@picteus/extension-sdk 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/backEndIntents.d.ts +216 -0
- package/dist/generated/backEndIntents.js +12 -0
- package/dist/generated/frontEndIntents.d.ts +1112 -0
- package/dist/generated/frontEndIntents.js +97 -0
- package/dist/generated/intentValidator.d.ts +49 -0
- package/dist/generated/intentValidator.js +363 -0
- package/dist/generated/viewKit.d.ts +1961 -565
- package/dist/generated/viewKit.js +1263 -489
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/picteus-ws-client/apis/AdministrationApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/AdministrationApi.js +1 -1
- package/dist/picteus-ws-client/apis/ApiSecretApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/ApiSecretApi.js +1 -1
- package/dist/picteus-ws-client/apis/CollectionApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/CollectionApi.js +1 -1
- package/dist/picteus-ws-client/apis/ExtensionApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/ExtensionApi.js +1 -1
- package/dist/picteus-ws-client/apis/ImageApi.d.ts +5 -1
- package/dist/picteus-ws-client/apis/ImageApi.js +7 -1
- package/dist/picteus-ws-client/apis/ImageAttachmentApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/ImageAttachmentApi.js +1 -1
- package/dist/picteus-ws-client/apis/MiscellaneousApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/MiscellaneousApi.js +1 -1
- package/dist/picteus-ws-client/apis/RepositoryApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/RepositoryApi.js +1 -1
- package/dist/picteus-ws-client/apis/SettingsApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/SettingsApi.js +1 -1
- package/dist/picteus-ws-client/models/ApiSecret.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApiSecret.js +1 -1
- package/dist/picteus-ws-client/models/ApiSecretSummary.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApiSecretSummary.js +1 -1
- package/dist/picteus-ws-client/models/ApiSecretType.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApiSecretType.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationConfiguration.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationConfiguration.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadata.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadata.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadataItem.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadataItem.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadataItemValue.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadataItemValue.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationSettings.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationSettings.js +1 -1
- package/dist/picteus-ws-client/models/Collection.d.ts +1 -1
- package/dist/picteus-ws-client/models/Collection.js +1 -1
- package/dist/picteus-ws-client/models/CommandEntity.d.ts +1 -1
- package/dist/picteus-ws-client/models/CommandEntity.js +1 -1
- package/dist/picteus-ws-client/models/ComputedImageFormat.d.ts +1 -1
- package/dist/picteus-ws-client/models/ComputedImageFormat.js +1 -1
- package/dist/picteus-ws-client/models/ConfigurationCapability.d.ts +1 -1
- package/dist/picteus-ws-client/models/ConfigurationCapability.js +1 -1
- package/dist/picteus-ws-client/models/ConfigurationExtensionCommand.d.ts +1 -1
- package/dist/picteus-ws-client/models/ConfigurationExtensionCommand.js +1 -1
- package/dist/picteus-ws-client/models/ConstantsRegistry.d.ts +1 -1
- package/dist/picteus-ws-client/models/ConstantsRegistry.js +1 -1
- package/dist/picteus-ws-client/models/Dates.d.ts +1 -1
- package/dist/picteus-ws-client/models/Dates.js +1 -1
- package/dist/picteus-ws-client/models/Extension.d.ts +1 -1
- package/dist/picteus-ws-client/models/Extension.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionActivity.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionActivity.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionActivityState.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionActivityState.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionAndManual.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionAndManual.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionCategory.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionCategory.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionGenerationOptions.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionGenerationOptions.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionIdImageEmbeddingName.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionIdImageEmbeddingName.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageEmbeddings.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageEmbeddings.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeature.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeature.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeatureName.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeatureName.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeaturesAttribute.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeaturesAttribute.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTag.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTag.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTagsAttribute.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTagsAttribute.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionManual.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionManual.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionSettings.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionSettings.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionState.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionState.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionsConfiguration.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionsConfiguration.js +1 -1
- package/dist/picteus-ws-client/models/GenerationRecipe.d.ts +1 -1
- package/dist/picteus-ws-client/models/GenerationRecipe.js +1 -1
- package/dist/picteus-ws-client/models/GenerationRecipePrompt.d.ts +1 -1
- package/dist/picteus-ws-client/models/GenerationRecipePrompt.js +1 -1
- package/dist/picteus-ws-client/models/Image.d.ts +1 -1
- package/dist/picteus-ws-client/models/Image.js +1 -1
- package/dist/picteus-ws-client/models/ImageDimensions.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageDimensions.js +1 -1
- package/dist/picteus-ws-client/models/ImageDistance.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageDistance.js +1 -1
- package/dist/picteus-ws-client/models/ImageEmbedding.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageEmbedding.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeature.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeature.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureFormat.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureFormat.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureNullValue.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureNullValue.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureType.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureType.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureValue.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureValue.js +1 -1
- package/dist/picteus-ws-client/models/ImageFormat.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFormat.js +1 -1
- package/dist/picteus-ws-client/models/ImageMediaUrl.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageMediaUrl.js +1 -1
- package/dist/picteus-ws-client/models/ImageMetadata.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageMetadata.js +1 -1
- package/dist/picteus-ws-client/models/ImageResizeRender.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageResizeRender.js +1 -1
- package/dist/picteus-ws-client/models/ImageSummary.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageSummary.js +1 -1
- package/dist/picteus-ws-client/models/InstructionsPrompt.d.ts +1 -1
- package/dist/picteus-ws-client/models/InstructionsPrompt.js +1 -1
- package/dist/picteus-ws-client/models/Manifest.d.ts +1 -1
- package/dist/picteus-ws-client/models/Manifest.js +1 -1
- package/dist/picteus-ws-client/models/ManifestCapability.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestCapability.js +1 -1
- package/dist/picteus-ws-client/models/ManifestCapabilityId.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestCapabilityId.js +1 -1
- package/dist/picteus-ws-client/models/ManifestEvent.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestEvent.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExecution.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExecution.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommand.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommand.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandOn.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandOn.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandSpecification.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandSpecification.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandUi.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandUi.js +1 -1
- package/dist/picteus-ws-client/models/ManifestInstructions.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestInstructions.js +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElement.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElement.js +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElementIntegration.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElementIntegration.js +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntime.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntime.js +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntimeEnvironment.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntimeEnvironment.js +1 -1
- package/dist/picteus-ws-client/models/ManifestThrottlingPolicy.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestThrottlingPolicy.js +1 -1
- package/dist/picteus-ws-client/models/ManifestUserInterface.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestUserInterface.js +1 -1
- package/dist/picteus-ws-client/models/PromptKind.d.ts +1 -1
- package/dist/picteus-ws-client/models/PromptKind.js +1 -1
- package/dist/picteus-ws-client/models/Repository.d.ts +1 -1
- package/dist/picteus-ws-client/models/Repository.js +1 -1
- package/dist/picteus-ws-client/models/RepositoryActivity.d.ts +1 -1
- package/dist/picteus-ws-client/models/RepositoryActivity.js +1 -1
- package/dist/picteus-ws-client/models/RepositoryActivityKind.d.ts +1 -1
- package/dist/picteus-ws-client/models/RepositoryActivityKind.js +1 -1
- package/dist/picteus-ws-client/models/RepositoryLocationType.d.ts +1 -1
- package/dist/picteus-ws-client/models/RepositoryLocationType.js +1 -1
- package/dist/picteus-ws-client/models/RepositoryState.d.ts +1 -1
- package/dist/picteus-ws-client/models/RepositoryState.js +1 -1
- package/dist/picteus-ws-client/models/RunCommandParameters.d.ts +1 -1
- package/dist/picteus-ws-client/models/RunCommandParameters.js +1 -1
- package/dist/picteus-ws-client/models/SearchCriteria.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchCriteria.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureComparisonOperator.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureComparisonOperator.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureCondition.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureCondition.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureConditionValue.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureConditionValue.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureLogicalOperator.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureLogicalOperator.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatures.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatures.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeaturesResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeaturesResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchFilter.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFilter.js +1 -1
- package/dist/picteus-ws-client/models/SearchFilterOrigin.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFilterOrigin.js +1 -1
- package/dist/picteus-ws-client/models/SearchImageIdResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImageIdResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchImageResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImageResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchImageSummaryResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImageSummaryResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchImagesOrigin.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImagesOrigin.js +1 -1
- package/dist/picteus-ws-client/models/SearchKeyword.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchKeyword.js +1 -1
- package/dist/picteus-ws-client/models/SearchMediaUrlResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchMediaUrlResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchOriginNature.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchOriginNature.js +1 -1
- package/dist/picteus-ws-client/models/SearchParameters.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchParameters.js +1 -1
- package/dist/picteus-ws-client/models/SearchProperties.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchProperties.js +1 -1
- package/dist/picteus-ws-client/models/SearchPropertyRange.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchPropertyRange.js +1 -1
- package/dist/picteus-ws-client/models/SearchRange.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchRange.js +1 -1
- package/dist/picteus-ws-client/models/SearchRepositoriesOrigin.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchRepositoriesOrigin.js +1 -1
- package/dist/picteus-ws-client/models/SearchSorting.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchSorting.js +1 -1
- package/dist/picteus-ws-client/models/SearchSortingProperty.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchSortingProperty.js +1 -1
- package/dist/picteus-ws-client/models/SearchTags.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchTags.js +1 -1
- package/dist/picteus-ws-client/models/SearchTagsResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchTagsResult.js +1 -1
- package/dist/picteus-ws-client/models/Software.d.ts +1 -1
- package/dist/picteus-ws-client/models/Software.js +1 -1
- package/dist/picteus-ws-client/models/TextualPrompt.d.ts +1 -1
- package/dist/picteus-ws-client/models/TextualPrompt.js +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceAnchor.d.ts +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceAnchor.js +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceSidebarIntegration.d.ts +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceSidebarIntegration.js +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceWindowIntegration.d.ts +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceWindowIntegration.js +1 -1
- package/dist/picteus-ws-client/runtime.d.ts +1 -1
- package/dist/picteus-ws-client/runtime.js +1 -1
- package/dist/picteusExtension.d.ts +13 -4
- package/dist/picteusExtension.js +45 -24
- package/package.json +4 -6
- package/dist/featureViewGrammar.d.ts +0 -2814
- package/dist/featureViewGrammar.js +0 -2612
- package/dist/generated/featureViewGrammar.d.ts +0 -3913
- package/dist/generated/featureViewGrammar.js +0 -4099
- package/dist/intents.d.ts +0 -188
- package/dist/intents.js +0 -26
- package/dist/picteus-ws-client/models/ExtensionActivityKind.d.ts +0 -26
- package/dist/picteus-ws-client/models/ExtensionActivityKind.js +0 -44
- package/dist/picteus-ws-client/models/ExtensionStatus.d.ts +0 -25
- package/dist/picteus-ws-client/models/ExtensionStatus.js +0 -43
- package/dist/picteus-ws-client/models/ImageEmbeddings.d.ts +0 -32
- package/dist/picteus-ws-client/models/ImageEmbeddings.js +0 -43
- package/dist/picteus-ws-client/models/RepositoryStatus.d.ts +0 -27
- package/dist/picteus-ws-client/models/RepositoryStatus.js +0 -45
- package/dist/picteus-ws-client/models/Settings.d.ts +0 -32
- package/dist/picteus-ws-client/models/Settings.js +0 -41
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Target layout anchor where an embedded extension user interface should be integrated.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The selected anchor is the discriminator for the supported integration surface. Its string value is part of the serialized intent contract and must match one of these declared choices.
|
|
6
|
+
*/
|
|
7
|
+
var UiAnchor;
|
|
8
|
+
(function (UiAnchor) {
|
|
9
|
+
/** Rendered inside a centered or full-screen modal dialog. */
|
|
10
|
+
UiAnchor["Modal"] = "modal";
|
|
11
|
+
/** Docked within the collateral sidebar navigation. */
|
|
12
|
+
UiAnchor["Sidebar"] = "sidebar";
|
|
13
|
+
/** Rendered inside an independent floating desktop window. */
|
|
14
|
+
UiAnchor["Window"] = "window";
|
|
15
|
+
/** Embedded within the image detail inspection view. */
|
|
16
|
+
UiAnchor["ImageDetail"] = "imageDetail";
|
|
17
|
+
/** Displayed within a dedicated tab. */
|
|
18
|
+
UiAnchor["Tab"] = "tab";
|
|
19
|
+
})(UiAnchor || (UiAnchor = {}));
|
|
20
|
+
/**
|
|
21
|
+
* Target layout anchor where an embedded extension user interface should be integrated.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* The selected anchor is the discriminator for the supported integration surface. Its string value is part of the serialized intent contract and must match one of these declared choices.
|
|
25
|
+
*/
|
|
26
|
+
export const IntentUiAnchor = UiAnchor;
|
|
27
|
+
/** Semantic classification and visual styling category of a modal dialog. */
|
|
28
|
+
var DialogType;
|
|
29
|
+
(function (DialogType) {
|
|
30
|
+
/** Error notice dialog indicating a failure or critical condition. */
|
|
31
|
+
DialogType["Error"] = "error";
|
|
32
|
+
/** Informational dialog displaying status, instructions, or notices. */
|
|
33
|
+
DialogType["Info"] = "info";
|
|
34
|
+
/** Question or confirmation prompt requiring explicit user decision. */
|
|
35
|
+
DialogType["Question"] = "question";
|
|
36
|
+
})(DialogType || (DialogType = {}));
|
|
37
|
+
/** Semantic classification and visual styling category of a modal dialog. */
|
|
38
|
+
export const IntentDialogType = DialogType;
|
|
39
|
+
/** Target view or entity type to display in the front-end. */
|
|
40
|
+
var ShowType;
|
|
41
|
+
(function (ShowType) {
|
|
42
|
+
/** Registered collateral sidebar panel. */
|
|
43
|
+
ShowType["Sidebar"] = "sidebar";
|
|
44
|
+
/** Extension settings configuration modal. */
|
|
45
|
+
ShowType["ExtensionSettings"] = "extensionSettings";
|
|
46
|
+
/** Full-screen image detail inspection view. */
|
|
47
|
+
ShowType["Image"] = "image";
|
|
48
|
+
/** Repository details and contents view. */
|
|
49
|
+
ShowType["Repository"] = "repository";
|
|
50
|
+
})(ShowType || (ShowType = {}));
|
|
51
|
+
/** Target view or entity type to display in the front-end. */
|
|
52
|
+
export const IntentShowType = ShowType;
|
|
53
|
+
/** Visual style and severity variant for toast notifications. */
|
|
54
|
+
var ToastType;
|
|
55
|
+
(function (ToastType) {
|
|
56
|
+
/** Informational toast indicating general status or successful completion. */
|
|
57
|
+
ToastType["Info"] = "info";
|
|
58
|
+
/** Cancellation toast indicating an operation was aborted or cancelled. */
|
|
59
|
+
ToastType["Cancel"] = "cancel";
|
|
60
|
+
/** Error toast indicating a failure or warning condition. */
|
|
61
|
+
ToastType["Error"] = "error";
|
|
62
|
+
})(ToastType || (ToastType = {}));
|
|
63
|
+
/** Visual style and severity variant for toast notifications. */
|
|
64
|
+
export const IntentToastType = ToastType;
|
|
65
|
+
function hasIntentProperty(intent, propertyName) {
|
|
66
|
+
return typeof intent === "object" && intent !== null && Reflect.get(intent, propertyName) !== undefined;
|
|
67
|
+
}
|
|
68
|
+
export function isFormIntent(intent) {
|
|
69
|
+
return hasIntentProperty(intent, "form");
|
|
70
|
+
}
|
|
71
|
+
export function isUiIntent(intent) {
|
|
72
|
+
return hasIntentProperty(intent, "ui");
|
|
73
|
+
}
|
|
74
|
+
export function isOpenBrowserIntent(intent) {
|
|
75
|
+
return hasIntentProperty(intent, "openBrowser");
|
|
76
|
+
}
|
|
77
|
+
export function isDialogIntent(intent) {
|
|
78
|
+
return hasIntentProperty(intent, "dialog");
|
|
79
|
+
}
|
|
80
|
+
export function isImagesIntent(intent) {
|
|
81
|
+
return hasIntentProperty(intent, "images");
|
|
82
|
+
}
|
|
83
|
+
export function isShowIntent(intent) {
|
|
84
|
+
return hasIntentProperty(intent, "show");
|
|
85
|
+
}
|
|
86
|
+
export function isToastIntent(intent) {
|
|
87
|
+
return hasIntentProperty(intent, "toast");
|
|
88
|
+
}
|
|
89
|
+
export function isNotificationIntent(intent) {
|
|
90
|
+
return hasIntentProperty(intent, "notification");
|
|
91
|
+
}
|
|
92
|
+
export function isProcessCommandIntent(intent) {
|
|
93
|
+
return hasIntentProperty(intent, "processCommand");
|
|
94
|
+
}
|
|
95
|
+
export function isActionIntent(intent) {
|
|
96
|
+
return hasIntentProperty(intent, "action");
|
|
97
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface IntentTypeDescription {
|
|
2
|
+
readonly kind: "string" | "number" | "boolean" | "bytes" | "enum" | "model" | "array" | "record" | "union" | "literal";
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly literalValue?: string | number | boolean;
|
|
5
|
+
readonly elementType?: IntentTypeDescription;
|
|
6
|
+
readonly unionTypes?: readonly IntentTypeDescription[];
|
|
7
|
+
}
|
|
8
|
+
export interface IntentPropertyDescription {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly optional: boolean;
|
|
11
|
+
readonly type: IntentTypeDescription;
|
|
12
|
+
readonly format?: string;
|
|
13
|
+
readonly minLength?: number;
|
|
14
|
+
readonly maxLength?: number;
|
|
15
|
+
readonly minValue?: number;
|
|
16
|
+
readonly maxValue?: number;
|
|
17
|
+
readonly pattern?: string;
|
|
18
|
+
readonly minItems?: number;
|
|
19
|
+
readonly maxItems?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface IntentModelDescription {
|
|
22
|
+
readonly baseModelName?: string;
|
|
23
|
+
readonly properties: readonly IntentPropertyDescription[];
|
|
24
|
+
}
|
|
25
|
+
export interface IntentSchemaDescription {
|
|
26
|
+
readonly enums: Readonly<Record<string, readonly string[]>>;
|
|
27
|
+
readonly models: Readonly<Record<string, IntentModelDescription>>;
|
|
28
|
+
readonly unions: Readonly<Record<string, readonly IntentTypeDescription[]>>;
|
|
29
|
+
readonly intents: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
export interface ValidationIssue {
|
|
32
|
+
readonly path: string;
|
|
33
|
+
readonly message: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ValidationSuccess<T = unknown> {
|
|
36
|
+
readonly success: true;
|
|
37
|
+
readonly data: T;
|
|
38
|
+
}
|
|
39
|
+
export interface ValidationFailure {
|
|
40
|
+
readonly success: false;
|
|
41
|
+
readonly error: {
|
|
42
|
+
readonly message: string;
|
|
43
|
+
readonly issues: readonly ValidationIssue[];
|
|
44
|
+
};
|
|
45
|
+
readonly issues: readonly ValidationIssue[];
|
|
46
|
+
}
|
|
47
|
+
export type ValidationResult<T = unknown> = ValidationSuccess<T> | ValidationFailure;
|
|
48
|
+
export declare function validateModel<T = unknown>(value: unknown, modelName: string, schema?: IntentSchemaDescription): ValidationResult<T>;
|
|
49
|
+
export declare function validateIntent<T = unknown>(value: unknown, schema?: IntentSchemaDescription): ValidationResult<T>;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Auto-generated by @picteus/specification-factory. Do not edit directly.
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
import { INTENT_SCHEMA_DESCRIPTION } from "./frontEndIntents.js";
|
|
5
|
+
function isValidUrl(candidate) {
|
|
6
|
+
try {
|
|
7
|
+
new URL(candidate);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function isByteBuffer(candidate) {
|
|
15
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(candidate)) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return candidate instanceof Uint8Array;
|
|
19
|
+
}
|
|
20
|
+
function collectModelProperties(modelName, schema) {
|
|
21
|
+
const model = schema.models[modelName];
|
|
22
|
+
if (!model) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const properties = [];
|
|
26
|
+
if (model.baseModelName) {
|
|
27
|
+
properties.push(...collectModelProperties(model.baseModelName, schema));
|
|
28
|
+
}
|
|
29
|
+
properties.push(...model.properties);
|
|
30
|
+
return properties;
|
|
31
|
+
}
|
|
32
|
+
function validateValue(value, type, schema, path, propertyConstraints) {
|
|
33
|
+
switch (type.kind) {
|
|
34
|
+
case "string":
|
|
35
|
+
{
|
|
36
|
+
if (typeof value !== "string") {
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
path,
|
|
40
|
+
message: `Expected string, received ${typeof value}`
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
if (propertyConstraints?.format === "url" && isValidUrl(value) === false) {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
path,
|
|
48
|
+
message: `Invalid url: "${value}"`
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
if (propertyConstraints?.minLength !== undefined && value.length < propertyConstraints.minLength) {
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
path,
|
|
56
|
+
message: `String must contain at least ${propertyConstraints.minLength} character(s)`
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
if (propertyConstraints?.maxLength !== undefined && value.length > propertyConstraints.maxLength) {
|
|
61
|
+
return [
|
|
62
|
+
{
|
|
63
|
+
path,
|
|
64
|
+
message: `String must contain at most ${propertyConstraints.maxLength} character(s)`
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
if (propertyConstraints?.pattern !== undefined) {
|
|
69
|
+
const regularExpression = new RegExp(propertyConstraints.pattern);
|
|
70
|
+
if (regularExpression.test(value) === false) {
|
|
71
|
+
return [
|
|
72
|
+
{
|
|
73
|
+
path,
|
|
74
|
+
message: `String does not match required pattern "${propertyConstraints.pattern}"`
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
case "number":
|
|
82
|
+
{
|
|
83
|
+
if (typeof value !== "number" || Number.isNaN(value) === true) {
|
|
84
|
+
return [
|
|
85
|
+
{
|
|
86
|
+
path,
|
|
87
|
+
message: `Expected number, received ${typeof value}`
|
|
88
|
+
}
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
if ((type.name === "int32" || type.name === "integer" || type.name === "int64") && Number.isInteger(value) === false) {
|
|
92
|
+
return [
|
|
93
|
+
{
|
|
94
|
+
path,
|
|
95
|
+
message: `Expected integer for ${type.name}, received float ${value}`
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
if (propertyConstraints?.minValue !== undefined && value < propertyConstraints.minValue) {
|
|
100
|
+
return [
|
|
101
|
+
{
|
|
102
|
+
path,
|
|
103
|
+
message: `Number must be greater than or equal to ${propertyConstraints.minValue}`
|
|
104
|
+
}
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
if (propertyConstraints?.maxValue !== undefined && value > propertyConstraints.maxValue) {
|
|
108
|
+
return [
|
|
109
|
+
{
|
|
110
|
+
path,
|
|
111
|
+
message: `Number must be less than or equal to ${propertyConstraints.maxValue}`
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
case "boolean":
|
|
118
|
+
{
|
|
119
|
+
if (typeof value !== "boolean") {
|
|
120
|
+
return [
|
|
121
|
+
{
|
|
122
|
+
path,
|
|
123
|
+
message: `Expected boolean, received ${typeof value}`
|
|
124
|
+
}
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
case "bytes":
|
|
130
|
+
{
|
|
131
|
+
if (isByteBuffer(value) === false) {
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
path,
|
|
135
|
+
message: `Expected Buffer or Uint8Array, received ${typeof value}`
|
|
136
|
+
}
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
case "literal":
|
|
142
|
+
{
|
|
143
|
+
if (value !== type.literalValue) {
|
|
144
|
+
return [
|
|
145
|
+
{
|
|
146
|
+
path,
|
|
147
|
+
message: `Expected literal ${JSON.stringify(type.literalValue)}, received ${JSON.stringify(value)}`
|
|
148
|
+
}
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
case "enum":
|
|
154
|
+
{
|
|
155
|
+
const allowedMembers = schema.enums[type.name];
|
|
156
|
+
if (!allowedMembers) {
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
path,
|
|
160
|
+
message: `Unknown enum "${type.name}" in schema`
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
if (typeof value !== "string" || allowedMembers.includes(value) === false) {
|
|
165
|
+
return [
|
|
166
|
+
{
|
|
167
|
+
path,
|
|
168
|
+
message: `Invalid value ${JSON.stringify(value)} for enum ${type.name}. Expected one of: ${allowedMembers.map((member) => JSON.stringify(member)).join(", ")}`
|
|
169
|
+
}
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
return [];
|
|
173
|
+
}
|
|
174
|
+
case "record":
|
|
175
|
+
{
|
|
176
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) === true) {
|
|
177
|
+
return [
|
|
178
|
+
{
|
|
179
|
+
path,
|
|
180
|
+
message: `Expected object, received ${value === null ? "null" : Array.isArray(value) ? "array" : typeof value}`
|
|
181
|
+
}
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
case "array":
|
|
187
|
+
{
|
|
188
|
+
if (Array.isArray(value) === false) {
|
|
189
|
+
return [
|
|
190
|
+
{
|
|
191
|
+
path,
|
|
192
|
+
message: `Expected array, received ${typeof value}`
|
|
193
|
+
}
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
if (propertyConstraints?.minItems !== undefined && value.length < propertyConstraints.minItems) {
|
|
197
|
+
return [
|
|
198
|
+
{
|
|
199
|
+
path,
|
|
200
|
+
message: `Array must contain at least ${propertyConstraints.minItems} item(s)`
|
|
201
|
+
}
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
if (propertyConstraints?.maxItems !== undefined && value.length > propertyConstraints.maxItems) {
|
|
205
|
+
return [
|
|
206
|
+
{
|
|
207
|
+
path,
|
|
208
|
+
message: `Array must contain at most ${propertyConstraints.maxItems} item(s)`
|
|
209
|
+
}
|
|
210
|
+
];
|
|
211
|
+
}
|
|
212
|
+
if (type.elementType) {
|
|
213
|
+
const collectedIssues = [];
|
|
214
|
+
for (let itemIndex = 0; itemIndex < value.length; itemIndex++) {
|
|
215
|
+
const itemPath = `${path}[${itemIndex}]`;
|
|
216
|
+
const itemIssues = validateValue(value[itemIndex], type.elementType, schema, itemPath);
|
|
217
|
+
collectedIssues.push(...itemIssues);
|
|
218
|
+
}
|
|
219
|
+
return collectedIssues;
|
|
220
|
+
}
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
223
|
+
case "union":
|
|
224
|
+
{
|
|
225
|
+
const variantTypes = type.unionTypes ?? [];
|
|
226
|
+
let bestCandidateIssues = [];
|
|
227
|
+
let hasMatchedVariant = false;
|
|
228
|
+
for (const variant of variantTypes) {
|
|
229
|
+
const variantIssues = validateValue(value, variant, schema, path);
|
|
230
|
+
if (variantIssues.length === 0) {
|
|
231
|
+
hasMatchedVariant = true;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
if (bestCandidateIssues.length === 0 || variantIssues.length < bestCandidateIssues.length) {
|
|
235
|
+
bestCandidateIssues = variantIssues;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (hasMatchedVariant === false) {
|
|
239
|
+
const failureDetail = bestCandidateIssues[0]?.message ?? "no variant matched";
|
|
240
|
+
return [
|
|
241
|
+
{
|
|
242
|
+
path,
|
|
243
|
+
message: `Value does not match any union variant for "${type.name}". Reason: ${failureDetail}`
|
|
244
|
+
}
|
|
245
|
+
];
|
|
246
|
+
}
|
|
247
|
+
return [];
|
|
248
|
+
}
|
|
249
|
+
case "model":
|
|
250
|
+
{
|
|
251
|
+
if (schema.unions[type.name]) {
|
|
252
|
+
const namedUnionVariants = schema.unions[type.name];
|
|
253
|
+
return validateValue(value, {
|
|
254
|
+
kind: "union",
|
|
255
|
+
name: type.name,
|
|
256
|
+
unionTypes: namedUnionVariants
|
|
257
|
+
}, schema, path);
|
|
258
|
+
}
|
|
259
|
+
const model = schema.models[type.name];
|
|
260
|
+
if (!model) {
|
|
261
|
+
return [
|
|
262
|
+
{
|
|
263
|
+
path,
|
|
264
|
+
message: `Unknown model "${type.name}" in schema`
|
|
265
|
+
}
|
|
266
|
+
];
|
|
267
|
+
}
|
|
268
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) === true) {
|
|
269
|
+
return [
|
|
270
|
+
{
|
|
271
|
+
path,
|
|
272
|
+
message: `Expected object for model "${type.name}", received ${value === null ? "null" : Array.isArray(value) ? "array" : typeof value}`
|
|
273
|
+
}
|
|
274
|
+
];
|
|
275
|
+
}
|
|
276
|
+
const recordValue = value;
|
|
277
|
+
const allProperties = collectModelProperties(type.name, schema);
|
|
278
|
+
const modelIssues = [];
|
|
279
|
+
for (const property of allProperties) {
|
|
280
|
+
const propertyPath = path.length > 0 ? `${path}.${property.name}` : property.name;
|
|
281
|
+
const propertyValue = recordValue[property.name];
|
|
282
|
+
if (propertyValue === undefined) {
|
|
283
|
+
if (property.optional === false) {
|
|
284
|
+
modelIssues.push({
|
|
285
|
+
path: propertyPath,
|
|
286
|
+
message: `Missing required property "${property.name}"`
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
const propertyIssues = validateValue(propertyValue, property.type, schema, propertyPath, property);
|
|
292
|
+
modelIssues.push(...propertyIssues);
|
|
293
|
+
}
|
|
294
|
+
return modelIssues;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function createValidationSuccess(data) {
|
|
299
|
+
return {
|
|
300
|
+
success: true,
|
|
301
|
+
data
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function createValidationFailure(issues) {
|
|
305
|
+
const firstIssueMessage = issues[0]?.message ?? "Validation failed";
|
|
306
|
+
return {
|
|
307
|
+
success: false,
|
|
308
|
+
error: {
|
|
309
|
+
message: firstIssueMessage,
|
|
310
|
+
issues
|
|
311
|
+
},
|
|
312
|
+
issues
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
export function validateModel(value, modelName, schema = INTENT_SCHEMA_DESCRIPTION) {
|
|
316
|
+
const issues = validateValue(value, { kind: "model", name: modelName }, schema, "");
|
|
317
|
+
if (issues.length === 0) {
|
|
318
|
+
return createValidationSuccess(value);
|
|
319
|
+
}
|
|
320
|
+
return createValidationFailure(issues);
|
|
321
|
+
}
|
|
322
|
+
export function validateIntent(value, schema = INTENT_SCHEMA_DESCRIPTION) {
|
|
323
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) === true) {
|
|
324
|
+
return createValidationFailure([
|
|
325
|
+
{
|
|
326
|
+
path: "",
|
|
327
|
+
message: `Expected intent object, received ${value === null ? "null" : Array.isArray(value) ? "array" : typeof value}`
|
|
328
|
+
}
|
|
329
|
+
]);
|
|
330
|
+
}
|
|
331
|
+
const recordValue = value;
|
|
332
|
+
const candidateIntentNames = schema.intents.filter((candidateName) => {
|
|
333
|
+
const model = schema.models[candidateName];
|
|
334
|
+
if (!model) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
return model.properties.some((property) => property.optional === false && property.name in recordValue);
|
|
338
|
+
});
|
|
339
|
+
if (candidateIntentNames.length === 0) {
|
|
340
|
+
return createValidationFailure([
|
|
341
|
+
{
|
|
342
|
+
path: "",
|
|
343
|
+
message: "Object does not match any recognized intent structure"
|
|
344
|
+
}
|
|
345
|
+
]);
|
|
346
|
+
}
|
|
347
|
+
let bestFailureResult = null;
|
|
348
|
+
for (const candidateName of candidateIntentNames) {
|
|
349
|
+
const candidateResult = validateModel(value, candidateName, schema);
|
|
350
|
+
if (candidateResult.success === true) {
|
|
351
|
+
return candidateResult;
|
|
352
|
+
}
|
|
353
|
+
if (bestFailureResult === null || candidateResult.issues.length < bestFailureResult.issues.length) {
|
|
354
|
+
bestFailureResult = candidateResult;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return bestFailureResult ?? createValidationFailure([
|
|
358
|
+
{
|
|
359
|
+
path: "",
|
|
360
|
+
message: "Intent validation failed"
|
|
361
|
+
}
|
|
362
|
+
]);
|
|
363
|
+
}
|