export declare type SpruceAuth = (options: { userId?: string; organizationId?: string; locationId?: string; }) => string; export interface ISpruceEventContract { events: { [eventName: string]: { description: string; subscribe: boolean; }; }; } export default function SpruceConfig(baseDirectory: string): { /** * 🌲🤖 Your Skill ID */ ID: string | undefined; /** * 🌲🤖 When enabled FE code will be compiled lazily. This should be false in production */ DEV_MODE: boolean; /** * 🌲🤖 The event version to use * https://developer.spruce.ai/#/events */ EVENT_VERSION: number; /** * 🌲🤖 The view version to use */ VIEW_VERSION: string | number; /** * 🌲🤖 The current log level. Valid options are (in decending order): * fatal * crit * error * warn * info * debug * trace */ LOG_LEVEL: string; /** * 🌲🤖 If "false", logs will not add colors to the terminal */ LOG_USE_COLORS: boolean; /** * 🌲🤖 If "false", incoming event logs will be disabled */ LOG_EVENTS: boolean; /** * 🌲🤖 If true, tries to find the filename and line number * where the log originated. This should only be used locally. * When enabled, trace will increase memory and cpu usage. */ LOG_USE_TRACE: boolean; /** * 🌲🤖 If true, tries to use sourcemaps to find the filename and line number * where the log originated. This should only be used locally. * When enabled, trace will increase memory and cpu usage. */ LOG_USE_SOURCEMAPS: boolean; /** * 🌲🤖 If true, outputs logs as JSON */ LOG_AS_JSON: boolean; /** * 🌲🤖 If true, errors from the FE will be sent to the BE and logged in the terminal */ CAPTURE_FE_LOGS: boolean; METRICS_APP_KEY: string | undefined; METRICS_URL: string | undefined; METRICS_ENABLED: boolean; METRICS_BROWSER_STATS_ENABLED: boolean; METRICS_REQUESTS_DISABLED: boolean; METRICS_SERVER_STATS_DISABLED: boolean; METRICS_SEQUELIZE_DISABLED: boolean; /** * 🌲🤖 The Spruce API to use. You probably want: * https://api.spruce.ai */ API_HOST: string | undefined; /** * 🌲🤖 The GraphQL subscriptions URI. * This will look like: wss://my-skill.sprucebot.com/graphql */ GRAPHQL_SUBSCRIPTIONS_URI: string | undefined; /** * 🌲🤖 Enable GQL listeners. This is used when streaming data via GQL * subscriptions from the Spruce API */ GRAPHQL_LISTENERS_ENABLED: boolean; /** * 🌲🤖 The Spruce API GQL subscriptions URI * This will look like: wss://api.spruce.ai/graphql */ API_GRAPHQL_SUBSCRIPTIONS_URI: string | undefined; /** * 🌲🤖 Enable the UIEnhancement GQL endpoint for your skill. * Requires GRAPHQL_ENABLED to be true */ UI_ENHANCEMENTS_ENABLED: boolean; /** * 🌲🤖 Your Skill's API key. * This should be kept secret at all times */ API_KEY: string | undefined; /** * 🌲🤖 DEPRECATED. Option to override heartwood components stylesheet */ SKILL_STYLESHEET: string; /** * 🌲🤖 DEPRECATED. Option to import a legacy stylesheet for your skill */ LEGACY_SKILL_STYLESHEET: string | undefined; /** * 🌲🤖 The URL to a local sqlite DB that is used for testing */ DATABASE_URL_TESTING: string; /** * 🌲🤖 Your Skill's name */ NAME: string | undefined; /** * 🌲🤖 Your Skill's slug * This can not be changed after you register your skill. Changing this value * will NOT update your slug */ SLUG: string; /** * 🌲🤖 Your Skill's description */ DESCRIPTION: string | undefined; /** * 🌲🤖 The port to start up */ PORT: string | undefined; /** * 🌲🤖 The base url to your Skill's BE */ SERVER_HOST: string | undefined; /** * 🌲🤖 The vimeo video ID to show on your marketing page */ VIMEO_ID: string | undefined; /** * 🌲🤖 The base url to your Skill's FE */ INTERFACE_HOST: string | undefined; /** * 🌲🤖 If "true", ignores SSL errors when loading the FE */ INTERFACE_SSL_ALLOW_SELF_SIGNED: boolean; /** * 🌲🤖 If "true", ignores SSL errors when loading the BE */ API_SSL_ALLOW_SELF_SIGNED: boolean; WHITELABEL: string | undefined; /** * 🌲🤖 If "true", enables crons * See controllers/cron */ RUN_CRONS: boolean; /** * 🌲🤖 If "true", enables debug routes * This should only be enabled in local and development environments */ ENABLE_DEBUG_ROUTES: boolean; /** * 🌲🤖 The maximum depth to allow for GQL queries. Default 10 * See https://github.com/stems/graphql-depth-limit for more info */ GRAPHQL_MAX_DEPTH: number; /** * 🌲🤖 The maximum complexity to allow for GQL queries. Default 1500 */ GRAPHQL_MAX_COMPLEXITY: number; /** * 🌲🤖 Enable Skills database * More info: https://developer.spruce.ai/#/orm */ DB_ENABLED: boolean; /** * 🌲🤖 Enable GraphQL endpoints */ GRAPHQL_ENABLED: boolean; /** * 🌲🤖 Enable GraphQL debugging and docs */ GRAPHIQL_ENABLED: boolean; /** * 🌲🤖 This variable can be checked to determine if we're running * in a test environment. */ TESTING: boolean; /** * 🌲🤖 This is for kit testing at homebase. It lets us run the example tests to ensure everything is functioning 💯 when we ship a new version of the kit. */ TESTING_SKILLS_KIT: boolean; /** * 🌲🤖 The S3 bucket name for assets * TODO abstract S3_bucket out of here, utilize adapter based config */ S3_BUCKET: string; /** * 🌲🤖 Your skills package.json name */ PACKAGE_NAME: any; /** * 🌲🤖 Your skills package.json version */ PACKAGE_VERSION: any; /** * Special internal skills might set this to true. Most skills can ignore this setting. */ GLOBAL: boolean; gqlOptions: { gqlDir: string; }; sequelizeOptions: { enabled: boolean; runMigrations: boolean; modelsDir: string; migrationsDir: string; options: { logging: boolean | { (message?: any, ...optionalParams: any[]): void; (message?: any, ...optionalParams: any[]): void; }; }; }; bodyParserOptions: { jsonLimit: string; }; nextConfig: { dir: string; dev: boolean; quiet: boolean; }; ICON: string; /** * 🌲🤖 Defines scopes for your GQL endpoints * See config/scopes.ts */ scopes: scopesType; /** * 🌲🤖 Defines the data to pull on users when they authenticate * with your skill * See config/auth.ts */ auth: authType; /** * 🌲🤖 Defines your skill's settings that can be configured * See config/settings.ts */ settings: settingsType; /** * 🌲🤖 Defines the error codes your Skill might throw * See config/errors.ts */ errors: { UNKNOWN: { code: number; status: string; reason: string; friendlyReason: string; }; ROUTE_NOT_FOUND: { code: number; status: string; reason: string; friendlyReason: string; }; LOCATION_NOT_FOUND: { code: number; status: string; reason: string; friendlyReason: string; }; ORGANIZATION_NOT_FOUND: { code: number; status: string; reason: string; friendlyReason: string; }; USER_NOT_FOUND: { code: number; status: string; reason: string; friendlyReason: string; }; INVALID_AUTHENTICATION: { code: number; status: string; reason: string; friendlyReason: string; }; USER_NOT_LOGGED_IN: { code: number; status: string; reason: string; friendlyReason: string; }; NOT_AUTHORIZED: { code: number; status: string; reason: string; friendlyReason: string; }; LOADING_ONBOARDING_ERROR: { code: number; status: string; reason: string; friendlyReason: string; }; SAVE_ONBOARDING_ERROR: { code: number; status: string; reason: string; /** * 🌲🤖 The event version to use * https://developer.spruce.ai/#/events */ friendlyReason: string; }; INVALID_PAYLOAD: { code: number; status: string; reason: string; friendlyReason: string; }; NOT_IMPLEMENTED: { code: number; status: string; reason: string; friendlyReason: string; }; INVALID_FILE_FORMAT: { code: number; status: string; reason: string; friendlyReason: string; }; } & errorsType; /** * 🌲🤖 Defines the ACLs your skill provides and needs * See config/acl.ts */ acl: aclType; /** * 🌲🤖 Defines the events your Skill responds to * See config/eventContract.ts * https://developer.spruce.ai/#/events?id=step-1-event-contracts */ eventContract: eventContractType; /** * 🌲🤖 Defines UI enhancements that your skill provides and other areas it enhances * See config/uiEnhancementContract.ts * https://developer.spruce.ai/ */ uiEnhancementContract: UIEnhancementContractType; };