@sprucelabs/spruce-templates 24.1.33 → 25.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/build/addons/eq.addon.js.map +1 -0
- package/build/addons/escape.addon.js.map +1 -0
- package/build/addons/fieldDefinitionBodyPartial.addon.js.map +1 -0
- package/build/addons/fieldDefinitionOptions.addon.js.map +1 -0
- package/build/addons/fieldTypeEnum.addon.js.map +1 -0
- package/build/addons/fieldValue.addon.js.map +1 -0
- package/build/addons/gt.addon.js.map +1 -0
- package/build/addons/hasKeys.addon.js.map +1 -0
- package/build/addons/hasNoneCoreSchemaTemplateItems.addon.js.map +1 -0
- package/build/addons/importRelatedSchemas.addon.js.map +1 -0
- package/build/addons/index.js.map +1 -0
- package/build/addons/isDefined.addon.js.map +1 -0
- package/build/addons/json.addon.js.map +1 -0
- package/build/addons/neq.addon.js.map +1 -0
- package/build/addons/operators.addon.js.map +1 -0
- package/build/addons/pascalCase.addon.js.map +1 -0
- package/build/addons/permissionContractBuilder.addon.js.map +1 -0
- package/build/addons/schemaBodyPartial.addon.js.map +1 -0
- package/build/addons/schemaNamespacePath.addon.js.map +1 -0
- package/build/addons/schemaValuesPartial.addon.js.map +1 -0
- package/build/addons/valueTypeGenerator.addon.js.map +1 -0
- package/build/addons/valueTypeLiteral.addon.js.map +1 -0
- package/build/addons/valueTypeMapper.addon.js.map +1 -0
- package/build/dist/templates/directories/skill/.nvmrc +1 -0
- package/build/dist/templates/directories/skill/README.md +4 -0
- package/build/dist/templates/directories/skill/eslint.config.mjs +3 -0
- package/build/dist/templates/directories/skill/package.json.hbs +15 -0
- package/build/dist/templates/directories/skill/src/errors/SpruceError.ts.hbs +20 -0
- package/build/dist/templates/directories/skill/tsconfig.json +39 -0
- package/build/dist/templates/directories/vscode/.vscode/launch.json +58 -0
- package/build/dist/templates/directories/vscode/.vscode/settings.json +67 -0
- package/build/dist/templates/directories/vscode/.vscode/tasks.json +112 -0
- package/build/dist/templates/typescript/conversation/conversation.plugin.ts.hbs +1 -0
- package/build/dist/templates/typescript/conversation/conversation.topic.ts.hbs +19 -0
- package/build/dist/templates/typescript/deploy/deploy.plugin.ts.hbs +1 -0
- package/build/dist/templates/typescript/error/SpruceError.ts.hbs +31 -0
- package/build/dist/templates/typescript/error/error.plugin.ts.hbs +78 -0
- package/build/dist/templates/typescript/error/example.ts.hbs +10 -0
- package/build/dist/templates/typescript/error/options.types.ts.hbs +12 -0
- package/build/dist/templates/typescript/event/event.contract.ts.hbs +26 -0
- package/build/dist/templates/typescript/event/event.options.ts.hbs +11 -0
- package/build/dist/templates/typescript/event/events.contract.ts.hbs +24 -0
- package/build/dist/templates/typescript/event/listener.ts.hbs +23 -0
- package/build/dist/templates/typescript/event/listeners.ts.hbs +15 -0
- package/build/dist/templates/typescript/event/payload.builder.ts.hbs +15 -0
- package/build/dist/templates/typescript/log/transport.plugin.ts.hbs +14 -0
- package/build/dist/templates/typescript/permissions/contract.builder.ts.hbs +36 -0
- package/build/dist/templates/typescript/permissions/permission.plugin.ts.hbs +1 -0
- package/build/dist/templates/typescript/permissions/permissions.ts.hbs +13 -0
- package/build/dist/templates/typescript/permissions/permissions.types.ts.hbs +14 -0
- package/build/dist/templates/typescript/polish/polish.ts.hbs +67 -0
- package/build/dist/templates/typescript/sandbox/will-boot.listener.ts.hbs +172 -0
- package/build/dist/templates/typescript/schema/builder.ts.hbs +24 -0
- package/build/dist/templates/typescript/schema/core.schemas.types.ts.hbs +34 -0
- package/build/dist/templates/typescript/schema/example.ts.hbs +20 -0
- package/build/dist/templates/typescript/schema/fields/fieldClassMap.ts.hbs +16 -0
- package/build/dist/templates/typescript/schema/fields/fields.types.ts.hbs +1 -0
- package/build/dist/templates/typescript/schema/imported.schema.ts.hbs +1 -0
- package/build/dist/templates/typescript/schema/partials/fieldDefinitionBody.ts.hbs +12 -0
- package/build/dist/templates/typescript/schema/partials/schemaBody.ts.hbs +20 -0
- package/build/dist/templates/typescript/schema/partials/schemaValues.ts.hbs +7 -0
- package/build/dist/templates/typescript/schema/schema.plugin.ts.hbs +101 -0
- package/build/dist/templates/typescript/schema/schema.ts.hbs +12 -0
- package/build/dist/templates/typescript/schema/schemas.types.ts.hbs +44 -0
- package/build/dist/templates/typescript/schema/valueTypes.ts.hbs +67 -0
- package/build/dist/templates/typescript/store/Store.store.ts.hbs +95 -0
- package/build/dist/templates/typescript/store/store.plugin.ts.hbs +1 -0
- package/build/dist/templates/typescript/store/stores.ts.hbs +9 -0
- package/build/dist/templates/typescript/store/stores.types.ts.hbs +17 -0
- package/build/dist/templates/typescript/test/StaticTest.test.ts.hbs +20 -0
- package/build/dist/templates/typescript/test/Test.test.ts.hbs +21 -0
- package/build/dist/templates/typescript/view/App.ac.ts.hbs +6 -0
- package/build/dist/templates/typescript/view/View.svc.ts.hbs +23 -0
- package/build/dist/templates/typescript/view/View.vc.ts.hbs +17 -0
- package/build/dist/templates/typescript/view/skill.theme.ts.hbs +70 -0
- package/build/dist/templates/typescript/view/view.plugin.ts.hbs +1 -0
- package/build/dist/templates/typescript/view/viewController.plugin.ts.hbs +3 -0
- package/build/dist/templates/typescript/view/views.ts.hbs +93 -0
- package/build/esm/addons/eq.addon.d.ts +1 -0
- package/build/esm/addons/eq.addon.js +4 -0
- package/build/esm/addons/escape.addon.d.ts +1 -0
- package/build/esm/addons/escape.addon.js +5 -0
- package/build/esm/addons/fieldDefinitionBodyPartial.addon.d.ts +1 -0
- package/build/esm/addons/fieldDefinitionBodyPartial.addon.js +8 -0
- package/build/esm/addons/fieldDefinitionOptions.addon.d.ts +1 -0
- package/build/esm/addons/fieldDefinitionOptions.addon.js +66 -0
- package/build/esm/addons/fieldTypeEnum.addon.d.ts +1 -0
- package/build/esm/addons/fieldTypeEnum.addon.js +9 -0
- package/build/esm/addons/fieldValue.addon.d.ts +1 -0
- package/build/esm/addons/fieldValue.addon.js +8 -0
- package/build/esm/addons/gt.addon.d.ts +1 -0
- package/build/esm/addons/gt.addon.js +4 -0
- package/build/esm/addons/hasKeys.addon.d.ts +1 -0
- package/build/esm/addons/hasKeys.addon.js +4 -0
- package/build/esm/addons/hasNoneCoreSchemaTemplateItems.addon.d.ts +1 -0
- package/build/esm/addons/hasNoneCoreSchemaTemplateItems.addon.js +6 -0
- package/build/esm/addons/importRelatedSchemas.addon.d.ts +1 -0
- package/build/esm/addons/importRelatedSchemas.addon.js +34 -0
- package/build/esm/addons/index.d.ts +23 -0
- package/build/esm/addons/index.js +23 -0
- package/build/esm/addons/isDefined.addon.d.ts +1 -0
- package/build/esm/addons/isDefined.addon.js +5 -0
- package/build/esm/addons/json.addon.d.ts +1 -0
- package/build/esm/addons/json.addon.js +7 -0
- package/build/esm/addons/neq.addon.d.ts +1 -0
- package/build/esm/addons/neq.addon.js +4 -0
- package/build/esm/addons/operators.addon.d.ts +1 -0
- package/build/esm/addons/operators.addon.js +15 -0
- package/build/esm/addons/pascalCase.addon.d.ts +1 -0
- package/build/esm/addons/pascalCase.addon.js +6 -0
- package/build/esm/addons/permissionContractBuilder.addon.d.ts +1 -0
- package/build/esm/addons/permissionContractBuilder.addon.js +4 -0
- package/build/esm/addons/schemaBodyPartial.addon.d.ts +1 -0
- package/build/esm/addons/schemaBodyPartial.addon.js +8 -0
- package/build/esm/addons/schemaNamespacePath.addon.d.ts +1 -0
- package/build/esm/addons/schemaNamespacePath.addon.js +18 -0
- package/build/esm/addons/schemaValuesPartial.addon.d.ts +1 -0
- package/build/esm/addons/schemaValuesPartial.addon.js +8 -0
- package/build/esm/addons/valueTypeGenerator.addon.d.ts +1 -0
- package/build/esm/addons/valueTypeGenerator.addon.js +15 -0
- package/build/esm/addons/valueTypeLiteral.addon.d.ts +1 -0
- package/build/esm/addons/valueTypeLiteral.addon.js +32 -0
- package/build/esm/addons/valueTypeMapper.addon.d.ts +1 -0
- package/build/esm/addons/valueTypeMapper.addon.js +9 -0
- package/build/esm/index.d.ts +141 -0
- package/build/esm/index.js +258 -0
- package/build/esm/templates/directories/skill/.nvmrc +1 -0
- package/build/esm/templates/directories/skill/README.md +4 -0
- package/build/esm/templates/directories/skill/eslint.config.mjs +3 -0
- package/build/esm/templates/directories/skill/package.json.hbs +15 -0
- package/build/esm/templates/directories/skill/src/.spruce/errors/options.types.ts +6 -0
- package/build/esm/templates/directories/skill/src/.spruce/features/event.plugin.ts +1 -0
- package/build/esm/templates/directories/skill/src/.spruce/skill.ts +8 -0
- package/build/esm/templates/directories/skill/src/errors/SpruceError.ts.hbs +20 -0
- package/build/esm/templates/directories/skill/src/index.ts +35 -0
- package/build/esm/templates/directories/skill/tsconfig.json +39 -0
- package/build/esm/templates/directories/vscode/.vscode/launch.json +58 -0
- package/build/esm/templates/directories/vscode/.vscode/settings.json +67 -0
- package/build/esm/templates/directories/vscode/.vscode/tasks.json +112 -0
- package/build/esm/templates/typescript/conversation/conversation.plugin.ts.hbs +1 -0
- package/build/esm/templates/typescript/conversation/conversation.topic.ts.hbs +19 -0
- package/build/esm/templates/typescript/deploy/deploy.plugin.ts.hbs +1 -0
- package/build/esm/templates/typescript/error/SpruceError.ts.hbs +31 -0
- package/build/esm/templates/typescript/error/error.plugin.ts.hbs +78 -0
- package/build/esm/templates/typescript/error/example.ts.hbs +10 -0
- package/build/esm/templates/typescript/error/options.types.ts.hbs +12 -0
- package/build/esm/templates/typescript/event/event.contract.ts.hbs +26 -0
- package/build/esm/templates/typescript/event/event.options.ts.hbs +11 -0
- package/build/esm/templates/typescript/event/events.contract.ts.hbs +24 -0
- package/build/esm/templates/typescript/event/listener.ts.hbs +23 -0
- package/build/esm/templates/typescript/event/listeners.ts.hbs +15 -0
- package/build/esm/templates/typescript/event/payload.builder.ts.hbs +15 -0
- package/build/esm/templates/typescript/log/transport.plugin.ts.hbs +14 -0
- package/build/esm/templates/typescript/permissions/contract.builder.ts.hbs +36 -0
- package/build/esm/templates/typescript/permissions/permission.plugin.ts.hbs +1 -0
- package/build/esm/templates/typescript/permissions/permissions.ts.hbs +13 -0
- package/build/esm/templates/typescript/permissions/permissions.types.ts.hbs +14 -0
- package/build/esm/templates/typescript/polish/polish.ts.hbs +67 -0
- package/build/esm/templates/typescript/sandbox/will-boot.listener.ts.hbs +172 -0
- package/build/esm/templates/typescript/schema/builder.ts.hbs +24 -0
- package/build/esm/templates/typescript/schema/core.schemas.types.ts.hbs +34 -0
- package/build/esm/templates/typescript/schema/example.ts.hbs +20 -0
- package/build/esm/templates/typescript/schema/fields/fieldClassMap.ts.hbs +16 -0
- package/build/esm/templates/typescript/schema/fields/fields.types.ts.hbs +1 -0
- package/build/esm/templates/typescript/schema/imported.schema.ts.hbs +1 -0
- package/build/esm/templates/typescript/schema/partials/fieldDefinitionBody.ts.hbs +12 -0
- package/build/esm/templates/typescript/schema/partials/schemaBody.ts.hbs +20 -0
- package/build/esm/templates/typescript/schema/partials/schemaValues.ts.hbs +7 -0
- package/build/esm/templates/typescript/schema/schema.plugin.ts.hbs +101 -0
- package/build/esm/templates/typescript/schema/schema.ts.hbs +12 -0
- package/build/esm/templates/typescript/schema/schemas.types.ts.hbs +44 -0
- package/build/esm/templates/typescript/schema/valueTypes.ts.hbs +67 -0
- package/build/esm/templates/typescript/store/Store.store.ts.hbs +95 -0
- package/build/esm/templates/typescript/store/store.plugin.ts.hbs +1 -0
- package/build/esm/templates/typescript/store/stores.ts.hbs +9 -0
- package/build/esm/templates/typescript/store/stores.types.ts.hbs +17 -0
- package/build/esm/templates/typescript/test/StaticTest.test.ts.hbs +20 -0
- package/build/esm/templates/typescript/test/Test.test.ts.hbs +21 -0
- package/build/esm/templates/typescript/view/App.ac.ts.hbs +6 -0
- package/build/esm/templates/typescript/view/View.svc.ts.hbs +23 -0
- package/build/esm/templates/typescript/view/View.vc.ts.hbs +17 -0
- package/build/esm/templates/typescript/view/skill.theme.ts.hbs +70 -0
- package/build/esm/templates/typescript/view/view.plugin.ts.hbs +1 -0
- package/build/esm/templates/typescript/view/viewController.plugin.ts.hbs +3 -0
- package/build/esm/templates/typescript/view/views.ts.hbs +93 -0
- package/build/esm/types/templates.types.d.ts +122 -0
- package/build/esm/types/templates.types.js +5 -0
- package/build/esm/utilities/DirectoryTemplateUtility.d.ts +15 -0
- package/build/esm/utilities/DirectoryTemplateUtility.js +79 -0
- package/build/esm/utilities/KeyGeneratorUtility.d.ts +5 -0
- package/build/esm/utilities/KeyGeneratorUtility.js +6 -0
- package/build/esm/utilities/importExtractor.utility.d.ts +10 -0
- package/build/esm/utilities/importExtractor.utility.js +32 -0
- package/build/esm/utilities/templateImporter.utility.d.ts +4 -0
- package/build/esm/utilities/templateImporter.utility.js +18 -0
- package/build/esm/utilities/templateItem.utility.d.ts +6 -0
- package/build/esm/utilities/templateItem.utility.js +25 -0
- package/build/index.js.map +1 -0
- package/build/types/templates.types.js.map +1 -0
- package/build/utilities/DirectoryTemplateUtility.js.map +1 -0
- package/build/utilities/KeyGeneratorUtility.js.map +1 -0
- package/build/utilities/importExtractor.utility.js.map +1 -0
- package/build/utilities/templateImporter.utility.js.map +1 -0
- package/build/utilities/templateItem.utility.js.map +1 -0
- package/package.json +3 -3
- package/LICENSE +0 -21
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
import path from 'path';
|
|
12
|
+
import { TemplateRenderAs } from '@sprucelabs/schema';
|
|
13
|
+
import { SCHEMA_VERSION_FALLBACK, DEFAULT_GLOBAL_SCHEMA_NAMESPACE, DEFAULT_BUILDER_FUNCTION, DEFAULT_SCHEMA_TYPES_FILE, } from '@sprucelabs/spruce-skill-utils';
|
|
14
|
+
import handlebars from 'handlebars';
|
|
15
|
+
import { DirectoryTemplateCode, } from './types/templates.types';
|
|
16
|
+
import DirectoryTemplateUtility from './utilities/DirectoryTemplateUtility';
|
|
17
|
+
import importExtractorUtil from './utilities/importExtractor.utility';
|
|
18
|
+
import KeyGeneratorUtility from './utilities/KeyGeneratorUtility';
|
|
19
|
+
import templateImportUtil from './utilities/templateImporter.utility';
|
|
20
|
+
import templateItemUtil from './utilities/templateItem.utility';
|
|
21
|
+
// Manual import of addons for Bun
|
|
22
|
+
import './addons';
|
|
23
|
+
// addonUtil.importSync({}, __dirname, 'addons')
|
|
24
|
+
export const templates = {
|
|
25
|
+
schemasTypes(options) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const imports = importExtractorUtil.extractFieldImports(options.fieldTemplateItems);
|
|
28
|
+
const template = templateImportUtil.getTemplate((_a = options.typesTemplate) !== null && _a !== void 0 ? _a : 'schema/schemas.types.ts.hbs');
|
|
29
|
+
const schemaImports = importExtractorUtil.extractSchemaImports(options.schemaTemplateItems);
|
|
30
|
+
return template(Object.assign(Object.assign({}, options), { imports,
|
|
31
|
+
schemaImports, globalSchemaNamespace: (_b = options.globalSchemaNamespace) !== null && _b !== void 0 ? _b : DEFAULT_GLOBAL_SCHEMA_NAMESPACE }));
|
|
32
|
+
},
|
|
33
|
+
valueTypes(options) {
|
|
34
|
+
var _a;
|
|
35
|
+
const imports = importExtractorUtil.extractFieldImports(options.fieldTemplateItems);
|
|
36
|
+
const rendersAs = Object.values(TemplateRenderAs);
|
|
37
|
+
const schemaTemplatesByNamespaceAndName = templateItemUtil.groupSchemaTemplatesByNamespaceAndName(options.schemaTemplateItems);
|
|
38
|
+
const fieldTemplatesByType = templateItemUtil.groupFieldItemsByNamespace(options.fieldTemplateItems);
|
|
39
|
+
const template = templateImportUtil.getTemplate('schema/valueTypes.ts.hbs');
|
|
40
|
+
return template(Object.assign(Object.assign({}, options), { imports,
|
|
41
|
+
fieldTemplatesByType,
|
|
42
|
+
schemaTemplatesByNamespaceAndName,
|
|
43
|
+
SCHEMA_VERSION_FALLBACK,
|
|
44
|
+
rendersAs, globalSchemaNamespace: (_a = options.globalSchemaNamespace) !== null && _a !== void 0 ? _a : DEFAULT_GLOBAL_SCHEMA_NAMESPACE }));
|
|
45
|
+
},
|
|
46
|
+
schema(options) {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
const imports = importExtractorUtil.extractFieldImports(options.fieldTemplateItems);
|
|
49
|
+
const template = templateImportUtil.getTemplate((_a = options.schemaFile) !== null && _a !== void 0 ? _a : 'schema/schema.ts.hbs');
|
|
50
|
+
return template(Object.assign(Object.assign({}, options), { imports, globalSchemaNamespace: (_b = options.globalSchemaNamespace) !== null && _b !== void 0 ? _b : DEFAULT_GLOBAL_SCHEMA_NAMESPACE, typesFile: (_c = options.typesFile) !== null && _c !== void 0 ? _c : DEFAULT_SCHEMA_TYPES_FILE }));
|
|
51
|
+
},
|
|
52
|
+
schemaBuilder(options) {
|
|
53
|
+
var _a;
|
|
54
|
+
const template = templateImportUtil.getTemplate('schema/builder.ts.hbs');
|
|
55
|
+
return template(Object.assign(Object.assign({}, options), { builderFunction: (_a = options.builderFunction) !== null && _a !== void 0 ? _a : DEFAULT_BUILDER_FUNCTION }));
|
|
56
|
+
},
|
|
57
|
+
error(options) {
|
|
58
|
+
const template = templateImportUtil.getTemplate('error/SpruceError.ts.hbs');
|
|
59
|
+
return template(Object.assign({ renderClassDefinition: true }, options));
|
|
60
|
+
},
|
|
61
|
+
errorOptionsTypes(options) {
|
|
62
|
+
const template = templateImportUtil.getTemplate('error/options.types.ts.hbs');
|
|
63
|
+
return template(options);
|
|
64
|
+
},
|
|
65
|
+
schemaExample(options) {
|
|
66
|
+
const template = templateImportUtil.getTemplate('schema/example.ts.hbs');
|
|
67
|
+
return template(options);
|
|
68
|
+
},
|
|
69
|
+
schemaPlugin() {
|
|
70
|
+
const template = templateImportUtil.getTemplate('schema/schema.plugin.ts.hbs');
|
|
71
|
+
return template({});
|
|
72
|
+
},
|
|
73
|
+
errorPlugin() {
|
|
74
|
+
const template = templateImportUtil.getTemplate('error/error.plugin.ts.hbs');
|
|
75
|
+
return template({});
|
|
76
|
+
},
|
|
77
|
+
conversationPlugin() {
|
|
78
|
+
const template = templateImportUtil.getTemplate('conversation/conversation.plugin.ts.hbs');
|
|
79
|
+
return template({});
|
|
80
|
+
},
|
|
81
|
+
deployPlugin() {
|
|
82
|
+
const template = templateImportUtil.getTemplate('deploy/deploy.plugin.ts.hbs');
|
|
83
|
+
return template({});
|
|
84
|
+
},
|
|
85
|
+
errorExample(options) {
|
|
86
|
+
const template = templateImportUtil.getTemplate('error/example.ts.hbs');
|
|
87
|
+
return template(options);
|
|
88
|
+
},
|
|
89
|
+
test(options) {
|
|
90
|
+
const { testType } = options;
|
|
91
|
+
const template = templateImportUtil.getTemplate(testType === 'static'
|
|
92
|
+
? 'test/StaticTest.test.ts.hbs'
|
|
93
|
+
: 'test/Test.test.ts.hbs');
|
|
94
|
+
return template(options);
|
|
95
|
+
},
|
|
96
|
+
fieldsTypes(options) {
|
|
97
|
+
const template = templateImportUtil.getTemplate('schema/fields/fields.types.ts.hbs');
|
|
98
|
+
return template(options);
|
|
99
|
+
},
|
|
100
|
+
fieldClassMap(options) {
|
|
101
|
+
const template = templateImportUtil.getTemplate('schema/fields/fieldClassMap.ts.hbs');
|
|
102
|
+
return template(options);
|
|
103
|
+
},
|
|
104
|
+
launchConfig() {
|
|
105
|
+
const template = templateImportUtil.getTemplate('vscode/launch.json');
|
|
106
|
+
return template({});
|
|
107
|
+
},
|
|
108
|
+
vsCodeSettings() {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const files = yield templates.directoryTemplate({
|
|
111
|
+
kind: DirectoryTemplateCode.VsCode,
|
|
112
|
+
context: {},
|
|
113
|
+
});
|
|
114
|
+
const settings = files.find((f) => f.filename === 'settings.json');
|
|
115
|
+
return settings.contents;
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
listener(options) {
|
|
119
|
+
const template = templateImportUtil.getTemplate('event/listener.ts.hbs');
|
|
120
|
+
return template(Object.assign(Object.assign({ globalSchemaNamespace: DEFAULT_GLOBAL_SCHEMA_NAMESPACE }, options), { shouldImportGlobalSchema: options.emitPayloadSchemaTemplateItem ||
|
|
121
|
+
options.responsePayloadSchemaTemplateItem }));
|
|
122
|
+
},
|
|
123
|
+
listeners(options) {
|
|
124
|
+
const template = templateImportUtil.getTemplate('event/listeners.ts.hbs');
|
|
125
|
+
return template(Object.assign({}, options));
|
|
126
|
+
},
|
|
127
|
+
eventContract(options) {
|
|
128
|
+
const template = templateImportUtil.getTemplate('event/event.contract.ts.hbs');
|
|
129
|
+
return template(options);
|
|
130
|
+
},
|
|
131
|
+
eventOptions(options) {
|
|
132
|
+
const template = templateImportUtil.getTemplate('event/event.options.ts.hbs');
|
|
133
|
+
return template(Object.assign(Object.assign({}, options), { isGlobal: options.isGlobal ? 'true' : 'false' }));
|
|
134
|
+
},
|
|
135
|
+
permissionPlugin() {
|
|
136
|
+
const template = templateImportUtil.getTemplate('permissions/permission.plugin.ts.hbs');
|
|
137
|
+
return template({});
|
|
138
|
+
},
|
|
139
|
+
permissions(options) {
|
|
140
|
+
const template = templateImportUtil.getTemplate('permissions/permissions.ts.hbs');
|
|
141
|
+
return template(Object.assign({}, options));
|
|
142
|
+
},
|
|
143
|
+
permissionContractBuilder(options) {
|
|
144
|
+
const template = templateImportUtil.getTemplate('permissions/contract.builder.ts.hbs');
|
|
145
|
+
return template(options);
|
|
146
|
+
},
|
|
147
|
+
permissionTypes(options) {
|
|
148
|
+
const template = templateImportUtil.getTemplate('permissions/permissions.types.ts.hbs');
|
|
149
|
+
return template(options);
|
|
150
|
+
},
|
|
151
|
+
eventEmitPayload(options) {
|
|
152
|
+
const template = templateImportUtil.getTemplate('event/payload.builder.ts.hbs');
|
|
153
|
+
return template(Object.assign(Object.assign({}, options), { actionCamel: 'EmitPayload' }));
|
|
154
|
+
},
|
|
155
|
+
eventEmitTarget(options) {
|
|
156
|
+
const template = templateImportUtil.getTemplate('event/payload.builder.ts.hbs');
|
|
157
|
+
return template(Object.assign(Object.assign({}, options), { actionCamel: 'EmitTarget' }));
|
|
158
|
+
},
|
|
159
|
+
eventResponsePayload(options) {
|
|
160
|
+
const template = templateImportUtil.getTemplate('event/payload.builder.ts.hbs');
|
|
161
|
+
return template(Object.assign(Object.assign({}, options), { actionCamel: 'ResponsePayload' }));
|
|
162
|
+
},
|
|
163
|
+
combinedEventsContract(options) {
|
|
164
|
+
const template = templateImportUtil.getTemplate('event/events.contract.ts.hbs');
|
|
165
|
+
return template(Object.assign(Object.assign({}, options), { contracts: options.templateItems }));
|
|
166
|
+
},
|
|
167
|
+
sandboxWillBootListener() {
|
|
168
|
+
const template = templateImportUtil.getTemplate('sandbox/will-boot.listener.ts.hbs');
|
|
169
|
+
return template({});
|
|
170
|
+
},
|
|
171
|
+
polish() {
|
|
172
|
+
const template = templateImportUtil.getTemplate('polish/polish.ts.hbs');
|
|
173
|
+
return template({});
|
|
174
|
+
},
|
|
175
|
+
directoryTemplate(options) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
return DirectoryTemplateUtility.build(options);
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
isValidTemplatedDirectory(options) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const { kind, dir } = options;
|
|
183
|
+
if (kind === DirectoryTemplateCode.Skill) {
|
|
184
|
+
return fs.existsSync(path.join(dir, 'package.json'));
|
|
185
|
+
}
|
|
186
|
+
const filesToCheck = yield DirectoryTemplateUtility.filesInTemplate(kind);
|
|
187
|
+
let filesMissing = false;
|
|
188
|
+
for (const file of filesToCheck) {
|
|
189
|
+
if (!fs.existsSync(file.path)) {
|
|
190
|
+
filesMissing = true;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (!filesMissing) {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
return false;
|
|
198
|
+
});
|
|
199
|
+
},
|
|
200
|
+
conversationTopic(options) {
|
|
201
|
+
const template = templateImportUtil.getTemplate('conversation/conversation.topic.ts.hbs');
|
|
202
|
+
return template(options);
|
|
203
|
+
},
|
|
204
|
+
generateFieldKey(renderAs, definition) {
|
|
205
|
+
return KeyGeneratorUtility.generateFieldKey(renderAs, definition);
|
|
206
|
+
},
|
|
207
|
+
storePlugin() {
|
|
208
|
+
const template = templateImportUtil.getTemplate('store/store.plugin.ts.hbs');
|
|
209
|
+
return template({});
|
|
210
|
+
},
|
|
211
|
+
store(options) {
|
|
212
|
+
const template = templateImportUtil.getTemplate('store/Store.store.ts.hbs');
|
|
213
|
+
return template(options);
|
|
214
|
+
},
|
|
215
|
+
storeTypes(options) {
|
|
216
|
+
const template = templateImportUtil.getTemplate('store/stores.types.ts.hbs');
|
|
217
|
+
return template(options);
|
|
218
|
+
},
|
|
219
|
+
stores(options) {
|
|
220
|
+
const template = templateImportUtil.getTemplate('store/stores.ts.hbs');
|
|
221
|
+
return template(options);
|
|
222
|
+
},
|
|
223
|
+
skillViewController(options) {
|
|
224
|
+
const template = templateImportUtil.getTemplate('view/View.svc.ts.hbs');
|
|
225
|
+
return template(options);
|
|
226
|
+
},
|
|
227
|
+
viewController(options) {
|
|
228
|
+
const template = templateImportUtil.getTemplate('view/View.vc.ts.hbs');
|
|
229
|
+
return template(options);
|
|
230
|
+
},
|
|
231
|
+
appController(options) {
|
|
232
|
+
const template = templateImportUtil.getTemplate('view/App.ac.ts.hbs');
|
|
233
|
+
return template(options);
|
|
234
|
+
},
|
|
235
|
+
views(options) {
|
|
236
|
+
const template = templateImportUtil.getTemplate('view/views.ts.hbs');
|
|
237
|
+
return template(options);
|
|
238
|
+
},
|
|
239
|
+
viewPlugin() {
|
|
240
|
+
const template = templateImportUtil.getTemplate('view/view.plugin.ts.hbs');
|
|
241
|
+
return template({});
|
|
242
|
+
},
|
|
243
|
+
viewControllerPlugin(options) {
|
|
244
|
+
const template = templateImportUtil.getTemplate('view/viewController.plugin.ts.hbs');
|
|
245
|
+
return template(options);
|
|
246
|
+
},
|
|
247
|
+
theme() {
|
|
248
|
+
const template = templateImportUtil.getTemplate('view/skill.theme.ts.hbs');
|
|
249
|
+
return template({});
|
|
250
|
+
},
|
|
251
|
+
logTransport() {
|
|
252
|
+
const template = templateImportUtil.getTemplate('log/transport.plugin.ts.hbs');
|
|
253
|
+
return template({});
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
export { default as importExtractorUtil } from './utilities/importExtractor.utility';
|
|
257
|
+
export default handlebars;
|
|
258
|
+
export * from './types/templates.types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lts/*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"description": "{{description}}",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"skill": {},
|
|
6
|
+
"homepage": "https://github.com/[YOUR REPO PATH]",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/[YOUR REPO PATH]/issues"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"scripts": {},
|
|
12
|
+
"dependencies": {},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { plugin as default } from '@sprucelabs/spruce-event-plugin'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import pathUtil from 'path'
|
|
2
|
+
import Skill from '@sprucelabs/spruce-skill-booter'
|
|
3
|
+
|
|
4
|
+
export default new Skill({
|
|
5
|
+
rootDir: pathUtil.join(__dirname, '..', '..'),
|
|
6
|
+
activeDir: pathUtil.join(__dirname, '..'),
|
|
7
|
+
hashSpruceDir: pathUtil.join(__dirname, '..', '.spruce'),
|
|
8
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import AbstractSpruceError from '@sprucelabs/error'
|
|
2
|
+
import ErrorOptions from '#spruce/errors/options.types'
|
|
3
|
+
|
|
4
|
+
export default class SpruceError extends AbstractSpruceError<ErrorOptions> {
|
|
5
|
+
public friendlyMessage(): string {
|
|
6
|
+
const { options } = this
|
|
7
|
+
let message
|
|
8
|
+
|
|
9
|
+
switch (options?.code) {
|
|
10
|
+
default:
|
|
11
|
+
message = super.friendlyMessage()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const fullMessage = options.friendlyMessage
|
|
15
|
+
? options.friendlyMessage
|
|
16
|
+
: message
|
|
17
|
+
|
|
18
|
+
return fullMessage
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// AUTO-GENERATED. ALL CHANGES WILL BE OVERWRITTEN
|
|
2
|
+
import AbstractSpruceError from '@sprucelabs/error'
|
|
3
|
+
import {
|
|
4
|
+
HEALTH_DIVIDER,
|
|
5
|
+
ERROR_DIVIDER,
|
|
6
|
+
pluginUtil,
|
|
7
|
+
} from '@sprucelabs/spruce-skill-utils'
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
import skill from '#spruce/skill'
|
|
10
|
+
|
|
11
|
+
const isHealthCheck = !!process.argv.find((arg) => arg === '--health')
|
|
12
|
+
|
|
13
|
+
async function run() {
|
|
14
|
+
await pluginUtil.import([skill], skill.hashSpruceDir)
|
|
15
|
+
|
|
16
|
+
if (isHealthCheck) {
|
|
17
|
+
const health = await skill.checkHealth()
|
|
18
|
+
console.log(HEALTH_DIVIDER)
|
|
19
|
+
console.log(JSON.stringify(health))
|
|
20
|
+
console.log(HEALTH_DIVIDER)
|
|
21
|
+
} else {
|
|
22
|
+
await skill.execute()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
run()
|
|
27
|
+
.then(() => {})
|
|
28
|
+
.catch((err) => {
|
|
29
|
+
if (err instanceof AbstractSpruceError && process.env.IS_CLI) {
|
|
30
|
+
console.error(ERROR_DIVIDER + err.toJson() + ERROR_DIVIDER)
|
|
31
|
+
} else {
|
|
32
|
+
console.error(err.stack ?? err.message)
|
|
33
|
+
}
|
|
34
|
+
process.exit(1)
|
|
35
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"skipLibCheck": true,
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"target": "ES2020",
|
|
7
|
+
"lib": [
|
|
8
|
+
"DOM",
|
|
9
|
+
"ES2022"
|
|
10
|
+
],
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"noImplicitAny": true,
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"sourceMap": false,
|
|
21
|
+
"outDir": "build",
|
|
22
|
+
"baseUrl": "src",
|
|
23
|
+
"experimentalDecorators": true,
|
|
24
|
+
"paths": {
|
|
25
|
+
"#spruce/*": [
|
|
26
|
+
".spruce/*"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"include": [
|
|
31
|
+
"./src/*.ts",
|
|
32
|
+
"./src/**/*.ts",
|
|
33
|
+
"./src/.spruce/**/*"
|
|
34
|
+
],
|
|
35
|
+
"exclude": [
|
|
36
|
+
"build",
|
|
37
|
+
"esm"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"type": "node",
|
|
6
|
+
"request": "attach",
|
|
7
|
+
"name": "attach.tests",
|
|
8
|
+
"port": 5200,
|
|
9
|
+
"restart": true,
|
|
10
|
+
"timeout": 10000
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "node",
|
|
14
|
+
"request": "launch",
|
|
15
|
+
"name": "test.file",
|
|
16
|
+
"runtimeExecutable": "node",
|
|
17
|
+
"runtimeArgs": [
|
|
18
|
+
"--inspect-brk",
|
|
19
|
+
"--trace-warnings",
|
|
20
|
+
"${workspaceFolder}/node_modules/.bin/jest",
|
|
21
|
+
"${fileBasenameNoExtension}",
|
|
22
|
+
"--detectOpenHandles"
|
|
23
|
+
],
|
|
24
|
+
"cwd": "${workspaceFolder}",
|
|
25
|
+
"console": "integratedTerminal",
|
|
26
|
+
"internalConsoleOptions": "neverOpen"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "node",
|
|
30
|
+
"request": "launch",
|
|
31
|
+
"name": "test.all",
|
|
32
|
+
"runtimeExecutable": "node",
|
|
33
|
+
"runtimeArgs": [
|
|
34
|
+
"--inspect-brk",
|
|
35
|
+
"--trace-warnings",
|
|
36
|
+
"${workspaceFolder}/node_modules/.bin/jest"
|
|
37
|
+
],
|
|
38
|
+
"cwd": "${workspaceFolder}",
|
|
39
|
+
"console": "integratedTerminal",
|
|
40
|
+
"internalConsoleOptions": "neverOpen"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "node",
|
|
44
|
+
"request": "launch",
|
|
45
|
+
"name": "boot",
|
|
46
|
+
"runtimeExecutable": "yarn",
|
|
47
|
+
"runtimeArgs": [
|
|
48
|
+
"run",
|
|
49
|
+
"--inspect-brk",
|
|
50
|
+
"--trace-warnings",
|
|
51
|
+
"boot"
|
|
52
|
+
],
|
|
53
|
+
"cwd": "${workspaceFolder}",
|
|
54
|
+
"console": "integratedTerminal",
|
|
55
|
+
"internalConsoleOptions": "neverOpen"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"debug.node.autoAttach": "on",
|
|
3
|
+
"git.ignoreLimitWarning": true,
|
|
4
|
+
"javascript.validate.enable": false,
|
|
5
|
+
"files.watcherExclude": {
|
|
6
|
+
"**/.git/objects/**": true,
|
|
7
|
+
"**/.git/subtree-cache/**": true,
|
|
8
|
+
"**/build/**": true,
|
|
9
|
+
"**/node_modules/**": true,
|
|
10
|
+
},
|
|
11
|
+
"search.exclude": {
|
|
12
|
+
"**/build/**": true,
|
|
13
|
+
"**/node_modules/**": true,
|
|
14
|
+
"**/.next/**": true
|
|
15
|
+
},
|
|
16
|
+
"editor.maxTokenizationLineLength": 20000000,
|
|
17
|
+
"[javascript]": {
|
|
18
|
+
"editor.formatOnSave": false
|
|
19
|
+
},
|
|
20
|
+
"[javascriptreact]": {
|
|
21
|
+
"editor.formatOnSave": false
|
|
22
|
+
},
|
|
23
|
+
"[typescript]": {
|
|
24
|
+
"editor.formatOnSave": false
|
|
25
|
+
},
|
|
26
|
+
"[typescriptreact]": {
|
|
27
|
+
"editor.formatOnSave": false
|
|
28
|
+
},
|
|
29
|
+
"[handlebars]": {
|
|
30
|
+
"editor.formatOnSave": false
|
|
31
|
+
},
|
|
32
|
+
"typescript.tsdk": "node_modules/typescript/lib",
|
|
33
|
+
"cSpell.ignorePaths": [
|
|
34
|
+
"**/package-lock.json",
|
|
35
|
+
"**/node_modules/**",
|
|
36
|
+
"**/build/**",
|
|
37
|
+
"**/vscode-extension/**",
|
|
38
|
+
"**/.git/objects/**",
|
|
39
|
+
".vscode",
|
|
40
|
+
".spruce"
|
|
41
|
+
],
|
|
42
|
+
"cSpell.words": [
|
|
43
|
+
"arkit",
|
|
44
|
+
"autogenerated",
|
|
45
|
+
"scrollable",
|
|
46
|
+
"serializable"
|
|
47
|
+
],
|
|
48
|
+
"debug.javascript.unmapMissingSources": true,
|
|
49
|
+
"javascript.preferences.importModuleSpecifier": "relative",
|
|
50
|
+
"typescript.preferences.importModuleSpecifier": "relative",
|
|
51
|
+
"eslint.useFlatConfig": true,
|
|
52
|
+
"eslint.enable": true,
|
|
53
|
+
"eslint.validate": [
|
|
54
|
+
"javascript",
|
|
55
|
+
"javascriptreact",
|
|
56
|
+
"typescript",
|
|
57
|
+
"typescriptreact"
|
|
58
|
+
],
|
|
59
|
+
"eslint.workingDirectories": [
|
|
60
|
+
"./"
|
|
61
|
+
],
|
|
62
|
+
"typescript.validate.enable": true,
|
|
63
|
+
"editor.formatOnSave": false,
|
|
64
|
+
"editor.codeActionsOnSave": {
|
|
65
|
+
"source.fixAll.eslint": "always"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"type": "npm",
|
|
6
|
+
"script": "watch.build.dev",
|
|
7
|
+
"group": "build",
|
|
8
|
+
"label": "watch.build.dev & problem.watcher",
|
|
9
|
+
"isBackground": true,
|
|
10
|
+
"runOptions": {
|
|
11
|
+
"runOn": "folderOpen"
|
|
12
|
+
},
|
|
13
|
+
"promptOnClose": false,
|
|
14
|
+
"presentation": {
|
|
15
|
+
"focus": false,
|
|
16
|
+
"reveal": "never"
|
|
17
|
+
},
|
|
18
|
+
"problemMatcher": {
|
|
19
|
+
"base": "$tsc-watch",
|
|
20
|
+
"applyTo": "allDocuments"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"label": "test.file",
|
|
25
|
+
"command": "spruce",
|
|
26
|
+
"args": [
|
|
27
|
+
"test",
|
|
28
|
+
"--inspect",
|
|
29
|
+
"5200",
|
|
30
|
+
"--pattern",
|
|
31
|
+
"${fileBasenameNoExtension}",
|
|
32
|
+
"--watchMode",
|
|
33
|
+
"standard"
|
|
34
|
+
],
|
|
35
|
+
"promptOnClose": false,
|
|
36
|
+
"group": {
|
|
37
|
+
"kind": "test",
|
|
38
|
+
"isDefault": true
|
|
39
|
+
},
|
|
40
|
+
"presentation": {
|
|
41
|
+
"reveal": "always",
|
|
42
|
+
"panel": "dedicated",
|
|
43
|
+
},
|
|
44
|
+
"problemMatcher": []
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"label": "test.reporter",
|
|
48
|
+
"command": "spruce",
|
|
49
|
+
"args": [
|
|
50
|
+
"test",
|
|
51
|
+
"--shouldHoldAtStart",
|
|
52
|
+
"true",
|
|
53
|
+
"--watchMode",
|
|
54
|
+
"smart"
|
|
55
|
+
],
|
|
56
|
+
"promptOnClose": false,
|
|
57
|
+
"group": "test",
|
|
58
|
+
"runOptions": {
|
|
59
|
+
"runOn": "folderOpen"
|
|
60
|
+
},
|
|
61
|
+
"presentation": {
|
|
62
|
+
"panel": "shared",
|
|
63
|
+
"focus": true,
|
|
64
|
+
"reveal": "always"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "spruce",
|
|
69
|
+
"type": "shell",
|
|
70
|
+
"command": "spruce ${input:spruceCommand}",
|
|
71
|
+
"problemMatcher": [],
|
|
72
|
+
"presentation": {
|
|
73
|
+
"reveal": "always",
|
|
74
|
+
"focus": true,
|
|
75
|
+
"panel": "new",
|
|
76
|
+
"clear": false
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"label": "shell",
|
|
81
|
+
"type": "shell",
|
|
82
|
+
"command": "${input:command} ${input:optionsCommand}",
|
|
83
|
+
"problemMatcher": [],
|
|
84
|
+
"presentation": {
|
|
85
|
+
"reveal": "always",
|
|
86
|
+
"focus": true,
|
|
87
|
+
"panel": "new",
|
|
88
|
+
"clear": false
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"inputs": [
|
|
93
|
+
{
|
|
94
|
+
"id": "spruceCommand",
|
|
95
|
+
"description": "spruce command",
|
|
96
|
+
"default": "create.test",
|
|
97
|
+
"type": "promptString"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "command",
|
|
101
|
+
"description": "command",
|
|
102
|
+
"default": "yarn",
|
|
103
|
+
"type": "promptString"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "optionsCommand",
|
|
107
|
+
"description": "optionsCommand",
|
|
108
|
+
"default": "add",
|
|
109
|
+
"type": "promptString"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { plugin as default } from '@sprucelabs/spruce-conversation-plugin'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TopicDefinition } from '@sprucelabs/spruce-conversation-plugin'
|
|
2
|
+
|
|
3
|
+
const topicDefinition: TopicDefinition = {
|
|
4
|
+
label: '{{nameReadable}}',
|
|
5
|
+
utterances: ['book appointment', 'Can i book my appointment?', 'book now', 'do you have any times available?', 'what is the wait time?'],
|
|
6
|
+
script: ['Sweet, lets book!', 'Lemme find your appointment!', async (options) => {
|
|
7
|
+
const confirm = await options.ui.confirm('Ok, you ready to do this?')
|
|
8
|
+
if (!confirm) {
|
|
9
|
+
await options.ui.renderLine('Ok, see you later!')
|
|
10
|
+
return {
|
|
11
|
+
transitionConversationTo: 'discovery'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return
|
|
16
|
+
}],
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default topicDefinition
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { plugin as default } from '@sprucelabs/spruce-deploy-plugin'
|