@sprucelabs/spruce-cli 16.0.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [17.0.0](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v16.0.0...v17.0.0) (2022-05-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Breaking Changes
|
|
10
|
+
|
|
11
|
+
* upgrade ([43df2f5](https://github.com/sprucelabsai/spruce-cli-workspace/commit/43df2f5))
|
|
12
|
+
* upgrade ([02ccd4a](https://github.com/sprucelabsai/spruce-cli-workspace/commit/02ccd4a))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# [16.0.0](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v15.4.12...v16.0.0) (2022-05-24)
|
|
7
19
|
|
|
8
20
|
|
|
@@ -15,7 +15,7 @@ export declare const coreSchemas: {
|
|
|
15
15
|
messageSourceSchema: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.MessageSourceSchema;
|
|
16
16
|
messageTargetSchema: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.MessageTargetSchema;
|
|
17
17
|
sendMessageSchema: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.SendMessageSchema;
|
|
18
|
-
|
|
18
|
+
choiceSchema: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.ChoiceSchema;
|
|
19
19
|
linkSchema: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.LinkSchema;
|
|
20
20
|
};
|
|
21
21
|
export interface SchemasByNamespace {
|
|
@@ -66,7 +66,7 @@ var coreSchemas = {
|
|
|
66
66
|
messageSourceSchema: _spruceCoreSchemas.messageSourceSchema,
|
|
67
67
|
messageTargetSchema: _spruceCoreSchemas.messageTargetSchema,
|
|
68
68
|
sendMessageSchema: _spruceCoreSchemas.sendMessageSchema,
|
|
69
|
-
|
|
69
|
+
choiceSchema: _spruceCoreSchemas.choiceSchema,
|
|
70
70
|
linkSchema: _spruceCoreSchemas.linkSchema
|
|
71
71
|
};
|
|
72
72
|
exports.coreSchemas = coreSchemas;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaStore.js","names":["coreSchemas","personSchema","skillSchema","skillCreatorSchema","locationSchema","organizationSchema","personOrganizationSchema","personLocationSchema","roleSchema","messageSchema","messageSourceSchema","messageTargetSchema","sendMessageSchema","choicesSchema","linkSchema","DEFAULT_LOCAL_SCHEMA_DIR","SchemaStore","options","localSchemaLookupDir","localSchemaDir","shouldFetchLocalSchemas","shouldFetchRemoteSchemas","shouldEnableVersioning","localNamespace","shouldFetchCoreSchemas","didUpdateHandler","moduleToImportFromWhenRemote","results","errors","schemasByNamespace","CORE_NAMESPACE","Object","values","map","schema","namespace","loadLocalSchemas","locals","schemas","forEach","local","push","emitDidFetchSchemasAndMixinResults","emitter","emit","remoteResults","eventResponseUtil","getAllResponsePayloadsAndErrors","SpruceError","payloads","length","payload","mixinSchemaOrThrowIfExists","idWithVersion","normalizeSchemaToIdWithVersion","match","find","s","isEqual","globbyLocalBuilders","matches","localLookupDir","localMatches","importer","Service","bulkImport","imported","c","version","resolveLocalVersion","prepareLocalSchema","err","code","file","originalError","globby","diskUtil","resolvePath","cwd","undefined","versionUtil","extractVersion","constValue","friendlyMessage","generateVersion","dirValue","SchemaError","schemaId","id","localAddonsDir","coreAddons","fieldRegistrations","registration","isLocal","localErrors","Promise","pathUtil","join","importService","importDefault","path","all","localAddons","allFields","uniqBy","filter","addon","fields","AbstractStore"],"sources":["../../../../src/features/schema/stores/SchemaStore.ts"],"sourcesContent":["import pathUtil from 'path'\nimport {\n\tSchema,\n\tFieldRegistration,\n\tfieldRegistrations,\n\tnormalizeSchemaToIdWithVersion,\n\tSchemaError,\n} from '@sprucelabs/schema'\nimport {\n\tpersonSchema,\n\tskillSchema,\n\tskillCreatorSchema,\n\tlocationSchema,\n\torganizationSchema,\n\tpersonOrganizationSchema,\n\tpersonLocationSchema,\n\troleSchema,\n\tmessageSchema,\n\tmessageSourceSchema,\n\tmessageTargetSchema,\n\tsendMessageSchema,\n\tchoicesSchema,\n\tlinkSchema,\n} from '@sprucelabs/spruce-core-schemas'\nimport { eventResponseUtil } from '@sprucelabs/spruce-event-utils'\nimport { versionUtil } from '@sprucelabs/spruce-skill-utils'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { CORE_NAMESPACE } from '@sprucelabs/spruce-skill-utils'\nimport globby from 'globby'\nimport { isEqual, uniqBy } from 'lodash'\nimport SpruceError from '../../../errors/SpruceError'\nimport AbstractStore from '../../../stores/AbstractStore'\nimport { InternalUpdateHandler } from '../../../types/cli.types'\n\nexport const coreSchemas = {\n\tpersonSchema,\n\tskillSchema,\n\tskillCreatorSchema,\n\tlocationSchema,\n\torganizationSchema,\n\tpersonOrganizationSchema,\n\tpersonLocationSchema,\n\troleSchema,\n\tmessageSchema,\n\tmessageSourceSchema,\n\tmessageTargetSchema,\n\tsendMessageSchema,\n\tchoicesSchema,\n\tlinkSchema,\n}\n\ninterface AddonItem {\n\tpath: string\n\tregistration: FieldRegistration\n\tisLocal: boolean\n}\n\nexport interface SchemasByNamespace {\n\t[namespace: string]: Schema[]\n}\n\ninterface FetchSchemasResults {\n\tschemasByNamespace: SchemasByNamespace\n\terrors: SpruceError[]\n}\nexport interface FetchedField {\n\tpath?: string\n\tregistration: FieldRegistration\n\tisLocal: boolean\n}\n\ninterface FetchFieldsResults {\n\terrors: SpruceError[]\n\tfields: FetchedField[]\n}\n\nconst DEFAULT_LOCAL_SCHEMA_DIR = 'src/schemas'\n\nexport default class SchemaStore extends AbstractStore {\n\tpublic readonly name = 'schema'\n\n\tpublic async fetchSchemas(options: {\n\t\tlocalSchemaLookupDir?: string\n\t\tshouldFetchRemoteSchemas?: boolean\n\t\tshouldEnableVersioning?: boolean\n\t\tlocalNamespace: string\n\t\tshouldFetchCoreSchemas?: boolean\n\t\tmoduleToImportFromWhenRemote?: string\n\t\tshouldFetchLocalSchemas?: boolean\n\t\tdidUpdateHandler?: InternalUpdateHandler\n\t}): Promise<FetchSchemasResults> {\n\t\tconst {\n\t\t\tlocalSchemaLookupDir: localSchemaDir = DEFAULT_LOCAL_SCHEMA_DIR,\n\t\t\tshouldFetchLocalSchemas = true,\n\t\t\tshouldFetchRemoteSchemas = true,\n\t\t\tshouldEnableVersioning = true,\n\t\t\tlocalNamespace,\n\t\t\tshouldFetchCoreSchemas = true,\n\t\t\tdidUpdateHandler,\n\t\t\tmoduleToImportFromWhenRemote,\n\t\t} = options || {}\n\n\t\tconst results: FetchSchemasResults = {\n\t\t\terrors: [],\n\t\t\tschemasByNamespace: {},\n\t\t}\n\n\t\tif (shouldFetchCoreSchemas) {\n\t\t\tresults.schemasByNamespace[CORE_NAMESPACE] = Object.values(\n\t\t\t\tcoreSchemas\n\t\t\t).map((schema) => ({\n\t\t\t\t...schema,\n\t\t\t\tnamespace: CORE_NAMESPACE,\n\t\t\t}))\n\t\t}\n\n\t\tif (shouldFetchLocalSchemas) {\n\t\t\tconst locals = await this.loadLocalSchemas(\n\t\t\t\tlocalSchemaDir,\n\t\t\t\tlocalNamespace,\n\t\t\t\tshouldEnableVersioning,\n\t\t\t\tdidUpdateHandler\n\t\t\t)\n\n\t\t\tif (moduleToImportFromWhenRemote) {\n\t\t\t\tlocals.schemas.forEach((local) => {\n\t\t\t\t\tlocal.moduleToImportFromWhenRemote = moduleToImportFromWhenRemote\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tresults.schemasByNamespace[localNamespace] = locals.schemas\n\t\t\tresults.errors.push(...locals.errors)\n\t\t}\n\n\t\tif (shouldFetchRemoteSchemas) {\n\t\t\tawait this.emitDidFetchSchemasAndMixinResults(localNamespace, results)\n\t\t}\n\n\t\treturn results\n\t}\n\n\tprivate async emitDidFetchSchemasAndMixinResults(\n\t\tlocalNamespace: string,\n\t\tresults: FetchSchemasResults\n\t) {\n\t\tconst schemas: Schema[] = []\n\t\tfor (const namespace in results.schemasByNamespace) {\n\t\t\tschemas.push(...results.schemasByNamespace[namespace])\n\t\t}\n\n\t\tconst remoteResults = await this.emitter.emit('schema.did-fetch-schemas', {\n\t\t\tschemas,\n\t\t})\n\n\t\tconst { payloads, errors } =\n\t\t\teventResponseUtil.getAllResponsePayloadsAndErrors(\n\t\t\t\tremoteResults,\n\t\t\t\tSpruceError\n\t\t\t)\n\n\t\tif (errors && errors.length > 0) {\n\t\t\tresults.errors.push(...errors)\n\t\t} else {\n\t\t\tpayloads.forEach((payload) => {\n\t\t\t\tpayload?.schemas?.forEach((schema: Schema) => {\n\t\t\t\t\tthis.mixinSchemaOrThrowIfExists(schema, localNamespace, results)\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate mixinSchemaOrThrowIfExists(\n\t\tschema: Schema,\n\t\tlocalNamespace: string,\n\t\tresults: FetchSchemasResults\n\t) {\n\t\tconst namespace = schema.namespace ?? localNamespace\n\n\t\tif (!results.schemasByNamespace[namespace]) {\n\t\t\tresults.schemasByNamespace[namespace] = []\n\t\t}\n\n\t\tconst idWithVersion = normalizeSchemaToIdWithVersion(schema)\n\t\tconst match = results.schemasByNamespace[namespace].find((s) =>\n\t\t\tisEqual(normalizeSchemaToIdWithVersion(s), idWithVersion)\n\t\t)\n\n\t\tif (!match) {\n\t\t\tresults.schemasByNamespace[namespace].push(schema)\n\t\t}\n\t}\n\n\tpublic async hasLocalSchemas() {\n\t\tconst matches = await this.globbyLocalBuilders(DEFAULT_LOCAL_SCHEMA_DIR)\n\t\treturn matches.length > 0\n\t}\n\n\tprivate async loadLocalSchemas(\n\t\tlocalLookupDir: string,\n\t\tlocalNamespace: string,\n\t\tshouldEnableVersioning?: boolean,\n\t\tdidUpdateHandler?: InternalUpdateHandler\n\t) {\n\t\tconst localMatches = await this.globbyLocalBuilders(localLookupDir)\n\n\t\tconst errors: SpruceError[] = []\n\t\tconst schemas: Schema[] = []\n\n\t\tdidUpdateHandler?.(\n\t\t\t`Starting import of ${localMatches.length} schema builders...`\n\t\t)\n\n\t\ttry {\n\t\t\tconst importer = this.Service('import')\n\t\t\tconst imported = await importer.bulkImport(localMatches)\n\n\t\t\tfor (let c = 0; c < localMatches.length; c++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst local = localMatches[c]\n\t\t\t\t\tlet schema = imported[c]\n\n\t\t\t\t\tlet version: undefined | string = this.resolveLocalVersion(\n\t\t\t\t\t\tshouldEnableVersioning,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\terrors\n\t\t\t\t\t)\n\t\t\t\t\tif (version || shouldEnableVersioning === false) {\n\t\t\t\t\t\tschema = this.prepareLocalSchema(\n\t\t\t\t\t\t\tschema,\n\t\t\t\t\t\t\tlocalNamespace,\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t\tdidUpdateHandler\n\t\t\t\t\t\t)\n\t\t\t\t\t\tschemas.push(schema)\n\t\t\t\t\t}\n\t\t\t\t} catch (err: any) {\n\t\t\t\t\terrors.push(\n\t\t\t\t\t\tnew SpruceError({\n\t\t\t\t\t\t\tcode: 'SCHEMA_FAILED_TO_IMPORT',\n\t\t\t\t\t\t\tfile: err?.options?.file ?? '**UNKNOWN**',\n\t\t\t\t\t\t\toriginalError: err?.originalError ?? err,\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err: any) {\n\t\t\tthrow new SpruceError({\n\t\t\t\tcode: 'SCHEMA_FAILED_TO_IMPORT',\n\t\t\t\tfile: err?.options?.file ?? '**UNKNOWN**',\n\t\t\t\toriginalError: err?.originalError ?? err,\n\t\t\t})\n\t\t}\n\n\t\treturn {\n\t\t\tschemas,\n\t\t\terrors,\n\t\t}\n\t}\n\n\tprivate async globbyLocalBuilders(localLookupDir: string) {\n\t\treturn await globby(\n\t\t\tdiskUtil.resolvePath(this.cwd, localLookupDir, '**/*.builder.[t|j]s')\n\t\t)\n\t}\n\n\tprivate resolveLocalVersion(\n\t\tshouldEnableVersioning: boolean | undefined,\n\t\tlocal: string,\n\t\terrors: SpruceError[]\n\t) {\n\t\tlet version: undefined | string\n\n\t\ttry {\n\t\t\tversion =\n\t\t\t\tshouldEnableVersioning === false\n\t\t\t\t\t? undefined\n\t\t\t\t\t: versionUtil.extractVersion(this.cwd, local).constValue\n\t\t} catch (err) {\n\t\t\terrors.push(\n\t\t\t\tnew SpruceError({\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tcode: 'VERSION_MISSING',\n\t\t\t\t\tfriendlyMessage: `It looks like your schema's are not versioned. Make sure schemas are in a directory like src/schemas/${\n\t\t\t\t\t\tversionUtil.generateVersion().dirValue\n\t\t\t\t\t}/*.ts`,\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\t\treturn version\n\t}\n\n\tprivate prepareLocalSchema(\n\t\tschema: Schema,\n\t\tlocalNamespace: string,\n\t\tversion: string | undefined,\n\t\tdidUpdateHandler: InternalUpdateHandler | undefined\n\t) {\n\t\tlet errors: string[] = []\n\n\t\tif (schema.version) {\n\t\t\terrors.push('version_should_not_be_set')\n\t\t}\n\n\t\tif (schema.namespace) {\n\t\t\terrors.push('namespace_should_not_be_set')\n\t\t}\n\n\t\tschema.namespace = localNamespace\n\n\t\tif (errors.length > 0) {\n\t\t\tthrow new SchemaError({\n\t\t\t\tcode: 'INVALID_SCHEMA',\n\t\t\t\tschemaId: schema.id,\n\t\t\t\terrors,\n\t\t\t\tfriendlyMessage:\n\t\t\t\t\t'You should not set a namespace nor version in your schema builder.',\n\t\t\t})\n\t\t}\n\n\t\tschema.version = version\n\n\t\tdidUpdateHandler?.(`Imported ${schema.id} builder.`)\n\n\t\treturn schema\n\t}\n\n\tpublic async fetchFields(options?: {\n\t\tlocalAddonsDir?: string\n\t}): Promise<FetchFieldsResults> {\n\t\tconst { localAddonsDir } = options || {}\n\n\t\tconst coreAddons = fieldRegistrations.map((registration) => {\n\t\t\treturn {\n\t\t\t\tregistration,\n\t\t\t\tisLocal: false,\n\t\t\t}\n\t\t})\n\n\t\tconst localErrors: SpruceError[] = []\n\n\t\tconst localAddons = !localAddonsDir\n\t\t\t? []\n\t\t\t: await Promise.all(\n\t\t\t\t\t(\n\t\t\t\t\t\tawait globby([\n\t\t\t\t\t\t\tpathUtil.join(localAddonsDir, '/*Field.addon.[t|j]s'),\n\t\t\t\t\t\t])\n\t\t\t\t\t).map(async (file: string) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst importService = this.Service('import')\n\t\t\t\t\t\t\tconst registration =\n\t\t\t\t\t\t\t\tawait importService.importDefault<FieldRegistration>(file)\n\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tpath: file,\n\t\t\t\t\t\t\t\tregistration,\n\t\t\t\t\t\t\t\tisLocal: true,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (err: any) {\n\t\t\t\t\t\t\tlocalErrors.push(\n\t\t\t\t\t\t\t\tnew SpruceError({\n\t\t\t\t\t\t\t\t\tcode: 'FAILED_TO_IMPORT',\n\t\t\t\t\t\t\t\t\tfile,\n\t\t\t\t\t\t\t\t\toriginalError: err,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t )\n\n\t\tconst allFields = uniqBy(\n\t\t\t[\n\t\t\t\t...coreAddons,\n\t\t\t\t...(localAddons.filter((addon) => !!addon) as AddonItem[]),\n\t\t\t],\n\t\t\t'registration.type'\n\t\t)\n\n\t\treturn {\n\t\t\tfields: allFields,\n\t\t\terrors: localErrors,\n\t\t}\n\t}\n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AEJ,SADF;kBAEN3E,MAAM,EAAEkE;gBAFF,CArDR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EAxPwCc,0B"}
|
|
1
|
+
{"version":3,"file":"SchemaStore.js","names":["coreSchemas","personSchema","skillSchema","skillCreatorSchema","locationSchema","organizationSchema","personOrganizationSchema","personLocationSchema","roleSchema","messageSchema","messageSourceSchema","messageTargetSchema","sendMessageSchema","choiceSchema","linkSchema","DEFAULT_LOCAL_SCHEMA_DIR","SchemaStore","options","localSchemaLookupDir","localSchemaDir","shouldFetchLocalSchemas","shouldFetchRemoteSchemas","shouldEnableVersioning","localNamespace","shouldFetchCoreSchemas","didUpdateHandler","moduleToImportFromWhenRemote","results","errors","schemasByNamespace","CORE_NAMESPACE","Object","values","map","schema","namespace","loadLocalSchemas","locals","schemas","forEach","local","push","emitDidFetchSchemasAndMixinResults","emitter","emit","remoteResults","eventResponseUtil","getAllResponsePayloadsAndErrors","SpruceError","payloads","length","payload","mixinSchemaOrThrowIfExists","idWithVersion","normalizeSchemaToIdWithVersion","match","find","s","isEqual","globbyLocalBuilders","matches","localLookupDir","localMatches","importer","Service","bulkImport","imported","c","version","resolveLocalVersion","prepareLocalSchema","err","code","file","originalError","globby","diskUtil","resolvePath","cwd","undefined","versionUtil","extractVersion","constValue","friendlyMessage","generateVersion","dirValue","SchemaError","schemaId","id","localAddonsDir","coreAddons","fieldRegistrations","registration","isLocal","localErrors","Promise","pathUtil","join","importService","importDefault","path","all","localAddons","allFields","uniqBy","filter","addon","fields","AbstractStore"],"sources":["../../../../src/features/schema/stores/SchemaStore.ts"],"sourcesContent":["import pathUtil from 'path'\nimport {\n\tSchema,\n\tFieldRegistration,\n\tfieldRegistrations,\n\tnormalizeSchemaToIdWithVersion,\n\tSchemaError,\n} from '@sprucelabs/schema'\nimport {\n\tpersonSchema,\n\tskillSchema,\n\tskillCreatorSchema,\n\tlocationSchema,\n\torganizationSchema,\n\tpersonOrganizationSchema,\n\tpersonLocationSchema,\n\troleSchema,\n\tmessageSchema,\n\tmessageSourceSchema,\n\tmessageTargetSchema,\n\tsendMessageSchema,\n\tchoiceSchema,\n\tlinkSchema,\n} from '@sprucelabs/spruce-core-schemas'\nimport { eventResponseUtil } from '@sprucelabs/spruce-event-utils'\nimport { versionUtil } from '@sprucelabs/spruce-skill-utils'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { CORE_NAMESPACE } from '@sprucelabs/spruce-skill-utils'\nimport globby from 'globby'\nimport { isEqual, uniqBy } from 'lodash'\nimport SpruceError from '../../../errors/SpruceError'\nimport AbstractStore from '../../../stores/AbstractStore'\nimport { InternalUpdateHandler } from '../../../types/cli.types'\n\nexport const coreSchemas = {\n\tpersonSchema,\n\tskillSchema,\n\tskillCreatorSchema,\n\tlocationSchema,\n\torganizationSchema,\n\tpersonOrganizationSchema,\n\tpersonLocationSchema,\n\troleSchema,\n\tmessageSchema,\n\tmessageSourceSchema,\n\tmessageTargetSchema,\n\tsendMessageSchema,\n\tchoiceSchema,\n\tlinkSchema,\n}\n\ninterface AddonItem {\n\tpath: string\n\tregistration: FieldRegistration\n\tisLocal: boolean\n}\n\nexport interface SchemasByNamespace {\n\t[namespace: string]: Schema[]\n}\n\ninterface FetchSchemasResults {\n\tschemasByNamespace: SchemasByNamespace\n\terrors: SpruceError[]\n}\nexport interface FetchedField {\n\tpath?: string\n\tregistration: FieldRegistration\n\tisLocal: boolean\n}\n\ninterface FetchFieldsResults {\n\terrors: SpruceError[]\n\tfields: FetchedField[]\n}\n\nconst DEFAULT_LOCAL_SCHEMA_DIR = 'src/schemas'\n\nexport default class SchemaStore extends AbstractStore {\n\tpublic readonly name = 'schema'\n\n\tpublic async fetchSchemas(options: {\n\t\tlocalSchemaLookupDir?: string\n\t\tshouldFetchRemoteSchemas?: boolean\n\t\tshouldEnableVersioning?: boolean\n\t\tlocalNamespace: string\n\t\tshouldFetchCoreSchemas?: boolean\n\t\tmoduleToImportFromWhenRemote?: string\n\t\tshouldFetchLocalSchemas?: boolean\n\t\tdidUpdateHandler?: InternalUpdateHandler\n\t}): Promise<FetchSchemasResults> {\n\t\tconst {\n\t\t\tlocalSchemaLookupDir: localSchemaDir = DEFAULT_LOCAL_SCHEMA_DIR,\n\t\t\tshouldFetchLocalSchemas = true,\n\t\t\tshouldFetchRemoteSchemas = true,\n\t\t\tshouldEnableVersioning = true,\n\t\t\tlocalNamespace,\n\t\t\tshouldFetchCoreSchemas = true,\n\t\t\tdidUpdateHandler,\n\t\t\tmoduleToImportFromWhenRemote,\n\t\t} = options || {}\n\n\t\tconst results: FetchSchemasResults = {\n\t\t\terrors: [],\n\t\t\tschemasByNamespace: {},\n\t\t}\n\n\t\tif (shouldFetchCoreSchemas) {\n\t\t\tresults.schemasByNamespace[CORE_NAMESPACE] = Object.values(\n\t\t\t\tcoreSchemas\n\t\t\t).map((schema) => ({\n\t\t\t\t...schema,\n\t\t\t\tnamespace: CORE_NAMESPACE,\n\t\t\t}))\n\t\t}\n\n\t\tif (shouldFetchLocalSchemas) {\n\t\t\tconst locals = await this.loadLocalSchemas(\n\t\t\t\tlocalSchemaDir,\n\t\t\t\tlocalNamespace,\n\t\t\t\tshouldEnableVersioning,\n\t\t\t\tdidUpdateHandler\n\t\t\t)\n\n\t\t\tif (moduleToImportFromWhenRemote) {\n\t\t\t\tlocals.schemas.forEach((local) => {\n\t\t\t\t\tlocal.moduleToImportFromWhenRemote = moduleToImportFromWhenRemote\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tresults.schemasByNamespace[localNamespace] = locals.schemas\n\t\t\tresults.errors.push(...locals.errors)\n\t\t}\n\n\t\tif (shouldFetchRemoteSchemas) {\n\t\t\tawait this.emitDidFetchSchemasAndMixinResults(localNamespace, results)\n\t\t}\n\n\t\treturn results\n\t}\n\n\tprivate async emitDidFetchSchemasAndMixinResults(\n\t\tlocalNamespace: string,\n\t\tresults: FetchSchemasResults\n\t) {\n\t\tconst schemas: Schema[] = []\n\t\tfor (const namespace in results.schemasByNamespace) {\n\t\t\tschemas.push(...results.schemasByNamespace[namespace])\n\t\t}\n\n\t\tconst remoteResults = await this.emitter.emit('schema.did-fetch-schemas', {\n\t\t\tschemas,\n\t\t})\n\n\t\tconst { payloads, errors } =\n\t\t\teventResponseUtil.getAllResponsePayloadsAndErrors(\n\t\t\t\tremoteResults,\n\t\t\t\tSpruceError\n\t\t\t)\n\n\t\tif (errors && errors.length > 0) {\n\t\t\tresults.errors.push(...errors)\n\t\t} else {\n\t\t\tpayloads.forEach((payload) => {\n\t\t\t\tpayload?.schemas?.forEach((schema: Schema) => {\n\t\t\t\t\tthis.mixinSchemaOrThrowIfExists(schema, localNamespace, results)\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate mixinSchemaOrThrowIfExists(\n\t\tschema: Schema,\n\t\tlocalNamespace: string,\n\t\tresults: FetchSchemasResults\n\t) {\n\t\tconst namespace = schema.namespace ?? localNamespace\n\n\t\tif (!results.schemasByNamespace[namespace]) {\n\t\t\tresults.schemasByNamespace[namespace] = []\n\t\t}\n\n\t\tconst idWithVersion = normalizeSchemaToIdWithVersion(schema)\n\t\tconst match = results.schemasByNamespace[namespace].find((s) =>\n\t\t\tisEqual(normalizeSchemaToIdWithVersion(s), idWithVersion)\n\t\t)\n\n\t\tif (!match) {\n\t\t\tresults.schemasByNamespace[namespace].push(schema)\n\t\t}\n\t}\n\n\tpublic async hasLocalSchemas() {\n\t\tconst matches = await this.globbyLocalBuilders(DEFAULT_LOCAL_SCHEMA_DIR)\n\t\treturn matches.length > 0\n\t}\n\n\tprivate async loadLocalSchemas(\n\t\tlocalLookupDir: string,\n\t\tlocalNamespace: string,\n\t\tshouldEnableVersioning?: boolean,\n\t\tdidUpdateHandler?: InternalUpdateHandler\n\t) {\n\t\tconst localMatches = await this.globbyLocalBuilders(localLookupDir)\n\n\t\tconst errors: SpruceError[] = []\n\t\tconst schemas: Schema[] = []\n\n\t\tdidUpdateHandler?.(\n\t\t\t`Starting import of ${localMatches.length} schema builders...`\n\t\t)\n\n\t\ttry {\n\t\t\tconst importer = this.Service('import')\n\t\t\tconst imported = await importer.bulkImport(localMatches)\n\n\t\t\tfor (let c = 0; c < localMatches.length; c++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst local = localMatches[c]\n\t\t\t\t\tlet schema = imported[c]\n\n\t\t\t\t\tlet version: undefined | string = this.resolveLocalVersion(\n\t\t\t\t\t\tshouldEnableVersioning,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\terrors\n\t\t\t\t\t)\n\t\t\t\t\tif (version || shouldEnableVersioning === false) {\n\t\t\t\t\t\tschema = this.prepareLocalSchema(\n\t\t\t\t\t\t\tschema,\n\t\t\t\t\t\t\tlocalNamespace,\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t\tdidUpdateHandler\n\t\t\t\t\t\t)\n\t\t\t\t\t\tschemas.push(schema)\n\t\t\t\t\t}\n\t\t\t\t} catch (err: any) {\n\t\t\t\t\terrors.push(\n\t\t\t\t\t\tnew SpruceError({\n\t\t\t\t\t\t\tcode: 'SCHEMA_FAILED_TO_IMPORT',\n\t\t\t\t\t\t\tfile: err?.options?.file ?? '**UNKNOWN**',\n\t\t\t\t\t\t\toriginalError: err?.originalError ?? err,\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err: any) {\n\t\t\tthrow new SpruceError({\n\t\t\t\tcode: 'SCHEMA_FAILED_TO_IMPORT',\n\t\t\t\tfile: err?.options?.file ?? '**UNKNOWN**',\n\t\t\t\toriginalError: err?.originalError ?? err,\n\t\t\t})\n\t\t}\n\n\t\treturn {\n\t\t\tschemas,\n\t\t\terrors,\n\t\t}\n\t}\n\n\tprivate async globbyLocalBuilders(localLookupDir: string) {\n\t\treturn await globby(\n\t\t\tdiskUtil.resolvePath(this.cwd, localLookupDir, '**/*.builder.[t|j]s')\n\t\t)\n\t}\n\n\tprivate resolveLocalVersion(\n\t\tshouldEnableVersioning: boolean | undefined,\n\t\tlocal: string,\n\t\terrors: SpruceError[]\n\t) {\n\t\tlet version: undefined | string\n\n\t\ttry {\n\t\t\tversion =\n\t\t\t\tshouldEnableVersioning === false\n\t\t\t\t\t? undefined\n\t\t\t\t\t: versionUtil.extractVersion(this.cwd, local).constValue\n\t\t} catch (err) {\n\t\t\terrors.push(\n\t\t\t\tnew SpruceError({\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tcode: 'VERSION_MISSING',\n\t\t\t\t\tfriendlyMessage: `It looks like your schema's are not versioned. Make sure schemas are in a directory like src/schemas/${\n\t\t\t\t\t\tversionUtil.generateVersion().dirValue\n\t\t\t\t\t}/*.ts`,\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\t\treturn version\n\t}\n\n\tprivate prepareLocalSchema(\n\t\tschema: Schema,\n\t\tlocalNamespace: string,\n\t\tversion: string | undefined,\n\t\tdidUpdateHandler: InternalUpdateHandler | undefined\n\t) {\n\t\tlet errors: string[] = []\n\n\t\tif (schema.version) {\n\t\t\terrors.push('version_should_not_be_set')\n\t\t}\n\n\t\tif (schema.namespace) {\n\t\t\terrors.push('namespace_should_not_be_set')\n\t\t}\n\n\t\tschema.namespace = localNamespace\n\n\t\tif (errors.length > 0) {\n\t\t\tthrow new SchemaError({\n\t\t\t\tcode: 'INVALID_SCHEMA',\n\t\t\t\tschemaId: schema.id,\n\t\t\t\terrors,\n\t\t\t\tfriendlyMessage:\n\t\t\t\t\t'You should not set a namespace nor version in your schema builder.',\n\t\t\t})\n\t\t}\n\n\t\tschema.version = version\n\n\t\tdidUpdateHandler?.(`Imported ${schema.id} builder.`)\n\n\t\treturn schema\n\t}\n\n\tpublic async fetchFields(options?: {\n\t\tlocalAddonsDir?: string\n\t}): Promise<FetchFieldsResults> {\n\t\tconst { localAddonsDir } = options || {}\n\n\t\tconst coreAddons = fieldRegistrations.map((registration) => {\n\t\t\treturn {\n\t\t\t\tregistration,\n\t\t\t\tisLocal: false,\n\t\t\t}\n\t\t})\n\n\t\tconst localErrors: SpruceError[] = []\n\n\t\tconst localAddons = !localAddonsDir\n\t\t\t? []\n\t\t\t: await Promise.all(\n\t\t\t\t\t(\n\t\t\t\t\t\tawait globby([\n\t\t\t\t\t\t\tpathUtil.join(localAddonsDir, '/*Field.addon.[t|j]s'),\n\t\t\t\t\t\t])\n\t\t\t\t\t).map(async (file: string) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst importService = this.Service('import')\n\t\t\t\t\t\t\tconst registration =\n\t\t\t\t\t\t\t\tawait importService.importDefault<FieldRegistration>(file)\n\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tpath: file,\n\t\t\t\t\t\t\t\tregistration,\n\t\t\t\t\t\t\t\tisLocal: true,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (err: any) {\n\t\t\t\t\t\t\tlocalErrors.push(\n\t\t\t\t\t\t\t\tnew SpruceError({\n\t\t\t\t\t\t\t\t\tcode: 'FAILED_TO_IMPORT',\n\t\t\t\t\t\t\t\t\tfile,\n\t\t\t\t\t\t\t\t\toriginalError: err,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t )\n\n\t\tconst allFields = uniqBy(\n\t\t\t[\n\t\t\t\t...coreAddons,\n\t\t\t\t...(localAddons.filter((addon) => !!addon) as AddonItem[]),\n\t\t\t],\n\t\t\t'registration.type'\n\t\t)\n\n\t\treturn {\n\t\t\tfields: allFields,\n\t\t\terrors: localErrors,\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAOA;;AAgBA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;AAGO,IAAMA,WAAW,GAAG;EAC1BC,YAAY,EAAZA,+BAD0B;EAE1BC,WAAW,EAAXA,8BAF0B;EAG1BC,kBAAkB,EAAlBA,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version": "
|
|
21
|
+
"version": "17.0.0",
|
|
22
22
|
"bin": {
|
|
23
23
|
"spruce": "./build/index.js"
|
|
24
24
|
},
|
|
@@ -77,18 +77,18 @@
|
|
|
77
77
|
"@babel/runtime": "^7.18.0",
|
|
78
78
|
"@jest/reporters": "^28.1.0",
|
|
79
79
|
"@sprucelabs/error": "^5.0.459",
|
|
80
|
-
"@sprucelabs/heartwood-view-controllers": "^
|
|
80
|
+
"@sprucelabs/heartwood-view-controllers": "^75.0.0",
|
|
81
81
|
"@sprucelabs/jest-json-reporter": "^6.0.387",
|
|
82
|
-
"@sprucelabs/mercury-client": "^
|
|
83
|
-
"@sprucelabs/mercury-event-emitter": "^
|
|
84
|
-
"@sprucelabs/mercury-types": "^
|
|
82
|
+
"@sprucelabs/mercury-client": "^26.0.0",
|
|
83
|
+
"@sprucelabs/mercury-event-emitter": "^26.0.0",
|
|
84
|
+
"@sprucelabs/mercury-types": "^30.0.0",
|
|
85
85
|
"@sprucelabs/schema": "^28.2.14",
|
|
86
|
-
"@sprucelabs/spruce-core-schemas": "^
|
|
87
|
-
"@sprucelabs/spruce-event-plugin": "^
|
|
88
|
-
"@sprucelabs/spruce-event-utils": "^
|
|
89
|
-
"@sprucelabs/spruce-skill-booter": "^
|
|
86
|
+
"@sprucelabs/spruce-core-schemas": "^29.0.1",
|
|
87
|
+
"@sprucelabs/spruce-event-plugin": "^33.0.0",
|
|
88
|
+
"@sprucelabs/spruce-event-utils": "^21.0.0",
|
|
89
|
+
"@sprucelabs/spruce-skill-booter": "^33.0.0",
|
|
90
90
|
"@sprucelabs/spruce-skill-utils": "^26.0.39",
|
|
91
|
-
"@sprucelabs/spruce-templates": "^
|
|
91
|
+
"@sprucelabs/spruce-templates": "^17.0.0",
|
|
92
92
|
"@typescript-eslint/eslint-plugin": "^5.26.0",
|
|
93
93
|
"@typescript-eslint/parser": "^5.26.0",
|
|
94
94
|
"cfonts": "^2.10.1",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"chokidar": "^3.5.3",
|
|
97
97
|
"cli-table3": "^0.6.2",
|
|
98
98
|
"commander": "7.2.0",
|
|
99
|
-
"core-js": "^3.22.
|
|
99
|
+
"core-js": "^3.22.7",
|
|
100
100
|
"emphasize": "4.2.0",
|
|
101
101
|
"fs-extra": "^10.1.0",
|
|
102
102
|
"gifwrap": "^0.10.1",
|
|
@@ -119,14 +119,14 @@
|
|
|
119
119
|
"uuid": "^8.3.2"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@sprucelabs/data-stores": "^12.0.
|
|
122
|
+
"@sprucelabs/data-stores": "^12.0.3",
|
|
123
123
|
"@sprucelabs/jest-sheets-reporter": "^1.3.44",
|
|
124
|
-
"@sprucelabs/mercury-core-events": "^
|
|
124
|
+
"@sprucelabs/mercury-core-events": "^6.0.0",
|
|
125
125
|
"@sprucelabs/resolve-path-aliases": "^1.1.49",
|
|
126
|
-
"@sprucelabs/spruce-conversation-plugin": "^
|
|
127
|
-
"@sprucelabs/spruce-deploy-plugin": "^
|
|
128
|
-
"@sprucelabs/spruce-store-plugin": "^
|
|
129
|
-
"@sprucelabs/spruce-test-fixtures": "^
|
|
126
|
+
"@sprucelabs/spruce-conversation-plugin": "^33.0.0",
|
|
127
|
+
"@sprucelabs/spruce-deploy-plugin": "^33.0.0",
|
|
128
|
+
"@sprucelabs/spruce-store-plugin": "^33.0.0",
|
|
129
|
+
"@sprucelabs/spruce-test-fixtures": "^33.0.0",
|
|
130
130
|
"@sprucelabs/test": "^7.7.317",
|
|
131
131
|
"@sprucelabs/test-utils": "^3.0.555",
|
|
132
132
|
"@types/blessed": "^0.1.19",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"@types/sha1": "^1.1.3",
|
|
147
147
|
"@types/slug": "^5.0.3",
|
|
148
148
|
"@types/superagent": "^4.1.15",
|
|
149
|
-
"@types/terminal-kit": "^1.
|
|
149
|
+
"@types/terminal-kit": "^1.34.0",
|
|
150
150
|
"@types/uuid": "^8.3.4",
|
|
151
151
|
"chokidar-cli": "^3.0.0",
|
|
152
152
|
"concurrently": "^7.2.1",
|
|
@@ -597,5 +597,5 @@
|
|
|
597
597
|
"terminal-kit"
|
|
598
598
|
]
|
|
599
599
|
},
|
|
600
|
-
"gitHead": "
|
|
600
|
+
"gitHead": "7c7d23d24dbff4f1316e6c12ea72938f74922b97"
|
|
601
601
|
}
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
messageSourceSchema,
|
|
20
20
|
messageTargetSchema,
|
|
21
21
|
sendMessageSchema,
|
|
22
|
-
|
|
22
|
+
choiceSchema,
|
|
23
23
|
linkSchema,
|
|
24
24
|
} from '@sprucelabs/spruce-core-schemas'
|
|
25
25
|
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils'
|
|
@@ -45,7 +45,7 @@ export const coreSchemas = {
|
|
|
45
45
|
messageSourceSchema,
|
|
46
46
|
messageTargetSchema,
|
|
47
47
|
sendMessageSchema,
|
|
48
|
-
|
|
48
|
+
choiceSchema,
|
|
49
49
|
linkSchema,
|
|
50
50
|
}
|
|
51
51
|
|