@uniformdev/canvas 19.130.0 → 19.131.1-alpha.8
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/index.d.mts +139 -4
- package/dist/index.d.ts +139 -4
- package/dist/index.esm.js +35 -4
- package/dist/index.js +37 -4
- package/dist/index.mjs +35 -4
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
@@ -8272,6 +8272,12 @@ interface paths$6 {
|
|
8272
8272
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
8273
8273
|
*/
|
8274
8274
|
releaseId?: components$4["parameters"]["releaseId"];
|
8275
|
+
/**
|
8276
|
+
* @deprecated Search on textual fields of a composition.
|
8277
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
8278
|
+
* Example: ?search=hello
|
8279
|
+
*/
|
8280
|
+
search?: components$4["parameters"]["search"];
|
8275
8281
|
};
|
8276
8282
|
};
|
8277
8283
|
responses: {
|
@@ -8629,6 +8635,13 @@ interface components$4 {
|
|
8629
8635
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
8630
8636
|
*/
|
8631
8637
|
releaseId: string;
|
8638
|
+
/**
|
8639
|
+
* @deprecated
|
8640
|
+
* @description Search on textual fields of a composition.
|
8641
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
8642
|
+
* Example: ?search=hello
|
8643
|
+
*/
|
8644
|
+
search: string;
|
8632
8645
|
};
|
8633
8646
|
}
|
8634
8647
|
interface external$7 {
|
@@ -11045,6 +11058,12 @@ interface external$5 {
|
|
11045
11058
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
11046
11059
|
*/
|
11047
11060
|
releaseId?: external$5["../../../lambda/functions/v1-canvas.swagger.yml"]["components"]["parameters"]["releaseId"];
|
11061
|
+
/**
|
11062
|
+
* @deprecated Search on textual fields of a composition.
|
11063
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
11064
|
+
* Example: ?search=hello
|
11065
|
+
*/
|
11066
|
+
search?: external$5["../../../lambda/functions/v1-canvas.swagger.yml"]["components"]["parameters"]["search"];
|
11048
11067
|
};
|
11049
11068
|
};
|
11050
11069
|
responses: {
|
@@ -11402,6 +11421,13 @@ interface external$5 {
|
|
11402
11421
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
11403
11422
|
*/
|
11404
11423
|
releaseId: string;
|
11424
|
+
/**
|
11425
|
+
* @deprecated
|
11426
|
+
* @description Search on textual fields of a composition.
|
11427
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
11428
|
+
* Example: ?search=hello
|
11429
|
+
*/
|
11430
|
+
search: string;
|
11405
11431
|
};
|
11406
11432
|
};
|
11407
11433
|
operations: {};
|
@@ -13339,6 +13365,12 @@ interface external$4 {
|
|
13339
13365
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
13340
13366
|
*/
|
13341
13367
|
releaseId?: external$4["v1-canvas.swagger.yml"]["components"]["parameters"]["releaseId"];
|
13368
|
+
/**
|
13369
|
+
* @deprecated Search on textual fields of a composition.
|
13370
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
13371
|
+
* Example: ?search=hello
|
13372
|
+
*/
|
13373
|
+
search?: external$4["v1-canvas.swagger.yml"]["components"]["parameters"]["search"];
|
13342
13374
|
};
|
13343
13375
|
};
|
13344
13376
|
responses: {
|
@@ -13696,6 +13728,13 @@ interface external$4 {
|
|
13696
13728
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
13697
13729
|
*/
|
13698
13730
|
releaseId: string;
|
13731
|
+
/**
|
13732
|
+
* @deprecated
|
13733
|
+
* @description Search on textual fields of a composition.
|
13734
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
13735
|
+
* Example: ?search=hello
|
13736
|
+
*/
|
13737
|
+
search: string;
|
13699
13738
|
};
|
13700
13739
|
};
|
13701
13740
|
operations: {};
|
@@ -14098,12 +14137,86 @@ type CanvasClientOptions = ClientOptions & {
|
|
14098
14137
|
edgeApiHost?: string;
|
14099
14138
|
disableSWR?: boolean;
|
14100
14139
|
};
|
14140
|
+
type CompositionFilters = Partial<Record<'entityId' | 'releaseId' | 'type' | 'uiStatus', {
|
14141
|
+
eq: string;
|
14142
|
+
} | {
|
14143
|
+
neq: string;
|
14144
|
+
} | {
|
14145
|
+
in: string[];
|
14146
|
+
} | {
|
14147
|
+
nin: string[];
|
14148
|
+
}> | Record<`${'entityId' | 'releaseId' | 'type' | 'uiStatus'}[${'eq' | 'neq'}]`, string> | Record<`${'entityId' | 'releaseId' | 'type' | 'uiStatus'}[${'in' | 'nin'}]`, string[]> | Record<'created' | 'modified', {
|
14149
|
+
eq: string;
|
14150
|
+
} | {
|
14151
|
+
neq: string;
|
14152
|
+
} | {
|
14153
|
+
in: string[];
|
14154
|
+
} | {
|
14155
|
+
nin: string[];
|
14156
|
+
} | {
|
14157
|
+
gt: string;
|
14158
|
+
} | {
|
14159
|
+
gte: string;
|
14160
|
+
} | {
|
14161
|
+
lt: string;
|
14162
|
+
} | {
|
14163
|
+
lte: string;
|
14164
|
+
}> | Record<`${'created' | 'modified'}[${'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'}]`, string> | Record<`${'created' | 'modified'}[${'in' | 'nin'}]`, string[]> | Record<'locale' | 'patternId', {
|
14165
|
+
eq: string;
|
14166
|
+
} | {
|
14167
|
+
neq: string;
|
14168
|
+
} | {
|
14169
|
+
in: string[];
|
14170
|
+
} | {
|
14171
|
+
nin: string[];
|
14172
|
+
} | {
|
14173
|
+
def: boolean | 'true' | 'false';
|
14174
|
+
}> | Record<`${'locale' | 'patternId'}[${'eq' | 'neq'}]`, string> | Record<`${'locale' | 'patternId'}[${'in' | 'nin'}]`, string[]> | Record<`${'locale' | 'patternId'}[def]`, boolean | 'true' | 'false'> | Record<'name' | 'slug', {
|
14175
|
+
match: string;
|
14176
|
+
} | {
|
14177
|
+
eq: string;
|
14178
|
+
} | {
|
14179
|
+
neq: string;
|
14180
|
+
} | {
|
14181
|
+
in: string[];
|
14182
|
+
} | {
|
14183
|
+
nin: string[];
|
14184
|
+
} | {
|
14185
|
+
def: boolean | 'true' | 'false';
|
14186
|
+
}> | Record<`${'name' | 'slug'}[${'match' | 'eq' | 'neq'}]`, string> | Record<`${'name' | 'slug'}[${'in' | 'nin'}]`, string[]> | Record<`${'name' | 'slug'}[def]`, boolean | 'true' | 'false'> | Record<'isPattern', {
|
14187
|
+
eq: boolean | 'true' | 'false';
|
14188
|
+
} | {
|
14189
|
+
neq: boolean | 'true' | 'false';
|
14190
|
+
}> | Record<`isPattern[${'eq' | 'neq'}]`, boolean | 'true' | 'false'> | Record<`parameters.${string}`, {
|
14191
|
+
match: string;
|
14192
|
+
} | {
|
14193
|
+
eq: string | number | boolean;
|
14194
|
+
} | {
|
14195
|
+
neq: string | number | boolean;
|
14196
|
+
} | {
|
14197
|
+
in: (string | number | boolean)[];
|
14198
|
+
} | {
|
14199
|
+
nin: (string | number | boolean)[];
|
14200
|
+
} | {
|
14201
|
+
gt: string | number;
|
14202
|
+
} | {
|
14203
|
+
gte: string | number;
|
14204
|
+
} | {
|
14205
|
+
lt: string | number;
|
14206
|
+
} | {
|
14207
|
+
lte: string | number;
|
14208
|
+
} | {
|
14209
|
+
def: boolean | 'true' | 'false';
|
14210
|
+
}> | Record<`parameters.${string}[match]`, string> | Record<`parameters.${string}[${'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'}]`, string | number> | Record<`parameters.${string}[${'in' | 'nin'}]`, (string | number)[]> | Record<`parameters.${string}[def]`, boolean | 'true' | 'false'>>;
|
14101
14211
|
declare class CanvasClient extends ApiClient<CanvasClientOptions> {
|
14102
14212
|
private edgeApiHost;
|
14103
14213
|
private edgeApiRequestInit?;
|
14104
14214
|
constructor(options: CanvasClientOptions);
|
14105
14215
|
/** Fetches lists of Canvas compositions, optionally by type */
|
14106
|
-
getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> &
|
14216
|
+
getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> & {
|
14217
|
+
/** @deprecated do not use */
|
14218
|
+
filters?: CompositionFilters;
|
14219
|
+
} & ({
|
14107
14220
|
resolveData: true;
|
14108
14221
|
diagnostics?: boolean;
|
14109
14222
|
} | {
|
@@ -14157,7 +14270,6 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
|
|
14157
14270
|
canBeComposition?: boolean | undefined;
|
14158
14271
|
parameters?: {
|
14159
14272
|
id: string;
|
14160
|
-
/** Fetches a component definition's composition defaults */
|
14161
14273
|
name: string;
|
14162
14274
|
helpText?: string | undefined;
|
14163
14275
|
type: string;
|
@@ -16170,6 +16282,8 @@ type AddComponentMessage = {
|
|
16170
16282
|
parentId: string;
|
16171
16283
|
slotName: string;
|
16172
16284
|
index: number;
|
16285
|
+
componentId?: string;
|
16286
|
+
isPattern?: boolean;
|
16173
16287
|
};
|
16174
16288
|
type MoveComponentMessage = {
|
16175
16289
|
type: 'move-component';
|
@@ -16231,7 +16345,24 @@ type ReportRenderedCompositionsMessage = {
|
|
16231
16345
|
type EditorStateUpdatedMessage = {
|
16232
16346
|
type: 'editor-state-updated';
|
16233
16347
|
};
|
16234
|
-
type
|
16348
|
+
type RequestComponentSuggestionMessage = {
|
16349
|
+
type: 'request-component-suggestion';
|
16350
|
+
parentId: string;
|
16351
|
+
slotName: string;
|
16352
|
+
index?: number;
|
16353
|
+
};
|
16354
|
+
type SuggestComponentMessage = {
|
16355
|
+
type: 'suggest-component';
|
16356
|
+
parentId: string;
|
16357
|
+
slotName: string;
|
16358
|
+
suggestion: {
|
16359
|
+
id: string;
|
16360
|
+
name: string;
|
16361
|
+
isPattern: boolean;
|
16362
|
+
} | undefined;
|
16363
|
+
hasMoreOptions?: boolean;
|
16364
|
+
};
|
16365
|
+
type ChannelMessage = SelectComponentMessage | ReadyMessage | UpdateCompositionMessage | UpdateCompositionInternalMessage | TriggerComponentActionMessage | AddComponentMessage | MoveComponentMessage | TriggerCompositionActionMessage | UpdatePreviewSettingsMessage | UpdateFeatureFlagsMessage | ReportRenderedCompositionsMessage | UpdateComponentParameterMessage | UpdateContextualEditingStateInternalMessage | SelectParameterMessage | DismissPlaceholderMessage | UpdateComponentReferencesMessage | OpenParameterEditorMessage | RequestComponentSuggestionMessage | SuggestComponentMessage | EditorStateUpdatedMessage;
|
16235
16366
|
declare const isSelectComponentMessage: (message: ChannelMessage) => message is SelectComponentMessage;
|
16236
16367
|
declare const isReadyMessage: (message: ChannelMessage) => message is ReadyMessage;
|
16237
16368
|
declare const isComponentActionMessage: (message: ChannelMessage) => message is TriggerComponentActionMessage;
|
@@ -16249,6 +16380,8 @@ declare const isReportRenderedCompositionsMessage: (message: ChannelMessage) =>
|
|
16249
16380
|
declare const isSelectParameterMessage: (message: ChannelMessage) => message is SelectParameterMessage;
|
16250
16381
|
declare const isOpenParameterEditorMessage: (message: ChannelMessage) => message is OpenParameterEditorMessage;
|
16251
16382
|
declare const isUpdateComponentReferencesMessage: (message: ChannelMessage) => message is UpdateComponentReferencesMessage;
|
16383
|
+
declare const isRequestComponentSuggestionMessage: (message: ChannelMessage) => message is RequestComponentSuggestionMessage;
|
16384
|
+
declare const isSuggestComponentMessage: (message: ChannelMessage) => message is SuggestComponentMessage;
|
16252
16385
|
type MessageHandler = (message: ChannelMessage, originalEvent: MessageEvent) => void;
|
16253
16386
|
type Channel = {
|
16254
16387
|
on: (types: ChannelMessage['type'][] | ChannelMessage['type'], handler: MessageHandler) => () => void;
|
@@ -16269,6 +16402,8 @@ type Channel = {
|
|
16269
16402
|
updateFeatureFlags: (options: Omit<UpdateFeatureFlagsMessage, 'type'>) => void;
|
16270
16403
|
updateContextualEditingStateInternal: (options: Omit<UpdateContextualEditingStateInternalMessage, 'type'>) => void;
|
16271
16404
|
reportRenderedCompositions: (options: Omit<ReportRenderedCompositionsMessage, 'type'>) => void;
|
16405
|
+
requestComponentSuggestion: (options: Omit<RequestComponentSuggestionMessage, 'type'>) => void;
|
16406
|
+
suggestComponent: (options: Omit<SuggestComponentMessage, 'type'>) => void;
|
16272
16407
|
updateComponentReferences: (options: Omit<UpdateComponentReferencesMessage, 'type'>) => void;
|
16273
16408
|
editorStateUpdated: () => void;
|
16274
16409
|
};
|
@@ -17044,4 +17179,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
|
|
17044
17179
|
|
17045
17180
|
declare const CanvasClientError: typeof ApiClientError;
|
17046
17181
|
|
17047
|
-
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextualEditingComponentReference, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryList, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, type PreviewEventBus, type PreviewPanelSettings, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type SubscribeToCompositionOptions, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
|
17182
|
+
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextualEditingComponentReference, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryList, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, type PreviewEventBus, type PreviewPanelSettings, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type SubscribeToCompositionOptions, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
|
package/dist/index.d.ts
CHANGED
@@ -8272,6 +8272,12 @@ interface paths$6 {
|
|
8272
8272
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
8273
8273
|
*/
|
8274
8274
|
releaseId?: components$4["parameters"]["releaseId"];
|
8275
|
+
/**
|
8276
|
+
* @deprecated Search on textual fields of a composition.
|
8277
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
8278
|
+
* Example: ?search=hello
|
8279
|
+
*/
|
8280
|
+
search?: components$4["parameters"]["search"];
|
8275
8281
|
};
|
8276
8282
|
};
|
8277
8283
|
responses: {
|
@@ -8629,6 +8635,13 @@ interface components$4 {
|
|
8629
8635
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
8630
8636
|
*/
|
8631
8637
|
releaseId: string;
|
8638
|
+
/**
|
8639
|
+
* @deprecated
|
8640
|
+
* @description Search on textual fields of a composition.
|
8641
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
8642
|
+
* Example: ?search=hello
|
8643
|
+
*/
|
8644
|
+
search: string;
|
8632
8645
|
};
|
8633
8646
|
}
|
8634
8647
|
interface external$7 {
|
@@ -11045,6 +11058,12 @@ interface external$5 {
|
|
11045
11058
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
11046
11059
|
*/
|
11047
11060
|
releaseId?: external$5["../../../lambda/functions/v1-canvas.swagger.yml"]["components"]["parameters"]["releaseId"];
|
11061
|
+
/**
|
11062
|
+
* @deprecated Search on textual fields of a composition.
|
11063
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
11064
|
+
* Example: ?search=hello
|
11065
|
+
*/
|
11066
|
+
search?: external$5["../../../lambda/functions/v1-canvas.swagger.yml"]["components"]["parameters"]["search"];
|
11048
11067
|
};
|
11049
11068
|
};
|
11050
11069
|
responses: {
|
@@ -11402,6 +11421,13 @@ interface external$5 {
|
|
11402
11421
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
11403
11422
|
*/
|
11404
11423
|
releaseId: string;
|
11424
|
+
/**
|
11425
|
+
* @deprecated
|
11426
|
+
* @description Search on textual fields of a composition.
|
11427
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
11428
|
+
* Example: ?search=hello
|
11429
|
+
*/
|
11430
|
+
search: string;
|
11405
11431
|
};
|
11406
11432
|
};
|
11407
11433
|
operations: {};
|
@@ -13339,6 +13365,12 @@ interface external$4 {
|
|
13339
13365
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
13340
13366
|
*/
|
13341
13367
|
releaseId?: external$4["v1-canvas.swagger.yml"]["components"]["parameters"]["releaseId"];
|
13368
|
+
/**
|
13369
|
+
* @deprecated Search on textual fields of a composition.
|
13370
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
13371
|
+
* Example: ?search=hello
|
13372
|
+
*/
|
13373
|
+
search?: external$4["v1-canvas.swagger.yml"]["components"]["parameters"]["search"];
|
13342
13374
|
};
|
13343
13375
|
};
|
13344
13376
|
responses: {
|
@@ -13696,6 +13728,13 @@ interface external$4 {
|
|
13696
13728
|
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be null.
|
13697
13729
|
*/
|
13698
13730
|
releaseId: string;
|
13731
|
+
/**
|
13732
|
+
* @deprecated
|
13733
|
+
* @description Search on textual fields of a composition.
|
13734
|
+
* Note: for long text fields the tail of the text is not guaranteed to be searchable.
|
13735
|
+
* Example: ?search=hello
|
13736
|
+
*/
|
13737
|
+
search: string;
|
13699
13738
|
};
|
13700
13739
|
};
|
13701
13740
|
operations: {};
|
@@ -14098,12 +14137,86 @@ type CanvasClientOptions = ClientOptions & {
|
|
14098
14137
|
edgeApiHost?: string;
|
14099
14138
|
disableSWR?: boolean;
|
14100
14139
|
};
|
14140
|
+
type CompositionFilters = Partial<Record<'entityId' | 'releaseId' | 'type' | 'uiStatus', {
|
14141
|
+
eq: string;
|
14142
|
+
} | {
|
14143
|
+
neq: string;
|
14144
|
+
} | {
|
14145
|
+
in: string[];
|
14146
|
+
} | {
|
14147
|
+
nin: string[];
|
14148
|
+
}> | Record<`${'entityId' | 'releaseId' | 'type' | 'uiStatus'}[${'eq' | 'neq'}]`, string> | Record<`${'entityId' | 'releaseId' | 'type' | 'uiStatus'}[${'in' | 'nin'}]`, string[]> | Record<'created' | 'modified', {
|
14149
|
+
eq: string;
|
14150
|
+
} | {
|
14151
|
+
neq: string;
|
14152
|
+
} | {
|
14153
|
+
in: string[];
|
14154
|
+
} | {
|
14155
|
+
nin: string[];
|
14156
|
+
} | {
|
14157
|
+
gt: string;
|
14158
|
+
} | {
|
14159
|
+
gte: string;
|
14160
|
+
} | {
|
14161
|
+
lt: string;
|
14162
|
+
} | {
|
14163
|
+
lte: string;
|
14164
|
+
}> | Record<`${'created' | 'modified'}[${'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'}]`, string> | Record<`${'created' | 'modified'}[${'in' | 'nin'}]`, string[]> | Record<'locale' | 'patternId', {
|
14165
|
+
eq: string;
|
14166
|
+
} | {
|
14167
|
+
neq: string;
|
14168
|
+
} | {
|
14169
|
+
in: string[];
|
14170
|
+
} | {
|
14171
|
+
nin: string[];
|
14172
|
+
} | {
|
14173
|
+
def: boolean | 'true' | 'false';
|
14174
|
+
}> | Record<`${'locale' | 'patternId'}[${'eq' | 'neq'}]`, string> | Record<`${'locale' | 'patternId'}[${'in' | 'nin'}]`, string[]> | Record<`${'locale' | 'patternId'}[def]`, boolean | 'true' | 'false'> | Record<'name' | 'slug', {
|
14175
|
+
match: string;
|
14176
|
+
} | {
|
14177
|
+
eq: string;
|
14178
|
+
} | {
|
14179
|
+
neq: string;
|
14180
|
+
} | {
|
14181
|
+
in: string[];
|
14182
|
+
} | {
|
14183
|
+
nin: string[];
|
14184
|
+
} | {
|
14185
|
+
def: boolean | 'true' | 'false';
|
14186
|
+
}> | Record<`${'name' | 'slug'}[${'match' | 'eq' | 'neq'}]`, string> | Record<`${'name' | 'slug'}[${'in' | 'nin'}]`, string[]> | Record<`${'name' | 'slug'}[def]`, boolean | 'true' | 'false'> | Record<'isPattern', {
|
14187
|
+
eq: boolean | 'true' | 'false';
|
14188
|
+
} | {
|
14189
|
+
neq: boolean | 'true' | 'false';
|
14190
|
+
}> | Record<`isPattern[${'eq' | 'neq'}]`, boolean | 'true' | 'false'> | Record<`parameters.${string}`, {
|
14191
|
+
match: string;
|
14192
|
+
} | {
|
14193
|
+
eq: string | number | boolean;
|
14194
|
+
} | {
|
14195
|
+
neq: string | number | boolean;
|
14196
|
+
} | {
|
14197
|
+
in: (string | number | boolean)[];
|
14198
|
+
} | {
|
14199
|
+
nin: (string | number | boolean)[];
|
14200
|
+
} | {
|
14201
|
+
gt: string | number;
|
14202
|
+
} | {
|
14203
|
+
gte: string | number;
|
14204
|
+
} | {
|
14205
|
+
lt: string | number;
|
14206
|
+
} | {
|
14207
|
+
lte: string | number;
|
14208
|
+
} | {
|
14209
|
+
def: boolean | 'true' | 'false';
|
14210
|
+
}> | Record<`parameters.${string}[match]`, string> | Record<`parameters.${string}[${'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'}]`, string | number> | Record<`parameters.${string}[${'in' | 'nin'}]`, (string | number)[]> | Record<`parameters.${string}[def]`, boolean | 'true' | 'false'>>;
|
14101
14211
|
declare class CanvasClient extends ApiClient<CanvasClientOptions> {
|
14102
14212
|
private edgeApiHost;
|
14103
14213
|
private edgeApiRequestInit?;
|
14104
14214
|
constructor(options: CanvasClientOptions);
|
14105
14215
|
/** Fetches lists of Canvas compositions, optionally by type */
|
14106
|
-
getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> &
|
14216
|
+
getCompositionList(params?: Omit<CompositionGetParameters, 'projectId' | 'componentId' | 'compositionId' | 'slug'> & {
|
14217
|
+
/** @deprecated do not use */
|
14218
|
+
filters?: CompositionFilters;
|
14219
|
+
} & ({
|
14107
14220
|
resolveData: true;
|
14108
14221
|
diagnostics?: boolean;
|
14109
14222
|
} | {
|
@@ -14157,7 +14270,6 @@ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
|
|
14157
14270
|
canBeComposition?: boolean | undefined;
|
14158
14271
|
parameters?: {
|
14159
14272
|
id: string;
|
14160
|
-
/** Fetches a component definition's composition defaults */
|
14161
14273
|
name: string;
|
14162
14274
|
helpText?: string | undefined;
|
14163
14275
|
type: string;
|
@@ -16170,6 +16282,8 @@ type AddComponentMessage = {
|
|
16170
16282
|
parentId: string;
|
16171
16283
|
slotName: string;
|
16172
16284
|
index: number;
|
16285
|
+
componentId?: string;
|
16286
|
+
isPattern?: boolean;
|
16173
16287
|
};
|
16174
16288
|
type MoveComponentMessage = {
|
16175
16289
|
type: 'move-component';
|
@@ -16231,7 +16345,24 @@ type ReportRenderedCompositionsMessage = {
|
|
16231
16345
|
type EditorStateUpdatedMessage = {
|
16232
16346
|
type: 'editor-state-updated';
|
16233
16347
|
};
|
16234
|
-
type
|
16348
|
+
type RequestComponentSuggestionMessage = {
|
16349
|
+
type: 'request-component-suggestion';
|
16350
|
+
parentId: string;
|
16351
|
+
slotName: string;
|
16352
|
+
index?: number;
|
16353
|
+
};
|
16354
|
+
type SuggestComponentMessage = {
|
16355
|
+
type: 'suggest-component';
|
16356
|
+
parentId: string;
|
16357
|
+
slotName: string;
|
16358
|
+
suggestion: {
|
16359
|
+
id: string;
|
16360
|
+
name: string;
|
16361
|
+
isPattern: boolean;
|
16362
|
+
} | undefined;
|
16363
|
+
hasMoreOptions?: boolean;
|
16364
|
+
};
|
16365
|
+
type ChannelMessage = SelectComponentMessage | ReadyMessage | UpdateCompositionMessage | UpdateCompositionInternalMessage | TriggerComponentActionMessage | AddComponentMessage | MoveComponentMessage | TriggerCompositionActionMessage | UpdatePreviewSettingsMessage | UpdateFeatureFlagsMessage | ReportRenderedCompositionsMessage | UpdateComponentParameterMessage | UpdateContextualEditingStateInternalMessage | SelectParameterMessage | DismissPlaceholderMessage | UpdateComponentReferencesMessage | OpenParameterEditorMessage | RequestComponentSuggestionMessage | SuggestComponentMessage | EditorStateUpdatedMessage;
|
16235
16366
|
declare const isSelectComponentMessage: (message: ChannelMessage) => message is SelectComponentMessage;
|
16236
16367
|
declare const isReadyMessage: (message: ChannelMessage) => message is ReadyMessage;
|
16237
16368
|
declare const isComponentActionMessage: (message: ChannelMessage) => message is TriggerComponentActionMessage;
|
@@ -16249,6 +16380,8 @@ declare const isReportRenderedCompositionsMessage: (message: ChannelMessage) =>
|
|
16249
16380
|
declare const isSelectParameterMessage: (message: ChannelMessage) => message is SelectParameterMessage;
|
16250
16381
|
declare const isOpenParameterEditorMessage: (message: ChannelMessage) => message is OpenParameterEditorMessage;
|
16251
16382
|
declare const isUpdateComponentReferencesMessage: (message: ChannelMessage) => message is UpdateComponentReferencesMessage;
|
16383
|
+
declare const isRequestComponentSuggestionMessage: (message: ChannelMessage) => message is RequestComponentSuggestionMessage;
|
16384
|
+
declare const isSuggestComponentMessage: (message: ChannelMessage) => message is SuggestComponentMessage;
|
16252
16385
|
type MessageHandler = (message: ChannelMessage, originalEvent: MessageEvent) => void;
|
16253
16386
|
type Channel = {
|
16254
16387
|
on: (types: ChannelMessage['type'][] | ChannelMessage['type'], handler: MessageHandler) => () => void;
|
@@ -16269,6 +16402,8 @@ type Channel = {
|
|
16269
16402
|
updateFeatureFlags: (options: Omit<UpdateFeatureFlagsMessage, 'type'>) => void;
|
16270
16403
|
updateContextualEditingStateInternal: (options: Omit<UpdateContextualEditingStateInternalMessage, 'type'>) => void;
|
16271
16404
|
reportRenderedCompositions: (options: Omit<ReportRenderedCompositionsMessage, 'type'>) => void;
|
16405
|
+
requestComponentSuggestion: (options: Omit<RequestComponentSuggestionMessage, 'type'>) => void;
|
16406
|
+
suggestComponent: (options: Omit<SuggestComponentMessage, 'type'>) => void;
|
16272
16407
|
updateComponentReferences: (options: Omit<UpdateComponentReferencesMessage, 'type'>) => void;
|
16273
16408
|
editorStateUpdated: () => void;
|
16274
16409
|
};
|
@@ -17044,4 +17179,4 @@ declare function parseVariableExpression(serialized: string, onToken?: (token: s
|
|
17044
17179
|
|
17045
17180
|
declare const CanvasClientError: typeof ApiClientError;
|
17046
17181
|
|
17047
|
-
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextualEditingComponentReference, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryList, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, type PreviewEventBus, type PreviewPanelSettings, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type SubscribeToCompositionOptions, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
|
17182
|
+
export { ASSETS_SOURCE_CUSTOM_URL, ASSETS_SOURCE_UNIFORM, ASSET_PARAMETER_TYPE, ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, type AddComponentMessage, type AssetParamValue, type AssetParamValueItem, type BatchEnhancer, BatchEntry, type BatchInvalidationPayload, type BindVariablesOptions, type BindVariablesResult, type BindVariablesToObjectOptions, type BlockLocationReference, type BlockValue, CANVAS_BLOCK_PARAM_TYPE, CANVAS_DRAFT_STATE, CANVAS_EDITOR_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_SLOT_SECTION_SLOT, CANVAS_SLOT_SECTION_TYPE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, type CanvasDefinitions, type CategoriesDeleteParameters, type CategoriesGetParameters, type CategoriesGetResponse, type CategoriesPutParameters, type Category, CategoryClient, type Channel, type ChannelMessage, type ChannelSubscription, ChildEnhancerBuilder, type ComponentDefinition, type ComponentDefinitionDeleteParameters, type ComponentDefinitionGetParameters, type ComponentDefinitionGetResponse, type ComponentDefinitionParameter, type ComponentDefinitionPermission, type ComponentDefinitionPutParameters, type ComponentDefinitionSlot, type ComponentDefinitionSlugSettings, type ComponentDefinitionVariant, type ComponentEnhancer, type ComponentEnhancerFunction, type ComponentEnhancerOptions, type ComponentInstance, type ComponentInstanceContextualEditing, type ComponentInstanceHistoryEntry, type ComponentInstanceHistoryGetParameters, type ComponentInstanceHistoryGetResponse, type ComponentLocationReference, type ComponentLocationReferenceV2, type ComponentOverridability, type ComponentOverride, type ComponentOverrides, type ComponentParameter, type ComponentParameterBlock, type ComponentParameterContextualEditing, type ComponentParameterEnhancer, type ComponentParameterEnhancerFunction, type ComponentParameterEnhancerOptions, type CompositionDataDiagnostic, type CompositionDeleteParameters, type CompositionDiagnostics, type CompositionFilters, type CompositionGetByComponentIdParameters, type CompositionGetByIdParameters, type CompositionGetByNodeIdParameters, type CompositionGetByNodePathParameters, type CompositionGetBySlugParameters, type CompositionGetListResponse, type CompositionGetOrderBy, type CompositionGetParameters, type CompositionGetResponse, type CompositionGetValidResponses, type CompositionIssue, type CompositionPatternIssue, type CompositionPutParameters, type CompositionResolvedGetResponse, type CompositionResolvedListResponse, type CompositionUIStatus, ContentClient, type ContentType, type ContentTypeField, type ContextualEditingComponentReference, type DataDiagnostic, type DataElementBindingIssue, type DataElementConnectionDefinition, type DataResolutionConfigIssue, type DataResolutionIssue, type DataResolutionOption, type DataResolutionOptionNegative, type DataResolutionOptionPositive, type DataResolutionParameters, type DataResourceDefinition, type DataResourceDefinitions, type DataResourceIssue, type DataResourceVariables, type DataSource, DataSourceClient, type DataSourceDeleteParameters, type DataSourceGetParameters, type DataSourceGetResponse, type DataSourcePutParameters, type DataSourcesGetParameters, type DataSourcesGetResponse, type DataType, DataTypeClient, type DataTypeDeleteParameters, type DataTypeGetParameters, type DataTypeGetResponse, type DataTypePutParameters, type DataVariableDefinition, type DataWithProperties, type DeleteContentTypeOptions, type DeleteEntryOptions, type DismissPlaceholderMessage, type DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_MAX_CACHE_TTL, EDGE_MIN_CACHE_TTL, EMPTY_COMPOSITION, type EdgehancersDiagnostics, type EdgehancersWholeResponseCacheDiagnostics, type EditorStateUpdatedMessage, EnhancerBuilder, type EnhancerContext, type EnhancerError, type EntriesGetParameters, type EntriesGetResponse, type EntriesHistoryGetParameters, type EntriesHistoryGetResponse, type EntriesResolvedListResponse, type Entry, type EntryData, type EntryList, type EventNames, type Filters, type FindInNodeTreeReference, type FlattenProperty, type FlattenValues, type FlattenValuesOptions, type GetContentTypesOptions, type GetContentTypesResponse, type GetEntriesOptions, type GetEntriesResponse, type GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, type InvalidationPayload, LOCALE_DYNAMIC_INPUT_NAME, type LimitPolicy, type LinkComponentParameterValue, type LinkParamConfiguration, type LinkParamValue, type LinkParameterType, type LinkTypeConfiguration, type Locale, LocaleClient, type LocaleDeleteParameters, type LocalePutParameters, type LocalesGetParameters, type LocalesGetResponse, type LocalizeDeprecatedOptions, type LocalizeModernOptions, type MessageHandler, type MoveComponentMessage, type NodeLocationReference, type NonProjectMapLinkParamValue, type OpenParameterEditorMessage, type OverrideOptions, PLACEHOLDER_ID, type PatternIssue, type PreviewEventBus, type PreviewPanelSettings, type ProjectMapLinkComponentParameterValue, type ProjectMapLinkParamValue, type Prompt, PromptClient, type PromptsDeleteParameters, type PromptsGetParameters, type PromptsGetResponse, type PromptsPutParameters, type PutContentTypeBody, type PutEntryBody, type ReadyMessage, RelationshipClient, type RelationshipResultInstance, type Release, ReleaseClient, type ReleaseContent, ReleaseContentsClient, type ReleaseContentsDeleteBody, type ReleaseContentsGetParameters, type ReleaseContentsGetResponse, type ReleaseDeleteParameters, type ReleasePatchParameters, type ReleasePutParameters, type ReleaseState, type ReleasesGetParameters, type ReleasesGetResponse, type ReportRenderedCompositionsMessage, type RequestComponentSuggestionMessage, type ResolvedRouteGetResponse, type RichTextBuiltInElement, type RichTextBuiltInFormat, type RichTextParamConfiguration, type RichTextParamValue, type RootComponentInstance, type RootEntryReference, type RootLocationReference, RouteClient, type RouteDynamicInputs, type RouteGetParameters, type RouteGetResponse, type RouteGetResponseComposition, type RouteGetResponseEdgehancedComposition, type RouteGetResponseNotFound, type RouteGetResponseRedirect, SECRET_QUERY_STRING_PARAM, type SelectComponentMessage, type SelectParameterMessage, type SpecificProjectMap, type SubscribeToCompositionOptions, type SuggestComponentMessage, type TreeNodeInfoTypes, type TriggerComponentActionMessage, type TriggerCompositionActionMessage, UncachedCanvasClient, UncachedCategoryClient, UncachedContentClient, UniqueBatchEntries, type UnsubscribeCallback, type UpdateComponentParameterMessage, type UpdateComponentReferencesMessage, type UpdateCompositionInternalMessage, type UpdateCompositionMessage, type UpdateContextualEditingStateInternalMessage, type UpdateFeatureFlagsMessage, type UpdatePreviewSettingsMessage, type WalkComponentTreeActions, type WalkNodeTreeActions, type WalkNodeTreeOptions, bindVariables, bindVariablesToObject, compose, convertEntryToPutEntry, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, createVariableReference, enhance, extractLocales, findParameterInNodeTree, flattenValues, generateComponentPlaceholderId, generateHash, getBlockValue, getChannelName, getComponentJsonPointer, getComponentPath, getNounForLocation, getNounForNode, getParameterAttributes, getPropertiesValue, getPropertyValue, isAddComponentMessage, isAllowedReferrer, isAssetParamValue, isAssetParamValueItem, isComponentActionMessage, isComponentPlaceholderId, isDismissPlaceholderMessage, isEntryData, isMovingComponentMessage, isNestedNodeType, isOpenParameterEditorMessage, isReadyMessage, isReportRenderedCompositionsMessage, isRequestComponentSuggestionMessage, isRootEntryReference, isSelectComponentMessage, isSelectParameterMessage, isSuggestComponentMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateComponentReferencesMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdateFeatureFlagsMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, parseComponentPlaceholderId, parseVariableExpression, subscribeToComposition, walkComponentTree, walkNodeTree };
|
package/dist/index.esm.js
CHANGED
@@ -481,15 +481,22 @@ var CanvasClient = class extends ApiClient {
|
|
481
481
|
/** Fetches lists of Canvas compositions, optionally by type */
|
482
482
|
async getCompositionList(params = {}) {
|
483
483
|
const { projectId } = this.options;
|
484
|
-
const { resolveData, ...originParams } = params;
|
484
|
+
const { resolveData, filters, ...originParams } = params;
|
485
|
+
const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
|
486
|
+
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
487
|
+
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
488
|
+
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
489
|
+
return { ...acc, [lhs]: rhs };
|
490
|
+
}, {});
|
485
491
|
if (!resolveData) {
|
486
|
-
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
|
492
|
+
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
487
493
|
return this.apiClient(fetchUri);
|
488
494
|
}
|
489
495
|
const edgeParams = {
|
490
496
|
...originParams,
|
491
497
|
projectId,
|
492
|
-
...params.diagnostics ? { diagnostics: "true" } : {}
|
498
|
+
...params.diagnostics ? { diagnostics: "true" } : {},
|
499
|
+
...rewrittenFilters
|
493
500
|
};
|
494
501
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
495
502
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
@@ -1917,6 +1924,12 @@ var isOpenParameterEditorMessage = (message) => {
|
|
1917
1924
|
var isUpdateComponentReferencesMessage = (message) => {
|
1918
1925
|
return message.type === "update-component-references";
|
1919
1926
|
};
|
1927
|
+
var isRequestComponentSuggestionMessage = (message) => {
|
1928
|
+
return message.type === "request-component-suggestion";
|
1929
|
+
};
|
1930
|
+
var isSuggestComponentMessage = (message) => {
|
1931
|
+
return message.type === "suggest-component";
|
1932
|
+
};
|
1920
1933
|
var createCanvasChannel = ({
|
1921
1934
|
listenTo,
|
1922
1935
|
broadcastTo
|
@@ -2068,6 +2081,20 @@ var createCanvasChannel = ({
|
|
2068
2081
|
};
|
2069
2082
|
postMessage(message);
|
2070
2083
|
};
|
2084
|
+
const requestComponentSuggestion = (options) => {
|
2085
|
+
const message = {
|
2086
|
+
...options,
|
2087
|
+
type: "request-component-suggestion"
|
2088
|
+
};
|
2089
|
+
postMessage(message);
|
2090
|
+
};
|
2091
|
+
const suggestComponent = (options) => {
|
2092
|
+
const message = {
|
2093
|
+
...options,
|
2094
|
+
type: "suggest-component"
|
2095
|
+
};
|
2096
|
+
postMessage(message);
|
2097
|
+
};
|
2071
2098
|
const updateFeatureFlags = (options) => {
|
2072
2099
|
const message = {
|
2073
2100
|
...options,
|
@@ -2121,7 +2148,9 @@ var createCanvasChannel = ({
|
|
2121
2148
|
openParameterEditor,
|
2122
2149
|
reportRenderedCompositions,
|
2123
2150
|
editorStateUpdated,
|
2124
|
-
updateComponentReferences
|
2151
|
+
updateComponentReferences,
|
2152
|
+
requestComponentSuggestion,
|
2153
|
+
suggestComponent
|
2125
2154
|
};
|
2126
2155
|
};
|
2127
2156
|
|
@@ -2830,9 +2859,11 @@ export {
|
|
2830
2859
|
isOpenParameterEditorMessage,
|
2831
2860
|
isReadyMessage,
|
2832
2861
|
isReportRenderedCompositionsMessage,
|
2862
|
+
isRequestComponentSuggestionMessage,
|
2833
2863
|
isRootEntryReference,
|
2834
2864
|
isSelectComponentMessage,
|
2835
2865
|
isSelectParameterMessage,
|
2866
|
+
isSuggestComponentMessage,
|
2836
2867
|
isSystemComponentDefinition,
|
2837
2868
|
isTriggerCompositionActionMessage,
|
2838
2869
|
isUpdateComponentParameterMessage,
|
package/dist/index.js
CHANGED
@@ -377,9 +377,11 @@ __export(src_exports, {
|
|
377
377
|
isOpenParameterEditorMessage: () => isOpenParameterEditorMessage,
|
378
378
|
isReadyMessage: () => isReadyMessage,
|
379
379
|
isReportRenderedCompositionsMessage: () => isReportRenderedCompositionsMessage,
|
380
|
+
isRequestComponentSuggestionMessage: () => isRequestComponentSuggestionMessage,
|
380
381
|
isRootEntryReference: () => isRootEntryReference,
|
381
382
|
isSelectComponentMessage: () => isSelectComponentMessage,
|
382
383
|
isSelectParameterMessage: () => isSelectParameterMessage,
|
384
|
+
isSuggestComponentMessage: () => isSuggestComponentMessage,
|
383
385
|
isSystemComponentDefinition: () => isSystemComponentDefinition,
|
384
386
|
isTriggerCompositionActionMessage: () => isTriggerCompositionActionMessage,
|
385
387
|
isUpdateComponentParameterMessage: () => isUpdateComponentParameterMessage,
|
@@ -614,15 +616,22 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
614
616
|
/** Fetches lists of Canvas compositions, optionally by type */
|
615
617
|
async getCompositionList(params = {}) {
|
616
618
|
const { projectId } = this.options;
|
617
|
-
const { resolveData, ...originParams } = params;
|
619
|
+
const { resolveData, filters, ...originParams } = params;
|
620
|
+
const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
|
621
|
+
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
622
|
+
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
623
|
+
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
624
|
+
return { ...acc, [lhs]: rhs };
|
625
|
+
}, {});
|
618
626
|
if (!resolveData) {
|
619
|
-
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
|
627
|
+
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
620
628
|
return this.apiClient(fetchUri);
|
621
629
|
}
|
622
630
|
const edgeParams = {
|
623
631
|
...originParams,
|
624
632
|
projectId,
|
625
|
-
...params.diagnostics ? { diagnostics: "true" } : {}
|
633
|
+
...params.diagnostics ? { diagnostics: "true" } : {},
|
634
|
+
...rewrittenFilters
|
626
635
|
};
|
627
636
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
628
637
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
@@ -2050,6 +2059,12 @@ var isOpenParameterEditorMessage = (message) => {
|
|
2050
2059
|
var isUpdateComponentReferencesMessage = (message) => {
|
2051
2060
|
return message.type === "update-component-references";
|
2052
2061
|
};
|
2062
|
+
var isRequestComponentSuggestionMessage = (message) => {
|
2063
|
+
return message.type === "request-component-suggestion";
|
2064
|
+
};
|
2065
|
+
var isSuggestComponentMessage = (message) => {
|
2066
|
+
return message.type === "suggest-component";
|
2067
|
+
};
|
2053
2068
|
var createCanvasChannel = ({
|
2054
2069
|
listenTo,
|
2055
2070
|
broadcastTo
|
@@ -2201,6 +2216,20 @@ var createCanvasChannel = ({
|
|
2201
2216
|
};
|
2202
2217
|
postMessage(message);
|
2203
2218
|
};
|
2219
|
+
const requestComponentSuggestion = (options) => {
|
2220
|
+
const message = {
|
2221
|
+
...options,
|
2222
|
+
type: "request-component-suggestion"
|
2223
|
+
};
|
2224
|
+
postMessage(message);
|
2225
|
+
};
|
2226
|
+
const suggestComponent = (options) => {
|
2227
|
+
const message = {
|
2228
|
+
...options,
|
2229
|
+
type: "suggest-component"
|
2230
|
+
};
|
2231
|
+
postMessage(message);
|
2232
|
+
};
|
2204
2233
|
const updateFeatureFlags = (options) => {
|
2205
2234
|
const message = {
|
2206
2235
|
...options,
|
@@ -2254,7 +2283,9 @@ var createCanvasChannel = ({
|
|
2254
2283
|
openParameterEditor,
|
2255
2284
|
reportRenderedCompositions,
|
2256
2285
|
editorStateUpdated,
|
2257
|
-
updateComponentReferences
|
2286
|
+
updateComponentReferences,
|
2287
|
+
requestComponentSuggestion,
|
2288
|
+
suggestComponent
|
2258
2289
|
};
|
2259
2290
|
};
|
2260
2291
|
|
@@ -2964,9 +2995,11 @@ var CanvasClientError = import_api13.ApiClientError;
|
|
2964
2995
|
isOpenParameterEditorMessage,
|
2965
2996
|
isReadyMessage,
|
2966
2997
|
isReportRenderedCompositionsMessage,
|
2998
|
+
isRequestComponentSuggestionMessage,
|
2967
2999
|
isRootEntryReference,
|
2968
3000
|
isSelectComponentMessage,
|
2969
3001
|
isSelectParameterMessage,
|
3002
|
+
isSuggestComponentMessage,
|
2970
3003
|
isSystemComponentDefinition,
|
2971
3004
|
isTriggerCompositionActionMessage,
|
2972
3005
|
isUpdateComponentParameterMessage,
|
package/dist/index.mjs
CHANGED
@@ -481,15 +481,22 @@ var CanvasClient = class extends ApiClient {
|
|
481
481
|
/** Fetches lists of Canvas compositions, optionally by type */
|
482
482
|
async getCompositionList(params = {}) {
|
483
483
|
const { projectId } = this.options;
|
484
|
-
const { resolveData, ...originParams } = params;
|
484
|
+
const { resolveData, filters, ...originParams } = params;
|
485
|
+
const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
|
486
|
+
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
487
|
+
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
488
|
+
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
489
|
+
return { ...acc, [lhs]: rhs };
|
490
|
+
}, {});
|
485
491
|
if (!resolveData) {
|
486
|
-
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId });
|
492
|
+
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
487
493
|
return this.apiClient(fetchUri);
|
488
494
|
}
|
489
495
|
const edgeParams = {
|
490
496
|
...originParams,
|
491
497
|
projectId,
|
492
|
-
...params.diagnostics ? { diagnostics: "true" } : {}
|
498
|
+
...params.diagnostics ? { diagnostics: "true" } : {},
|
499
|
+
...rewrittenFilters
|
493
500
|
};
|
494
501
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
495
502
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
@@ -1917,6 +1924,12 @@ var isOpenParameterEditorMessage = (message) => {
|
|
1917
1924
|
var isUpdateComponentReferencesMessage = (message) => {
|
1918
1925
|
return message.type === "update-component-references";
|
1919
1926
|
};
|
1927
|
+
var isRequestComponentSuggestionMessage = (message) => {
|
1928
|
+
return message.type === "request-component-suggestion";
|
1929
|
+
};
|
1930
|
+
var isSuggestComponentMessage = (message) => {
|
1931
|
+
return message.type === "suggest-component";
|
1932
|
+
};
|
1920
1933
|
var createCanvasChannel = ({
|
1921
1934
|
listenTo,
|
1922
1935
|
broadcastTo
|
@@ -2068,6 +2081,20 @@ var createCanvasChannel = ({
|
|
2068
2081
|
};
|
2069
2082
|
postMessage(message);
|
2070
2083
|
};
|
2084
|
+
const requestComponentSuggestion = (options) => {
|
2085
|
+
const message = {
|
2086
|
+
...options,
|
2087
|
+
type: "request-component-suggestion"
|
2088
|
+
};
|
2089
|
+
postMessage(message);
|
2090
|
+
};
|
2091
|
+
const suggestComponent = (options) => {
|
2092
|
+
const message = {
|
2093
|
+
...options,
|
2094
|
+
type: "suggest-component"
|
2095
|
+
};
|
2096
|
+
postMessage(message);
|
2097
|
+
};
|
2071
2098
|
const updateFeatureFlags = (options) => {
|
2072
2099
|
const message = {
|
2073
2100
|
...options,
|
@@ -2121,7 +2148,9 @@ var createCanvasChannel = ({
|
|
2121
2148
|
openParameterEditor,
|
2122
2149
|
reportRenderedCompositions,
|
2123
2150
|
editorStateUpdated,
|
2124
|
-
updateComponentReferences
|
2151
|
+
updateComponentReferences,
|
2152
|
+
requestComponentSuggestion,
|
2153
|
+
suggestComponent
|
2125
2154
|
};
|
2126
2155
|
};
|
2127
2156
|
|
@@ -2830,9 +2859,11 @@ export {
|
|
2830
2859
|
isOpenParameterEditorMessage,
|
2831
2860
|
isReadyMessage,
|
2832
2861
|
isReportRenderedCompositionsMessage,
|
2862
|
+
isRequestComponentSuggestionMessage,
|
2833
2863
|
isRootEntryReference,
|
2834
2864
|
isSelectComponentMessage,
|
2835
2865
|
isSelectParameterMessage,
|
2866
|
+
isSuggestComponentMessage,
|
2836
2867
|
isSystemComponentDefinition,
|
2837
2868
|
isTriggerCompositionActionMessage,
|
2838
2869
|
isUpdateComponentParameterMessage,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.131.1-alpha.8+d326c2787d",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -38,8 +38,8 @@
|
|
38
38
|
"pusher-js": "8.2.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/assets": "19.
|
42
|
-
"@uniformdev/context": "19.
|
41
|
+
"@uniformdev/assets": "19.131.1-alpha.8+d326c2787d",
|
42
|
+
"@uniformdev/context": "19.131.1-alpha.8+d326c2787d",
|
43
43
|
"immer": "10.0.3"
|
44
44
|
},
|
45
45
|
"files": [
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"publishConfig": {
|
49
49
|
"access": "public"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "d326c2787d0b159fcd7edb45b165a8eae54862e6"
|
52
52
|
}
|