@uniformdev/mesh-sdk 17.7.1-alpha.34 → 18.0.0

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/LICENSE.txt CHANGED
@@ -1,2 +1,2 @@
1
- © 2022 Uniform Systems, Inc. All Rights Reserved.
1
+ © 2023 Uniform Systems, Inc. All Rights Reserved.
2
2
  See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
package/dist/index.d.ts CHANGED
@@ -2,16 +2,16 @@ import { DataSource, RootComponentInstance, ComponentInstance, ComponentDefiniti
2
2
  import { DataType } from '@uniformdev/canvas/.';
3
3
  import { Emitter } from 'mitt';
4
4
 
5
- declare type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'headers' | 'parameters' | 'variables'>;
6
- declare type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = {
5
+ type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'headers' | 'parameters' | 'variables'>;
6
+ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = {
7
7
  /** Settings defined at the integration level (arbitrary type used on settings location) */
8
8
  settings: TIntegrationConfiguration;
9
9
  /** The Uniform project ID */
10
10
  projectId: string;
11
11
  };
12
- declare type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
12
+ type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
13
13
 
14
- declare type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = {
14
+ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = {
15
15
  rootNode: Omit<RootComponentInstance, 'slots' | '_data'>;
16
16
  parameterConfiguration: TParamConfiguration;
17
17
  component: Omit<ComponentInstance, 'slots' | '_parameters' | '_id'>;
@@ -22,15 +22,15 @@ declare type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrati
22
22
  /** The Uniform project ID */
23
23
  projectId: string;
24
24
  };
25
- declare type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'>;
25
+ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'>;
26
26
 
27
- declare type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, undefined, TSettingsType, 'settings'>;
27
+ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, undefined, TSettingsType, 'settings'>;
28
28
 
29
29
  /**
30
30
  * Defines methods used for interacting with a Mesh location
31
31
  * To receive useful typings, check the `type` property of the location to narrow the typing.
32
32
  */
33
- declare type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | DataSourceLocation | DataTypeLocation | DataTypeInstanceLocation | DataResourceLocation;
33
+ type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | DataSourceLocation | DataTypeLocation | DataTypeInstanceLocation | DataResourceLocation;
34
34
  interface MeshContextData {
35
35
  locationKey: string;
36
36
  locationType: MeshLocationTypes;
@@ -57,8 +57,8 @@ interface DialogResponseData {
57
57
  dialogId: string;
58
58
  error?: string;
59
59
  }
60
- declare type DialogType = 'location' | 'confirm';
61
- declare type OpenDialogResult = {
60
+ type DialogType = 'location' | 'confirm';
61
+ type OpenDialogResult = {
62
62
  /** Unique ID of this dialog which can be used to close it */
63
63
  dialogId: string;
64
64
  /**
@@ -100,30 +100,30 @@ interface DialogOptions<TDialogParams = DialogParams> {
100
100
  */
101
101
  contentHeight?: CSSHeight;
102
102
  }
103
- declare type DialogParamValue = string | number | boolean | null | DialogParamValue[] | {
103
+ type DialogParamValue = string | number | boolean | null | DialogParamValue[] | {
104
104
  [key: string]: DialogParamValue;
105
105
  };
106
- declare type DialogParams = {
106
+ type DialogParams = {
107
107
  [paramName: string]: DialogParamValue;
108
108
  };
109
- declare type CSSHeight = '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'unset' | '-moz-max-content' | '-moz-min-content' | '-webkit-fit-content' | 'auto' | 'fit-content' | 'max-content' | 'min-content' | `${number}${'px' | 'em' | 'rem' | 'vh'}`;
110
- declare type ValidationResult = {
109
+ type CSSHeight = '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'unset' | '-moz-max-content' | '-moz-min-content' | '-webkit-fit-content' | 'auto' | 'fit-content' | 'max-content' | 'min-content' | `${number}${'px' | 'em' | 'rem' | 'vh'}`;
110
+ type ValidationResult = {
111
111
  isValid: false;
112
112
  validationMessage: string;
113
113
  } | {
114
114
  isValid: true;
115
115
  };
116
- declare type OpenDialogMessage = {
116
+ type OpenDialogMessage = {
117
117
  dialogType: DialogType;
118
118
  dialogData: unknown;
119
119
  options?: DialogOptions;
120
120
  };
121
- declare type CloseDialogMessage = {
121
+ type CloseDialogMessage = {
122
122
  dialogId: string | undefined;
123
123
  dialogType: DialogType;
124
124
  dialogData?: unknown;
125
125
  };
126
- declare type GetDataResourceMessage = Pick<DataType, 'path' | 'headers' | 'parameters' | 'body' | 'method'>;
126
+ type GetDataResourceMessage = Pick<DataType, 'path' | 'headers' | 'parameters' | 'body' | 'method'>;
127
127
 
128
128
  /**
129
129
  * Imports the iframe communications library and provides an interface for interacting with
@@ -144,7 +144,7 @@ declare function connectToParent({ dialogResponseHandlers, }: {
144
144
  };
145
145
  }>;
146
146
 
147
- declare type SetLocationFunction<TSetValue> = (value: TSetValue, options?: SetValueOptions) => Promise<void> | void;
147
+ type SetLocationFunction<TSetValue> = (value: TSetValue, options?: SetValueOptions) => Promise<void> | void;
148
148
  /** Core shared generic for a mesh location context */
149
149
  interface MeshLocationCore<TValue = unknown, TMetadata = unknown, TSetValue = TValue, TType extends MeshLocationTypes = MeshLocationTypes> {
150
150
  /** The current location type (where in the Uniform app the mesh app is rendering) */
@@ -193,25 +193,25 @@ interface MeshLocationCore<TValue = unknown, TMetadata = unknown, TSetValue = TV
193
193
  /**
194
194
  * Known location types that can be passed to a mesh location
195
195
  */
196
- declare type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'settings' | 'dataSource' | 'dataType'
196
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'settings' | 'dataSource' | 'dataType'
197
197
  /** @deprecated use dataResource */
198
198
  | 'dataTypeInstance' | 'dataResource';
199
- declare type SetValueOptions = ValidationResult;
200
- declare type SetValueMessage = {
199
+ type SetValueOptions = ValidationResult;
200
+ type SetValueMessage = {
201
201
  uniformMeshLocationValue: unknown;
202
202
  options?: SetValueOptions;
203
203
  };
204
- declare type GetDataResourceLocation = {
204
+ type GetDataResourceLocation = {
205
205
  getDataResource: Awaited<ReturnType<typeof connectToParent>>['parent']['getDataResource'];
206
206
  };
207
207
 
208
- declare type DataTypeLocationValue = Pick<DataType$1, 'body' | 'method' | 'path' | 'custom' | 'headers' | 'parameters' | 'variables'>;
209
- declare type DataConnectorInfo = {
208
+ type DataTypeLocationValue = Pick<DataType$1, 'body' | 'method' | 'path' | 'custom' | 'headers' | 'parameters' | 'variables'>;
209
+ type DataConnectorInfo = {
210
210
  type: string;
211
211
  displayName: string;
212
212
  installedIntegrationId: string;
213
213
  };
214
- declare type DataTypeLocationMetadata<TIntegrationConfiguration = unknown> = {
214
+ type DataTypeLocationMetadata<TIntegrationConfiguration = unknown> = {
215
215
  /** Settings defined at the integration level (arbitrary type used on settings location) */
216
216
  settings: TIntegrationConfiguration;
217
217
  /** The Uniform project ID */
@@ -225,11 +225,11 @@ declare type DataTypeLocationMetadata<TIntegrationConfiguration = unknown> = {
225
225
  /** The data type's archetype value. */
226
226
  archetype: string;
227
227
  };
228
- declare type DataTypeLocation = MeshLocationCore<DataTypeLocationValue, DataTypeLocationMetadata, DataTypeLocationValue, 'dataType'> & GetDataResourceLocation;
228
+ type DataTypeLocation = MeshLocationCore<DataTypeLocationValue, DataTypeLocationMetadata, DataTypeLocationValue, 'dataType'> & GetDataResourceLocation;
229
229
 
230
230
  /** @deprecated use DataResourceLocationMetadata */
231
- declare type DataTypeInstanceLocationMetadata<TIntegrationConfiguration = unknown> = DataResourceLocationMetadata<TIntegrationConfiguration>;
232
- declare type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = {
231
+ type DataTypeInstanceLocationMetadata<TIntegrationConfiguration = unknown> = DataResourceLocationMetadata<TIntegrationConfiguration>;
232
+ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = {
233
233
  /** Settings defined at the integration level (arbitrary type used on settings location) */
234
234
  settings: TIntegrationConfiguration;
235
235
  /** The current data resource's data type */
@@ -245,17 +245,17 @@ declare type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> =
245
245
  /** The Uniform project ID */
246
246
  projectId: string;
247
247
  };
248
- declare type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
248
+ type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
249
249
  /** @deprecated use DataResourceLocation */
250
- declare type DataTypeInstanceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataTypeInstance'>;
250
+ type DataTypeInstanceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataTypeInstance'>;
251
251
 
252
- declare type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = {
252
+ type ParamTypeConfigLocationMetadata<TIntegrationConfiguration = unknown> = {
253
253
  /** Settings defined at the integration level (arbitrary type used on settings location) */
254
254
  settings: TIntegrationConfiguration;
255
255
  /** The Uniform project ID */
256
256
  projectId: string;
257
257
  };
258
- declare type ParamTypeConfigLocation<TParamValue = unknown, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeConfigLocationMetadata<TIntegrationConfiguration>, TParamValue, 'paramTypeConfig'>;
258
+ type ParamTypeConfigLocation<TParamValue = unknown, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeConfigLocationMetadata<TIntegrationConfiguration>, TParamValue, 'paramTypeConfig'>;
259
259
 
260
260
  interface SdkWindow {
261
261
  /** The current window object. */
@@ -274,7 +274,7 @@ interface SdkWindow {
274
274
  updateHeight: (height: CSSHeight) => void;
275
275
  }
276
276
 
277
- declare type OpenLocationDialogOptions<TDialogParams> = {
277
+ type OpenLocationDialogOptions<TDialogParams> = {
278
278
  /**
279
279
  * Name of the location key in the Mesh App definition (stored on uniform.app) to open in a dialog.
280
280
  * For example if the current location is integration settings, this would be an object key on:
@@ -285,16 +285,16 @@ declare type OpenLocationDialogOptions<TDialogParams> = {
285
285
  locationKey: string;
286
286
  options?: DialogOptions<TDialogParams>;
287
287
  };
288
- declare type OpenConfirmationDialogOptions = {
288
+ type OpenConfirmationDialogOptions = {
289
289
  titleText: string;
290
290
  bodyText: string;
291
291
  options?: Omit<DialogOptions<void>, 'disableCloseDialogOnSetValue' | 'params'>;
292
292
  };
293
- declare type OpenConfirmationDialogResult = {
293
+ type OpenConfirmationDialogResult = {
294
294
  value: 'confirm' | 'cancel';
295
295
  closeDialog: () => Promise<void>;
296
296
  };
297
- declare type CloseLocationDialogOptions = {
297
+ type CloseLocationDialogOptions = {
298
298
  /** Id of the dialog to close. If no dialog with the given id exists, nothing will happen. */
299
299
  dialogId: string;
300
300
  };
@@ -308,7 +308,7 @@ interface LocationDialogResponse<TDialogValue> {
308
308
  closeDialog: () => Promise<void>;
309
309
  }
310
310
  /** Events that can be emitted from the Mesh SDK */
311
- declare type UniformMeshSDKEvents = {
311
+ type UniformMeshSDKEvents = {
312
312
  /** Fired when the location value has changed */
313
313
  onValueChanged: {
314
314
  newValue: unknown;