@sprucelabs/spruce-cli 18.1.8 → 18.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/CHANGELOG.md +12 -0
- package/build/.spruce/events/events.contract.d.ts +159 -0
- package/build/.spruce/events/events.contract.js +5 -1
- package/build/.spruce/events/events.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/getActiveTheme.v2021_02_11.contract.d.ts +46 -0
- package/build/.spruce/events/heartwood/getActiveTheme.v2021_02_11.contract.js +57 -0
- package/build/.spruce/events/heartwood/getActiveTheme.v2021_02_11.contract.js.map +1 -0
- package/build/.spruce/events/heartwood/registerDashboardCards.v2021_02_11.contract.d.ts +68 -0
- package/build/.spruce/events/heartwood/registerDashboardCards.v2021_02_11.contract.js +78 -0
- package/build/.spruce/events/heartwood/registerDashboardCards.v2021_02_11.contract.js.map +1 -0
- package/build/.spruce/events/heartwood/upsertTheme.v2021_02_11.contract.d.ts +40 -0
- package/build/.spruce/events/heartwood/upsertTheme.v2021_02_11.contract.js +51 -0
- package/build/.spruce/events/heartwood/upsertTheme.v2021_02_11.contract.js.map +1 -0
- package/build/.spruce/events/spruceCli/registerSkillViews.v2021_04_11.contract.d.ts +9 -0
- package/build/.spruce/events/spruceCli/registerSkillViews.v2021_04_11.contract.js +17 -0
- package/build/.spruce/events/spruceCli/registerSkillViews.v2021_04_11.contract.js.map +1 -0
- package/build/.spruce/schemas/schemas.types.d.ts +158 -55
- package/build/.spruce/schemas/schemas.types.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/actionResponse.schema.d.ts +3 -0
- package/build/.spruce/schemas/spruceCli/v2020_07_22/actionResponse.schema.js +70 -0
- package/build/.spruce/schemas/spruceCli/v2020_07_22/actionResponse.schema.js.map +1 -0
- package/build/.spruce/schemas/spruceCli/v2020_07_22/npmPackage.schema.d.ts +3 -0
- package/build/.spruce/schemas/spruceCli/v2020_07_22/npmPackage.schema.js +35 -0
- package/build/.spruce/schemas/spruceCli/v2020_07_22/npmPackage.schema.js.map +1 -0
- package/build/.spruce/settings.json +2 -1
- package/build/GlobalEmitter.d.ts +13 -38
- package/build/GlobalEmitter.js +3 -6
- package/build/GlobalEmitter.js.map +1 -1
- package/build/__tests__/behavioral/TestingAConversation.test.d.ts +2 -1
- package/build/__tests__/behavioral/TestingAConversation.test.js +74 -84
- package/build/__tests__/behavioral/TestingAConversation.test.js.map +1 -1
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js +38 -13
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.d.ts +1 -0
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js +16 -9
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.d.ts +2 -2
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js +7 -7
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionPlugin.test.d.ts +6 -0
- package/build/__tests__/behavioral/permissions/PermissionPlugin.test.js +85 -0
- package/build/__tests__/behavioral/permissions/PermissionPlugin.test.js.map +1 -0
- package/build/__tests__/behavioral/permissions/PermissionStore.test.d.ts +12 -2
- package/build/__tests__/behavioral/permissions/PermissionStore.test.js +248 -36
- package/build/__tests__/behavioral/permissions/PermissionStore.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionWriter.test.d.ts +5 -0
- package/build/__tests__/behavioral/permissions/PermissionWriter.test.js +88 -0
- package/build/__tests__/behavioral/permissions/PermissionWriter.test.js.map +1 -0
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.d.ts +15 -4
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js +325 -28
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/support/AbstractPermissionsTest.d.ts +11 -0
- package/build/__tests__/behavioral/permissions/{AbstractPermissionsTest.js → support/AbstractPermissionsTest.js} +34 -2
- package/build/__tests__/behavioral/permissions/support/AbstractPermissionsTest.js.map +1 -0
- package/build/__tests__/behavioral/permissions/support/generateShortAlphaId.d.ts +1 -0
- package/build/__tests__/behavioral/permissions/support/generateShortAlphaId.js +11 -0
- package/build/__tests__/behavioral/permissions/support/generateShortAlphaId.js.map +1 -0
- package/build/__tests__/behavioral/permissions/support/renderPermissionTestFile.d.ts +1 -0
- package/build/__tests__/behavioral/permissions/support/renderPermissionTestFile.js +17 -0
- package/build/__tests__/behavioral/permissions/support/renderPermissionTestFile.js.map +1 -0
- package/build/__tests__/behavioral/permissions/support/sortPermissionContracts.d.ts +5 -0
- package/build/__tests__/behavioral/permissions/support/sortPermissionContracts.js +10 -0
- package/build/__tests__/behavioral/permissions/support/sortPermissionContracts.js.map +1 -0
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.d.ts +1 -1
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js +46 -46
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/CreatingATest.test.js +2 -2
- package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js +7 -3
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js +2 -2
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter2.test.d.ts +1 -1
- package/build/__tests__/implementation/ActionExecuter2.test.js +23 -11
- package/build/__tests__/implementation/ActionExecuter2.test.js.map +1 -1
- package/build/__tests__/implementation/GlobalEmitter.test.d.ts +1 -0
- package/build/__tests__/implementation/GlobalEmitter.test.js +40 -3
- package/build/__tests__/implementation/GlobalEmitter.test.js.map +1 -1
- package/build/__tests__/implementation/SkillStore.test.js +3 -4
- package/build/__tests__/implementation/SkillStore.test.js.map +1 -1
- package/build/__tests__/support/EventFaker.d.ts +5 -0
- package/build/__tests__/support/EventFaker.js +48 -0
- package/build/__tests__/support/EventFaker.js.map +1 -0
- package/build/features/AbstractAction.d.ts +1 -1
- package/build/features/AbstractAction.js.map +1 -1
- package/build/features/AbstractFeature.d.ts +3 -3
- package/build/features/AbstractFeature.js +8 -8
- package/build/features/AbstractFeature.js.map +1 -1
- package/build/features/ActionExecuter.d.ts +1 -1
- package/build/features/ActionExecuter.js +3 -4
- package/build/features/ActionExecuter.js.map +1 -1
- package/build/features/ActionFactory.d.ts +12 -5
- package/build/features/ActionFactory.js +27 -6
- package/build/features/ActionFactory.js.map +1 -1
- package/build/features/ActionQuestionAsker.d.ts +1 -1
- package/build/features/ActionQuestionAsker.js +6 -6
- package/build/features/ActionQuestionAsker.js.map +1 -1
- package/build/features/conversation/ConversationFeature.js +1 -1
- package/build/features/conversation/ConversationFeature.js.map +1 -1
- package/build/features/dependencies/DependencyFeature.js +1 -1
- package/build/features/dependencies/DependencyFeature.js.map +1 -1
- package/build/features/deploy/actions/HerokuAction.js +31 -33
- package/build/features/deploy/actions/HerokuAction.js.map +1 -1
- package/build/features/error/ErrorFeature.js +4 -4
- package/build/features/error/ErrorFeature.js.map +1 -1
- package/build/features/event/EventFeature.d.ts +8 -8
- package/build/features/event/EventFeature.js +7 -4
- package/build/features/event/EventFeature.js.map +1 -1
- package/build/features/event/actions/CreateAction.js.map +1 -1
- package/build/features/event/actions/ListenAction.js.map +1 -1
- package/build/features/event/stores/EventStore.d.ts +9 -9
- package/build/features/event/stores/EventStore.js +26 -26
- package/build/features/event/stores/EventStore.js.map +1 -1
- package/build/features/eventContract/EventContractFeature.js +4 -1
- package/build/features/eventContract/EventContractFeature.js.map +1 -1
- package/build/features/eventContract/actions/PullAction.js +10 -5
- package/build/features/eventContract/actions/PullAction.js.map +1 -1
- package/build/features/features.types.d.ts +2 -37
- package/build/features/features.types.js +0 -41
- package/build/features/features.types.js.map +1 -1
- package/build/features/log/LogFeature.js +1 -1
- package/build/features/log/LogFeature.js.map +1 -1
- package/build/features/node/NodeFeature.js.map +1 -1
- package/build/features/organization/actions/InstallAction.js.map +1 -1
- package/build/features/permission/PermissionFeature.d.ts +12 -2
- package/build/features/permission/PermissionFeature.js +140 -15
- package/build/features/permission/PermissionFeature.js.map +1 -1
- package/build/features/permission/actions/CreateAction.js +4 -1
- package/build/features/permission/actions/CreateAction.js.map +1 -1
- package/build/features/permission/actions/SyncAction.d.ts +5 -1
- package/build/features/permission/actions/SyncAction.js +28 -10
- package/build/features/permission/actions/SyncAction.js.map +1 -1
- package/build/features/permission/stores/PermissionStore.d.ts +7 -1
- package/build/features/permission/stores/PermissionStore.js +92 -23
- package/build/features/permission/stores/PermissionStore.js.map +1 -1
- package/build/features/permission/writers/PermissionWriter.d.ts +7 -1
- package/build/features/permission/writers/PermissionWriter.js +66 -17
- package/build/features/permission/writers/PermissionWriter.js.map +1 -1
- package/build/features/person/PersonFeature.js +1 -1
- package/build/features/person/PersonFeature.js.map +1 -1
- package/build/features/sandbox/SandboxFeature.js +1 -1
- package/build/features/sandbox/SandboxFeature.js.map +1 -1
- package/build/features/schema/SchemaFeature.d.ts +8 -8
- package/build/features/schema/SchemaFeature.js +4 -4
- package/build/features/schema/SchemaFeature.js.map +1 -1
- package/build/features/schema/writers/SchemaWriter.d.ts +12 -12
- package/build/features/schema/writers/SchemaWriter.js.map +1 -1
- package/build/features/skill/SkillFeature.d.ts +11 -11
- package/build/features/skill/SkillFeature.js +2 -2
- package/build/features/skill/SkillFeature.js.map +1 -1
- package/build/features/skill/actions/RebuildAction.js.map +1 -1
- package/build/features/skill/actions/RegisterAction.js.map +1 -1
- package/build/features/skill/stores/SkillStore.js +1 -2
- package/build/features/skill/stores/SkillStore.js.map +1 -1
- package/build/features/store/StoreFeature.js +1 -1
- package/build/features/store/StoreFeature.js.map +1 -1
- package/build/features/store/actions/SyncAction.d.ts +1 -1
- package/build/features/store/actions/SyncAction.js.map +1 -1
- package/build/features/test/TestFeature.js +1 -1
- package/build/features/test/TestFeature.js.map +1 -1
- package/build/features/view/ViewFeature.js +1 -1
- package/build/features/view/ViewFeature.js.map +1 -1
- package/build/schemas/v2020_07_22/actionResponse.builder.d.ts +85 -0
- package/build/schemas/v2020_07_22/actionResponse.builder.js +70 -0
- package/build/schemas/v2020_07_22/actionResponse.builder.js.map +1 -0
- package/build/schemas/v2020_07_22/generatedFile.builder.d.ts +27 -0
- package/build/schemas/v2020_07_22/generatedFile.builder.js +45 -0
- package/build/schemas/v2020_07_22/generatedFile.builder.js.map +1 -0
- package/build/schemas/v2020_07_22/watcherDidDetectChangesEmitPayload.builder.js +4 -40
- package/build/schemas/v2020_07_22/watcherDidDetectChangesEmitPayload.builder.js.map +1 -1
- package/build/services/CommandService.d.ts +2 -2
- package/build/services/CommandService.js +6 -6
- package/build/services/CommandService.js.map +1 -1
- package/build/services/PkgService.d.ts +1 -0
- package/build/services/PkgService.js +5 -0
- package/build/services/PkgService.js.map +1 -1
- package/build/tests/AbstractCliTest.d.ts +7 -3
- package/build/tests/AbstractCliTest.js +81 -45
- package/build/tests/AbstractCliTest.js.map +1 -1
- package/build/tests/buildTestCache.js +7 -0
- package/build/tests/buildTestCache.js.map +1 -1
- package/build/tests/fixtures/FeatureFixture.js +1 -0
- package/build/tests/fixtures/FeatureFixture.js.map +1 -1
- package/build/tests/utilities/test.utility.d.ts +2 -0
- package/build/tests/utilities/test.utility.js +6 -0
- package/build/tests/utilities/test.utility.js.map +1 -1
- package/node_modules/@typescript-eslint/parser/package.json +6 -6
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js +9 -9
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js +21 -7
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js +2 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js +39 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts +4 -2
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +13 -5
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts +2 -2
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js +9 -9
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js +17 -17
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts +2 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/package.json +12 -12
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/generated/ast-spec.d.ts +27 -3
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/lib.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/parser-options.d.ts +3 -3
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +27 -3
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js +3 -0
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +3 -3
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/package.json +3 -3
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/shared.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parseSettings/index.d.ts +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser-options.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/simple-traverse.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/estree-to-ts-node-types.d.ts +4 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/ts-nodes.d.ts +4 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +22 -3
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js +9 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts +4 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts +4 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/package.json +6 -6
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js +63 -48
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map +1 -1
- package/node_modules/@typescript-eslint/visitor-keys/package.json +4 -4
- package/package.json +65 -33
- package/src/.spruce/events/events.contract.ts +24 -0
- package/src/.spruce/events/heartwood/getActiveTheme.v2021_02_11.contract.ts +54 -0
- package/src/.spruce/events/heartwood/registerDashboardCards.v2021_02_11.contract.ts +79 -0
- package/src/.spruce/events/heartwood/upsertTheme.v2021_02_11.contract.ts +48 -0
- package/src/.spruce/events/spruceCli/registerSkillViews.v2021_04_11.contract.ts +13 -0
- package/src/.spruce/schemas/schemas.types.ts +171 -52
- package/src/.spruce/schemas/spruceCli/v2020_07_22/actionResponse.schema.ts +58 -0
- package/src/.spruce/schemas/spruceCli/v2020_07_22/npmPackage.schema.ts +33 -0
- package/src/.spruce/settings.json +2 -1
- package/src/GlobalEmitter.ts +2 -7
- package/src/__tests__/behavioral/TestingAConversation.test.ts +20 -37
- package/src/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.ts +14 -2
- package/src/__tests__/behavioral/events/SkillEmitsBootEvents.test.ts +6 -0
- package/src/__tests__/behavioral/permissions/CreatingPermissions.test.ts +2 -2
- package/src/__tests__/behavioral/permissions/PermissionPlugin.test.ts +24 -0
- package/src/__tests__/behavioral/permissions/PermissionStore.test.ts +204 -23
- package/src/__tests__/behavioral/permissions/PermissionWriter.test.ts +23 -0
- package/src/__tests__/behavioral/permissions/SyncingPermissions.test.ts +125 -8
- package/src/__tests__/behavioral/permissions/support/AbstractPermissionsTest.ts +38 -0
- package/src/__tests__/behavioral/permissions/support/generateShortAlphaId.ts +5 -0
- package/src/__tests__/behavioral/permissions/support/renderPermissionTestFile.ts +27 -0
- package/src/__tests__/behavioral/permissions/support/sortPermissionContracts.ts +3 -0
- package/src/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.ts +12 -12
- package/src/__tests__/behavioral/tests/CreatingATest.test.ts +2 -2
- package/src/__tests__/behavioral/upgrading/UpgradingANodeModule.test.ts +3 -0
- package/src/__tests__/behavioral/upgrading/UpgradingASkill3.test.ts +3 -2
- package/src/__tests__/behavioral/upgrading/UpgradingASkill4.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter2.test.ts +13 -6
- package/src/__tests__/implementation/GlobalEmitter.test.ts +22 -1
- package/src/__tests__/implementation/SkillStore.test.ts +1 -2
- package/src/__tests__/support/EventFaker.ts +23 -0
- package/src/features/AbstractAction.ts +2 -2
- package/src/features/AbstractFeature.ts +8 -8
- package/src/features/ActionExecuter.ts +4 -5
- package/src/features/ActionFactory.ts +44 -20
- package/src/features/ActionQuestionAsker.ts +17 -17
- package/src/features/conversation/ConversationFeature.ts +1 -1
- package/src/features/dependencies/DependencyFeature.ts +1 -1
- package/src/features/deploy/actions/HerokuAction.ts +2 -2
- package/src/features/error/ErrorFeature.ts +4 -4
- package/src/features/event/EventFeature.ts +15 -14
- package/src/features/event/actions/CreateAction.ts +1 -1
- package/src/features/event/actions/ListenAction.ts +1 -1
- package/src/features/event/stores/EventStore.ts +37 -37
- package/src/features/eventContract/EventContractFeature.ts +6 -1
- package/src/features/eventContract/actions/PullAction.ts +7 -3
- package/src/features/features.types.ts +4 -41
- package/src/features/log/LogFeature.ts +1 -1
- package/src/features/node/NodeFeature.ts +1 -1
- package/src/features/organization/actions/InstallAction.ts +1 -1
- package/src/features/permission/PermissionFeature.ts +66 -11
- package/src/features/permission/actions/CreateAction.ts +2 -0
- package/src/features/permission/actions/SyncAction.ts +22 -3
- package/src/features/permission/stores/PermissionStore.ts +44 -3
- package/src/features/permission/writers/PermissionWriter.ts +64 -3
- package/src/features/person/PersonFeature.ts +1 -1
- package/src/features/sandbox/SandboxFeature.ts +1 -3
- package/src/features/schema/SchemaFeature.ts +14 -14
- package/src/features/schema/writers/SchemaWriter.ts +14 -15
- package/src/features/skill/SkillFeature.ts +18 -18
- package/src/features/skill/actions/RebuildAction.ts +1 -1
- package/src/features/skill/actions/RegisterAction.ts +1 -1
- package/src/features/skill/stores/SkillStore.ts +1 -2
- package/src/features/store/StoreFeature.ts +1 -1
- package/src/features/store/actions/SyncAction.ts +1 -1
- package/src/features/test/TestFeature.ts +1 -1
- package/src/features/view/ViewFeature.ts +1 -1
- package/src/schemas/v2020_07_22/actionResponse.builder.ts +62 -0
- package/src/schemas/v2020_07_22/generatedFile.builder.ts +44 -0
- package/src/schemas/v2020_07_22/watcherDidDetectChangesEmitPayload.builder.ts +3 -46
- package/src/services/CommandService.ts +5 -5
- package/src/services/PkgService.ts +4 -0
- package/src/tests/AbstractCliTest.ts +31 -13
- package/src/tests/buildTestCache.ts +7 -0
- package/src/tests/fixtures/FeatureFixture.ts +2 -0
- package/src/tests/utilities/test.utility.ts +13 -0
- package/build/__tests__/behavioral/permissions/AbstractPermissionsTest.d.ts +0 -8
- package/build/__tests__/behavioral/permissions/AbstractPermissionsTest.js.map +0 -1
- package/src/__tests__/behavioral/permissions/AbstractPermissionsTest.ts +0 -20
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { buildSchema } from '@sprucelabs/schema'
|
|
2
|
+
import generatedFileBuilder from './generatedFile.builder'
|
|
3
|
+
|
|
4
|
+
export default buildSchema({
|
|
5
|
+
id: 'actionResponse',
|
|
6
|
+
name: 'Action response',
|
|
7
|
+
importsWhenLocal: [`import AbstractSpruceError from '@sprucelabs/error'`],
|
|
8
|
+
fields: {
|
|
9
|
+
files: {
|
|
10
|
+
type: 'schema',
|
|
11
|
+
isArray: true,
|
|
12
|
+
options: {
|
|
13
|
+
schema: generatedFileBuilder,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
headline: {
|
|
17
|
+
type: 'text',
|
|
18
|
+
},
|
|
19
|
+
hints: {
|
|
20
|
+
type: 'text',
|
|
21
|
+
isArray: true,
|
|
22
|
+
},
|
|
23
|
+
summaryLines: {
|
|
24
|
+
type: 'text',
|
|
25
|
+
isArray: true,
|
|
26
|
+
},
|
|
27
|
+
errors: {
|
|
28
|
+
type: 'raw',
|
|
29
|
+
isArray: true,
|
|
30
|
+
options: {
|
|
31
|
+
valueType: 'AbstractSpruceError<any>',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
meta: {
|
|
35
|
+
type: 'raw',
|
|
36
|
+
options: {
|
|
37
|
+
valueType: 'Record<string, any>',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
packagesInstalled: {
|
|
41
|
+
type: 'schema',
|
|
42
|
+
isArray: true,
|
|
43
|
+
options: {
|
|
44
|
+
schema: buildSchema({
|
|
45
|
+
id: 'npmPackage',
|
|
46
|
+
fields: {
|
|
47
|
+
name: {
|
|
48
|
+
type: 'text',
|
|
49
|
+
isRequired: true,
|
|
50
|
+
},
|
|
51
|
+
version: {
|
|
52
|
+
type: 'text',
|
|
53
|
+
},
|
|
54
|
+
isDev: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { buildSchema } from '@sprucelabs/schema'
|
|
2
|
+
|
|
3
|
+
const generatedFileBuilder = buildSchema({
|
|
4
|
+
id: 'generatedFile',
|
|
5
|
+
fields: {
|
|
6
|
+
name: {
|
|
7
|
+
type: 'text',
|
|
8
|
+
isRequired: true,
|
|
9
|
+
},
|
|
10
|
+
path: {
|
|
11
|
+
type: 'text',
|
|
12
|
+
isRequired: true,
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: 'text',
|
|
16
|
+
},
|
|
17
|
+
action: {
|
|
18
|
+
type: 'select',
|
|
19
|
+
isRequired: true,
|
|
20
|
+
options: {
|
|
21
|
+
choices: [
|
|
22
|
+
{
|
|
23
|
+
label: 'Skipped',
|
|
24
|
+
value: 'skipped',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: 'Generated',
|
|
28
|
+
value: 'generated',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Updated',
|
|
32
|
+
value: 'updated',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Deleted',
|
|
36
|
+
value: 'deleted',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export default generatedFileBuilder
|
|
@@ -1,45 +1,5 @@
|
|
|
1
1
|
import { buildSchema } from '@sprucelabs/schema'
|
|
2
|
-
|
|
3
|
-
const fieldsSchema = buildSchema({
|
|
4
|
-
id: 'generatedFileFields',
|
|
5
|
-
fields: {
|
|
6
|
-
name: {
|
|
7
|
-
type: 'text',
|
|
8
|
-
isRequired: true,
|
|
9
|
-
},
|
|
10
|
-
path: {
|
|
11
|
-
type: 'text',
|
|
12
|
-
isRequired: true,
|
|
13
|
-
},
|
|
14
|
-
description: {
|
|
15
|
-
type: 'text',
|
|
16
|
-
},
|
|
17
|
-
action: {
|
|
18
|
-
type: 'select',
|
|
19
|
-
isRequired: true,
|
|
20
|
-
options: {
|
|
21
|
-
choices: [
|
|
22
|
-
{
|
|
23
|
-
label: 'Skipped',
|
|
24
|
-
value: 'skipped',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'Generated',
|
|
28
|
-
value: 'generated',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: 'Updated',
|
|
32
|
-
value: 'updated',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: 'Deleted',
|
|
36
|
-
value: 'deleted',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
})
|
|
2
|
+
import generatedFileBuilder from './generatedFile.builder'
|
|
43
3
|
|
|
44
4
|
export default buildSchema({
|
|
45
5
|
id: 'watcherDidDetectChangesEmitPayload',
|
|
@@ -51,13 +11,10 @@ export default buildSchema({
|
|
|
51
11
|
isArray: true,
|
|
52
12
|
options: {
|
|
53
13
|
schemas: [
|
|
54
|
-
|
|
55
|
-
id: 'generatedFile',
|
|
56
|
-
fields: fieldsSchema.fields,
|
|
57
|
-
}),
|
|
14
|
+
generatedFileBuilder,
|
|
58
15
|
buildSchema({
|
|
59
16
|
id: 'generatedDir',
|
|
60
|
-
fields:
|
|
17
|
+
fields: generatedFileBuilder.fields,
|
|
61
18
|
}),
|
|
62
19
|
],
|
|
63
20
|
},
|
|
@@ -13,7 +13,7 @@ export default class CommandService {
|
|
|
13
13
|
public cwd: string
|
|
14
14
|
private activeChildProcess: ChildProcess | undefined
|
|
15
15
|
private ignoreCloseErrors = false
|
|
16
|
-
private static
|
|
16
|
+
private static fakeResponses: {
|
|
17
17
|
command: string | RegExp
|
|
18
18
|
response: MockResponse
|
|
19
19
|
}[] = []
|
|
@@ -167,7 +167,7 @@ export default class CommandService {
|
|
|
167
167
|
|
|
168
168
|
private getMockResponse(executable: string, args: string[]) {
|
|
169
169
|
const mockKey = `${executable} ${args.join(' ')}`.trim()
|
|
170
|
-
const commands = CommandService.
|
|
170
|
+
const commands = CommandService.fakeResponses
|
|
171
171
|
const match = commands.find((r) =>
|
|
172
172
|
r.command instanceof RegExp
|
|
173
173
|
? mockKey.search(r.command) > -1
|
|
@@ -178,14 +178,14 @@ export default class CommandService {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
public static fakeCommand(command: string | RegExp, response: MockResponse) {
|
|
181
|
-
this.
|
|
181
|
+
this.fakeResponses.unshift({
|
|
182
182
|
command,
|
|
183
183
|
response,
|
|
184
184
|
})
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
public static
|
|
188
|
-
this.
|
|
187
|
+
public static clearFakedResponses() {
|
|
188
|
+
this.fakeResponses = []
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -93,6 +93,10 @@ export default class PkgService extends BasePkgService {
|
|
|
93
93
|
return { executable, args }
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
public getSkillNamespace() {
|
|
97
|
+
return this.get('skill.namespace')
|
|
98
|
+
}
|
|
99
|
+
|
|
96
100
|
public async uninstall(pkg: string[] | string) {
|
|
97
101
|
const packages = Array.isArray(pkg) ? pkg : [pkg]
|
|
98
102
|
const args: string[] = ['uninstall', ...packages]
|
|
@@ -46,10 +46,6 @@ import SkillFixture from './fixtures/SkillFixture'
|
|
|
46
46
|
import ViewFixture from './fixtures/ViewFixture'
|
|
47
47
|
import testUtil from './utilities/test.utility'
|
|
48
48
|
|
|
49
|
-
type ExecuterOptions = Partial<ActionExecuterOptions> & {
|
|
50
|
-
optionOverrides?: OptionOverrides
|
|
51
|
-
}
|
|
52
|
-
|
|
53
49
|
export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
54
50
|
protected static cliRoot = pathUtil.join(__dirname, '..')
|
|
55
51
|
protected static homeDir: string
|
|
@@ -64,6 +60,7 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
64
60
|
private static _featureInstaller?: FeatureInstaller
|
|
65
61
|
private static viewFixture?: ViewFixture
|
|
66
62
|
private static originalEnv: { [x: string]: string | undefined }
|
|
63
|
+
private static _writers?: WriterFactory
|
|
67
64
|
|
|
68
65
|
protected static async beforeAll() {
|
|
69
66
|
await super.beforeAll()
|
|
@@ -82,6 +79,10 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
82
79
|
protected static async beforeEach() {
|
|
83
80
|
await super.beforeEach()
|
|
84
81
|
|
|
82
|
+
delete this._writers
|
|
83
|
+
|
|
84
|
+
ActionFactory.clearActionOverrides()
|
|
85
|
+
|
|
85
86
|
//@ts-ignore
|
|
86
87
|
process.env = { ...this.originalEnv }
|
|
87
88
|
|
|
@@ -106,7 +107,7 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
106
107
|
ImportService.clearCache()
|
|
107
108
|
SkillStore.clearCurrentSkill()
|
|
108
109
|
EventStore.clearCache()
|
|
109
|
-
CommandService.
|
|
110
|
+
CommandService.clearFakedResponses()
|
|
110
111
|
MercuryClientFactory.reset()
|
|
111
112
|
MercuryClientFactory.setIsTestMode(false)
|
|
112
113
|
|
|
@@ -134,11 +135,15 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
134
135
|
if (diskUtil.doesDirExist(this.homeDir) && testUtil.shouldClearCache()) {
|
|
135
136
|
diskUtil.deleteDir(this.homeDir)
|
|
136
137
|
}
|
|
138
|
+
|
|
139
|
+
if (testUtil.shouldCleanupAfterEach()) {
|
|
140
|
+
FeatureFixture.deleteOldSkillDirs()
|
|
141
|
+
}
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
protected static async afterAll() {
|
|
140
145
|
await super.afterAll()
|
|
141
|
-
if (testUtil.
|
|
146
|
+
if (testUtil.shouldCleanupAfterAll()) {
|
|
142
147
|
FeatureFixture.deleteOldSkillDirs()
|
|
143
148
|
}
|
|
144
149
|
}
|
|
@@ -252,9 +257,7 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
252
257
|
|
|
253
258
|
protected static getViewFixture() {
|
|
254
259
|
if (!this.viewFixture) {
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const viewWriter = writerFactory.Writer('view', { fileDescriptions: [] })
|
|
260
|
+
const viewWriter = this.writers.Writer('view', { fileDescriptions: [] })
|
|
258
261
|
this.viewFixture = new ViewFixture(
|
|
259
262
|
this.cwd,
|
|
260
263
|
viewWriter,
|
|
@@ -265,6 +268,14 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
265
268
|
return this.viewFixture
|
|
266
269
|
}
|
|
267
270
|
|
|
271
|
+
protected static get writers() {
|
|
272
|
+
if (!this._writers) {
|
|
273
|
+
this._writers = this.WriterFactory()
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return this._writers
|
|
277
|
+
}
|
|
278
|
+
|
|
268
279
|
private static WriterFactory() {
|
|
269
280
|
return new WriterFactory({
|
|
270
281
|
templates,
|
|
@@ -388,8 +399,7 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
388
399
|
results: FeatureActionResponse
|
|
389
400
|
) {
|
|
390
401
|
for (const file of results.files ?? []) {
|
|
391
|
-
|
|
392
|
-
await checker.check(file.path)
|
|
402
|
+
await this.assertFilePassesTypeChecks(file.path)
|
|
393
403
|
}
|
|
394
404
|
|
|
395
405
|
// await Promise.all(
|
|
@@ -400,6 +410,11 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
400
410
|
// )
|
|
401
411
|
}
|
|
402
412
|
|
|
413
|
+
protected static async assertFilePassesTypeChecks(file: string) {
|
|
414
|
+
const checker = this.Service('typeChecker')
|
|
415
|
+
await checker.check(file)
|
|
416
|
+
}
|
|
417
|
+
|
|
403
418
|
protected static async connectToApi(options?: ApiClientFactoryOptions) {
|
|
404
419
|
return this.getMercuryFixture().connectToApi(options)
|
|
405
420
|
}
|
|
@@ -446,10 +461,9 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
446
461
|
|
|
447
462
|
protected static ActionExecuter(options?: ExecuterOptions) {
|
|
448
463
|
const serviceFactory = this.ServiceFactory()
|
|
449
|
-
const writerFactory = this.WriterFactory()
|
|
450
464
|
|
|
451
465
|
const actionFactory = new ActionFactory({
|
|
452
|
-
writerFactory,
|
|
466
|
+
writerFactory: this.writers,
|
|
453
467
|
ui: this.ui,
|
|
454
468
|
emitter: this.emitter,
|
|
455
469
|
apiClientFactory: this.getMercuryFixture().getApiClientFactory(),
|
|
@@ -492,3 +506,7 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
|
|
|
492
506
|
void this.ui.sendInput(`${match.value}`)
|
|
493
507
|
}
|
|
494
508
|
}
|
|
509
|
+
|
|
510
|
+
type ExecuterOptions = Partial<ActionExecuterOptions> & {
|
|
511
|
+
optionOverrides?: OptionOverrides
|
|
512
|
+
}
|
|
@@ -45,6 +45,13 @@ async function run() {
|
|
|
45
45
|
|
|
46
46
|
if (process.env.WILL_BUILD_CACHE_SCRIPT) {
|
|
47
47
|
term.renderLine('Running pre build cache script')
|
|
48
|
+
if (process.env.CLEAN_CACHE_SCRIPT) {
|
|
49
|
+
try {
|
|
50
|
+
execSync(process.env.CLEAN_CACHE_SCRIPT)
|
|
51
|
+
} catch {
|
|
52
|
+
/* Empty */
|
|
53
|
+
}
|
|
54
|
+
}
|
|
48
55
|
execSync(process.env.WILL_BUILD_CACHE_SCRIPT)
|
|
49
56
|
}
|
|
50
57
|
|
|
@@ -26,6 +26,19 @@ const testUtil = {
|
|
|
26
26
|
return process.env.CLEANUP_TEST_SKILL_DIRS !== 'false'
|
|
27
27
|
},
|
|
28
28
|
|
|
29
|
+
shouldCleanupAfterEach() {
|
|
30
|
+
return (
|
|
31
|
+
this.shouldCleanupTestSkillDirs() &&
|
|
32
|
+
process.env.CLEANUP_TEST_SKILL_DIRS_ON === 'afterEach'
|
|
33
|
+
)
|
|
34
|
+
},
|
|
35
|
+
shouldCleanupAfterAll() {
|
|
36
|
+
return (
|
|
37
|
+
this.shouldCleanupTestSkillDirs() &&
|
|
38
|
+
process.env.CLEANUP_TEST_SKILL_DIRS_ON !== 'afterEach'
|
|
39
|
+
)
|
|
40
|
+
},
|
|
41
|
+
|
|
29
42
|
getTestRootDir() {
|
|
30
43
|
return process.env.TEST_CACHE_ROOT_DIR ?? pathUtil.join(os.tmpdir())
|
|
31
44
|
},
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import CreateAction from '../../../features/permission/actions/CreateAction';
|
|
2
|
-
import AbstractSkillTest from '../../../tests/AbstractSkillTest';
|
|
3
|
-
export default abstract class AbstractPermissionsTest extends AbstractSkillTest {
|
|
4
|
-
protected static skillCacheKey: string;
|
|
5
|
-
protected static createAction: CreateAction;
|
|
6
|
-
protected static beforeEach(): Promise<void>;
|
|
7
|
-
protected static createPermissionContract(nameReadable: string): Promise<import("../../../features/features.types").FeatureActionResponse>;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractPermissionsTest.js","names":["AbstractPermissionsTest","createAction","Action","nameReadable","execute","nameCamel","namesUtil","toCamel","AbstractSkillTest"],"sources":["../../../../src/__tests__/behavioral/permissions/AbstractPermissionsTest.ts"],"sourcesContent":["import { namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport CreateAction from '../../../features/permission/actions/CreateAction'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\n\nexport default abstract class AbstractPermissionsTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'permissions'\n\tprotected static createAction: CreateAction\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\t\tthis.createAction = this.Action('permission', 'create')\n\t}\n\n\tprotected static async createPermissionContract(nameReadable: string) {\n\t\treturn await this.createAction.execute({\n\t\t\tnameReadable,\n\t\t\tnameCamel: namesUtil.toCamel(nameReadable),\n\t\t})\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAEA;AAAgE;AAAA;AAAA,IAElCA,uBAAuB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;MAAA,gGAIpD;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA;cAAA;gBAEC,IAAI,CAACC,YAAY,GAAG,IAAI,CAACC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACvD;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;IAAA;IAAA;MAAA,8GAED,kBAAgDC,YAAoB;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACtD,IAAI,CAACF,YAAY,CAACG,OAAO,CAAC;kBACtCD,YAAY,EAAZA,YAAY;kBACZE,SAAS,EAAEC,2BAAS,CAACC,OAAO,CAACJ,YAAY;gBAC1C,CAAC,CAAC;cAAA;gBAAA;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACF;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA,EAd4DK,8BAAiB;AAAA;AAAA,iCAAjDR,uBAAuB,mBACnB,aAAa;AAAA,iCADjBA,uBAAuB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { namesUtil } from '@sprucelabs/spruce-skill-utils'
|
|
2
|
-
import CreateAction from '../../../features/permission/actions/CreateAction'
|
|
3
|
-
import AbstractSkillTest from '../../../tests/AbstractSkillTest'
|
|
4
|
-
|
|
5
|
-
export default abstract class AbstractPermissionsTest extends AbstractSkillTest {
|
|
6
|
-
protected static skillCacheKey = 'permissions'
|
|
7
|
-
protected static createAction: CreateAction
|
|
8
|
-
|
|
9
|
-
protected static async beforeEach() {
|
|
10
|
-
await super.beforeEach()
|
|
11
|
-
this.createAction = this.Action('permission', 'create')
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
protected static async createPermissionContract(nameReadable: string) {
|
|
15
|
-
return await this.createAction.execute({
|
|
16
|
-
nameReadable,
|
|
17
|
-
nameCamel: namesUtil.toCamel(nameReadable),
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
}
|