@sprucelabs/spruce-cli 17.1.38 → 17.1.41
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 +24 -0
- package/build/__tests__/behavioral/AddingADependency.test.js +10 -12
- package/build/__tests__/behavioral/AddingADependency.test.js.map +1 -1
- package/build/__tests__/behavioral/BlockingCommands.test.js +3 -5
- package/build/__tests__/behavioral/BlockingCommands.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingTheCli.test.js +3 -3
- package/build/__tests__/behavioral/BootingTheCli.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingWithBadFiles.test.js +7 -7
- package/build/__tests__/behavioral/BootingWithBadFiles.test.js.map +1 -1
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js +13 -13
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js.map +1 -1
- package/build/__tests__/behavioral/CreatingSchemasWithGenerics.test.js +10 -10
- package/build/__tests__/behavioral/CreatingSchemasWithGenerics.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingASkill.test.js +32 -34
- package/build/__tests__/behavioral/DeployingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingToSandbox.test.js +15 -17
- package/build/__tests__/behavioral/DeployingToSandbox.test.js.map +1 -1
- package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js +11 -13
- package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js.map +1 -1
- package/build/__tests__/behavioral/GettingCliVersion.test.js +4 -4
- package/build/__tests__/behavioral/GettingCliVersion.test.js.map +1 -1
- package/build/__tests__/behavioral/InstallingASkillAtAnOrg.test.js +11 -13
- package/build/__tests__/behavioral/InstallingASkillAtAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/ListeningToCoreEvents.test.js +4 -4
- package/build/__tests__/behavioral/ListeningToCoreEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/LoggingInAsASkill.test.js +14 -16
- package/build/__tests__/behavioral/LoggingInAsASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/ManagingDependencies.test.js +9 -9
- package/build/__tests__/behavioral/ManagingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js +3 -3
- package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js.map +1 -1
- package/build/__tests__/behavioral/RebuildingASkill.test.js +4 -6
- package/build/__tests__/behavioral/RebuildingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js +4 -4
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringEventsOnBoot.test.js +7 -7
- package/build/__tests__/behavioral/RegisteringEventsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringGlobalEvents.test.js +11 -11
- package/build/__tests__/behavioral/RegisteringGlobalEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringSkillViewOnBoot.test.js +6 -6
- package/build/__tests__/behavioral/RegisteringSkillViewOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js +5 -5
- package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js +10 -12
- package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingRemote.test.js +9 -9
- package/build/__tests__/behavioral/SettingRemote.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpASkillForTesting.test.js +10 -10
- package/build/__tests__/behavioral/SettingUpASkillForTesting.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpSchemasForModuleDistribution.test.js +29 -31
- package/build/__tests__/behavioral/SettingUpSchemasForModuleDistribution.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpVscode.test.js +10 -10
- package/build/__tests__/behavioral/SettingUpVscode.test.js.map +1 -1
- package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.js +13 -13
- package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/TestReporterSettingsRemembered.test.js +6 -6
- package/build/__tests__/behavioral/TestReporterSettingsRemembered.test.js.map +1 -1
- package/build/__tests__/behavioral/TestingAConversation.test.js +17 -17
- package/build/__tests__/behavioral/TestingAConversation.test.js.map +1 -1
- package/build/__tests__/behavioral/TestingDataStores.test.js +13 -13
- package/build/__tests__/behavioral/TestingDataStores.test.js.map +1 -1
- package/build/__tests__/behavioral/WatchingSkillViews.test.js +15 -15
- package/build/__tests__/behavioral/WatchingSkillViews.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js +15 -15
- package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js +8 -8
- package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js +32 -32
- package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/SettingUpErrors.test.js +4 -6
- package/build/__tests__/behavioral/errors/SettingUpErrors.test.js.map +1 -1
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js +25 -25
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAListener.test.js +29 -31
- package/build/__tests__/behavioral/events/CreatingAListener.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js +26 -28
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js +22 -22
- package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js +38 -38
- package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js +7 -7
- package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js +6 -6
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SettingUpEvents.test.js +4 -4
- package/build/__tests__/behavioral/events/SettingUpEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js +3 -5
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/node/CreatingANodeModule.test.js +6 -6
- package/build/__tests__/behavioral/node/CreatingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js +6 -6
- package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js.map +1 -1
- package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js +6 -6
- package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js +3 -3
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js +14 -16
- package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js.map +1 -1
- package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js +7 -7
- package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js.map +1 -1
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js +8 -8
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js +23 -25
- package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js +7 -7
- package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js +6 -6
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js +18 -18
- package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js +7 -7
- package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js +62 -64
- package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js +6 -8
- package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js +4 -6
- package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.d.ts +1 -1
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js +4 -4
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/BootingASkill.test.js +12 -12
- package/build/__tests__/behavioral/skill/BootingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/CreatingASkill.test.js +5 -5
- package/build/__tests__/behavioral/skill/CreatingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/RegisteringASkill.test.js +12 -14
- package/build/__tests__/behavioral/skill/RegisteringASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/SettingUpASkill.test.js +29 -29
- package/build/__tests__/behavioral/skill/SettingUpASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js +26 -28
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js +8 -10
- package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/CreatingATest.test.js +10 -10
- package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/RunningTests.test.js +8 -10
- package/build/__tests__/behavioral/tests/RunningTests.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js +17 -17
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SettingUpTests.test.js +3 -5
- package/build/__tests__/behavioral/tests/SettingUpTests.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js +8 -8
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js +7 -7
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js +6 -6
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js +15 -15
- package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js +24 -24
- package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js +22 -22
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js +10 -10
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js +9 -9
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js +4 -4
- package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js +9 -9
- package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js +28 -30
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingATheme.test.js +9 -11
- package/build/__tests__/behavioral/views/CreatingATheme.test.js.map +1 -1
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js +8 -8
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/views/SettingUpViews.test.js +5 -5
- package/build/__tests__/behavioral/views/SettingUpViews.test.js.map +1 -1
- package/build/__tests__/behavioral/views/TestingViewControllers.test.js +12 -12
- package/build/__tests__/behavioral/views/TestingViewControllers.test.js.map +1 -1
- package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js +10 -10
- package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter.test.js +5 -5
- package/build/__tests__/implementation/ActionExecuter.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter2.test.js +30 -30
- package/build/__tests__/implementation/ActionExecuter2.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter3.test.js +3 -5
- package/build/__tests__/implementation/ActionExecuter3.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter4.test.js +2 -4
- package/build/__tests__/implementation/ActionExecuter4.test.js.map +1 -1
- package/build/__tests__/implementation/ArgParser.test.d.ts +1 -1
- package/build/__tests__/implementation/ArgParser.test.js +7 -7
- package/build/__tests__/implementation/ArgParser.test.js.map +1 -1
- package/build/__tests__/implementation/BuildService.test.js +4 -4
- package/build/__tests__/implementation/BuildService.test.js.map +1 -1
- package/build/__tests__/implementation/BulkImporting.test.d.ts +1 -1
- package/build/__tests__/implementation/BulkImporting.test.js +20 -22
- package/build/__tests__/implementation/BulkImporting.test.js.map +1 -1
- package/build/__tests__/implementation/CachingImports.test.js +3 -3
- package/build/__tests__/implementation/CachingImports.test.js.map +1 -1
- package/build/__tests__/implementation/CommandOptionBuilder.test.js +12 -12
- package/build/__tests__/implementation/CommandOptionBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.d.ts +1 -1
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.js +13 -13
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.js.map +1 -1
- package/build/__tests__/implementation/DataStoreStore.test.js +16 -18
- package/build/__tests__/implementation/DataStoreStore.test.js.map +1 -1
- package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js +6 -6
- package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js.map +1 -1
- package/build/__tests__/implementation/EventContractCleanerUtil.test.d.ts +1 -1
- package/build/__tests__/implementation/EventContractCleanerUtil.test.js +7 -7
- package/build/__tests__/implementation/EventContractCleanerUtil.test.js.map +1 -1
- package/build/__tests__/implementation/EventStore.test.js +27 -29
- package/build/__tests__/implementation/EventStore.test.js.map +1 -1
- package/build/__tests__/implementation/EventTemplateItemBuilder.test.js +12 -12
- package/build/__tests__/implementation/EventTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureCommandAttacher.test.js +23 -23
- package/build/__tests__/implementation/FeatureCommandAttacher.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureFixture.test.js +7 -7
- package/build/__tests__/implementation/FeatureFixture.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureInstaller.test.js +8 -8
- package/build/__tests__/implementation/FeatureInstaller.test.js.map +1 -1
- package/build/__tests__/implementation/FeaturesUtil.test.d.ts +1 -1
- package/build/__tests__/implementation/FeaturesUtil.test.js +4 -4
- package/build/__tests__/implementation/FeaturesUtil.test.js.map +1 -1
- package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js +11 -11
- package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/GlobalEmitter.js +3 -3
- package/build/__tests__/implementation/GlobalEmitter.js.map +1 -1
- package/build/__tests__/implementation/Introspection.test.js +4 -4
- package/build/__tests__/implementation/Introspection.test.js.map +1 -1
- package/build/__tests__/implementation/JestJsonParser.test.d.ts +1 -1
- package/build/__tests__/implementation/JestJsonParser.test.js +31 -31
- package/build/__tests__/implementation/JestJsonParser.test.js.map +1 -1
- package/build/__tests__/implementation/LintService.test.js +3 -3
- package/build/__tests__/implementation/LintService.test.js.map +1 -1
- package/build/__tests__/implementation/ListenerStore.test.js +3 -3
- package/build/__tests__/implementation/ListenerStore.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptLoader.test.js +9 -9
- package/build/__tests__/implementation/OnboardingScriptLoader.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptPlayer.test.js +17 -17
- package/build/__tests__/implementation/OnboardingScriptPlayer.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingStore.test.js +14 -14
- package/build/__tests__/implementation/OnboardingStore.test.js.map +1 -1
- package/build/__tests__/implementation/OrganizationStore.test.js +10 -10
- package/build/__tests__/implementation/OrganizationStore.test.js.map +1 -1
- package/build/__tests__/implementation/ParentTestFinder.test.js +6 -6
- package/build/__tests__/implementation/ParentTestFinder.test.js.map +1 -1
- package/build/__tests__/implementation/PkgService.test.js +8 -8
- package/build/__tests__/implementation/PkgService.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaStore.test.js +30 -32
- package/build/__tests__/implementation/SchemaStore.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js +10 -10
- package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaValueTypeWriter.test.js +13 -13
- package/build/__tests__/implementation/SchemaValueTypeWriter.test.js.map +1 -1
- package/build/__tests__/implementation/ServiceFactory.test.js +3 -3
- package/build/__tests__/implementation/ServiceFactory.test.js.map +1 -1
- package/build/__tests__/implementation/SettingUpANodeModule.test.js +4 -6
- package/build/__tests__/implementation/SettingUpANodeModule.test.js.map +1 -1
- package/build/__tests__/implementation/SkillStore.test.js +25 -27
- package/build/__tests__/implementation/SkillStore.test.js.map +1 -1
- package/build/__tests__/implementation/StoreFeature.test.js +4 -4
- package/build/__tests__/implementation/StoreFeature.test.js.map +1 -1
- package/build/__tests__/implementation/TestReporter.test.js +5 -5
- package/build/__tests__/implementation/TestReporter.test.js.map +1 -1
- package/build/__tests__/implementation/TestRunner.test.js +23 -25
- package/build/__tests__/implementation/TestRunner.test.js.map +1 -1
- package/build/__tests__/implementation/ValueTypeMapping.test.js +4 -4
- package/build/__tests__/implementation/ValueTypeMapping.test.js.map +1 -1
- package/build/__tests__/implementation/Widgets.test.js +10 -10
- package/build/__tests__/implementation/Widgets.test.js.map +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest.d.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest2.d.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest2.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/deeper/AbstractBananaTest.d.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/deeper/AbstractBananaTest.ts +1 -1
- package/build/features/onboard/templates/ManagingTodos.test.ts.hbs +1 -1
- package/build/features/test/TestLogItemGenerator.js +2 -2
- package/build/features/test/TestLogItemGenerator.js.map +1 -1
- package/build/interfaces/SpyInterface.js +5 -5
- package/build/interfaces/SpyInterface.js.map +1 -1
- package/build/tests/AbstractCliTest.d.ts +1 -1
- package/build/tests/AbstractCliTest.js +11 -11
- package/build/tests/AbstractCliTest.js.map +1 -1
- package/build/tests/AbstractSchemaTest.js +4 -4
- package/build/tests/AbstractSchemaTest.js.map +1 -1
- package/build/tests/utilities/test.utility.js +6 -6
- package/build/tests/utilities/test.utility.js.map +1 -1
- package/build/tests/utilities/uiAssert.utility.js +6 -6
- package/build/tests/utilities/uiAssert.utility.js.map +1 -1
- package/node_modules/@typescript-eslint/parser/package.json +5 -5
- package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
- package/node_modules/@typescript-eslint/types/package.json +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/package.json +5 -5
- package/node_modules/@typescript-eslint/visitor-keys/package.json +3 -3
- package/package.json +32 -32
- package/src/__tests__/behavioral/AddingADependency.test.ts +1 -1
- package/src/__tests__/behavioral/BlockingCommands.test.ts +1 -1
- package/src/__tests__/behavioral/BootingTheCli.test.ts +1 -1
- package/src/__tests__/behavioral/BootingWithBadFiles.test.ts +1 -1
- package/src/__tests__/behavioral/CreatingAConversationTopic.test.ts +1 -1
- package/src/__tests__/behavioral/CreatingSchemasWithGenerics.test.ts +1 -1
- package/src/__tests__/behavioral/DeployingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/DeployingToSandbox.test.ts +1 -1
- package/src/__tests__/behavioral/EnablingAndDisablingCache.test.ts +1 -1
- package/src/__tests__/behavioral/GettingCliVersion.test.ts +1 -1
- package/src/__tests__/behavioral/InstallingASkillAtAnOrg.test.ts +1 -1
- package/src/__tests__/behavioral/ListeningToCoreEvents.test.ts +1 -1
- package/src/__tests__/behavioral/LoggingInAsASkill.test.ts +1 -1
- package/src/__tests__/behavioral/ManagingDependencies.test.ts +1 -1
- package/src/__tests__/behavioral/OverridingCommandsInPackageJson.test.ts +1 -1
- package/src/__tests__/behavioral/RebuildingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringConversationsOnBoot.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringEventsOnBoot.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringGlobalEvents.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringSkillViewOnBoot.test.ts +1 -1
- package/src/__tests__/behavioral/RememberingUpgradeSelections.test.ts +1 -1
- package/src/__tests__/behavioral/SettingLogTransportsInASkill.test.ts +1 -1
- package/src/__tests__/behavioral/SettingRemote.test.ts +1 -1
- package/src/__tests__/behavioral/SettingUpASkillForTesting.test.ts +1 -1
- package/src/__tests__/behavioral/SettingUpSchemasForModuleDistribution.test.ts +1 -1
- package/src/__tests__/behavioral/SettingUpVscode.test.ts +1 -1
- package/src/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.ts +1 -1
- package/src/__tests__/behavioral/TestReporterSettingsRemembered.test.ts +1 -1
- package/src/__tests__/behavioral/TestingAConversation.test.ts +1 -1
- package/src/__tests__/behavioral/TestingDataStores.test.ts +1 -1
- package/src/__tests__/behavioral/WatchingSkillViews.test.ts +1 -1
- package/src/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.ts +1 -1
- package/src/__tests__/behavioral/errors/KeepingErrorClassInSync.test.ts +1 -1
- package/src/__tests__/behavioral/errors/KeepingErrorsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/errors/SettingUpErrors.test.ts +1 -1
- package/src/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.ts +1 -1
- package/src/__tests__/behavioral/events/CreatingAListener.test.ts +1 -1
- package/src/__tests__/behavioral/events/CreatingAnEvent.test.ts +1 -1
- package/src/__tests__/behavioral/events/KeepingEventsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/events/KeepingEventsInSync2.test.ts +1 -1
- package/src/__tests__/behavioral/events/KeepingListenersInSync.test.ts +1 -1
- package/src/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.ts +1 -1
- package/src/__tests__/behavioral/events/SettingUpEvents.test.ts +1 -1
- package/src/__tests__/behavioral/events/SkillEmitsBootEvents.test.ts +1 -1
- package/src/__tests__/behavioral/node/CreatingANodeModule.test.ts +1 -1
- package/src/__tests__/behavioral/onboard/StartingOnboarding.test.ts +1 -1
- package/src/__tests__/behavioral/organization/CreatingAnOrg.test.ts +1 -1
- package/src/__tests__/behavioral/permissions/CreatingPermissions.test.ts +1 -1
- package/src/__tests__/behavioral/person/LoggingInAsPerson.test.ts +1 -1
- package/src/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.ts +1 -1
- package/src/__tests__/behavioral/polish/SettingUpPolish.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/ImportingSchemaImports.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/KeepingSchemasInSync.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/SettingUpSchemas.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/UsingSchemasInCli.test.ts +1 -1
- package/src/__tests__/behavioral/skill/BootingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/skill/CreatingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/skill/RegisteringASkill.test.ts +1 -1
- package/src/__tests__/behavioral/skill/SettingUpASkill.test.ts +1 -1
- package/src/__tests__/behavioral/stores/CreatingADataStore.test.ts +1 -1
- package/src/__tests__/behavioral/stores/KeepingDataStoresInSync.test.ts +1 -1
- package/src/__tests__/behavioral/tests/CreatingATest.test.ts +1 -1
- package/src/__tests__/behavioral/tests/RunningTests.test.ts +1 -1
- package/src/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.ts +1 -1
- package/src/__tests__/behavioral/tests/SettingUpTests.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpdatingDependencies.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpdatingDependencies2.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingANodeModule.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill2.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill3.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill4.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill5.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingWithListeners.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.ts +1 -1
- package/src/__tests__/behavioral/views/CreatingASkillView.test.ts +1 -1
- package/src/__tests__/behavioral/views/CreatingATheme.test.ts +1 -1
- package/src/__tests__/behavioral/views/KeepingViewsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/views/SettingUpViews.test.ts +1 -1
- package/src/__tests__/behavioral/views/TestingViewControllers.test.ts +1 -1
- package/src/__tests__/behavioral/watchers/WatchingForChanges.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter2.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter3.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter4.test.ts +1 -1
- package/src/__tests__/implementation/ArgParser.test.ts +1 -1
- package/src/__tests__/implementation/BuildService.test.ts +1 -1
- package/src/__tests__/implementation/BulkImporting.test.ts +1 -1
- package/src/__tests__/implementation/CachingImports.test.ts +1 -1
- package/src/__tests__/implementation/CommandOptionBuilder.test.ts +1 -1
- package/src/__tests__/implementation/CommanderCommandResultMapper.test.ts +1 -1
- package/src/__tests__/implementation/DataStoreStore.test.ts +1 -1
- package/src/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.ts +1 -1
- package/src/__tests__/implementation/EventContractCleanerUtil.test.ts +1 -1
- package/src/__tests__/implementation/EventStore.test.ts +1 -1
- package/src/__tests__/implementation/EventTemplateItemBuilder.test.ts +1 -1
- package/src/__tests__/implementation/FeatureCommandAttacher.test.ts +1 -1
- package/src/__tests__/implementation/FeatureFixture.test.ts +1 -1
- package/src/__tests__/implementation/FeatureInstaller.test.ts +1 -1
- package/src/__tests__/implementation/FeaturesUtil.test.ts +1 -1
- package/src/__tests__/implementation/FieldTemplateItemBuilder.test.ts +1 -1
- package/src/__tests__/implementation/GlobalEmitter.ts +1 -1
- package/src/__tests__/implementation/Introspection.test.ts +1 -1
- package/src/__tests__/implementation/JestJsonParser.test.ts +1 -1
- package/src/__tests__/implementation/LintService.test.ts +1 -1
- package/src/__tests__/implementation/ListenerStore.test.ts +1 -1
- package/src/__tests__/implementation/OnboardingScriptLoader.test.ts +1 -1
- package/src/__tests__/implementation/OnboardingScriptPlayer.test.ts +1 -1
- package/src/__tests__/implementation/OnboardingStore.test.ts +1 -1
- package/src/__tests__/implementation/OrganizationStore.test.ts +1 -1
- package/src/__tests__/implementation/ParentTestFinder.test.ts +1 -1
- package/src/__tests__/implementation/PkgService.test.ts +1 -1
- package/src/__tests__/implementation/SchemaStore.test.ts +1 -1
- package/src/__tests__/implementation/SchemaTemplateItemBuilder.test.ts +1 -1
- package/src/__tests__/implementation/SchemaValueTypeWriter.test.ts +1 -1
- package/src/__tests__/implementation/ServiceFactory.test.ts +1 -1
- package/src/__tests__/implementation/SettingUpANodeModule.test.ts +1 -1
- package/src/__tests__/implementation/SkillStore.test.ts +1 -1
- package/src/__tests__/implementation/StoreFeature.test.ts +1 -1
- package/src/__tests__/implementation/TestReporter.test.ts +1 -1
- package/src/__tests__/implementation/TestRunner.test.ts +1 -1
- package/src/__tests__/implementation/ValueTypeMapping.test.ts +1 -1
- package/src/__tests__/implementation/Widgets.test.ts +1 -1
- package/src/__tests__/testDirsAndFiles/abstract_tests/AbstractTest.ts +1 -1
- package/src/__tests__/testDirsAndFiles/abstract_tests/AbstractTest2.ts +1 -1
- package/src/__tests__/testDirsAndFiles/abstract_tests/deeper/AbstractBananaTest.ts +1 -1
- package/src/features/onboard/templates/ManagingTodos.test.ts.hbs +1 -1
- package/src/features/test/TestLogItemGenerator.ts +1 -1
- package/src/interfaces/SpyInterface.ts +1 -1
- package/src/tests/AbstractCliTest.ts +1 -1
- package/src/tests/AbstractSchemaTest.ts +1 -1
- package/src/tests/utilities/test.utility.ts +1 -1
- package/src/tests/utilities/uiAssert.utility.ts +1 -1
|
@@ -29,15 +29,13 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
29
29
|
|
|
30
30
|
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
31
31
|
|
|
32
|
-
var _test = require("@sprucelabs/test");
|
|
33
|
-
|
|
34
32
|
var _testUtils = require("@sprucelabs/test-utils");
|
|
35
33
|
|
|
36
34
|
var _SchemaStore = require("../../../features/schema/stores/SchemaStore");
|
|
37
35
|
|
|
38
36
|
var _AbstractSchemaTest2 = _interopRequireDefault(require("../../../tests/AbstractSchemaTest"));
|
|
39
37
|
|
|
40
|
-
var
|
|
38
|
+
var _test = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
|
|
41
39
|
|
|
42
40
|
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _class, _class2;
|
|
43
41
|
|
|
@@ -50,7 +48,7 @@ var TYPE_FILE_COUNT = 2; // (only fieldMap and field.types... schema.types check
|
|
|
50
48
|
|
|
51
49
|
var SYNC_FILE_COUNT = Object.keys(_SchemaStore.coreSchemas).length + TYPE_FILE_COUNT;
|
|
52
50
|
var MOCK_CORE_SYNC_FILE_COUNT = 4 + TYPE_FILE_COUNT;
|
|
53
|
-
var KeepsSchemasInSyncTest = (_dec = (0,
|
|
51
|
+
var KeepsSchemasInSyncTest = (_dec = (0, _testUtils.test)(), _dec2 = (0, _testUtils.test)(), _dec3 = (0, _testUtils.test)(), _dec4 = (0, _testUtils.test)(), _dec5 = (0, _testUtils.test)(), _dec6 = (0, _testUtils.test)(), _dec7 = (0, _testUtils.test)(), _dec8 = (0, _testUtils.test)(), _dec9 = (0, _testUtils.test)(), _dec10 = (0, _testUtils.test)(), _dec11 = (0, _testUtils.test)(), _dec12 = (0, _testUtils.test)(), _dec13 = (0, _testUtils.test)(), _dec14 = (0, _testUtils.test)(), _dec15 = (0, _testUtils.test)('syncs minArrayLength, importsWhenRemote'), _dec16 = (0, _testUtils.test)(), _dec17 = (0, _testUtils.test)(), (_class = (_class2 = /*#__PURE__*/function (_AbstractSchemaTest) {
|
|
54
52
|
(0, _inherits2["default"])(KeepsSchemasInSyncTest, _AbstractSchemaTest);
|
|
55
53
|
|
|
56
54
|
var _super = _createSuper(KeepsSchemasInSyncTest);
|
|
@@ -72,7 +70,7 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
72
70
|
return this.Cli();
|
|
73
71
|
|
|
74
72
|
case 2:
|
|
75
|
-
|
|
73
|
+
_testUtils.assert.isFunction(this.Action('schema', 'sync').execute);
|
|
76
74
|
|
|
77
75
|
case 3:
|
|
78
76
|
case "end":
|
|
@@ -104,7 +102,7 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
104
102
|
|
|
105
103
|
case 2:
|
|
106
104
|
_context2.next = 4;
|
|
107
|
-
return
|
|
105
|
+
return _testUtils.assert.doesThrowAsync(function () {
|
|
108
106
|
return _this.Action('schema', 'sync').execute({});
|
|
109
107
|
});
|
|
110
108
|
|
|
@@ -146,10 +144,10 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
146
144
|
case 4:
|
|
147
145
|
results = _context3.sent;
|
|
148
146
|
|
|
149
|
-
|
|
147
|
+
_testUtils.assert.isFalsy(results.errors); //TODO determine better way to count files
|
|
150
148
|
|
|
151
149
|
|
|
152
|
-
|
|
150
|
+
_test["default"].assertCountsByAction(results.files, {
|
|
153
151
|
updated: 0,
|
|
154
152
|
generated: SYNC_FILE_COUNT,
|
|
155
153
|
skipped: 0
|
|
@@ -190,9 +188,9 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
190
188
|
case 4:
|
|
191
189
|
results = _context4.sent;
|
|
192
190
|
|
|
193
|
-
|
|
191
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
194
192
|
|
|
195
|
-
|
|
193
|
+
_test["default"].assertCountsByAction(results.files, {
|
|
196
194
|
updated: 0,
|
|
197
195
|
generated: TYPE_FILE_COUNT,
|
|
198
196
|
skipped: 0
|
|
@@ -231,11 +229,11 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
231
229
|
case 4:
|
|
232
230
|
results = _context5.sent;
|
|
233
231
|
|
|
234
|
-
|
|
232
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
235
233
|
|
|
236
234
|
tmpFile = this.resolveHashSprucePath('schemas', 'tmp', 'valueType.tmp.ts');
|
|
237
235
|
|
|
238
|
-
|
|
236
|
+
_testUtils.assert.isFalse(_spruceSkillUtils.diskUtil.doesFileExist(tmpFile));
|
|
239
237
|
|
|
240
238
|
case 8:
|
|
241
239
|
case "end":
|
|
@@ -274,19 +272,19 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
274
272
|
case 6:
|
|
275
273
|
results = _context6.sent;
|
|
276
274
|
|
|
277
|
-
|
|
275
|
+
_testUtils.assert.isUndefined(results.errors);
|
|
278
276
|
|
|
279
|
-
|
|
277
|
+
_testUtils.assert.isTruthy(results.files);
|
|
280
278
|
|
|
281
|
-
|
|
279
|
+
_testUtils.assert.isLength(results.files, MOCK_CORE_SYNC_FILE_COUNT);
|
|
282
280
|
|
|
283
|
-
|
|
281
|
+
_test["default"].assertCountsByAction(results.files, {
|
|
284
282
|
generated: MOCK_CORE_SYNC_FILE_COUNT,
|
|
285
283
|
skipped: 0,
|
|
286
284
|
updated: 0
|
|
287
285
|
});
|
|
288
286
|
|
|
289
|
-
|
|
287
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(this.coreSchemaTypesFile));
|
|
290
288
|
|
|
291
289
|
_context6.next = 14;
|
|
292
290
|
return this.assertTypesFileGeneratesArraySelect(this.coreSchemaTypesFile);
|
|
@@ -326,11 +324,11 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
326
324
|
case 4:
|
|
327
325
|
results = _context7.sent;
|
|
328
326
|
|
|
329
|
-
|
|
327
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
330
328
|
|
|
331
|
-
|
|
329
|
+
_testUtils.assert.isAbove((_results$files = results.files) === null || _results$files === void 0 ? void 0 : _results$files.length, 0);
|
|
332
330
|
|
|
333
|
-
|
|
331
|
+
_test["default"].assertCountsByAction(results.files, {
|
|
334
332
|
generated: 0,
|
|
335
333
|
skipped: (_results$files$length = (_results$files2 = results.files) === null || _results$files2 === void 0 ? void 0 : _results$files2.length) !== null && _results$files$length !== void 0 ? _results$files$length : 0,
|
|
336
334
|
updated: 0
|
|
@@ -373,11 +371,11 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
373
371
|
case 6:
|
|
374
372
|
results = _context8.sent;
|
|
375
373
|
|
|
376
|
-
|
|
374
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
377
375
|
|
|
378
376
|
typesContents = _spruceSkillUtils.diskUtil.readFile(this.coreSchemaTypesFile);
|
|
379
377
|
|
|
380
|
-
|
|
378
|
+
_testUtils.assert.doesInclude(typesContents, new RegExp("SpruceSchemas.".concat(_spruceSkillUtils.CORE_NAMESPACE, ".").concat(_spruceSkillUtils.CORE_SCHEMA_VERSION.constValue, "(.*?)interface Person"), 'gis'));
|
|
381
379
|
|
|
382
380
|
case 10:
|
|
383
381
|
case "end":
|
|
@@ -416,9 +414,9 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
416
414
|
case 6:
|
|
417
415
|
results = _context9.sent;
|
|
418
416
|
|
|
419
|
-
|
|
417
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
420
418
|
|
|
421
|
-
|
|
419
|
+
_testUtils.assert.isTruthy(results.files);
|
|
422
420
|
|
|
423
421
|
_context9.next = 11;
|
|
424
422
|
return this.assertValidActionResponseFiles(results);
|
|
@@ -426,14 +424,14 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
426
424
|
case 11:
|
|
427
425
|
typesContents = _spruceSkillUtils.diskUtil.readFile(this.coreSchemaTypesFile);
|
|
428
426
|
|
|
429
|
-
|
|
427
|
+
_testUtils.assert.doesNotInclude(typesContents, /@sprucelabs\/spruce-core-schemas/gi);
|
|
430
428
|
|
|
431
|
-
|
|
429
|
+
_testUtils.assert.doesInclude(typesContents, new RegExp("export declare namespace ".concat(_spruceSkillUtils.DEFAULT_GLOBAL_SCHEMA_NAMESPACE, ".").concat(_spruceSkillUtils.CORE_NAMESPACE, ".").concat(_spruceSkillUtils.CORE_SCHEMA_VERSION.constValue), 'gis'));
|
|
432
430
|
|
|
433
|
-
orgSchema =
|
|
431
|
+
orgSchema = _test["default"].assertFileByNameInGeneratedFiles('organization.schema.ts', results.files);
|
|
434
432
|
locationSchemaContents = _spruceSkillUtils.diskUtil.readFile(orgSchema);
|
|
435
433
|
|
|
436
|
-
|
|
434
|
+
_testUtils.assert.doesInclude(locationSchemaContents, 'SchemaRegistry');
|
|
437
435
|
|
|
438
436
|
case 17:
|
|
439
437
|
case "end":
|
|
@@ -477,20 +475,20 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
477
475
|
case 8:
|
|
478
476
|
results = _context10.sent;
|
|
479
477
|
|
|
480
|
-
|
|
478
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
481
479
|
|
|
482
|
-
|
|
480
|
+
_testUtils.assert.isTruthy(results.files);
|
|
483
481
|
|
|
484
482
|
typesContents = _spruceSkillUtils.diskUtil.readFile(this.coreSchemaTypesFile);
|
|
485
483
|
|
|
486
|
-
|
|
484
|
+
_testUtils.assert.doesNotInclude(typesContents, /@sprucelabs\/spruce-core-schemas/gi);
|
|
487
485
|
|
|
488
|
-
|
|
486
|
+
_testUtils.assert.doesInclude(typesContents, new RegExp("export declare namespace ".concat(_spruceSkillUtils.DEFAULT_GLOBAL_SCHEMA_NAMESPACE, ".").concat(_spruceSkillUtils.CORE_NAMESPACE, ".").concat(_spruceSkillUtils.CORE_SCHEMA_VERSION.constValue), 'gis'));
|
|
489
487
|
|
|
490
|
-
orgSchema =
|
|
488
|
+
orgSchema = _test["default"].assertFileByNameInGeneratedFiles('organization.schema.ts', results.files);
|
|
491
489
|
locationSchemaContents = _spruceSkillUtils.diskUtil.readFile(orgSchema);
|
|
492
490
|
|
|
493
|
-
|
|
491
|
+
_testUtils.assert.doesInclude(locationSchemaContents, 'SchemaRegistry');
|
|
494
492
|
|
|
495
493
|
case 17:
|
|
496
494
|
case "end":
|
|
@@ -528,9 +526,9 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
528
526
|
case 4:
|
|
529
527
|
createResponse = _context11.sent;
|
|
530
528
|
|
|
531
|
-
|
|
529
|
+
_testUtils.assert.isFalsy(createResponse.errors);
|
|
532
530
|
|
|
533
|
-
builderPath =
|
|
531
|
+
builderPath = _test["default"].assertFileByNameInGeneratedFiles('testSchema.builder.ts', createResponse.files);
|
|
534
532
|
contents = _spruceSkillUtils.diskUtil.readFile(builderPath).replace("id: 'testSchema'", "id: 'test-schema'");
|
|
535
533
|
|
|
536
534
|
_spruceSkillUtils.diskUtil.writeFile(builderPath, contents);
|
|
@@ -540,10 +538,10 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
540
538
|
|
|
541
539
|
case 11:
|
|
542
540
|
syncResults = _context11.sent;
|
|
543
|
-
testSchema =
|
|
541
|
+
testSchema = _test["default"].assertFileByNameInGeneratedFiles('test-schema.schema.ts', syncResults.files);
|
|
544
542
|
testSchemaContents = _spruceSkillUtils.diskUtil.readFile(testSchema);
|
|
545
543
|
|
|
546
|
-
|
|
544
|
+
_testUtils.assert.doesInclude(testSchemaContents, 'SchemaRegistry');
|
|
547
545
|
|
|
548
546
|
_context11.next = 17;
|
|
549
547
|
return this.assertValidActionResponseFiles(syncResults);
|
|
@@ -588,10 +586,10 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
588
586
|
for (_i = 0, _Object$values = Object.values(_SchemaStore.coreSchemas); _i < _Object$values.length; _i++) {
|
|
589
587
|
schema = _Object$values[_i];
|
|
590
588
|
id = schema.id;
|
|
591
|
-
match =
|
|
589
|
+
match = _test["default"].assertFileByNameInGeneratedFiles("".concat(id, ".schema.ts"), createResponse.files);
|
|
592
590
|
contents = _spruceSkillUtils.diskUtil.readFile(match);
|
|
593
591
|
|
|
594
|
-
|
|
592
|
+
_testUtils.assert.doesInclude(contents, "export { ".concat(id, "Schema as default } from '@sprucelabs/spruce-core-schemas'"));
|
|
595
593
|
}
|
|
596
594
|
|
|
597
595
|
case 6:
|
|
@@ -626,7 +624,7 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
626
624
|
createAction = this.Action('schema', 'create');
|
|
627
625
|
matcher = new RegExp("SpruceSchemas.TestingSchemas.".concat(version.constValue, "(.*?)interface TestSchema"), 'gis');
|
|
628
626
|
|
|
629
|
-
|
|
627
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(_path["default"].dirname(this.schemaTypesFile)));
|
|
630
628
|
|
|
631
629
|
_context13.next = 9;
|
|
632
630
|
return createAction.execute({
|
|
@@ -636,15 +634,15 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
636
634
|
|
|
637
635
|
case 9:
|
|
638
636
|
createResponse = _context13.sent;
|
|
639
|
-
builderFile =
|
|
637
|
+
builderFile = _test["default"].assertFileByNameInGeneratedFiles(/testSchema\.builder/, createResponse.files); // make sure builder is versioned
|
|
640
638
|
|
|
641
|
-
|
|
639
|
+
_testUtils.assert.doesInclude(builderFile, version.dirValue);
|
|
642
640
|
|
|
643
|
-
schemaFile =
|
|
641
|
+
schemaFile = _test["default"].assertFileByNameInGeneratedFiles(/testSchema\.schema/, createResponse.files); // make sure this path is versioned
|
|
644
642
|
|
|
645
|
-
|
|
643
|
+
_testUtils.assert.doesInclude(schemaFile, version.dirValue);
|
|
646
644
|
|
|
647
|
-
|
|
645
|
+
_testUtils.assert.doesInclude(schemaFile, '/testingSchemas/'); // schema types should be good
|
|
648
646
|
|
|
649
647
|
|
|
650
648
|
_context13.next = 17;
|
|
@@ -654,10 +652,10 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
654
652
|
// the types should include our test schema
|
|
655
653
|
typesContents = _spruceSkillUtils.diskUtil.readFile(this.schemaTypesFile);
|
|
656
654
|
|
|
657
|
-
|
|
655
|
+
_testUtils.assert.doesInclude(typesContents, matcher); // the schema file should exist
|
|
658
656
|
|
|
659
657
|
|
|
660
|
-
|
|
658
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(schemaFile)); // DELETE builder and make sure we are cleaned up
|
|
661
659
|
|
|
662
660
|
|
|
663
661
|
_spruceSkillUtils.diskUtil.deleteFile(builderFile); // this should cleanup types and schema files
|
|
@@ -667,15 +665,15 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
667
665
|
return this.Action('schema', 'sync').execute({});
|
|
668
666
|
|
|
669
667
|
case 23:
|
|
670
|
-
|
|
668
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(this.schemaTypesFile)); // and the schema should have been deleted
|
|
671
669
|
|
|
672
670
|
|
|
673
|
-
|
|
671
|
+
_testUtils.assert.isFalse(_spruceSkillUtils.diskUtil.doesFileExist(schemaFile)); // and the namespace folder should have been deleted
|
|
674
672
|
|
|
675
673
|
|
|
676
674
|
namespaceFolder = this.resolveHashSprucePath('schemas', 'testingSChemas');
|
|
677
675
|
|
|
678
|
-
|
|
676
|
+
_testUtils.assert.isFalse(_spruceSkillUtils.diskUtil.doesDirExist(namespaceFolder));
|
|
679
677
|
|
|
680
678
|
case 27:
|
|
681
679
|
case "end":
|
|
@@ -727,7 +725,7 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
727
725
|
case 13:
|
|
728
726
|
results = _context14.sent;
|
|
729
727
|
|
|
730
|
-
|
|
728
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
731
729
|
|
|
732
730
|
_context14.next = 17;
|
|
733
731
|
return this.assertValidActionResponseFiles(results);
|
|
@@ -775,11 +773,11 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
775
773
|
case 10:
|
|
776
774
|
schema = _context15.sent;
|
|
777
775
|
|
|
778
|
-
|
|
776
|
+
_testUtils.assert.isUndefined(schema.fields.phone.minArrayLength);
|
|
779
777
|
|
|
780
|
-
|
|
778
|
+
_testUtils.assert.isEqual(schema.fields.favoriteColors.minArrayLength, 3);
|
|
781
779
|
|
|
782
|
-
|
|
780
|
+
_testUtils.assert.isEqual(schema.fields.permissions.minArrayLength, 0);
|
|
783
781
|
|
|
784
782
|
case 14:
|
|
785
783
|
case "end":
|
|
@@ -818,9 +816,9 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
818
816
|
beforeFolder = this.resolveHashSprucePath('schemas', 'testingSchemas');
|
|
819
817
|
afterFolder = this.resolveHashSprucePath('schemas', 'newNamespace');
|
|
820
818
|
|
|
821
|
-
|
|
819
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(beforeFolder));
|
|
822
820
|
|
|
823
|
-
|
|
821
|
+
_testUtils.assert.isFalse(_spruceSkillUtils.diskUtil.doesFileExist(afterFolder));
|
|
824
822
|
|
|
825
823
|
_context16.next = 10;
|
|
826
824
|
return this.Store('skill').setCurrentSkillsNamespace('new-namespace');
|
|
@@ -830,9 +828,9 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
830
828
|
return this.Action('schema', 'sync').execute({});
|
|
831
829
|
|
|
832
830
|
case 12:
|
|
833
|
-
|
|
831
|
+
_testUtils.assert.isFalse(_spruceSkillUtils.diskUtil.doesFileExist(beforeFolder));
|
|
834
832
|
|
|
835
|
-
|
|
833
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(afterFolder));
|
|
836
834
|
|
|
837
835
|
case 14:
|
|
838
836
|
case "end":
|
|
@@ -869,7 +867,7 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
869
867
|
|
|
870
868
|
case 4:
|
|
871
869
|
results = _context17.sent;
|
|
872
|
-
testSchemaPath =
|
|
870
|
+
testSchemaPath = _test["default"].assertFileByNameInGeneratedFiles('testSchema.builder.ts', results.files);
|
|
873
871
|
|
|
874
872
|
_spruceSkillUtils.diskUtil.writeFile(testSchemaPath, "import { buildSchema } from '@sprucelabs/schema'\n\n\t\texport default buildSchema({\n\t\t\tid: 'testSchema',\n\t\t\tname: 'Test schema',\n\t\t\tdescription: '',\n\t\t\timportsWhenLocal: ['import * as Local from \"@sprucelabs/schema\"'],\n\t\t\timportsWhenRemote: ['import * as Remote from \"@sprucelabs/schema\"'],\n\t\t\ttypeSuffix: '<S extends Record<string, any> = Record<string, any>>',\n\t\t\tfields: {\n\t\t\t\tfieldName1: {\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tlabel: 'First Field',\n\t\t\t\t\tisRequired: true,\n\t\t\t\t},\n\t\t\t\tfieldName2: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tlabel: 'Second Field',\n\t\t\t\t\tisRequired: true,\n\t\t\t\t\thint: 'A hint',\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\t");
|
|
875
873
|
|
|
@@ -878,14 +876,14 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
878
876
|
|
|
879
877
|
case 9:
|
|
880
878
|
syncResults = _context17.sent;
|
|
881
|
-
schemaPath =
|
|
879
|
+
schemaPath = _test["default"].assertFileByNameInGeneratedFiles('testSchema.schema.ts', syncResults.files);
|
|
882
880
|
_context17.next = 13;
|
|
883
881
|
return this.Service('import').importDefault(schemaPath);
|
|
884
882
|
|
|
885
883
|
case 13:
|
|
886
884
|
imported = _context17.sent;
|
|
887
885
|
|
|
888
|
-
|
|
886
|
+
_testUtils.assert.doesInclude(imported, {
|
|
889
887
|
importsWhenRemote: ['import * as Remote from "@sprucelabs/schema"'],
|
|
890
888
|
typeSuffix: '<S extends Record<string, any> = Record<string, any>>'
|
|
891
889
|
});
|
|
@@ -913,7 +911,7 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
913
911
|
while (1) {
|
|
914
912
|
switch (_context18.prev = _context18.next) {
|
|
915
913
|
case 0:
|
|
916
|
-
file =
|
|
914
|
+
file = _test["default"].assertFileByNameInGeneratedFiles(filename, results.files);
|
|
917
915
|
_context18.next = 3;
|
|
918
916
|
return this.Service('import').importDefault(file);
|
|
919
917
|
|
|
@@ -946,7 +944,7 @@ var KeepsSchemasInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
946
944
|
case 0:
|
|
947
945
|
contents = _spruceSkillUtils.diskUtil.readFile(typesFile);
|
|
948
946
|
|
|
949
|
-
|
|
947
|
+
_testUtils.assert.doesInclude(contents, "'favoriteColors'?: (\"blue\" | \"red\")[]");
|
|
950
948
|
|
|
951
949
|
case 2:
|
|
952
950
|
case "end":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeepingSchemasInSync.test.js","names":["TYPE_FILE_COUNT","SYNC_FILE_COUNT","Object","keys","coreSchemas","length","MOCK_CORE_SYNC_FILE_COUNT","KeepsSchemasInSyncTest","test","Cli","assert","isFunction","Action","execute","doesThrowAsync","err","errorAssert","assertError","installSchemaFeature","results","isFalsy","errors","testUtil","assertCountsByAction","files","updated","generated","skipped","shouldFetchCoreSchemas","tmpFile","resolveHashSprucePath","isFalse","diskUtil","doesFileExist","copyMockCoreSchemas","coreSyncOptions","isUndefined","isTruthy","isLength","isTrue","coreSchemaTypesFile","assertTypesFileGeneratesArraySelect","syncSchemas","isAbove","typesContents","readFile","doesInclude","RegExp","CORE_NAMESPACE","CORE_SCHEMA_VERSION","constValue","assertValidActionResponseFiles","doesNotInclude","DEFAULT_GLOBAL_SCHEMA_NAMESPACE","orgSchema","assertFileByNameInGeneratedFiles","locationSchemaContents","pkg","Service","set","path","value","nameReadable","nameCamel","createResponse","builderPath","contents","replace","writeFile","syncResults","testSchema","testSchemaContents","values","schema","id","match","version","versionUtil","generateVersion","typeChecker","createAction","matcher","pathUtil","dirname","schemaTypesFile","builderFile","dirValue","schemaFile","check","deleteFile","namespaceFolder","doesDirExist","FeatureFixture","installCachedFeatures","promise","waitForInput","ui","sendInput","schemasDir","resolvePath","copyDir","resolveTestPath","importSchema","fields","phone","minArrayLength","isEqual","favoriteColors","permissions","beforeFolder","afterFolder","Store","setCurrentSkillsNamespace","testSchemaPath","schemaPath","importDefault","imported","importsWhenRemote","typeSuffix","filename","file","typesFile","source","destination","AbstractSchemaTest","shouldGenerateCoreSchemaTypes"],"sources":["../../../../src/__tests__/behavioral/schemas/KeepingSchemasInSync.test.ts"],"sourcesContent":["import pathUtil from 'path'\nimport { versionUtil } from '@sprucelabs/spruce-skill-utils'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport {\n\tCORE_SCHEMA_VERSION,\n\tCORE_NAMESPACE,\n\tDEFAULT_GLOBAL_SCHEMA_NAMESPACE,\n} from '@sprucelabs/spruce-skill-utils'\nimport { assert, test } from '@sprucelabs/test'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport { coreSchemas } from '../../../features/schema/stores/SchemaStore'\nimport AbstractSchemaTest from '../../../tests/AbstractSchemaTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\n//TODO rethink how to check for count of files and results or where it may make sense to move this test\nconst TYPE_FILE_COUNT = 2 // (only fieldMap and field.types... schema.types checked by +1 in tests)\nconst SYNC_FILE_COUNT = Object.keys(coreSchemas).length + TYPE_FILE_COUNT\nconst MOCK_CORE_SYNC_FILE_COUNT = 4 + TYPE_FILE_COUNT\n\nexport default class KeepsSchemasInSyncTest extends AbstractSchemaTest {\n\tprivate static readonly coreSyncOptions = {\n\t\tshouldGenerateCoreSchemaTypes: true,\n\t}\n\n\t@test()\n\tprotected static async hasSyncSchemaAction() {\n\t\tawait this.Cli()\n\t\tassert.isFunction(this.Action('schema', 'sync').execute)\n\t}\n\n\t@test()\n\tprotected static async failsBecauseSchemasIsNotInstalled() {\n\t\tawait this.Cli()\n\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Action('schema', 'sync').execute({})\n\t\t)\n\n\t\terrorAssert.assertError(err, 'FEATURE_NOT_INSTALLED')\n\t}\n\n\t@test()\n\tprotected static async syncingWithNoSchemasSucceeds() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\t//TODO determine better way to count files\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tupdated: 0,\n\t\t\tgenerated: SYNC_FILE_COUNT,\n\t\t\tskipped: 0,\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async syncingWithNoSchemasAndFetchCoreSchemasFalseSucceeds() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({\n\t\t\tshouldFetchCoreSchemas: false,\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tupdated: 0,\n\t\t\tgenerated: TYPE_FILE_COUNT,\n\t\t\tskipped: 0,\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async syncingCleansUpTempFiles() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst tmpFile = this.resolveHashSprucePath(\n\t\t\t'schemas',\n\t\t\t'tmp',\n\t\t\t'valueType.tmp.ts'\n\t\t)\n\n\t\tassert.isFalse(diskUtil.doesFileExist(tmpFile))\n\t}\n\n\t@test()\n\tprotected static async syncingCoreSchemasGeneratesTypesFile() {\n\t\tawait this.installSchemaFeature('schemas')\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isUndefined(results.errors)\n\t\tassert.isTruthy(results.files)\n\n\t\tassert.isLength(results.files, MOCK_CORE_SYNC_FILE_COUNT)\n\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tgenerated: MOCK_CORE_SYNC_FILE_COUNT,\n\t\t\tskipped: 0,\n\t\t\tupdated: 0,\n\t\t})\n\n\t\tassert.isTrue(diskUtil.doesFileExist(this.coreSchemaTypesFile))\n\n\t\tawait this.assertTypesFileGeneratesArraySelect(this.coreSchemaTypesFile)\n\t}\n\n\t@test()\n\tprotected static async syncSchemasTwiceSkipsFiles() {\n\t\tawait this.syncSchemas('schemas', this.coreSyncOptions)\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isFalsy(results.errors)\n\t\tassert.isAbove(results.files?.length, 0)\n\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tgenerated: 0,\n\t\t\tskipped: results.files?.length ?? 0,\n\t\t\tupdated: 0,\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async makeSureSchemaTypesAreVersioned() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst typesContents = diskUtil.readFile(this.coreSchemaTypesFile)\n\t\tassert.doesInclude(\n\t\t\ttypesContents,\n\t\t\tnew RegExp(\n\t\t\t\t`SpruceSchemas.${CORE_NAMESPACE}.${CORE_SCHEMA_VERSION.constValue}(.*?)interface Person`,\n\t\t\t\t'gis'\n\t\t\t)\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async shouldGenerateCoreSchemaTypesGeneratesValidFiles() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isFalsy(results.errors)\n\t\tassert.isTruthy(results.files)\n\n\t\tawait this.assertValidActionResponseFiles(results)\n\n\t\tconst typesContents = diskUtil.readFile(this.coreSchemaTypesFile)\n\n\t\tassert.doesNotInclude(typesContents, /@sprucelabs\\/spruce-core-schemas/gi)\n\t\tassert.doesInclude(\n\t\t\ttypesContents,\n\t\t\tnew RegExp(\n\t\t\t\t`export declare namespace ${DEFAULT_GLOBAL_SCHEMA_NAMESPACE}.${CORE_NAMESPACE}.${CORE_SCHEMA_VERSION.constValue}`,\n\t\t\t\t'gis'\n\t\t\t)\n\t\t)\n\n\t\tconst orgSchema = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'organization.schema.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst locationSchemaContents = diskUtil.readFile(orgSchema)\n\t\tassert.doesInclude(locationSchemaContents, 'SchemaRegistry')\n\t}\n\n\t@test()\n\tprotected static async generateCoreSchemaInCoreSchemasModule() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst pkg = this.Service('pkg')\n\t\tpkg.set({ path: 'name', value: '@sprucelabs/spruce-core-schemas' })\n\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalsy(results.errors)\n\t\tassert.isTruthy(results.files)\n\n\t\tconst typesContents = diskUtil.readFile(this.coreSchemaTypesFile)\n\n\t\tassert.doesNotInclude(typesContents, /@sprucelabs\\/spruce-core-schemas/gi)\n\t\tassert.doesInclude(\n\t\t\ttypesContents,\n\t\t\tnew RegExp(\n\t\t\t\t`export declare namespace ${DEFAULT_GLOBAL_SCHEMA_NAMESPACE}.${CORE_NAMESPACE}.${CORE_SCHEMA_VERSION.constValue}`,\n\t\t\t\t'gis'\n\t\t\t)\n\t\t)\n\n\t\tconst orgSchema = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'organization.schema.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst locationSchemaContents = diskUtil.readFile(orgSchema)\n\t\tassert.doesInclude(locationSchemaContents, 'SchemaRegistry')\n\t}\n\n\t@test()\n\tprotected static async canHandleHyphenSchemaIds() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tconst createResponse = await this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tassert.isFalsy(createResponse.errors)\n\n\t\tconst builderPath = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'testSchema.builder.ts',\n\t\t\tcreateResponse.files\n\t\t)\n\n\t\tconst contents = diskUtil\n\t\t\t.readFile(builderPath)\n\t\t\t.replace(\"id: 'testSchema'\", \"id: 'test-schema'\")\n\n\t\tdiskUtil.writeFile(builderPath, contents)\n\n\t\tconst syncResults = await this.Action('schema', 'sync').execute({})\n\n\t\tconst testSchema = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'test-schema.schema.ts',\n\t\t\tsyncResults.files\n\t\t)\n\n\t\tconst testSchemaContents = diskUtil.readFile(testSchema)\n\t\tassert.doesInclude(testSchemaContents, 'SchemaRegistry')\n\n\t\tawait this.assertValidActionResponseFiles(syncResults)\n\t}\n\n\t@test()\n\tprotected static async coreSchemasPullFromCoreSchemasModuleDuringNormalGeneration() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tconst createResponse = await this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tfor (const schema of Object.values(coreSchemas)) {\n\t\t\tconst id = schema.id\n\t\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t\t`${id}.schema.ts`,\n\t\t\t\tcreateResponse.files\n\t\t\t)\n\t\t\tconst contents = diskUtil.readFile(match)\n\t\t\tassert.doesInclude(\n\t\t\t\tcontents,\n\t\t\t\t`export { ${id}Schema as default } from '@sprucelabs/spruce-core-schemas'`\n\t\t\t)\n\t\t}\n\t}\n\n\t@test()\n\tprotected static async schemasStayInSyncWhenBuildersAreDeleted() {\n\t\tawait this.syncSchemas('schemas')\n\t\tconst version = versionUtil.generateVersion()\n\t\tconst typeChecker = this.Service('typeChecker')\n\t\tconst createAction = this.Action('schema', 'create')\n\n\t\tconst matcher = new RegExp(\n\t\t\t`SpruceSchemas.TestingSchemas.${version.constValue}(.*?)interface TestSchema`,\n\t\t\t'gis'\n\t\t)\n\n\t\tassert.isTrue(\n\t\t\tdiskUtil.doesFileExist(pathUtil.dirname(this.schemaTypesFile))\n\t\t)\n\n\t\tconst createResponse = await createAction.execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tconst builderFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t/testSchema\\.builder/,\n\t\t\tcreateResponse.files\n\t\t)\n\n\t\t// make sure builder is versioned\n\t\tassert.doesInclude(builderFile, version.dirValue)\n\n\t\tconst schemaFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t/testSchema\\.schema/,\n\t\t\tcreateResponse.files\n\t\t)\n\n\t\t// make sure this path is versioned\n\t\tassert.doesInclude(schemaFile, version.dirValue)\n\t\tassert.doesInclude(schemaFile, '/testingSchemas/')\n\n\t\t// schema types should be good\n\t\tawait typeChecker.check(this.schemaTypesFile)\n\n\t\t// the types should include our test schema\n\t\tlet typesContents = diskUtil.readFile(this.schemaTypesFile)\n\t\tassert.doesInclude(typesContents, matcher)\n\n\t\t// the schema file should exist\n\t\tassert.isTrue(diskUtil.doesFileExist(schemaFile))\n\n\t\t// DELETE builder and make sure we are cleaned up\n\t\tdiskUtil.deleteFile(builderFile)\n\n\t\t// this should cleanup types and schema files\n\t\tawait this.Action('schema', 'sync').execute({})\n\n\t\tassert.isTrue(diskUtil.doesFileExist(this.schemaTypesFile))\n\n\t\t// and the schema should have been deleted\n\t\tassert.isFalse(diskUtil.doesFileExist(schemaFile))\n\n\t\t// and the namespace folder should have been deleted\n\t\tconst namespaceFolder = this.resolveHashSprucePath(\n\t\t\t'schemas',\n\t\t\t'testingSChemas'\n\t\t)\n\t\tassert.isFalse(diskUtil.doesDirExist(namespaceFolder))\n\t}\n\n\t@test()\n\tprotected static async canSyncSchemasWhenOnlyNodeModuleIsInstalledAfterDecliningToInstallSkill() {\n\t\tawait this.FeatureFixture().installCachedFeatures('schemasInNodeModule')\n\n\t\tconst promise = this.Action('schema', 'sync').execute({})\n\n\t\tawait this.waitForInput()\n\n\t\tawait this.ui.sendInput('n')\n\n\t\tawait this.waitForInput()\n\n\t\tawait this.ui.sendInput('')\n\n\t\tconst results = await promise\n\n\t\tassert.isFalsy(results.errors)\n\t\tawait this.assertValidActionResponseFiles(results)\n\t}\n\n\t@test('syncs minArrayLength, importsWhenRemote')\n\tprotected static async syncsExpectedFields() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tconst schemasDir = this.resolvePath('src', 'schemas')\n\n\t\tawait diskUtil.copyDir(this.resolveTestPath('test_builders'), schemasDir)\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\t\tconst schema = await this.importSchema(results, 'schemaTwo.schema.ts')\n\n\t\tassert.isUndefined(schema.fields.phone.minArrayLength)\n\t\tassert.isEqual(schema.fields.favoriteColors.minArrayLength, 3)\n\t\tassert.isEqual(schema.fields.permissions.minArrayLength, 0)\n\t}\n\n\t@test()\n\tprotected static async canChangeSkillNamespace() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tawait this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tconst beforeFolder = this.resolveHashSprucePath('schemas', 'testingSchemas')\n\t\tconst afterFolder = this.resolveHashSprucePath('schemas', 'newNamespace')\n\n\t\tassert.isTrue(diskUtil.doesFileExist(beforeFolder))\n\t\tassert.isFalse(diskUtil.doesFileExist(afterFolder))\n\n\t\tawait this.Store('skill').setCurrentSkillsNamespace('new-namespace')\n\n\t\tawait this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalse(diskUtil.doesFileExist(beforeFolder))\n\t\tassert.isTrue(diskUtil.doesFileExist(afterFolder))\n\t}\n\n\t@test()\n\tprotected static async generatedSchemasRetainImportsAndTypeSuffix() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tconst testSchemaPath = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'testSchema.builder.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tdiskUtil.writeFile(\n\t\t\ttestSchemaPath,\n\t\t\t`import { buildSchema } from '@sprucelabs/schema'\n\n\t\texport default buildSchema({\n\t\t\tid: 'testSchema',\n\t\t\tname: 'Test schema',\n\t\t\tdescription: '',\n\t\t\timportsWhenLocal: ['import * as Local from \"@sprucelabs/schema\"'],\n\t\t\timportsWhenRemote: ['import * as Remote from \"@sprucelabs/schema\"'],\n\t\t\ttypeSuffix: '<S extends Record<string, any> = Record<string, any>>',\n\t\t\tfields: {\n\t\t\t\tfieldName1: {\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tlabel: 'First Field',\n\t\t\t\t\tisRequired: true,\n\t\t\t\t},\n\t\t\t\tfieldName2: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tlabel: 'Second Field',\n\t\t\t\t\tisRequired: true,\n\t\t\t\t\thint: 'A hint',\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\t`\n\t\t)\n\n\t\tconst syncResults = await this.Action('schema', 'sync').execute({})\n\n\t\tconst schemaPath = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'testSchema.schema.ts',\n\t\t\tsyncResults.files\n\t\t)\n\n\t\tconst imported = await this.Service('import').importDefault(schemaPath)\n\n\t\tassert.doesInclude(imported, {\n\t\t\timportsWhenRemote: ['import * as Remote from \"@sprucelabs/schema\"'],\n\t\t\ttypeSuffix: '<S extends Record<string, any> = Record<string, any>>',\n\t\t})\n\t}\n\n\tprivate static async importSchema(results: any, filename: string) {\n\t\tconst file = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\tfilename,\n\t\t\tresults.files\n\t\t)\n\n\t\tconst schema = await this.Service('import').importDefault(file)\n\n\t\treturn schema\n\t}\n\n\tprivate static async assertTypesFileGeneratesArraySelect(typesFile: string) {\n\t\tconst contents = diskUtil.readFile(typesFile)\n\t\tassert.doesInclude(contents, `'favoriteColors'?: (\"blue\" | \"red\")[]`)\n\t}\n\n\tprivate static async copyMockCoreSchemas() {\n\t\tconst source = this.resolveTestPath('mock_core_builders')\n\t\tconst destination = this.resolvePath('src', 'schemas')\n\n\t\tawait diskUtil.copyDir(source, destination)\n\t}\n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A;UAAA;YAAA;cAAA;gBACOvD,QADP,GACkBlC,0BAAA,CAASa,QAAT,CAAkB4E,SAAlB,CADlB;;gBAEC/G,YAAA,CAAOoC,WAAP,CAAmBoB,QAAnB;;cAFD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;+GAKA;QAAA;QAAA;UAAA;YAAA;cAAA;gBACOwD,MADP,GACgB,KAAKrB,eAAL,CAAqB,oBAArB,CADhB;gBAEOsB,WAFP,GAEqB,KAAKxB,WAAL,CAAiB,KAAjB,EAAwB,SAAxB,CAFrB;gBAAA;gBAAA,OAIOnE,0BAAA,CAASoE,OAAT,CAAiBsB,MAAjB,EAAyBC,WAAzB,CAJP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EA9cmDC,+B,gEACT;EACzCC,6BAA6B,EAAE;AADU,C"}
|
|
1
|
+
{"version":3,"file":"KeepingSchemasInSync.test.js","names":["TYPE_FILE_COUNT","SYNC_FILE_COUNT","Object","keys","coreSchemas","length","MOCK_CORE_SYNC_FILE_COUNT","KeepsSchemasInSyncTest","test","Cli","assert","isFunction","Action","execute","doesThrowAsync","err","errorAssert","assertError","installSchemaFeature","results","isFalsy","errors","testUtil","assertCountsByAction","files","updated","generated","skipped","shouldFetchCoreSchemas","tmpFile","resolveHashSprucePath","isFalse","diskUtil","doesFileExist","copyMockCoreSchemas","coreSyncOptions","isUndefined","isTruthy","isLength","isTrue","coreSchemaTypesFile","assertTypesFileGeneratesArraySelect","syncSchemas","isAbove","typesContents","readFile","doesInclude","RegExp","CORE_NAMESPACE","CORE_SCHEMA_VERSION","constValue","assertValidActionResponseFiles","doesNotInclude","DEFAULT_GLOBAL_SCHEMA_NAMESPACE","orgSchema","assertFileByNameInGeneratedFiles","locationSchemaContents","pkg","Service","set","path","value","nameReadable","nameCamel","createResponse","builderPath","contents","replace","writeFile","syncResults","testSchema","testSchemaContents","values","schema","id","match","version","versionUtil","generateVersion","typeChecker","createAction","matcher","pathUtil","dirname","schemaTypesFile","builderFile","dirValue","schemaFile","check","deleteFile","namespaceFolder","doesDirExist","FeatureFixture","installCachedFeatures","promise","waitForInput","ui","sendInput","schemasDir","resolvePath","copyDir","resolveTestPath","importSchema","fields","phone","minArrayLength","isEqual","favoriteColors","permissions","beforeFolder","afterFolder","Store","setCurrentSkillsNamespace","testSchemaPath","schemaPath","importDefault","imported","importsWhenRemote","typeSuffix","filename","file","typesFile","source","destination","AbstractSchemaTest","shouldGenerateCoreSchemaTypes"],"sources":["../../../../src/__tests__/behavioral/schemas/KeepingSchemasInSync.test.ts"],"sourcesContent":["import pathUtil from 'path'\nimport { versionUtil } from '@sprucelabs/spruce-skill-utils'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport {\n\tCORE_SCHEMA_VERSION,\n\tCORE_NAMESPACE,\n\tDEFAULT_GLOBAL_SCHEMA_NAMESPACE,\n} from '@sprucelabs/spruce-skill-utils'\nimport { assert, test } from '@sprucelabs/test-utils'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport { coreSchemas } from '../../../features/schema/stores/SchemaStore'\nimport AbstractSchemaTest from '../../../tests/AbstractSchemaTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\n//TODO rethink how to check for count of files and results or where it may make sense to move this test\nconst TYPE_FILE_COUNT = 2 // (only fieldMap and field.types... schema.types checked by +1 in tests)\nconst SYNC_FILE_COUNT = Object.keys(coreSchemas).length + TYPE_FILE_COUNT\nconst MOCK_CORE_SYNC_FILE_COUNT = 4 + TYPE_FILE_COUNT\n\nexport default class KeepsSchemasInSyncTest extends AbstractSchemaTest {\n\tprivate static readonly coreSyncOptions = {\n\t\tshouldGenerateCoreSchemaTypes: true,\n\t}\n\n\t@test()\n\tprotected static async hasSyncSchemaAction() {\n\t\tawait this.Cli()\n\t\tassert.isFunction(this.Action('schema', 'sync').execute)\n\t}\n\n\t@test()\n\tprotected static async failsBecauseSchemasIsNotInstalled() {\n\t\tawait this.Cli()\n\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Action('schema', 'sync').execute({})\n\t\t)\n\n\t\terrorAssert.assertError(err, 'FEATURE_NOT_INSTALLED')\n\t}\n\n\t@test()\n\tprotected static async syncingWithNoSchemasSucceeds() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\t//TODO determine better way to count files\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tupdated: 0,\n\t\t\tgenerated: SYNC_FILE_COUNT,\n\t\t\tskipped: 0,\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async syncingWithNoSchemasAndFetchCoreSchemasFalseSucceeds() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({\n\t\t\tshouldFetchCoreSchemas: false,\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tupdated: 0,\n\t\t\tgenerated: TYPE_FILE_COUNT,\n\t\t\tskipped: 0,\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async syncingCleansUpTempFiles() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst tmpFile = this.resolveHashSprucePath(\n\t\t\t'schemas',\n\t\t\t'tmp',\n\t\t\t'valueType.tmp.ts'\n\t\t)\n\n\t\tassert.isFalse(diskUtil.doesFileExist(tmpFile))\n\t}\n\n\t@test()\n\tprotected static async syncingCoreSchemasGeneratesTypesFile() {\n\t\tawait this.installSchemaFeature('schemas')\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isUndefined(results.errors)\n\t\tassert.isTruthy(results.files)\n\n\t\tassert.isLength(results.files, MOCK_CORE_SYNC_FILE_COUNT)\n\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tgenerated: MOCK_CORE_SYNC_FILE_COUNT,\n\t\t\tskipped: 0,\n\t\t\tupdated: 0,\n\t\t})\n\n\t\tassert.isTrue(diskUtil.doesFileExist(this.coreSchemaTypesFile))\n\n\t\tawait this.assertTypesFileGeneratesArraySelect(this.coreSchemaTypesFile)\n\t}\n\n\t@test()\n\tprotected static async syncSchemasTwiceSkipsFiles() {\n\t\tawait this.syncSchemas('schemas', this.coreSyncOptions)\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isFalsy(results.errors)\n\t\tassert.isAbove(results.files?.length, 0)\n\n\t\ttestUtil.assertCountsByAction(results.files, {\n\t\t\tgenerated: 0,\n\t\t\tskipped: results.files?.length ?? 0,\n\t\t\tupdated: 0,\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async makeSureSchemaTypesAreVersioned() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst typesContents = diskUtil.readFile(this.coreSchemaTypesFile)\n\t\tassert.doesInclude(\n\t\t\ttypesContents,\n\t\t\tnew RegExp(\n\t\t\t\t`SpruceSchemas.${CORE_NAMESPACE}.${CORE_SCHEMA_VERSION.constValue}(.*?)interface Person`,\n\t\t\t\t'gis'\n\t\t\t)\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async shouldGenerateCoreSchemaTypesGeneratesValidFiles() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute(\n\t\t\tthis.coreSyncOptions\n\t\t)\n\n\t\tassert.isFalsy(results.errors)\n\t\tassert.isTruthy(results.files)\n\n\t\tawait this.assertValidActionResponseFiles(results)\n\n\t\tconst typesContents = diskUtil.readFile(this.coreSchemaTypesFile)\n\n\t\tassert.doesNotInclude(typesContents, /@sprucelabs\\/spruce-core-schemas/gi)\n\t\tassert.doesInclude(\n\t\t\ttypesContents,\n\t\t\tnew RegExp(\n\t\t\t\t`export declare namespace ${DEFAULT_GLOBAL_SCHEMA_NAMESPACE}.${CORE_NAMESPACE}.${CORE_SCHEMA_VERSION.constValue}`,\n\t\t\t\t'gis'\n\t\t\t)\n\t\t)\n\n\t\tconst orgSchema = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'organization.schema.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst locationSchemaContents = diskUtil.readFile(orgSchema)\n\t\tassert.doesInclude(locationSchemaContents, 'SchemaRegistry')\n\t}\n\n\t@test()\n\tprotected static async generateCoreSchemaInCoreSchemasModule() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst pkg = this.Service('pkg')\n\t\tpkg.set({ path: 'name', value: '@sprucelabs/spruce-core-schemas' })\n\n\t\tawait this.copyMockCoreSchemas()\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalsy(results.errors)\n\t\tassert.isTruthy(results.files)\n\n\t\tconst typesContents = diskUtil.readFile(this.coreSchemaTypesFile)\n\n\t\tassert.doesNotInclude(typesContents, /@sprucelabs\\/spruce-core-schemas/gi)\n\t\tassert.doesInclude(\n\t\t\ttypesContents,\n\t\t\tnew RegExp(\n\t\t\t\t`export declare namespace ${DEFAULT_GLOBAL_SCHEMA_NAMESPACE}.${CORE_NAMESPACE}.${CORE_SCHEMA_VERSION.constValue}`,\n\t\t\t\t'gis'\n\t\t\t)\n\t\t)\n\n\t\tconst orgSchema = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'organization.schema.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst locationSchemaContents = diskUtil.readFile(orgSchema)\n\t\tassert.doesInclude(locationSchemaContents, 'SchemaRegistry')\n\t}\n\n\t@test()\n\tprotected static async canHandleHyphenSchemaIds() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tconst createResponse = await this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tassert.isFalsy(createResponse.errors)\n\n\t\tconst builderPath = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'testSchema.builder.ts',\n\t\t\tcreateResponse.files\n\t\t)\n\n\t\tconst contents = diskUtil\n\t\t\t.readFile(builderPath)\n\t\t\t.replace(\"id: 'testSchema'\", \"id: 'test-schema'\")\n\n\t\tdiskUtil.writeFile(builderPath, contents)\n\n\t\tconst syncResults = await this.Action('schema', 'sync').execute({})\n\n\t\tconst testSchema = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'test-schema.schema.ts',\n\t\t\tsyncResults.files\n\t\t)\n\n\t\tconst testSchemaContents = diskUtil.readFile(testSchema)\n\t\tassert.doesInclude(testSchemaContents, 'SchemaRegistry')\n\n\t\tawait this.assertValidActionResponseFiles(syncResults)\n\t}\n\n\t@test()\n\tprotected static async coreSchemasPullFromCoreSchemasModuleDuringNormalGeneration() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tconst createResponse = await this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tfor (const schema of Object.values(coreSchemas)) {\n\t\t\tconst id = schema.id\n\t\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t\t`${id}.schema.ts`,\n\t\t\t\tcreateResponse.files\n\t\t\t)\n\t\t\tconst contents = diskUtil.readFile(match)\n\t\t\tassert.doesInclude(\n\t\t\t\tcontents,\n\t\t\t\t`export { ${id}Schema as default } from '@sprucelabs/spruce-core-schemas'`\n\t\t\t)\n\t\t}\n\t}\n\n\t@test()\n\tprotected static async schemasStayInSyncWhenBuildersAreDeleted() {\n\t\tawait this.syncSchemas('schemas')\n\t\tconst version = versionUtil.generateVersion()\n\t\tconst typeChecker = this.Service('typeChecker')\n\t\tconst createAction = this.Action('schema', 'create')\n\n\t\tconst matcher = new RegExp(\n\t\t\t`SpruceSchemas.TestingSchemas.${version.constValue}(.*?)interface TestSchema`,\n\t\t\t'gis'\n\t\t)\n\n\t\tassert.isTrue(\n\t\t\tdiskUtil.doesFileExist(pathUtil.dirname(this.schemaTypesFile))\n\t\t)\n\n\t\tconst createResponse = await createAction.execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tconst builderFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t/testSchema\\.builder/,\n\t\t\tcreateResponse.files\n\t\t)\n\n\t\t// make sure builder is versioned\n\t\tassert.doesInclude(builderFile, version.dirValue)\n\n\t\tconst schemaFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t/testSchema\\.schema/,\n\t\t\tcreateResponse.files\n\t\t)\n\n\t\t// make sure this path is versioned\n\t\tassert.doesInclude(schemaFile, version.dirValue)\n\t\tassert.doesInclude(schemaFile, '/testingSchemas/')\n\n\t\t// schema types should be good\n\t\tawait typeChecker.check(this.schemaTypesFile)\n\n\t\t// the types should include our test schema\n\t\tlet typesContents = diskUtil.readFile(this.schemaTypesFile)\n\t\tassert.doesInclude(typesContents, matcher)\n\n\t\t// the schema file should exist\n\t\tassert.isTrue(diskUtil.doesFileExist(schemaFile))\n\n\t\t// DELETE builder and make sure we are cleaned up\n\t\tdiskUtil.deleteFile(builderFile)\n\n\t\t// this should cleanup types and schema files\n\t\tawait this.Action('schema', 'sync').execute({})\n\n\t\tassert.isTrue(diskUtil.doesFileExist(this.schemaTypesFile))\n\n\t\t// and the schema should have been deleted\n\t\tassert.isFalse(diskUtil.doesFileExist(schemaFile))\n\n\t\t// and the namespace folder should have been deleted\n\t\tconst namespaceFolder = this.resolveHashSprucePath(\n\t\t\t'schemas',\n\t\t\t'testingSChemas'\n\t\t)\n\t\tassert.isFalse(diskUtil.doesDirExist(namespaceFolder))\n\t}\n\n\t@test()\n\tprotected static async canSyncSchemasWhenOnlyNodeModuleIsInstalledAfterDecliningToInstallSkill() {\n\t\tawait this.FeatureFixture().installCachedFeatures('schemasInNodeModule')\n\n\t\tconst promise = this.Action('schema', 'sync').execute({})\n\n\t\tawait this.waitForInput()\n\n\t\tawait this.ui.sendInput('n')\n\n\t\tawait this.waitForInput()\n\n\t\tawait this.ui.sendInput('')\n\n\t\tconst results = await promise\n\n\t\tassert.isFalsy(results.errors)\n\t\tawait this.assertValidActionResponseFiles(results)\n\t}\n\n\t@test('syncs minArrayLength, importsWhenRemote')\n\tprotected static async syncsExpectedFields() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tconst schemasDir = this.resolvePath('src', 'schemas')\n\n\t\tawait diskUtil.copyDir(this.resolveTestPath('test_builders'), schemasDir)\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\t\tconst schema = await this.importSchema(results, 'schemaTwo.schema.ts')\n\n\t\tassert.isUndefined(schema.fields.phone.minArrayLength)\n\t\tassert.isEqual(schema.fields.favoriteColors.minArrayLength, 3)\n\t\tassert.isEqual(schema.fields.permissions.minArrayLength, 0)\n\t}\n\n\t@test()\n\tprotected static async canChangeSkillNamespace() {\n\t\tawait this.syncSchemas('schemas')\n\n\t\tawait this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tconst beforeFolder = this.resolveHashSprucePath('schemas', 'testingSchemas')\n\t\tconst afterFolder = this.resolveHashSprucePath('schemas', 'newNamespace')\n\n\t\tassert.isTrue(diskUtil.doesFileExist(beforeFolder))\n\t\tassert.isFalse(diskUtil.doesFileExist(afterFolder))\n\n\t\tawait this.Store('skill').setCurrentSkillsNamespace('new-namespace')\n\n\t\tawait this.Action('schema', 'sync').execute({})\n\n\t\tassert.isFalse(diskUtil.doesFileExist(beforeFolder))\n\t\tassert.isTrue(diskUtil.doesFileExist(afterFolder))\n\t}\n\n\t@test()\n\tprotected static async generatedSchemasRetainImportsAndTypeSuffix() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst results = await this.Action('schema', 'create').execute({\n\t\t\tnameReadable: 'Test schema',\n\t\t\tnameCamel: 'testSchema',\n\t\t})\n\n\t\tconst testSchemaPath = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'testSchema.builder.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tdiskUtil.writeFile(\n\t\t\ttestSchemaPath,\n\t\t\t`import { buildSchema } from '@sprucelabs/schema'\n\n\t\texport default buildSchema({\n\t\t\tid: 'testSchema',\n\t\t\tname: 'Test schema',\n\t\t\tdescription: '',\n\t\t\timportsWhenLocal: ['import * as Local from \"@sprucelabs/schema\"'],\n\t\t\timportsWhenRemote: ['import * as Remote from \"@sprucelabs/schema\"'],\n\t\t\ttypeSuffix: '<S extends Record<string, any> = Record<string, any>>',\n\t\t\tfields: {\n\t\t\t\tfieldName1: {\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tlabel: 'First Field',\n\t\t\t\t\tisRequired: true,\n\t\t\t\t},\n\t\t\t\tfieldName2: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tlabel: 'Second Field',\n\t\t\t\t\tisRequired: true,\n\t\t\t\t\thint: 'A hint',\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\t`\n\t\t)\n\n\t\tconst syncResults = await this.Action('schema', 'sync').execute({})\n\n\t\tconst schemaPath = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'testSchema.schema.ts',\n\t\t\tsyncResults.files\n\t\t)\n\n\t\tconst imported = await this.Service('import').importDefault(schemaPath)\n\n\t\tassert.doesInclude(imported, {\n\t\t\timportsWhenRemote: ['import * as Remote from \"@sprucelabs/schema\"'],\n\t\t\ttypeSuffix: '<S extends Record<string, any> = Record<string, any>>',\n\t\t})\n\t}\n\n\tprivate static async importSchema(results: any, filename: string) {\n\t\tconst file = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\tfilename,\n\t\t\tresults.files\n\t\t)\n\n\t\tconst schema = await this.Service('import').importDefault(file)\n\n\t\treturn schema\n\t}\n\n\tprivate static async assertTypesFileGeneratesArraySelect(typesFile: string) {\n\t\tconst contents = diskUtil.readFile(typesFile)\n\t\tassert.doesInclude(contents, `'favoriteColors'?: (\"blue\" | \"red\")[]`)\n\t}\n\n\tprivate static async copyMockCoreSchemas() {\n\t\tconst source = this.resolveTestPath('mock_core_builders')\n\t\tconst destination = this.resolvePath('src', 'schemas')\n\n\t\tawait diskUtil.copyDir(source, destination)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAOA;;AAEA;;AACA;;AACA;;;;;;;;AAEA;AACA,IAAMA,eAAe,GAAG,CAAxB,C,CAA0B;;AAC1B,IAAMC,eAAe,GAAGC,MAAM,CAACC,IAAP,CAAYC,wBAAZ,EAAyBC,MAAzB,GAAkCL,eAA1D;AACA,IAAMM,yBAAyB,GAAG,IAAIN,eAAtC;IAEqBO,sB,WAKnB,IAAAC,eAAA,G,UAMA,IAAAA,eAAA,G,UAWA,IAAAA,eAAA,G,UAgBA,IAAAA,eAAA,G,UAiBA,IAAAA,eAAA,G,UAiBA,IAAAA,eAAA,G,UAyBA,IAAAA,eAAA,G,UAiBA,IAAAA,eAAA,G,UAsBA,IAAAA,eAAA,G,WAmCA,IAAAA,eAAA,G,WAkCA,IAAAA,eAAA,G,WAmCA,IAAAA,eAAA,G,WAuBA,IAAAA,eAAA,G,WAmEA,IAAAA,eAAA,G,WAoBA,IAAAA,eAAA,EAAK,yCAAL,C,WAgBA,IAAAA,eAAA,G,WAuBA,IAAAA,eAAA,G;;;;;;;;;;;;;+GAhYD;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAEO,KAAKC,GAAL,EAFP;;cAAA;gBAGCC,iBAAA,CAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,QAAZ,EAAsB,MAAtB,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AA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;wGAyDA,mBAAkCnG,OAAlC,EAAgDoG,QAAhD;QAAA;QAAA;UAAA;YAAA;cAAA;gBACOC,IADP,GACclG,gBAAA,CAASiC,gCAAT,CACZgE,QADY,EAEZpG,OAAO,CAACK,KAFI,CADd;gBAAA;gBAAA,OAMsB,KAAKkC,OAAL,CAAa,QAAb,EAAuByD,aAAvB,CAAqCK,IAArC,CANtB;;cAAA;gBAMO/C,MANP;gBAAA,mCAQQA,MARR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;+HAWA,mBAAyDgD,SAAzD;QAAA;QAAA;UAAA;YAAA;cAAA;gBACOvD,QADP,GACkBlC,0BAAA,CAASa,QAAT,CAAkB4E,SAAlB,CADlB;;gBAEC/G,iBAAA,CAAOoC,WAAP,CAAmBoB,QAAnB;;cAFD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;+GAKA;QAAA;QAAA;UAAA;YAAA;cAAA;gBACOwD,MADP,GACgB,KAAKrB,eAAL,CAAqB,oBAArB,CADhB;gBAEOsB,WAFP,GAEqB,KAAKxB,WAAL,CAAiB,KAAjB,EAAwB,SAAxB,CAFrB;gBAAA;gBAAA,OAIOnE,0BAAA,CAASoE,OAAT,CAAiBsB,MAAjB,EAAyBC,WAAzB,CAJP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EA9cmDC,+B,gEACT;EACzCC,6BAA6B,EAAE;AADU,C"}
|
|
@@ -25,8 +25,6 @@ var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/
|
|
|
25
25
|
|
|
26
26
|
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
27
27
|
|
|
28
|
-
var _test = require("@sprucelabs/test");
|
|
29
|
-
|
|
30
28
|
var _testUtils = require("@sprucelabs/test-utils");
|
|
31
29
|
|
|
32
30
|
var _AbstractSchemaTest2 = _interopRequireDefault(require("../../../tests/AbstractSchemaTest"));
|
|
@@ -39,7 +37,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
39
37
|
|
|
40
38
|
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; } }
|
|
41
39
|
|
|
42
|
-
var SettingUpSchemasTests = (_dec = (0,
|
|
40
|
+
var SettingUpSchemasTests = (_dec = (0, _testUtils.test)(), _dec2 = (0, _testUtils.test)(), _dec3 = (0, _testUtils.test)(), (_class = /*#__PURE__*/function (_AbstractSchemaTest) {
|
|
43
41
|
(0, _inherits2["default"])(SettingUpSchemasTests, _AbstractSchemaTest);
|
|
44
42
|
|
|
45
43
|
var _super = _createSuper(SettingUpSchemasTests);
|
|
@@ -64,7 +62,7 @@ var SettingUpSchemasTests = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
|
|
|
64
62
|
case 2:
|
|
65
63
|
cli = _context.sent;
|
|
66
64
|
_context.next = 5;
|
|
67
|
-
return
|
|
65
|
+
return _testUtils.assert.doesThrowAsync(function () {
|
|
68
66
|
return cli.installFeatures({
|
|
69
67
|
features: [{
|
|
70
68
|
code: 'schema'
|
|
@@ -107,11 +105,11 @@ var SettingUpSchemasTests = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
|
|
|
107
105
|
pgkPath = this.resolvePath('package.json');
|
|
108
106
|
contents = JSON.stringify(_spruceSkillUtils.diskUtil.readFile(pgkPath));
|
|
109
107
|
|
|
110
|
-
|
|
108
|
+
_testUtils.assert.doesInclude(contents, '@sprucelabs/schema');
|
|
111
109
|
|
|
112
110
|
tsConfig = _tsConfig["default"].readConfig(this.cwd);
|
|
113
111
|
|
|
114
|
-
|
|
112
|
+
_testUtils.assert.isEqualDeep(tsConfig['compilerOptions']['paths'], {
|
|
115
113
|
'#spruce/*': ['.spruce/*']
|
|
116
114
|
});
|
|
117
115
|
|
|
@@ -149,9 +147,9 @@ var SettingUpSchemasTests = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
|
|
|
149
147
|
case 5:
|
|
150
148
|
health = _context3.sent;
|
|
151
149
|
|
|
152
|
-
|
|
150
|
+
_testUtils.assert.isTruthy(health.schema);
|
|
153
151
|
|
|
154
|
-
|
|
152
|
+
_testUtils.assert.isEqual(health.schema.status, 'passed');
|
|
155
153
|
|
|
156
154
|
case 8:
|
|
157
155
|
case "end":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingUpSchemas.test.js","names":["SettingUpSchemasTests","test","Cli","cli","assert","doesThrowAsync","installFeatures","features","code","err","errorAssert","assertError","installSchemaFeature","pgkPath","resolvePath","contents","JSON","stringify","diskUtil","readFile","doesInclude","tsConfig","tsConfigUtil","readConfig","cwd","isEqualDeep","checkHealth","health","isTruthy","schema","isEqual","status","AbstractSchemaTest"],"sources":["../../../../src/__tests__/behavioral/schemas/SettingUpSchemas.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport AbstractSchemaTest from '../../../tests/AbstractSchemaTest'\nimport tsConfigUtil from '../../../utilities/tsConfig.utility'\n\nexport default class SettingUpSchemasTests extends AbstractSchemaTest {\n\t@test()\n\tprotected static async failsBecauseMissingSkillInformation() {\n\t\tconst cli = await this.Cli()\n\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tcli.installFeatures({\n\t\t\t\tfeatures: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'schema',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})\n\t\t)\n\n\t\terrorAssert.assertError(err, 'VALIDATION_FAILED')\n\t}\n\n\t@test()\n\tprotected static async installsSchema() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst pgkPath = this.resolvePath('package.json')\n\t\tconst contents = JSON.stringify(diskUtil.readFile(pgkPath))\n\n\t\tassert.doesInclude(contents, '@sprucelabs/schema')\n\n\t\tconst tsConfig = tsConfigUtil.readConfig(this.cwd)\n\n\t\tassert.isEqualDeep(tsConfig['compilerOptions']['paths'], {\n\t\t\t'#spruce/*': ['.spruce/*'],\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async schemaPassesHealthCheck() {\n\t\tconst cli = await this.installSchemaFeature('schemas')\n\t\tconst health = await cli.checkHealth()\n\n\t\tassert.isTruthy(health.schema)\n\t\tassert.isEqual(health.schema.status, 'passed')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"file":"SettingUpSchemas.test.js","names":["SettingUpSchemasTests","test","Cli","cli","assert","doesThrowAsync","installFeatures","features","code","err","errorAssert","assertError","installSchemaFeature","pgkPath","resolvePath","contents","JSON","stringify","diskUtil","readFile","doesInclude","tsConfig","tsConfigUtil","readConfig","cwd","isEqualDeep","checkHealth","health","isTruthy","schema","isEqual","status","AbstractSchemaTest"],"sources":["../../../../src/__tests__/behavioral/schemas/SettingUpSchemas.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test-utils'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport AbstractSchemaTest from '../../../tests/AbstractSchemaTest'\nimport tsConfigUtil from '../../../utilities/tsConfig.utility'\n\nexport default class SettingUpSchemasTests extends AbstractSchemaTest {\n\t@test()\n\tprotected static async failsBecauseMissingSkillInformation() {\n\t\tconst cli = await this.Cli()\n\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tcli.installFeatures({\n\t\t\t\tfeatures: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'schema',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t})\n\t\t)\n\n\t\terrorAssert.assertError(err, 'VALIDATION_FAILED')\n\t}\n\n\t@test()\n\tprotected static async installsSchema() {\n\t\tawait this.installSchemaFeature('schemas')\n\n\t\tconst pgkPath = this.resolvePath('package.json')\n\t\tconst contents = JSON.stringify(diskUtil.readFile(pgkPath))\n\n\t\tassert.doesInclude(contents, '@sprucelabs/schema')\n\n\t\tconst tsConfig = tsConfigUtil.readConfig(this.cwd)\n\n\t\tassert.isEqualDeep(tsConfig['compilerOptions']['paths'], {\n\t\t\t'#spruce/*': ['.spruce/*'],\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async schemaPassesHealthCheck() {\n\t\tconst cli = await this.installSchemaFeature('schemas')\n\t\tconst health = await cli.checkHealth()\n\n\t\tassert.isTruthy(health.schema)\n\t\tassert.isEqual(health.schema.status, 'passed')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;IAEqBA,qB,WACnB,IAAAC,eAAA,G,UAiBA,IAAAA,eAAA,G,UAgBA,IAAAA,eAAA,G;;;;;;;;;;;;;+HAjCD;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAEmB,KAAKC,GAAL,EAFnB;;cAAA;gBAEOC,GAFP;gBAAA;gBAAA,OAImBC,iBAAA,CAAOC,cAAP,CAAsB;kBAAA,OACvCF,GAAG,CAACG,eAAJ,CAAoB;oBACnBC,QAAQ,EAAE,CACT;sBACCC,IAAI,EAAE;oBADP,CADS;kBADS,CAApB,CADuC;gBAAA,CAAtB,CAJnB;;cAAA;gBAIOC,GAJP;;gBAcCC,sBAAA,CAAYC,WAAZ,CAAwBF,GAAxB,EAA6B,mBAA7B;;cAdD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;0GAiBA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAEO,KAAKG,oBAAL,CAA0B,SAA1B,CAFP;;cAAA;gBAIOC,OAJP,GAIiB,KAAKC,WA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