@uniformdev/canvas 20.50.2-alpha.1 → 20.50.2-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1510 -1034
- package/dist/index.d.ts +1510 -1034
- package/dist/index.esm.js +92 -40
- package/dist/index.js +97 -41
- package/dist/index.mjs +92 -40
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -380,7 +380,7 @@ var require_retry2 = __commonJS({
|
|
|
380
380
|
});
|
|
381
381
|
|
|
382
382
|
// src/CanvasClient.ts
|
|
383
|
-
import { ApiClient } from "@uniformdev/context/api";
|
|
383
|
+
import { ApiClient, rewriteFiltersForApi } from "@uniformdev/context/api";
|
|
384
384
|
|
|
385
385
|
// src/enhancement/createLimitPolicy.ts
|
|
386
386
|
var import_p_limit = __toESM(require_p_limit());
|
|
@@ -584,22 +584,6 @@ function createLimitPolicy({
|
|
|
584
584
|
}
|
|
585
585
|
var nullLimitPolicy = async (func) => await func();
|
|
586
586
|
|
|
587
|
-
// src/utils/rewriteFilters.ts
|
|
588
|
-
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
|
589
|
-
function rewriteFilters(filters) {
|
|
590
|
-
return Object.entries(filters != null ? filters : {}).reduce(
|
|
591
|
-
(acc, [key, value]) => {
|
|
592
|
-
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
|
593
|
-
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
|
594
|
-
return {
|
|
595
|
-
...acc,
|
|
596
|
-
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
|
597
|
-
};
|
|
598
|
-
},
|
|
599
|
-
{}
|
|
600
|
-
);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
587
|
// src/CanvasClient.ts
|
|
604
588
|
var CANVAS_URL = "/api/v1/canvas";
|
|
605
589
|
var CanvasClient = class extends ApiClient {
|
|
@@ -616,7 +600,7 @@ var CanvasClient = class extends ApiClient {
|
|
|
616
600
|
async getCompositionList(params = {}) {
|
|
617
601
|
const { projectId } = this.options;
|
|
618
602
|
const { resolveData, filters, ...originParams } = params;
|
|
619
|
-
const rewrittenFilters =
|
|
603
|
+
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
620
604
|
if (!resolveData) {
|
|
621
605
|
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
|
622
606
|
return this.apiClient(fetchUri);
|
|
@@ -770,7 +754,7 @@ var UncachedCategoryClient = class extends CategoryClient {
|
|
|
770
754
|
};
|
|
771
755
|
|
|
772
756
|
// src/ContentClient.ts
|
|
773
|
-
import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
|
|
757
|
+
import { ApiClient as ApiClient3, rewriteFiltersForApi as rewriteFiltersForApi2 } from "@uniformdev/context/api";
|
|
774
758
|
var _contentTypesUrl, _entriesUrl;
|
|
775
759
|
var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
776
760
|
constructor(options) {
|
|
@@ -786,7 +770,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
|
786
770
|
getEntries(options) {
|
|
787
771
|
const { projectId } = this.options;
|
|
788
772
|
const { skipDataResolution, filters, ...params } = options;
|
|
789
|
-
const rewrittenFilters =
|
|
773
|
+
const rewrittenFilters = rewriteFiltersForApi2(filters);
|
|
790
774
|
if (skipDataResolution) {
|
|
791
775
|
const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
|
792
776
|
return this.apiClient(url);
|
|
@@ -2627,10 +2611,47 @@ _baseUrl = new WeakMap();
|
|
|
2627
2611
|
__privateAdd(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
2628
2612
|
var IntegrationPropertyEditorsClient = _IntegrationPropertyEditorsClient;
|
|
2629
2613
|
|
|
2630
|
-
// src/
|
|
2614
|
+
// src/LabelClient.ts
|
|
2631
2615
|
import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
|
|
2616
|
+
var LABELS_URL = "/api/v1/labels";
|
|
2617
|
+
var LabelClient = class extends ApiClient8 {
|
|
2618
|
+
/** Fetches labels for the current project. */
|
|
2619
|
+
async getLabels(options) {
|
|
2620
|
+
const { projectId } = this.options;
|
|
2621
|
+
const fetchUri = this.createUrl(LABELS_URL, { ...options, projectId });
|
|
2622
|
+
return await this.apiClient(fetchUri);
|
|
2623
|
+
}
|
|
2624
|
+
/** Updates or creates a label. */
|
|
2625
|
+
async upsertLabel(body) {
|
|
2626
|
+
const { projectId } = this.options;
|
|
2627
|
+
const fetchUri = this.createUrl(LABELS_URL);
|
|
2628
|
+
await this.apiClient(fetchUri, {
|
|
2629
|
+
method: "PUT",
|
|
2630
|
+
body: JSON.stringify({ ...body, projectId }),
|
|
2631
|
+
expectNoContent: true
|
|
2632
|
+
});
|
|
2633
|
+
}
|
|
2634
|
+
/** Deletes a label by id. */
|
|
2635
|
+
async removeLabel(options) {
|
|
2636
|
+
const { projectId } = this.options;
|
|
2637
|
+
const fetchUri = this.createUrl(LABELS_URL);
|
|
2638
|
+
await this.apiClient(fetchUri, {
|
|
2639
|
+
method: "DELETE",
|
|
2640
|
+
body: JSON.stringify({ ...options, projectId }),
|
|
2641
|
+
expectNoContent: true
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
};
|
|
2645
|
+
var UncachedLabelClient = class extends LabelClient {
|
|
2646
|
+
constructor(options) {
|
|
2647
|
+
super({ ...options, bypassCache: true });
|
|
2648
|
+
}
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
// src/LocaleClient.ts
|
|
2652
|
+
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
|
2632
2653
|
var localesUrl = "/api/v1/locales";
|
|
2633
|
-
var LocaleClient = class extends
|
|
2654
|
+
var LocaleClient = class extends ApiClient9 {
|
|
2634
2655
|
constructor(options) {
|
|
2635
2656
|
super(options);
|
|
2636
2657
|
}
|
|
@@ -2685,6 +2706,12 @@ var isSelectComponentMessage = (message) => {
|
|
|
2685
2706
|
var isReadyMessage = (message) => {
|
|
2686
2707
|
return message.type === "ready";
|
|
2687
2708
|
};
|
|
2709
|
+
var isSessionPendingMessage = (message) => {
|
|
2710
|
+
return message.type === "session-pending";
|
|
2711
|
+
};
|
|
2712
|
+
var isAwaitingReadyMessage = (message) => {
|
|
2713
|
+
return message.type === "awaiting-ready";
|
|
2714
|
+
};
|
|
2688
2715
|
var isComponentActionMessage = (message) => {
|
|
2689
2716
|
return message.type === "trigger-component-action";
|
|
2690
2717
|
};
|
|
@@ -2787,6 +2814,14 @@ var createCanvasChannel = ({
|
|
|
2787
2814
|
};
|
|
2788
2815
|
postMessage(message);
|
|
2789
2816
|
};
|
|
2817
|
+
const sessionPending = () => {
|
|
2818
|
+
const message = { type: "session-pending" };
|
|
2819
|
+
postMessage(message);
|
|
2820
|
+
};
|
|
2821
|
+
const awaitingReady = () => {
|
|
2822
|
+
const message = { type: "awaiting-ready" };
|
|
2823
|
+
postMessage(message);
|
|
2824
|
+
};
|
|
2790
2825
|
const on = (types, handler) => {
|
|
2791
2826
|
const handlerId = ++handlerCounter;
|
|
2792
2827
|
handlers[handlerId] = {
|
|
@@ -2986,6 +3021,8 @@ var createCanvasChannel = ({
|
|
|
2986
3021
|
return {
|
|
2987
3022
|
broadcastTo: broadcastToItems,
|
|
2988
3023
|
ready,
|
|
3024
|
+
sessionPending,
|
|
3025
|
+
awaitingReady,
|
|
2989
3026
|
destroy,
|
|
2990
3027
|
addBroadcastTarget,
|
|
2991
3028
|
triggerComponentAction,
|
|
@@ -3016,10 +3053,10 @@ var createCanvasChannel = ({
|
|
|
3016
3053
|
};
|
|
3017
3054
|
|
|
3018
3055
|
// src/PreviewClient.ts
|
|
3019
|
-
import { ApiClient as
|
|
3056
|
+
import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
|
|
3020
3057
|
var previewUrlsUrl = "/api/v1/preview-urls";
|
|
3021
3058
|
var previewViewportsUrl = "/api/v1/preview-viewports";
|
|
3022
|
-
var PreviewClient = class extends
|
|
3059
|
+
var PreviewClient = class extends ApiClient10 {
|
|
3023
3060
|
constructor(options) {
|
|
3024
3061
|
super(options);
|
|
3025
3062
|
}
|
|
@@ -3082,9 +3119,9 @@ var PreviewClient = class extends ApiClient9 {
|
|
|
3082
3119
|
};
|
|
3083
3120
|
|
|
3084
3121
|
// src/ProjectClient.ts
|
|
3085
|
-
import { ApiClient as
|
|
3086
|
-
var _url2;
|
|
3087
|
-
var _ProjectClient = class _ProjectClient extends
|
|
3122
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
|
3123
|
+
var _url2, _projectsUrl;
|
|
3124
|
+
var _ProjectClient = class _ProjectClient extends ApiClient11 {
|
|
3088
3125
|
constructor(options) {
|
|
3089
3126
|
super({ ...options, bypassCache: true });
|
|
3090
3127
|
}
|
|
@@ -3093,6 +3130,15 @@ var _ProjectClient = class _ProjectClient extends ApiClient10 {
|
|
|
3093
3130
|
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2), { ...options });
|
|
3094
3131
|
return await this.apiClient(fetchUri);
|
|
3095
3132
|
}
|
|
3133
|
+
/**
|
|
3134
|
+
* Fetches projects grouped by team.
|
|
3135
|
+
* When teamId is provided, returns a single team with its projects.
|
|
3136
|
+
* When omitted, returns all accessible teams and their projects.
|
|
3137
|
+
*/
|
|
3138
|
+
async getProjects(options) {
|
|
3139
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _projectsUrl), options ? { ...options } : {});
|
|
3140
|
+
return await this.apiClient(fetchUri);
|
|
3141
|
+
}
|
|
3096
3142
|
/** Updates or creates (based on id) a Project */
|
|
3097
3143
|
async upsert(body) {
|
|
3098
3144
|
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
|
|
@@ -3112,13 +3158,15 @@ var _ProjectClient = class _ProjectClient extends ApiClient10 {
|
|
|
3112
3158
|
}
|
|
3113
3159
|
};
|
|
3114
3160
|
_url2 = new WeakMap();
|
|
3161
|
+
_projectsUrl = new WeakMap();
|
|
3115
3162
|
__privateAdd(_ProjectClient, _url2, "/api/v1/project");
|
|
3163
|
+
__privateAdd(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
3116
3164
|
var ProjectClient = _ProjectClient;
|
|
3117
3165
|
|
|
3118
3166
|
// src/PromptClient.ts
|
|
3119
|
-
import { ApiClient as
|
|
3167
|
+
import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
|
|
3120
3168
|
var PromptsUrl = "/api/v1/prompts";
|
|
3121
|
-
var PromptClient = class extends
|
|
3169
|
+
var PromptClient = class extends ApiClient12 {
|
|
3122
3170
|
constructor(options) {
|
|
3123
3171
|
super(options);
|
|
3124
3172
|
}
|
|
@@ -3149,9 +3197,9 @@ var PromptClient = class extends ApiClient11 {
|
|
|
3149
3197
|
};
|
|
3150
3198
|
|
|
3151
3199
|
// src/RelationshipClient.ts
|
|
3152
|
-
import { ApiClient as
|
|
3200
|
+
import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
|
|
3153
3201
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
|
3154
|
-
var RelationshipClient = class extends
|
|
3202
|
+
var RelationshipClient = class extends ApiClient13 {
|
|
3155
3203
|
constructor(options) {
|
|
3156
3204
|
super(options);
|
|
3157
3205
|
this.get = async (options) => {
|
|
@@ -3163,9 +3211,9 @@ var RelationshipClient = class extends ApiClient12 {
|
|
|
3163
3211
|
};
|
|
3164
3212
|
|
|
3165
3213
|
// src/ReleaseClient.ts
|
|
3166
|
-
import { ApiClient as
|
|
3214
|
+
import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
|
|
3167
3215
|
var releasesUrl = "/api/v1/releases";
|
|
3168
|
-
var ReleaseClient = class extends
|
|
3216
|
+
var ReleaseClient = class extends ApiClient14 {
|
|
3169
3217
|
constructor(options) {
|
|
3170
3218
|
super(options);
|
|
3171
3219
|
}
|
|
@@ -3205,9 +3253,9 @@ var ReleaseClient = class extends ApiClient13 {
|
|
|
3205
3253
|
};
|
|
3206
3254
|
|
|
3207
3255
|
// src/ReleaseContentsClient.ts
|
|
3208
|
-
import { ApiClient as
|
|
3256
|
+
import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
|
|
3209
3257
|
var releaseContentsUrl2 = "/api/v1/release-contents";
|
|
3210
|
-
var ReleaseContentsClient = class extends
|
|
3258
|
+
var ReleaseContentsClient = class extends ApiClient15 {
|
|
3211
3259
|
constructor(options) {
|
|
3212
3260
|
super(options);
|
|
3213
3261
|
}
|
|
@@ -3229,9 +3277,9 @@ var ReleaseContentsClient = class extends ApiClient14 {
|
|
|
3229
3277
|
};
|
|
3230
3278
|
|
|
3231
3279
|
// src/RouteClient.ts
|
|
3232
|
-
import { ApiClient as
|
|
3280
|
+
import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
|
|
3233
3281
|
var ROUTE_URL = "/api/v1/route";
|
|
3234
|
-
var RouteClient = class extends
|
|
3282
|
+
var RouteClient = class extends ApiClient16 {
|
|
3235
3283
|
constructor(options) {
|
|
3236
3284
|
var _a;
|
|
3237
3285
|
if (!options.limitPolicy) {
|
|
@@ -3606,12 +3654,12 @@ function handleRichTextNodeBinding(object, options) {
|
|
|
3606
3654
|
import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
|
|
3607
3655
|
|
|
3608
3656
|
// src/.version.ts
|
|
3609
|
-
var version = "20.
|
|
3657
|
+
var version = "20.60.0";
|
|
3610
3658
|
|
|
3611
3659
|
// src/WorkflowClient.ts
|
|
3612
|
-
import { ApiClient as
|
|
3660
|
+
import { ApiClient as ApiClient17 } from "@uniformdev/context/api";
|
|
3613
3661
|
var workflowsUrl = "/api/v1/workflows";
|
|
3614
|
-
var WorkflowClient = class extends
|
|
3662
|
+
var WorkflowClient = class extends ApiClient17 {
|
|
3615
3663
|
constructor(options) {
|
|
3616
3664
|
super(options);
|
|
3617
3665
|
}
|
|
@@ -3715,6 +3763,7 @@ export {
|
|
|
3715
3763
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
3716
3764
|
IntegrationPropertyEditorsClient,
|
|
3717
3765
|
LOCALE_DYNAMIC_INPUT_NAME,
|
|
3766
|
+
LabelClient,
|
|
3718
3767
|
LocaleClient,
|
|
3719
3768
|
PLACEHOLDER_ID,
|
|
3720
3769
|
PreviewClient,
|
|
@@ -3728,6 +3777,7 @@ export {
|
|
|
3728
3777
|
UncachedCanvasClient,
|
|
3729
3778
|
UncachedCategoryClient,
|
|
3730
3779
|
UncachedContentClient,
|
|
3780
|
+
UncachedLabelClient,
|
|
3731
3781
|
UniqueBatchEntries,
|
|
3732
3782
|
WorkflowClient,
|
|
3733
3783
|
autoFixParameterGroups,
|
|
@@ -3774,6 +3824,7 @@ export {
|
|
|
3774
3824
|
isAllowedReferrer,
|
|
3775
3825
|
isAssetParamValue,
|
|
3776
3826
|
isAssetParamValueItem,
|
|
3827
|
+
isAwaitingReadyMessage,
|
|
3777
3828
|
isComponentActionMessage,
|
|
3778
3829
|
isComponentPlaceholderId,
|
|
3779
3830
|
isContextStorageUpdatedMessage,
|
|
@@ -3789,6 +3840,7 @@ export {
|
|
|
3789
3840
|
isRootEntryReference,
|
|
3790
3841
|
isSelectComponentMessage,
|
|
3791
3842
|
isSelectParameterMessage,
|
|
3843
|
+
isSessionPendingMessage,
|
|
3792
3844
|
isSuggestComponentMessage,
|
|
3793
3845
|
isSystemComponentDefinition,
|
|
3794
3846
|
isTriggerCompositionActionMessage,
|
package/dist/index.js
CHANGED
|
@@ -397,7 +397,7 @@ __export(src_exports, {
|
|
|
397
397
|
ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
|
|
398
398
|
ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
|
|
399
399
|
ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
|
|
400
|
-
ApiClientError: () =>
|
|
400
|
+
ApiClientError: () => import_api19.ApiClientError,
|
|
401
401
|
BatchEntry: () => BatchEntry,
|
|
402
402
|
BlockFormatError: () => BlockFormatError,
|
|
403
403
|
CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
|
|
@@ -459,6 +459,7 @@ __export(src_exports, {
|
|
|
459
459
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE: () => IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
460
460
|
IntegrationPropertyEditorsClient: () => IntegrationPropertyEditorsClient,
|
|
461
461
|
LOCALE_DYNAMIC_INPUT_NAME: () => LOCALE_DYNAMIC_INPUT_NAME,
|
|
462
|
+
LabelClient: () => LabelClient,
|
|
462
463
|
LocaleClient: () => LocaleClient,
|
|
463
464
|
PLACEHOLDER_ID: () => PLACEHOLDER_ID,
|
|
464
465
|
PreviewClient: () => PreviewClient,
|
|
@@ -472,6 +473,7 @@ __export(src_exports, {
|
|
|
472
473
|
UncachedCanvasClient: () => UncachedCanvasClient,
|
|
473
474
|
UncachedCategoryClient: () => UncachedCategoryClient,
|
|
474
475
|
UncachedContentClient: () => UncachedContentClient,
|
|
476
|
+
UncachedLabelClient: () => UncachedLabelClient,
|
|
475
477
|
UniqueBatchEntries: () => UniqueBatchEntries,
|
|
476
478
|
WorkflowClient: () => WorkflowClient,
|
|
477
479
|
autoFixParameterGroups: () => autoFixParameterGroups,
|
|
@@ -518,6 +520,7 @@ __export(src_exports, {
|
|
|
518
520
|
isAllowedReferrer: () => isAllowedReferrer,
|
|
519
521
|
isAssetParamValue: () => isAssetParamValue,
|
|
520
522
|
isAssetParamValueItem: () => isAssetParamValueItem,
|
|
523
|
+
isAwaitingReadyMessage: () => isAwaitingReadyMessage,
|
|
521
524
|
isComponentActionMessage: () => isComponentActionMessage,
|
|
522
525
|
isComponentPlaceholderId: () => isComponentPlaceholderId,
|
|
523
526
|
isContextStorageUpdatedMessage: () => isContextStorageUpdatedMessage,
|
|
@@ -533,6 +536,7 @@ __export(src_exports, {
|
|
|
533
536
|
isRootEntryReference: () => isRootEntryReference,
|
|
534
537
|
isSelectComponentMessage: () => isSelectComponentMessage,
|
|
535
538
|
isSelectParameterMessage: () => isSelectParameterMessage,
|
|
539
|
+
isSessionPendingMessage: () => isSessionPendingMessage,
|
|
536
540
|
isSuggestComponentMessage: () => isSuggestComponentMessage,
|
|
537
541
|
isSystemComponentDefinition: () => isSystemComponentDefinition,
|
|
538
542
|
isTriggerCompositionActionMessage: () => isTriggerCompositionActionMessage,
|
|
@@ -762,22 +766,6 @@ function createLimitPolicy({
|
|
|
762
766
|
}
|
|
763
767
|
var nullLimitPolicy = async (func) => await func();
|
|
764
768
|
|
|
765
|
-
// src/utils/rewriteFilters.ts
|
|
766
|
-
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
|
767
|
-
function rewriteFilters(filters) {
|
|
768
|
-
return Object.entries(filters != null ? filters : {}).reduce(
|
|
769
|
-
(acc, [key, value]) => {
|
|
770
|
-
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
|
771
|
-
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
|
772
|
-
return {
|
|
773
|
-
...acc,
|
|
774
|
-
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
|
775
|
-
};
|
|
776
|
-
},
|
|
777
|
-
{}
|
|
778
|
-
);
|
|
779
|
-
}
|
|
780
|
-
|
|
781
769
|
// src/CanvasClient.ts
|
|
782
770
|
var CANVAS_URL = "/api/v1/canvas";
|
|
783
771
|
var CanvasClient = class extends import_api2.ApiClient {
|
|
@@ -794,7 +782,7 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
|
794
782
|
async getCompositionList(params = {}) {
|
|
795
783
|
const { projectId } = this.options;
|
|
796
784
|
const { resolveData, filters, ...originParams } = params;
|
|
797
|
-
const rewrittenFilters =
|
|
785
|
+
const rewrittenFilters = (0, import_api2.rewriteFiltersForApi)(filters);
|
|
798
786
|
if (!resolveData) {
|
|
799
787
|
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
|
800
788
|
return this.apiClient(fetchUri);
|
|
@@ -964,7 +952,7 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
|
|
|
964
952
|
getEntries(options) {
|
|
965
953
|
const { projectId } = this.options;
|
|
966
954
|
const { skipDataResolution, filters, ...params } = options;
|
|
967
|
-
const rewrittenFilters =
|
|
955
|
+
const rewrittenFilters = (0, import_api4.rewriteFiltersForApi)(filters);
|
|
968
956
|
if (skipDataResolution) {
|
|
969
957
|
const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
|
970
958
|
return this.apiClient(url);
|
|
@@ -2805,10 +2793,47 @@ _baseUrl = new WeakMap();
|
|
|
2805
2793
|
__privateAdd(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
2806
2794
|
var IntegrationPropertyEditorsClient = _IntegrationPropertyEditorsClient;
|
|
2807
2795
|
|
|
2808
|
-
// src/
|
|
2796
|
+
// src/LabelClient.ts
|
|
2809
2797
|
var import_api9 = require("@uniformdev/context/api");
|
|
2798
|
+
var LABELS_URL = "/api/v1/labels";
|
|
2799
|
+
var LabelClient = class extends import_api9.ApiClient {
|
|
2800
|
+
/** Fetches labels for the current project. */
|
|
2801
|
+
async getLabels(options) {
|
|
2802
|
+
const { projectId } = this.options;
|
|
2803
|
+
const fetchUri = this.createUrl(LABELS_URL, { ...options, projectId });
|
|
2804
|
+
return await this.apiClient(fetchUri);
|
|
2805
|
+
}
|
|
2806
|
+
/** Updates or creates a label. */
|
|
2807
|
+
async upsertLabel(body) {
|
|
2808
|
+
const { projectId } = this.options;
|
|
2809
|
+
const fetchUri = this.createUrl(LABELS_URL);
|
|
2810
|
+
await this.apiClient(fetchUri, {
|
|
2811
|
+
method: "PUT",
|
|
2812
|
+
body: JSON.stringify({ ...body, projectId }),
|
|
2813
|
+
expectNoContent: true
|
|
2814
|
+
});
|
|
2815
|
+
}
|
|
2816
|
+
/** Deletes a label by id. */
|
|
2817
|
+
async removeLabel(options) {
|
|
2818
|
+
const { projectId } = this.options;
|
|
2819
|
+
const fetchUri = this.createUrl(LABELS_URL);
|
|
2820
|
+
await this.apiClient(fetchUri, {
|
|
2821
|
+
method: "DELETE",
|
|
2822
|
+
body: JSON.stringify({ ...options, projectId }),
|
|
2823
|
+
expectNoContent: true
|
|
2824
|
+
});
|
|
2825
|
+
}
|
|
2826
|
+
};
|
|
2827
|
+
var UncachedLabelClient = class extends LabelClient {
|
|
2828
|
+
constructor(options) {
|
|
2829
|
+
super({ ...options, bypassCache: true });
|
|
2830
|
+
}
|
|
2831
|
+
};
|
|
2832
|
+
|
|
2833
|
+
// src/LocaleClient.ts
|
|
2834
|
+
var import_api10 = require("@uniformdev/context/api");
|
|
2810
2835
|
var localesUrl = "/api/v1/locales";
|
|
2811
|
-
var LocaleClient = class extends
|
|
2836
|
+
var LocaleClient = class extends import_api10.ApiClient {
|
|
2812
2837
|
constructor(options) {
|
|
2813
2838
|
super(options);
|
|
2814
2839
|
}
|
|
@@ -2863,6 +2888,12 @@ var isSelectComponentMessage = (message) => {
|
|
|
2863
2888
|
var isReadyMessage = (message) => {
|
|
2864
2889
|
return message.type === "ready";
|
|
2865
2890
|
};
|
|
2891
|
+
var isSessionPendingMessage = (message) => {
|
|
2892
|
+
return message.type === "session-pending";
|
|
2893
|
+
};
|
|
2894
|
+
var isAwaitingReadyMessage = (message) => {
|
|
2895
|
+
return message.type === "awaiting-ready";
|
|
2896
|
+
};
|
|
2866
2897
|
var isComponentActionMessage = (message) => {
|
|
2867
2898
|
return message.type === "trigger-component-action";
|
|
2868
2899
|
};
|
|
@@ -2965,6 +2996,14 @@ var createCanvasChannel = ({
|
|
|
2965
2996
|
};
|
|
2966
2997
|
postMessage(message);
|
|
2967
2998
|
};
|
|
2999
|
+
const sessionPending = () => {
|
|
3000
|
+
const message = { type: "session-pending" };
|
|
3001
|
+
postMessage(message);
|
|
3002
|
+
};
|
|
3003
|
+
const awaitingReady = () => {
|
|
3004
|
+
const message = { type: "awaiting-ready" };
|
|
3005
|
+
postMessage(message);
|
|
3006
|
+
};
|
|
2968
3007
|
const on = (types, handler) => {
|
|
2969
3008
|
const handlerId = ++handlerCounter;
|
|
2970
3009
|
handlers[handlerId] = {
|
|
@@ -3164,6 +3203,8 @@ var createCanvasChannel = ({
|
|
|
3164
3203
|
return {
|
|
3165
3204
|
broadcastTo: broadcastToItems,
|
|
3166
3205
|
ready,
|
|
3206
|
+
sessionPending,
|
|
3207
|
+
awaitingReady,
|
|
3167
3208
|
destroy,
|
|
3168
3209
|
addBroadcastTarget,
|
|
3169
3210
|
triggerComponentAction,
|
|
@@ -3194,10 +3235,10 @@ var createCanvasChannel = ({
|
|
|
3194
3235
|
};
|
|
3195
3236
|
|
|
3196
3237
|
// src/PreviewClient.ts
|
|
3197
|
-
var
|
|
3238
|
+
var import_api11 = require("@uniformdev/context/api");
|
|
3198
3239
|
var previewUrlsUrl = "/api/v1/preview-urls";
|
|
3199
3240
|
var previewViewportsUrl = "/api/v1/preview-viewports";
|
|
3200
|
-
var PreviewClient = class extends
|
|
3241
|
+
var PreviewClient = class extends import_api11.ApiClient {
|
|
3201
3242
|
constructor(options) {
|
|
3202
3243
|
super(options);
|
|
3203
3244
|
}
|
|
@@ -3260,9 +3301,9 @@ var PreviewClient = class extends import_api10.ApiClient {
|
|
|
3260
3301
|
};
|
|
3261
3302
|
|
|
3262
3303
|
// src/ProjectClient.ts
|
|
3263
|
-
var
|
|
3264
|
-
var _url2;
|
|
3265
|
-
var _ProjectClient = class _ProjectClient extends
|
|
3304
|
+
var import_api12 = require("@uniformdev/context/api");
|
|
3305
|
+
var _url2, _projectsUrl;
|
|
3306
|
+
var _ProjectClient = class _ProjectClient extends import_api12.ApiClient {
|
|
3266
3307
|
constructor(options) {
|
|
3267
3308
|
super({ ...options, bypassCache: true });
|
|
3268
3309
|
}
|
|
@@ -3271,6 +3312,15 @@ var _ProjectClient = class _ProjectClient extends import_api11.ApiClient {
|
|
|
3271
3312
|
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2), { ...options });
|
|
3272
3313
|
return await this.apiClient(fetchUri);
|
|
3273
3314
|
}
|
|
3315
|
+
/**
|
|
3316
|
+
* Fetches projects grouped by team.
|
|
3317
|
+
* When teamId is provided, returns a single team with its projects.
|
|
3318
|
+
* When omitted, returns all accessible teams and their projects.
|
|
3319
|
+
*/
|
|
3320
|
+
async getProjects(options) {
|
|
3321
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _projectsUrl), options ? { ...options } : {});
|
|
3322
|
+
return await this.apiClient(fetchUri);
|
|
3323
|
+
}
|
|
3274
3324
|
/** Updates or creates (based on id) a Project */
|
|
3275
3325
|
async upsert(body) {
|
|
3276
3326
|
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
|
|
@@ -3290,13 +3340,15 @@ var _ProjectClient = class _ProjectClient extends import_api11.ApiClient {
|
|
|
3290
3340
|
}
|
|
3291
3341
|
};
|
|
3292
3342
|
_url2 = new WeakMap();
|
|
3343
|
+
_projectsUrl = new WeakMap();
|
|
3293
3344
|
__privateAdd(_ProjectClient, _url2, "/api/v1/project");
|
|
3345
|
+
__privateAdd(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
3294
3346
|
var ProjectClient = _ProjectClient;
|
|
3295
3347
|
|
|
3296
3348
|
// src/PromptClient.ts
|
|
3297
|
-
var
|
|
3349
|
+
var import_api13 = require("@uniformdev/context/api");
|
|
3298
3350
|
var PromptsUrl = "/api/v1/prompts";
|
|
3299
|
-
var PromptClient = class extends
|
|
3351
|
+
var PromptClient = class extends import_api13.ApiClient {
|
|
3300
3352
|
constructor(options) {
|
|
3301
3353
|
super(options);
|
|
3302
3354
|
}
|
|
@@ -3327,9 +3379,9 @@ var PromptClient = class extends import_api12.ApiClient {
|
|
|
3327
3379
|
};
|
|
3328
3380
|
|
|
3329
3381
|
// src/RelationshipClient.ts
|
|
3330
|
-
var
|
|
3382
|
+
var import_api14 = require("@uniformdev/context/api");
|
|
3331
3383
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
|
3332
|
-
var RelationshipClient = class extends
|
|
3384
|
+
var RelationshipClient = class extends import_api14.ApiClient {
|
|
3333
3385
|
constructor(options) {
|
|
3334
3386
|
super(options);
|
|
3335
3387
|
this.get = async (options) => {
|
|
@@ -3341,9 +3393,9 @@ var RelationshipClient = class extends import_api13.ApiClient {
|
|
|
3341
3393
|
};
|
|
3342
3394
|
|
|
3343
3395
|
// src/ReleaseClient.ts
|
|
3344
|
-
var
|
|
3396
|
+
var import_api15 = require("@uniformdev/context/api");
|
|
3345
3397
|
var releasesUrl = "/api/v1/releases";
|
|
3346
|
-
var ReleaseClient = class extends
|
|
3398
|
+
var ReleaseClient = class extends import_api15.ApiClient {
|
|
3347
3399
|
constructor(options) {
|
|
3348
3400
|
super(options);
|
|
3349
3401
|
}
|
|
@@ -3383,9 +3435,9 @@ var ReleaseClient = class extends import_api14.ApiClient {
|
|
|
3383
3435
|
};
|
|
3384
3436
|
|
|
3385
3437
|
// src/ReleaseContentsClient.ts
|
|
3386
|
-
var
|
|
3438
|
+
var import_api16 = require("@uniformdev/context/api");
|
|
3387
3439
|
var releaseContentsUrl2 = "/api/v1/release-contents";
|
|
3388
|
-
var ReleaseContentsClient = class extends
|
|
3440
|
+
var ReleaseContentsClient = class extends import_api16.ApiClient {
|
|
3389
3441
|
constructor(options) {
|
|
3390
3442
|
super(options);
|
|
3391
3443
|
}
|
|
@@ -3407,9 +3459,9 @@ var ReleaseContentsClient = class extends import_api15.ApiClient {
|
|
|
3407
3459
|
};
|
|
3408
3460
|
|
|
3409
3461
|
// src/RouteClient.ts
|
|
3410
|
-
var
|
|
3462
|
+
var import_api17 = require("@uniformdev/context/api");
|
|
3411
3463
|
var ROUTE_URL = "/api/v1/route";
|
|
3412
|
-
var RouteClient = class extends
|
|
3464
|
+
var RouteClient = class extends import_api17.ApiClient {
|
|
3413
3465
|
constructor(options) {
|
|
3414
3466
|
var _a;
|
|
3415
3467
|
if (!options.limitPolicy) {
|
|
@@ -3781,15 +3833,15 @@ function handleRichTextNodeBinding(object, options) {
|
|
|
3781
3833
|
}
|
|
3782
3834
|
|
|
3783
3835
|
// src/index.ts
|
|
3784
|
-
var
|
|
3836
|
+
var import_api19 = require("@uniformdev/context/api");
|
|
3785
3837
|
|
|
3786
3838
|
// src/.version.ts
|
|
3787
|
-
var version = "20.
|
|
3839
|
+
var version = "20.60.0";
|
|
3788
3840
|
|
|
3789
3841
|
// src/WorkflowClient.ts
|
|
3790
|
-
var
|
|
3842
|
+
var import_api18 = require("@uniformdev/context/api");
|
|
3791
3843
|
var workflowsUrl = "/api/v1/workflows";
|
|
3792
|
-
var WorkflowClient = class extends
|
|
3844
|
+
var WorkflowClient = class extends import_api18.ApiClient {
|
|
3793
3845
|
constructor(options) {
|
|
3794
3846
|
super(options);
|
|
3795
3847
|
}
|
|
@@ -3820,7 +3872,7 @@ var WorkflowClient = class extends import_api17.ApiClient {
|
|
|
3820
3872
|
};
|
|
3821
3873
|
|
|
3822
3874
|
// src/index.ts
|
|
3823
|
-
var CanvasClientError =
|
|
3875
|
+
var CanvasClientError = import_api19.ApiClientError;
|
|
3824
3876
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3825
3877
|
0 && (module.exports = {
|
|
3826
3878
|
ASSETS_SOURCE_CUSTOM_URL,
|
|
@@ -3894,6 +3946,7 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3894
3946
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
3895
3947
|
IntegrationPropertyEditorsClient,
|
|
3896
3948
|
LOCALE_DYNAMIC_INPUT_NAME,
|
|
3949
|
+
LabelClient,
|
|
3897
3950
|
LocaleClient,
|
|
3898
3951
|
PLACEHOLDER_ID,
|
|
3899
3952
|
PreviewClient,
|
|
@@ -3907,6 +3960,7 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3907
3960
|
UncachedCanvasClient,
|
|
3908
3961
|
UncachedCategoryClient,
|
|
3909
3962
|
UncachedContentClient,
|
|
3963
|
+
UncachedLabelClient,
|
|
3910
3964
|
UniqueBatchEntries,
|
|
3911
3965
|
WorkflowClient,
|
|
3912
3966
|
autoFixParameterGroups,
|
|
@@ -3953,6 +4007,7 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3953
4007
|
isAllowedReferrer,
|
|
3954
4008
|
isAssetParamValue,
|
|
3955
4009
|
isAssetParamValueItem,
|
|
4010
|
+
isAwaitingReadyMessage,
|
|
3956
4011
|
isComponentActionMessage,
|
|
3957
4012
|
isComponentPlaceholderId,
|
|
3958
4013
|
isContextStorageUpdatedMessage,
|
|
@@ -3968,6 +4023,7 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3968
4023
|
isRootEntryReference,
|
|
3969
4024
|
isSelectComponentMessage,
|
|
3970
4025
|
isSelectParameterMessage,
|
|
4026
|
+
isSessionPendingMessage,
|
|
3971
4027
|
isSuggestComponentMessage,
|
|
3972
4028
|
isSystemComponentDefinition,
|
|
3973
4029
|
isTriggerCompositionActionMessage,
|