@uniformdev/mesh-sdk 19.179.1-alpha.1 → 19.179.2-alpha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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
 
@@ -90,6 +90,7 @@ interface paths$1 {
90
90
  type: string;
91
91
  displayName: string;
92
92
  dataSourceEditorUrl?: string;
93
+ supportsUnpublishedData?: boolean;
93
94
  dataSourceEditorLocations?: {
94
95
  [key: string]: {
95
96
  url: string;
@@ -110,6 +111,7 @@ interface paths$1 {
110
111
  url: string;
111
112
  };
112
113
  };
114
+ contextualEditing?: string;
113
115
  };
114
116
  };
115
117
  badgeIconUrl?: string;
@@ -264,6 +266,7 @@ interface paths$1 {
264
266
  type: string;
265
267
  displayName: string;
266
268
  dataSourceEditorUrl?: string;
269
+ supportsUnpublishedData?: boolean;
267
270
  dataSourceEditorLocations?: {
268
271
  [key: string]: {
269
272
  url: string;
@@ -284,6 +287,7 @@ interface paths$1 {
284
287
  url: string;
285
288
  };
286
289
  };
290
+ contextualEditing?: string;
287
291
  };
288
292
  };
289
293
  badgeIconUrl?: string;
@@ -437,6 +441,7 @@ interface paths$1 {
437
441
  type: string;
438
442
  displayName: string;
439
443
  dataSourceEditorUrl?: string;
444
+ supportsUnpublishedData?: boolean;
440
445
  dataSourceEditorLocations?: {
441
446
  [key: string]: {
442
447
  url: string;
@@ -457,6 +462,7 @@ interface paths$1 {
457
462
  url: string;
458
463
  };
459
464
  };
465
+ contextualEditing?: string;
460
466
  };
461
467
  };
462
468
  badgeIconUrl?: string;
@@ -797,91 +803,93 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
797
803
  upsert(body: Omit<IntegrationDefinitionPutParameters, 'teamId'>): Promise<{
798
804
  type: string;
799
805
  displayName: string;
800
- logoIconUrl?: string | undefined;
801
- badgeIconUrl?: string | undefined;
802
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown" | undefined;
803
- public?: boolean | undefined;
804
- scopes?: string[] | undefined;
805
- baseLocationUrl?: string | undefined;
806
+ logoIconUrl?: string;
807
+ badgeIconUrl?: string;
808
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
809
+ public?: boolean;
810
+ scopes?: string[];
811
+ baseLocationUrl?: string;
806
812
  locations: {
807
813
  install?: {
808
- description?: string[] | undefined;
809
- informationUrl?: string | undefined;
810
- canvasPackageUrl?: string | undefined;
811
- } | undefined;
814
+ description?: string[];
815
+ informationUrl?: string;
816
+ canvasPackageUrl?: string;
817
+ };
812
818
  settings?: {
813
819
  url: string;
814
820
  locations?: {
815
821
  [key: string]: {
816
822
  url: string;
817
823
  };
818
- } | undefined;
819
- } | undefined;
824
+ };
825
+ };
820
826
  canvas?: {
821
827
  parameterTypes: {
822
828
  type: string;
823
829
  displayName: string;
824
- configureUrl?: string | undefined;
830
+ configureUrl?: string;
825
831
  editorUrl: string;
826
832
  configurationLocations?: {
827
833
  [key: string]: {
828
834
  url: string;
829
835
  };
830
- } | undefined;
836
+ };
831
837
  editorLocations?: {
832
838
  [key: string]: {
833
839
  url: string;
834
840
  };
835
- } | undefined;
836
- renderableInPropertyPanel?: boolean | undefined;
837
- localizable?: "default-yes" | "default-no" | "yes" | "no" | undefined;
841
+ };
842
+ renderableInPropertyPanel?: boolean;
843
+ localizable?: "default-yes" | "default-no" | "yes" | "no";
838
844
  }[];
839
845
  editorTools?: {
840
846
  composition?: {
841
847
  url: string;
842
- } | undefined;
848
+ };
843
849
  componentPattern?: {
844
850
  url: string;
845
- } | undefined;
851
+ };
846
852
  compositionDefaults?: {
847
853
  url: string;
848
- } | undefined;
854
+ };
849
855
  entry?: {
850
856
  url: string;
851
- } | undefined;
857
+ };
852
858
  entryPattern?: {
853
859
  url: string;
854
- } | undefined;
855
- } | undefined;
856
- } | undefined;
860
+ };
861
+ };
862
+ };
857
863
  dataConnectors?: {
858
864
  type: string;
859
865
  displayName: string;
860
- dataSourceEditorUrl?: string | undefined;
866
+ dataSourceEditorUrl?: string;
867
+ supportsUnpublishedData?: boolean;
861
868
  dataSourceEditorLocations?: {
862
869
  [key: string]: {
863
870
  url: string;
864
871
  };
865
- } | undefined;
872
+ };
866
873
  dataArchetypes?: {
867
874
  [key: string]: {
868
875
  displayName: string;
869
- typeEditorUrl?: string | undefined;
876
+ typeEditorUrl?: string;
870
877
  typeEditorLocations?: {
871
878
  [key: string]: {
872
879
  url: string;
873
880
  };
874
- } | undefined;
875
- dataEditorUrl?: string | undefined;
881
+ };
882
+ dataEditorUrl?: string;
876
883
  dataEditorUrlLocations?: {
877
884
  [key: string]: {
878
885
  url: string;
879
886
  };
880
- } | undefined;
887
+ };
888
+ contextualEditing?: string;
881
889
  };
882
- } | undefined;
883
- badgeIconUrl?: string | undefined;
884
- }[] | undefined;
890
+ };
891
+ badgeIconUrl?: string;
892
+ }[];
885
893
  assetLibrary?: {
886
894
  assetLibraryUrl: string;
887
895
  assetParameterUrl: string;
@@ -889,24 +897,24 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
889
897
  [key: string]: {
890
898
  url: string;
891
899
  };
892
- } | undefined;
900
+ };
893
901
  unstable_dynamicAssets?: {
894
902
  dataConnectorId: string;
895
903
  assetsListArchetypeId: string;
896
904
  singleAssetArchetypeId: string;
897
- } | undefined;
898
- } | undefined;
905
+ };
906
+ };
899
907
  unstable_assetLibrary?: {
900
908
  url: string;
901
909
  dynamicAssets?: {
902
910
  dataConnectorId: string;
903
911
  assetsListArchetypeId: string;
904
912
  singleAssetArchetypeId: string;
905
- } | undefined;
906
- } | undefined;
913
+ };
914
+ };
907
915
  ai?: {
908
916
  generateUrl: string;
909
- metadataUrl?: string | undefined;
917
+ metadataUrl?: string;
910
918
  prompts?: {
911
919
  id: string;
912
920
  name: string;
@@ -915,20 +923,20 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
915
923
  arguments?: {
916
924
  [key: string]: {
917
925
  type: string;
918
- displayName?: string | null | undefined;
919
- helpText?: string | null | undefined;
920
- default?: string | null | undefined;
926
+ displayName?: string | null;
927
+ helpText?: string | null;
928
+ default?: string | null;
921
929
  };
922
- } | null | undefined;
923
- metadata?: unknown;
924
- } | null | undefined;
930
+ } | null;
931
+ metadata?: unknown | null;
932
+ } | null;
925
933
  parameterTypes: string[];
926
- }[] | undefined;
927
- } | undefined;
934
+ }[];
935
+ };
928
936
  unstable_ai?: {
929
937
  generateUrl: string;
930
- metadataUrl?: string | undefined;
931
- } | undefined;
938
+ metadataUrl?: string;
939
+ };
932
940
  };
933
941
  unstable_prompts?: {
934
942
  id: string;
@@ -938,15 +946,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
938
946
  arguments?: {
939
947
  [key: string]: {
940
948
  type: string;
941
- displayName?: string | null | undefined;
942
- helpText?: string | null | undefined;
943
- default?: string | null | undefined;
949
+ displayName?: string | null;
950
+ helpText?: string | null;
951
+ default?: string | null;
944
952
  };
945
- } | null | undefined;
946
- metadata?: unknown;
947
- } | null | undefined;
953
+ } | null;
954
+ metadata?: unknown | null;
955
+ } | null;
948
956
  parameterTypes: string[];
949
- }[] | undefined;
957
+ }[];
950
958
  }>;
951
959
  /** Deletes a mesh app from a team */
952
960
  remove(body: Omit<IntegrationDefinitionDeleteParameters, 'teamId'>): Promise<void>;
@@ -1016,11 +1024,14 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
1016
1024
  dataConnector: DataConnectorInfo;
1017
1025
  /** Current dynamic inputs that are configured on the composition (if any). */
1018
1026
  dynamicInputs: DynamicInputs;
1027
+ dataSourceVariant?: DataSourceVariantsKeys;
1019
1028
  }, TIntegrationConfiguration>;
1020
1029
  type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
1021
1030
 
1022
- type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables'>;
1023
- type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
1031
+ type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
1032
+ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1033
+ enableUnpublishedMode: DataSourceLocationValue['enableUnpublishedMode'];
1034
+ }, TIntegrationConfiguration>;
1024
1035
  type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
1025
1036
 
1026
1037
  type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
@@ -1050,6 +1061,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1050
1061
  * Note that setValue() always sets the target language automatically.
1051
1062
  */
1052
1063
  targetLocale: string | undefined;
1064
+ /**
1065
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1066
+ * If this is -1, then the editor is not editing a conditional value.
1067
+ */
1068
+ targetConditionIndex: number;
1053
1069
  }, TIntegrationConfiguration>;
1054
1070
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
1055
1071
  /**
@@ -1068,7 +1084,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
1068
1084
  * Defines methods used for interacting with a Mesh location
1069
1085
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1070
1086
  */
1071
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1087
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | ContextualEditingLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1072
1088
  interface MeshContextData {
1073
1089
  locationKey: string;
1074
1090
  locationType: MeshLocationTypes;
@@ -1180,7 +1196,9 @@ type CloseDialogMessage = {
1180
1196
  dialogType: DialogType;
1181
1197
  dialogData?: unknown;
1182
1198
  };
1183
- type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'>;
1199
+ type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'> & {
1200
+ dataSourceVariant?: DataSourceVariantsKeys;
1201
+ };
1184
1202
  /** Primitive data types that a parameter type accepts to be bound to composition data */
1185
1203
  type BindableTypes = 'string' | 'number' | 'boolean' | 'object' | 'array';
1186
1204
  /** Message to parent to create a data connection expression to insert in a param type */
@@ -1229,9 +1247,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1229
1247
  * Imports the iframe communications library and provides an interface for interacting with
1230
1248
  * the parent window via said communications library.
1231
1249
  */
1232
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1250
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1233
1251
  dialogResponseHandlers: DialogResponseHandlers;
1234
1252
  onMetadataUpdated: (metadata: unknown) => void;
1253
+ onValueExternallyUpdated: (value: unknown) => void;
1235
1254
  }): Promise<{
1236
1255
  initData: MeshContextData;
1237
1256
  parent: {
@@ -1374,7 +1393,7 @@ type MeshLocationUserPermissions =
1374
1393
  /**
1375
1394
  * Known location types that can be passed to a mesh location
1376
1395
  */
1377
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'canvasEditorTools' | 'aiMetadata';
1396
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'contextualEditing' | 'canvasEditorTools' | 'aiMetadata';
1378
1397
  type SetValueOptions = ValidationResult;
1379
1398
  type SetValueMessage = {
1380
1399
  uniformMeshLocationValue: unknown;
@@ -1435,6 +1454,13 @@ type CanvasEditorToolsData = {
1435
1454
  });
1436
1455
  type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
1437
1456
 
1457
+ type ContextualEditingLocationValue = Record<string, string>;
1458
+ type ContextualEditingLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1459
+ archetype: string;
1460
+ resolvedData: any;
1461
+ }, TIntegrationConfiguration>;
1462
+ type ContextualEditingLocation = MeshLocationCore<ContextualEditingLocationValue, ContextualEditingLocationMetadata, ContextualEditingLocationValue, 'contextualEditing'> & GetDataResourceLocation;
1463
+
1438
1464
  type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1439
1465
  /** The Uniform project ID */
1440
1466
  componentDefinition: ComponentDefinition;
@@ -1544,4 +1570,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
1544
1570
  */
1545
1571
  declare const hasRole: (role: string, user: UniformUser) => boolean;
1546
1572
 
1547
- 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 };
1573
+ 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
 
@@ -90,6 +90,7 @@ interface paths$1 {
90
90
  type: string;
91
91
  displayName: string;
92
92
  dataSourceEditorUrl?: string;
93
+ supportsUnpublishedData?: boolean;
93
94
  dataSourceEditorLocations?: {
94
95
  [key: string]: {
95
96
  url: string;
@@ -110,6 +111,7 @@ interface paths$1 {
110
111
  url: string;
111
112
  };
112
113
  };
114
+ contextualEditing?: string;
113
115
  };
114
116
  };
115
117
  badgeIconUrl?: string;
@@ -264,6 +266,7 @@ interface paths$1 {
264
266
  type: string;
265
267
  displayName: string;
266
268
  dataSourceEditorUrl?: string;
269
+ supportsUnpublishedData?: boolean;
267
270
  dataSourceEditorLocations?: {
268
271
  [key: string]: {
269
272
  url: string;
@@ -284,6 +287,7 @@ interface paths$1 {
284
287
  url: string;
285
288
  };
286
289
  };
290
+ contextualEditing?: string;
287
291
  };
288
292
  };
289
293
  badgeIconUrl?: string;
@@ -437,6 +441,7 @@ interface paths$1 {
437
441
  type: string;
438
442
  displayName: string;
439
443
  dataSourceEditorUrl?: string;
444
+ supportsUnpublishedData?: boolean;
440
445
  dataSourceEditorLocations?: {
441
446
  [key: string]: {
442
447
  url: string;
@@ -457,6 +462,7 @@ interface paths$1 {
457
462
  url: string;
458
463
  };
459
464
  };
465
+ contextualEditing?: string;
460
466
  };
461
467
  };
462
468
  badgeIconUrl?: string;
@@ -797,91 +803,93 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
797
803
  upsert(body: Omit<IntegrationDefinitionPutParameters, 'teamId'>): Promise<{
798
804
  type: string;
799
805
  displayName: string;
800
- logoIconUrl?: string | undefined;
801
- badgeIconUrl?: string | undefined;
802
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown" | undefined;
803
- public?: boolean | undefined;
804
- scopes?: string[] | undefined;
805
- baseLocationUrl?: string | undefined;
806
+ logoIconUrl?: string;
807
+ badgeIconUrl?: string;
808
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
809
+ public?: boolean;
810
+ scopes?: string[];
811
+ baseLocationUrl?: string;
806
812
  locations: {
807
813
  install?: {
808
- description?: string[] | undefined;
809
- informationUrl?: string | undefined;
810
- canvasPackageUrl?: string | undefined;
811
- } | undefined;
814
+ description?: string[];
815
+ informationUrl?: string;
816
+ canvasPackageUrl?: string;
817
+ };
812
818
  settings?: {
813
819
  url: string;
814
820
  locations?: {
815
821
  [key: string]: {
816
822
  url: string;
817
823
  };
818
- } | undefined;
819
- } | undefined;
824
+ };
825
+ };
820
826
  canvas?: {
821
827
  parameterTypes: {
822
828
  type: string;
823
829
  displayName: string;
824
- configureUrl?: string | undefined;
830
+ configureUrl?: string;
825
831
  editorUrl: string;
826
832
  configurationLocations?: {
827
833
  [key: string]: {
828
834
  url: string;
829
835
  };
830
- } | undefined;
836
+ };
831
837
  editorLocations?: {
832
838
  [key: string]: {
833
839
  url: string;
834
840
  };
835
- } | undefined;
836
- renderableInPropertyPanel?: boolean | undefined;
837
- localizable?: "default-yes" | "default-no" | "yes" | "no" | undefined;
841
+ };
842
+ renderableInPropertyPanel?: boolean;
843
+ localizable?: "default-yes" | "default-no" | "yes" | "no";
838
844
  }[];
839
845
  editorTools?: {
840
846
  composition?: {
841
847
  url: string;
842
- } | undefined;
848
+ };
843
849
  componentPattern?: {
844
850
  url: string;
845
- } | undefined;
851
+ };
846
852
  compositionDefaults?: {
847
853
  url: string;
848
- } | undefined;
854
+ };
849
855
  entry?: {
850
856
  url: string;
851
- } | undefined;
857
+ };
852
858
  entryPattern?: {
853
859
  url: string;
854
- } | undefined;
855
- } | undefined;
856
- } | undefined;
860
+ };
861
+ };
862
+ };
857
863
  dataConnectors?: {
858
864
  type: string;
859
865
  displayName: string;
860
- dataSourceEditorUrl?: string | undefined;
866
+ dataSourceEditorUrl?: string;
867
+ supportsUnpublishedData?: boolean;
861
868
  dataSourceEditorLocations?: {
862
869
  [key: string]: {
863
870
  url: string;
864
871
  };
865
- } | undefined;
872
+ };
866
873
  dataArchetypes?: {
867
874
  [key: string]: {
868
875
  displayName: string;
869
- typeEditorUrl?: string | undefined;
876
+ typeEditorUrl?: string;
870
877
  typeEditorLocations?: {
871
878
  [key: string]: {
872
879
  url: string;
873
880
  };
874
- } | undefined;
875
- dataEditorUrl?: string | undefined;
881
+ };
882
+ dataEditorUrl?: string;
876
883
  dataEditorUrlLocations?: {
877
884
  [key: string]: {
878
885
  url: string;
879
886
  };
880
- } | undefined;
887
+ };
888
+ contextualEditing?: string;
881
889
  };
882
- } | undefined;
883
- badgeIconUrl?: string | undefined;
884
- }[] | undefined;
890
+ };
891
+ badgeIconUrl?: string;
892
+ }[];
885
893
  assetLibrary?: {
886
894
  assetLibraryUrl: string;
887
895
  assetParameterUrl: string;
@@ -889,24 +897,24 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
889
897
  [key: string]: {
890
898
  url: string;
891
899
  };
892
- } | undefined;
900
+ };
893
901
  unstable_dynamicAssets?: {
894
902
  dataConnectorId: string;
895
903
  assetsListArchetypeId: string;
896
904
  singleAssetArchetypeId: string;
897
- } | undefined;
898
- } | undefined;
905
+ };
906
+ };
899
907
  unstable_assetLibrary?: {
900
908
  url: string;
901
909
  dynamicAssets?: {
902
910
  dataConnectorId: string;
903
911
  assetsListArchetypeId: string;
904
912
  singleAssetArchetypeId: string;
905
- } | undefined;
906
- } | undefined;
913
+ };
914
+ };
907
915
  ai?: {
908
916
  generateUrl: string;
909
- metadataUrl?: string | undefined;
917
+ metadataUrl?: string;
910
918
  prompts?: {
911
919
  id: string;
912
920
  name: string;
@@ -915,20 +923,20 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
915
923
  arguments?: {
916
924
  [key: string]: {
917
925
  type: string;
918
- displayName?: string | null | undefined;
919
- helpText?: string | null | undefined;
920
- default?: string | null | undefined;
926
+ displayName?: string | null;
927
+ helpText?: string | null;
928
+ default?: string | null;
921
929
  };
922
- } | null | undefined;
923
- metadata?: unknown;
924
- } | null | undefined;
930
+ } | null;
931
+ metadata?: unknown | null;
932
+ } | null;
925
933
  parameterTypes: string[];
926
- }[] | undefined;
927
- } | undefined;
934
+ }[];
935
+ };
928
936
  unstable_ai?: {
929
937
  generateUrl: string;
930
- metadataUrl?: string | undefined;
931
- } | undefined;
938
+ metadataUrl?: string;
939
+ };
932
940
  };
933
941
  unstable_prompts?: {
934
942
  id: string;
@@ -938,15 +946,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
938
946
  arguments?: {
939
947
  [key: string]: {
940
948
  type: string;
941
- displayName?: string | null | undefined;
942
- helpText?: string | null | undefined;
943
- default?: string | null | undefined;
949
+ displayName?: string | null;
950
+ helpText?: string | null;
951
+ default?: string | null;
944
952
  };
945
- } | null | undefined;
946
- metadata?: unknown;
947
- } | null | undefined;
953
+ } | null;
954
+ metadata?: unknown | null;
955
+ } | null;
948
956
  parameterTypes: string[];
949
- }[] | undefined;
957
+ }[];
950
958
  }>;
951
959
  /** Deletes a mesh app from a team */
952
960
  remove(body: Omit<IntegrationDefinitionDeleteParameters, 'teamId'>): Promise<void>;
@@ -1016,11 +1024,14 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
1016
1024
  dataConnector: DataConnectorInfo;
1017
1025
  /** Current dynamic inputs that are configured on the composition (if any). */
1018
1026
  dynamicInputs: DynamicInputs;
1027
+ dataSourceVariant?: DataSourceVariantsKeys;
1019
1028
  }, TIntegrationConfiguration>;
1020
1029
  type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
1021
1030
 
1022
- type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables'>;
1023
- type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
1031
+ type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
1032
+ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1033
+ enableUnpublishedMode: DataSourceLocationValue['enableUnpublishedMode'];
1034
+ }, TIntegrationConfiguration>;
1024
1035
  type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
1025
1036
 
1026
1037
  type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
@@ -1050,6 +1061,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1050
1061
  * Note that setValue() always sets the target language automatically.
1051
1062
  */
1052
1063
  targetLocale: string | undefined;
1064
+ /**
1065
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1066
+ * If this is -1, then the editor is not editing a conditional value.
1067
+ */
1068
+ targetConditionIndex: number;
1053
1069
  }, TIntegrationConfiguration>;
1054
1070
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
1055
1071
  /**
@@ -1068,7 +1084,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
1068
1084
  * Defines methods used for interacting with a Mesh location
1069
1085
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1070
1086
  */
1071
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1087
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | ContextualEditingLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1072
1088
  interface MeshContextData {
1073
1089
  locationKey: string;
1074
1090
  locationType: MeshLocationTypes;
@@ -1180,7 +1196,9 @@ type CloseDialogMessage = {
1180
1196
  dialogType: DialogType;
1181
1197
  dialogData?: unknown;
1182
1198
  };
1183
- type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'>;
1199
+ type GetDataResourceMessage = Pick<DataType, 'path' | 'archetype' | 'headers' | 'parameters' | 'body' | 'method'> & {
1200
+ dataSourceVariant?: DataSourceVariantsKeys;
1201
+ };
1184
1202
  /** Primitive data types that a parameter type accepts to be bound to composition data */
1185
1203
  type BindableTypes = 'string' | 'number' | 'boolean' | 'object' | 'array';
1186
1204
  /** Message to parent to create a data connection expression to insert in a param type */
@@ -1229,9 +1247,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1229
1247
  * Imports the iframe communications library and provides an interface for interacting with
1230
1248
  * the parent window via said communications library.
1231
1249
  */
1232
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1250
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1233
1251
  dialogResponseHandlers: DialogResponseHandlers;
1234
1252
  onMetadataUpdated: (metadata: unknown) => void;
1253
+ onValueExternallyUpdated: (value: unknown) => void;
1235
1254
  }): Promise<{
1236
1255
  initData: MeshContextData;
1237
1256
  parent: {
@@ -1374,7 +1393,7 @@ type MeshLocationUserPermissions =
1374
1393
  /**
1375
1394
  * Known location types that can be passed to a mesh location
1376
1395
  */
1377
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'canvasEditorTools' | 'aiMetadata';
1396
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'contextualEditing' | 'canvasEditorTools' | 'aiMetadata';
1378
1397
  type SetValueOptions = ValidationResult;
1379
1398
  type SetValueMessage = {
1380
1399
  uniformMeshLocationValue: unknown;
@@ -1435,6 +1454,13 @@ type CanvasEditorToolsData = {
1435
1454
  });
1436
1455
  type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
1437
1456
 
1457
+ type ContextualEditingLocationValue = Record<string, string>;
1458
+ type ContextualEditingLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1459
+ archetype: string;
1460
+ resolvedData: any;
1461
+ }, TIntegrationConfiguration>;
1462
+ type ContextualEditingLocation = MeshLocationCore<ContextualEditingLocationValue, ContextualEditingLocationMetadata, ContextualEditingLocationValue, 'contextualEditing'> & GetDataResourceLocation;
1463
+
1438
1464
  type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1439
1465
  /** The Uniform project ID */
1440
1466
  componentDefinition: ComponentDefinition;
@@ -1544,4 +1570,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
1544
1570
  */
1545
1571
  declare const hasRole: (role: string, user: UniformUser) => boolean;
1546
1572
 
1547
- 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 };
1573
+ 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.179.1";
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.179.1";
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.179.1";
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.179.1-alpha.1+3adc08c00a",
3
+ "version": "19.179.2-alpha.25+252ca669db",
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.179.1-alpha.1+3adc08c00a",
37
- "@uniformdev/context": "19.179.1-alpha.1+3adc08c00a",
38
- "@uniformdev/project-map": "19.179.1-alpha.1+3adc08c00a",
37
+ "@uniformdev/canvas": "19.179.2-alpha.25+252ca669db",
38
+ "@uniformdev/context": "19.179.2-alpha.25+252ca669db",
39
+ "@uniformdev/project-map": "19.179.2-alpha.25+252ca669db",
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": "3adc08c00a0d3932b6b767faaa6157f8b71ef0a0"
46
+ "gitHead": "252ca669dbe0172211ab6b0465322c8cecd9a974"
46
47
  }