@uniformdev/canvas 19.119.0 → 19.121.1-alpha.3
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 +1 -1
- package/dist/index.d.mts +2681 -1226
- package/dist/index.d.ts +2681 -1226
- package/dist/index.esm.js +100 -5
- package/dist/index.js +108 -8
- package/dist/index.mjs +100 -5
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
@@ -925,12 +925,14 @@ function getComponentPath(ancestorsAndSelf) {
|
|
925
925
|
var CANVAS_PERSONALIZE_TYPE = "$personalization";
|
926
926
|
var CANVAS_TEST_TYPE = "$test";
|
927
927
|
var CANVAS_LOCALIZATION_TYPE = "$localization";
|
928
|
+
var CANVAS_SLOT_SECTION_TYPE = "$slotSection";
|
928
929
|
var CANVAS_INTENT_TAG_PARAM = "intentTag";
|
929
930
|
var CANVAS_LOCALE_TAG_PARAM = "locale";
|
930
931
|
var CANVAS_BLOCK_PARAM_TYPE = "$block";
|
931
932
|
var CANVAS_PERSONALIZE_SLOT = "pz";
|
932
933
|
var CANVAS_TEST_SLOT = "test";
|
933
934
|
var CANVAS_LOCALIZATION_SLOT = "localized";
|
935
|
+
var CANVAS_SLOT_SECTION_SLOT = "$slotSectionItems";
|
934
936
|
var CANVAS_DRAFT_STATE = 0;
|
935
937
|
var CANVAS_PUBLISHED_STATE = 64;
|
936
938
|
var CANVAS_EDITOR_STATE = 63;
|
@@ -2291,10 +2293,76 @@ var RelationshipClient = class extends ApiClient8 {
|
|
2291
2293
|
}
|
2292
2294
|
};
|
2293
2295
|
|
2294
|
-
// src/
|
2296
|
+
// src/ReleaseClient.ts
|
2295
2297
|
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
2298
|
+
var releasesUrl = "/api/v1/releases";
|
2299
|
+
var ReleaseClient = class extends ApiClient9 {
|
2300
|
+
constructor(options) {
|
2301
|
+
super(options);
|
2302
|
+
}
|
2303
|
+
/** Fetches all releases for a project */
|
2304
|
+
async get(options) {
|
2305
|
+
const { projectId } = this.options;
|
2306
|
+
const fetchUri = this.createUrl(releasesUrl, { ...options, projectId });
|
2307
|
+
return await this.apiClient(fetchUri);
|
2308
|
+
}
|
2309
|
+
/** Updates or creates (based on id) a release */
|
2310
|
+
async upsert(body) {
|
2311
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2312
|
+
await this.apiClient(fetchUri, {
|
2313
|
+
method: "PUT",
|
2314
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2315
|
+
expectNoContent: true
|
2316
|
+
});
|
2317
|
+
}
|
2318
|
+
/** Deletes a release */
|
2319
|
+
async remove(body) {
|
2320
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2321
|
+
await this.apiClient(fetchUri, {
|
2322
|
+
method: "DELETE",
|
2323
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2324
|
+
expectNoContent: true
|
2325
|
+
});
|
2326
|
+
}
|
2327
|
+
/** Readies or unreadies a release for merging */
|
2328
|
+
async ready(body) {
|
2329
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2330
|
+
await this.apiClient(fetchUri, {
|
2331
|
+
method: "PATCH",
|
2332
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2333
|
+
expectNoContent: true
|
2334
|
+
});
|
2335
|
+
}
|
2336
|
+
};
|
2337
|
+
|
2338
|
+
// src/ReleaseContentsClient.ts
|
2339
|
+
import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
|
2340
|
+
var releaseContentsUrl = "/api/v1/release-contents";
|
2341
|
+
var ReleaseContentsClient = class extends ApiClient10 {
|
2342
|
+
constructor(options) {
|
2343
|
+
super(options);
|
2344
|
+
}
|
2345
|
+
/** Fetches all entities added to a release */
|
2346
|
+
async get(options) {
|
2347
|
+
const { projectId } = this.options;
|
2348
|
+
const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
|
2349
|
+
return await this.apiClient(fetchUri);
|
2350
|
+
}
|
2351
|
+
/** Removes a release content from a release */
|
2352
|
+
async remove(body) {
|
2353
|
+
const fetchUri = this.createUrl(releaseContentsUrl);
|
2354
|
+
await this.apiClient(fetchUri, {
|
2355
|
+
method: "DELETE",
|
2356
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2357
|
+
expectNoContent: true
|
2358
|
+
});
|
2359
|
+
}
|
2360
|
+
};
|
2361
|
+
|
2362
|
+
// src/RouteClient.ts
|
2363
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
2296
2364
|
var ROUTE_URL = "/api/v1/route";
|
2297
|
-
var RouteClient = class extends
|
2365
|
+
var RouteClient = class extends ApiClient11 {
|
2298
2366
|
constructor(options) {
|
2299
2367
|
var _a;
|
2300
2368
|
if (!options.limitPolicy) {
|
@@ -2356,7 +2424,8 @@ function convertEntryToPutEntry(entry) {
|
|
2356
2424
|
},
|
2357
2425
|
pattern: entry.pattern,
|
2358
2426
|
state: entry.state,
|
2359
|
-
projectId: entry.projectId
|
2427
|
+
projectId: entry.projectId,
|
2428
|
+
releaseId: entry.releaseId
|
2360
2429
|
};
|
2361
2430
|
}
|
2362
2431
|
|
@@ -2433,6 +2502,7 @@ function mapSlotToTestVariations(slot) {
|
|
2433
2502
|
}
|
2434
2503
|
|
2435
2504
|
// src/utils/placeholder.ts
|
2505
|
+
var SEPARATOR = "_";
|
2436
2506
|
var isComponentPlaceholderId = (id) => {
|
2437
2507
|
if (id === PLACEHOLDER_ID) {
|
2438
2508
|
return true;
|
@@ -2442,11 +2512,31 @@ var isComponentPlaceholderId = (id) => {
|
|
2442
2512
|
}
|
2443
2513
|
return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
|
2444
2514
|
};
|
2445
|
-
var generateComponentPlaceholderId = (randomId, sdkVersion) => {
|
2515
|
+
var generateComponentPlaceholderId = (randomId, sdkVersion, parent) => {
|
2446
2516
|
if (typeof sdkVersion === "undefined" || sdkVersion === 1) {
|
2447
2517
|
return PLACEHOLDER_ID;
|
2448
2518
|
}
|
2449
|
-
|
2519
|
+
let idParts = [PLACEHOLDER_ID, randomId];
|
2520
|
+
if (parent) {
|
2521
|
+
idParts = [...idParts, parent.nodeId, parent.slotId];
|
2522
|
+
}
|
2523
|
+
return idParts.join(SEPARATOR);
|
2524
|
+
};
|
2525
|
+
var parseComponentPlaceholderId = (id) => {
|
2526
|
+
if (!isComponentPlaceholderId(id)) {
|
2527
|
+
return;
|
2528
|
+
}
|
2529
|
+
const idParts = id.split(SEPARATOR);
|
2530
|
+
const result = {
|
2531
|
+
id: idParts[1]
|
2532
|
+
};
|
2533
|
+
if (idParts[2]) {
|
2534
|
+
result.parent = {
|
2535
|
+
nodeId: idParts[2],
|
2536
|
+
slotId: idParts[3]
|
2537
|
+
};
|
2538
|
+
}
|
2539
|
+
return result;
|
2450
2540
|
};
|
2451
2541
|
|
2452
2542
|
// src/utils/variables/parseVariableExpression.ts
|
@@ -2663,6 +2753,8 @@ export {
|
|
2663
2753
|
CANVAS_PERSONALIZE_SLOT,
|
2664
2754
|
CANVAS_PERSONALIZE_TYPE,
|
2665
2755
|
CANVAS_PUBLISHED_STATE,
|
2756
|
+
CANVAS_SLOT_SECTION_SLOT,
|
2757
|
+
CANVAS_SLOT_SECTION_TYPE,
|
2666
2758
|
CANVAS_TEST_SLOT,
|
2667
2759
|
CANVAS_TEST_TYPE,
|
2668
2760
|
CANVAS_TEST_VARIANT_PARAM,
|
@@ -2692,6 +2784,8 @@ export {
|
|
2692
2784
|
PLACEHOLDER_ID,
|
2693
2785
|
PromptClient,
|
2694
2786
|
RelationshipClient,
|
2787
|
+
ReleaseClient,
|
2788
|
+
ReleaseContentsClient,
|
2695
2789
|
RouteClient,
|
2696
2790
|
SECRET_QUERY_STRING_PARAM,
|
2697
2791
|
UncachedCanvasClient,
|
@@ -2752,6 +2846,7 @@ export {
|
|
2752
2846
|
mapSlotToPersonalizedVariations,
|
2753
2847
|
mapSlotToTestVariations,
|
2754
2848
|
nullLimitPolicy,
|
2849
|
+
parseComponentPlaceholderId,
|
2755
2850
|
parseVariableExpression,
|
2756
2851
|
subscribeToComposition,
|
2757
2852
|
walkComponentTree,
|
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: () =>
|
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,
|
@@ -300,6 +300,8 @@ __export(src_exports, {
|
|
300
300
|
CANVAS_PERSONALIZE_SLOT: () => CANVAS_PERSONALIZE_SLOT,
|
301
301
|
CANVAS_PERSONALIZE_TYPE: () => CANVAS_PERSONALIZE_TYPE,
|
302
302
|
CANVAS_PUBLISHED_STATE: () => CANVAS_PUBLISHED_STATE,
|
303
|
+
CANVAS_SLOT_SECTION_SLOT: () => CANVAS_SLOT_SECTION_SLOT,
|
304
|
+
CANVAS_SLOT_SECTION_TYPE: () => CANVAS_SLOT_SECTION_TYPE,
|
303
305
|
CANVAS_TEST_SLOT: () => CANVAS_TEST_SLOT,
|
304
306
|
CANVAS_TEST_TYPE: () => CANVAS_TEST_TYPE,
|
305
307
|
CANVAS_TEST_VARIANT_PARAM: () => CANVAS_TEST_VARIANT_PARAM,
|
@@ -329,6 +331,8 @@ __export(src_exports, {
|
|
329
331
|
PLACEHOLDER_ID: () => PLACEHOLDER_ID,
|
330
332
|
PromptClient: () => PromptClient,
|
331
333
|
RelationshipClient: () => RelationshipClient,
|
334
|
+
ReleaseClient: () => ReleaseClient,
|
335
|
+
ReleaseContentsClient: () => ReleaseContentsClient,
|
332
336
|
RouteClient: () => RouteClient,
|
333
337
|
SECRET_QUERY_STRING_PARAM: () => SECRET_QUERY_STRING_PARAM,
|
334
338
|
UncachedCanvasClient: () => UncachedCanvasClient,
|
@@ -389,6 +393,7 @@ __export(src_exports, {
|
|
389
393
|
mapSlotToPersonalizedVariations: () => mapSlotToPersonalizedVariations,
|
390
394
|
mapSlotToTestVariations: () => mapSlotToTestVariations,
|
391
395
|
nullLimitPolicy: () => nullLimitPolicy,
|
396
|
+
parseComponentPlaceholderId: () => parseComponentPlaceholderId,
|
392
397
|
parseVariableExpression: () => parseVariableExpression,
|
393
398
|
subscribeToComposition: () => subscribeToComposition,
|
394
399
|
walkComponentTree: () => walkComponentTree,
|
@@ -1053,12 +1058,14 @@ function getComponentPath(ancestorsAndSelf) {
|
|
1053
1058
|
var CANVAS_PERSONALIZE_TYPE = "$personalization";
|
1054
1059
|
var CANVAS_TEST_TYPE = "$test";
|
1055
1060
|
var CANVAS_LOCALIZATION_TYPE = "$localization";
|
1061
|
+
var CANVAS_SLOT_SECTION_TYPE = "$slotSection";
|
1056
1062
|
var CANVAS_INTENT_TAG_PARAM = "intentTag";
|
1057
1063
|
var CANVAS_LOCALE_TAG_PARAM = "locale";
|
1058
1064
|
var CANVAS_BLOCK_PARAM_TYPE = "$block";
|
1059
1065
|
var CANVAS_PERSONALIZE_SLOT = "pz";
|
1060
1066
|
var CANVAS_TEST_SLOT = "test";
|
1061
1067
|
var CANVAS_LOCALIZATION_SLOT = "localized";
|
1068
|
+
var CANVAS_SLOT_SECTION_SLOT = "$slotSectionItems";
|
1062
1069
|
var CANVAS_DRAFT_STATE = 0;
|
1063
1070
|
var CANVAS_PUBLISHED_STATE = 64;
|
1064
1071
|
var CANVAS_EDITOR_STATE = 63;
|
@@ -2419,10 +2426,76 @@ var RelationshipClient = class extends import_api9.ApiClient {
|
|
2419
2426
|
}
|
2420
2427
|
};
|
2421
2428
|
|
2422
|
-
// src/
|
2429
|
+
// src/ReleaseClient.ts
|
2423
2430
|
var import_api10 = require("@uniformdev/context/api");
|
2431
|
+
var releasesUrl = "/api/v1/releases";
|
2432
|
+
var ReleaseClient = class extends import_api10.ApiClient {
|
2433
|
+
constructor(options) {
|
2434
|
+
super(options);
|
2435
|
+
}
|
2436
|
+
/** Fetches all releases for a project */
|
2437
|
+
async get(options) {
|
2438
|
+
const { projectId } = this.options;
|
2439
|
+
const fetchUri = this.createUrl(releasesUrl, { ...options, projectId });
|
2440
|
+
return await this.apiClient(fetchUri);
|
2441
|
+
}
|
2442
|
+
/** Updates or creates (based on id) a release */
|
2443
|
+
async upsert(body) {
|
2444
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2445
|
+
await this.apiClient(fetchUri, {
|
2446
|
+
method: "PUT",
|
2447
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2448
|
+
expectNoContent: true
|
2449
|
+
});
|
2450
|
+
}
|
2451
|
+
/** Deletes a release */
|
2452
|
+
async remove(body) {
|
2453
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2454
|
+
await this.apiClient(fetchUri, {
|
2455
|
+
method: "DELETE",
|
2456
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2457
|
+
expectNoContent: true
|
2458
|
+
});
|
2459
|
+
}
|
2460
|
+
/** Readies or unreadies a release for merging */
|
2461
|
+
async ready(body) {
|
2462
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2463
|
+
await this.apiClient(fetchUri, {
|
2464
|
+
method: "PATCH",
|
2465
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2466
|
+
expectNoContent: true
|
2467
|
+
});
|
2468
|
+
}
|
2469
|
+
};
|
2470
|
+
|
2471
|
+
// src/ReleaseContentsClient.ts
|
2472
|
+
var import_api11 = require("@uniformdev/context/api");
|
2473
|
+
var releaseContentsUrl = "/api/v1/release-contents";
|
2474
|
+
var ReleaseContentsClient = class extends import_api11.ApiClient {
|
2475
|
+
constructor(options) {
|
2476
|
+
super(options);
|
2477
|
+
}
|
2478
|
+
/** Fetches all entities added to a release */
|
2479
|
+
async get(options) {
|
2480
|
+
const { projectId } = this.options;
|
2481
|
+
const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
|
2482
|
+
return await this.apiClient(fetchUri);
|
2483
|
+
}
|
2484
|
+
/** Removes a release content from a release */
|
2485
|
+
async remove(body) {
|
2486
|
+
const fetchUri = this.createUrl(releaseContentsUrl);
|
2487
|
+
await this.apiClient(fetchUri, {
|
2488
|
+
method: "DELETE",
|
2489
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2490
|
+
expectNoContent: true
|
2491
|
+
});
|
2492
|
+
}
|
2493
|
+
};
|
2494
|
+
|
2495
|
+
// src/RouteClient.ts
|
2496
|
+
var import_api12 = require("@uniformdev/context/api");
|
2424
2497
|
var ROUTE_URL = "/api/v1/route";
|
2425
|
-
var RouteClient = class extends
|
2498
|
+
var RouteClient = class extends import_api12.ApiClient {
|
2426
2499
|
constructor(options) {
|
2427
2500
|
var _a;
|
2428
2501
|
if (!options.limitPolicy) {
|
@@ -2484,7 +2557,8 @@ function convertEntryToPutEntry(entry) {
|
|
2484
2557
|
},
|
2485
2558
|
pattern: entry.pattern,
|
2486
2559
|
state: entry.state,
|
2487
|
-
projectId: entry.projectId
|
2560
|
+
projectId: entry.projectId,
|
2561
|
+
releaseId: entry.releaseId
|
2488
2562
|
};
|
2489
2563
|
}
|
2490
2564
|
|
@@ -2561,6 +2635,7 @@ function mapSlotToTestVariations(slot) {
|
|
2561
2635
|
}
|
2562
2636
|
|
2563
2637
|
// src/utils/placeholder.ts
|
2638
|
+
var SEPARATOR = "_";
|
2564
2639
|
var isComponentPlaceholderId = (id) => {
|
2565
2640
|
if (id === PLACEHOLDER_ID) {
|
2566
2641
|
return true;
|
@@ -2570,11 +2645,31 @@ var isComponentPlaceholderId = (id) => {
|
|
2570
2645
|
}
|
2571
2646
|
return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
|
2572
2647
|
};
|
2573
|
-
var generateComponentPlaceholderId = (randomId, sdkVersion) => {
|
2648
|
+
var generateComponentPlaceholderId = (randomId, sdkVersion, parent) => {
|
2574
2649
|
if (typeof sdkVersion === "undefined" || sdkVersion === 1) {
|
2575
2650
|
return PLACEHOLDER_ID;
|
2576
2651
|
}
|
2577
|
-
|
2652
|
+
let idParts = [PLACEHOLDER_ID, randomId];
|
2653
|
+
if (parent) {
|
2654
|
+
idParts = [...idParts, parent.nodeId, parent.slotId];
|
2655
|
+
}
|
2656
|
+
return idParts.join(SEPARATOR);
|
2657
|
+
};
|
2658
|
+
var parseComponentPlaceholderId = (id) => {
|
2659
|
+
if (!isComponentPlaceholderId(id)) {
|
2660
|
+
return;
|
2661
|
+
}
|
2662
|
+
const idParts = id.split(SEPARATOR);
|
2663
|
+
const result = {
|
2664
|
+
id: idParts[1]
|
2665
|
+
};
|
2666
|
+
if (idParts[2]) {
|
2667
|
+
result.parent = {
|
2668
|
+
nodeId: idParts[2],
|
2669
|
+
slotId: idParts[3]
|
2670
|
+
};
|
2671
|
+
}
|
2672
|
+
return result;
|
2578
2673
|
};
|
2579
2674
|
|
2580
2675
|
// src/utils/variables/parseVariableExpression.ts
|
@@ -2765,8 +2860,8 @@ function handleRichTextNodeBinding(object, options) {
|
|
2765
2860
|
}
|
2766
2861
|
|
2767
2862
|
// src/index.ts
|
2768
|
-
var
|
2769
|
-
var CanvasClientError =
|
2863
|
+
var import_api13 = require("@uniformdev/context/api");
|
2864
|
+
var CanvasClientError = import_api13.ApiClientError;
|
2770
2865
|
// Annotate the CommonJS export names for ESM import in node:
|
2771
2866
|
0 && (module.exports = {
|
2772
2867
|
ASSETS_SOURCE_CUSTOM_URL,
|
@@ -2792,6 +2887,8 @@ var CanvasClientError = import_api11.ApiClientError;
|
|
2792
2887
|
CANVAS_PERSONALIZE_SLOT,
|
2793
2888
|
CANVAS_PERSONALIZE_TYPE,
|
2794
2889
|
CANVAS_PUBLISHED_STATE,
|
2890
|
+
CANVAS_SLOT_SECTION_SLOT,
|
2891
|
+
CANVAS_SLOT_SECTION_TYPE,
|
2795
2892
|
CANVAS_TEST_SLOT,
|
2796
2893
|
CANVAS_TEST_TYPE,
|
2797
2894
|
CANVAS_TEST_VARIANT_PARAM,
|
@@ -2821,6 +2918,8 @@ var CanvasClientError = import_api11.ApiClientError;
|
|
2821
2918
|
PLACEHOLDER_ID,
|
2822
2919
|
PromptClient,
|
2823
2920
|
RelationshipClient,
|
2921
|
+
ReleaseClient,
|
2922
|
+
ReleaseContentsClient,
|
2824
2923
|
RouteClient,
|
2825
2924
|
SECRET_QUERY_STRING_PARAM,
|
2826
2925
|
UncachedCanvasClient,
|
@@ -2881,6 +2980,7 @@ var CanvasClientError = import_api11.ApiClientError;
|
|
2881
2980
|
mapSlotToPersonalizedVariations,
|
2882
2981
|
mapSlotToTestVariations,
|
2883
2982
|
nullLimitPolicy,
|
2983
|
+
parseComponentPlaceholderId,
|
2884
2984
|
parseVariableExpression,
|
2885
2985
|
subscribeToComposition,
|
2886
2986
|
walkComponentTree,
|
package/dist/index.mjs
CHANGED
@@ -925,12 +925,14 @@ function getComponentPath(ancestorsAndSelf) {
|
|
925
925
|
var CANVAS_PERSONALIZE_TYPE = "$personalization";
|
926
926
|
var CANVAS_TEST_TYPE = "$test";
|
927
927
|
var CANVAS_LOCALIZATION_TYPE = "$localization";
|
928
|
+
var CANVAS_SLOT_SECTION_TYPE = "$slotSection";
|
928
929
|
var CANVAS_INTENT_TAG_PARAM = "intentTag";
|
929
930
|
var CANVAS_LOCALE_TAG_PARAM = "locale";
|
930
931
|
var CANVAS_BLOCK_PARAM_TYPE = "$block";
|
931
932
|
var CANVAS_PERSONALIZE_SLOT = "pz";
|
932
933
|
var CANVAS_TEST_SLOT = "test";
|
933
934
|
var CANVAS_LOCALIZATION_SLOT = "localized";
|
935
|
+
var CANVAS_SLOT_SECTION_SLOT = "$slotSectionItems";
|
934
936
|
var CANVAS_DRAFT_STATE = 0;
|
935
937
|
var CANVAS_PUBLISHED_STATE = 64;
|
936
938
|
var CANVAS_EDITOR_STATE = 63;
|
@@ -2291,10 +2293,76 @@ var RelationshipClient = class extends ApiClient8 {
|
|
2291
2293
|
}
|
2292
2294
|
};
|
2293
2295
|
|
2294
|
-
// src/
|
2296
|
+
// src/ReleaseClient.ts
|
2295
2297
|
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
2298
|
+
var releasesUrl = "/api/v1/releases";
|
2299
|
+
var ReleaseClient = class extends ApiClient9 {
|
2300
|
+
constructor(options) {
|
2301
|
+
super(options);
|
2302
|
+
}
|
2303
|
+
/** Fetches all releases for a project */
|
2304
|
+
async get(options) {
|
2305
|
+
const { projectId } = this.options;
|
2306
|
+
const fetchUri = this.createUrl(releasesUrl, { ...options, projectId });
|
2307
|
+
return await this.apiClient(fetchUri);
|
2308
|
+
}
|
2309
|
+
/** Updates or creates (based on id) a release */
|
2310
|
+
async upsert(body) {
|
2311
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2312
|
+
await this.apiClient(fetchUri, {
|
2313
|
+
method: "PUT",
|
2314
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2315
|
+
expectNoContent: true
|
2316
|
+
});
|
2317
|
+
}
|
2318
|
+
/** Deletes a release */
|
2319
|
+
async remove(body) {
|
2320
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2321
|
+
await this.apiClient(fetchUri, {
|
2322
|
+
method: "DELETE",
|
2323
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2324
|
+
expectNoContent: true
|
2325
|
+
});
|
2326
|
+
}
|
2327
|
+
/** Readies or unreadies a release for merging */
|
2328
|
+
async ready(body) {
|
2329
|
+
const fetchUri = this.createUrl(releasesUrl);
|
2330
|
+
await this.apiClient(fetchUri, {
|
2331
|
+
method: "PATCH",
|
2332
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2333
|
+
expectNoContent: true
|
2334
|
+
});
|
2335
|
+
}
|
2336
|
+
};
|
2337
|
+
|
2338
|
+
// src/ReleaseContentsClient.ts
|
2339
|
+
import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
|
2340
|
+
var releaseContentsUrl = "/api/v1/release-contents";
|
2341
|
+
var ReleaseContentsClient = class extends ApiClient10 {
|
2342
|
+
constructor(options) {
|
2343
|
+
super(options);
|
2344
|
+
}
|
2345
|
+
/** Fetches all entities added to a release */
|
2346
|
+
async get(options) {
|
2347
|
+
const { projectId } = this.options;
|
2348
|
+
const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
|
2349
|
+
return await this.apiClient(fetchUri);
|
2350
|
+
}
|
2351
|
+
/** Removes a release content from a release */
|
2352
|
+
async remove(body) {
|
2353
|
+
const fetchUri = this.createUrl(releaseContentsUrl);
|
2354
|
+
await this.apiClient(fetchUri, {
|
2355
|
+
method: "DELETE",
|
2356
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2357
|
+
expectNoContent: true
|
2358
|
+
});
|
2359
|
+
}
|
2360
|
+
};
|
2361
|
+
|
2362
|
+
// src/RouteClient.ts
|
2363
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
2296
2364
|
var ROUTE_URL = "/api/v1/route";
|
2297
|
-
var RouteClient = class extends
|
2365
|
+
var RouteClient = class extends ApiClient11 {
|
2298
2366
|
constructor(options) {
|
2299
2367
|
var _a;
|
2300
2368
|
if (!options.limitPolicy) {
|
@@ -2356,7 +2424,8 @@ function convertEntryToPutEntry(entry) {
|
|
2356
2424
|
},
|
2357
2425
|
pattern: entry.pattern,
|
2358
2426
|
state: entry.state,
|
2359
|
-
projectId: entry.projectId
|
2427
|
+
projectId: entry.projectId,
|
2428
|
+
releaseId: entry.releaseId
|
2360
2429
|
};
|
2361
2430
|
}
|
2362
2431
|
|
@@ -2433,6 +2502,7 @@ function mapSlotToTestVariations(slot) {
|
|
2433
2502
|
}
|
2434
2503
|
|
2435
2504
|
// src/utils/placeholder.ts
|
2505
|
+
var SEPARATOR = "_";
|
2436
2506
|
var isComponentPlaceholderId = (id) => {
|
2437
2507
|
if (id === PLACEHOLDER_ID) {
|
2438
2508
|
return true;
|
@@ -2442,11 +2512,31 @@ var isComponentPlaceholderId = (id) => {
|
|
2442
2512
|
}
|
2443
2513
|
return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
|
2444
2514
|
};
|
2445
|
-
var generateComponentPlaceholderId = (randomId, sdkVersion) => {
|
2515
|
+
var generateComponentPlaceholderId = (randomId, sdkVersion, parent) => {
|
2446
2516
|
if (typeof sdkVersion === "undefined" || sdkVersion === 1) {
|
2447
2517
|
return PLACEHOLDER_ID;
|
2448
2518
|
}
|
2449
|
-
|
2519
|
+
let idParts = [PLACEHOLDER_ID, randomId];
|
2520
|
+
if (parent) {
|
2521
|
+
idParts = [...idParts, parent.nodeId, parent.slotId];
|
2522
|
+
}
|
2523
|
+
return idParts.join(SEPARATOR);
|
2524
|
+
};
|
2525
|
+
var parseComponentPlaceholderId = (id) => {
|
2526
|
+
if (!isComponentPlaceholderId(id)) {
|
2527
|
+
return;
|
2528
|
+
}
|
2529
|
+
const idParts = id.split(SEPARATOR);
|
2530
|
+
const result = {
|
2531
|
+
id: idParts[1]
|
2532
|
+
};
|
2533
|
+
if (idParts[2]) {
|
2534
|
+
result.parent = {
|
2535
|
+
nodeId: idParts[2],
|
2536
|
+
slotId: idParts[3]
|
2537
|
+
};
|
2538
|
+
}
|
2539
|
+
return result;
|
2450
2540
|
};
|
2451
2541
|
|
2452
2542
|
// src/utils/variables/parseVariableExpression.ts
|
@@ -2663,6 +2753,8 @@ export {
|
|
2663
2753
|
CANVAS_PERSONALIZE_SLOT,
|
2664
2754
|
CANVAS_PERSONALIZE_TYPE,
|
2665
2755
|
CANVAS_PUBLISHED_STATE,
|
2756
|
+
CANVAS_SLOT_SECTION_SLOT,
|
2757
|
+
CANVAS_SLOT_SECTION_TYPE,
|
2666
2758
|
CANVAS_TEST_SLOT,
|
2667
2759
|
CANVAS_TEST_TYPE,
|
2668
2760
|
CANVAS_TEST_VARIANT_PARAM,
|
@@ -2692,6 +2784,8 @@ export {
|
|
2692
2784
|
PLACEHOLDER_ID,
|
2693
2785
|
PromptClient,
|
2694
2786
|
RelationshipClient,
|
2787
|
+
ReleaseClient,
|
2788
|
+
ReleaseContentsClient,
|
2695
2789
|
RouteClient,
|
2696
2790
|
SECRET_QUERY_STRING_PARAM,
|
2697
2791
|
UncachedCanvasClient,
|
@@ -2752,6 +2846,7 @@ export {
|
|
2752
2846
|
mapSlotToPersonalizedVariations,
|
2753
2847
|
mapSlotToTestVariations,
|
2754
2848
|
nullLimitPolicy,
|
2849
|
+
parseComponentPlaceholderId,
|
2755
2850
|
parseVariableExpression,
|
2756
2851
|
subscribeToComposition,
|
2757
2852
|
walkComponentTree,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.121.1-alpha.3+7d8c709610",
|
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.
|
42
|
-
"@uniformdev/context": "19.
|
41
|
+
"@uniformdev/assets": "19.121.1-alpha.3+7d8c709610",
|
42
|
+
"@uniformdev/context": "19.121.1-alpha.3+7d8c709610",
|
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": "
|
51
|
+
"gitHead": "7d8c70961033e6ec47b7f8874b5e49b224367cf5"
|
52
52
|
}
|