@uniformdev/mesh-sdk 20.7.1-alpha.4 → 20.7.1-alpha.45

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,7 +1,7 @@
1
1
  import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
2
- import { ProjectMapNode } from '@uniformdev/project-map';
3
- import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, Locale, DataVariableDefinition, EntryData } from '@uniformdev/canvas';
2
+ import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataVariableDefinition, Locale, EntryData } from '@uniformdev/canvas';
4
3
  export { AssetParamValue, AssetParamValueItem } from '@uniformdev/canvas';
4
+ import { ProjectMapNode } from '@uniformdev/project-map';
5
5
  import { AssetDefinitionType } from '@uniformdev/assets';
6
6
  import { Emitter } from 'mitt';
7
7
 
@@ -65,7 +65,7 @@ interface paths$1 {
65
65
  };
66
66
  };
67
67
  canvas?: {
68
- parameterTypes: {
68
+ parameterTypes?: {
69
69
  type: string;
70
70
  displayName: string;
71
71
  configureUrl?: string;
@@ -114,6 +114,15 @@ interface paths$1 {
114
114
  url: string;
115
115
  };
116
116
  };
117
+ personalization?: {
118
+ selectionAlgorithms?: {
119
+ [key: string]: {
120
+ displayName: string;
121
+ description?: string;
122
+ criteriaEditorUrl?: string;
123
+ };
124
+ };
125
+ };
117
126
  };
118
127
  dataConnectors?: {
119
128
  type: string;
@@ -224,15 +233,28 @@ interface paths$1 {
224
233
  definition: {
225
234
  name: string;
226
235
  description: string;
227
- parameters?: {
236
+ parameters: {
228
237
  [key: string]: unknown;
229
238
  };
239
+ strict: boolean;
230
240
  };
231
241
  systemParameters?: "pageHtml"[];
232
242
  includedAgents?: ("scout" | "sage")[];
233
243
  }[];
234
244
  };
235
245
  };
246
+ tools?: {
247
+ id: string;
248
+ name: string;
249
+ url: string;
250
+ iconUrl?: string;
251
+ }[];
252
+ projectTools?: {
253
+ id: string;
254
+ name: string;
255
+ url: string;
256
+ iconUrl?: string;
257
+ }[];
236
258
  };
237
259
  unstable_prompts?: {
238
260
  /** Format: uuid */
@@ -309,7 +331,7 @@ interface paths$1 {
309
331
  };
310
332
  };
311
333
  canvas?: {
312
- parameterTypes: {
334
+ parameterTypes?: {
313
335
  type: string;
314
336
  displayName: string;
315
337
  configureUrl?: string;
@@ -358,6 +380,15 @@ interface paths$1 {
358
380
  url: string;
359
381
  };
360
382
  };
383
+ personalization?: {
384
+ selectionAlgorithms?: {
385
+ [key: string]: {
386
+ displayName: string;
387
+ description?: string;
388
+ criteriaEditorUrl?: string;
389
+ };
390
+ };
391
+ };
361
392
  };
362
393
  dataConnectors?: {
363
394
  type: string;
@@ -468,15 +499,28 @@ interface paths$1 {
468
499
  definition: {
469
500
  name: string;
470
501
  description: string;
471
- parameters?: {
502
+ parameters: {
472
503
  [key: string]: unknown;
473
504
  };
505
+ strict: boolean;
474
506
  };
475
507
  systemParameters?: "pageHtml"[];
476
508
  includedAgents?: ("scout" | "sage")[];
477
509
  }[];
478
510
  };
479
511
  };
512
+ tools?: {
513
+ id: string;
514
+ name: string;
515
+ url: string;
516
+ iconUrl?: string;
517
+ }[];
518
+ projectTools?: {
519
+ id: string;
520
+ name: string;
521
+ url: string;
522
+ iconUrl?: string;
523
+ }[];
480
524
  };
481
525
  unstable_prompts?: {
482
526
  /** Format: uuid */
@@ -538,7 +582,7 @@ interface paths$1 {
538
582
  };
539
583
  };
540
584
  canvas?: {
541
- parameterTypes: {
585
+ parameterTypes?: {
542
586
  type: string;
543
587
  displayName: string;
544
588
  configureUrl?: string;
@@ -587,6 +631,15 @@ interface paths$1 {
587
631
  url: string;
588
632
  };
589
633
  };
634
+ personalization?: {
635
+ selectionAlgorithms?: {
636
+ [key: string]: {
637
+ displayName: string;
638
+ description?: string;
639
+ criteriaEditorUrl?: string;
640
+ };
641
+ };
642
+ };
590
643
  };
591
644
  dataConnectors?: {
592
645
  type: string;
@@ -697,15 +750,28 @@ interface paths$1 {
697
750
  definition: {
698
751
  name: string;
699
752
  description: string;
700
- parameters?: {
753
+ parameters: {
701
754
  [key: string]: unknown;
702
755
  };
756
+ strict: boolean;
703
757
  };
704
758
  systemParameters?: "pageHtml"[];
705
759
  includedAgents?: ("scout" | "sage")[];
706
760
  }[];
707
761
  };
708
762
  };
763
+ tools?: {
764
+ id: string;
765
+ name: string;
766
+ url: string;
767
+ iconUrl?: string;
768
+ }[];
769
+ projectTools?: {
770
+ id: string;
771
+ name: string;
772
+ url: string;
773
+ iconUrl?: string;
774
+ }[];
709
775
  };
710
776
  unstable_prompts?: {
711
777
  /** Format: uuid */
@@ -1130,7 +1196,7 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1130
1196
  };
1131
1197
  };
1132
1198
  canvas?: {
1133
- parameterTypes: {
1199
+ parameterTypes?: {
1134
1200
  type: string;
1135
1201
  displayName: string;
1136
1202
  configureUrl?: string;
@@ -1174,6 +1240,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1174
1240
  url: string;
1175
1241
  };
1176
1242
  };
1243
+ personalization?: {
1244
+ selectionAlgorithms?: {
1245
+ [key: string]: {
1246
+ displayName: string;
1247
+ description?: string;
1248
+ criteriaEditorUrl?: string;
1249
+ };
1250
+ };
1251
+ };
1177
1252
  };
1178
1253
  dataConnectors?: {
1179
1254
  type: string;
@@ -1275,15 +1350,28 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1275
1350
  definition: {
1276
1351
  name: string;
1277
1352
  description: string;
1278
- parameters?: {
1353
+ parameters: {
1279
1354
  [key: string]: unknown;
1280
1355
  };
1356
+ strict: boolean;
1281
1357
  };
1282
1358
  systemParameters?: "pageHtml"[];
1283
1359
  includedAgents?: ("scout" | "sage")[];
1284
1360
  }[];
1285
1361
  };
1286
1362
  };
1363
+ tools?: {
1364
+ id: string;
1365
+ name: string;
1366
+ url: string;
1367
+ iconUrl?: string;
1368
+ }[];
1369
+ projectTools?: {
1370
+ id: string;
1371
+ name: string;
1372
+ url: string;
1373
+ iconUrl?: string;
1374
+ }[];
1287
1375
  };
1288
1376
  unstable_prompts?: {
1289
1377
  id: string;
@@ -1352,7 +1440,11 @@ type FunctionCallSystemParameter = (typeof functionCallSystemParameters)[number]
1352
1440
  declare function parseFunctionCall<Parameters extends Record<string, string>, Settings = Record<string, string>>(request: Pick<Request, 'body'>): {
1353
1441
  functionCall: {
1354
1442
  arguments: Parameters;
1443
+ call_id: string;
1355
1444
  name: string;
1445
+ type: "function_call";
1446
+ id?: string;
1447
+ status?: "in_progress" | "completed" | "incomplete";
1356
1448
  };
1357
1449
  settings: Settings;
1358
1450
  systemParameters: Record<FunctionCallSystemParameter, string | undefined>;
@@ -1468,16 +1560,14 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
1468
1560
  editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
1469
1561
  };
1470
1562
 
1471
- type SettingsLocationMetadata = CommonMetadata & {
1472
- locales: Locale[];
1473
- };
1563
+ type SettingsLocationMetadata = CommonMetadata;
1474
1564
  type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsLocationMetadata, TSettingsType, 'settings'>;
1475
1565
 
1476
1566
  /**
1477
1567
  * Defines methods used for interacting with a Mesh location
1478
1568
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1479
1569
  */
1480
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1570
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | ProjectToolLocation<TValue>;
1481
1571
  interface MeshContextData {
1482
1572
  locationKey: string;
1483
1573
  locationType: MeshLocationTypes;
@@ -1486,6 +1576,7 @@ interface MeshContextData {
1486
1576
  locationMetadata: any;
1487
1577
  uniformApiVersion: string;
1488
1578
  dialogContext?: DialogContext;
1579
+ fullScreenHeight?: boolean;
1489
1580
  }
1490
1581
  interface DialogContext {
1491
1582
  dialogId: string;
@@ -1584,6 +1675,13 @@ type OpenDialogMessage = {
1584
1675
  dialogData: unknown;
1585
1676
  options?: DialogOptions;
1586
1677
  };
1678
+ type NavigateMessage = {
1679
+ path: string;
1680
+ options?: {
1681
+ projectId?: string;
1682
+ target?: '_blank';
1683
+ };
1684
+ };
1587
1685
  type CloseDialogMessage = {
1588
1686
  dialogId: string | undefined;
1589
1687
  dialogType: DialogType;
@@ -1658,6 +1756,8 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
1658
1756
  openDialog: (message: OpenDialogMessage) => Promise<Pick<DialogResponseData, "value" | "dialogId"> | undefined>;
1659
1757
  closeDialog: (message: CloseDialogMessage) => Promise<void>;
1660
1758
  getDataResource: <TExpectedResult>(message: GetDataResourceMessage) => Promise<TExpectedResult>;
1759
+ navigate: (message: NavigateMessage) => Promise<void>;
1760
+ reloadLocation: () => Promise<void>;
1661
1761
  editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
1662
1762
  };
1663
1763
  }>;
@@ -1682,6 +1782,10 @@ interface MeshLocationCore<TValue = unknown, TMetadata = unknown, TSetValue = TV
1682
1782
  * Each location has a specific type of metadata that it is provided, which is typed automatically when the location is known.
1683
1783
  */
1684
1784
  metadata: TMetadata;
1785
+ /**
1786
+ * A router object that can be used to navigate parent frame (Uniform App) to other page within current project and other methods.
1787
+ */
1788
+ router: MeshRouter;
1685
1789
  /**
1686
1790
  * Context of a location when it is rendering inside a dialog in the Uniform app.
1687
1791
  * This is set when:
@@ -1699,6 +1803,23 @@ interface MeshLocationCore<TValue = unknown, TMetadata = unknown, TSetValue = TV
1699
1803
  returnDialogValue: (value: unknown) => Promise<void>;
1700
1804
  };
1701
1805
  }
1806
+ type MeshRouter = {
1807
+ /**
1808
+ * Navigate parent frame (Uniform App) to a new path within current project.
1809
+ *
1810
+ * So router.navigate('/canvas/edit/{compositionId}') will navigate will open the composition editor for the given composition ID in the parent frame.
1811
+ * Be aware that most of the time it will close your mesh app, so you should use it with caution.
1812
+ *
1813
+ * @param path - The path to navigate to. You don't need to specify /projects/${projectId} as it is prepended automatically with the current project ID.
1814
+ * @param options - The options for the navigation.
1815
+ * @param options.projectId - You can specify project ID to navigate to. By default the current project ID is used.
1816
+ * @param options.target - Allows to open a new tab instead of navigating the current one.
1817
+ */
1818
+ navigatePlatform: (path: string, options?: {
1819
+ projectId?: string;
1820
+ target?: '_blank';
1821
+ }) => void;
1822
+ };
1702
1823
  /** Common metadata for all mesh locations */
1703
1824
  type CommonMetadata<ExtendedMetadata = unknown, TIntegrationConfiguration = unknown> = {
1704
1825
  /** The current Uniform user context. Contains name, email and context to check for permissions */
@@ -1709,6 +1830,8 @@ type CommonMetadata<ExtendedMetadata = unknown, TIntegrationConfiguration = unkn
1709
1830
  dashboardOrigin: string;
1710
1831
  /** Settings defined at the integration level (arbitrary type used on settings location) */
1711
1832
  settings: TIntegrationConfiguration;
1833
+ /** List if enabled Uniform Project locales */
1834
+ locales: Locale[];
1712
1835
  } & ExtendedMetadata;
1713
1836
  type MeshLocationUserPermissions =
1714
1837
  /** Uniform Context:Enrichments:Create */
@@ -1777,6 +1900,10 @@ type MeshLocationUserPermissions =
1777
1900
  | 'COMPOSITIONS_READ_DRAFT'
1778
1901
  /** Uniform Canvas:Component Library:Manage|Create, update, and delete component library data */
1779
1902
  | 'COMPOSITIONS_MANAGE_SCHEMA'
1903
+ /** Uniform Canvas:Content Types:Manage|Create, update, and delete content types */
1904
+ | 'ENTRIES_MANAGE_SCHEMA'
1905
+ /** Uniform Canvas:AI Prompts:Manage|Create, update, and delete AI prompts */
1906
+ | 'PROMPTS_MANAGE_SCHEMA'
1780
1907
  /** UTM Mapper:Read|Read UTM mapper configuration */
1781
1908
  | 'UTM_MAPPER_READ'
1782
1909
  /** UTM Mapper:Read|Create, update and delete UTM mapper configuration */
@@ -1792,7 +1919,7 @@ type MeshLocationUserPermissions =
1792
1919
  /**
1793
1920
  * Known location types that can be passed to a mesh location
1794
1921
  */
1795
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata';
1922
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'projectTool';
1796
1923
  type SetValueOptions = ValidationResult;
1797
1924
  type SetValueMessage = {
1798
1925
  uniformMeshLocationValue: unknown;
@@ -1834,7 +1961,6 @@ type AIPromptMetadataLocation = MeshLocationCore<Record<string, unknown>, Prompt
1834
1961
  type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1835
1962
  releaseId?: string;
1836
1963
  state?: number;
1837
- locales: Locale[];
1838
1964
  }, TIntegrationConfiguration>;
1839
1965
  type CanvasEditorToolsReferenceData = {
1840
1966
  name: string;
@@ -1908,6 +2034,14 @@ type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = Comm
1908
2034
  }, TIntegrationConfiguration>;
1909
2035
  type ParamTypeConfigLocation<TParamValue = unknown, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeConfigLocationMetadata<TIntegrationConfiguration>, TParamValue, 'paramTypeConfig'>;
1910
2036
 
2037
+ /** @deprecated Experimental functionality is subject to change in minor versions. */
2038
+ type PersonalizationCriteriaLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
2039
+ /** @deprecated Experimental functionality is subject to change in minor versions. */
2040
+ type PersonalizationCriteriaLocation<TCriteriaValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TCriteriaValue | undefined, PersonalizationCriteriaLocationMetadata<TIntegrationConfiguration>, TCriteriaValue, 'personalizationCriteria'>;
2041
+
2042
+ type ProjectToolLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
2043
+ type ProjectToolLocation<TTool, TIntegrationConfiguration = unknown> = MeshLocationCore<TTool, ProjectToolLocationMetadata<TIntegrationConfiguration>, TTool, 'projectTool'>;
2044
+
1911
2045
  interface SdkWindow {
1912
2046
  /** The current window object. */
1913
2047
  instance: Window;
@@ -2011,4 +2145,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
2011
2145
  */
2012
2146
  declare const hasRole: (role: string, user: UniformUser) => boolean;
2013
2147
 
2014
- 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 EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, 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, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
2148
+ 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 EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, 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 MeshRouter, type MeshSDKEventInterface, type NavigateMessage, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PersonalizationCriteriaLocation, type PersonalizationCriteriaLocationMetadata, type ProjectToolLocation, type ProjectToolLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
2
- import { ProjectMapNode } from '@uniformdev/project-map';
3
- import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, Locale, DataVariableDefinition, EntryData } from '@uniformdev/canvas';
2
+ import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataVariableDefinition, Locale, EntryData } from '@uniformdev/canvas';
4
3
  export { AssetParamValue, AssetParamValueItem } from '@uniformdev/canvas';
4
+ import { ProjectMapNode } from '@uniformdev/project-map';
5
5
  import { AssetDefinitionType } from '@uniformdev/assets';
6
6
  import { Emitter } from 'mitt';
7
7
 
@@ -65,7 +65,7 @@ interface paths$1 {
65
65
  };
66
66
  };
67
67
  canvas?: {
68
- parameterTypes: {
68
+ parameterTypes?: {
69
69
  type: string;
70
70
  displayName: string;
71
71
  configureUrl?: string;
@@ -114,6 +114,15 @@ interface paths$1 {
114
114
  url: string;
115
115
  };
116
116
  };
117
+ personalization?: {
118
+ selectionAlgorithms?: {
119
+ [key: string]: {
120
+ displayName: string;
121
+ description?: string;
122
+ criteriaEditorUrl?: string;
123
+ };
124
+ };
125
+ };
117
126
  };
118
127
  dataConnectors?: {
119
128
  type: string;
@@ -224,15 +233,28 @@ interface paths$1 {
224
233
  definition: {
225
234
  name: string;
226
235
  description: string;
227
- parameters?: {
236
+ parameters: {
228
237
  [key: string]: unknown;
229
238
  };
239
+ strict: boolean;
230
240
  };
231
241
  systemParameters?: "pageHtml"[];
232
242
  includedAgents?: ("scout" | "sage")[];
233
243
  }[];
234
244
  };
235
245
  };
246
+ tools?: {
247
+ id: string;
248
+ name: string;
249
+ url: string;
250
+ iconUrl?: string;
251
+ }[];
252
+ projectTools?: {
253
+ id: string;
254
+ name: string;
255
+ url: string;
256
+ iconUrl?: string;
257
+ }[];
236
258
  };
237
259
  unstable_prompts?: {
238
260
  /** Format: uuid */
@@ -309,7 +331,7 @@ interface paths$1 {
309
331
  };
310
332
  };
311
333
  canvas?: {
312
- parameterTypes: {
334
+ parameterTypes?: {
313
335
  type: string;
314
336
  displayName: string;
315
337
  configureUrl?: string;
@@ -358,6 +380,15 @@ interface paths$1 {
358
380
  url: string;
359
381
  };
360
382
  };
383
+ personalization?: {
384
+ selectionAlgorithms?: {
385
+ [key: string]: {
386
+ displayName: string;
387
+ description?: string;
388
+ criteriaEditorUrl?: string;
389
+ };
390
+ };
391
+ };
361
392
  };
362
393
  dataConnectors?: {
363
394
  type: string;
@@ -468,15 +499,28 @@ interface paths$1 {
468
499
  definition: {
469
500
  name: string;
470
501
  description: string;
471
- parameters?: {
502
+ parameters: {
472
503
  [key: string]: unknown;
473
504
  };
505
+ strict: boolean;
474
506
  };
475
507
  systemParameters?: "pageHtml"[];
476
508
  includedAgents?: ("scout" | "sage")[];
477
509
  }[];
478
510
  };
479
511
  };
512
+ tools?: {
513
+ id: string;
514
+ name: string;
515
+ url: string;
516
+ iconUrl?: string;
517
+ }[];
518
+ projectTools?: {
519
+ id: string;
520
+ name: string;
521
+ url: string;
522
+ iconUrl?: string;
523
+ }[];
480
524
  };
481
525
  unstable_prompts?: {
482
526
  /** Format: uuid */
@@ -538,7 +582,7 @@ interface paths$1 {
538
582
  };
539
583
  };
540
584
  canvas?: {
541
- parameterTypes: {
585
+ parameterTypes?: {
542
586
  type: string;
543
587
  displayName: string;
544
588
  configureUrl?: string;
@@ -587,6 +631,15 @@ interface paths$1 {
587
631
  url: string;
588
632
  };
589
633
  };
634
+ personalization?: {
635
+ selectionAlgorithms?: {
636
+ [key: string]: {
637
+ displayName: string;
638
+ description?: string;
639
+ criteriaEditorUrl?: string;
640
+ };
641
+ };
642
+ };
590
643
  };
591
644
  dataConnectors?: {
592
645
  type: string;
@@ -697,15 +750,28 @@ interface paths$1 {
697
750
  definition: {
698
751
  name: string;
699
752
  description: string;
700
- parameters?: {
753
+ parameters: {
701
754
  [key: string]: unknown;
702
755
  };
756
+ strict: boolean;
703
757
  };
704
758
  systemParameters?: "pageHtml"[];
705
759
  includedAgents?: ("scout" | "sage")[];
706
760
  }[];
707
761
  };
708
762
  };
763
+ tools?: {
764
+ id: string;
765
+ name: string;
766
+ url: string;
767
+ iconUrl?: string;
768
+ }[];
769
+ projectTools?: {
770
+ id: string;
771
+ name: string;
772
+ url: string;
773
+ iconUrl?: string;
774
+ }[];
709
775
  };
710
776
  unstable_prompts?: {
711
777
  /** Format: uuid */
@@ -1130,7 +1196,7 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1130
1196
  };
1131
1197
  };
1132
1198
  canvas?: {
1133
- parameterTypes: {
1199
+ parameterTypes?: {
1134
1200
  type: string;
1135
1201
  displayName: string;
1136
1202
  configureUrl?: string;
@@ -1174,6 +1240,15 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1174
1240
  url: string;
1175
1241
  };
1176
1242
  };
1243
+ personalization?: {
1244
+ selectionAlgorithms?: {
1245
+ [key: string]: {
1246
+ displayName: string;
1247
+ description?: string;
1248
+ criteriaEditorUrl?: string;
1249
+ };
1250
+ };
1251
+ };
1177
1252
  };
1178
1253
  dataConnectors?: {
1179
1254
  type: string;
@@ -1275,15 +1350,28 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1275
1350
  definition: {
1276
1351
  name: string;
1277
1352
  description: string;
1278
- parameters?: {
1353
+ parameters: {
1279
1354
  [key: string]: unknown;
1280
1355
  };
1356
+ strict: boolean;
1281
1357
  };
1282
1358
  systemParameters?: "pageHtml"[];
1283
1359
  includedAgents?: ("scout" | "sage")[];
1284
1360
  }[];
1285
1361
  };
1286
1362
  };
1363
+ tools?: {
1364
+ id: string;
1365
+ name: string;
1366
+ url: string;
1367
+ iconUrl?: string;
1368
+ }[];
1369
+ projectTools?: {
1370
+ id: string;
1371
+ name: string;
1372
+ url: string;
1373
+ iconUrl?: string;
1374
+ }[];
1287
1375
  };
1288
1376
  unstable_prompts?: {
1289
1377
  id: string;
@@ -1352,7 +1440,11 @@ type FunctionCallSystemParameter = (typeof functionCallSystemParameters)[number]
1352
1440
  declare function parseFunctionCall<Parameters extends Record<string, string>, Settings = Record<string, string>>(request: Pick<Request, 'body'>): {
1353
1441
  functionCall: {
1354
1442
  arguments: Parameters;
1443
+ call_id: string;
1355
1444
  name: string;
1445
+ type: "function_call";
1446
+ id?: string;
1447
+ status?: "in_progress" | "completed" | "incomplete";
1356
1448
  };
1357
1449
  settings: Settings;
1358
1450
  systemParameters: Record<FunctionCallSystemParameter, string | undefined>;
@@ -1468,16 +1560,14 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
1468
1560
  editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
1469
1561
  };
1470
1562
 
1471
- type SettingsLocationMetadata = CommonMetadata & {
1472
- locales: Locale[];
1473
- };
1563
+ type SettingsLocationMetadata = CommonMetadata;
1474
1564
  type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsLocationMetadata, TSettingsType, 'settings'>;
1475
1565
 
1476
1566
  /**
1477
1567
  * Defines methods used for interacting with a Mesh location
1478
1568
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1479
1569
  */
1480
- type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation;
1570
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | ProjectToolLocation<TValue>;
1481
1571
  interface MeshContextData {
1482
1572
  locationKey: string;
1483
1573
  locationType: MeshLocationTypes;
@@ -1486,6 +1576,7 @@ interface MeshContextData {
1486
1576
  locationMetadata: any;
1487
1577
  uniformApiVersion: string;
1488
1578
  dialogContext?: DialogContext;
1579
+ fullScreenHeight?: boolean;
1489
1580
  }
1490
1581
  interface DialogContext {
1491
1582
  dialogId: string;
@@ -1584,6 +1675,13 @@ type OpenDialogMessage = {
1584
1675
  dialogData: unknown;
1585
1676
  options?: DialogOptions;
1586
1677
  };
1678
+ type NavigateMessage = {
1679
+ path: string;
1680
+ options?: {
1681
+ projectId?: string;
1682
+ target?: '_blank';
1683
+ };
1684
+ };
1587
1685
  type CloseDialogMessage = {
1588
1686
  dialogId: string | undefined;
1589
1687
  dialogType: DialogType;
@@ -1658,6 +1756,8 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
1658
1756
  openDialog: (message: OpenDialogMessage) => Promise<Pick<DialogResponseData, "value" | "dialogId"> | undefined>;
1659
1757
  closeDialog: (message: CloseDialogMessage) => Promise<void>;
1660
1758
  getDataResource: <TExpectedResult>(message: GetDataResourceMessage) => Promise<TExpectedResult>;
1759
+ navigate: (message: NavigateMessage) => Promise<void>;
1760
+ reloadLocation: () => Promise<void>;
1661
1761
  editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
1662
1762
  };
1663
1763
  }>;
@@ -1682,6 +1782,10 @@ interface MeshLocationCore<TValue = unknown, TMetadata = unknown, TSetValue = TV
1682
1782
  * Each location has a specific type of metadata that it is provided, which is typed automatically when the location is known.
1683
1783
  */
1684
1784
  metadata: TMetadata;
1785
+ /**
1786
+ * A router object that can be used to navigate parent frame (Uniform App) to other page within current project and other methods.
1787
+ */
1788
+ router: MeshRouter;
1685
1789
  /**
1686
1790
  * Context of a location when it is rendering inside a dialog in the Uniform app.
1687
1791
  * This is set when:
@@ -1699,6 +1803,23 @@ interface MeshLocationCore<TValue = unknown, TMetadata = unknown, TSetValue = TV
1699
1803
  returnDialogValue: (value: unknown) => Promise<void>;
1700
1804
  };
1701
1805
  }
1806
+ type MeshRouter = {
1807
+ /**
1808
+ * Navigate parent frame (Uniform App) to a new path within current project.
1809
+ *
1810
+ * So router.navigate('/canvas/edit/{compositionId}') will navigate will open the composition editor for the given composition ID in the parent frame.
1811
+ * Be aware that most of the time it will close your mesh app, so you should use it with caution.
1812
+ *
1813
+ * @param path - The path to navigate to. You don't need to specify /projects/${projectId} as it is prepended automatically with the current project ID.
1814
+ * @param options - The options for the navigation.
1815
+ * @param options.projectId - You can specify project ID to navigate to. By default the current project ID is used.
1816
+ * @param options.target - Allows to open a new tab instead of navigating the current one.
1817
+ */
1818
+ navigatePlatform: (path: string, options?: {
1819
+ projectId?: string;
1820
+ target?: '_blank';
1821
+ }) => void;
1822
+ };
1702
1823
  /** Common metadata for all mesh locations */
1703
1824
  type CommonMetadata<ExtendedMetadata = unknown, TIntegrationConfiguration = unknown> = {
1704
1825
  /** The current Uniform user context. Contains name, email and context to check for permissions */
@@ -1709,6 +1830,8 @@ type CommonMetadata<ExtendedMetadata = unknown, TIntegrationConfiguration = unkn
1709
1830
  dashboardOrigin: string;
1710
1831
  /** Settings defined at the integration level (arbitrary type used on settings location) */
1711
1832
  settings: TIntegrationConfiguration;
1833
+ /** List if enabled Uniform Project locales */
1834
+ locales: Locale[];
1712
1835
  } & ExtendedMetadata;
1713
1836
  type MeshLocationUserPermissions =
1714
1837
  /** Uniform Context:Enrichments:Create */
@@ -1777,6 +1900,10 @@ type MeshLocationUserPermissions =
1777
1900
  | 'COMPOSITIONS_READ_DRAFT'
1778
1901
  /** Uniform Canvas:Component Library:Manage|Create, update, and delete component library data */
1779
1902
  | 'COMPOSITIONS_MANAGE_SCHEMA'
1903
+ /** Uniform Canvas:Content Types:Manage|Create, update, and delete content types */
1904
+ | 'ENTRIES_MANAGE_SCHEMA'
1905
+ /** Uniform Canvas:AI Prompts:Manage|Create, update, and delete AI prompts */
1906
+ | 'PROMPTS_MANAGE_SCHEMA'
1780
1907
  /** UTM Mapper:Read|Read UTM mapper configuration */
1781
1908
  | 'UTM_MAPPER_READ'
1782
1909
  /** UTM Mapper:Read|Create, update and delete UTM mapper configuration */
@@ -1792,7 +1919,7 @@ type MeshLocationUserPermissions =
1792
1919
  /**
1793
1920
  * Known location types that can be passed to a mesh location
1794
1921
  */
1795
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata';
1922
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'projectTool';
1796
1923
  type SetValueOptions = ValidationResult;
1797
1924
  type SetValueMessage = {
1798
1925
  uniformMeshLocationValue: unknown;
@@ -1834,7 +1961,6 @@ type AIPromptMetadataLocation = MeshLocationCore<Record<string, unknown>, Prompt
1834
1961
  type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1835
1962
  releaseId?: string;
1836
1963
  state?: number;
1837
- locales: Locale[];
1838
1964
  }, TIntegrationConfiguration>;
1839
1965
  type CanvasEditorToolsReferenceData = {
1840
1966
  name: string;
@@ -1908,6 +2034,14 @@ type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = Comm
1908
2034
  }, TIntegrationConfiguration>;
1909
2035
  type ParamTypeConfigLocation<TParamValue = unknown, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeConfigLocationMetadata<TIntegrationConfiguration>, TParamValue, 'paramTypeConfig'>;
1910
2036
 
2037
+ /** @deprecated Experimental functionality is subject to change in minor versions. */
2038
+ type PersonalizationCriteriaLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
2039
+ /** @deprecated Experimental functionality is subject to change in minor versions. */
2040
+ type PersonalizationCriteriaLocation<TCriteriaValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TCriteriaValue | undefined, PersonalizationCriteriaLocationMetadata<TIntegrationConfiguration>, TCriteriaValue, 'personalizationCriteria'>;
2041
+
2042
+ type ProjectToolLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<unknown, TIntegrationConfiguration>;
2043
+ type ProjectToolLocation<TTool, TIntegrationConfiguration = unknown> = MeshLocationCore<TTool, ProjectToolLocationMetadata<TIntegrationConfiguration>, TTool, 'projectTool'>;
2044
+
1911
2045
  interface SdkWindow {
1912
2046
  /** The current window object. */
1913
2047
  instance: Window;
@@ -2011,4 +2145,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
2011
2145
  */
2012
2146
  declare const hasRole: (role: string, user: UniformUser) => boolean;
2013
2147
 
2014
- 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 EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, 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, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
2148
+ 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 EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, 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 MeshRouter, type MeshSDKEventInterface, type NavigateMessage, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PersonalizationCriteriaLocation, type PersonalizationCriteriaLocationMetadata, type ProjectToolLocation, type ProjectToolLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
package/dist/index.esm.js CHANGED
@@ -131,7 +131,7 @@ var getLogger = (prefix, debug) => {
131
131
  };
132
132
 
133
133
  // src/temp/version.ts
134
- var UNIFORM_MESH_SDK_VERSION = "20.7.0";
134
+ var UNIFORM_MESH_SDK_VERSION = "20.18.0";
135
135
 
136
136
  // src/framepost/constants.ts
137
137
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
@@ -518,6 +518,12 @@ async function connectToParent({
518
518
  timeout: 3e4
519
519
  });
520
520
  },
521
+ navigate: async (message) => {
522
+ await client.request("navigate", message);
523
+ },
524
+ reloadLocation: async () => {
525
+ await client.request("reload");
526
+ },
521
527
  editConnectedData: async (message) => {
522
528
  return await client.request(
523
529
  "editConnectedData",
@@ -546,9 +552,11 @@ var createSdkWindow = ({
546
552
  }
547
553
  const windowInstance = window;
548
554
  const updateHeight = (height) => {
549
- if (height && height !== oldHeight) {
550
- oldHeight = height;
551
- onHeightChange == null ? void 0 : onHeightChange(height);
555
+ if (height) {
556
+ if (height !== oldHeight) {
557
+ oldHeight = height;
558
+ onHeightChange == null ? void 0 : onHeightChange(height);
559
+ }
552
560
  return;
553
561
  }
554
562
  let maxBottom = windowInstance.document.documentElement.getBoundingClientRect().height;
@@ -619,6 +627,7 @@ var createSdkWindow = ({
619
627
  childList: true,
620
628
  subtree: true
621
629
  });
630
+ updateHeight();
622
631
  },
623
632
  disableAutoResizing: () => {
624
633
  observer == null ? void 0 : observer.disconnect();
@@ -702,6 +711,10 @@ async function initializeUniformMeshSDK({
702
711
  getCurrentLocation: () => {
703
712
  const location = {
704
713
  getDataResource: parent.getDataResource,
714
+ router: {
715
+ navigatePlatform: (path, options) => parent.navigate({ path, options })
716
+ // reloadLocation: parent.reloadLocation,
717
+ },
705
718
  editConnectedData,
706
719
  type: contextData.locationType,
707
720
  isReadOnly: contextData.isReadOnly,
@@ -732,7 +745,10 @@ async function initializeUniformMeshSDK({
732
745
  // then we disable autoResizing for the dialog location.
733
746
  // Otherwise, autoResizing will likely "overwrite" the specified `contentHeight` value, making
734
747
  // developers very sad and confused. No one wants a sad and confused developer.
735
- autoResizingDisabled: ((_a = contextData.dialogContext) == null ? void 0 : _a.contentHeight) ? true : autoResizingDisabled
748
+ // Another case for explicit autoResizingDisabled flag is Full Screen Height from the parent (e.g. asset library location),
749
+ // so by default it will be stretch to the maximum height of the parent.
750
+ // Can still be manually enabled by calling sdk.currentWindow?.enableAutoResizing() in mesh app.
751
+ autoResizingDisabled: ((_a = contextData.dialogContext) == null ? void 0 : _a.contentHeight) || contextData.fullScreenHeight ? true : autoResizingDisabled
736
752
  }),
737
753
  version: contextData.uniformApiVersion,
738
754
  openLocationDialog: async ({
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var getLogger = (prefix, debug) => {
172
172
  };
173
173
 
174
174
  // src/temp/version.ts
175
- var UNIFORM_MESH_SDK_VERSION = "20.7.0";
175
+ var UNIFORM_MESH_SDK_VERSION = "20.18.0";
176
176
 
177
177
  // src/framepost/constants.ts
178
178
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
@@ -559,6 +559,12 @@ async function connectToParent({
559
559
  timeout: 3e4
560
560
  });
561
561
  },
562
+ navigate: async (message) => {
563
+ await client.request("navigate", message);
564
+ },
565
+ reloadLocation: async () => {
566
+ await client.request("reload");
567
+ },
562
568
  editConnectedData: async (message) => {
563
569
  return await client.request(
564
570
  "editConnectedData",
@@ -587,9 +593,11 @@ var createSdkWindow = ({
587
593
  }
588
594
  const windowInstance = window;
589
595
  const updateHeight = (height) => {
590
- if (height && height !== oldHeight) {
591
- oldHeight = height;
592
- onHeightChange == null ? void 0 : onHeightChange(height);
596
+ if (height) {
597
+ if (height !== oldHeight) {
598
+ oldHeight = height;
599
+ onHeightChange == null ? void 0 : onHeightChange(height);
600
+ }
593
601
  return;
594
602
  }
595
603
  let maxBottom = windowInstance.document.documentElement.getBoundingClientRect().height;
@@ -660,6 +668,7 @@ var createSdkWindow = ({
660
668
  childList: true,
661
669
  subtree: true
662
670
  });
671
+ updateHeight();
663
672
  },
664
673
  disableAutoResizing: () => {
665
674
  observer == null ? void 0 : observer.disconnect();
@@ -743,6 +752,10 @@ async function initializeUniformMeshSDK({
743
752
  getCurrentLocation: () => {
744
753
  const location = {
745
754
  getDataResource: parent.getDataResource,
755
+ router: {
756
+ navigatePlatform: (path, options) => parent.navigate({ path, options })
757
+ // reloadLocation: parent.reloadLocation,
758
+ },
746
759
  editConnectedData,
747
760
  type: contextData.locationType,
748
761
  isReadOnly: contextData.isReadOnly,
@@ -773,7 +786,10 @@ async function initializeUniformMeshSDK({
773
786
  // then we disable autoResizing for the dialog location.
774
787
  // Otherwise, autoResizing will likely "overwrite" the specified `contentHeight` value, making
775
788
  // developers very sad and confused. No one wants a sad and confused developer.
776
- autoResizingDisabled: ((_a = contextData.dialogContext) == null ? void 0 : _a.contentHeight) ? true : autoResizingDisabled
789
+ // Another case for explicit autoResizingDisabled flag is Full Screen Height from the parent (e.g. asset library location),
790
+ // so by default it will be stretch to the maximum height of the parent.
791
+ // Can still be manually enabled by calling sdk.currentWindow?.enableAutoResizing() in mesh app.
792
+ autoResizingDisabled: ((_a = contextData.dialogContext) == null ? void 0 : _a.contentHeight) || contextData.fullScreenHeight ? true : autoResizingDisabled
777
793
  }),
778
794
  version: contextData.uniformApiVersion,
779
795
  openLocationDialog: async ({
package/dist/index.mjs CHANGED
@@ -131,7 +131,7 @@ var getLogger = (prefix, debug) => {
131
131
  };
132
132
 
133
133
  // src/temp/version.ts
134
- var UNIFORM_MESH_SDK_VERSION = "20.7.0";
134
+ var UNIFORM_MESH_SDK_VERSION = "20.18.0";
135
135
 
136
136
  // src/framepost/constants.ts
137
137
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
@@ -518,6 +518,12 @@ async function connectToParent({
518
518
  timeout: 3e4
519
519
  });
520
520
  },
521
+ navigate: async (message) => {
522
+ await client.request("navigate", message);
523
+ },
524
+ reloadLocation: async () => {
525
+ await client.request("reload");
526
+ },
521
527
  editConnectedData: async (message) => {
522
528
  return await client.request(
523
529
  "editConnectedData",
@@ -546,9 +552,11 @@ var createSdkWindow = ({
546
552
  }
547
553
  const windowInstance = window;
548
554
  const updateHeight = (height) => {
549
- if (height && height !== oldHeight) {
550
- oldHeight = height;
551
- onHeightChange == null ? void 0 : onHeightChange(height);
555
+ if (height) {
556
+ if (height !== oldHeight) {
557
+ oldHeight = height;
558
+ onHeightChange == null ? void 0 : onHeightChange(height);
559
+ }
552
560
  return;
553
561
  }
554
562
  let maxBottom = windowInstance.document.documentElement.getBoundingClientRect().height;
@@ -619,6 +627,7 @@ var createSdkWindow = ({
619
627
  childList: true,
620
628
  subtree: true
621
629
  });
630
+ updateHeight();
622
631
  },
623
632
  disableAutoResizing: () => {
624
633
  observer == null ? void 0 : observer.disconnect();
@@ -702,6 +711,10 @@ async function initializeUniformMeshSDK({
702
711
  getCurrentLocation: () => {
703
712
  const location = {
704
713
  getDataResource: parent.getDataResource,
714
+ router: {
715
+ navigatePlatform: (path, options) => parent.navigate({ path, options })
716
+ // reloadLocation: parent.reloadLocation,
717
+ },
705
718
  editConnectedData,
706
719
  type: contextData.locationType,
707
720
  isReadOnly: contextData.isReadOnly,
@@ -732,7 +745,10 @@ async function initializeUniformMeshSDK({
732
745
  // then we disable autoResizing for the dialog location.
733
746
  // Otherwise, autoResizing will likely "overwrite" the specified `contentHeight` value, making
734
747
  // developers very sad and confused. No one wants a sad and confused developer.
735
- autoResizingDisabled: ((_a = contextData.dialogContext) == null ? void 0 : _a.contentHeight) ? true : autoResizingDisabled
748
+ // Another case for explicit autoResizingDisabled flag is Full Screen Height from the parent (e.g. asset library location),
749
+ // so by default it will be stretch to the maximum height of the parent.
750
+ // Can still be manually enabled by calling sdk.currentWindow?.enableAutoResizing() in mesh app.
751
+ autoResizingDisabled: ((_a = contextData.dialogContext) == null ? void 0 : _a.contentHeight) || contextData.fullScreenHeight ? true : autoResizingDisabled
736
752
  }),
737
753
  version: contextData.uniformApiVersion,
738
754
  openLocationDialog: async ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk",
3
- "version": "20.7.1-alpha.4+20185a97ff",
3
+ "version": "20.7.1-alpha.45+082e9e310e",
4
4
  "description": "Uniform Mesh Framework SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
26
26
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
27
27
  "update-openapi": "tsx ./scripts/update-openapi.cts",
28
- "document": "api-extractor run --local"
28
+ "document:prebuild": "api-extractor run --local"
29
29
  },
30
30
  "files": [
31
31
  "/dist"
@@ -34,16 +34,16 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@uniformdev/assets": "20.7.1-alpha.4+20185a97ff",
38
- "@uniformdev/canvas": "20.7.1-alpha.4+20185a97ff",
39
- "@uniformdev/context": "20.7.1-alpha.4+20185a97ff",
40
- "@uniformdev/project-map": "20.7.1-alpha.4+20185a97ff",
37
+ "@uniformdev/assets": "20.7.1-alpha.45+082e9e310e",
38
+ "@uniformdev/canvas": "20.7.1-alpha.45+082e9e310e",
39
+ "@uniformdev/context": "20.7.1-alpha.45+082e9e310e",
40
+ "@uniformdev/project-map": "20.7.1-alpha.45+082e9e310e",
41
41
  "imagesloaded": "^5.0.0",
42
42
  "mitt": "^3.0.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/imagesloaded": "^4.1.2",
46
- "openai": "^4.58.2"
46
+ "openai": "4.94.0"
47
47
  },
48
- "gitHead": "20185a97ff6c2de2f871223af12d73583fe300af"
48
+ "gitHead": "082e9e310e3f0a32074da8bc21a928e665041246"
49
49
  }