@uniformdev/mesh-sdk 19.173.0 → 19.173.2-alpha.210

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
2
2
  import { ProjectMapNode } from '@uniformdev/project-map';
3
- import { AssetParamValue, DataType, DataSource, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, Locale, DataVariableDefinition, EntryData } from '@uniformdev/canvas';
3
+ import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, Locale, DataVariableDefinition, EntryData } from '@uniformdev/canvas';
4
4
  export { AssetParamValue, AssetParamValueItem } from '@uniformdev/canvas';
5
5
  import { Emitter } from 'mitt';
6
6
 
@@ -67,6 +67,7 @@ interface paths$1 {
67
67
  renderableInPropertyPanel?: boolean;
68
68
  /** @enum {string} */
69
69
  localizable?: "default-yes" | "default-no" | "yes" | "no";
70
+ allowedPlacement?: ("parameter" | "field")[];
70
71
  }[];
71
72
  editorTools?: {
72
73
  composition?: {
@@ -90,6 +91,7 @@ interface paths$1 {
90
91
  type: string;
91
92
  displayName: string;
92
93
  dataSourceEditorUrl?: string;
94
+ supportsUnpublishedData?: boolean;
93
95
  dataSourceEditorLocations?: {
94
96
  [key: string]: {
95
97
  url: string;
@@ -110,6 +112,7 @@ interface paths$1 {
110
112
  url: string;
111
113
  };
112
114
  };
115
+ contextualEditing?: string;
113
116
  };
114
117
  };
115
118
  badgeIconUrl?: string;
@@ -117,6 +120,11 @@ interface paths$1 {
117
120
  assetLibrary?: {
118
121
  assetLibraryUrl: string;
119
122
  assetParameterUrl: string;
123
+ assetLibraryLocations?: {
124
+ [key: string]: {
125
+ url: string;
126
+ };
127
+ };
120
128
  unstable_dynamicAssets?: {
121
129
  dataConnectorId: string;
122
130
  assetsListArchetypeId: string;
@@ -236,6 +244,7 @@ interface paths$1 {
236
244
  renderableInPropertyPanel?: boolean;
237
245
  /** @enum {string} */
238
246
  localizable?: "default-yes" | "default-no" | "yes" | "no";
247
+ allowedPlacement?: ("parameter" | "field")[];
239
248
  }[];
240
249
  editorTools?: {
241
250
  composition?: {
@@ -259,6 +268,7 @@ interface paths$1 {
259
268
  type: string;
260
269
  displayName: string;
261
270
  dataSourceEditorUrl?: string;
271
+ supportsUnpublishedData?: boolean;
262
272
  dataSourceEditorLocations?: {
263
273
  [key: string]: {
264
274
  url: string;
@@ -279,6 +289,7 @@ interface paths$1 {
279
289
  url: string;
280
290
  };
281
291
  };
292
+ contextualEditing?: string;
282
293
  };
283
294
  };
284
295
  badgeIconUrl?: string;
@@ -286,6 +297,11 @@ interface paths$1 {
286
297
  assetLibrary?: {
287
298
  assetLibraryUrl: string;
288
299
  assetParameterUrl: string;
300
+ assetLibraryLocations?: {
301
+ [key: string]: {
302
+ url: string;
303
+ };
304
+ };
289
305
  unstable_dynamicAssets?: {
290
306
  dataConnectorId: string;
291
307
  assetsListArchetypeId: string;
@@ -404,6 +420,7 @@ interface paths$1 {
404
420
  renderableInPropertyPanel?: boolean;
405
421
  /** @enum {string} */
406
422
  localizable?: "default-yes" | "default-no" | "yes" | "no";
423
+ allowedPlacement?: ("parameter" | "field")[];
407
424
  }[];
408
425
  editorTools?: {
409
426
  composition?: {
@@ -427,6 +444,7 @@ interface paths$1 {
427
444
  type: string;
428
445
  displayName: string;
429
446
  dataSourceEditorUrl?: string;
447
+ supportsUnpublishedData?: boolean;
430
448
  dataSourceEditorLocations?: {
431
449
  [key: string]: {
432
450
  url: string;
@@ -447,6 +465,7 @@ interface paths$1 {
447
465
  url: string;
448
466
  };
449
467
  };
468
+ contextualEditing?: string;
450
469
  };
451
470
  };
452
471
  badgeIconUrl?: string;
@@ -454,6 +473,11 @@ interface paths$1 {
454
473
  assetLibrary?: {
455
474
  assetLibraryUrl: string;
456
475
  assetParameterUrl: string;
476
+ assetLibraryLocations?: {
477
+ [key: string]: {
478
+ url: string;
479
+ };
480
+ };
457
481
  unstable_dynamicAssets?: {
458
482
  dataConnectorId: string;
459
483
  assetsListArchetypeId: string;
@@ -782,111 +806,119 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
782
806
  upsert(body: Omit<IntegrationDefinitionPutParameters, 'teamId'>): Promise<{
783
807
  type: string;
784
808
  displayName: string;
785
- logoIconUrl?: string | undefined;
786
- badgeIconUrl?: string | undefined;
787
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown" | undefined;
788
- public?: boolean | undefined;
789
- scopes?: string[] | undefined;
790
- baseLocationUrl?: string | undefined;
809
+ logoIconUrl?: string;
810
+ badgeIconUrl?: string;
811
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
812
+ public?: boolean;
813
+ scopes?: string[];
814
+ baseLocationUrl?: string;
791
815
  locations: {
792
816
  install?: {
793
- description?: string[] | undefined;
794
- informationUrl?: string | undefined;
795
- canvasPackageUrl?: string | undefined;
796
- } | undefined;
817
+ description?: string[];
818
+ informationUrl?: string;
819
+ canvasPackageUrl?: string;
820
+ };
797
821
  settings?: {
798
822
  url: string;
799
823
  locations?: {
800
824
  [key: string]: {
801
825
  url: string;
802
826
  };
803
- } | undefined;
804
- } | undefined;
827
+ };
828
+ };
805
829
  canvas?: {
806
830
  parameterTypes: {
807
831
  type: string;
808
832
  displayName: string;
809
- configureUrl?: string | undefined;
833
+ configureUrl?: string;
810
834
  editorUrl: string;
811
835
  configurationLocations?: {
812
836
  [key: string]: {
813
837
  url: string;
814
838
  };
815
- } | undefined;
839
+ };
816
840
  editorLocations?: {
817
841
  [key: string]: {
818
842
  url: string;
819
843
  };
820
- } | undefined;
821
- renderableInPropertyPanel?: boolean | undefined;
822
- localizable?: "default-yes" | "default-no" | "yes" | "no" | undefined;
844
+ };
845
+ renderableInPropertyPanel?: boolean;
846
+ localizable?: "default-yes" | "default-no" | "yes" | "no";
847
+ allowedPlacement?: ("parameter" | "field")[];
823
848
  }[];
824
849
  editorTools?: {
825
850
  composition?: {
826
851
  url: string;
827
- } | undefined;
852
+ };
828
853
  componentPattern?: {
829
854
  url: string;
830
- } | undefined;
855
+ };
831
856
  compositionDefaults?: {
832
857
  url: string;
833
- } | undefined;
858
+ };
834
859
  entry?: {
835
860
  url: string;
836
- } | undefined;
861
+ };
837
862
  entryPattern?: {
838
863
  url: string;
839
- } | undefined;
840
- } | undefined;
841
- } | undefined;
864
+ };
865
+ };
866
+ };
842
867
  dataConnectors?: {
843
868
  type: string;
844
869
  displayName: string;
845
- dataSourceEditorUrl?: string | undefined;
870
+ dataSourceEditorUrl?: string;
871
+ supportsUnpublishedData?: boolean;
846
872
  dataSourceEditorLocations?: {
847
873
  [key: string]: {
848
874
  url: string;
849
875
  };
850
- } | undefined;
876
+ };
851
877
  dataArchetypes?: {
852
878
  [key: string]: {
853
879
  displayName: string;
854
- typeEditorUrl?: string | undefined;
880
+ typeEditorUrl?: string;
855
881
  typeEditorLocations?: {
856
882
  [key: string]: {
857
883
  url: string;
858
884
  };
859
- } | undefined;
860
- dataEditorUrl?: string | undefined;
885
+ };
886
+ dataEditorUrl?: string;
861
887
  dataEditorUrlLocations?: {
862
888
  [key: string]: {
863
889
  url: string;
864
890
  };
865
- } | undefined;
891
+ };
892
+ contextualEditing?: string;
866
893
  };
867
- } | undefined;
868
- badgeIconUrl?: string | undefined;
869
- }[] | undefined;
894
+ };
895
+ badgeIconUrl?: string;
896
+ }[];
870
897
  assetLibrary?: {
871
898
  assetLibraryUrl: string;
872
899
  assetParameterUrl: string;
900
+ assetLibraryLocations?: {
901
+ [key: string]: {
902
+ url: string;
903
+ };
904
+ };
873
905
  unstable_dynamicAssets?: {
874
906
  dataConnectorId: string;
875
907
  assetsListArchetypeId: string;
876
908
  singleAssetArchetypeId: string;
877
- } | undefined;
878
- } | undefined;
909
+ };
910
+ };
879
911
  unstable_assetLibrary?: {
880
912
  url: string;
881
913
  dynamicAssets?: {
882
914
  dataConnectorId: string;
883
915
  assetsListArchetypeId: string;
884
916
  singleAssetArchetypeId: string;
885
- } | undefined;
886
- } | undefined;
917
+ };
918
+ };
887
919
  ai?: {
888
920
  generateUrl: string;
889
- metadataUrl?: string | undefined;
921
+ metadataUrl?: string;
890
922
  prompts?: {
891
923
  id: string;
892
924
  name: string;
@@ -895,20 +927,20 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
895
927
  arguments?: {
896
928
  [key: string]: {
897
929
  type: string;
898
- displayName?: string | null | undefined;
899
- helpText?: string | null | undefined;
900
- default?: string | null | undefined;
930
+ displayName?: string | null;
931
+ helpText?: string | null;
932
+ default?: string | null;
901
933
  };
902
- } | null | undefined;
903
- metadata?: unknown;
904
- } | null | undefined;
934
+ } | null;
935
+ metadata?: unknown | null;
936
+ } | null;
905
937
  parameterTypes: string[];
906
- }[] | undefined;
907
- } | undefined;
938
+ }[];
939
+ };
908
940
  unstable_ai?: {
909
941
  generateUrl: string;
910
- metadataUrl?: string | undefined;
911
- } | undefined;
942
+ metadataUrl?: string;
943
+ };
912
944
  };
913
945
  unstable_prompts?: {
914
946
  id: string;
@@ -918,15 +950,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
918
950
  arguments?: {
919
951
  [key: string]: {
920
952
  type: string;
921
- displayName?: string | null | undefined;
922
- helpText?: string | null | undefined;
923
- default?: string | null | undefined;
953
+ displayName?: string | null;
954
+ helpText?: string | null;
955
+ default?: string | null;
924
956
  };
925
- } | null | undefined;
926
- metadata?: unknown;
927
- } | null | undefined;
957
+ } | null;
958
+ metadata?: unknown | null;
959
+ } | null;
928
960
  parameterTypes: string[];
929
- }[] | undefined;
961
+ }[];
930
962
  }>;
931
963
  /** Deletes a mesh app from a team */
932
964
  remove(body: Omit<IntegrationDefinitionDeleteParameters, 'teamId'>): Promise<void>;
@@ -996,11 +1028,19 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
996
1028
  dataConnector: DataConnectorInfo;
997
1029
  /** Current dynamic inputs that are configured on the composition (if any). */
998
1030
  dynamicInputs: DynamicInputs;
1031
+ /** Which Data Source variant is being resolved and used for getDataResource (unless overriden explicitly) */
1032
+ dataSourceVariant?: DataSourceVariantsKeys;
999
1033
  }, TIntegrationConfiguration>;
1000
1034
  type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
1001
1035
 
1002
- type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables'>;
1003
- type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
1036
+ type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
1037
+ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1038
+ /**
1039
+ * If true, the data source should provide additional configuration to support the unpublished mode and save "unpublish" Data Source variant.
1040
+ * E.g. inputs for Preview API Token + Preview Environment.
1041
+ */
1042
+ enableUnpublishedMode: DataSourceLocationValue['enableUnpublishedMode'];
1043
+ }, TIntegrationConfiguration>;
1004
1044
  type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
1005
1045
 
1006
1046
  type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
@@ -1030,6 +1070,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1030
1070
  * Note that setValue() always sets the target language automatically.
1031
1071
  */
1032
1072
  targetLocale: string | undefined;
1073
+ /**
1074
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1075
+ * If this is -1, then the editor is not editing a conditional value.
1076
+ */
1077
+ targetConditionIndex: number;
1033
1078
  }, TIntegrationConfiguration>;
1034
1079
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
1035
1080
  /**
@@ -1048,7 +1093,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
1048
1093
  * Defines methods used for interacting with a Mesh location
1049
1094
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1050
1095
  */
1051
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1096
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | ContextualEditingLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1052
1097
  interface MeshContextData {
1053
1098
  locationKey: string;
1054
1099
  locationType: MeshLocationTypes;
@@ -1160,7 +1205,13 @@ type CloseDialogMessage = {
1160
1205
  dialogType: DialogType;
1161
1206
  dialogData?: unknown;
1162
1207
  };
1163
- type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'>;
1208
+ type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'> & {
1209
+ /**
1210
+ * Ability to override Data Source variant for particular getDataResource request,
1211
+ * because by default it will use Canvas Editor global. But sometimes you don't want to switch to Unpublished Data and stick to standard one.
1212
+ */
1213
+ dataSourceVariant?: DataSourceVariantsKeys | 'standard';
1214
+ };
1164
1215
  /** Primitive data types that a parameter type accepts to be bound to composition data */
1165
1216
  type BindableTypes = 'string' | 'number' | 'boolean' | 'object' | 'array';
1166
1217
  /** Message to parent to create a data connection expression to insert in a param type */
@@ -1209,9 +1260,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1209
1260
  * Imports the iframe communications library and provides an interface for interacting with
1210
1261
  * the parent window via said communications library.
1211
1262
  */
1212
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1263
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1213
1264
  dialogResponseHandlers: DialogResponseHandlers;
1214
1265
  onMetadataUpdated: (metadata: unknown) => void;
1266
+ onValueExternallyUpdated: (value: unknown) => void;
1215
1267
  }): Promise<{
1216
1268
  initData: MeshContextData;
1217
1269
  parent: {
@@ -1354,7 +1406,7 @@ type MeshLocationUserPermissions =
1354
1406
  /**
1355
1407
  * Known location types that can be passed to a mesh location
1356
1408
  */
1357
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'canvasEditorTools' | 'aiMetadata';
1409
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'contextualEditing' | 'canvasEditorTools' | 'aiMetadata';
1358
1410
  type SetValueOptions = ValidationResult;
1359
1411
  type SetValueMessage = {
1360
1412
  uniformMeshLocationValue: unknown;
@@ -1415,6 +1467,19 @@ type CanvasEditorToolsData = {
1415
1467
  });
1416
1468
  type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
1417
1469
 
1470
+ type ContextualEditingLocationValue = Record<string, string>;
1471
+ type ContextualEditingLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1472
+ resolvedData: any;
1473
+ dataType: DataType;
1474
+ /** The data type's archetype value. */
1475
+ archetype: string;
1476
+ /**
1477
+ * The current data resource's data source. NOTE: param and header values are not available in this context.
1478
+ */
1479
+ dataSource: DataSource;
1480
+ }, TIntegrationConfiguration>;
1481
+ type ContextualEditingLocation = MeshLocationCore<ContextualEditingLocationValue, ContextualEditingLocationMetadata, ContextualEditingLocationValue, 'contextualEditing'> & GetDataResourceLocation;
1482
+
1418
1483
  type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1419
1484
  /** The Uniform project ID */
1420
1485
  componentDefinition: ComponentDefinition;
@@ -1524,4 +1589,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
1524
1589
  */
1525
1590
  declare const hasRole: (role: string, user: UniformUser) => boolean;
1526
1591
 
1527
- export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type GetDataResourceLocation, type GetDataResourceMessage, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshSDKEventInterface, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, hasPermissions, hasRole, initializeUniformMeshSDK };
1592
+ export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type ContextualEditingLocation, type ContextualEditingLocationMetadata, type ContextualEditingLocationValue, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type GetDataResourceLocation, type GetDataResourceMessage, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshSDKEventInterface, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, hasPermissions, hasRole, initializeUniformMeshSDK };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
2
2
  import { ProjectMapNode } from '@uniformdev/project-map';
3
- import { AssetParamValue, DataType, DataSource, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, Locale, DataVariableDefinition, EntryData } from '@uniformdev/canvas';
3
+ import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, Locale, DataVariableDefinition, EntryData } from '@uniformdev/canvas';
4
4
  export { AssetParamValue, AssetParamValueItem } from '@uniformdev/canvas';
5
5
  import { Emitter } from 'mitt';
6
6
 
@@ -67,6 +67,7 @@ interface paths$1 {
67
67
  renderableInPropertyPanel?: boolean;
68
68
  /** @enum {string} */
69
69
  localizable?: "default-yes" | "default-no" | "yes" | "no";
70
+ allowedPlacement?: ("parameter" | "field")[];
70
71
  }[];
71
72
  editorTools?: {
72
73
  composition?: {
@@ -90,6 +91,7 @@ interface paths$1 {
90
91
  type: string;
91
92
  displayName: string;
92
93
  dataSourceEditorUrl?: string;
94
+ supportsUnpublishedData?: boolean;
93
95
  dataSourceEditorLocations?: {
94
96
  [key: string]: {
95
97
  url: string;
@@ -110,6 +112,7 @@ interface paths$1 {
110
112
  url: string;
111
113
  };
112
114
  };
115
+ contextualEditing?: string;
113
116
  };
114
117
  };
115
118
  badgeIconUrl?: string;
@@ -117,6 +120,11 @@ interface paths$1 {
117
120
  assetLibrary?: {
118
121
  assetLibraryUrl: string;
119
122
  assetParameterUrl: string;
123
+ assetLibraryLocations?: {
124
+ [key: string]: {
125
+ url: string;
126
+ };
127
+ };
120
128
  unstable_dynamicAssets?: {
121
129
  dataConnectorId: string;
122
130
  assetsListArchetypeId: string;
@@ -236,6 +244,7 @@ interface paths$1 {
236
244
  renderableInPropertyPanel?: boolean;
237
245
  /** @enum {string} */
238
246
  localizable?: "default-yes" | "default-no" | "yes" | "no";
247
+ allowedPlacement?: ("parameter" | "field")[];
239
248
  }[];
240
249
  editorTools?: {
241
250
  composition?: {
@@ -259,6 +268,7 @@ interface paths$1 {
259
268
  type: string;
260
269
  displayName: string;
261
270
  dataSourceEditorUrl?: string;
271
+ supportsUnpublishedData?: boolean;
262
272
  dataSourceEditorLocations?: {
263
273
  [key: string]: {
264
274
  url: string;
@@ -279,6 +289,7 @@ interface paths$1 {
279
289
  url: string;
280
290
  };
281
291
  };
292
+ contextualEditing?: string;
282
293
  };
283
294
  };
284
295
  badgeIconUrl?: string;
@@ -286,6 +297,11 @@ interface paths$1 {
286
297
  assetLibrary?: {
287
298
  assetLibraryUrl: string;
288
299
  assetParameterUrl: string;
300
+ assetLibraryLocations?: {
301
+ [key: string]: {
302
+ url: string;
303
+ };
304
+ };
289
305
  unstable_dynamicAssets?: {
290
306
  dataConnectorId: string;
291
307
  assetsListArchetypeId: string;
@@ -404,6 +420,7 @@ interface paths$1 {
404
420
  renderableInPropertyPanel?: boolean;
405
421
  /** @enum {string} */
406
422
  localizable?: "default-yes" | "default-no" | "yes" | "no";
423
+ allowedPlacement?: ("parameter" | "field")[];
407
424
  }[];
408
425
  editorTools?: {
409
426
  composition?: {
@@ -427,6 +444,7 @@ interface paths$1 {
427
444
  type: string;
428
445
  displayName: string;
429
446
  dataSourceEditorUrl?: string;
447
+ supportsUnpublishedData?: boolean;
430
448
  dataSourceEditorLocations?: {
431
449
  [key: string]: {
432
450
  url: string;
@@ -447,6 +465,7 @@ interface paths$1 {
447
465
  url: string;
448
466
  };
449
467
  };
468
+ contextualEditing?: string;
450
469
  };
451
470
  };
452
471
  badgeIconUrl?: string;
@@ -454,6 +473,11 @@ interface paths$1 {
454
473
  assetLibrary?: {
455
474
  assetLibraryUrl: string;
456
475
  assetParameterUrl: string;
476
+ assetLibraryLocations?: {
477
+ [key: string]: {
478
+ url: string;
479
+ };
480
+ };
457
481
  unstable_dynamicAssets?: {
458
482
  dataConnectorId: string;
459
483
  assetsListArchetypeId: string;
@@ -782,111 +806,119 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
782
806
  upsert(body: Omit<IntegrationDefinitionPutParameters, 'teamId'>): Promise<{
783
807
  type: string;
784
808
  displayName: string;
785
- logoIconUrl?: string | undefined;
786
- badgeIconUrl?: string | undefined;
787
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown" | undefined;
788
- public?: boolean | undefined;
789
- scopes?: string[] | undefined;
790
- baseLocationUrl?: string | undefined;
809
+ logoIconUrl?: string;
810
+ badgeIconUrl?: string;
811
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
812
+ public?: boolean;
813
+ scopes?: string[];
814
+ baseLocationUrl?: string;
791
815
  locations: {
792
816
  install?: {
793
- description?: string[] | undefined;
794
- informationUrl?: string | undefined;
795
- canvasPackageUrl?: string | undefined;
796
- } | undefined;
817
+ description?: string[];
818
+ informationUrl?: string;
819
+ canvasPackageUrl?: string;
820
+ };
797
821
  settings?: {
798
822
  url: string;
799
823
  locations?: {
800
824
  [key: string]: {
801
825
  url: string;
802
826
  };
803
- } | undefined;
804
- } | undefined;
827
+ };
828
+ };
805
829
  canvas?: {
806
830
  parameterTypes: {
807
831
  type: string;
808
832
  displayName: string;
809
- configureUrl?: string | undefined;
833
+ configureUrl?: string;
810
834
  editorUrl: string;
811
835
  configurationLocations?: {
812
836
  [key: string]: {
813
837
  url: string;
814
838
  };
815
- } | undefined;
839
+ };
816
840
  editorLocations?: {
817
841
  [key: string]: {
818
842
  url: string;
819
843
  };
820
- } | undefined;
821
- renderableInPropertyPanel?: boolean | undefined;
822
- localizable?: "default-yes" | "default-no" | "yes" | "no" | undefined;
844
+ };
845
+ renderableInPropertyPanel?: boolean;
846
+ localizable?: "default-yes" | "default-no" | "yes" | "no";
847
+ allowedPlacement?: ("parameter" | "field")[];
823
848
  }[];
824
849
  editorTools?: {
825
850
  composition?: {
826
851
  url: string;
827
- } | undefined;
852
+ };
828
853
  componentPattern?: {
829
854
  url: string;
830
- } | undefined;
855
+ };
831
856
  compositionDefaults?: {
832
857
  url: string;
833
- } | undefined;
858
+ };
834
859
  entry?: {
835
860
  url: string;
836
- } | undefined;
861
+ };
837
862
  entryPattern?: {
838
863
  url: string;
839
- } | undefined;
840
- } | undefined;
841
- } | undefined;
864
+ };
865
+ };
866
+ };
842
867
  dataConnectors?: {
843
868
  type: string;
844
869
  displayName: string;
845
- dataSourceEditorUrl?: string | undefined;
870
+ dataSourceEditorUrl?: string;
871
+ supportsUnpublishedData?: boolean;
846
872
  dataSourceEditorLocations?: {
847
873
  [key: string]: {
848
874
  url: string;
849
875
  };
850
- } | undefined;
876
+ };
851
877
  dataArchetypes?: {
852
878
  [key: string]: {
853
879
  displayName: string;
854
- typeEditorUrl?: string | undefined;
880
+ typeEditorUrl?: string;
855
881
  typeEditorLocations?: {
856
882
  [key: string]: {
857
883
  url: string;
858
884
  };
859
- } | undefined;
860
- dataEditorUrl?: string | undefined;
885
+ };
886
+ dataEditorUrl?: string;
861
887
  dataEditorUrlLocations?: {
862
888
  [key: string]: {
863
889
  url: string;
864
890
  };
865
- } | undefined;
891
+ };
892
+ contextualEditing?: string;
866
893
  };
867
- } | undefined;
868
- badgeIconUrl?: string | undefined;
869
- }[] | undefined;
894
+ };
895
+ badgeIconUrl?: string;
896
+ }[];
870
897
  assetLibrary?: {
871
898
  assetLibraryUrl: string;
872
899
  assetParameterUrl: string;
900
+ assetLibraryLocations?: {
901
+ [key: string]: {
902
+ url: string;
903
+ };
904
+ };
873
905
  unstable_dynamicAssets?: {
874
906
  dataConnectorId: string;
875
907
  assetsListArchetypeId: string;
876
908
  singleAssetArchetypeId: string;
877
- } | undefined;
878
- } | undefined;
909
+ };
910
+ };
879
911
  unstable_assetLibrary?: {
880
912
  url: string;
881
913
  dynamicAssets?: {
882
914
  dataConnectorId: string;
883
915
  assetsListArchetypeId: string;
884
916
  singleAssetArchetypeId: string;
885
- } | undefined;
886
- } | undefined;
917
+ };
918
+ };
887
919
  ai?: {
888
920
  generateUrl: string;
889
- metadataUrl?: string | undefined;
921
+ metadataUrl?: string;
890
922
  prompts?: {
891
923
  id: string;
892
924
  name: string;
@@ -895,20 +927,20 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
895
927
  arguments?: {
896
928
  [key: string]: {
897
929
  type: string;
898
- displayName?: string | null | undefined;
899
- helpText?: string | null | undefined;
900
- default?: string | null | undefined;
930
+ displayName?: string | null;
931
+ helpText?: string | null;
932
+ default?: string | null;
901
933
  };
902
- } | null | undefined;
903
- metadata?: unknown;
904
- } | null | undefined;
934
+ } | null;
935
+ metadata?: unknown | null;
936
+ } | null;
905
937
  parameterTypes: string[];
906
- }[] | undefined;
907
- } | undefined;
938
+ }[];
939
+ };
908
940
  unstable_ai?: {
909
941
  generateUrl: string;
910
- metadataUrl?: string | undefined;
911
- } | undefined;
942
+ metadataUrl?: string;
943
+ };
912
944
  };
913
945
  unstable_prompts?: {
914
946
  id: string;
@@ -918,15 +950,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
918
950
  arguments?: {
919
951
  [key: string]: {
920
952
  type: string;
921
- displayName?: string | null | undefined;
922
- helpText?: string | null | undefined;
923
- default?: string | null | undefined;
953
+ displayName?: string | null;
954
+ helpText?: string | null;
955
+ default?: string | null;
924
956
  };
925
- } | null | undefined;
926
- metadata?: unknown;
927
- } | null | undefined;
957
+ } | null;
958
+ metadata?: unknown | null;
959
+ } | null;
928
960
  parameterTypes: string[];
929
- }[] | undefined;
961
+ }[];
930
962
  }>;
931
963
  /** Deletes a mesh app from a team */
932
964
  remove(body: Omit<IntegrationDefinitionDeleteParameters, 'teamId'>): Promise<void>;
@@ -996,11 +1028,19 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
996
1028
  dataConnector: DataConnectorInfo;
997
1029
  /** Current dynamic inputs that are configured on the composition (if any). */
998
1030
  dynamicInputs: DynamicInputs;
1031
+ /** Which Data Source variant is being resolved and used for getDataResource (unless overriden explicitly) */
1032
+ dataSourceVariant?: DataSourceVariantsKeys;
999
1033
  }, TIntegrationConfiguration>;
1000
1034
  type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
1001
1035
 
1002
- type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables'>;
1003
- type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
1036
+ type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
1037
+ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1038
+ /**
1039
+ * If true, the data source should provide additional configuration to support the unpublished mode and save "unpublish" Data Source variant.
1040
+ * E.g. inputs for Preview API Token + Preview Environment.
1041
+ */
1042
+ enableUnpublishedMode: DataSourceLocationValue['enableUnpublishedMode'];
1043
+ }, TIntegrationConfiguration>;
1004
1044
  type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
1005
1045
 
1006
1046
  type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
@@ -1030,6 +1070,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1030
1070
  * Note that setValue() always sets the target language automatically.
1031
1071
  */
1032
1072
  targetLocale: string | undefined;
1073
+ /**
1074
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1075
+ * If this is -1, then the editor is not editing a conditional value.
1076
+ */
1077
+ targetConditionIndex: number;
1033
1078
  }, TIntegrationConfiguration>;
1034
1079
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
1035
1080
  /**
@@ -1048,7 +1093,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
1048
1093
  * Defines methods used for interacting with a Mesh location
1049
1094
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1050
1095
  */
1051
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1096
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | ContextualEditingLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1052
1097
  interface MeshContextData {
1053
1098
  locationKey: string;
1054
1099
  locationType: MeshLocationTypes;
@@ -1160,7 +1205,13 @@ type CloseDialogMessage = {
1160
1205
  dialogType: DialogType;
1161
1206
  dialogData?: unknown;
1162
1207
  };
1163
- type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'>;
1208
+ type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'> & {
1209
+ /**
1210
+ * Ability to override Data Source variant for particular getDataResource request,
1211
+ * because by default it will use Canvas Editor global. But sometimes you don't want to switch to Unpublished Data and stick to standard one.
1212
+ */
1213
+ dataSourceVariant?: DataSourceVariantsKeys | 'standard';
1214
+ };
1164
1215
  /** Primitive data types that a parameter type accepts to be bound to composition data */
1165
1216
  type BindableTypes = 'string' | 'number' | 'boolean' | 'object' | 'array';
1166
1217
  /** Message to parent to create a data connection expression to insert in a param type */
@@ -1209,9 +1260,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1209
1260
  * Imports the iframe communications library and provides an interface for interacting with
1210
1261
  * the parent window via said communications library.
1211
1262
  */
1212
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1263
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1213
1264
  dialogResponseHandlers: DialogResponseHandlers;
1214
1265
  onMetadataUpdated: (metadata: unknown) => void;
1266
+ onValueExternallyUpdated: (value: unknown) => void;
1215
1267
  }): Promise<{
1216
1268
  initData: MeshContextData;
1217
1269
  parent: {
@@ -1354,7 +1406,7 @@ type MeshLocationUserPermissions =
1354
1406
  /**
1355
1407
  * Known location types that can be passed to a mesh location
1356
1408
  */
1357
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'canvasEditorTools' | 'aiMetadata';
1409
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'contextualEditing' | 'canvasEditorTools' | 'aiMetadata';
1358
1410
  type SetValueOptions = ValidationResult;
1359
1411
  type SetValueMessage = {
1360
1412
  uniformMeshLocationValue: unknown;
@@ -1415,6 +1467,19 @@ type CanvasEditorToolsData = {
1415
1467
  });
1416
1468
  type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
1417
1469
 
1470
+ type ContextualEditingLocationValue = Record<string, string>;
1471
+ type ContextualEditingLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1472
+ resolvedData: any;
1473
+ dataType: DataType;
1474
+ /** The data type's archetype value. */
1475
+ archetype: string;
1476
+ /**
1477
+ * The current data resource's data source. NOTE: param and header values are not available in this context.
1478
+ */
1479
+ dataSource: DataSource;
1480
+ }, TIntegrationConfiguration>;
1481
+ type ContextualEditingLocation = MeshLocationCore<ContextualEditingLocationValue, ContextualEditingLocationMetadata, ContextualEditingLocationValue, 'contextualEditing'> & GetDataResourceLocation;
1482
+
1418
1483
  type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1419
1484
  /** The Uniform project ID */
1420
1485
  componentDefinition: ComponentDefinition;
@@ -1524,4 +1589,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
1524
1589
  */
1525
1590
  declare const hasRole: (role: string, user: UniformUser) => boolean;
1526
1591
 
1527
- export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type GetDataResourceLocation, type GetDataResourceMessage, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshSDKEventInterface, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, hasPermissions, hasRole, initializeUniformMeshSDK };
1592
+ export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type ContextualEditingLocation, type ContextualEditingLocationMetadata, type ContextualEditingLocationValue, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type GetDataResourceLocation, type GetDataResourceMessage, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshSDKEventInterface, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, hasPermissions, hasRole, initializeUniformMeshSDK };
package/dist/index.esm.js CHANGED
@@ -112,6 +112,9 @@ var getLogger = (prefix, debug) => {
112
112
  }
113
113
  };
114
114
 
115
+ // src/temp/version.ts
116
+ var UNIFORM_MESH_SDK_VERSION = "19.186.3";
117
+
115
118
  // src/framepost/constants.ts
116
119
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
117
120
 
@@ -361,6 +364,7 @@ var SharedClient = class {
361
364
  const message = serialize({
362
365
  type,
363
366
  apiVersion: "framepost/v1" /* v1 */,
367
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
364
368
  key,
365
369
  data,
366
370
  id: randomInsecureId(),
@@ -402,6 +406,7 @@ var SharedClient = class {
402
406
  const message = serialize({
403
407
  type: "channel_init" /* CHANNEL_INIT */,
404
408
  apiVersion: "framepost/v1" /* v1 */,
409
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
405
410
  key: "",
406
411
  data: context,
407
412
  id: randomInsecureId()
@@ -445,7 +450,8 @@ var ChildClient = class extends SharedClient {
445
450
  // src/sdkComms.ts
446
451
  async function connectToParent({
447
452
  dialogResponseHandlers,
448
- onMetadataUpdated
453
+ onMetadataUpdated,
454
+ onValueExternallyUpdated
449
455
  }) {
450
456
  const client = new ChildClient({ debug: false });
451
457
  window.parent.postMessage("parents just don't understand", "*");
@@ -463,6 +469,7 @@ async function connectToParent({
463
469
  delete dialogResponseHandlers[data.dialogId];
464
470
  });
465
471
  client.onRequest("metadata-value", onMetadataUpdated);
472
+ client.onRequest("external-value-update", onValueExternallyUpdated);
466
473
  return {
467
474
  initData,
468
475
  parent: {
@@ -648,6 +655,10 @@ async function initializeUniformMeshSDK({
648
655
  console.debug("Received metadata update", newMeta);
649
656
  currentMetadata = typedNewMeta;
650
657
  events.emit("onMetadataChanged", { newValue: newMeta });
658
+ },
659
+ onValueExternallyUpdated: (newValue) => {
660
+ console.debug("Received external value update", newValue);
661
+ events.emit("onValueChanged", { newValue });
651
662
  }
652
663
  });
653
664
  const { initData: contextData, parent } = connectResult;
package/dist/index.js CHANGED
@@ -151,6 +151,9 @@ var getLogger = (prefix, debug) => {
151
151
  }
152
152
  };
153
153
 
154
+ // src/temp/version.ts
155
+ var UNIFORM_MESH_SDK_VERSION = "19.186.3";
156
+
154
157
  // src/framepost/constants.ts
155
158
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
156
159
 
@@ -400,6 +403,7 @@ var SharedClient = class {
400
403
  const message = serialize({
401
404
  type,
402
405
  apiVersion: "framepost/v1" /* v1 */,
406
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
403
407
  key,
404
408
  data,
405
409
  id: randomInsecureId(),
@@ -441,6 +445,7 @@ var SharedClient = class {
441
445
  const message = serialize({
442
446
  type: "channel_init" /* CHANNEL_INIT */,
443
447
  apiVersion: "framepost/v1" /* v1 */,
448
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
444
449
  key: "",
445
450
  data: context,
446
451
  id: randomInsecureId()
@@ -484,7 +489,8 @@ var ChildClient = class extends SharedClient {
484
489
  // src/sdkComms.ts
485
490
  async function connectToParent({
486
491
  dialogResponseHandlers,
487
- onMetadataUpdated
492
+ onMetadataUpdated,
493
+ onValueExternallyUpdated
488
494
  }) {
489
495
  const client = new ChildClient({ debug: false });
490
496
  window.parent.postMessage("parents just don't understand", "*");
@@ -502,6 +508,7 @@ async function connectToParent({
502
508
  delete dialogResponseHandlers[data.dialogId];
503
509
  });
504
510
  client.onRequest("metadata-value", onMetadataUpdated);
511
+ client.onRequest("external-value-update", onValueExternallyUpdated);
505
512
  return {
506
513
  initData,
507
514
  parent: {
@@ -687,6 +694,10 @@ async function initializeUniformMeshSDK({
687
694
  console.debug("Received metadata update", newMeta);
688
695
  currentMetadata = typedNewMeta;
689
696
  events.emit("onMetadataChanged", { newValue: newMeta });
697
+ },
698
+ onValueExternallyUpdated: (newValue) => {
699
+ console.debug("Received external value update", newValue);
700
+ events.emit("onValueChanged", { newValue });
690
701
  }
691
702
  });
692
703
  const { initData: contextData, parent } = connectResult;
package/dist/index.mjs CHANGED
@@ -112,6 +112,9 @@ var getLogger = (prefix, debug) => {
112
112
  }
113
113
  };
114
114
 
115
+ // src/temp/version.ts
116
+ var UNIFORM_MESH_SDK_VERSION = "19.186.3";
117
+
115
118
  // src/framepost/constants.ts
116
119
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
117
120
 
@@ -361,6 +364,7 @@ var SharedClient = class {
361
364
  const message = serialize({
362
365
  type,
363
366
  apiVersion: "framepost/v1" /* v1 */,
367
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
364
368
  key,
365
369
  data,
366
370
  id: randomInsecureId(),
@@ -402,6 +406,7 @@ var SharedClient = class {
402
406
  const message = serialize({
403
407
  type: "channel_init" /* CHANNEL_INIT */,
404
408
  apiVersion: "framepost/v1" /* v1 */,
409
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
405
410
  key: "",
406
411
  data: context,
407
412
  id: randomInsecureId()
@@ -445,7 +450,8 @@ var ChildClient = class extends SharedClient {
445
450
  // src/sdkComms.ts
446
451
  async function connectToParent({
447
452
  dialogResponseHandlers,
448
- onMetadataUpdated
453
+ onMetadataUpdated,
454
+ onValueExternallyUpdated
449
455
  }) {
450
456
  const client = new ChildClient({ debug: false });
451
457
  window.parent.postMessage("parents just don't understand", "*");
@@ -463,6 +469,7 @@ async function connectToParent({
463
469
  delete dialogResponseHandlers[data.dialogId];
464
470
  });
465
471
  client.onRequest("metadata-value", onMetadataUpdated);
472
+ client.onRequest("external-value-update", onValueExternallyUpdated);
466
473
  return {
467
474
  initData,
468
475
  parent: {
@@ -648,6 +655,10 @@ async function initializeUniformMeshSDK({
648
655
  console.debug("Received metadata update", newMeta);
649
656
  currentMetadata = typedNewMeta;
650
657
  events.emit("onMetadataChanged", { newValue: newMeta });
658
+ },
659
+ onValueExternallyUpdated: (newValue) => {
660
+ console.debug("Received external value update", newValue);
661
+ events.emit("onValueChanged", { newValue });
651
662
  }
652
663
  });
653
664
  const { initData: contextData, parent } = connectResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk",
3
- "version": "19.173.0",
3
+ "version": "19.173.2-alpha.210+4f0f6ff104",
4
4
  "description": "Uniform Mesh Framework SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -16,9 +16,10 @@
16
16
  "types": "./dist/index.d.ts",
17
17
  "sideEffects": false,
18
18
  "scripts": {
19
- "build": "run-s update-openapi build:js",
19
+ "build": "run-s update-openapi build:setversion build:js",
20
20
  "build:js": "tsup",
21
- "dev": "pnpm update-openapi && tsup --watch",
21
+ "build:setversion": "tsx ./scripts/set-version.ts",
22
+ "dev": "pnpm update-openapi && pnpm build:setversion && tsup --watch",
22
23
  "clean": "rimraf dist",
23
24
  "test": "jest --maxWorkers=1 --passWithNoTests",
24
25
  "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
@@ -33,14 +34,14 @@
33
34
  "access": "public"
34
35
  },
35
36
  "dependencies": {
36
- "@uniformdev/canvas": "19.173.0",
37
- "@uniformdev/context": "19.173.0",
38
- "@uniformdev/project-map": "19.173.0",
37
+ "@uniformdev/canvas": "19.173.2-alpha.210+4f0f6ff104",
38
+ "@uniformdev/context": "19.173.2-alpha.210+4f0f6ff104",
39
+ "@uniformdev/project-map": "19.173.2-alpha.210+4f0f6ff104",
39
40
  "imagesloaded": "^5.0.0",
40
- "mitt": "^3.0.0"
41
+ "mitt": "^3.0.1"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@types/imagesloaded": "^4.1.2"
44
45
  },
45
- "gitHead": "d71596f8829efb4f28ef7213dd9c06421b5cc388"
46
+ "gitHead": "4f0f6ff104f46349c338fde461f063f22f04ce0e"
46
47
  }