@sprucelabs/spruce-templates 22.1.13 → 22.3.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 +24 -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 +109 -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/Test.test.ts.hbs +20 -0
- package/build/dist/templates/typescript/view/App.avc.ts.hbs +5 -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 +78 -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 +138 -0
- package/build/esm/index.js +255 -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 +24 -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 +109 -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/Test.test.ts.hbs +20 -0
- package/build/esm/templates/typescript/view/App.avc.ts.hbs +5 -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 +78 -0
- package/build/esm/types/templates.types.d.ts +121 -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.d.ts +3 -2
- package/build/index.js +4 -0
- package/build/index.js.map +1 -0
- package/build/templates/typescript/view/App.avc.ts.hbs +5 -0
- package/build/templates/typescript/view/views.ts.hbs +6 -1
- package/build/types/templates.types.d.ts +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 +9 -9
- package/LICENSE +0 -21
|
@@ -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'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{{#if renderClassDefinition}}
|
|
2
|
+
import BaseSpruceError from '@sprucelabs/error'
|
|
3
|
+
import ErrorOptions from '#spruce/errors/options.types'
|
|
4
|
+
|
|
5
|
+
export default class SpruceError extends BaseSpruceError<ErrorOptions>{
|
|
6
|
+
|
|
7
|
+
/** an easy to understand version of the errors */
|
|
8
|
+
public friendlyMessage():string {
|
|
9
|
+
|
|
10
|
+
const { options } = this
|
|
11
|
+
let message
|
|
12
|
+
switch (options?.code) {
|
|
13
|
+
{{/if}}
|
|
14
|
+
{{#each errors}}
|
|
15
|
+
case '{{code}}':
|
|
16
|
+
message = '{{#if description}}{{{escape description}}}{{else}}A {{{escape nameReadable}}} just happened!{{/if}}'
|
|
17
|
+
break
|
|
18
|
+
{{/each}}
|
|
19
|
+
{{#if renderClassDefinition}}
|
|
20
|
+
default:
|
|
21
|
+
message = super.friendlyMessage()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const fullMessage = options.friendlyMessage
|
|
25
|
+
? options.friendlyMessage
|
|
26
|
+
: message
|
|
27
|
+
|
|
28
|
+
return fullMessage
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
{{/if}}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import globby from '@sprucelabs/globby'
|
|
2
|
+
import {
|
|
3
|
+
ErrorHealthCheckItem,
|
|
4
|
+
SkillFeature,
|
|
5
|
+
Skill,
|
|
6
|
+
diskUtil,
|
|
7
|
+
HASH_SPRUCE_DIR_NAME,
|
|
8
|
+
BootCallback,
|
|
9
|
+
} from '@sprucelabs/spruce-skill-utils'
|
|
10
|
+
|
|
11
|
+
class ErrorSkillFeature implements SkillFeature {
|
|
12
|
+
private skill: Skill
|
|
13
|
+
private _isBooted = false
|
|
14
|
+
private bootHandler?: BootCallback
|
|
15
|
+
|
|
16
|
+
public constructor(skill: Skill) {
|
|
17
|
+
this.skill = skill
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public onBoot(cb: BootCallback) {
|
|
21
|
+
this.bootHandler = cb
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public execute = async () => {
|
|
25
|
+
this._isBooted = true
|
|
26
|
+
void this.bootHandler?.()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public checkHealth = async () => {
|
|
30
|
+
const errorFiles = await this.getErrors()
|
|
31
|
+
|
|
32
|
+
const errors = errorFiles.map((path) => {
|
|
33
|
+
const schema = require(path).default
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
id: schema.id,
|
|
37
|
+
name: schema.name,
|
|
38
|
+
description: schema.description,
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const health: ErrorHealthCheckItem = {
|
|
43
|
+
status: 'passed',
|
|
44
|
+
errorSchemas: errors,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return health
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public isInstalled = async () => {
|
|
51
|
+
return true
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public async destroy() {
|
|
55
|
+
this._isBooted = false
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public isBooted() {
|
|
59
|
+
return this._isBooted
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private async getErrors() {
|
|
63
|
+
const schemaFiles = await globby(
|
|
64
|
+
diskUtil.resolvePath(
|
|
65
|
+
this.skill.activeDir,
|
|
66
|
+
HASH_SPRUCE_DIR_NAME,
|
|
67
|
+
'errors',
|
|
68
|
+
'**/*.schema.[t|j]s'
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
return schemaFiles
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default (skill: Skill) => {
|
|
76
|
+
const feature = new ErrorSkillFeature(skill)
|
|
77
|
+
skill.registerFeature('error', feature)
|
|
78
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SpruceErrors } from "#spruce/errors/errors.types"
|
|
2
|
+
import { ErrorOptions as ISpruceErrorOptions} from "@sprucelabs/error"
|
|
3
|
+
|
|
4
|
+
{{#each options}}
|
|
5
|
+
export interface {{namePascal}}ErrorOptions extends SpruceErrors.{{namespace}}.{{namePascal}}, ISpruceErrorOptions {
|
|
6
|
+
code: '{{code}}'
|
|
7
|
+
}
|
|
8
|
+
{{/each}}
|
|
9
|
+
|
|
10
|
+
type ErrorOptions = {{#each options}} | {{namePascal}}ErrorOptions {{/each}}
|
|
11
|
+
|
|
12
|
+
export default ErrorOptions
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import '#spruce/permissions/permissions.types'
|
|
2
|
+
{{#each imports}}
|
|
3
|
+
import {{importAs}} from '{{package}}'
|
|
4
|
+
{{/each}}
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const {{nameCamel}}EventContract = buildEventContract({
|
|
8
|
+
eventSignatures: {
|
|
9
|
+
{{#each eventSignatures}}
|
|
10
|
+
'{{@key}}': {
|
|
11
|
+
{{#if isGlobal}}isGlobal: true,{{/if}}
|
|
12
|
+
{{#if emitPermissions}}emitPermissions: {{{json emitPermissions}}},{{/if}}
|
|
13
|
+
{{#if listenPermissions}}listenPermissions: {{{json listenPermissions}}},{{/if}}
|
|
14
|
+
{{#if emitPayloadSchema}}emitPayloadSchema: {{emitPayloadSchema.nameCamel}}Schema,{{/if}}
|
|
15
|
+
{{#if responsePayloadSchema}}responsePayloadSchema: {{responsePayloadSchema.nameCamel}}Schema,{{/if}}
|
|
16
|
+
{{#if emitPermissionContract}}emitPermissionContract: {{{ permissionContractBuilder emitPermissionContract }}},{{/if}}
|
|
17
|
+
{{#if listenPermissionContract}}listenPermissionContract: {{{ permissionContractBuilder listenPermissionContract }}},{{/if}}
|
|
18
|
+
}
|
|
19
|
+
{{/each}}
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
export default {{nameCamel}}EventContract
|
|
23
|
+
|
|
24
|
+
export type {{namePascal}}EventContract = typeof {{nameCamel}}EventContract
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventSignature } from '@sprucelabs/mercury-types'
|
|
2
|
+
import '#spruce/permissions/permissions.types'
|
|
3
|
+
import '@sprucelabs/mercury-core-events'
|
|
4
|
+
|
|
5
|
+
type Options = Omit<EventSignature, 'responsePayloadSchema'| 'emitPayloadSchema'| 'listenPermissionContract'| 'emitPermissionContract' >
|
|
6
|
+
|
|
7
|
+
const eventOptions: Options = {
|
|
8
|
+
isGlobal: {{isGlobal}},
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default eventOptions
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{{#if shouldImportCoreEvents}}import { coreEventContracts } from '@sprucelabs/mercury-core-events'{{/if}}
|
|
2
|
+
|
|
3
|
+
{{#each contracts}}
|
|
4
|
+
import {{namespaceCamel}}{{namePascal}}EventContract_{{version}}, { {{namePascal}}EventContract as {{namespacePascal}}{{namePascal}}EventContract_{{version}} } from '#spruce/events/{{ namespaceCamel }}/{{ nameCamel }}.{{ version }}.contract'
|
|
5
|
+
{{/each}}
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{{#each contracts}}
|
|
9
|
+
{{namespaceCamel}}{{namePascal}}EventContract_{{version}},
|
|
10
|
+
{{/each}}
|
|
11
|
+
{{#if shouldImportCoreEvents}}...coreEventContracts,{{/if}}
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
declare module '{{skillEventContractTypesFile}}' {
|
|
15
|
+
interface SkillEventSignatures {
|
|
16
|
+
{{#each contracts}}
|
|
17
|
+
|
|
18
|
+
{{#each eventSignatures}}
|
|
19
|
+
'{{@key}}': {{../namespacePascal}}{{../namePascal}}EventContract_{{../version}}['eventSignatures']['{{@key}}'],
|
|
20
|
+
{{/each}}
|
|
21
|
+
|
|
22
|
+
{{/each}}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import SpruceError from '#spruce/../errors/SpruceError'
|
|
2
|
+
import { SpruceEvent, SpruceEventResponse } from '@sprucelabs/spruce-event-utils'
|
|
3
|
+
{{#if emitPayloadSchemaTemplateItem}}import { SkillEventContract } from '@sprucelabs/mercury-types'{{/if}}
|
|
4
|
+
{{#if shouldImportGlobalSchema}}import { {{globalSchemaNamespace}} } from '{{schemaTypesFile}}'{{/if}}
|
|
5
|
+
|
|
6
|
+
export default async (event: SpruceEvent{{#if emitPayloadSchemaTemplateItem}}<SkillEventContract, EmitPayload>{{/if}}): SpruceEventResponse{{#if responsePayloadSchemaTemplateItem}}<ResponsePayload>{{/if}} => {
|
|
7
|
+
console.log(event)
|
|
8
|
+
|
|
9
|
+
throw new SpruceError({
|
|
10
|
+
//@ts-ignore
|
|
11
|
+
code: 'LISTENER_NOT_IMPLEMENTED',
|
|
12
|
+
//@ts-ignore
|
|
13
|
+
fullyQualifiedEventName: '{{fullyQualifiedEventName}}'
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
//return {}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
{{#if emitPayloadSchemaTemplateItem}}
|
|
20
|
+
type EmitPayload = {{{ schemaNamespacePath schemaTemplateItem=emitPayloadSchemaTemplateItem }}}
|
|
21
|
+
{{/if}}{{#if responsePayloadSchemaTemplateItem}}
|
|
22
|
+
type ResponsePayload = {{{ schemaNamespacePath schemaTemplateItem=responsePayloadSchemaTemplateItem }}}
|
|
23
|
+
{{/if}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EventFeatureListener } from '@sprucelabs/spruce-event-utils'
|
|
2
|
+
|
|
3
|
+
const listeners: EventFeatureListener[] = [
|
|
4
|
+
{{#each listeners}}
|
|
5
|
+
{
|
|
6
|
+
eventName: '{{eventName}}',
|
|
7
|
+
eventNamespace: '{{eventNamespace}}',
|
|
8
|
+
version: '{{version}}',
|
|
9
|
+
callback: require('{{path}}').default,
|
|
10
|
+
isGlobal: require('{{path}}').isGlobal,
|
|
11
|
+
},
|
|
12
|
+
{{/each}}
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
export default listeners
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildSchema
|
|
3
|
+
} from '@sprucelabs/schema'
|
|
4
|
+
|
|
5
|
+
const {{nameCamel}}{{actionCamel}}Builder = buildSchema({
|
|
6
|
+
id: '{{nameCamel}}{{actionCamel}}',
|
|
7
|
+
fields: {
|
|
8
|
+
aTextField: {
|
|
9
|
+
type: 'text',
|
|
10
|
+
label: 'Update me',
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export default {{nameCamel}}{{actionCamel}}Builder
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Level, LogTransport } from '@sprucelabs/spruce-skill-utils'
|
|
2
|
+
|
|
3
|
+
export default function (): {
|
|
4
|
+
levels: Level[]
|
|
5
|
+
transport: LogTransport
|
|
6
|
+
} | null {
|
|
7
|
+
return {
|
|
8
|
+
levels: [],
|
|
9
|
+
transport: (...messageParts: string[]) => {
|
|
10
|
+
const message = messageParts.join(' ')
|
|
11
|
+
console.log(message)
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildPermissionContract
|
|
3
|
+
} from '@sprucelabs/mercury-types'
|
|
4
|
+
|
|
5
|
+
const {{ nameCamel }}Permissions = buildPermissionContract({
|
|
6
|
+
id: '{{nameKebab}}',
|
|
7
|
+
name: '{{{escape nameReadable}}}',
|
|
8
|
+
description: '{{{escape description}}}',
|
|
9
|
+
requireAllPermissions: false,
|
|
10
|
+
permissions: [
|
|
11
|
+
{
|
|
12
|
+
id: 'can-high-five',
|
|
13
|
+
name: 'Can give high five',
|
|
14
|
+
description: 'Will this person be allowed to high five?',
|
|
15
|
+
|
|
16
|
+
defaults: {
|
|
17
|
+
/**
|
|
18
|
+
Uncomment this comment to set which roles will pass by default. Keep
|
|
19
|
+
in mind this is overridden by the people who install your skill.
|
|
20
|
+
|
|
21
|
+
guest: { onPrem: true },
|
|
22
|
+
owner: { onPrem: true },
|
|
23
|
+
groupManager: { onPrem: true },
|
|
24
|
+
manager: { onPrem: true },
|
|
25
|
+
teammate: { onPrem: true },
|
|
26
|
+
anonymous: { default: false },
|
|
27
|
+
|
|
28
|
+
**/
|
|
29
|
+
skill: false,
|
|
30
|
+
},
|
|
31
|
+
requireAllStatuses: false,
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
export default {{ nameCamel }}Permissions
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { plugin as default } from '@sprucelabs/spruce-permission-plugin'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PermissionContract } from "@sprucelabs/mercury-types"
|
|
2
|
+
{{#each contracts}}
|
|
3
|
+
import {{nameCamel}}PermissionContract from '{{path}}'
|
|
4
|
+
{{/each}}
|
|
5
|
+
|
|
6
|
+
const contracts: PermissionContract[] = [
|
|
7
|
+
{{#each contracts}}
|
|
8
|
+
{{nameCamel}}PermissionContract,
|
|
9
|
+
{{/each}}
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export default contracts
|