@sprucelabs/spruce-cli 19.1.24 → 19.1.25
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 +8 -0
- package/build/__tests__/behavioral/AddingADependency.test.js +29 -57
- package/build/__tests__/behavioral/AddingADependency.test.js.map +1 -1
- package/build/__tests__/behavioral/BlockingCommands.test.js +9 -17
- package/build/__tests__/behavioral/BlockingCommands.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingTheCli.test.js +9 -17
- package/build/__tests__/behavioral/BootingTheCli.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingWithBadFiles.test.js +13 -25
- package/build/__tests__/behavioral/BootingWithBadFiles.test.js.map +1 -1
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js +13 -25
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingASkill.test.js +73 -145
- package/build/__tests__/behavioral/DeployingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingToSandbox.test.js +61 -121
- package/build/__tests__/behavioral/DeployingToSandbox.test.js.map +1 -1
- package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js +33 -65
- package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js.map +1 -1
- package/build/__tests__/behavioral/GettingCliVersion.test.js +13 -25
- package/build/__tests__/behavioral/GettingCliVersion.test.js.map +1 -1
- package/build/__tests__/behavioral/ManagingDependencies.test.js +21 -41
- package/build/__tests__/behavioral/ManagingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js +9 -17
- package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js +10 -18
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js +17 -33
- package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js +29 -57
- package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingRemote.test.js +21 -41
- package/build/__tests__/behavioral/SettingRemote.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpVscode.test.js +9 -17
- package/build/__tests__/behavioral/SettingUpVscode.test.js.map +1 -1
- package/build/__tests__/behavioral/TestingAConversation.test.js +25 -49
- package/build/__tests__/behavioral/TestingAConversation.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js +21 -41
- package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js +9 -17
- package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js +21 -41
- package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/SettingUpErrors.test.js +9 -17
- package/build/__tests__/behavioral/errors/SettingUpErrors.test.js.map +1 -1
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js +45 -89
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAListener.test.js +73 -145
- package/build/__tests__/behavioral/events/CreatingAListener.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js +53 -105
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js.map +1 -1
- package/build/__tests__/behavioral/events/EventWriter.test.js +5 -9
- package/build/__tests__/behavioral/events/EventWriter.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js +61 -121
- package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js +41 -81
- package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js +13 -25
- package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js +9 -17
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js.map +1 -1
- package/build/__tests__/behavioral/events/ListeningToCoreEvents.test.js +9 -17
- package/build/__tests__/behavioral/events/ListeningToCoreEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/RegisteringEventsOnBoot.test.js +14 -26
- package/build/__tests__/behavioral/events/RegisteringEventsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/events/RegisteringGlobalEvents.test.js +26 -50
- package/build/__tests__/behavioral/events/RegisteringGlobalEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SettingUpEvents.test.js +5 -9
- package/build/__tests__/behavioral/events/SettingUpEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js +13 -25
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SyncingEventsOnlyFromDependencies.test.js +13 -25
- package/build/__tests__/behavioral/events/SyncingEventsOnlyFromDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/node/CreatingANodeModule.test.js +13 -25
- package/build/__tests__/behavioral/node/CreatingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js +13 -25
- package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js.map +1 -1
- package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js +9 -17
- package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js +13 -25
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionPlugin.test.js +9 -17
- package/build/__tests__/behavioral/permissions/PermissionPlugin.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionStore.test.js +49 -97
- package/build/__tests__/behavioral/permissions/PermissionStore.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionWriter.test.js +9 -17
- package/build/__tests__/behavioral/permissions/PermissionWriter.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js +59 -113
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/support/AbstractPermissionsTest.js +13 -25
- package/build/__tests__/behavioral/permissions/support/AbstractPermissionsTest.js.map +1 -1
- package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js +37 -73
- package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js.map +1 -1
- package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js +13 -25
- package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js.map +1 -1
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js +29 -57
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js +41 -81
- package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/CreatingSchemasWithGenerics.test.js +5 -9
- package/build/__tests__/behavioral/schemas/CreatingSchemasWithGenerics.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js +9 -17
- package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js +17 -33
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js +21 -41
- package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js +5 -9
- package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js +81 -161
- package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js +13 -25
- package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SettingUpSchemasForModuleDistribution.test.js +49 -97
- package/build/__tests__/behavioral/schemas/SettingUpSchemasForModuleDistribution.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js +5 -9
- package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js +5 -9
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/BootingASkill.test.js +13 -25
- package/build/__tests__/behavioral/skill/BootingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/CreatingASkill.test.js +9 -17
- package/build/__tests__/behavioral/skill/CreatingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/InstallingASkillAtAnOrg.test.js +33 -65
- package/build/__tests__/behavioral/skill/InstallingASkillAtAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/LoggingInAsASkill.test.js +37 -73
- package/build/__tests__/behavioral/skill/LoggingInAsASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/RebuildingASkill.test.js +13 -25
- package/build/__tests__/behavioral/skill/RebuildingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/RegisteringASkill.test.js +17 -33
- package/build/__tests__/behavioral/skill/RegisteringASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/SettingUpASkill.test.js +29 -57
- package/build/__tests__/behavioral/skill/SettingUpASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js +45 -89
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js +41 -81
- package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/CreatingATest.test.js +41 -81
- package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/RunningTests.test.js +17 -33
- package/build/__tests__/behavioral/tests/RunningTests.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js +45 -89
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SettingUpASkillForTesting.test.js +21 -41
- package/build/__tests__/behavioral/tests/SettingUpASkillForTesting.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SettingUpTests.test.js +9 -17
- package/build/__tests__/behavioral/tests/SettingUpTests.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/TestReporterSettingsRemembered.test.js +9 -17
- package/build/__tests__/behavioral/tests/TestReporterSettingsRemembered.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/TestingDataStores.test.js +9 -17
- package/build/__tests__/behavioral/tests/TestingDataStores.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js +17 -33
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js +21 -41
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js +17 -33
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js +41 -81
- package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js +29 -57
- package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js +41 -81
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js +17 -33
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js +29 -57
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js +18 -32
- package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js +29 -57
- package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js +53 -105
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingATheme.test.js +30 -56
- package/build/__tests__/behavioral/views/CreatingATheme.test.js.map +1 -1
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js +25 -49
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/views/RegisteringSkillViewOnBoot.test.js +25 -49
- package/build/__tests__/behavioral/views/RegisteringSkillViewOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/views/SettingUpViews.test.js +9 -17
- package/build/__tests__/behavioral/views/SettingUpViews.test.js.map +1 -1
- package/build/__tests__/behavioral/views/TestingViewControllers.test.js +21 -41
- package/build/__tests__/behavioral/views/TestingViewControllers.test.js.map +1 -1
- package/build/__tests__/behavioral/views/WatchingSkillViews.test.js +13 -25
- package/build/__tests__/behavioral/views/WatchingSkillViews.test.js.map +1 -1
- package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js +53 -105
- package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter.test.js +9 -17
- package/build/__tests__/implementation/ActionExecuter.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter2.test.js +33 -65
- package/build/__tests__/implementation/ActionExecuter2.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter3.test.js +17 -33
- package/build/__tests__/implementation/ActionExecuter3.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter4.test.js +13 -25
- package/build/__tests__/implementation/ActionExecuter4.test.js.map +1 -1
- package/build/__tests__/implementation/ArgParser.test.js +9 -17
- package/build/__tests__/implementation/ArgParser.test.js.map +1 -1
- package/build/__tests__/implementation/BuildService.test.js +9 -17
- package/build/__tests__/implementation/BuildService.test.js.map +1 -1
- package/build/__tests__/implementation/BulkImporting.test.js +41 -81
- package/build/__tests__/implementation/BulkImporting.test.js.map +1 -1
- package/build/__tests__/implementation/CachingImports.test.js +21 -41
- package/build/__tests__/implementation/CachingImports.test.js.map +1 -1
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.js +37 -73
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.js.map +1 -1
- package/build/__tests__/implementation/DataStoreStore.test.js +41 -81
- package/build/__tests__/implementation/DataStoreStore.test.js.map +1 -1
- package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js +13 -25
- package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js.map +1 -1
- package/build/__tests__/implementation/EventContractCleanerUtil.test.js +17 -33
- package/build/__tests__/implementation/EventContractCleanerUtil.test.js.map +1 -1
- package/build/__tests__/implementation/EventStore.test.js +58 -113
- package/build/__tests__/implementation/EventStore.test.js.map +1 -1
- package/build/__tests__/implementation/EventTemplateItemBuilder.test.js +13 -25
- package/build/__tests__/implementation/EventTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureCommandAttacher.test.js +37 -73
- package/build/__tests__/implementation/FeatureCommandAttacher.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureFixture.test.js +17 -33
- package/build/__tests__/implementation/FeatureFixture.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureInstaller.test.js +17 -33
- package/build/__tests__/implementation/FeatureInstaller.test.js.map +1 -1
- package/build/__tests__/implementation/FeaturesUtil.test.js +5 -9
- package/build/__tests__/implementation/FeaturesUtil.test.js.map +1 -1
- package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js +5 -9
- package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/GlobalEmitter.test.js +9 -17
- package/build/__tests__/implementation/GlobalEmitter.test.js.map +1 -1
- package/build/__tests__/implementation/JestJsonParser.test.js +5 -9
- package/build/__tests__/implementation/JestJsonParser.test.js.map +1 -1
- package/build/__tests__/implementation/LintService.test.js +9 -17
- package/build/__tests__/implementation/LintService.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptLoader.test.js +19 -34
- package/build/__tests__/implementation/OnboardingScriptLoader.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptPlayer.test.js +58 -103
- package/build/__tests__/implementation/OnboardingScriptPlayer.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingStore.test.js +9 -17
- package/build/__tests__/implementation/OnboardingStore.test.js.map +1 -1
- package/build/__tests__/implementation/OrganizationStore.test.js +21 -41
- package/build/__tests__/implementation/OrganizationStore.test.js.map +1 -1
- package/build/__tests__/implementation/ParentTestFinder.test.js +13 -25
- package/build/__tests__/implementation/ParentTestFinder.test.js.map +1 -1
- package/build/__tests__/implementation/PkgService.test.js +25 -49
- package/build/__tests__/implementation/PkgService.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaStore.test.js +65 -129
- package/build/__tests__/implementation/SchemaStore.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js +5 -9
- package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaValueTypeWriter.test.js +29 -57
- package/build/__tests__/implementation/SchemaValueTypeWriter.test.js.map +1 -1
- package/build/__tests__/implementation/ServiceFactory.test.js +5 -9
- package/build/__tests__/implementation/ServiceFactory.test.js.map +1 -1
- package/build/__tests__/implementation/SettingUpANodeModule.test.js +13 -25
- package/build/__tests__/implementation/SettingUpANodeModule.test.js.map +1 -1
- package/build/__tests__/implementation/SkillStore.test.js +33 -65
- package/build/__tests__/implementation/SkillStore.test.js.map +1 -1
- package/build/__tests__/implementation/StoreFeature.test.js +10 -16
- package/build/__tests__/implementation/StoreFeature.test.js.map +1 -1
- package/build/__tests__/implementation/TestReporter.test.js +17 -33
- package/build/__tests__/implementation/TestReporter.test.js.map +1 -1
- package/build/__tests__/implementation/TestRunner.test.js +37 -73
- package/build/__tests__/implementation/TestRunner.test.js.map +1 -1
- package/build/__tests__/implementation/ValueTypeMapping.test.js +9 -17
- package/build/__tests__/implementation/ValueTypeMapping.test.js.map +1 -1
- package/build/__tests__/implementation/Widgets.test.js +17 -33
- package/build/__tests__/implementation/Widgets.test.js.map +1 -1
- package/build/__tests__/support/EventFaker.js +5 -9
- package/build/__tests__/support/EventFaker.js.map +1 -1
- package/build/__tests__/support/scripts/first.script.js +5 -7
- package/build/__tests__/support/scripts/first.script.js.map +1 -1
- package/build/boot.js +5 -12
- package/build/boot.js.map +1 -1
- package/build/cli/Cli.js +42 -80
- package/build/cli/Cli.js.map +1 -1
- package/build/components/FormComponent.js +9 -17
- package/build/components/FormComponent.js.map +1 -1
- package/build/components/QuizComponent.js +9 -17
- package/build/components/QuizComponent.js.map +1 -1
- package/build/features/AbstractAction.js +13 -25
- package/build/features/AbstractAction.js.map +1 -1
- package/build/features/AbstractFeature.js +17 -33
- package/build/features/AbstractFeature.js.map +1 -1
- package/build/features/ActionExecuter.js +11 -17
- package/build/features/ActionExecuter.js.map +1 -1
- package/build/features/ActionQuestionAsker.js +35 -65
- package/build/features/ActionQuestionAsker.js.map +1 -1
- package/build/features/FeatureCommandAttacher.js +5 -9
- package/build/features/FeatureCommandAttacher.js.map +1 -1
- package/build/features/FeatureInstaller.js +43 -81
- package/build/features/FeatureInstaller.js.map +1 -1
- package/build/features/OverrideActionDecorator.js +6 -8
- package/build/features/OverrideActionDecorator.js.map +1 -1
- package/build/features/cache/CacheFeature.js +5 -9
- package/build/features/cache/CacheFeature.js.map +1 -1
- package/build/features/cache/actions/DisableAction.js +5 -9
- package/build/features/cache/actions/DisableAction.js.map +1 -1
- package/build/features/cache/actions/EnableAction.js +5 -9
- package/build/features/cache/actions/EnableAction.js.map +1 -1
- package/build/features/conversation/ConversationFeature.js +13 -25
- package/build/features/conversation/ConversationFeature.js.map +1 -1
- package/build/features/conversation/actions/CreateAction.js +5 -9
- package/build/features/conversation/actions/CreateAction.js.map +1 -1
- package/build/features/conversation/actions/TestAction.js +14 -24
- package/build/features/conversation/actions/TestAction.js.map +1 -1
- package/build/features/conversation/stores/ConversationStore.js +5 -9
- package/build/features/conversation/stores/ConversationStore.js.map +1 -1
- package/build/features/conversation/writers/ConversationWriter.js +5 -9
- package/build/features/conversation/writers/ConversationWriter.js.map +1 -1
- package/build/features/dependencies/DependencyFeature.js +5 -9
- package/build/features/dependencies/DependencyFeature.js.map +1 -1
- package/build/features/dependencies/actions/AddAction.js +5 -9
- package/build/features/dependencies/actions/AddAction.js.map +1 -1
- package/build/features/dependencies/actions/ManageAction.js +5 -9
- package/build/features/dependencies/actions/ManageAction.js.map +1 -1
- package/build/features/deploy/DeployFeature.js +5 -9
- package/build/features/deploy/DeployFeature.js.map +1 -1
- package/build/features/deploy/actions/HerokuAction.js +41 -81
- package/build/features/deploy/actions/HerokuAction.js.map +1 -1
- package/build/features/error/ErrorFeature.js +13 -25
- package/build/features/error/ErrorFeature.js.map +1 -1
- package/build/features/error/ParentTestFinder.js +5 -9
- package/build/features/error/ParentTestFinder.js.map +1 -1
- package/build/features/error/actions/CreateAction.js +5 -9
- package/build/features/error/actions/CreateAction.js.map +1 -1
- package/build/features/error/actions/SyncAction.js +13 -25
- package/build/features/error/actions/SyncAction.js.map +1 -1
- package/build/features/error/writers/ErrorWriter.js +21 -41
- package/build/features/error/writers/ErrorWriter.js.map +1 -1
- package/build/features/event/EventFeature.js +29 -57
- package/build/features/event/EventFeature.js.map +1 -1
- package/build/features/event/actions/CreateAction.js +5 -9
- package/build/features/event/actions/CreateAction.js.map +1 -1
- package/build/features/event/actions/ListenAction.js +29 -57
- package/build/features/event/actions/ListenAction.js.map +1 -1
- package/build/features/event/actions/SetRemoteAction.js +5 -9
- package/build/features/event/actions/SetRemoteAction.js.map +1 -1
- package/build/features/event/actions/SyncAction.js +5 -9
- package/build/features/event/actions/SyncAction.js.map +1 -1
- package/build/features/event/actions/SyncListenersAction.js +5 -9
- package/build/features/event/actions/SyncListenersAction.js.map +1 -1
- package/build/features/event/builders/EventContractBuilder.js +17 -33
- package/build/features/event/builders/EventContractBuilder.js.map +1 -1
- package/build/features/event/stores/EventStore.js +26 -48
- package/build/features/event/stores/EventStore.js.map +1 -1
- package/build/features/event/stores/ListenerStore.js +5 -9
- package/build/features/event/stores/ListenerStore.js.map +1 -1
- package/build/features/event/writers/EventWriter.js +25 -49
- package/build/features/event/writers/EventWriter.js.map +1 -1
- package/build/features/eventContract/actions/PullAction.js +9 -17
- package/build/features/eventContract/actions/PullAction.js.map +1 -1
- package/build/features/log/actions/CreateTransportAction.js +5 -9
- package/build/features/log/actions/CreateTransportAction.js.map +1 -1
- package/build/features/log/writers/LogWriter.js +5 -9
- package/build/features/log/writers/LogWriter.js.map +1 -1
- package/build/features/node/NodeFeature.js +22 -40
- package/build/features/node/NodeFeature.js.map +1 -1
- package/build/features/node/actions/CreateAction.js +5 -9
- package/build/features/node/actions/CreateAction.js.map +1 -1
- package/build/features/node/actions/UpdateDependenciesAction.js +9 -17
- package/build/features/node/actions/UpdateDependenciesAction.js.map +1 -1
- package/build/features/node/actions/UpgradeAction.js +13 -25
- package/build/features/node/actions/UpgradeAction.js.map +1 -1
- package/build/features/node/writers/NodeWriter.js +5 -9
- package/build/features/node/writers/NodeWriter.js.map +1 -1
- package/build/features/onboard/OnboardFeature.js +18 -33
- package/build/features/onboard/OnboardFeature.js.map +1 -1
- package/build/features/onboard/ScriptLoader.js +5 -9
- package/build/features/onboard/ScriptLoader.js.map +1 -1
- package/build/features/onboard/ScriptPlayer.js +13 -25
- package/build/features/onboard/ScriptPlayer.js.map +1 -1
- package/build/features/onboard/actions/OnboardAction.js +5 -9
- package/build/features/onboard/actions/OnboardAction.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.first.script.js +18 -37
- package/build/features/onboard/scripts/onboarding.first.script.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.immersive.script.js +8 -13
- package/build/features/onboard/scripts/onboarding.immersive.script.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.returning.script.js +5 -7
- package/build/features/onboard/scripts/onboarding.returning.script.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.short.script.js +17 -31
- package/build/features/onboard/scripts/onboarding.short.script.js.map +1 -1
- package/build/features/onboard/scripts/todo/todo.create.skill.script.js +5 -7
- package/build/features/onboard/scripts/todo/todo.create.skill.script.js.map +1 -1
- package/build/features/onboard/scripts/todo/todo.test.script.js +5 -7
- package/build/features/onboard/scripts/todo/todo.test.script.js.map +1 -1
- package/build/features/onboard/scripts/wrongCommand.script.js +5 -7
- package/build/features/onboard/scripts/wrongCommand.script.js.map +1 -1
- package/build/features/organization/actions/CreateAction.js +5 -9
- package/build/features/organization/actions/CreateAction.js.map +1 -1
- package/build/features/organization/actions/InstallAction.js +5 -9
- package/build/features/organization/actions/InstallAction.js.map +1 -1
- package/build/features/organization/stores/OrganizationStore.js +21 -41
- package/build/features/organization/stores/OrganizationStore.js.map +1 -1
- package/build/features/permission/PermissionFeature.js +17 -33
- package/build/features/permission/PermissionFeature.js.map +1 -1
- package/build/features/permission/actions/CreateAction.js +5 -9
- package/build/features/permission/actions/CreateAction.js.map +1 -1
- package/build/features/permission/actions/SyncAction.js +8 -15
- package/build/features/permission/actions/SyncAction.js.map +1 -1
- package/build/features/permission/stores/PermissionStore.js +9 -17
- package/build/features/permission/stores/PermissionStore.js.map +1 -1
- package/build/features/permission/writers/PermissionWriter.js +13 -25
- package/build/features/permission/writers/PermissionWriter.js.map +1 -1
- package/build/features/person/actions/LoginAction.js +5 -9
- package/build/features/person/actions/LoginAction.js.map +1 -1
- package/build/features/person/actions/LogoutAction.js +5 -9
- package/build/features/person/actions/LogoutAction.js.map +1 -1
- package/build/features/person/actions/WhoamiAction.js +5 -9
- package/build/features/person/actions/WhoamiAction.js.map +1 -1
- package/build/features/polish/actions/SetupAction.js +5 -9
- package/build/features/polish/actions/SetupAction.js.map +1 -1
- package/build/features/polish/writers/PolishWriter.js +5 -9
- package/build/features/polish/writers/PolishWriter.js.map +1 -1
- package/build/features/sandbox/SandboxFeature.js +5 -7
- package/build/features/sandbox/SandboxFeature.js.map +1 -1
- package/build/features/sandbox/actions/SetupAction.js +5 -9
- package/build/features/sandbox/actions/SetupAction.js.map +1 -1
- package/build/features/sandbox/writers/SandboxWriter.js +5 -9
- package/build/features/sandbox/writers/SandboxWriter.js.map +1 -1
- package/build/features/schema/SchemaFeature.js +17 -33
- package/build/features/schema/SchemaFeature.js.map +1 -1
- package/build/features/schema/ValueTypeBuilder.js +5 -9
- package/build/features/schema/ValueTypeBuilder.js.map +1 -1
- package/build/features/schema/actions/CreateAction.js +5 -9
- package/build/features/schema/actions/CreateAction.js.map +1 -1
- package/build/features/schema/actions/SyncAction.js +21 -41
- package/build/features/schema/actions/SyncAction.js.map +1 -1
- package/build/features/schema/actions/SyncFieldsAction.js +5 -9
- package/build/features/schema/actions/SyncFieldsAction.js.map +1 -1
- package/build/features/schema/services/SchemaService.js +5 -9
- package/build/features/schema/services/SchemaService.js.map +1 -1
- package/build/features/schema/stores/SchemaStore.js +31 -57
- package/build/features/schema/stores/SchemaStore.js.map +1 -1
- package/build/features/schema/writers/SchemaWriter.js +25 -49
- package/build/features/schema/writers/SchemaWriter.js.map +1 -1
- package/build/features/skill/SkillFeature.js +25 -49
- package/build/features/skill/SkillFeature.js.map +1 -1
- package/build/features/skill/actions/BootAction.js +9 -17
- package/build/features/skill/actions/BootAction.js.map +1 -1
- package/build/features/skill/actions/CreateAction.js +5 -9
- package/build/features/skill/actions/CreateAction.js.map +1 -1
- package/build/features/skill/actions/DashboardAction.js +5 -9
- package/build/features/skill/actions/DashboardAction.js.map +1 -1
- package/build/features/skill/actions/LoginAction.js +5 -9
- package/build/features/skill/actions/LoginAction.js.map +1 -1
- package/build/features/skill/actions/RebuildAction.js +5 -9
- package/build/features/skill/actions/RebuildAction.js.map +1 -1
- package/build/features/skill/actions/RegisterAction.js +5 -9
- package/build/features/skill/actions/RegisterAction.js.map +1 -1
- package/build/features/skill/stores/SkillStore.js +37 -73
- package/build/features/skill/stores/SkillStore.js.map +1 -1
- package/build/features/skill/updaters/Updater.js +5 -9
- package/build/features/skill/updaters/Updater.js.map +1 -1
- package/build/features/skill/writers/SkillWriter.js +5 -9
- package/build/features/skill/writers/SkillWriter.js.map +1 -1
- package/build/features/store/StoreFeature.js +13 -25
- package/build/features/store/StoreFeature.js.map +1 -1
- package/build/features/store/actions/CreateAction.js +5 -9
- package/build/features/store/actions/CreateAction.js.map +1 -1
- package/build/features/store/actions/SyncAction.js +5 -9
- package/build/features/store/actions/SyncAction.js.map +1 -1
- package/build/features/store/stores/StoreStore.js +5 -9
- package/build/features/store/stores/StoreStore.js.map +1 -1
- package/build/features/store/writers/StoreWriter.js +17 -33
- package/build/features/store/writers/StoreWriter.js.map +1 -1
- package/build/features/test/TestFeature.js +9 -17
- package/build/features/test/TestFeature.js.map +1 -1
- package/build/features/test/TestReporter.js +17 -33
- package/build/features/test/TestReporter.js.map +1 -1
- package/build/features/test/TestRunner.js +14 -26
- package/build/features/test/TestRunner.js.map +1 -1
- package/build/features/test/actions/CreateAction.js +17 -33
- package/build/features/test/actions/CreateAction.js.map +1 -1
- package/build/features/test/actions/SetupAction.js +5 -9
- package/build/features/test/actions/SetupAction.js.map +1 -1
- package/build/features/test/actions/TestAction.js +21 -41
- package/build/features/test/actions/TestAction.js.map +1 -1
- package/build/features/test/writers/TestWriter.js +5 -9
- package/build/features/test/writers/TestWriter.js.map +1 -1
- package/build/features/view/ViewFeature.js +10 -16
- package/build/features/view/ViewFeature.js.map +1 -1
- package/build/features/view/actions/CreateAction.js +5 -9
- package/build/features/view/actions/CreateAction.js.map +1 -1
- package/build/features/view/actions/CreateThemeAction.js +5 -9
- package/build/features/view/actions/CreateThemeAction.js.map +1 -1
- package/build/features/view/actions/SyncAction.js +5 -9
- package/build/features/view/actions/SyncAction.js.map +1 -1
- package/build/features/view/actions/WatchAction.js +5 -9
- package/build/features/view/actions/WatchAction.js.map +1 -1
- package/build/features/view/stores/ViewStore.js +5 -9
- package/build/features/view/stores/ViewStore.js.map +1 -1
- package/build/features/view/writers/ViewWriter.js +9 -17
- package/build/features/view/writers/ViewWriter.js.map +1 -1
- package/build/features/vscode/actions/SetupAction.js +21 -41
- package/build/features/vscode/actions/SetupAction.js.map +1 -1
- package/build/features/vscode/services/VsCodeService.js +13 -25
- package/build/features/vscode/services/VsCodeService.js.map +1 -1
- package/build/features/vscode/writers/VsCodeWriter.js +5 -9
- package/build/features/vscode/writers/VsCodeWriter.js.map +1 -1
- package/build/features/watch/WatchFeature.js +23 -41
- package/build/features/watch/WatchFeature.js.map +1 -1
- package/build/interfaces/SpyInterface.js +25 -49
- package/build/interfaces/SpyInterface.js.map +1 -1
- package/build/interfaces/TerminalInterface.js +33 -65
- package/build/interfaces/TerminalInterface.js.map +1 -1
- package/build/services/BuildService.js +5 -9
- package/build/services/BuildService.js.map +1 -1
- package/build/services/CommandService.js +5 -9
- package/build/services/CommandService.js.map +1 -1
- package/build/services/GameService.js +5 -9
- package/build/services/GameService.js.map +1 -1
- package/build/services/ImportService.js +21 -31
- package/build/services/ImportService.js.map +1 -1
- package/build/services/LintService.js +6 -8
- package/build/services/LintService.js.map +1 -1
- package/build/services/PkgService.js +9 -17
- package/build/services/PkgService.js.map +1 -1
- package/build/services/TypeCheckerService.js +6 -8
- package/build/services/TypeCheckerService.js.map +1 -1
- package/build/stores/AbstractStore.js +5 -9
- package/build/stores/AbstractStore.js.map +1 -1
- package/build/tests/AbstractCliTest.js +61 -121
- package/build/tests/AbstractCliTest.js.map +1 -1
- package/build/tests/AbstractErrorTest.js +5 -9
- package/build/tests/AbstractErrorTest.js.map +1 -1
- package/build/tests/AbstractEventTest.js +17 -33
- package/build/tests/AbstractEventTest.js.map +1 -1
- package/build/tests/AbstractSchemaTest.js +13 -25
- package/build/tests/AbstractSchemaTest.js.map +1 -1
- package/build/tests/AbstractSkillTest.js +13 -25
- package/build/tests/AbstractSkillTest.js.map +1 -1
- package/build/tests/AbstractTestTest.js +5 -9
- package/build/tests/AbstractTestTest.js.map +1 -1
- package/build/tests/MockProgramFactory.js +10 -15
- package/build/tests/MockProgramFactory.js.map +1 -1
- package/build/tests/buildTestCache.js +32 -49
- package/build/tests/buildTestCache.js.map +1 -1
- package/build/tests/cleanTestData.js +27 -45
- package/build/tests/cleanTestData.js.map +1 -1
- package/build/tests/fixtures/FeatureFixture.js +25 -49
- package/build/tests/fixtures/FeatureFixture.js.map +1 -1
- package/build/tests/fixtures/MercuryFixture.js +5 -9
- package/build/tests/fixtures/MercuryFixture.js.map +1 -1
- package/build/tests/fixtures/OrganizationFixture.js +13 -25
- package/build/tests/fixtures/OrganizationFixture.js.map +1 -1
- package/build/tests/fixtures/PersonFixture.js +9 -17
- package/build/tests/fixtures/PersonFixture.js.map +1 -1
- package/build/tests/fixtures/SkillFixture.js +31 -57
- package/build/tests/fixtures/SkillFixture.js.map +1 -1
- package/build/tests/fixtures/ViewFixture.js +5 -9
- package/build/tests/fixtures/ViewFixture.js.map +1 -1
- package/build/updaters/ScriptUpdater.js +5 -9
- package/build/updaters/ScriptUpdater.js.map +1 -1
- package/build/widgets/terminalKit/TkBaseWidget.js +5 -9
- package/build/widgets/terminalKit/TkBaseWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkInputWidget.js +9 -17
- package/build/widgets/terminalKit/TkInputWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkLayoutWidget.js +5 -9
- package/build/widgets/terminalKit/TkLayoutWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkTextWidget.js +5 -9
- package/build/widgets/terminalKit/TkTextWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkWindowWidget.js +9 -17
- package/build/widgets/terminalKit/TkWindowWidget.js.map +1 -1
- package/build/writers/AbstractWriter.js +13 -25
- package/build/writers/AbstractWriter.js.map +1 -1
- package/package.json +29 -29
|
@@ -25,7 +25,7 @@ var optionsSchema = (0, _schema.buildSchema)({
|
|
|
25
25
|
description: 'Disable caching.',
|
|
26
26
|
fields: {}
|
|
27
27
|
});
|
|
28
|
-
var DisableCacheAction = /*#__PURE__*/function (_AbstractAction) {
|
|
28
|
+
var DisableCacheAction = /*#__PURE__*/function (_AbstractAction, _execute) {
|
|
29
29
|
(0, _inherits2["default"])(DisableCacheAction, _AbstractAction);
|
|
30
30
|
var _super = _createSuper(DisableCacheAction);
|
|
31
31
|
function DisableCacheAction() {
|
|
@@ -42,8 +42,8 @@ var DisableCacheAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
42
42
|
}
|
|
43
43
|
(0, _createClass2["default"])(DisableCacheAction, [{
|
|
44
44
|
key: "execute",
|
|
45
|
-
value: function () {
|
|
46
|
-
|
|
45
|
+
value: function execute(_x) {
|
|
46
|
+
return (_execute = _execute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_options) {
|
|
47
47
|
var _err$options, _err$message, error;
|
|
48
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
49
49
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -92,12 +92,8 @@ var DisableCacheAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
92
92
|
return _context.stop();
|
|
93
93
|
}
|
|
94
94
|
}, _callee, this, [[0, 8]]);
|
|
95
|
-
}));
|
|
96
|
-
|
|
97
|
-
return _execute.apply(this, arguments);
|
|
98
|
-
}
|
|
99
|
-
return execute;
|
|
100
|
-
}()
|
|
95
|
+
}))).apply(this, arguments);
|
|
96
|
+
}
|
|
101
97
|
}]);
|
|
102
98
|
return DisableCacheAction;
|
|
103
99
|
}(_AbstractAction2["default"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableAction.js","names":["_schema","require","_SpruceError","_interopRequireDefault","_AbstractAction2","_constants","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","optionsSchema","buildSchema","id","description","fields","DisableCacheAction","_AbstractAction","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","
|
|
1
|
+
{"version":3,"file":"DisableAction.js","names":["_schema","require","_SpruceError","_interopRequireDefault","_AbstractAction2","_constants","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","optionsSchema","buildSchema","id","description","fields","DisableCacheAction","_AbstractAction","_execute","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","execute","_x","_asyncToGenerator2","_regenerator","mark","_callee","_options","_err$options","_err$message","error","wrap","_callee$","_context","prev","next","Service","DISABLE_NPM_CACHE_COMMAND","abrupt","headline","summaryLines","t0","options","cmd","includes","SpruceError","code","dependencies","name","hint","message","toLowerCase","errors","stop","AbstractAction","exports"],"sources":["../../../../src/features/cache/actions/DisableAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport SpruceError from '../../../errors/SpruceError'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\nimport { DISABLE_NPM_CACHE_COMMAND } from '../constants'\n\nconst optionsSchema = buildSchema({\n\tid: 'disableCacheAction',\n\tdescription: 'Disable caching.',\n\tfields: {},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\n\nexport default class DisableCacheAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema = optionsSchema\n\tpublic commandAliases = [\n\t\t'disable.cache',\n\t\t'stop.cache',\n\t\t'disable.caching',\n\t\t'stop.caching',\n\t]\n\tpublic invocationMessage = 'Disabling cache...'\n\n\tpublic async execute(_options: Options): Promise<FeatureActionResponse> {\n\t\ttry {\n\t\t\tawait this.Service('command').execute('which docker')\n\t\t\tawait this.Service('command').execute(DISABLE_NPM_CACHE_COMMAND)\n\n\t\t\treturn {\n\t\t\t\theadline: 'Stopping cache',\n\t\t\t\tsummaryLines: ['Shutting down cache!'],\n\t\t\t}\n\t\t} catch (err: any) {\n\t\t\tlet error = err\n\t\t\tif (err.options?.cmd?.includes('which')) {\n\t\t\t\terror = new SpruceError({\n\t\t\t\t\tcode: 'MISSING_DEPENDENCIES',\n\t\t\t\t\tdependencies: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Docker',\n\t\t\t\t\t\t\thint: 'Get Docker here: https://www.docker.com/products/docker-desktop',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t})\n\t\t\t} else if (err.message?.toLowerCase()?.includes('no such container')) {\n\t\t\t\terror = new SpruceError({\n\t\t\t\t\tcode: 'CACHE_NOT_ENABLED',\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\terror = new SpruceError({\n\t\t\t\t\tcode: 'MISSING_DEPENDENCIES',\n\t\t\t\t\tdependencies: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AAAG,QAAA,CAAAoB,IAAA;UAAA;QAAA,GAAA3B,OAAA;MAAA,CAEF,IAAArC,KAAA,OAAAD,SAAA;IAAA;EAAA;EAAA,OAAAe,kBAAA;AAAA,EAnD8CmD,2BAAc;AAAAC,OAAA,cAAApD,kBAAA"}
|
|
@@ -25,7 +25,7 @@ var optionsSchema = (0, _schema.buildSchema)({
|
|
|
25
25
|
description: 'Enable npm caching so pulling node_modules is much faster.',
|
|
26
26
|
fields: {}
|
|
27
27
|
});
|
|
28
|
-
var EnableCacheAction = /*#__PURE__*/function (_AbstractAction) {
|
|
28
|
+
var EnableCacheAction = /*#__PURE__*/function (_AbstractAction, _execute) {
|
|
29
29
|
(0, _inherits2["default"])(EnableCacheAction, _AbstractAction);
|
|
30
30
|
var _super = _createSuper(EnableCacheAction);
|
|
31
31
|
function EnableCacheAction() {
|
|
@@ -42,8 +42,8 @@ var EnableCacheAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
42
42
|
}
|
|
43
43
|
(0, _createClass2["default"])(EnableCacheAction, [{
|
|
44
44
|
key: "execute",
|
|
45
|
-
value: function () {
|
|
46
|
-
|
|
45
|
+
value: function execute(_x) {
|
|
46
|
+
return (_execute = _execute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_options) {
|
|
47
47
|
var _err$options, error;
|
|
48
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
49
49
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -87,12 +87,8 @@ var EnableCacheAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
87
87
|
return _context.stop();
|
|
88
88
|
}
|
|
89
89
|
}, _callee, this, [[0, 10]]);
|
|
90
|
-
}));
|
|
91
|
-
|
|
92
|
-
return _execute.apply(this, arguments);
|
|
93
|
-
}
|
|
94
|
-
return execute;
|
|
95
|
-
}()
|
|
90
|
+
}))).apply(this, arguments);
|
|
91
|
+
}
|
|
96
92
|
}]);
|
|
97
93
|
return EnableCacheAction;
|
|
98
94
|
}(_AbstractAction2["default"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnableAction.js","names":["_schema","require","_SpruceError","_interopRequireDefault","_AbstractAction2","_constants","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","optionsSchema","buildSchema","id","description","fields","EnableCacheAction","_AbstractAction","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","
|
|
1
|
+
{"version":3,"file":"EnableAction.js","names":["_schema","require","_SpruceError","_interopRequireDefault","_AbstractAction2","_constants","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","optionsSchema","buildSchema","id","description","fields","EnableCacheAction","_AbstractAction","_execute","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","execute","_x","_asyncToGenerator2","_regenerator","mark","_callee","_options","_err$options","error","wrap","_callee$","_context","prev","next","Service","Action","ENABLE_NPM_CACHE_COMMAND","abrupt","headline","summaryLines","t0","options","cmd","includes","SpruceError","code","dependencies","name","hint","errors","stop","AbstractAction","exports"],"sources":["../../../../src/features/cache/actions/EnableAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport SpruceError from '../../../errors/SpruceError'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\nimport { ENABLE_NPM_CACHE_COMMAND } from '../constants'\n\nconst optionsSchema = buildSchema({\n\tid: 'enableCacheAction',\n\tdescription: 'Enable npm caching so pulling node_modules is much faster.',\n\tfields: {},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\n\nexport default class EnableCacheAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema = optionsSchema\n\tpublic commandAliases = [\n\t\t'enable.cache',\n\t\t'start.cache',\n\t\t'enable.caching',\n\t\t'start.caching',\n\t]\n\tpublic invocationMessage = 'Enabling cache... 💪'\n\n\tpublic async execute(_options: Options): Promise<FeatureActionResponse> {\n\t\ttry {\n\t\t\tawait this.Service('command').execute('which docker')\n\n\t\t\tawait this.Action('cache', 'disable').execute({})\n\t\t\tawait this.Service('command').execute(ENABLE_NPM_CACHE_COMMAND)\n\n\t\t\treturn {\n\t\t\t\theadline: 'Starting cache',\n\t\t\t\tsummaryLines: ['Booting cache systems now. Give it a sec!'],\n\t\t\t}\n\t\t} catch (err: any) {\n\t\t\tlet error = err\n\t\t\tif (err.options?.cmd?.includes('which')) {\n\t\t\t\terror = new SpruceError({\n\t\t\t\t\tcode: 'MISSING_DEPENDENCIES',\n\t\t\t\t\tdependencies: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Docker',\n\t\t\t\t\t\t\thint: 'Get Docker here: https://www.docker.com/products/docker-desktop',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\terror = new SpruceError({ code: 'DOCKER_NOT_STARTED' })\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\terrors: [error],\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAAuD,SAAAK,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,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Af,YAAA,eAAhBA,YAAA,CAAkBgB,QAAQ,CAAC,OAAO,CAAC,EAAE;gBACxCf,KAAK,GAAG,IAAIgB,uBAAW,CAAC;kBACvBC,IAAI,EAAE,sBAAsB;kBAC5BC,YAAY,EAAE,CACb;oBACCC,IAAI,EAAE,QAAQ;oBACdC,IAAI,EAAE;kBACP,CAAC;gBAEH,CAAC,CAAC;cACH,CAAC,MAAM;gBACNpB,KAAK,GAAG,IAAIgB,uBAAW,CAAC;kBAAEC,IAAI,EAAE;gBAAqB,CAAC,CAAC;cACxD;cAAC,OAAAd,QAAA,CAAAM,MAAA,WAEM;gBACNY,MAAM,EAAE,CAACrB,KAAK;cACf,CAAC;YAAA;YAAA;cAAA,OAAAG,QAAA,CAAAmB,IAAA;UAAA;QAAA,GAAAzB,OAAA;MAAA,CAEF,IAAArC,KAAA,OAAAD,SAAA;IAAA;EAAA;EAAA,OAAAe,iBAAA;AAAA,EAzC6CiD,2BAAc;AAAAC,OAAA,cAAAlD,iBAAA"}
|
|
@@ -18,7 +18,7 @@ var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
|
18
18
|
var _AbstractFeature2 = _interopRequireDefault(require("../AbstractFeature"));
|
|
19
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
20
20
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
-
var ConversationFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
21
|
+
var ConversationFeature = /*#__PURE__*/function (_AbstractFeature, _handleWillExecute, _afterPackageInstall, _writePlugin) {
|
|
22
22
|
(0, _inherits2["default"])(ConversationFeature, _AbstractFeature);
|
|
23
23
|
var _super = _createSuper(ConversationFeature);
|
|
24
24
|
function ConversationFeature(options) {
|
|
@@ -42,8 +42,8 @@ var ConversationFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
42
42
|
}
|
|
43
43
|
(0, _createClass2["default"])(ConversationFeature, [{
|
|
44
44
|
key: "handleWillExecute",
|
|
45
|
-
value: function () {
|
|
46
|
-
|
|
45
|
+
value: function handleWillExecute(_x) {
|
|
46
|
+
return (_handleWillExecute = _handleWillExecute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(payload) {
|
|
47
47
|
var isInstalled, files;
|
|
48
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
49
49
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -70,16 +70,12 @@ var ConversationFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
70
70
|
return _context.stop();
|
|
71
71
|
}
|
|
72
72
|
}, _callee, this);
|
|
73
|
-
}));
|
|
74
|
-
|
|
75
|
-
return _handleWillExecute.apply(this, arguments);
|
|
76
|
-
}
|
|
77
|
-
return handleWillExecute;
|
|
78
|
-
}()
|
|
73
|
+
}))).apply(this, arguments);
|
|
74
|
+
}
|
|
79
75
|
}, {
|
|
80
76
|
key: "afterPackageInstall",
|
|
81
|
-
value: function () {
|
|
82
|
-
|
|
77
|
+
value: function afterPackageInstall() {
|
|
78
|
+
return (_afterPackageInstall = _afterPackageInstall || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
83
79
|
var files;
|
|
84
80
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
85
81
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -96,16 +92,12 @@ var ConversationFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
96
92
|
return _context2.stop();
|
|
97
93
|
}
|
|
98
94
|
}, _callee2, this);
|
|
99
|
-
}));
|
|
100
|
-
|
|
101
|
-
return _afterPackageInstall.apply(this, arguments);
|
|
102
|
-
}
|
|
103
|
-
return afterPackageInstall;
|
|
104
|
-
}()
|
|
95
|
+
}))).apply(this, arguments);
|
|
96
|
+
}
|
|
105
97
|
}, {
|
|
106
98
|
key: "writePlugin",
|
|
107
|
-
value: function () {
|
|
108
|
-
|
|
99
|
+
value: function writePlugin() {
|
|
100
|
+
return (_writePlugin = _writePlugin || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
109
101
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
110
102
|
while (1) switch (_context3.prev = _context3.next) {
|
|
111
103
|
case 0:
|
|
@@ -115,12 +107,8 @@ var ConversationFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
115
107
|
return _context3.stop();
|
|
116
108
|
}
|
|
117
109
|
}, _callee3, this);
|
|
118
|
-
}));
|
|
119
|
-
|
|
120
|
-
return _writePlugin.apply(this, arguments);
|
|
121
|
-
}
|
|
122
|
-
return writePlugin;
|
|
123
|
-
}()
|
|
110
|
+
}))).apply(this, arguments);
|
|
111
|
+
}
|
|
124
112
|
}]);
|
|
125
113
|
return ConversationFeature;
|
|
126
114
|
}(_AbstractFeature2["default"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationFeature.js","names":["_spruceSkillUtils","require","_AbstractFeature2","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationFeature","_AbstractFeature","_inherits2","_super","options","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","code","isRequired","name","isDev","diskUtil","resolvePath","__dirname","emitter","on","handleWillExecute","bind","_createClass2","key","value","
|
|
1
|
+
{"version":3,"file":"ConversationFeature.js","names":["_spruceSkillUtils","require","_AbstractFeature2","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationFeature","_AbstractFeature","_handleWillExecute","_afterPackageInstall","_writePlugin","_inherits2","_super","options","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","code","isRequired","name","isDev","diskUtil","resolvePath","__dirname","emitter","on","handleWillExecute","bind","_createClass2","key","value","_x","_asyncToGenerator2","_regenerator","mark","_callee","payload","isInstalled","files","wrap","_callee$","_context","prev","next","features","sent","featureCode","actionCode","writePlugin","abrupt","stop","afterPackageInstall","_callee2","_callee2$","_context2","_callee3","_callee3$","_context3","Writer","cwd","AbstractFeature","exports"],"sources":["../../../src/features/conversation/ConversationFeature.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { NpmPackage } from '../../types/cli.types'\nimport AbstractFeature, {\n\tFeatureDependency,\n\tFeatureOptions,\n\tInstallResults,\n} from '../AbstractFeature'\nimport { FeatureCode } from '../features.types'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tconversation: ConversationFeature\n\t}\n}\n\nexport default class ConversationFeature extends AbstractFeature {\n\tpublic nameReadable = 'Conversation'\n\tpublic code: FeatureCode = 'conversation'\n\tpublic description = 'Computers like to talk, too.'\n\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{ code: 'event', isRequired: true },\n\t]\n\tpublic packageDependencies: NpmPackage[] = [\n\t\t{\n\t\t\tname: '@sprucelabs/spruce-conversation-plugin@latest',\n\t\t\tisDev: false,\n\t\t},\n\t]\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic constructor(options: FeatureOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on(\n\t\t\t'feature.will-execute',\n\t\t\tthis.handleWillExecute.bind(this)\n\t\t)\n\t}\n\n\tprivate async handleWillExecute(payload: {\n\t\tactionCode: string\n\t\tfeatureCode: string\n\t}) {\n\t\tconst isInstalled = await this.features.isInstalled('conversation')\n\n\t\tif (\n\t\t\tpayload.featureCode === 'node' &&\n\t\t\tpayload.actionCode === 'upgrade' &&\n\t\t\tisInstalled\n\t\t) {\n\t\t\tconst files = await this.writePlugin()\n\t\t\treturn { files }\n\t\t}\n\n\t\treturn {}\n\t}\n\n\tpublic async afterPackageInstall(): Promise<InstallResults> {\n\t\tconst files = await this.writePlugin()\n\n\t\treturn {\n\t\t\tfiles,\n\t\t}\n\t}\n\n\tprivate async writePlugin() {\n\t\treturn this.Writer('conversation').writePlugin(this.cwd)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAI2B,SAAAG,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;AAAA,IASNC,mBAAmB,0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;cACD,CAAC;YAAA;YAAA;cAAA,OAAAgB,SAAA,CAAAJ,IAAA;UAAA;QAAA,GAAAE,QAAA;MAAA,CACD,IAAAxD,KAAA,OAAAD,SAAA;IAAA;EAAA;IAAAkC,GAAA;IAAAC,KAAA,WAAAkB,YAAA;MAAA,QAAAvC,YAAA,GAAAA,YAAA,QAAAuB,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAED,SAAAqB,SAAA;QAAA,OAAAtB,YAAA,YAAAM,IAAA,UAAAiB,UAAAC,SAAA;UAAA,kBAAAA,SAAA,CAAAf,IAAA,GAAAe,SAAA,CAAAd,IAAA;YAAA;cAAA,OAAAc,SAAA,CAAAR,MAAA,WACQ,IAAI,CAACS,MAAM,CAAC,cAAc,CAAC,CAACV,WAAW,CAAC,IAAI,CAACW,GAAG,CAAC;YAAA;YAAA;cAAA,OAAAF,SAAA,CAAAP,IAAA;UAAA;QAAA,GAAAK,QAAA;MAAA,CACxD,IAAA3D,KAAA,OAAAD,SAAA;IAAA;EAAA;EAAA,OAAAU,mBAAA;AAAA,EArD+CuD,4BAAe;AAAAC,OAAA,cAAAxD,mBAAA"}
|
|
@@ -18,7 +18,7 @@ var _createConversationTopicOptions = _interopRequireDefault(require("../../../.
|
|
|
18
18
|
var _AbstractAction2 = _interopRequireDefault(require("../../AbstractAction"));
|
|
19
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
20
20
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
-
var CreateAction = /*#__PURE__*/function (_AbstractAction) {
|
|
21
|
+
var CreateAction = /*#__PURE__*/function (_AbstractAction, _execute) {
|
|
22
22
|
(0, _inherits2["default"])(CreateAction, _AbstractAction);
|
|
23
23
|
var _super = _createSuper(CreateAction);
|
|
24
24
|
function CreateAction() {
|
|
@@ -34,8 +34,8 @@ var CreateAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
34
34
|
}
|
|
35
35
|
(0, _createClass2["default"])(CreateAction, [{
|
|
36
36
|
key: "execute",
|
|
37
|
-
value: function () {
|
|
38
|
-
|
|
37
|
+
value: function execute(_x) {
|
|
38
|
+
return (_execute = _execute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(options) {
|
|
39
39
|
var _this$validateAndNorm, nameReadable, nameCamel, file;
|
|
40
40
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
41
41
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -56,12 +56,8 @@ var CreateAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
56
56
|
return _context.stop();
|
|
57
57
|
}
|
|
58
58
|
}, _callee, this);
|
|
59
|
-
}));
|
|
60
|
-
|
|
61
|
-
return _execute.apply(this, arguments);
|
|
62
|
-
}
|
|
63
|
-
return execute;
|
|
64
|
-
}()
|
|
59
|
+
}))).apply(this, arguments);
|
|
60
|
+
}
|
|
65
61
|
}]);
|
|
66
62
|
return CreateAction;
|
|
67
63
|
}(_AbstractAction2["default"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAction.js","names":["_createConversationTopicOptions","_interopRequireDefault","require","_AbstractAction2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","CreateAction","_AbstractAction","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","createConversationTopicOptionsSchema","_createClass2","key","value","
|
|
1
|
+
{"version":3,"file":"CreateAction.js","names":["_createConversationTopicOptions","_interopRequireDefault","require","_AbstractAction2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","CreateAction","_AbstractAction","_execute","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","createConversationTopicOptionsSchema","_createClass2","key","value","execute","_x","_asyncToGenerator2","_regenerator","mark","_callee","options","_this$validateAndNorm","nameReadable","nameCamel","file","wrap","_callee$","_context","prev","next","validateAndNormalizeOptions","Writer","writeDefinition","cwd","sent","abrupt","files","stop","AbstractAction","exports"],"sources":["../../../../src/features/conversation/actions/CreateAction.ts"],"sourcesContent":["import { SpruceSchemas } from '#spruce/schemas/schemas.types'\nimport createConversationTopicOptionsSchema from '#spruce/schemas/spruceCli/v2020_07_22/createConversationTopicOptions.schema'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\ntype OptionsSchema =\n\tSpruceSchemas.SpruceCli.v2020_07_22.CreateConversationTopicOptionsSchema\ntype Options =\n\tSpruceSchemas.SpruceCli.v2020_07_22.CreateConversationTopicOptions\nexport default class CreateAction extends AbstractAction<OptionsSchema> {\n\tpublic invocationMessage = 'Creating your new topic for conversation... 🎙'\n\tpublic optionsSchema = createConversationTopicOptionsSchema\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst { nameReadable, nameCamel } =\n\t\t\tthis.validateAndNormalizeOptions(options)\n\n\t\tconst file = await this.Writer('conversation').writeDefinition(this.cwd, {\n\t\t\tnameCamel,\n\t\t\tnameReadable,\n\t\t})\n\n\t\treturn {\n\t\t\tfiles: [file],\n\t\t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
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
var TestAction = /*#__PURE__*/function (_AbstractAction) {
|
|
35
|
+
var TestAction = /*#__PURE__*/function (_AbstractAction, _execute, _kill) {
|
|
36
36
|
(0, _inherits2["default"])(TestAction, _AbstractAction);
|
|
37
37
|
var _super = _createSuper(TestAction);
|
|
38
38
|
function TestAction() {
|
|
@@ -50,8 +50,8 @@ var TestAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
50
50
|
}
|
|
51
51
|
(0, _createClass2["default"])(TestAction, [{
|
|
52
52
|
key: "execute",
|
|
53
|
-
value: function () {
|
|
54
|
-
|
|
53
|
+
value: function execute(_x) {
|
|
54
|
+
return (_execute = _execute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(options) {
|
|
55
55
|
var _this2 = this;
|
|
56
56
|
var _this$validateAndNorm, shouldReturnImmediately, shouldRunSilently, command, isWriting, promise, _err$options, _err$options2;
|
|
57
57
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
@@ -63,12 +63,13 @@ var TestAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
63
63
|
command = this.Service('command');
|
|
64
64
|
isWriting = false;
|
|
65
65
|
promise = new Promise(function (resolve, reject) {
|
|
66
|
+
var _ref;
|
|
66
67
|
command.execute('yarn boot.local', {
|
|
67
68
|
spawnOptions: shouldRunSilently ? undefined : {
|
|
68
69
|
stdio: [process.stdin, 'pipe', 'pipe']
|
|
69
70
|
},
|
|
70
|
-
onData: shouldRunSilently ? undefined :
|
|
71
|
-
|
|
71
|
+
onData: shouldRunSilently ? undefined : function (_x2) {
|
|
72
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
|
72
73
|
var _process$stdout, _process$stdout2;
|
|
73
74
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
74
75
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -88,11 +89,8 @@ var TestAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
88
89
|
return _context.stop();
|
|
89
90
|
}
|
|
90
91
|
}, _callee);
|
|
91
|
-
}));
|
|
92
|
-
|
|
93
|
-
return _ref.apply(this, arguments);
|
|
94
|
-
};
|
|
95
|
-
}(),
|
|
92
|
+
}))).apply(this, arguments);
|
|
93
|
+
},
|
|
96
94
|
onError: function onError(data) {
|
|
97
95
|
if (!data.includes('warning package.json')) {
|
|
98
96
|
// const err = new SpruceError({
|
|
@@ -152,16 +150,12 @@ var TestAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
152
150
|
return _context2.stop();
|
|
153
151
|
}
|
|
154
152
|
}, _callee2, this, [[2, 15]]);
|
|
155
|
-
}));
|
|
156
|
-
|
|
157
|
-
return _execute.apply(this, arguments);
|
|
158
|
-
}
|
|
159
|
-
return execute;
|
|
160
|
-
}()
|
|
153
|
+
}))).apply(this, arguments);
|
|
154
|
+
}
|
|
161
155
|
}, {
|
|
162
156
|
key: "kill",
|
|
163
|
-
value: function () {
|
|
164
|
-
|
|
157
|
+
value: function kill() {
|
|
158
|
+
return (_kill = _kill || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
165
159
|
var _this$killHandler;
|
|
166
160
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
167
161
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -172,12 +166,8 @@ var TestAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
172
166
|
return _context3.stop();
|
|
173
167
|
}
|
|
174
168
|
}, _callee3, this);
|
|
175
|
-
}));
|
|
176
|
-
|
|
177
|
-
return _kill.apply(this, arguments);
|
|
178
|
-
}
|
|
179
|
-
return kill;
|
|
180
|
-
}()
|
|
169
|
+
}))).apply(this, arguments);
|
|
170
|
+
}
|
|
181
171
|
}]);
|
|
182
172
|
return TestAction;
|
|
183
173
|
}(_AbstractAction2["default"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestAction.js","names":["_schema","require","_AbstractAction2","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","optionsSchema","buildSchema","id","description","fields","shouldReturnImmediately","type","isPrivate","shouldRunSilently","TestAction","_AbstractAction","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","_execute","_asyncToGenerator2","_regenerator","mark","_callee2","options","_this2","_this$validateAndNorm","command","isWriting","promise","_err$options","_err$options2","wrap","_callee2$","_context2","prev","next","validateAndNormalizeOptions","ui","startLoading","Service","Promise","resolve","reject","execute","spawnOptions","undefined","stdio","process","stdin","onData","_ref","_callee","data","_process$stdout","_process$stdout2","_callee$","_context","search","clear","stopLoading","stdout","write","replace","stop","_x2","onError","includes","env","ACTION","then","killHandler","kill","bind","abrupt","meta","pid","t0","stderr","code","summaryLines","errors","_x","_kill","_callee3","_this$killHandler","_callee3$","_context3","AbstractAction","exports"],"sources":["../../../../src/features/conversation/actions/TestAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'testConversationOptions',\n\tdescription: 'Test your conversation topics.',\n\tfields: {\n\t\tshouldReturnImmediately: {\n\t\t\ttype: 'boolean',\n\t\t\tisPrivate: true,\n\t\t},\n\t\tshouldRunSilently: {\n\t\t\ttype: 'boolean',\n\t\t\tisPrivate: true,\n\t\t},\n\t},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\nexport default class TestAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema = optionsSchema\n\tpublic commandAliases = ['test.conversation', 'chat']\n\tpublic invocationMessage = \"Let's test talking about topics... 🎙\"\n\n\tprivate killHandler?: () => void\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst { shouldReturnImmediately, shouldRunSilently } =\n\t\t\tthis.validateAndNormalizeOptions(options)\n\n\t\tthis.ui.startLoading('Booting skill...')\n\n\t\ttry {\n\t\t\tconst command = this.Service('command')\n\t\t\tlet isWriting = false\n\n\t\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\t\tcommand\n\t\t\t\t\t.execute('yarn boot.local', {\n\t\t\t\t\t\tspawnOptions: shouldRunSilently\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tstdio: [process.stdin, 'pipe', 'pipe'],\n\t\t\t\t\t\t\t },\n\n\t\t\t\t\t\tonData: shouldRunSilently\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: async (data) => {\n\t\t\t\t\t\t\t\t\tif (!isWriting) {\n\t\t\t\t\t\t\t\t\t\tisWriting = data.search(':: Skill booted') > -1\n\t\t\t\t\t\t\t\t\t\tif (isWriting) {\n\t\t\t\t\t\t\t\t\t\t\tthis.ui.clear()\n\t\t\t\t\t\t\t\t\t\t\tthis.ui.stopLoading()\n\t\t\t\t\t\t\t\t\t\t\tprocess.stdout?.write(\n\t\t\t\t\t\t\t\t\t\t\t\t'? Send your first message to kick-off the conversation: '\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (isWriting) {\n\t\t\t\t\t\t\t\t\t\tprocess.stdout?.write(\n\t\t\t\t\t\t\t\t\t\t\tdata.replace('Skill :: Skill booted', '')\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\tonError: (data) => {\n\t\t\t\t\t\t\tif (!data.includes('warning package.json')) {\n\t\t\t\t\t\t\t\t// const err = new SpruceError({\n\t\t\t\t\t\t\t\t// \tfriendlyMessage:\n\t\t\t\t\t\t\t\t// \t\t`Testing conversations failed because of the following error:\\n\\n` +\n\t\t\t\t\t\t\t\t// \t\tdata,\n\t\t\t\t\t\t\t\t// \tcode: 'EXECUTING_COMMAND_FAILED',\n\t\t\t\t\t\t\t\t// \tcmd: 'ACTION=test.conversation yarn.boot.local',\n\t\t\t\t\t\t\t\t// \tstderr: data,\n\t\t\t\t\t\t\t\t// })\n\t\t\t\t\t\t\t\t// reject(err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenv: {\n\t\t\t\t\t\t\tACTION: 'test.conversation',\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\t.then(resolve)\n\t\t\t\t\t.catch(reject)\n\t\t\t})\n\n\t\t\tthis.killHandler = command.kill.bind(command)\n\n\t\t\tif (shouldReturnImmediately) {\n\t\t\t\treturn {\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tkill: this.killHandler,\n\t\t\t\t\t\tpid: command.pid() as number,\n\t\t\t\t\t\tpromise,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tawait promise\n\t\t\t}\n\t\t} catch (err: any) {\n\t\t\tif (\n\t\t\t\terr.options?.stderr?.includes('SIGINT') ||\n\t\t\t\terr.options?.code === 'CONVERSATION_ABORTED'\n\t\t\t) {\n\t\t\t\treturn {\n\t\t\t\t\tsummaryLines: ['Conversation terminated. ✌️'],\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\terrors: [err],\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsummaryLines: ['Talk soon! 👋'],\n\t\t}\n\t}\n\n\tpublic async kill() {\n\t\tthis.killHandler?.()\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAiD,SAAAG,a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AAA,OAAA9C,SAAA,CAAAwC,MAAA,WAGK;gBACNO,MAAM,EAAE,CAAA/C,SAAA,CAAA2C,EAAA;cACT,CAAC;YAAA;cAAA,OAAA3C,SAAA,CAAAwC,MAAA,WAGK;gBACNM,YAAY,EAAE,CAAC,eAAe;cAC/B,CAAC;YAAA;YAAA;cAAA,OAAA9C,SAAA,CAAA8B,IAAA;UAAA;QAAA,GAAAzC,QAAA;MAAA,CACD;MAAA,SAAAqB,QAAAsC,EAAA;QAAA,OAAA/D,QAAA,CAAAnC,KAAA,OAAAD,SAAA;MAAA;MAAA,OAAA6D,OAAA;IAAA;EAAA;IAAA3B,GAAA;IAAAC,KAAA;MAAA,IAAAiE,KAAA,OAAA/D,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAED,SAAA8D,SAAA;QAAA,IAAAC,iBAAA;QAAA,OAAAhE,YAAA,YAAAW,IAAA,UAAAsD,UAAAC,SAAA;UAAA,kBAAAA,SAAA,CAAApD,IAAA,GAAAoD,SAAA,CAAAnD,IAAA;YAAA;cACC,CAAAiD,iBAAA,OAAI,CAACd,WAAW,cAAAc,iBAAA,eAAhBA,iBAAA,CAAA9F,IAAA,KAAmB,CAAC;YAAA;YAAA;cAAA,OAAAgG,SAAA,CAAAvB,IAAA;UAAA;QAAA,GAAAoB,QAAA;MAAA,CACpB;MAAA,SAAAZ,KAAA;QAAA,OAAAW,KAAA,CAAAnG,KAAA,OAAAD,SAAA;MAAA;MAAA,OAAAyF,IAAA;IAAA;EAAA;EAAA,OAAAtE,UAAA;AAAA,EApGsCsF,2BAAc;AAAAC,OAAA,cAAAvF,UAAA"}
|
|
1
|
+
{"version":3,"file":"TestAction.js","names":["_schema","require","_AbstractAction2","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","optionsSchema","buildSchema","id","description","fields","shouldReturnImmediately","type","isPrivate","shouldRunSilently","TestAction","_AbstractAction","_execute","_kill","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","execute","_x","_asyncToGenerator2","_regenerator","mark","_callee2","options","_this2","_this$validateAndNorm","command","isWriting","promise","_err$options","_err$options2","wrap","_callee2$","_context2","prev","next","validateAndNormalizeOptions","ui","startLoading","Service","Promise","resolve","reject","_ref","spawnOptions","undefined","stdio","process","stdin","onData","_x2","_callee","data","_process$stdout","_process$stdout2","_callee$","_context","search","clear","stopLoading","stdout","write","replace","stop","onError","includes","env","ACTION","then","killHandler","kill","bind","abrupt","meta","pid","t0","stderr","code","summaryLines","errors","_callee3","_this$killHandler","_callee3$","_context3","AbstractAction","exports"],"sources":["../../../../src/features/conversation/actions/TestAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'testConversationOptions',\n\tdescription: 'Test your conversation topics.',\n\tfields: {\n\t\tshouldReturnImmediately: {\n\t\t\ttype: 'boolean',\n\t\t\tisPrivate: true,\n\t\t},\n\t\tshouldRunSilently: {\n\t\t\ttype: 'boolean',\n\t\t\tisPrivate: true,\n\t\t},\n\t},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\nexport default class TestAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema = optionsSchema\n\tpublic commandAliases = ['test.conversation', 'chat']\n\tpublic invocationMessage = \"Let's test talking about topics... 🎙\"\n\n\tprivate killHandler?: () => void\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst { shouldReturnImmediately, shouldRunSilently } =\n\t\t\tthis.validateAndNormalizeOptions(options)\n\n\t\tthis.ui.startLoading('Booting skill...')\n\n\t\ttry {\n\t\t\tconst command = this.Service('command')\n\t\t\tlet isWriting = false\n\n\t\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\t\tcommand\n\t\t\t\t\t.execute('yarn boot.local', {\n\t\t\t\t\t\tspawnOptions: shouldRunSilently\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tstdio: [process.stdin, 'pipe', 'pipe'],\n\t\t\t\t\t\t\t },\n\n\t\t\t\t\t\tonData: shouldRunSilently\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: async (data) => {\n\t\t\t\t\t\t\t\t\tif (!isWriting) {\n\t\t\t\t\t\t\t\t\t\tisWriting = data.search(':: Skill booted') > -1\n\t\t\t\t\t\t\t\t\t\tif (isWriting) {\n\t\t\t\t\t\t\t\t\t\t\tthis.ui.clear()\n\t\t\t\t\t\t\t\t\t\t\tthis.ui.stopLoading()\n\t\t\t\t\t\t\t\t\t\t\tprocess.stdout?.write(\n\t\t\t\t\t\t\t\t\t\t\t\t'? Send your first message to kick-off the conversation: '\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (isWriting) {\n\t\t\t\t\t\t\t\t\t\tprocess.stdout?.write(\n\t\t\t\t\t\t\t\t\t\t\tdata.replace('Skill :: Skill booted', '')\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t },\n\t\t\t\t\t\tonError: (data) => {\n\t\t\t\t\t\t\tif (!data.includes('warning package.json')) {\n\t\t\t\t\t\t\t\t// const err = new SpruceError({\n\t\t\t\t\t\t\t\t// \tfriendlyMessage:\n\t\t\t\t\t\t\t\t// \t\t`Testing conversations failed because of the following error:\\n\\n` +\n\t\t\t\t\t\t\t\t// \t\tdata,\n\t\t\t\t\t\t\t\t// \tcode: 'EXECUTING_COMMAND_FAILED',\n\t\t\t\t\t\t\t\t// \tcmd: 'ACTION=test.conversation yarn.boot.local',\n\t\t\t\t\t\t\t\t// \tstderr: data,\n\t\t\t\t\t\t\t\t// })\n\t\t\t\t\t\t\t\t// reject(err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenv: {\n\t\t\t\t\t\t\tACTION: 'test.conversation',\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\t.then(resolve)\n\t\t\t\t\t.catch(reject)\n\t\t\t})\n\n\t\t\tthis.killHandler = command.kill.bind(command)\n\n\t\t\tif (shouldReturnImmediately) {\n\t\t\t\treturn {\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tkill: this.killHandler,\n\t\t\t\t\t\tpid: command.pid() as number,\n\t\t\t\t\t\tpromise,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tawait promise\n\t\t\t}\n\t\t} catch (err: any) {\n\t\t\tif (\n\t\t\t\terr.options?.stderr?.includes('SIGINT') ||\n\t\t\t\terr.options?.code === 'CONVERSATION_ABORTED'\n\t\t\t) {\n\t\t\t\treturn {\n\t\t\t\t\tsummaryLines: ['Conversation terminated. ✌️'],\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\terrors: [err],\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsummaryLines: ['Talk soon! 👋'],\n\t\t}\n\t}\n\n\tpublic async kill() {\n\t\tthis.killHandler?.()\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAiD,SAAAG,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,E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YAAY,EAAE,CAAC,eAAe;cAC/B,CAAC;YAAA;YAAA;cAAA,OAAA7C,SAAA,CAAA8B,IAAA;UAAA;QAAA,GAAAzC,QAAA;MAAA,CACD,IAAA1C,KAAA,OAAAD,SAAA;IAAA;EAAA;IAAAoC,GAAA;IAAAC,KAAA,WAAAsD,KAAA;MAAA,QAAArE,KAAA,GAAAA,KAAA,QAAAkB,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAED,SAAA2D,SAAA;QAAA,IAAAC,iBAAA;QAAA,OAAA7D,YAAA,YAAAW,IAAA,UAAAmD,UAAAC,SAAA;UAAA,kBAAAA,SAAA,CAAAjD,IAAA,GAAAiD,SAAA,CAAAhD,IAAA;YAAA;cACC,CAAA8C,iBAAA,OAAI,CAACZ,WAAW,cAAAY,iBAAA,eAAhBA,iBAAA,CAAA9F,IAAA,KAAmB,CAAC;YAAA;YAAA;cAAA,OAAAgG,SAAA,CAAApB,IAAA;UAAA;QAAA,GAAAiB,QAAA;MAAA,CACpB,IAAApG,KAAA,OAAAD,SAAA;IAAA;EAAA;EAAA,OAAAmB,UAAA;AAAA,EApGsCsF,2BAAc;AAAAC,OAAA,cAAAvF,UAAA"}
|
|
@@ -19,7 +19,7 @@ var _SpruceError = _interopRequireDefault(require("../../../errors/SpruceError")
|
|
|
19
19
|
var _AbstractStore2 = _interopRequireDefault(require("../../../stores/AbstractStore"));
|
|
20
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
21
21
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
-
var ConversationStore = /*#__PURE__*/function (_AbstractStore) {
|
|
22
|
+
var ConversationStore = /*#__PURE__*/function (_AbstractStore, _fetchRegisteredTopics) {
|
|
23
23
|
(0, _inherits2["default"])(ConversationStore, _AbstractStore);
|
|
24
24
|
var _super = _createSuper(ConversationStore);
|
|
25
25
|
function ConversationStore() {
|
|
@@ -34,8 +34,8 @@ var ConversationStore = /*#__PURE__*/function (_AbstractStore) {
|
|
|
34
34
|
}
|
|
35
35
|
(0, _createClass2["default"])(ConversationStore, [{
|
|
36
36
|
key: "fetchRegisteredTopics",
|
|
37
|
-
value: function () {
|
|
38
|
-
|
|
37
|
+
value: function fetchRegisteredTopics() {
|
|
38
|
+
return (_fetchRegisteredTopics = _fetchRegisteredTopics || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
39
39
|
var _payloads$0$topics, _payloads$;
|
|
40
40
|
var client, results, _eventResponseUtil$ge, payloads, errors, topics;
|
|
41
41
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
@@ -60,12 +60,8 @@ var ConversationStore = /*#__PURE__*/function (_AbstractStore) {
|
|
|
60
60
|
return _context.stop();
|
|
61
61
|
}
|
|
62
62
|
}, _callee, this);
|
|
63
|
-
}));
|
|
64
|
-
|
|
65
|
-
return _fetchRegisteredTopics.apply(this, arguments);
|
|
66
|
-
}
|
|
67
|
-
return fetchRegisteredTopics;
|
|
68
|
-
}()
|
|
63
|
+
}))).apply(this, arguments);
|
|
64
|
+
}
|
|
69
65
|
}]);
|
|
70
66
|
return ConversationStore;
|
|
71
67
|
}(_AbstractStore2["default"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationStore.js","names":["_spruceEventUtils","require","_SpruceError","_interopRequireDefault","_AbstractStore2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationStore","_AbstractStore","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","
|
|
1
|
+
{"version":3,"file":"ConversationStore.js","names":["_spruceEventUtils","require","_SpruceError","_interopRequireDefault","_AbstractStore2","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationStore","_AbstractStore","_fetchRegisteredTopics","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","fetchRegisteredTopics","_asyncToGenerator2","_regenerator","mark","_callee","_payloads$0$topics","_payloads$","client","results","_eventResponseUtil$ge","payloads","errors","topics","wrap","_callee$","_context","prev","next","connectToApi","sent","emit","eventResponseUtil","getAllResponsePayloadsAndErrors","SpruceError","abrupt","stop","AbstractStore","exports"],"sources":["../../../../src/features/conversation/stores/ConversationStore.ts"],"sourcesContent":["import { SpruceSchemas } from '@sprucelabs/mercury-types'\nimport { eventResponseUtil } from '@sprucelabs/spruce-event-utils'\nimport SpruceError from '../../../errors/SpruceError'\nimport AbstractStore from '../../../stores/AbstractStore'\n\nexport interface EventStoreFetchEventContractsResponse {\n\terrors: SpruceError[]\n\ttopics: SpruceSchemas.Mercury.v2020_12_25.GetConversationTopicsTopic[]\n}\n\nexport default class ConversationStore extends AbstractStore {\n\tpublic name = 'event'\n\n\tpublic async fetchRegisteredTopics() {\n\t\tconst client = await this.connectToApi()\n\t\tconst results = await client.emit('get-conversation-topics::v2020_12_25')\n\t\tconst { payloads, errors } =\n\t\t\teventResponseUtil.getAllResponsePayloadsAndErrors(results, SpruceError)\n\n\t\tconst topics = payloads[0]?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AAAI,QAAA,CAAAU,IAAA;UAAA;QAAA,GAAArB,OAAA;MAAA,CACzB,IAAA/B,KAAA,OAAAD,SAAA;IAAA;EAAA;EAAA,OAAAU,iBAAA;AAAA,EAZ6C4C,0BAAa;AAAAC,OAAA,cAAA7C,iBAAA"}
|
|
@@ -16,7 +16,7 @@ var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
|
16
16
|
var _AbstractWriter2 = _interopRequireDefault(require("../../../writers/AbstractWriter"));
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
18
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
-
var ConversationWriter = /*#__PURE__*/function (_AbstractWriter) {
|
|
19
|
+
var ConversationWriter = /*#__PURE__*/function (_AbstractWriter, _writeDefinition) {
|
|
20
20
|
(0, _inherits2["default"])(ConversationWriter, _AbstractWriter);
|
|
21
21
|
var _super = _createSuper(ConversationWriter);
|
|
22
22
|
function ConversationWriter() {
|
|
@@ -25,8 +25,8 @@ var ConversationWriter = /*#__PURE__*/function (_AbstractWriter) {
|
|
|
25
25
|
}
|
|
26
26
|
(0, _createClass2["default"])(ConversationWriter, [{
|
|
27
27
|
key: "writeDefinition",
|
|
28
|
-
value: function () {
|
|
29
|
-
|
|
28
|
+
value: function writeDefinition(_x, _x2) {
|
|
29
|
+
return (_writeDefinition = _writeDefinition || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(destinationDir, options) {
|
|
30
30
|
var nameCamel, nameReadable, filename, destination, contents, file;
|
|
31
31
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
32
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -53,12 +53,8 @@ var ConversationWriter = /*#__PURE__*/function (_AbstractWriter) {
|
|
|
53
53
|
return _context.stop();
|
|
54
54
|
}
|
|
55
55
|
}, _callee, this);
|
|
56
|
-
}));
|
|
57
|
-
|
|
58
|
-
return _writeDefinition.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
return writeDefinition;
|
|
61
|
-
}()
|
|
56
|
+
}))).apply(this, arguments);
|
|
57
|
+
}
|
|
62
58
|
}, {
|
|
63
59
|
key: "writePlugin",
|
|
64
60
|
value: function writePlugin(cwd) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationWriter.js","names":["_spruceSkillUtils","require","_AbstractWriter2","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationWriter","_AbstractWriter","_inherits2","_super","_classCallCheck2","_createClass2","key","value","
|
|
1
|
+
{"version":3,"file":"ConversationWriter.js","names":["_spruceSkillUtils","require","_AbstractWriter2","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationWriter","_AbstractWriter","_writeDefinition","_inherits2","_super","_classCallCheck2","_createClass2","key","value","writeDefinition","_x","_x2","_asyncToGenerator2","_regenerator","mark","_callee","destinationDir","options","nameCamel","nameReadable","filename","destination","contents","file","wrap","_callee$","_context","prev","next","concat","diskUtil","resolvePath","templates","conversationTopic","writeFile","lint","name","path","action","description","toLowerCase","abrupt","stop","writePlugin","cwd","resolveHashSprucePath","pluginContents","conversationPlugin","results","writeFileIfChangedMixinResults","AbstractWriter","exports"],"sources":["../../../../src/features/conversation/writers/ConversationWriter.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { GeneratedFile } from '../../../types/cli.types'\nimport AbstractWriter from '../../../writers/AbstractWriter'\n\nexport default class ConversationWriter extends AbstractWriter {\n\tpublic async writeDefinition(\n\t\tdestinationDir: string,\n\t\toptions: { nameCamel: string; nameReadable: string }\n\t) {\n\t\tconst { nameCamel, nameReadable } = options\n\n\t\tconst filename = `${nameCamel}.topic.ts`\n\t\tconst destination = diskUtil.resolvePath(\n\t\t\tdestinationDir,\n\t\t\t'src',\n\t\t\t'conversations',\n\t\t\tfilename\n\t\t)\n\n\t\tconst contents = this.templates.conversationTopic({ nameReadable })\n\n\t\tdiskUtil.writeFile(destination, contents)\n\n\t\tawait this.lint(destination)\n\n\t\tconst file: GeneratedFile = {\n\t\t\tname: filename,\n\t\t\tpath: destination,\n\t\t\taction: 'generated',\n\t\t\tdescription: `The definition talking about ${nameReadable.toLowerCase()}`,\n\t\t}\n\t\treturn file\n\t}\n\n\tpublic writePlugin(cwd: string) {\n\t\tconst destination = diskUtil.resolveHashSprucePath(\n\t\t\tcwd,\n\t\t\t'features',\n\t\t\t'conversation.plugin.ts'\n\t\t)\n\n\t\tconst pluginContents = this.templates.conversationPlugin()\n\n\t\tconst results = this.writeFileIfChangedMixinResults(\n\t\t\tdestination,\n\t\t\tpluginContents,\n\t\t\t'Supports your skill with having conversations.'\n\t\t)\n\n\t\treturn results\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA4D,SAAAG,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAA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