Provides an HTTP API to interact with SpaceCat data
https://opensource.adobe.com/spacecat-api-service/
$ npm run docs$ npm run docs:serve$ npm install @adobe/spacecat-api-serviceSee the API documentation.
To set up local development for spacecat-api-service, follow these steps:
- Create an
.envfile in your project root and define the following environment variables with your AWS credentials:
AWS_REGION=your_aws_region AWS_ACCESS_KEY_ID=your_access_key_id AWS_SECRET_ACCESS_KEY=your_secret_access_key AWS_SESSION_TOKEN=your_session_token USER_API_KEY=api_key_for_user_requests ADMIN_API_KEY=api_key_for_admin_requests - Start the development server
npm start $ npm install$ npm test$ npm run lintCurrently, audit worker requires two env variables:
AUDIT_JOBS_QUEUE_URL=url of the queue to send audit jobs to AUDIT_REPORT_SLACK_CHANNEL_ID=slack channel id to send the audit reports to RUM_DOMAIN_KEY=global domain key for the rum api SLACK_BOT_TOKEN=slack bot's token, Fulfillment worker requires the following env variable:
FULFILLMENT_EVENTS_QUEUE_URL=url of the queue to send fulfillment events to Organizations controller requires the following env variable:
SLACK_URL_WORKSPACE_EXTERNAL=url of the external Slack workspace, used to generate the Slack channel url Slack controller requires the following env variables:
IMS_CLIENT_ID=client id for the IMS API IMS_HOST=host for the IMS API IMS_CLIENT_CODE=client code for the IMS API IMS_CLIENT_SECRET=client secret for the IMS API SLACK_TOKEN_WORKSPACE_EXTERNAL_ELEVATED=Slack token for the external workspace, elevated permissions SLACK_OPS_CHANNEL_WORKSPACE_EXTERNAL=channel ID to use for operations messages in the external workspace AGENT_WORKFLOW_STATE_MACHINE_ARN=ARN of the generic agent Step Functions workflow (used by the brand-profile Slack command) Sandbox audit rate-limit (optional):
Minimum hours that must elapse before the same audit can run again for the same site. Default is 4 hrs. Set the variable to 0 to disable the rate-limit entirely.
SANDBOX_AUDIT_RATE_LIMIT_HOURS=4 Import controller requires the following env variables:
IMPORT_CONFIGURATION=JSON document which includes the following configuration properties: - allowedApiKeys: array of allowed API keys, used to authenticate import requests - queues: array of queue names to use for import jobs. If a queue name is removed from this array, it will no longer be available for new import jobs - queueUrlPrefix: prefix for import queue URLs (eg. https://sqs.us-east-1.amazonaws.com/1234567890/), used to create the complete queue URL for import jobs - s3Bucket: the S3 bucket to store import job artifacts The multipartFormData wrapper uses the following optional env variables:
MULTIPART_FORM_FILE_COUNT_LIMIT=Maximum number of files which can be included in a multipart/form-data request (defaults to 5) MULTIPART_FORM_MAX_FILE_SIZE_MB=Maximum file size in MB for a single file in a multipart/form-data request (defaults to 20)