@uniformdev/canvas 18.2.1 → 18.3.1-alpha.21

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.
@@ -475,17 +475,19 @@ function createLimitPolicy({
475
475
  var nullLimitPolicy = async (func) => await func();
476
476
 
477
477
  // src/CanvasClient.ts
478
+ var CANVAS_URL = "/api/v1/canvas";
478
479
  var CanvasClient = class extends ApiClient {
479
480
  constructor(options) {
481
+ var _a;
480
482
  if (!options.limitPolicy) {
481
483
  options.limitPolicy = createLimitPolicy({});
482
484
  }
483
485
  super(options);
484
- this.canvasUrl = "/api/v1/canvas";
486
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
485
487
  }
486
488
  async getCompositionList(options) {
487
489
  const { projectId } = this.options;
488
- const fetchUri = this.createUrl(this.canvasUrl, { ...options, projectId });
490
+ const fetchUri = this.createUrl(CANVAS_URL, { ...options, projectId });
489
491
  return await this.apiClient(fetchUri);
490
492
  }
491
493
  unstable_getCompositionByNodePath(options) {
@@ -507,20 +509,20 @@ var CanvasClient = class extends ApiClient {
507
509
  ...params
508
510
  }) {
509
511
  const { projectId } = this.options;
510
- const url = resolveData ? "/api/edge/v1/composition" : this.canvasUrl;
511
- const dataResolutionParams = {};
512
- if (resolveData) {
513
- if (dynamicVariables) {
514
- dataResolutionParams.dynamicVariables = JSON.stringify(dynamicVariables);
515
- }
516
- if (dataDiagnostics) {
517
- dataResolutionParams.dataDiagnostics = "true";
518
- }
512
+ if (!resolveData) {
513
+ return this.apiClient(this.createUrl(CANVAS_URL, { ...params, projectId }));
519
514
  }
520
- return this.apiClient(this.createUrl(url, { ...params, ...dataResolutionParams, projectId }));
515
+ const edgeParams = {
516
+ ...params,
517
+ projectId,
518
+ ...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
519
+ ...dataDiagnostics ? { dataDiagnostics: "true" } : {}
520
+ };
521
+ const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
522
+ return this.apiClient(edgeUrl);
521
523
  }
522
524
  async updateComposition(body) {
523
- const fetchUri = this.createUrl("/api/v1/canvas");
525
+ const fetchUri = this.createUrl(CANVAS_URL);
524
526
  await this.apiClient(fetchUri, {
525
527
  method: "PUT",
526
528
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -528,7 +530,7 @@ var CanvasClient = class extends ApiClient {
528
530
  });
529
531
  }
530
532
  async removeComposition(body) {
531
- const fetchUri = this.createUrl("/api/v1/canvas");
533
+ const fetchUri = this.createUrl(CANVAS_URL);
532
534
  const { projectId } = this.options;
533
535
  await this.apiClient(fetchUri, {
534
536
  method: "DELETE",
package/dist/cli/cli.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UniformCLIPlugin } from '@uniformdev/cli';
2
2
  import { UniformPackage } from '@uniformdev/cli/sync';
3
- import { a1 as CanvasDefinitions } from '../createEventBus-bd2e0a92.js';
3
+ import { a1 as CanvasDefinitions } from '../createEventBus-db0afea5.js';
4
4
  import 'pusher-js';
5
5
 
6
6
  type CanvasPackage = UniformPackage & CanvasDefinitions;
package/dist/cli/cli.js CHANGED
@@ -18087,17 +18087,22 @@ async function createArraySyncEngineDataSource({
18087
18087
  }
18088
18088
  var import_chalk = __toESM2(require_source());
18089
18089
  function withApiOptions(yargs) {
18090
- var _a2, _b2;
18090
+ var _a2, _b2, _c2;
18091
18091
  return yargs.option("apiKey", {
18092
- describe: "Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
18093
- default: (_b2 = (_a2 = process.env.CANVAS_CLI_API_KEY) != null ? _a2 : process.env.UPM_CLI_API_KEY) != null ? _b2 : process.env.UNIFORM_API_KEY,
18092
+ describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
18093
+ default: (_c2 = (_b2 = (_a2 = process.env.UNIFORM_CLI_API_KEY) != null ? _a2 : process.env.CANVAS_CLI_API_KEY) != null ? _b2 : process.env.UPM_CLI_API_KEY) != null ? _c2 : process.env.UNIFORM_API_KEY,
18094
18094
  demandOption: true,
18095
18095
  type: "string"
18096
18096
  }).option("apiHost", {
18097
- describe: "Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",
18097
+ describe: "Uniform host. Defaults to UNIFORM_CLI_BASE_URL env var or https://uniform.app. Supports dotenv.",
18098
18098
  default: process.env.UNIFORM_CLI_BASE_URL || "https://uniform.app",
18099
18099
  demandOption: true,
18100
18100
  type: "string"
18101
+ }).option("edgeApiHost", {
18102
+ describe: "Uniform edge host. Defaults to UNIFORM_CLI_BASE_EDGE_URL env var or https://uniform.global. Supports dotenv.",
18103
+ default: process.env.UNIFORM_CLI_BASE_EDGE_URL || "https://uniform.global",
18104
+ demandOption: true,
18105
+ type: "string"
18101
18106
  }).option("proxy", {
18102
18107
  describe: "HTTPS proxy to use for Uniform API calls. Defaults to HTTPS_PROXY, https_proxy, ALL_PROXY, or all_proxy env vars (in that order). Supports dotenv.",
18103
18108
  default: process.env.HTTPS_PROXY || process.env.https_proxy || process.env.ALL_PROXY || process.env.all_proxy,
@@ -18598,17 +18603,19 @@ function createLimitPolicy({
18598
18603
  }
18599
18604
 
18600
18605
  // src/CanvasClient.ts
18606
+ var CANVAS_URL = "/api/v1/canvas";
18601
18607
  var CanvasClient = class extends import_api.ApiClient {
18602
18608
  constructor(options) {
18609
+ var _a2;
18603
18610
  if (!options.limitPolicy) {
18604
18611
  options.limitPolicy = createLimitPolicy({});
18605
18612
  }
18606
18613
  super(options);
18607
- this.canvasUrl = "/api/v1/canvas";
18614
+ this.edgeApiHost = (_a2 = options.edgeApiHost) != null ? _a2 : "https://uniform.global";
18608
18615
  }
18609
18616
  async getCompositionList(options) {
18610
18617
  const { projectId } = this.options;
18611
- const fetchUri = this.createUrl(this.canvasUrl, { ...options, projectId });
18618
+ const fetchUri = this.createUrl(CANVAS_URL, { ...options, projectId });
18612
18619
  return await this.apiClient(fetchUri);
18613
18620
  }
18614
18621
  unstable_getCompositionByNodePath(options) {
@@ -18630,20 +18637,20 @@ var CanvasClient = class extends import_api.ApiClient {
18630
18637
  ...params
18631
18638
  }) {
18632
18639
  const { projectId } = this.options;
18633
- const url = resolveData ? "/api/edge/v1/composition" : this.canvasUrl;
18634
- const dataResolutionParams = {};
18635
- if (resolveData) {
18636
- if (dynamicVariables) {
18637
- dataResolutionParams.dynamicVariables = JSON.stringify(dynamicVariables);
18638
- }
18639
- if (dataDiagnostics) {
18640
- dataResolutionParams.dataDiagnostics = "true";
18641
- }
18640
+ if (!resolveData) {
18641
+ return this.apiClient(this.createUrl(CANVAS_URL, { ...params, projectId }));
18642
18642
  }
18643
- return this.apiClient(this.createUrl(url, { ...params, ...dataResolutionParams, projectId }));
18643
+ const edgeParams = {
18644
+ ...params,
18645
+ projectId,
18646
+ ...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
18647
+ ...dataDiagnostics ? { dataDiagnostics: "true" } : {}
18648
+ };
18649
+ const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
18650
+ return this.apiClient(edgeUrl);
18644
18651
  }
18645
18652
  async updateComposition(body) {
18646
- const fetchUri = this.createUrl("/api/v1/canvas");
18653
+ const fetchUri = this.createUrl(CANVAS_URL);
18647
18654
  await this.apiClient(fetchUri, {
18648
18655
  method: "PUT",
18649
18656
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -18651,7 +18658,7 @@ var CanvasClient = class extends import_api.ApiClient {
18651
18658
  });
18652
18659
  }
18653
18660
  async removeComposition(body) {
18654
- const fetchUri = this.createUrl("/api/v1/canvas");
18661
+ const fetchUri = this.createUrl(CANVAS_URL);
18655
18662
  const { projectId } = this.options;
18656
18663
  await this.apiClient(fetchUri, {
18657
18664
  method: "DELETE",
@@ -19146,6 +19153,7 @@ var CompositionGetModule = {
19146
19153
  ),
19147
19154
  handler: async ({
19148
19155
  apiHost,
19156
+ edgeApiHost,
19149
19157
  apiKey,
19150
19158
  proxy,
19151
19159
  id,
@@ -19159,7 +19167,7 @@ var CompositionGetModule = {
19159
19167
  unstableDataDiagnostics
19160
19168
  }) => {
19161
19169
  const fetch2 = nodeFetchProxy(proxy);
19162
- const client = new UncachedCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
19170
+ const client = new UncachedCanvasClient({ apiKey, edgeApiHost, apiHost, fetch: fetch2, projectId });
19163
19171
  const res = prepCompositionForDisk(
19164
19172
  await client.getCompositionById({
19165
19173
  compositionId: id,
package/dist/cli/cli.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  __require,
15
15
  __toCommonJS,
16
16
  __toESM
17
- } from "../chunk-D45SO56S.mjs";
17
+ } from "../chunk-RFV573P3.mjs";
18
18
 
19
19
  // ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
20
20
  var require_ms = __commonJS({
@@ -17806,17 +17806,22 @@ async function createArraySyncEngineDataSource({
17806
17806
  }
17807
17807
  var import_chalk = __toESM2(require_source());
17808
17808
  function withApiOptions(yargs) {
17809
- var _a2, _b2;
17809
+ var _a2, _b2, _c2;
17810
17810
  return yargs.option("apiKey", {
17811
- describe: "Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
17812
- default: (_b2 = (_a2 = process.env.CANVAS_CLI_API_KEY) != null ? _a2 : process.env.UPM_CLI_API_KEY) != null ? _b2 : process.env.UNIFORM_API_KEY,
17811
+ describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
17812
+ default: (_c2 = (_b2 = (_a2 = process.env.UNIFORM_CLI_API_KEY) != null ? _a2 : process.env.CANVAS_CLI_API_KEY) != null ? _b2 : process.env.UPM_CLI_API_KEY) != null ? _c2 : process.env.UNIFORM_API_KEY,
17813
17813
  demandOption: true,
17814
17814
  type: "string"
17815
17815
  }).option("apiHost", {
17816
- describe: "Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",
17816
+ describe: "Uniform host. Defaults to UNIFORM_CLI_BASE_URL env var or https://uniform.app. Supports dotenv.",
17817
17817
  default: process.env.UNIFORM_CLI_BASE_URL || "https://uniform.app",
17818
17818
  demandOption: true,
17819
17819
  type: "string"
17820
+ }).option("edgeApiHost", {
17821
+ describe: "Uniform edge host. Defaults to UNIFORM_CLI_BASE_EDGE_URL env var or https://uniform.global. Supports dotenv.",
17822
+ default: process.env.UNIFORM_CLI_BASE_EDGE_URL || "https://uniform.global",
17823
+ demandOption: true,
17824
+ type: "string"
17820
17825
  }).option("proxy", {
17821
17826
  describe: "HTTPS proxy to use for Uniform API calls. Defaults to HTTPS_PROXY, https_proxy, ALL_PROXY, or all_proxy env vars (in that order). Supports dotenv.",
17822
17827
  default: process.env.HTTPS_PROXY || process.env.https_proxy || process.env.ALL_PROXY || process.env.all_proxy,
@@ -18591,6 +18596,7 @@ var CompositionGetModule = {
18591
18596
  ),
18592
18597
  handler: async ({
18593
18598
  apiHost,
18599
+ edgeApiHost,
18594
18600
  apiKey,
18595
18601
  proxy,
18596
18602
  id,
@@ -18604,7 +18610,7 @@ var CompositionGetModule = {
18604
18610
  unstableDataDiagnostics
18605
18611
  }) => {
18606
18612
  const fetch2 = nodeFetchProxy(proxy);
18607
- const client = new UncachedCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
18613
+ const client = new UncachedCanvasClient({ apiKey, edgeApiHost, apiHost, fetch: fetch2, projectId });
18608
18614
  const res = prepCompositionForDisk(
18609
18615
  await client.getCompositionById({
18610
18616
  compositionId: id,
@@ -198,6 +198,8 @@ interface components$2 {
198
198
  };
199
199
  /** @description Public ID of alternate visual appearance for this component, if any selected */
200
200
  variant?: string;
201
+ /** @description Project map nodes associated with this component. Must pass withProjectMapNodes parameter to be populated. */
202
+ projectMapNodes?: components$2["schemas"]["CompositionProjectMapNodeInfo"][];
201
203
  /** @description Slots containing any child components */
202
204
  slots?: {
203
205
  [key: string]: components$2["schemas"]["ComponentInstance"][];
@@ -350,6 +352,21 @@ interface components$2 {
350
352
  DataResourceVariables: {
351
353
  [key: string]: string;
352
354
  };
355
+ /** @description Project map node information related to a component. */
356
+ CompositionProjectMapNodeInfo: {
357
+ /**
358
+ * Format: uuid
359
+ * @description Unique identifier for the project map node
360
+ */
361
+ id: string;
362
+ /** @description Path of the project map node */
363
+ path: string;
364
+ /**
365
+ * Format: uuid
366
+ * @description Unique identifier for the project map that this node belongs to.
367
+ */
368
+ projectMapId: string;
369
+ };
353
370
  };
354
371
  }
355
372
 
@@ -692,6 +709,8 @@ interface external$5 {
692
709
  };
693
710
  /** @description Public ID of alternate visual appearance for this component, if any selected */
694
711
  variant?: string;
712
+ /** @description Project map nodes associated with this component. Must pass withProjectMapNodes parameter to be populated. */
713
+ projectMapNodes?: external$5["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionProjectMapNodeInfo"][];
695
714
  /** @description Slots containing any child components */
696
715
  slots?: {
697
716
  [key: string]: external$5["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
@@ -844,6 +863,21 @@ interface external$5 {
844
863
  DataResourceVariables: {
845
864
  [key: string]: string;
846
865
  };
866
+ /** @description Project map node information related to a component. */
867
+ CompositionProjectMapNodeInfo: {
868
+ /**
869
+ * Format: uuid
870
+ * @description Unique identifier for the project map node
871
+ */
872
+ id: string;
873
+ /** @description Path of the project map node */
874
+ path: string;
875
+ /**
876
+ * Format: uuid
877
+ * @description Unique identifier for the project map that this node belongs to.
878
+ */
879
+ projectMapId: string;
880
+ };
847
881
  };
848
882
  };
849
883
  operations: {};
@@ -968,6 +1002,8 @@ interface paths$3 {
968
1002
  * This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
969
1003
  */
970
1004
  withUIStatus?: components$1["parameters"]["withUIStatus"];
1005
+ /** Includes project map node information in the composition results */
1006
+ withProjectMapNodes?: components$1["parameters"]["withProjectMapNodes"];
971
1007
  };
972
1008
  };
973
1009
  responses: {
@@ -1169,6 +1205,8 @@ interface components$1 {
1169
1205
  * This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
1170
1206
  */
1171
1207
  uiStatus: ("Draft" | "Modified" | "Published" | "Orphan")[];
1208
+ /** @description Includes project map node information in the composition results */
1209
+ withProjectMapNodes: boolean;
1172
1210
  /** @description Filters composition lists by the user who created them. The user is specified by their identity subject. */
1173
1211
  createdBy: string;
1174
1212
  /** @description Filters composition lists by the user who last updated them. The user is specified by their identity subject. */
@@ -1423,6 +1461,8 @@ interface external$4 {
1423
1461
  };
1424
1462
  /** @description Public ID of alternate visual appearance for this component, if any selected */
1425
1463
  variant?: string;
1464
+ /** @description Project map nodes associated with this component. Must pass withProjectMapNodes parameter to be populated. */
1465
+ projectMapNodes?: external$4["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionProjectMapNodeInfo"][];
1426
1466
  /** @description Slots containing any child components */
1427
1467
  slots?: {
1428
1468
  [key: string]: external$4["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
@@ -1575,6 +1615,21 @@ interface external$4 {
1575
1615
  DataResourceVariables: {
1576
1616
  [key: string]: string;
1577
1617
  };
1618
+ /** @description Project map node information related to a component. */
1619
+ CompositionProjectMapNodeInfo: {
1620
+ /**
1621
+ * Format: uuid
1622
+ * @description Unique identifier for the project map node
1623
+ */
1624
+ id: string;
1625
+ /** @description Path of the project map node */
1626
+ path: string;
1627
+ /**
1628
+ * Format: uuid
1629
+ * @description Unique identifier for the project map that this node belongs to.
1630
+ */
1631
+ projectMapId: string;
1632
+ };
1578
1633
  };
1579
1634
  };
1580
1635
  operations: {};
@@ -1934,6 +1989,8 @@ interface external$3 {
1934
1989
  };
1935
1990
  /** @description Public ID of alternate visual appearance for this component, if any selected */
1936
1991
  variant?: string;
1992
+ /** @description Project map nodes associated with this component. Must pass withProjectMapNodes parameter to be populated. */
1993
+ projectMapNodes?: external$3["../../../lambda/functions/uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionProjectMapNodeInfo"][];
1937
1994
  /** @description Slots containing any child components */
1938
1995
  slots?: {
1939
1996
  [key: string]: external$3["../../../lambda/functions/uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
@@ -2086,6 +2143,21 @@ interface external$3 {
2086
2143
  DataResourceVariables: {
2087
2144
  [key: string]: string;
2088
2145
  };
2146
+ /** @description Project map node information related to a component. */
2147
+ CompositionProjectMapNodeInfo: {
2148
+ /**
2149
+ * Format: uuid
2150
+ * @description Unique identifier for the project map node
2151
+ */
2152
+ id: string;
2153
+ /** @description Path of the project map node */
2154
+ path: string;
2155
+ /**
2156
+ * Format: uuid
2157
+ * @description Unique identifier for the project map that this node belongs to.
2158
+ */
2159
+ projectMapId: string;
2160
+ };
2089
2161
  };
2090
2162
  };
2091
2163
  operations: {};
@@ -2170,6 +2242,8 @@ interface external$3 {
2170
2242
  * This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
2171
2243
  */
2172
2244
  withUIStatus?: external$3["../../../lambda/functions/v1-canvas.swagger.yml"]["components"]["parameters"]["withUIStatus"];
2245
+ /** Includes project map node information in the composition results */
2246
+ withProjectMapNodes?: external$3["../../../lambda/functions/v1-canvas.swagger.yml"]["components"]["parameters"]["withProjectMapNodes"];
2173
2247
  };
2174
2248
  };
2175
2249
  responses: {
@@ -2371,6 +2445,8 @@ interface external$3 {
2371
2445
  * This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
2372
2446
  */
2373
2447
  uiStatus: ("Draft" | "Modified" | "Published" | "Orphan")[];
2448
+ /** @description Includes project map node information in the composition results */
2449
+ withProjectMapNodes: boolean;
2374
2450
  /** @description Filters composition lists by the user who created them. The user is specified by their identity subject. */
2375
2451
  createdBy: string;
2376
2452
  /** @description Filters composition lists by the user who last updated them. The user is specified by their identity subject. */
@@ -2568,8 +2644,14 @@ interface paths$2 {
2568
2644
  data: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["DataSource"];
2569
2645
  /** Format: uuid */
2570
2646
  projectId: string;
2571
- /** Format: uuid */
2572
- integrationId: string;
2647
+ /**
2648
+ * Format: uuid
2649
+ * @deprecated
2650
+ * @description Do not use. Will be removed in future.
2651
+ */
2652
+ integrationId?: string;
2653
+ /** @description The integration type that the data source is attached to. Must be installed in the project. */
2654
+ integrationType?: string;
2573
2655
  };
2574
2656
  };
2575
2657
  };
@@ -2839,6 +2921,8 @@ interface external$2 {
2839
2921
  };
2840
2922
  /** @description Public ID of alternate visual appearance for this component, if any selected */
2841
2923
  variant?: string;
2924
+ /** @description Project map nodes associated with this component. Must pass withProjectMapNodes parameter to be populated. */
2925
+ projectMapNodes?: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionProjectMapNodeInfo"][];
2842
2926
  /** @description Slots containing any child components */
2843
2927
  slots?: {
2844
2928
  [key: string]: external$2["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
@@ -2991,6 +3075,21 @@ interface external$2 {
2991
3075
  DataResourceVariables: {
2992
3076
  [key: string]: string;
2993
3077
  };
3078
+ /** @description Project map node information related to a component. */
3079
+ CompositionProjectMapNodeInfo: {
3080
+ /**
3081
+ * Format: uuid
3082
+ * @description Unique identifier for the project map node
3083
+ */
3084
+ id: string;
3085
+ /** @description Path of the project map node */
3086
+ path: string;
3087
+ /**
3088
+ * Format: uuid
3089
+ * @description Unique identifier for the project map that this node belongs to.
3090
+ */
3091
+ projectMapId: string;
3092
+ };
2994
3093
  };
2995
3094
  };
2996
3095
  operations: {};
@@ -3275,6 +3374,8 @@ interface external$1 {
3275
3374
  };
3276
3375
  /** @description Public ID of alternate visual appearance for this component, if any selected */
3277
3376
  variant?: string;
3377
+ /** @description Project map nodes associated with this component. Must pass withProjectMapNodes parameter to be populated. */
3378
+ projectMapNodes?: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionProjectMapNodeInfo"][];
3278
3379
  /** @description Slots containing any child components */
3279
3380
  slots?: {
3280
3381
  [key: string]: external$1["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
@@ -3427,6 +3528,21 @@ interface external$1 {
3427
3528
  DataResourceVariables: {
3428
3529
  [key: string]: string;
3429
3530
  };
3531
+ /** @description Project map node information related to a component. */
3532
+ CompositionProjectMapNodeInfo: {
3533
+ /**
3534
+ * Format: uuid
3535
+ * @description Unique identifier for the project map node
3536
+ */
3537
+ id: string;
3538
+ /** @description Path of the project map node */
3539
+ path: string;
3540
+ /**
3541
+ * Format: uuid
3542
+ * @description Unique identifier for the project map that this node belongs to.
3543
+ */
3544
+ projectMapId: string;
3545
+ };
3430
3546
  };
3431
3547
  };
3432
3548
  operations: {};
@@ -3746,6 +3862,8 @@ interface external {
3746
3862
  };
3747
3863
  /** @description Public ID of alternate visual appearance for this component, if any selected */
3748
3864
  variant?: string;
3865
+ /** @description Project map nodes associated with this component. Must pass withProjectMapNodes parameter to be populated. */
3866
+ projectMapNodes?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["CompositionProjectMapNodeInfo"][];
3749
3867
  /** @description Slots containing any child components */
3750
3868
  slots?: {
3751
3869
  [key: string]: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["ComponentInstance"][];
@@ -3898,6 +4016,21 @@ interface external {
3898
4016
  DataResourceVariables: {
3899
4017
  [key: string]: string;
3900
4018
  };
4019
+ /** @description Project map node information related to a component. */
4020
+ CompositionProjectMapNodeInfo: {
4021
+ /**
4022
+ * Format: uuid
4023
+ * @description Unique identifier for the project map node
4024
+ */
4025
+ id: string;
4026
+ /** @description Path of the project map node */
4027
+ path: string;
4028
+ /**
4029
+ * Format: uuid
4030
+ * @description Unique identifier for the project map that this node belongs to.
4031
+ */
4032
+ projectMapId: string;
4033
+ };
3901
4034
  };
3902
4035
  };
3903
4036
  operations: {};
package/dist/index.d.ts CHANGED
@@ -1,15 +1,18 @@
1
1
  import { ApiClient, ClientOptions, ExceptProject, ApiClientError } from '@uniformdev/context/api';
2
2
  export { ApiClientError } from '@uniformdev/context/api';
3
- import { C as CompositionGetParameters, a as CompositionGetByNodePathParameters, D as DataResolutionOptionNegative, b as CompositionGetResponse, c as DataResolutionOptionPositive, d as DataResolutionParameters, e as CompositionResolvedGetResponse, f as CompositionGetValidResponses, g as DataResolutionOption, h as CompositionGetByNodeIdParameters, i as CompositionGetBySlugParameters, j as CompositionGetByIdParameters, k as CompositionPutParameters, l as CompositionDeleteParameters, m as ComponentDefinitionGetParameters, n as ComponentDefinitionPutParameters, o as ComponentDefinitionDeleteParameters, p as ComponentInstance, q as ComponentParameter, r as components, s as DataSourceGetParameters, t as DataSourcesGetParameters, u as DataSourcePutParameters, v as DataSourceDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, z as DataTypeDeleteParameters, R as RootComponentInstance, P as PreviewEventBus } from './createEventBus-bd2e0a92.js';
4
- export { a1 as CanvasDefinitions, A as ChannelSubscription, O as ComponentDefinition, H as ComponentDefinitionAPIDeleteRequest, G as ComponentDefinitionAPIPutRequest, F as ComponentDefinitionAPIResponse, o as ComponentDefinitionDeleteParameters, m as ComponentDefinitionGetParameters, E as ComponentDefinitionGetResponse, I as ComponentDefinitionListAPIOptions, J as ComponentDefinitionParameter, N as ComponentDefinitionPermission, n as ComponentDefinitionPutParameters, M as ComponentDefinitionSlot, L as ComponentDefinitionSlugSettings, K as ComponentDefinitionVariant, p as ComponentInstance, q as ComponentParameter, W as CompositionAPIDeleteRequest, Y as CompositionAPIOptions, V as CompositionAPIResponse, a8 as CompositionDataDiagnostic, l as CompositionDeleteParameters, j as CompositionGetByIdParameters, h as CompositionGetByNodeIdParameters, a as CompositionGetByNodePathParameters, i as CompositionGetBySlugParameters, U as CompositionGetListResponse, S as CompositionGetOrderBy, C as CompositionGetParameters, b as CompositionGetResponse, f as CompositionGetValidResponses, a2 as CompositionIssue, X as CompositionListAPIResponse, a3 as CompositionPatternIssue, k as CompositionPutParameters, e as CompositionResolvedGetResponse, T as CompositionUIStatus, Q as CreatingComponentDefinition, a4 as DataElementBindingIssue, Z as DataElementConnectionDefinition, a7 as DataResolutionConfigIssue, g as DataResolutionOption, D as DataResolutionOptionNegative, c as DataResolutionOptionPositive, d as DataResolutionParameters, a0 as DataResourceDefinition, $ as DataResourceDefinitions, a5 as DataResourceIssue, a6 as DataResourceVariableIssue, _ as DataResourceVariables, ac as DataSource, v as DataSourceDeleteParameters, s as DataSourceGetParameters, a9 as DataSourceGetResponse, u as DataSourcePutParameters, t as DataSourcesGetParameters, aa as DataSourcesGetResponse, ab as DataType, z as DataTypeDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, ad as DataVariableDefinition, P as PreviewEventBus, R as RootComponentInstance, B as createEventBus } from './createEventBus-bd2e0a92.js';
3
+ import { C as CompositionGetParameters, a as CompositionGetByNodePathParameters, D as DataResolutionOptionNegative, b as CompositionGetResponse, c as DataResolutionOptionPositive, d as DataResolutionParameters, e as CompositionResolvedGetResponse, f as CompositionGetValidResponses, g as DataResolutionOption, h as CompositionGetByNodeIdParameters, i as CompositionGetBySlugParameters, j as CompositionGetByIdParameters, k as CompositionPutParameters, l as CompositionDeleteParameters, m as ComponentDefinitionGetParameters, n as ComponentDefinitionPutParameters, o as ComponentDefinitionDeleteParameters, p as ComponentInstance, q as ComponentParameter, r as components, s as DataSourceGetParameters, t as DataSourcesGetParameters, u as DataSourcePutParameters, v as DataSourceDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, z as DataTypeDeleteParameters, R as RootComponentInstance, P as PreviewEventBus } from './createEventBus-db0afea5.js';
4
+ export { a1 as CanvasDefinitions, A as ChannelSubscription, O as ComponentDefinition, H as ComponentDefinitionAPIDeleteRequest, G as ComponentDefinitionAPIPutRequest, F as ComponentDefinitionAPIResponse, o as ComponentDefinitionDeleteParameters, m as ComponentDefinitionGetParameters, E as ComponentDefinitionGetResponse, I as ComponentDefinitionListAPIOptions, J as ComponentDefinitionParameter, N as ComponentDefinitionPermission, n as ComponentDefinitionPutParameters, M as ComponentDefinitionSlot, L as ComponentDefinitionSlugSettings, K as ComponentDefinitionVariant, p as ComponentInstance, q as ComponentParameter, W as CompositionAPIDeleteRequest, Y as CompositionAPIOptions, V as CompositionAPIResponse, a8 as CompositionDataDiagnostic, l as CompositionDeleteParameters, j as CompositionGetByIdParameters, h as CompositionGetByNodeIdParameters, a as CompositionGetByNodePathParameters, i as CompositionGetBySlugParameters, U as CompositionGetListResponse, S as CompositionGetOrderBy, C as CompositionGetParameters, b as CompositionGetResponse, f as CompositionGetValidResponses, a2 as CompositionIssue, X as CompositionListAPIResponse, a3 as CompositionPatternIssue, k as CompositionPutParameters, e as CompositionResolvedGetResponse, T as CompositionUIStatus, Q as CreatingComponentDefinition, a4 as DataElementBindingIssue, Z as DataElementConnectionDefinition, a7 as DataResolutionConfigIssue, g as DataResolutionOption, D as DataResolutionOptionNegative, c as DataResolutionOptionPositive, d as DataResolutionParameters, a0 as DataResourceDefinition, $ as DataResourceDefinitions, a5 as DataResourceIssue, a6 as DataResourceVariableIssue, _ as DataResourceVariables, ac as DataSource, v as DataSourceDeleteParameters, s as DataSourceGetParameters, a9 as DataSourceGetResponse, u as DataSourcePutParameters, t as DataSourcesGetParameters, aa as DataSourcesGetResponse, ab as DataType, z as DataTypeDeleteParameters, w as DataTypeGetParameters, x as DataTypeGetResponse, y as DataTypePutParameters, ad as DataVariableDefinition, P as PreviewEventBus, R as RootComponentInstance, B as createEventBus } from './createEventBus-db0afea5.js';
5
5
  import { Options as Options$1 } from 'p-retry';
6
6
  import { Options } from 'p-throttle';
7
7
  import { PersonalizedVariant, TestVariant } from '@uniformdev/context';
8
8
  import 'pusher-js';
9
9
 
10
- declare class CanvasClient extends ApiClient<ClientOptions> {
11
- constructor(options: ClientOptions);
12
- private canvasUrl;
10
+ type CanvasClientOptions = ClientOptions & {
11
+ edgeApiHost?: string;
12
+ };
13
+ declare class CanvasClient extends ApiClient<CanvasClientOptions> {
14
+ private edgeApiHost;
15
+ constructor(options: CanvasClientOptions);
13
16
  /** Fetches lists of Canvas compositions, optionally by type */
14
17
  getCompositionList(options?: Omit<CompositionGetParameters, 'projectId' | 'compositionId' | 'slug'>): Promise<{
15
18
  compositions: {
@@ -33,6 +36,11 @@ declare class CanvasClient extends ApiClient<ClientOptions> {
33
36
  };
34
37
  } | undefined;
35
38
  variant?: string | undefined;
39
+ projectMapNodes?: {
40
+ id: string;
41
+ path: string;
42
+ projectMapId: string;
43
+ }[] | undefined;
36
44
  slots?: {
37
45
  [key: string]: {
38
46
  type: string;
@@ -199,7 +207,7 @@ declare class CanvasClient extends ApiClient<ClientOptions> {
199
207
  removeComponentDefinition(body: Omit<ComponentDefinitionDeleteParameters, 'projectId'>): Promise<void>;
200
208
  }
201
209
  declare class UncachedCanvasClient extends CanvasClient {
202
- constructor(options: Omit<ClientOptions, 'bypassCache'>);
210
+ constructor(options: Omit<CanvasClientOptions, 'bypassCache'>);
203
211
  }
204
212
 
205
213
  type EnhancerContext = {
@@ -704,6 +712,11 @@ declare const createUniformApiEnhancer: ({ apiUrl }: {
704
712
  };
705
713
  } | undefined;
706
714
  variant?: string | undefined;
715
+ projectMapNodes?: {
716
+ id: string;
717
+ path: string;
718
+ projectMapId: string;
719
+ }[] | undefined;
707
720
  slots?: {
708
721
  [key: string]: {
709
722
  type: string;
package/dist/index.esm.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  nullLimitPolicy,
59
59
  subscribeToComposition,
60
60
  walkComponentTree
61
- } from "./chunk-D45SO56S.mjs";
61
+ } from "./chunk-RFV573P3.mjs";
62
62
  export {
63
63
  ApiClientError,
64
64
  BatchEntry,
package/dist/index.js CHANGED
@@ -513,17 +513,19 @@ function createLimitPolicy({
513
513
  var nullLimitPolicy = async (func) => await func();
514
514
 
515
515
  // src/CanvasClient.ts
516
+ var CANVAS_URL = "/api/v1/canvas";
516
517
  var CanvasClient = class extends import_api.ApiClient {
517
518
  constructor(options) {
519
+ var _a;
518
520
  if (!options.limitPolicy) {
519
521
  options.limitPolicy = createLimitPolicy({});
520
522
  }
521
523
  super(options);
522
- this.canvasUrl = "/api/v1/canvas";
524
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
523
525
  }
524
526
  async getCompositionList(options) {
525
527
  const { projectId } = this.options;
526
- const fetchUri = this.createUrl(this.canvasUrl, { ...options, projectId });
528
+ const fetchUri = this.createUrl(CANVAS_URL, { ...options, projectId });
527
529
  return await this.apiClient(fetchUri);
528
530
  }
529
531
  unstable_getCompositionByNodePath(options) {
@@ -545,20 +547,20 @@ var CanvasClient = class extends import_api.ApiClient {
545
547
  ...params
546
548
  }) {
547
549
  const { projectId } = this.options;
548
- const url = resolveData ? "/api/edge/v1/composition" : this.canvasUrl;
549
- const dataResolutionParams = {};
550
- if (resolveData) {
551
- if (dynamicVariables) {
552
- dataResolutionParams.dynamicVariables = JSON.stringify(dynamicVariables);
553
- }
554
- if (dataDiagnostics) {
555
- dataResolutionParams.dataDiagnostics = "true";
556
- }
550
+ if (!resolveData) {
551
+ return this.apiClient(this.createUrl(CANVAS_URL, { ...params, projectId }));
557
552
  }
558
- return this.apiClient(this.createUrl(url, { ...params, ...dataResolutionParams, projectId }));
553
+ const edgeParams = {
554
+ ...params,
555
+ projectId,
556
+ ...dynamicVariables ? { dynamicVariables: JSON.stringify(dynamicVariables) } : {},
557
+ ...dataDiagnostics ? { dataDiagnostics: "true" } : {}
558
+ };
559
+ const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
560
+ return this.apiClient(edgeUrl);
559
561
  }
560
562
  async updateComposition(body) {
561
- const fetchUri = this.createUrl("/api/v1/canvas");
563
+ const fetchUri = this.createUrl(CANVAS_URL);
562
564
  await this.apiClient(fetchUri, {
563
565
  method: "PUT",
564
566
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -566,7 +568,7 @@ var CanvasClient = class extends import_api.ApiClient {
566
568
  });
567
569
  }
568
570
  async removeComposition(body) {
569
- const fetchUri = this.createUrl("/api/v1/canvas");
571
+ const fetchUri = this.createUrl(CANVAS_URL);
570
572
  const { projectId } = this.options;
571
573
  await this.apiClient(fetchUri, {
572
574
  method: "DELETE",
package/dist/index.mjs CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  nullLimitPolicy,
59
59
  subscribeToComposition,
60
60
  walkComponentTree
61
- } from "./chunk-D45SO56S.mjs";
61
+ } from "./chunk-RFV573P3.mjs";
62
62
  export {
63
63
  ApiClientError,
64
64
  BatchEntry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "18.2.1",
3
+ "version": "18.3.1-alpha.21+5789df064",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -49,7 +49,7 @@
49
49
  "devDependencies": {
50
50
  "@types/retry": "0.12.1",
51
51
  "@types/yargs": "17.0.20",
52
- "@uniformdev/cli": "18.2.1",
52
+ "@uniformdev/cli": "18.3.1-alpha.21+5789df064",
53
53
  "p-limit": "4.0.0",
54
54
  "p-retry": "5.1.2",
55
55
  "p-throttle": "5.0.0",
@@ -57,7 +57,7 @@
57
57
  "yargs": "17.6.2"
58
58
  },
59
59
  "dependencies": {
60
- "@uniformdev/context": "18.2.1"
60
+ "@uniformdev/context": "18.3.1-alpha.21+5789df064"
61
61
  },
62
62
  "files": [
63
63
  "/dist"
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "c519c1d6b73c928ba0b795702d56fbb63fdd3c90"
68
+ "gitHead": "5789df064396b6ab274cdaf44743d48bc1542dc4"
69
69
  }