Skip to content

Edge Delivery services experience success as a service automation: SpaceCat + Star Catalogue

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.txt
Notifications You must be signed in to change notification settings

adobe/spacecat-api-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,710 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SpaceCat API Service

Provides an HTTP API to interact with SpaceCat data

HTTP API Doc

https://opensource.adobe.com/spacecat-api-service/

Build documentation locally

$ npm run docs

Serve the documentation locally

$ npm run docs:serve

Installation

$ npm install @adobe/spacecat-api-service

Usage

See the API documentation.

Development

To set up local development for spacecat-api-service, follow these steps:

  1. Create an .env file 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
  1. Start the development server
npm start

Build

$ npm install

Test

$ npm test

E2E Tests

End-to-end tests validate the API against the live CI environment.

Setup

Add the following to your .env file:

USER_API_KEY=your_api_key_for_ci_environment

The E2E tests use a hardcoded test site ID and auto-discover opportunities/suggestions for testing. (You can change site id according to you)

Run E2E Tests Locally

$ npm run test-e2e

Lint

$ npm run lint

Required ENV Variables

Currently, 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)

LLMO onboarding requires the following env variable:

SLACK_LLMO_ALERTS_CHANNEL_ID=slack channel id for LLMO onboarding alerts (data folder exists, site already assigned)

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)

About

Edge Delivery services experience success as a service automation: SpaceCat + Star Catalogue

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.txt

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 90