@uniformdev/canvas 19.79.1-alpha.13 → 19.79.1-alpha.18

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.esm.js CHANGED
@@ -643,12 +643,22 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
643
643
  }
644
644
  getEntries(options) {
645
645
  const { projectId } = this.options;
646
- const { skipDataResolution, ...params } = options;
646
+ const { skipDataResolution, filters, ...params } = options;
647
+ const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
648
+ const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
649
+ let rhs = typeof value === "object" ? Object.values(value)[0] : value;
650
+ rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
651
+ return { ...acc, [lhs]: rhs };
652
+ }, {});
647
653
  if (skipDataResolution) {
648
- const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId });
654
+ const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
649
655
  return this.apiClient(url);
650
656
  }
651
- const edgeUrl = this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
657
+ const edgeUrl = this.createUrl(
658
+ __privateGet(_ContentClient, _entriesUrl),
659
+ { ...this.getEdgeOptions(params), ...rewrittenFilters },
660
+ this.edgeApiHost
661
+ );
652
662
  return this.apiClient(
653
663
  edgeUrl,
654
664
  this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
@@ -2281,10 +2291,76 @@ var RelationshipClient = class extends ApiClient8 {
2281
2291
  }
2282
2292
  };
2283
2293
 
2284
- // src/RouteClient.ts
2294
+ // src/ReleaseClient.ts
2285
2295
  import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
2296
+ var releasesUrl = "/api/v1/releases";
2297
+ var ReleaseClient = class extends ApiClient9 {
2298
+ constructor(options) {
2299
+ super(options);
2300
+ }
2301
+ /** Fetches all releases for a project */
2302
+ async get(options) {
2303
+ const { projectId } = this.options;
2304
+ const fetchUri = this.createUrl(releasesUrl, { ...options, projectId });
2305
+ return await this.apiClient(fetchUri);
2306
+ }
2307
+ /** Updates or creates (based on id) a release */
2308
+ async upsert(body) {
2309
+ const fetchUri = this.createUrl(releasesUrl);
2310
+ await this.apiClient(fetchUri, {
2311
+ method: "PUT",
2312
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2313
+ expectNoContent: true
2314
+ });
2315
+ }
2316
+ /** Deletes a release */
2317
+ async remove(body) {
2318
+ const fetchUri = this.createUrl(releasesUrl);
2319
+ await this.apiClient(fetchUri, {
2320
+ method: "DELETE",
2321
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2322
+ expectNoContent: true
2323
+ });
2324
+ }
2325
+ /** Readies or unreadies a release for merging */
2326
+ async ready(body) {
2327
+ const fetchUri = this.createUrl(releasesUrl);
2328
+ await this.apiClient(fetchUri, {
2329
+ method: "PATCH",
2330
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2331
+ expectNoContent: true
2332
+ });
2333
+ }
2334
+ };
2335
+
2336
+ // src/ReleaseContentsClient.ts
2337
+ import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
2338
+ var releaseContentsUrl = "/api/v1/release-contents";
2339
+ var ReleaseContentsClient = class extends ApiClient10 {
2340
+ constructor(options) {
2341
+ super(options);
2342
+ }
2343
+ /** Fetches all entities added to a release */
2344
+ async get(options) {
2345
+ const { projectId } = this.options;
2346
+ const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
2347
+ return await this.apiClient(fetchUri);
2348
+ }
2349
+ /** Removes a release content from a release */
2350
+ async remove(body) {
2351
+ const fetchUri = this.createUrl(releaseContentsUrl);
2352
+ await this.apiClient(fetchUri, {
2353
+ method: "DELETE",
2354
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2355
+ expectNoContent: true
2356
+ });
2357
+ }
2358
+ };
2359
+
2360
+ // src/RouteClient.ts
2361
+ import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
2286
2362
  var ROUTE_URL = "/api/v1/route";
2287
- var RouteClient = class extends ApiClient9 {
2363
+ var RouteClient = class extends ApiClient11 {
2288
2364
  constructor(options) {
2289
2365
  var _a;
2290
2366
  if (!options.limitPolicy) {
@@ -2344,8 +2420,10 @@ function convertEntryToPutEntry(entry) {
2344
2420
  fields: entry.entry.fields,
2345
2421
  _locales: entry.entry._locales
2346
2422
  },
2423
+ pattern: entry.pattern,
2347
2424
  state: entry.state,
2348
- projectId: entry.projectId
2425
+ projectId: entry.projectId,
2426
+ releaseId: entry.releaseId
2349
2427
  };
2350
2428
  }
2351
2429
 
@@ -2681,6 +2759,8 @@ export {
2681
2759
  PLACEHOLDER_ID,
2682
2760
  PromptClient,
2683
2761
  RelationshipClient,
2762
+ ReleaseClient,
2763
+ ReleaseContentsClient,
2684
2764
  RouteClient,
2685
2765
  SECRET_QUERY_STRING_PARAM,
2686
2766
  UncachedCanvasClient,
package/dist/index.js CHANGED
@@ -286,7 +286,7 @@ __export(src_exports, {
286
286
  ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
287
287
  ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
288
288
  ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
289
- ApiClientError: () => import_api11.ApiClientError,
289
+ ApiClientError: () => import_api13.ApiClientError,
290
290
  BatchEntry: () => BatchEntry,
291
291
  CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
292
292
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
@@ -329,6 +329,8 @@ __export(src_exports, {
329
329
  PLACEHOLDER_ID: () => PLACEHOLDER_ID,
330
330
  PromptClient: () => PromptClient,
331
331
  RelationshipClient: () => RelationshipClient,
332
+ ReleaseClient: () => ReleaseClient,
333
+ ReleaseContentsClient: () => ReleaseContentsClient,
332
334
  RouteClient: () => RouteClient,
333
335
  SECRET_QUERY_STRING_PARAM: () => SECRET_QUERY_STRING_PARAM,
334
336
  UncachedCanvasClient: () => UncachedCanvasClient,
@@ -771,12 +773,22 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
771
773
  }
772
774
  getEntries(options) {
773
775
  const { projectId } = this.options;
774
- const { skipDataResolution, ...params } = options;
776
+ const { skipDataResolution, filters, ...params } = options;
777
+ const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
778
+ const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
779
+ let rhs = typeof value === "object" ? Object.values(value)[0] : value;
780
+ rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
781
+ return { ...acc, [lhs]: rhs };
782
+ }, {});
775
783
  if (skipDataResolution) {
776
- const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId });
784
+ const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
777
785
  return this.apiClient(url);
778
786
  }
779
- const edgeUrl = this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
787
+ const edgeUrl = this.createUrl(
788
+ __privateGet(_ContentClient, _entriesUrl),
789
+ { ...this.getEdgeOptions(params), ...rewrittenFilters },
790
+ this.edgeApiHost
791
+ );
780
792
  return this.apiClient(
781
793
  edgeUrl,
782
794
  this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
@@ -2409,10 +2421,76 @@ var RelationshipClient = class extends import_api9.ApiClient {
2409
2421
  }
2410
2422
  };
2411
2423
 
2412
- // src/RouteClient.ts
2424
+ // src/ReleaseClient.ts
2413
2425
  var import_api10 = require("@uniformdev/context/api");
2426
+ var releasesUrl = "/api/v1/releases";
2427
+ var ReleaseClient = class extends import_api10.ApiClient {
2428
+ constructor(options) {
2429
+ super(options);
2430
+ }
2431
+ /** Fetches all releases for a project */
2432
+ async get(options) {
2433
+ const { projectId } = this.options;
2434
+ const fetchUri = this.createUrl(releasesUrl, { ...options, projectId });
2435
+ return await this.apiClient(fetchUri);
2436
+ }
2437
+ /** Updates or creates (based on id) a release */
2438
+ async upsert(body) {
2439
+ const fetchUri = this.createUrl(releasesUrl);
2440
+ await this.apiClient(fetchUri, {
2441
+ method: "PUT",
2442
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2443
+ expectNoContent: true
2444
+ });
2445
+ }
2446
+ /** Deletes a release */
2447
+ async remove(body) {
2448
+ const fetchUri = this.createUrl(releasesUrl);
2449
+ await this.apiClient(fetchUri, {
2450
+ method: "DELETE",
2451
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2452
+ expectNoContent: true
2453
+ });
2454
+ }
2455
+ /** Readies or unreadies a release for merging */
2456
+ async ready(body) {
2457
+ const fetchUri = this.createUrl(releasesUrl);
2458
+ await this.apiClient(fetchUri, {
2459
+ method: "PATCH",
2460
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2461
+ expectNoContent: true
2462
+ });
2463
+ }
2464
+ };
2465
+
2466
+ // src/ReleaseContentsClient.ts
2467
+ var import_api11 = require("@uniformdev/context/api");
2468
+ var releaseContentsUrl = "/api/v1/release-contents";
2469
+ var ReleaseContentsClient = class extends import_api11.ApiClient {
2470
+ constructor(options) {
2471
+ super(options);
2472
+ }
2473
+ /** Fetches all entities added to a release */
2474
+ async get(options) {
2475
+ const { projectId } = this.options;
2476
+ const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
2477
+ return await this.apiClient(fetchUri);
2478
+ }
2479
+ /** Removes a release content from a release */
2480
+ async remove(body) {
2481
+ const fetchUri = this.createUrl(releaseContentsUrl);
2482
+ await this.apiClient(fetchUri, {
2483
+ method: "DELETE",
2484
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2485
+ expectNoContent: true
2486
+ });
2487
+ }
2488
+ };
2489
+
2490
+ // src/RouteClient.ts
2491
+ var import_api12 = require("@uniformdev/context/api");
2414
2492
  var ROUTE_URL = "/api/v1/route";
2415
- var RouteClient = class extends import_api10.ApiClient {
2493
+ var RouteClient = class extends import_api12.ApiClient {
2416
2494
  constructor(options) {
2417
2495
  var _a;
2418
2496
  if (!options.limitPolicy) {
@@ -2472,8 +2550,10 @@ function convertEntryToPutEntry(entry) {
2472
2550
  fields: entry.entry.fields,
2473
2551
  _locales: entry.entry._locales
2474
2552
  },
2553
+ pattern: entry.pattern,
2475
2554
  state: entry.state,
2476
- projectId: entry.projectId
2555
+ projectId: entry.projectId,
2556
+ releaseId: entry.releaseId
2477
2557
  };
2478
2558
  }
2479
2559
 
@@ -2754,8 +2834,8 @@ function handleRichTextNodeBinding(object, options) {
2754
2834
  }
2755
2835
 
2756
2836
  // src/index.ts
2757
- var import_api11 = require("@uniformdev/context/api");
2758
- var CanvasClientError = import_api11.ApiClientError;
2837
+ var import_api13 = require("@uniformdev/context/api");
2838
+ var CanvasClientError = import_api13.ApiClientError;
2759
2839
  // Annotate the CommonJS export names for ESM import in node:
2760
2840
  0 && (module.exports = {
2761
2841
  ASSETS_SOURCE_CUSTOM_URL,
@@ -2810,6 +2890,8 @@ var CanvasClientError = import_api11.ApiClientError;
2810
2890
  PLACEHOLDER_ID,
2811
2891
  PromptClient,
2812
2892
  RelationshipClient,
2893
+ ReleaseClient,
2894
+ ReleaseContentsClient,
2813
2895
  RouteClient,
2814
2896
  SECRET_QUERY_STRING_PARAM,
2815
2897
  UncachedCanvasClient,
package/dist/index.mjs CHANGED
@@ -643,12 +643,22 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
643
643
  }
644
644
  getEntries(options) {
645
645
  const { projectId } = this.options;
646
- const { skipDataResolution, ...params } = options;
646
+ const { skipDataResolution, filters, ...params } = options;
647
+ const rewrittenFilters = Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
648
+ const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
649
+ let rhs = typeof value === "object" ? Object.values(value)[0] : value;
650
+ rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
651
+ return { ...acc, [lhs]: rhs };
652
+ }, {});
647
653
  if (skipDataResolution) {
648
- const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId });
654
+ const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
649
655
  return this.apiClient(url);
650
656
  }
651
- const edgeUrl = this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
657
+ const edgeUrl = this.createUrl(
658
+ __privateGet(_ContentClient, _entriesUrl),
659
+ { ...this.getEdgeOptions(params), ...rewrittenFilters },
660
+ this.edgeApiHost
661
+ );
652
662
  return this.apiClient(
653
663
  edgeUrl,
654
664
  this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
@@ -2281,10 +2291,76 @@ var RelationshipClient = class extends ApiClient8 {
2281
2291
  }
2282
2292
  };
2283
2293
 
2284
- // src/RouteClient.ts
2294
+ // src/ReleaseClient.ts
2285
2295
  import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
2296
+ var releasesUrl = "/api/v1/releases";
2297
+ var ReleaseClient = class extends ApiClient9 {
2298
+ constructor(options) {
2299
+ super(options);
2300
+ }
2301
+ /** Fetches all releases for a project */
2302
+ async get(options) {
2303
+ const { projectId } = this.options;
2304
+ const fetchUri = this.createUrl(releasesUrl, { ...options, projectId });
2305
+ return await this.apiClient(fetchUri);
2306
+ }
2307
+ /** Updates or creates (based on id) a release */
2308
+ async upsert(body) {
2309
+ const fetchUri = this.createUrl(releasesUrl);
2310
+ await this.apiClient(fetchUri, {
2311
+ method: "PUT",
2312
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2313
+ expectNoContent: true
2314
+ });
2315
+ }
2316
+ /** Deletes a release */
2317
+ async remove(body) {
2318
+ const fetchUri = this.createUrl(releasesUrl);
2319
+ await this.apiClient(fetchUri, {
2320
+ method: "DELETE",
2321
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2322
+ expectNoContent: true
2323
+ });
2324
+ }
2325
+ /** Readies or unreadies a release for merging */
2326
+ async ready(body) {
2327
+ const fetchUri = this.createUrl(releasesUrl);
2328
+ await this.apiClient(fetchUri, {
2329
+ method: "PATCH",
2330
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2331
+ expectNoContent: true
2332
+ });
2333
+ }
2334
+ };
2335
+
2336
+ // src/ReleaseContentsClient.ts
2337
+ import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
2338
+ var releaseContentsUrl = "/api/v1/release-contents";
2339
+ var ReleaseContentsClient = class extends ApiClient10 {
2340
+ constructor(options) {
2341
+ super(options);
2342
+ }
2343
+ /** Fetches all entities added to a release */
2344
+ async get(options) {
2345
+ const { projectId } = this.options;
2346
+ const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
2347
+ return await this.apiClient(fetchUri);
2348
+ }
2349
+ /** Removes a release content from a release */
2350
+ async remove(body) {
2351
+ const fetchUri = this.createUrl(releaseContentsUrl);
2352
+ await this.apiClient(fetchUri, {
2353
+ method: "DELETE",
2354
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2355
+ expectNoContent: true
2356
+ });
2357
+ }
2358
+ };
2359
+
2360
+ // src/RouteClient.ts
2361
+ import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
2286
2362
  var ROUTE_URL = "/api/v1/route";
2287
- var RouteClient = class extends ApiClient9 {
2363
+ var RouteClient = class extends ApiClient11 {
2288
2364
  constructor(options) {
2289
2365
  var _a;
2290
2366
  if (!options.limitPolicy) {
@@ -2344,8 +2420,10 @@ function convertEntryToPutEntry(entry) {
2344
2420
  fields: entry.entry.fields,
2345
2421
  _locales: entry.entry._locales
2346
2422
  },
2423
+ pattern: entry.pattern,
2347
2424
  state: entry.state,
2348
- projectId: entry.projectId
2425
+ projectId: entry.projectId,
2426
+ releaseId: entry.releaseId
2349
2427
  };
2350
2428
  }
2351
2429
 
@@ -2681,6 +2759,8 @@ export {
2681
2759
  PLACEHOLDER_ID,
2682
2760
  PromptClient,
2683
2761
  RelationshipClient,
2762
+ ReleaseClient,
2763
+ ReleaseContentsClient,
2684
2764
  RouteClient,
2685
2765
  SECRET_QUERY_STRING_PARAM,
2686
2766
  UncachedCanvasClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.79.1-alpha.13+608a273da",
3
+ "version": "19.79.1-alpha.18+12234b9350",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -38,8 +38,8 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/assets": "19.79.1-alpha.13+608a273da",
42
- "@uniformdev/context": "19.79.1-alpha.13+608a273da",
41
+ "@uniformdev/assets": "19.79.1-alpha.18+12234b9350",
42
+ "@uniformdev/context": "19.79.1-alpha.18+12234b9350",
43
43
  "immer": "10.0.3"
44
44
  },
45
45
  "files": [
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "608a273da87aa432f17b2c8ce15d747dadab0cd1"
51
+ "gitHead": "12234b9350cfa4209bc7e242701d2dc535ece19e"
52
52
  }