@uniformdev/mesh-sdk 19.135.0 → 19.135.1-alpha.11

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, DataVariableDefinition } from '@uniformdev/canvas';
3
+ import { AssetParamValue, DataType, DataSource, 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
 
@@ -30,7 +30,7 @@ interface paths$1 {
30
30
  logoIconUrl?: string;
31
31
  badgeIconUrl?: string;
32
32
  /** @enum {string} */
33
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown";
33
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
34
34
  public?: boolean;
35
35
  scopes?: string[];
36
36
  baseLocationUrl?: string;
@@ -67,7 +67,25 @@ 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
  }[];
72
+ editorTools?: {
73
+ composition?: {
74
+ url: string;
75
+ };
76
+ componentPattern?: {
77
+ url: string;
78
+ };
79
+ compositionDefaults?: {
80
+ url: string;
81
+ };
82
+ entry?: {
83
+ url: string;
84
+ };
85
+ entryPattern?: {
86
+ url: string;
87
+ };
88
+ };
71
89
  };
72
90
  dataConnectors?: {
73
91
  type: string;
@@ -100,6 +118,11 @@ interface paths$1 {
100
118
  assetLibrary?: {
101
119
  assetLibraryUrl: string;
102
120
  assetParameterUrl: string;
121
+ assetLibraryLocations?: {
122
+ [key: string]: {
123
+ url: string;
124
+ };
125
+ };
103
126
  unstable_dynamicAssets?: {
104
127
  dataConnectorId: string;
105
128
  assetsListArchetypeId: string;
@@ -182,7 +205,7 @@ interface paths$1 {
182
205
  logoIconUrl?: string;
183
206
  badgeIconUrl?: string;
184
207
  /** @enum {string} */
185
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown";
208
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
186
209
  public?: boolean;
187
210
  scopes?: string[];
188
211
  baseLocationUrl?: string;
@@ -219,7 +242,25 @@ interface paths$1 {
219
242
  renderableInPropertyPanel?: boolean;
220
243
  /** @enum {string} */
221
244
  localizable?: "default-yes" | "default-no" | "yes" | "no";
245
+ allowedPlacement?: ("parameter" | "field")[];
222
246
  }[];
247
+ editorTools?: {
248
+ composition?: {
249
+ url: string;
250
+ };
251
+ componentPattern?: {
252
+ url: string;
253
+ };
254
+ compositionDefaults?: {
255
+ url: string;
256
+ };
257
+ entry?: {
258
+ url: string;
259
+ };
260
+ entryPattern?: {
261
+ url: string;
262
+ };
263
+ };
223
264
  };
224
265
  dataConnectors?: {
225
266
  type: string;
@@ -252,6 +293,11 @@ interface paths$1 {
252
293
  assetLibrary?: {
253
294
  assetLibraryUrl: string;
254
295
  assetParameterUrl: string;
296
+ assetLibraryLocations?: {
297
+ [key: string]: {
298
+ url: string;
299
+ };
300
+ };
255
301
  unstable_dynamicAssets?: {
256
302
  dataConnectorId: string;
257
303
  assetsListArchetypeId: string;
@@ -334,7 +380,7 @@ interface paths$1 {
334
380
  logoIconUrl?: string;
335
381
  badgeIconUrl?: string;
336
382
  /** @enum {string} */
337
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown";
383
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
338
384
  scopes?: string[];
339
385
  baseLocationUrl?: string;
340
386
  locations: {
@@ -370,7 +416,25 @@ interface paths$1 {
370
416
  renderableInPropertyPanel?: boolean;
371
417
  /** @enum {string} */
372
418
  localizable?: "default-yes" | "default-no" | "yes" | "no";
419
+ allowedPlacement?: ("parameter" | "field")[];
373
420
  }[];
421
+ editorTools?: {
422
+ composition?: {
423
+ url: string;
424
+ };
425
+ componentPattern?: {
426
+ url: string;
427
+ };
428
+ compositionDefaults?: {
429
+ url: string;
430
+ };
431
+ entry?: {
432
+ url: string;
433
+ };
434
+ entryPattern?: {
435
+ url: string;
436
+ };
437
+ };
374
438
  };
375
439
  dataConnectors?: {
376
440
  type: string;
@@ -403,6 +467,11 @@ interface paths$1 {
403
467
  assetLibrary?: {
404
468
  assetLibraryUrl: string;
405
469
  assetParameterUrl: string;
470
+ assetLibraryLocations?: {
471
+ [key: string]: {
472
+ url: string;
473
+ };
474
+ };
406
475
  unstable_dynamicAssets?: {
407
476
  dataConnectorId: string;
408
477
  assetsListArchetypeId: string;
@@ -731,94 +800,117 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
731
800
  upsert(body: Omit<IntegrationDefinitionPutParameters, 'teamId'>): Promise<{
732
801
  type: string;
733
802
  displayName: string;
734
- logoIconUrl?: string | undefined;
735
- badgeIconUrl?: string | undefined;
736
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown" | undefined;
737
- public?: boolean | undefined;
738
- scopes?: string[] | undefined;
739
- baseLocationUrl?: string | undefined;
803
+ logoIconUrl?: string;
804
+ badgeIconUrl?: string;
805
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
806
+ public?: boolean;
807
+ scopes?: string[];
808
+ baseLocationUrl?: string;
740
809
  locations: {
741
810
  install?: {
742
- description?: string[] | undefined;
743
- informationUrl?: string | undefined;
744
- canvasPackageUrl?: string | undefined;
745
- } | undefined;
811
+ description?: string[];
812
+ informationUrl?: string;
813
+ canvasPackageUrl?: string;
814
+ };
746
815
  settings?: {
747
816
  url: string;
748
817
  locations?: {
749
818
  [key: string]: {
750
819
  url: string;
751
820
  };
752
- } | undefined;
753
- } | undefined;
821
+ };
822
+ };
754
823
  canvas?: {
755
824
  parameterTypes: {
756
825
  type: string;
757
826
  displayName: string;
758
- configureUrl?: string | undefined;
827
+ configureUrl?: string;
759
828
  editorUrl: string;
760
829
  configurationLocations?: {
761
830
  [key: string]: {
762
831
  url: string;
763
832
  };
764
- } | undefined;
833
+ };
765
834
  editorLocations?: {
766
835
  [key: string]: {
767
836
  url: string;
768
837
  };
769
- } | undefined;
770
- renderableInPropertyPanel?: boolean | undefined;
771
- localizable?: "default-yes" | "default-no" | "yes" | "no" | undefined;
838
+ };
839
+ renderableInPropertyPanel?: boolean;
840
+ localizable?: "default-yes" | "default-no" | "yes" | "no";
841
+ allowedPlacement?: ("parameter" | "field")[];
772
842
  }[];
773
- } | undefined;
843
+ editorTools?: {
844
+ composition?: {
845
+ url: string;
846
+ };
847
+ componentPattern?: {
848
+ url: string;
849
+ };
850
+ compositionDefaults?: {
851
+ url: string;
852
+ };
853
+ entry?: {
854
+ url: string;
855
+ };
856
+ entryPattern?: {
857
+ url: string;
858
+ };
859
+ };
860
+ };
774
861
  dataConnectors?: {
775
862
  type: string;
776
863
  displayName: string;
777
- dataSourceEditorUrl?: string | undefined;
864
+ dataSourceEditorUrl?: string;
778
865
  dataSourceEditorLocations?: {
779
866
  [key: string]: {
780
867
  url: string;
781
868
  };
782
- } | undefined;
869
+ };
783
870
  dataArchetypes?: {
784
871
  [key: string]: {
785
872
  displayName: string;
786
- typeEditorUrl?: string | undefined;
873
+ typeEditorUrl?: string;
787
874
  typeEditorLocations?: {
788
875
  [key: string]: {
789
876
  url: string;
790
877
  };
791
- } | undefined;
792
- dataEditorUrl?: string | undefined;
878
+ };
879
+ dataEditorUrl?: string;
793
880
  dataEditorUrlLocations?: {
794
881
  [key: string]: {
795
882
  url: string;
796
883
  };
797
- } | undefined;
884
+ };
798
885
  };
799
- } | undefined;
800
- badgeIconUrl?: string | undefined;
801
- }[] | undefined;
886
+ };
887
+ badgeIconUrl?: string;
888
+ }[];
802
889
  assetLibrary?: {
803
890
  assetLibraryUrl: string;
804
891
  assetParameterUrl: string;
892
+ assetLibraryLocations?: {
893
+ [key: string]: {
894
+ url: string;
895
+ };
896
+ };
805
897
  unstable_dynamicAssets?: {
806
898
  dataConnectorId: string;
807
899
  assetsListArchetypeId: string;
808
900
  singleAssetArchetypeId: string;
809
- } | undefined;
810
- } | undefined;
901
+ };
902
+ };
811
903
  unstable_assetLibrary?: {
812
904
  url: string;
813
905
  dynamicAssets?: {
814
906
  dataConnectorId: string;
815
907
  assetsListArchetypeId: string;
816
908
  singleAssetArchetypeId: string;
817
- } | undefined;
818
- } | undefined;
909
+ };
910
+ };
819
911
  ai?: {
820
912
  generateUrl: string;
821
- metadataUrl?: string | undefined;
913
+ metadataUrl?: string;
822
914
  prompts?: {
823
915
  id: string;
824
916
  name: string;
@@ -827,20 +919,20 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
827
919
  arguments?: {
828
920
  [key: string]: {
829
921
  type: string;
830
- displayName?: string | null | undefined;
831
- helpText?: string | null | undefined;
832
- default?: string | null | undefined;
922
+ displayName?: string | null;
923
+ helpText?: string | null;
924
+ default?: string | null;
833
925
  };
834
- } | null | undefined;
835
- metadata?: unknown;
836
- } | null | undefined;
926
+ } | null;
927
+ metadata?: unknown | null;
928
+ } | null;
837
929
  parameterTypes: string[];
838
- }[] | undefined;
839
- } | undefined;
930
+ }[];
931
+ };
840
932
  unstable_ai?: {
841
933
  generateUrl: string;
842
- metadataUrl?: string | undefined;
843
- } | undefined;
934
+ metadataUrl?: string;
935
+ };
844
936
  };
845
937
  unstable_prompts?: {
846
938
  id: string;
@@ -850,15 +942,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
850
942
  arguments?: {
851
943
  [key: string]: {
852
944
  type: string;
853
- displayName?: string | null | undefined;
854
- helpText?: string | null | undefined;
855
- default?: string | null | undefined;
945
+ displayName?: string | null;
946
+ helpText?: string | null;
947
+ default?: string | null;
856
948
  };
857
- } | null | undefined;
858
- metadata?: unknown;
859
- } | null | undefined;
949
+ } | null;
950
+ metadata?: unknown | null;
951
+ } | null;
860
952
  parameterTypes: string[];
861
- }[] | undefined;
953
+ }[];
862
954
  }>;
863
955
  /** Deletes a mesh app from a team */
864
956
  remove(body: Omit<IntegrationDefinitionDeleteParameters, 'teamId'>): Promise<void>;
@@ -962,6 +1054,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
962
1054
  * Note that setValue() always sets the target language automatically.
963
1055
  */
964
1056
  targetLocale: string | undefined;
1057
+ /**
1058
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1059
+ * If this is -1, then the editor is not editing a conditional value.
1060
+ */
1061
+ targetConditionIndex: number;
965
1062
  }, TIntegrationConfiguration>;
966
1063
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
967
1064
  /**
@@ -971,14 +1068,16 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
971
1068
  editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
972
1069
  };
973
1070
 
974
- type SettingsLocationMetadata = CommonMetadata;
1071
+ type SettingsLocationMetadata = CommonMetadata & {
1072
+ locales: Locale[];
1073
+ };
975
1074
  type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsLocationMetadata, TSettingsType, 'settings'>;
976
1075
 
977
1076
  /**
978
1077
  * Defines methods used for interacting with a Mesh location
979
1078
  * To receive useful typings, check the `type` property of the location to narrow the typing.
980
1079
  */
981
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1080
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
982
1081
  interface MeshContextData {
983
1082
  locationKey: string;
984
1083
  locationType: MeshLocationTypes;
@@ -1139,9 +1238,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1139
1238
  * Imports the iframe communications library and provides an interface for interacting with
1140
1239
  * the parent window via said communications library.
1141
1240
  */
1142
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1241
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1143
1242
  dialogResponseHandlers: DialogResponseHandlers;
1144
1243
  onMetadataUpdated: (metadata: unknown) => void;
1244
+ onValueExternallyUpdated: (value: unknown) => void;
1145
1245
  }): Promise<{
1146
1246
  initData: MeshContextData;
1147
1247
  parent: {
@@ -1199,6 +1299,8 @@ type CommonMetadata<ExtendedMetadata = unknown, TIntegrationConfiguration = unkn
1199
1299
  user: UniformUser;
1200
1300
  /** Current Uniform Project ID */
1201
1301
  projectId: string;
1302
+ /** Current Uniform Dashboard URL origin. Can be useful to build links to the Uniform app */
1303
+ dashboardOrigin: string;
1202
1304
  /** Settings defined at the integration level (arbitrary type used on settings location) */
1203
1305
  settings: TIntegrationConfiguration;
1204
1306
  } & ExtendedMetadata;
@@ -1272,11 +1374,17 @@ type MeshLocationUserPermissions =
1272
1374
  /** UTM Mapper:Read|Read UTM mapper configuration */
1273
1375
  | 'UTM_MAPPER_READ'
1274
1376
  /** Uniform Canvas:Releases:Launch|Launch a release */
1275
- | 'RELEASES_LAUNCH';
1377
+ | 'RELEASES_LAUNCH'
1378
+ /** Uniform Canvas:Releases:Create */
1379
+ | 'RELEASES_CREATE'
1380
+ /** Uniform Canvas:Releases:Delete */
1381
+ | 'RELEASES_DELETE'
1382
+ /** Uniform Canvas:Releases:Update */
1383
+ | 'RELEASES_UPDATE';
1276
1384
  /**
1277
1385
  * Known location types that can be passed to a mesh location
1278
1386
  */
1279
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'aiMetadata';
1387
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'canvasEditorTools' | 'aiMetadata';
1280
1388
  type SetValueOptions = ValidationResult;
1281
1389
  type SetValueMessage = {
1282
1390
  uniformMeshLocationValue: unknown;
@@ -1315,6 +1423,28 @@ type PromptSettingsLocationMetadata<TIntegrationConfiguration = unknown> = Commo
1315
1423
  type AIGenerateLocation<TType> = MeshLocationCore<TType, AIGenerateLocationMetadata, TType, 'aiGenerate'>;
1316
1424
  type AIPromptMetadataLocation = MeshLocationCore<Record<string, unknown>, PromptSettingsLocationMetadata, Record<string, unknown>, 'aiMetadata'>;
1317
1425
 
1426
+ type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1427
+ releaseId?: string;
1428
+ state?: number;
1429
+ locales: Locale[];
1430
+ }, TIntegrationConfiguration>;
1431
+ type CanvasEditorToolsReferenceData = {
1432
+ name: string;
1433
+ };
1434
+ type CanvasEditorEntityType = 'composition' | 'componentPattern' | 'compositionDefaults' | 'entry' | 'entryPattern' | 'asset';
1435
+ type CanvasEditorToolsData = {
1436
+ patternNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
1437
+ entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
1438
+ entityType: CanvasEditorEntityType;
1439
+ } & ({
1440
+ rootEntity: RootComponentInstance;
1441
+ entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
1442
+ } | {
1443
+ rootEntity: EntryData;
1444
+ entityType: 'entry' | 'entryPattern';
1445
+ });
1446
+ type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
1447
+
1318
1448
  type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1319
1449
  /** The Uniform project ID */
1320
1450
  componentDefinition: ComponentDefinition;
@@ -1424,4 +1554,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
1424
1554
  */
1425
1555
  declare const hasRole: (role: string, user: UniformUser) => boolean;
1426
1556
 
1427
- export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, 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 };
1557
+ 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 };
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, DataVariableDefinition } from '@uniformdev/canvas';
3
+ import { AssetParamValue, DataType, DataSource, 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
 
@@ -30,7 +30,7 @@ interface paths$1 {
30
30
  logoIconUrl?: string;
31
31
  badgeIconUrl?: string;
32
32
  /** @enum {string} */
33
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown";
33
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
34
34
  public?: boolean;
35
35
  scopes?: string[];
36
36
  baseLocationUrl?: string;
@@ -67,7 +67,25 @@ 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
  }[];
72
+ editorTools?: {
73
+ composition?: {
74
+ url: string;
75
+ };
76
+ componentPattern?: {
77
+ url: string;
78
+ };
79
+ compositionDefaults?: {
80
+ url: string;
81
+ };
82
+ entry?: {
83
+ url: string;
84
+ };
85
+ entryPattern?: {
86
+ url: string;
87
+ };
88
+ };
71
89
  };
72
90
  dataConnectors?: {
73
91
  type: string;
@@ -100,6 +118,11 @@ interface paths$1 {
100
118
  assetLibrary?: {
101
119
  assetLibraryUrl: string;
102
120
  assetParameterUrl: string;
121
+ assetLibraryLocations?: {
122
+ [key: string]: {
123
+ url: string;
124
+ };
125
+ };
103
126
  unstable_dynamicAssets?: {
104
127
  dataConnectorId: string;
105
128
  assetsListArchetypeId: string;
@@ -182,7 +205,7 @@ interface paths$1 {
182
205
  logoIconUrl?: string;
183
206
  badgeIconUrl?: string;
184
207
  /** @enum {string} */
185
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown";
208
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
186
209
  public?: boolean;
187
210
  scopes?: string[];
188
211
  baseLocationUrl?: string;
@@ -219,7 +242,25 @@ interface paths$1 {
219
242
  renderableInPropertyPanel?: boolean;
220
243
  /** @enum {string} */
221
244
  localizable?: "default-yes" | "default-no" | "yes" | "no";
245
+ allowedPlacement?: ("parameter" | "field")[];
222
246
  }[];
247
+ editorTools?: {
248
+ composition?: {
249
+ url: string;
250
+ };
251
+ componentPattern?: {
252
+ url: string;
253
+ };
254
+ compositionDefaults?: {
255
+ url: string;
256
+ };
257
+ entry?: {
258
+ url: string;
259
+ };
260
+ entryPattern?: {
261
+ url: string;
262
+ };
263
+ };
223
264
  };
224
265
  dataConnectors?: {
225
266
  type: string;
@@ -252,6 +293,11 @@ interface paths$1 {
252
293
  assetLibrary?: {
253
294
  assetLibraryUrl: string;
254
295
  assetParameterUrl: string;
296
+ assetLibraryLocations?: {
297
+ [key: string]: {
298
+ url: string;
299
+ };
300
+ };
255
301
  unstable_dynamicAssets?: {
256
302
  dataConnectorId: string;
257
303
  assetsListArchetypeId: string;
@@ -334,7 +380,7 @@ interface paths$1 {
334
380
  logoIconUrl?: string;
335
381
  badgeIconUrl?: string;
336
382
  /** @enum {string} */
337
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown";
383
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
338
384
  scopes?: string[];
339
385
  baseLocationUrl?: string;
340
386
  locations: {
@@ -370,7 +416,25 @@ interface paths$1 {
370
416
  renderableInPropertyPanel?: boolean;
371
417
  /** @enum {string} */
372
418
  localizable?: "default-yes" | "default-no" | "yes" | "no";
419
+ allowedPlacement?: ("parameter" | "field")[];
373
420
  }[];
421
+ editorTools?: {
422
+ composition?: {
423
+ url: string;
424
+ };
425
+ componentPattern?: {
426
+ url: string;
427
+ };
428
+ compositionDefaults?: {
429
+ url: string;
430
+ };
431
+ entry?: {
432
+ url: string;
433
+ };
434
+ entryPattern?: {
435
+ url: string;
436
+ };
437
+ };
374
438
  };
375
439
  dataConnectors?: {
376
440
  type: string;
@@ -403,6 +467,11 @@ interface paths$1 {
403
467
  assetLibrary?: {
404
468
  assetLibraryUrl: string;
405
469
  assetParameterUrl: string;
470
+ assetLibraryLocations?: {
471
+ [key: string]: {
472
+ url: string;
473
+ };
474
+ };
406
475
  unstable_dynamicAssets?: {
407
476
  dataConnectorId: string;
408
477
  assetsListArchetypeId: string;
@@ -731,94 +800,117 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
731
800
  upsert(body: Omit<IntegrationDefinitionPutParameters, 'teamId'>): Promise<{
732
801
  type: string;
733
802
  displayName: string;
734
- logoIconUrl?: string | undefined;
735
- badgeIconUrl?: string | undefined;
736
- category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "uniform" | "ai" | "unknown" | undefined;
737
- public?: boolean | undefined;
738
- scopes?: string[] | undefined;
739
- baseLocationUrl?: string | undefined;
803
+ logoIconUrl?: string;
804
+ badgeIconUrl?: string;
805
+ category?: "analytics" | "cdn" | "classic" | "commerce" | "content" | "comingSoon" | "data" | "deprecated" | "email" | "framework" | "search" | "starters" | "translation" | "uniform" | "ai" | "unknown";
806
+ public?: boolean;
807
+ scopes?: string[];
808
+ baseLocationUrl?: string;
740
809
  locations: {
741
810
  install?: {
742
- description?: string[] | undefined;
743
- informationUrl?: string | undefined;
744
- canvasPackageUrl?: string | undefined;
745
- } | undefined;
811
+ description?: string[];
812
+ informationUrl?: string;
813
+ canvasPackageUrl?: string;
814
+ };
746
815
  settings?: {
747
816
  url: string;
748
817
  locations?: {
749
818
  [key: string]: {
750
819
  url: string;
751
820
  };
752
- } | undefined;
753
- } | undefined;
821
+ };
822
+ };
754
823
  canvas?: {
755
824
  parameterTypes: {
756
825
  type: string;
757
826
  displayName: string;
758
- configureUrl?: string | undefined;
827
+ configureUrl?: string;
759
828
  editorUrl: string;
760
829
  configurationLocations?: {
761
830
  [key: string]: {
762
831
  url: string;
763
832
  };
764
- } | undefined;
833
+ };
765
834
  editorLocations?: {
766
835
  [key: string]: {
767
836
  url: string;
768
837
  };
769
- } | undefined;
770
- renderableInPropertyPanel?: boolean | undefined;
771
- localizable?: "default-yes" | "default-no" | "yes" | "no" | undefined;
838
+ };
839
+ renderableInPropertyPanel?: boolean;
840
+ localizable?: "default-yes" | "default-no" | "yes" | "no";
841
+ allowedPlacement?: ("parameter" | "field")[];
772
842
  }[];
773
- } | undefined;
843
+ editorTools?: {
844
+ composition?: {
845
+ url: string;
846
+ };
847
+ componentPattern?: {
848
+ url: string;
849
+ };
850
+ compositionDefaults?: {
851
+ url: string;
852
+ };
853
+ entry?: {
854
+ url: string;
855
+ };
856
+ entryPattern?: {
857
+ url: string;
858
+ };
859
+ };
860
+ };
774
861
  dataConnectors?: {
775
862
  type: string;
776
863
  displayName: string;
777
- dataSourceEditorUrl?: string | undefined;
864
+ dataSourceEditorUrl?: string;
778
865
  dataSourceEditorLocations?: {
779
866
  [key: string]: {
780
867
  url: string;
781
868
  };
782
- } | undefined;
869
+ };
783
870
  dataArchetypes?: {
784
871
  [key: string]: {
785
872
  displayName: string;
786
- typeEditorUrl?: string | undefined;
873
+ typeEditorUrl?: string;
787
874
  typeEditorLocations?: {
788
875
  [key: string]: {
789
876
  url: string;
790
877
  };
791
- } | undefined;
792
- dataEditorUrl?: string | undefined;
878
+ };
879
+ dataEditorUrl?: string;
793
880
  dataEditorUrlLocations?: {
794
881
  [key: string]: {
795
882
  url: string;
796
883
  };
797
- } | undefined;
884
+ };
798
885
  };
799
- } | undefined;
800
- badgeIconUrl?: string | undefined;
801
- }[] | undefined;
886
+ };
887
+ badgeIconUrl?: string;
888
+ }[];
802
889
  assetLibrary?: {
803
890
  assetLibraryUrl: string;
804
891
  assetParameterUrl: string;
892
+ assetLibraryLocations?: {
893
+ [key: string]: {
894
+ url: string;
895
+ };
896
+ };
805
897
  unstable_dynamicAssets?: {
806
898
  dataConnectorId: string;
807
899
  assetsListArchetypeId: string;
808
900
  singleAssetArchetypeId: string;
809
- } | undefined;
810
- } | undefined;
901
+ };
902
+ };
811
903
  unstable_assetLibrary?: {
812
904
  url: string;
813
905
  dynamicAssets?: {
814
906
  dataConnectorId: string;
815
907
  assetsListArchetypeId: string;
816
908
  singleAssetArchetypeId: string;
817
- } | undefined;
818
- } | undefined;
909
+ };
910
+ };
819
911
  ai?: {
820
912
  generateUrl: string;
821
- metadataUrl?: string | undefined;
913
+ metadataUrl?: string;
822
914
  prompts?: {
823
915
  id: string;
824
916
  name: string;
@@ -827,20 +919,20 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
827
919
  arguments?: {
828
920
  [key: string]: {
829
921
  type: string;
830
- displayName?: string | null | undefined;
831
- helpText?: string | null | undefined;
832
- default?: string | null | undefined;
922
+ displayName?: string | null;
923
+ helpText?: string | null;
924
+ default?: string | null;
833
925
  };
834
- } | null | undefined;
835
- metadata?: unknown;
836
- } | null | undefined;
926
+ } | null;
927
+ metadata?: unknown | null;
928
+ } | null;
837
929
  parameterTypes: string[];
838
- }[] | undefined;
839
- } | undefined;
930
+ }[];
931
+ };
840
932
  unstable_ai?: {
841
933
  generateUrl: string;
842
- metadataUrl?: string | undefined;
843
- } | undefined;
934
+ metadataUrl?: string;
935
+ };
844
936
  };
845
937
  unstable_prompts?: {
846
938
  id: string;
@@ -850,15 +942,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
850
942
  arguments?: {
851
943
  [key: string]: {
852
944
  type: string;
853
- displayName?: string | null | undefined;
854
- helpText?: string | null | undefined;
855
- default?: string | null | undefined;
945
+ displayName?: string | null;
946
+ helpText?: string | null;
947
+ default?: string | null;
856
948
  };
857
- } | null | undefined;
858
- metadata?: unknown;
859
- } | null | undefined;
949
+ } | null;
950
+ metadata?: unknown | null;
951
+ } | null;
860
952
  parameterTypes: string[];
861
- }[] | undefined;
953
+ }[];
862
954
  }>;
863
955
  /** Deletes a mesh app from a team */
864
956
  remove(body: Omit<IntegrationDefinitionDeleteParameters, 'teamId'>): Promise<void>;
@@ -962,6 +1054,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
962
1054
  * Note that setValue() always sets the target language automatically.
963
1055
  */
964
1056
  targetLocale: string | undefined;
1057
+ /**
1058
+ * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1059
+ * If this is -1, then the editor is not editing a conditional value.
1060
+ */
1061
+ targetConditionIndex: number;
965
1062
  }, TIntegrationConfiguration>;
966
1063
  type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
967
1064
  /**
@@ -971,14 +1068,16 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
971
1068
  editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
972
1069
  };
973
1070
 
974
- type SettingsLocationMetadata = CommonMetadata;
1071
+ type SettingsLocationMetadata = CommonMetadata & {
1072
+ locales: Locale[];
1073
+ };
975
1074
  type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsLocationMetadata, TSettingsType, 'settings'>;
976
1075
 
977
1076
  /**
978
1077
  * Defines methods used for interacting with a Mesh location
979
1078
  * To receive useful typings, check the `type` property of the location to narrow the typing.
980
1079
  */
981
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1080
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
982
1081
  interface MeshContextData {
983
1082
  locationKey: string;
984
1083
  locationType: MeshLocationTypes;
@@ -1139,9 +1238,10 @@ type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent
1139
1238
  * Imports the iframe communications library and provides an interface for interacting with
1140
1239
  * the parent window via said communications library.
1141
1240
  */
1142
- declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }: {
1241
+ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, onValueExternallyUpdated, }: {
1143
1242
  dialogResponseHandlers: DialogResponseHandlers;
1144
1243
  onMetadataUpdated: (metadata: unknown) => void;
1244
+ onValueExternallyUpdated: (value: unknown) => void;
1145
1245
  }): Promise<{
1146
1246
  initData: MeshContextData;
1147
1247
  parent: {
@@ -1199,6 +1299,8 @@ type CommonMetadata<ExtendedMetadata = unknown, TIntegrationConfiguration = unkn
1199
1299
  user: UniformUser;
1200
1300
  /** Current Uniform Project ID */
1201
1301
  projectId: string;
1302
+ /** Current Uniform Dashboard URL origin. Can be useful to build links to the Uniform app */
1303
+ dashboardOrigin: string;
1202
1304
  /** Settings defined at the integration level (arbitrary type used on settings location) */
1203
1305
  settings: TIntegrationConfiguration;
1204
1306
  } & ExtendedMetadata;
@@ -1272,11 +1374,17 @@ type MeshLocationUserPermissions =
1272
1374
  /** UTM Mapper:Read|Read UTM mapper configuration */
1273
1375
  | 'UTM_MAPPER_READ'
1274
1376
  /** Uniform Canvas:Releases:Launch|Launch a release */
1275
- | 'RELEASES_LAUNCH';
1377
+ | 'RELEASES_LAUNCH'
1378
+ /** Uniform Canvas:Releases:Create */
1379
+ | 'RELEASES_CREATE'
1380
+ /** Uniform Canvas:Releases:Delete */
1381
+ | 'RELEASES_DELETE'
1382
+ /** Uniform Canvas:Releases:Update */
1383
+ | 'RELEASES_UPDATE';
1276
1384
  /**
1277
1385
  * Known location types that can be passed to a mesh location
1278
1386
  */
1279
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'aiMetadata';
1387
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'canvasEditorTools' | 'aiMetadata';
1280
1388
  type SetValueOptions = ValidationResult;
1281
1389
  type SetValueMessage = {
1282
1390
  uniformMeshLocationValue: unknown;
@@ -1315,6 +1423,28 @@ type PromptSettingsLocationMetadata<TIntegrationConfiguration = unknown> = Commo
1315
1423
  type AIGenerateLocation<TType> = MeshLocationCore<TType, AIGenerateLocationMetadata, TType, 'aiGenerate'>;
1316
1424
  type AIPromptMetadataLocation = MeshLocationCore<Record<string, unknown>, PromptSettingsLocationMetadata, Record<string, unknown>, 'aiMetadata'>;
1317
1425
 
1426
+ type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1427
+ releaseId?: string;
1428
+ state?: number;
1429
+ locales: Locale[];
1430
+ }, TIntegrationConfiguration>;
1431
+ type CanvasEditorToolsReferenceData = {
1432
+ name: string;
1433
+ };
1434
+ type CanvasEditorEntityType = 'composition' | 'componentPattern' | 'compositionDefaults' | 'entry' | 'entryPattern' | 'asset';
1435
+ type CanvasEditorToolsData = {
1436
+ patternNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
1437
+ entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
1438
+ entityType: CanvasEditorEntityType;
1439
+ } & ({
1440
+ rootEntity: RootComponentInstance;
1441
+ entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
1442
+ } | {
1443
+ rootEntity: EntryData;
1444
+ entityType: 'entry' | 'entryPattern';
1445
+ });
1446
+ type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
1447
+
1318
1448
  type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1319
1449
  /** The Uniform project ID */
1320
1450
  componentDefinition: ComponentDefinition;
@@ -1424,4 +1554,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
1424
1554
  */
1425
1555
  declare const hasRole: (role: string, user: UniformUser) => boolean;
1426
1556
 
1427
- export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, 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 };
1557
+ 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 };
package/dist/index.esm.js CHANGED
@@ -1,16 +1,9 @@
1
- var __accessCheck = (obj, member, msg) => {
2
- if (!member.has(obj))
3
- throw TypeError("Cannot " + msg);
4
- };
5
- var __privateGet = (obj, member, getter) => {
6
- __accessCheck(obj, member, "read from private field");
7
- return getter ? getter.call(obj) : member.get(obj);
8
- };
9
- var __privateAdd = (obj, member, value) => {
10
- if (member.has(obj))
11
- throw TypeError("Cannot add the same private member more than once");
12
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1
+ var __typeError = (msg) => {
2
+ throw TypeError(msg);
13
3
  };
4
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
6
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
14
7
 
15
8
  // src/clients/IntegrationDefinitionClient.ts
16
9
  import { ApiClient } from "@uniformdev/context/api";
@@ -119,6 +112,9 @@ var getLogger = (prefix, debug) => {
119
112
  }
120
113
  };
121
114
 
115
+ // src/temp/version.ts
116
+ var UNIFORM_MESH_SDK_VERSION = "19.185.0";
117
+
122
118
  // src/framepost/constants.ts
123
119
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
124
120
 
@@ -368,6 +364,7 @@ var SharedClient = class {
368
364
  const message = serialize({
369
365
  type,
370
366
  apiVersion: "framepost/v1" /* v1 */,
367
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
371
368
  key,
372
369
  data,
373
370
  id: randomInsecureId(),
@@ -409,6 +406,7 @@ var SharedClient = class {
409
406
  const message = serialize({
410
407
  type: "channel_init" /* CHANNEL_INIT */,
411
408
  apiVersion: "framepost/v1" /* v1 */,
409
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
412
410
  key: "",
413
411
  data: context,
414
412
  id: randomInsecureId()
@@ -452,7 +450,8 @@ var ChildClient = class extends SharedClient {
452
450
  // src/sdkComms.ts
453
451
  async function connectToParent({
454
452
  dialogResponseHandlers,
455
- onMetadataUpdated
453
+ onMetadataUpdated,
454
+ onValueExternallyUpdated
456
455
  }) {
457
456
  const client = new ChildClient({ debug: false });
458
457
  window.parent.postMessage("parents just don't understand", "*");
@@ -470,6 +469,7 @@ async function connectToParent({
470
469
  delete dialogResponseHandlers[data.dialogId];
471
470
  });
472
471
  client.onRequest("metadata-value", onMetadataUpdated);
472
+ client.onRequest("external-value-update", onValueExternallyUpdated);
473
473
  return {
474
474
  initData,
475
475
  parent: {
@@ -655,6 +655,10 @@ async function initializeUniformMeshSDK({
655
655
  console.debug("Received metadata update", newMeta);
656
656
  currentMetadata = typedNewMeta;
657
657
  events.emit("onMetadataChanged", { newValue: newMeta });
658
+ },
659
+ onValueExternallyUpdated: (newValue) => {
660
+ console.debug("Received external value update", newValue);
661
+ events.emit("onValueChanged", { newValue });
658
662
  }
659
663
  });
660
664
  const { initData: contextData, parent } = connectResult;
@@ -788,8 +792,7 @@ async function initializeUniformMeshSDK({
788
792
 
789
793
  // src/user.ts
790
794
  var hasPermissions = (permissions, user) => {
791
- if (user.isAdmin)
792
- return true;
795
+ if (user.isAdmin) return true;
793
796
  if (Array.isArray(permissions)) {
794
797
  return permissions.every((permission) => user.permissions.includes(permission));
795
798
  } else {
@@ -797,8 +800,7 @@ var hasPermissions = (permissions, user) => {
797
800
  }
798
801
  };
799
802
  var hasRole = (role, user) => {
800
- if (user.isAdmin)
801
- return true;
803
+ if (user.isAdmin) return true;
802
804
  return user.roles.some((userRole) => userRole.name === role || userRole.id === role);
803
805
  };
804
806
  export {
package/dist/index.js CHANGED
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __typeError = (msg) => {
9
+ throw TypeError(msg);
10
+ };
8
11
  var __export = (target, all) => {
9
12
  for (var name in all)
10
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,19 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
29
  mod
27
30
  ));
28
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var __accessCheck = (obj, member, msg) => {
30
- if (!member.has(obj))
31
- throw TypeError("Cannot " + msg);
32
- };
33
- var __privateGet = (obj, member, getter) => {
34
- __accessCheck(obj, member, "read from private field");
35
- return getter ? getter.call(obj) : member.get(obj);
36
- };
37
- var __privateAdd = (obj, member, value) => {
38
- if (member.has(obj))
39
- throw TypeError("Cannot add the same private member more than once");
40
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
41
- };
32
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
33
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
34
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
42
35
 
43
36
  // src/index.ts
44
37
  var src_exports = {};
@@ -158,6 +151,9 @@ var getLogger = (prefix, debug) => {
158
151
  }
159
152
  };
160
153
 
154
+ // src/temp/version.ts
155
+ var UNIFORM_MESH_SDK_VERSION = "19.185.0";
156
+
161
157
  // src/framepost/constants.ts
162
158
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
163
159
 
@@ -407,6 +403,7 @@ var SharedClient = class {
407
403
  const message = serialize({
408
404
  type,
409
405
  apiVersion: "framepost/v1" /* v1 */,
406
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
410
407
  key,
411
408
  data,
412
409
  id: randomInsecureId(),
@@ -448,6 +445,7 @@ var SharedClient = class {
448
445
  const message = serialize({
449
446
  type: "channel_init" /* CHANNEL_INIT */,
450
447
  apiVersion: "framepost/v1" /* v1 */,
448
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
451
449
  key: "",
452
450
  data: context,
453
451
  id: randomInsecureId()
@@ -491,7 +489,8 @@ var ChildClient = class extends SharedClient {
491
489
  // src/sdkComms.ts
492
490
  async function connectToParent({
493
491
  dialogResponseHandlers,
494
- onMetadataUpdated
492
+ onMetadataUpdated,
493
+ onValueExternallyUpdated
495
494
  }) {
496
495
  const client = new ChildClient({ debug: false });
497
496
  window.parent.postMessage("parents just don't understand", "*");
@@ -509,6 +508,7 @@ async function connectToParent({
509
508
  delete dialogResponseHandlers[data.dialogId];
510
509
  });
511
510
  client.onRequest("metadata-value", onMetadataUpdated);
511
+ client.onRequest("external-value-update", onValueExternallyUpdated);
512
512
  return {
513
513
  initData,
514
514
  parent: {
@@ -694,6 +694,10 @@ async function initializeUniformMeshSDK({
694
694
  console.debug("Received metadata update", newMeta);
695
695
  currentMetadata = typedNewMeta;
696
696
  events.emit("onMetadataChanged", { newValue: newMeta });
697
+ },
698
+ onValueExternallyUpdated: (newValue) => {
699
+ console.debug("Received external value update", newValue);
700
+ events.emit("onValueChanged", { newValue });
697
701
  }
698
702
  });
699
703
  const { initData: contextData, parent } = connectResult;
@@ -827,8 +831,7 @@ async function initializeUniformMeshSDK({
827
831
 
828
832
  // src/user.ts
829
833
  var hasPermissions = (permissions, user) => {
830
- if (user.isAdmin)
831
- return true;
834
+ if (user.isAdmin) return true;
832
835
  if (Array.isArray(permissions)) {
833
836
  return permissions.every((permission) => user.permissions.includes(permission));
834
837
  } else {
@@ -836,8 +839,7 @@ var hasPermissions = (permissions, user) => {
836
839
  }
837
840
  };
838
841
  var hasRole = (role, user) => {
839
- if (user.isAdmin)
840
- return true;
842
+ if (user.isAdmin) return true;
841
843
  return user.roles.some((userRole) => userRole.name === role || userRole.id === role);
842
844
  };
843
845
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -1,16 +1,9 @@
1
- var __accessCheck = (obj, member, msg) => {
2
- if (!member.has(obj))
3
- throw TypeError("Cannot " + msg);
4
- };
5
- var __privateGet = (obj, member, getter) => {
6
- __accessCheck(obj, member, "read from private field");
7
- return getter ? getter.call(obj) : member.get(obj);
8
- };
9
- var __privateAdd = (obj, member, value) => {
10
- if (member.has(obj))
11
- throw TypeError("Cannot add the same private member more than once");
12
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1
+ var __typeError = (msg) => {
2
+ throw TypeError(msg);
13
3
  };
4
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
6
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
14
7
 
15
8
  // src/clients/IntegrationDefinitionClient.ts
16
9
  import { ApiClient } from "@uniformdev/context/api";
@@ -119,6 +112,9 @@ var getLogger = (prefix, debug) => {
119
112
  }
120
113
  };
121
114
 
115
+ // src/temp/version.ts
116
+ var UNIFORM_MESH_SDK_VERSION = "19.185.0";
117
+
122
118
  // src/framepost/constants.ts
123
119
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
124
120
 
@@ -368,6 +364,7 @@ var SharedClient = class {
368
364
  const message = serialize({
369
365
  type,
370
366
  apiVersion: "framepost/v1" /* v1 */,
367
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
371
368
  key,
372
369
  data,
373
370
  id: randomInsecureId(),
@@ -409,6 +406,7 @@ var SharedClient = class {
409
406
  const message = serialize({
410
407
  type: "channel_init" /* CHANNEL_INIT */,
411
408
  apiVersion: "framepost/v1" /* v1 */,
409
+ sdkVersion: UNIFORM_MESH_SDK_VERSION,
412
410
  key: "",
413
411
  data: context,
414
412
  id: randomInsecureId()
@@ -452,7 +450,8 @@ var ChildClient = class extends SharedClient {
452
450
  // src/sdkComms.ts
453
451
  async function connectToParent({
454
452
  dialogResponseHandlers,
455
- onMetadataUpdated
453
+ onMetadataUpdated,
454
+ onValueExternallyUpdated
456
455
  }) {
457
456
  const client = new ChildClient({ debug: false });
458
457
  window.parent.postMessage("parents just don't understand", "*");
@@ -470,6 +469,7 @@ async function connectToParent({
470
469
  delete dialogResponseHandlers[data.dialogId];
471
470
  });
472
471
  client.onRequest("metadata-value", onMetadataUpdated);
472
+ client.onRequest("external-value-update", onValueExternallyUpdated);
473
473
  return {
474
474
  initData,
475
475
  parent: {
@@ -655,6 +655,10 @@ async function initializeUniformMeshSDK({
655
655
  console.debug("Received metadata update", newMeta);
656
656
  currentMetadata = typedNewMeta;
657
657
  events.emit("onMetadataChanged", { newValue: newMeta });
658
+ },
659
+ onValueExternallyUpdated: (newValue) => {
660
+ console.debug("Received external value update", newValue);
661
+ events.emit("onValueChanged", { newValue });
658
662
  }
659
663
  });
660
664
  const { initData: contextData, parent } = connectResult;
@@ -788,8 +792,7 @@ async function initializeUniformMeshSDK({
788
792
 
789
793
  // src/user.ts
790
794
  var hasPermissions = (permissions, user) => {
791
- if (user.isAdmin)
792
- return true;
795
+ if (user.isAdmin) return true;
793
796
  if (Array.isArray(permissions)) {
794
797
  return permissions.every((permission) => user.permissions.includes(permission));
795
798
  } else {
@@ -797,8 +800,7 @@ var hasPermissions = (permissions, user) => {
797
800
  }
798
801
  };
799
802
  var hasRole = (role, user) => {
800
- if (user.isAdmin)
801
- return true;
803
+ if (user.isAdmin) return true;
802
804
  return user.roles.some((userRole) => userRole.name === role || userRole.id === role);
803
805
  };
804
806
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk",
3
- "version": "19.135.0",
3
+ "version": "19.135.1-alpha.11+9f52e6cfd6",
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.135.0",
37
- "@uniformdev/context": "19.135.0",
38
- "@uniformdev/project-map": "19.135.0",
37
+ "@uniformdev/canvas": "19.135.1-alpha.11+9f52e6cfd6",
38
+ "@uniformdev/context": "19.135.1-alpha.11+9f52e6cfd6",
39
+ "@uniformdev/project-map": "19.135.1-alpha.11+9f52e6cfd6",
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": "741cd50843c92d550dbff2daffb3a6106a7a3f94"
46
+ "gitHead": "9f52e6cfd6e562e9c759735ba2a44378388a2a82"
46
47
  }