@uniformdev/canvas 20.48.1-alpha.28 → 20.48.1-alpha.33.sha-eb3f272086
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 +7237 -4682
- package/dist/index.d.ts +7237 -4682
- package/dist/index.esm.js +1419 -878
- package/dist/index.js +1419 -841
- package/dist/index.mjs +1419 -878
- package/package.json +12 -13
package/dist/index.js
CHANGED
|
@@ -8,9 +8,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
8
|
var __typeError = (msg) => {
|
|
9
9
|
throw TypeError(msg);
|
|
10
10
|
};
|
|
11
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
-
};
|
|
14
11
|
var __export = (target, all) => {
|
|
15
12
|
for (var name in all)
|
|
16
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -36,358 +33,9 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
36
33
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
37
34
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
38
35
|
|
|
39
|
-
// ../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js
|
|
40
|
-
var require_yocto_queue = __commonJS({
|
|
41
|
-
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports2, module2) {
|
|
42
|
-
"use strict";
|
|
43
|
-
var Node = class {
|
|
44
|
-
/// value;
|
|
45
|
-
/// next;
|
|
46
|
-
constructor(value) {
|
|
47
|
-
this.value = value;
|
|
48
|
-
this.next = void 0;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var Queue = class {
|
|
52
|
-
// TODO: Use private class fields when targeting Node.js 12.
|
|
53
|
-
// #_head;
|
|
54
|
-
// #_tail;
|
|
55
|
-
// #_size;
|
|
56
|
-
constructor() {
|
|
57
|
-
this.clear();
|
|
58
|
-
}
|
|
59
|
-
enqueue(value) {
|
|
60
|
-
const node = new Node(value);
|
|
61
|
-
if (this._head) {
|
|
62
|
-
this._tail.next = node;
|
|
63
|
-
this._tail = node;
|
|
64
|
-
} else {
|
|
65
|
-
this._head = node;
|
|
66
|
-
this._tail = node;
|
|
67
|
-
}
|
|
68
|
-
this._size++;
|
|
69
|
-
}
|
|
70
|
-
dequeue() {
|
|
71
|
-
const current = this._head;
|
|
72
|
-
if (!current) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this._head = this._head.next;
|
|
76
|
-
this._size--;
|
|
77
|
-
return current.value;
|
|
78
|
-
}
|
|
79
|
-
clear() {
|
|
80
|
-
this._head = void 0;
|
|
81
|
-
this._tail = void 0;
|
|
82
|
-
this._size = 0;
|
|
83
|
-
}
|
|
84
|
-
get size() {
|
|
85
|
-
return this._size;
|
|
86
|
-
}
|
|
87
|
-
*[Symbol.iterator]() {
|
|
88
|
-
let current = this._head;
|
|
89
|
-
while (current) {
|
|
90
|
-
yield current.value;
|
|
91
|
-
current = current.next;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
module2.exports = Queue;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// ../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js
|
|
100
|
-
var require_p_limit = __commonJS({
|
|
101
|
-
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports2, module2) {
|
|
102
|
-
"use strict";
|
|
103
|
-
var Queue = require_yocto_queue();
|
|
104
|
-
var pLimit2 = (concurrency) => {
|
|
105
|
-
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
106
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
107
|
-
}
|
|
108
|
-
const queue = new Queue();
|
|
109
|
-
let activeCount = 0;
|
|
110
|
-
const next = () => {
|
|
111
|
-
activeCount--;
|
|
112
|
-
if (queue.size > 0) {
|
|
113
|
-
queue.dequeue()();
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
const run = async (fn, resolve, ...args) => {
|
|
117
|
-
activeCount++;
|
|
118
|
-
const result = (async () => fn(...args))();
|
|
119
|
-
resolve(result);
|
|
120
|
-
try {
|
|
121
|
-
await result;
|
|
122
|
-
} catch (e) {
|
|
123
|
-
}
|
|
124
|
-
next();
|
|
125
|
-
};
|
|
126
|
-
const enqueue = (fn, resolve, ...args) => {
|
|
127
|
-
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
128
|
-
(async () => {
|
|
129
|
-
await Promise.resolve();
|
|
130
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
131
|
-
queue.dequeue()();
|
|
132
|
-
}
|
|
133
|
-
})();
|
|
134
|
-
};
|
|
135
|
-
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
136
|
-
enqueue(fn, resolve, ...args);
|
|
137
|
-
});
|
|
138
|
-
Object.defineProperties(generator, {
|
|
139
|
-
activeCount: {
|
|
140
|
-
get: () => activeCount
|
|
141
|
-
},
|
|
142
|
-
pendingCount: {
|
|
143
|
-
get: () => queue.size
|
|
144
|
-
},
|
|
145
|
-
clearQueue: {
|
|
146
|
-
value: () => {
|
|
147
|
-
queue.clear();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
return generator;
|
|
152
|
-
};
|
|
153
|
-
module2.exports = pLimit2;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js
|
|
158
|
-
var require_retry_operation = __commonJS({
|
|
159
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
|
|
160
|
-
"use strict";
|
|
161
|
-
function RetryOperation(timeouts, options) {
|
|
162
|
-
if (typeof options === "boolean") {
|
|
163
|
-
options = { forever: options };
|
|
164
|
-
}
|
|
165
|
-
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
166
|
-
this._timeouts = timeouts;
|
|
167
|
-
this._options = options || {};
|
|
168
|
-
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
169
|
-
this._fn = null;
|
|
170
|
-
this._errors = [];
|
|
171
|
-
this._attempts = 1;
|
|
172
|
-
this._operationTimeout = null;
|
|
173
|
-
this._operationTimeoutCb = null;
|
|
174
|
-
this._timeout = null;
|
|
175
|
-
this._operationStart = null;
|
|
176
|
-
this._timer = null;
|
|
177
|
-
if (this._options.forever) {
|
|
178
|
-
this._cachedTimeouts = this._timeouts.slice(0);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
module2.exports = RetryOperation;
|
|
182
|
-
RetryOperation.prototype.reset = function() {
|
|
183
|
-
this._attempts = 1;
|
|
184
|
-
this._timeouts = this._originalTimeouts.slice(0);
|
|
185
|
-
};
|
|
186
|
-
RetryOperation.prototype.stop = function() {
|
|
187
|
-
if (this._timeout) {
|
|
188
|
-
clearTimeout(this._timeout);
|
|
189
|
-
}
|
|
190
|
-
if (this._timer) {
|
|
191
|
-
clearTimeout(this._timer);
|
|
192
|
-
}
|
|
193
|
-
this._timeouts = [];
|
|
194
|
-
this._cachedTimeouts = null;
|
|
195
|
-
};
|
|
196
|
-
RetryOperation.prototype.retry = function(err) {
|
|
197
|
-
if (this._timeout) {
|
|
198
|
-
clearTimeout(this._timeout);
|
|
199
|
-
}
|
|
200
|
-
if (!err) {
|
|
201
|
-
return false;
|
|
202
|
-
}
|
|
203
|
-
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
204
|
-
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
205
|
-
this._errors.push(err);
|
|
206
|
-
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
this._errors.push(err);
|
|
210
|
-
var timeout = this._timeouts.shift();
|
|
211
|
-
if (timeout === void 0) {
|
|
212
|
-
if (this._cachedTimeouts) {
|
|
213
|
-
this._errors.splice(0, this._errors.length - 1);
|
|
214
|
-
timeout = this._cachedTimeouts.slice(-1);
|
|
215
|
-
} else {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
var self = this;
|
|
220
|
-
this._timer = setTimeout(function() {
|
|
221
|
-
self._attempts++;
|
|
222
|
-
if (self._operationTimeoutCb) {
|
|
223
|
-
self._timeout = setTimeout(function() {
|
|
224
|
-
self._operationTimeoutCb(self._attempts);
|
|
225
|
-
}, self._operationTimeout);
|
|
226
|
-
if (self._options.unref) {
|
|
227
|
-
self._timeout.unref();
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
self._fn(self._attempts);
|
|
231
|
-
}, timeout);
|
|
232
|
-
if (this._options.unref) {
|
|
233
|
-
this._timer.unref();
|
|
234
|
-
}
|
|
235
|
-
return true;
|
|
236
|
-
};
|
|
237
|
-
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
238
|
-
this._fn = fn;
|
|
239
|
-
if (timeoutOps) {
|
|
240
|
-
if (timeoutOps.timeout) {
|
|
241
|
-
this._operationTimeout = timeoutOps.timeout;
|
|
242
|
-
}
|
|
243
|
-
if (timeoutOps.cb) {
|
|
244
|
-
this._operationTimeoutCb = timeoutOps.cb;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
var self = this;
|
|
248
|
-
if (this._operationTimeoutCb) {
|
|
249
|
-
this._timeout = setTimeout(function() {
|
|
250
|
-
self._operationTimeoutCb();
|
|
251
|
-
}, self._operationTimeout);
|
|
252
|
-
}
|
|
253
|
-
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
254
|
-
this._fn(this._attempts);
|
|
255
|
-
};
|
|
256
|
-
RetryOperation.prototype.try = function(fn) {
|
|
257
|
-
console.log("Using RetryOperation.try() is deprecated");
|
|
258
|
-
this.attempt(fn);
|
|
259
|
-
};
|
|
260
|
-
RetryOperation.prototype.start = function(fn) {
|
|
261
|
-
console.log("Using RetryOperation.start() is deprecated");
|
|
262
|
-
this.attempt(fn);
|
|
263
|
-
};
|
|
264
|
-
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
265
|
-
RetryOperation.prototype.errors = function() {
|
|
266
|
-
return this._errors;
|
|
267
|
-
};
|
|
268
|
-
RetryOperation.prototype.attempts = function() {
|
|
269
|
-
return this._attempts;
|
|
270
|
-
};
|
|
271
|
-
RetryOperation.prototype.mainError = function() {
|
|
272
|
-
if (this._errors.length === 0) {
|
|
273
|
-
return null;
|
|
274
|
-
}
|
|
275
|
-
var counts = {};
|
|
276
|
-
var mainError = null;
|
|
277
|
-
var mainErrorCount = 0;
|
|
278
|
-
for (var i = 0; i < this._errors.length; i++) {
|
|
279
|
-
var error = this._errors[i];
|
|
280
|
-
var message = error.message;
|
|
281
|
-
var count = (counts[message] || 0) + 1;
|
|
282
|
-
counts[message] = count;
|
|
283
|
-
if (count >= mainErrorCount) {
|
|
284
|
-
mainError = error;
|
|
285
|
-
mainErrorCount = count;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return mainError;
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js
|
|
294
|
-
var require_retry = __commonJS({
|
|
295
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports2) {
|
|
296
|
-
"use strict";
|
|
297
|
-
var RetryOperation = require_retry_operation();
|
|
298
|
-
exports2.operation = function(options) {
|
|
299
|
-
var timeouts = exports2.timeouts(options);
|
|
300
|
-
return new RetryOperation(timeouts, {
|
|
301
|
-
forever: options && (options.forever || options.retries === Infinity),
|
|
302
|
-
unref: options && options.unref,
|
|
303
|
-
maxRetryTime: options && options.maxRetryTime
|
|
304
|
-
});
|
|
305
|
-
};
|
|
306
|
-
exports2.timeouts = function(options) {
|
|
307
|
-
if (options instanceof Array) {
|
|
308
|
-
return [].concat(options);
|
|
309
|
-
}
|
|
310
|
-
var opts = {
|
|
311
|
-
retries: 10,
|
|
312
|
-
factor: 2,
|
|
313
|
-
minTimeout: 1 * 1e3,
|
|
314
|
-
maxTimeout: Infinity,
|
|
315
|
-
randomize: false
|
|
316
|
-
};
|
|
317
|
-
for (var key in options) {
|
|
318
|
-
opts[key] = options[key];
|
|
319
|
-
}
|
|
320
|
-
if (opts.minTimeout > opts.maxTimeout) {
|
|
321
|
-
throw new Error("minTimeout is greater than maxTimeout");
|
|
322
|
-
}
|
|
323
|
-
var timeouts = [];
|
|
324
|
-
for (var i = 0; i < opts.retries; i++) {
|
|
325
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
326
|
-
}
|
|
327
|
-
if (options && options.forever && !timeouts.length) {
|
|
328
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
329
|
-
}
|
|
330
|
-
timeouts.sort(function(a, b) {
|
|
331
|
-
return a - b;
|
|
332
|
-
});
|
|
333
|
-
return timeouts;
|
|
334
|
-
};
|
|
335
|
-
exports2.createTimeout = function(attempt, opts) {
|
|
336
|
-
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
337
|
-
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
338
|
-
timeout = Math.min(timeout, opts.maxTimeout);
|
|
339
|
-
return timeout;
|
|
340
|
-
};
|
|
341
|
-
exports2.wrap = function(obj, options, methods) {
|
|
342
|
-
if (options instanceof Array) {
|
|
343
|
-
methods = options;
|
|
344
|
-
options = null;
|
|
345
|
-
}
|
|
346
|
-
if (!methods) {
|
|
347
|
-
methods = [];
|
|
348
|
-
for (var key in obj) {
|
|
349
|
-
if (typeof obj[key] === "function") {
|
|
350
|
-
methods.push(key);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
for (var i = 0; i < methods.length; i++) {
|
|
355
|
-
var method = methods[i];
|
|
356
|
-
var original = obj[method];
|
|
357
|
-
obj[method] = function retryWrapper(original2) {
|
|
358
|
-
var op = exports2.operation(options);
|
|
359
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
360
|
-
var callback = args.pop();
|
|
361
|
-
args.push(function(err) {
|
|
362
|
-
if (op.retry(err)) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
if (err) {
|
|
366
|
-
arguments[0] = op.mainError();
|
|
367
|
-
}
|
|
368
|
-
callback.apply(this, arguments);
|
|
369
|
-
});
|
|
370
|
-
op.attempt(function() {
|
|
371
|
-
original2.apply(obj, args);
|
|
372
|
-
});
|
|
373
|
-
}.bind(obj, original);
|
|
374
|
-
obj[method].options = options;
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js
|
|
381
|
-
var require_retry2 = __commonJS({
|
|
382
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports2, module2) {
|
|
383
|
-
"use strict";
|
|
384
|
-
module2.exports = require_retry();
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
|
|
388
36
|
// src/index.ts
|
|
389
|
-
var
|
|
390
|
-
__export(
|
|
37
|
+
var index_exports = {};
|
|
38
|
+
__export(index_exports, {
|
|
391
39
|
ASSETS_SOURCE_CUSTOM_URL: () => ASSETS_SOURCE_CUSTOM_URL,
|
|
392
40
|
ASSETS_SOURCE_UNIFORM: () => ASSETS_SOURCE_UNIFORM,
|
|
393
41
|
ASSET_PARAMETER_TYPE: () => ASSET_PARAMETER_TYPE,
|
|
@@ -397,7 +45,7 @@ __export(src_exports, {
|
|
|
397
45
|
ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
|
|
398
46
|
ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
|
|
399
47
|
ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
|
|
400
|
-
ApiClientError: () =>
|
|
48
|
+
ApiClientError: () => import_api27.ApiClientError,
|
|
401
49
|
BatchEntry: () => BatchEntry,
|
|
402
50
|
BlockFormatError: () => BlockFormatError,
|
|
403
51
|
CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
|
|
@@ -439,7 +87,11 @@ __export(src_exports, {
|
|
|
439
87
|
CanvasClientError: () => CanvasClientError,
|
|
440
88
|
CategoryClient: () => CategoryClient,
|
|
441
89
|
ChildEnhancerBuilder: () => ChildEnhancerBuilder,
|
|
90
|
+
ComponentDefinitionClient: () => ComponentDefinitionClient,
|
|
91
|
+
CompositionDeliveryClient: () => CompositionDeliveryClient,
|
|
92
|
+
CompositionManagementClient: () => CompositionManagementClient,
|
|
442
93
|
ContentClient: () => ContentClient,
|
|
94
|
+
ContentTypeClient: () => ContentTypeClient,
|
|
443
95
|
DataSourceClient: () => DataSourceClient,
|
|
444
96
|
DataTypeClient: () => DataTypeClient,
|
|
445
97
|
EDGE_CACHE_DISABLED: () => EDGE_CACHE_DISABLED,
|
|
@@ -449,6 +101,8 @@ __export(src_exports, {
|
|
|
449
101
|
EMPTY_COMPOSITION: () => EMPTY_COMPOSITION,
|
|
450
102
|
EnhancerBuilder: () => EnhancerBuilder,
|
|
451
103
|
EntityReleasesClient: () => EntityReleasesClient,
|
|
104
|
+
EntryDeliveryClient: () => EntryDeliveryClient,
|
|
105
|
+
EntryManagementClient: () => EntryManagementClient,
|
|
452
106
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
|
453
107
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
|
454
108
|
IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
|
|
@@ -459,19 +113,23 @@ __export(src_exports, {
|
|
|
459
113
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE: () => IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
460
114
|
IntegrationPropertyEditorsClient: () => IntegrationPropertyEditorsClient,
|
|
461
115
|
LOCALE_DYNAMIC_INPUT_NAME: () => LOCALE_DYNAMIC_INPUT_NAME,
|
|
116
|
+
LabelClient: () => LabelClient,
|
|
462
117
|
LocaleClient: () => LocaleClient,
|
|
463
118
|
PLACEHOLDER_ID: () => PLACEHOLDER_ID,
|
|
464
119
|
PreviewClient: () => PreviewClient,
|
|
465
120
|
ProjectClient: () => ProjectClient,
|
|
466
121
|
PromptClient: () => PromptClient,
|
|
122
|
+
REFERENCE_DATA_TYPE_ID: () => REFERENCE_DATA_TYPE_ID,
|
|
467
123
|
RelationshipClient: () => RelationshipClient,
|
|
468
124
|
ReleaseClient: () => ReleaseClient,
|
|
469
125
|
ReleaseContentsClient: () => ReleaseContentsClient,
|
|
470
126
|
RouteClient: () => RouteClient,
|
|
471
127
|
SECRET_QUERY_STRING_PARAM: () => SECRET_QUERY_STRING_PARAM,
|
|
128
|
+
SELECT_QUERY_PREFIX: () => SELECT_QUERY_PREFIX,
|
|
472
129
|
UncachedCanvasClient: () => UncachedCanvasClient,
|
|
473
130
|
UncachedCategoryClient: () => UncachedCategoryClient,
|
|
474
131
|
UncachedContentClient: () => UncachedContentClient,
|
|
132
|
+
UncachedLabelClient: () => UncachedLabelClient,
|
|
475
133
|
UniqueBatchEntries: () => UniqueBatchEntries,
|
|
476
134
|
WorkflowClient: () => WorkflowClient,
|
|
477
135
|
autoFixParameterGroups: () => autoFixParameterGroups,
|
|
@@ -518,6 +176,7 @@ __export(src_exports, {
|
|
|
518
176
|
isAllowedReferrer: () => isAllowedReferrer,
|
|
519
177
|
isAssetParamValue: () => isAssetParamValue,
|
|
520
178
|
isAssetParamValueItem: () => isAssetParamValueItem,
|
|
179
|
+
isAwaitingReadyMessage: () => isAwaitingReadyMessage,
|
|
521
180
|
isComponentActionMessage: () => isComponentActionMessage,
|
|
522
181
|
isComponentPlaceholderId: () => isComponentPlaceholderId,
|
|
523
182
|
isContextStorageUpdatedMessage: () => isContextStorageUpdatedMessage,
|
|
@@ -533,6 +192,7 @@ __export(src_exports, {
|
|
|
533
192
|
isRootEntryReference: () => isRootEntryReference,
|
|
534
193
|
isSelectComponentMessage: () => isSelectComponentMessage,
|
|
535
194
|
isSelectParameterMessage: () => isSelectParameterMessage,
|
|
195
|
+
isSessionPendingMessage: () => isSessionPendingMessage,
|
|
536
196
|
isSuggestComponentMessage: () => isSuggestComponentMessage,
|
|
537
197
|
isSystemComponentDefinition: () => isSystemComponentDefinition,
|
|
538
198
|
isTriggerCompositionActionMessage: () => isTriggerCompositionActionMessage,
|
|
@@ -547,240 +207,757 @@ __export(src_exports, {
|
|
|
547
207
|
localize: () => localize,
|
|
548
208
|
mapSlotToPersonalizedVariations: () => mapSlotToPersonalizedVariations,
|
|
549
209
|
mapSlotToTestVariations: () => mapSlotToTestVariations,
|
|
210
|
+
matchesProjectionPattern: () => matchesProjectionPattern,
|
|
550
211
|
mergeAssetConfigWithDefaults: () => mergeAssetConfigWithDefaults,
|
|
551
212
|
nullLimitPolicy: () => nullLimitPolicy,
|
|
552
213
|
parseComponentPlaceholderId: () => parseComponentPlaceholderId,
|
|
553
214
|
parseVariableExpression: () => parseVariableExpression,
|
|
215
|
+
projectionToQuery: () => projectionToQuery,
|
|
216
|
+
queryToProjection: () => queryToProjection,
|
|
554
217
|
version: () => version,
|
|
555
218
|
walkNodeTree: () => walkNodeTree,
|
|
556
219
|
walkPropertyValues: () => walkPropertyValues
|
|
557
220
|
});
|
|
558
|
-
module.exports = __toCommonJS(
|
|
221
|
+
module.exports = __toCommonJS(index_exports);
|
|
559
222
|
|
|
560
|
-
// src/
|
|
223
|
+
// src/CategoryClient.ts
|
|
561
224
|
var import_api2 = require("@uniformdev/context/api");
|
|
562
225
|
|
|
563
226
|
// src/enhancement/createLimitPolicy.ts
|
|
564
227
|
var import_api = require("@uniformdev/context/api");
|
|
565
|
-
var import_p_limit = __toESM(
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
228
|
+
var import_p_limit = __toESM(require("p-limit"));
|
|
229
|
+
var import_p_retry = __toESM(require("p-retry"));
|
|
230
|
+
var import_p_throttle = __toESM(require("p-throttle"));
|
|
231
|
+
function createLimitPolicy({
|
|
232
|
+
throttle = { interval: 1e3, limit: 10 },
|
|
233
|
+
retry = { retries: 1, factor: 1.66 },
|
|
234
|
+
limit = 10
|
|
235
|
+
}) {
|
|
236
|
+
const throttler = throttle ? (0, import_p_throttle.default)(throttle) : null;
|
|
237
|
+
const limiter = limit ? (0, import_p_limit.default)(limit) : null;
|
|
238
|
+
return function limitPolicy(func) {
|
|
239
|
+
let currentFunc = async () => await func();
|
|
240
|
+
if (throttler) {
|
|
241
|
+
const throttleFunc = currentFunc;
|
|
242
|
+
currentFunc = throttler(throttleFunc);
|
|
243
|
+
}
|
|
244
|
+
if (limiter) {
|
|
245
|
+
const limitFunc = currentFunc;
|
|
246
|
+
currentFunc = () => limiter(limitFunc);
|
|
247
|
+
}
|
|
248
|
+
if (retry) {
|
|
249
|
+
const retryFunc = currentFunc;
|
|
250
|
+
currentFunc = () => (0, import_p_retry.default)(retryFunc, {
|
|
251
|
+
...retry,
|
|
252
|
+
onFailedAttempt: async (error) => {
|
|
253
|
+
if (retry.onFailedAttempt) {
|
|
254
|
+
await retry.onFailedAttempt(error);
|
|
255
|
+
}
|
|
256
|
+
if (error instanceof import_api.ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
257
|
+
throw error;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
return currentFunc();
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
var nullLimitPolicy = async (func) => await func();
|
|
266
|
+
|
|
267
|
+
// src/CategoryClient.ts
|
|
268
|
+
var CATEGORIES_URL = "/api/v1/categories";
|
|
269
|
+
var CategoryClient = class extends import_api2.ApiClient {
|
|
270
|
+
constructor(options) {
|
|
271
|
+
if (!options.limitPolicy) {
|
|
272
|
+
options.limitPolicy = createLimitPolicy({});
|
|
273
|
+
}
|
|
274
|
+
super(options);
|
|
275
|
+
}
|
|
276
|
+
/** Fetches a list of categories created in given project */
|
|
277
|
+
async list(options) {
|
|
278
|
+
const { projectId } = this.options;
|
|
279
|
+
const fetchUri = this.createUrl("/api/v1/categories", { ...options, projectId });
|
|
280
|
+
return await this.apiClient(fetchUri);
|
|
281
|
+
}
|
|
282
|
+
/** @deprecated Use {@link list} instead. */
|
|
283
|
+
async getCategories(options) {
|
|
284
|
+
return this.list(options);
|
|
285
|
+
}
|
|
286
|
+
/** Updates or creates a category, also used to re-order them */
|
|
287
|
+
async save(categories) {
|
|
288
|
+
const { projectId } = this.options;
|
|
289
|
+
const fetchUri = this.createUrl(CATEGORIES_URL);
|
|
290
|
+
return await this.apiClient(fetchUri, {
|
|
291
|
+
method: "PUT",
|
|
292
|
+
body: JSON.stringify({ categories, projectId }),
|
|
293
|
+
expectNoContent: true
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/** @deprecated Use {@link save} instead. */
|
|
297
|
+
async upsertCategories(categories) {
|
|
298
|
+
return this.save(categories);
|
|
299
|
+
}
|
|
300
|
+
/** Deletes a category */
|
|
301
|
+
async remove(options) {
|
|
302
|
+
const { projectId } = this.options;
|
|
303
|
+
const fetchUri = this.createUrl(CATEGORIES_URL);
|
|
304
|
+
return await this.apiClient(fetchUri, {
|
|
305
|
+
method: "DELETE",
|
|
306
|
+
body: JSON.stringify({ projectId, categoryId: options.categoryId }),
|
|
307
|
+
expectNoContent: true
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/** @deprecated Use {@link remove} instead. */
|
|
311
|
+
async removeCategory(options) {
|
|
312
|
+
return this.remove(options);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
var UncachedCategoryClient = class extends CategoryClient {
|
|
316
|
+
constructor(options) {
|
|
317
|
+
super({ ...options, bypassCache: true });
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// src/clients/ComponentDefinitionClient.ts
|
|
322
|
+
var import_api4 = require("@uniformdev/context/api");
|
|
323
|
+
|
|
324
|
+
// src/clients/ContentClientBase.ts
|
|
325
|
+
var import_api3 = require("@uniformdev/context/api");
|
|
326
|
+
var CANONICAL_FORMAT = "canonical";
|
|
327
|
+
var ContentClientBase = class extends import_api3.ApiClient {
|
|
328
|
+
constructor(options, defaultBypassCache) {
|
|
329
|
+
var _a, _b;
|
|
330
|
+
super({
|
|
331
|
+
...options,
|
|
332
|
+
limitPolicy: (_a = options.limitPolicy) != null ? _a : createLimitPolicy({}),
|
|
333
|
+
bypassCache: (_b = options.bypassCache) != null ? _b : defaultBypassCache
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// src/clients/ComponentDefinitionClient.ts
|
|
339
|
+
var DEFINITIONS_URL = "/api/v1/canvas-definitions";
|
|
340
|
+
var ComponentDefinitionClient = class extends ContentClientBase {
|
|
341
|
+
constructor(options) {
|
|
342
|
+
super(
|
|
343
|
+
options,
|
|
344
|
+
/* defaultBypassCache */
|
|
345
|
+
true
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
/** Fetches one component definition by id (throws `ApiClientError(404)` if absent). */
|
|
349
|
+
async get(args) {
|
|
350
|
+
var _a;
|
|
351
|
+
const url = this.createUrl(DEFINITIONS_URL, {
|
|
352
|
+
componentId: args.componentId,
|
|
353
|
+
projectId: this.options.projectId
|
|
354
|
+
});
|
|
355
|
+
const res = await this.apiClient(url);
|
|
356
|
+
const definition = (_a = res.componentDefinitions) == null ? void 0 : _a[0];
|
|
357
|
+
if (!definition) {
|
|
358
|
+
throw new import_api4.ApiClientError("Component definition not found", "GET", url.toString(), 404, "Not Found");
|
|
359
|
+
}
|
|
360
|
+
return definition;
|
|
361
|
+
}
|
|
362
|
+
/** Fetches a list of component definitions. */
|
|
363
|
+
list(args) {
|
|
364
|
+
const url = this.createUrl(DEFINITIONS_URL, { ...args, projectId: this.options.projectId });
|
|
365
|
+
return this.apiClient(url);
|
|
366
|
+
}
|
|
367
|
+
/** Creates or updates a component definition. */
|
|
368
|
+
async save(def) {
|
|
369
|
+
const url = this.createUrl(DEFINITIONS_URL);
|
|
370
|
+
await this.apiClient(url, {
|
|
371
|
+
method: "PUT",
|
|
372
|
+
body: JSON.stringify({ ...def, projectId: this.options.projectId }),
|
|
373
|
+
expectNoContent: true
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
/** Deletes a component definition. */
|
|
377
|
+
async remove(args) {
|
|
378
|
+
const url = this.createUrl(DEFINITIONS_URL);
|
|
379
|
+
await this.apiClient(url, {
|
|
380
|
+
method: "DELETE",
|
|
381
|
+
body: JSON.stringify({ ...args, projectId: this.options.projectId }),
|
|
382
|
+
expectNoContent: true
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
// src/clients/CompositionDeliveryClient.ts
|
|
388
|
+
var import_api5 = require("@uniformdev/context/api");
|
|
389
|
+
|
|
390
|
+
// src/projection/types.ts
|
|
391
|
+
var SELECT_QUERY_PREFIX = "select.";
|
|
392
|
+
|
|
393
|
+
// src/projection/projectionToQuery.ts
|
|
394
|
+
function appendCsv(out, key, values) {
|
|
395
|
+
if (values === void 0) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
out[key] = values.join(",");
|
|
399
|
+
}
|
|
400
|
+
function projectionToQuery(spec) {
|
|
401
|
+
const out = {};
|
|
402
|
+
if (!spec) {
|
|
403
|
+
return out;
|
|
404
|
+
}
|
|
405
|
+
const { fields, fieldTypes, slots } = spec;
|
|
406
|
+
const p = SELECT_QUERY_PREFIX;
|
|
407
|
+
if (fields) {
|
|
408
|
+
appendCsv(out, `${p}fields[only]`, fields.only);
|
|
409
|
+
appendCsv(out, `${p}fields[except]`, fields.except);
|
|
410
|
+
appendCsv(out, `${p}fields[locales]`, fields.locales);
|
|
411
|
+
if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
|
|
412
|
+
out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (fieldTypes) {
|
|
416
|
+
appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
|
|
417
|
+
appendCsv(out, `${p}fieldTypes[except]`, fieldTypes.except);
|
|
418
|
+
}
|
|
419
|
+
if (slots) {
|
|
420
|
+
appendCsv(out, `${p}slots[only]`, slots.only);
|
|
421
|
+
appendCsv(out, `${p}slots[except]`, slots.except);
|
|
422
|
+
if (typeof slots.depth === "number") {
|
|
423
|
+
out[`${p}slots[depth]`] = String(slots.depth);
|
|
424
|
+
}
|
|
425
|
+
if (slots.named) {
|
|
426
|
+
const slotNames = Object.keys(slots.named).sort();
|
|
427
|
+
for (const slotName of slotNames) {
|
|
428
|
+
const named = slots.named[slotName];
|
|
429
|
+
if (named && typeof named.depth === "number") {
|
|
430
|
+
out[`${p}slots.${slotName}[depth]`] = String(named.depth);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return out;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// src/utils/constants.ts
|
|
439
|
+
var CANVAS_PERSONALIZE_TYPE = "$personalization";
|
|
440
|
+
var CANVAS_TEST_TYPE = "$test";
|
|
441
|
+
var CANVAS_LOCALIZATION_TYPE = "$localization";
|
|
442
|
+
var CANVAS_SLOT_SECTION_TYPE = "$slotSection";
|
|
443
|
+
var CANVAS_INTENT_TAG_PARAM = "intentTag";
|
|
444
|
+
var CANVAS_LOCALE_TAG_PARAM = "locale";
|
|
445
|
+
var CANVAS_BLOCK_PARAM_TYPE = "$block";
|
|
446
|
+
var CANVAS_PERSONALIZE_SLOT = "pz";
|
|
447
|
+
var CANVAS_TEST_SLOT = "test";
|
|
448
|
+
var CANVAS_LOCALIZATION_SLOT = "localized";
|
|
449
|
+
var CANVAS_SLOT_SECTION_SLOT = "$slotSectionItems";
|
|
450
|
+
var CANVAS_SLOT_SECTION_NAME_PARAM = "name";
|
|
451
|
+
var CANVAS_SLOT_SECTION_MIN_PARAM = "min";
|
|
452
|
+
var CANVAS_SLOT_SECTION_MAX_PARAM = "max";
|
|
453
|
+
var CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM = "groupType";
|
|
454
|
+
var CANVAS_SLOT_SECTION_SPECIFIC_PARAM = "specific";
|
|
455
|
+
var CANVAS_DRAFT_STATE = 0;
|
|
456
|
+
var CANVAS_PUBLISHED_STATE = 64;
|
|
457
|
+
var CANVAS_EDITOR_STATE = 63;
|
|
458
|
+
var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
|
|
459
|
+
var CANVAS_PERSONALIZATION_EVENT_NAME_PARAM = "trackingEventName";
|
|
460
|
+
var CANVAS_PERSONALIZATION_ALGORITHM_PARAM = "algorithm";
|
|
461
|
+
var CANVAS_PERSONALIZATION_ALGORITHM_TYPE = "pzAlgorithm";
|
|
462
|
+
var CANVAS_PERSONALIZATION_TAKE_PARAM = "count";
|
|
463
|
+
var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
|
464
|
+
var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
|
465
|
+
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
466
|
+
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
467
|
+
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
468
|
+
var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
|
|
469
|
+
var SECRET_QUERY_STRING_PARAM = "secret";
|
|
470
|
+
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
471
|
+
var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
|
|
472
|
+
var IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM = "is_incontext_editing_forced_settings";
|
|
473
|
+
var IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM = "is_config_check";
|
|
474
|
+
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
|
475
|
+
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
|
476
|
+
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
|
477
|
+
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
|
478
|
+
var PLACEHOLDER_ID = "placeholder";
|
|
479
|
+
var EMPTY_COMPOSITION = {
|
|
480
|
+
_id: "_empty_composition_id",
|
|
481
|
+
_name: "An empty composition used for contextual editing",
|
|
482
|
+
type: "_empty_composition_type"
|
|
483
|
+
};
|
|
484
|
+
var EDGE_MIN_CACHE_TTL = 10;
|
|
485
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
486
|
+
var EDGE_DEFAULT_CACHE_TTL = 30;
|
|
487
|
+
var EDGE_CACHE_DISABLED = -1;
|
|
488
|
+
var ASSET_PARAMETER_TYPE = "asset";
|
|
489
|
+
var ASSETS_SOURCE_UNIFORM = "uniform-assets";
|
|
490
|
+
var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
|
|
491
|
+
var REFERENCE_DATA_TYPE_ID = "uniformContentInternalReference";
|
|
492
|
+
|
|
493
|
+
// src/clients/compositionHelpers.ts
|
|
494
|
+
function resolveCompositionSelector(args) {
|
|
495
|
+
if ("compositionId" in args) {
|
|
496
|
+
const { compositionId, editionId, versionId, ...readOptions } = args;
|
|
497
|
+
return {
|
|
498
|
+
readOptions,
|
|
499
|
+
// raw mode matches on composition OR edition id via the compositionId param
|
|
500
|
+
compositionId: editionId != null ? editionId : compositionId,
|
|
501
|
+
versionId,
|
|
502
|
+
hasCompositionId: true,
|
|
503
|
+
pinnedEdition: editionId !== void 0
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
return { readOptions: args, hasCompositionId: false, pinnedEdition: false };
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// src/clients/DeliveryClientBase.ts
|
|
510
|
+
var DEFAULT_EDGE_API_HOST = "https://uniform.global";
|
|
511
|
+
var DeliveryClientBase = class extends ContentClientBase {
|
|
512
|
+
constructor(options) {
|
|
513
|
+
var _a;
|
|
514
|
+
super(
|
|
515
|
+
options,
|
|
516
|
+
/* defaultBypassCache */
|
|
517
|
+
false
|
|
518
|
+
);
|
|
519
|
+
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : DEFAULT_EDGE_API_HOST;
|
|
520
|
+
this.edgeRequestInit = options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0;
|
|
521
|
+
}
|
|
522
|
+
/** Coerces the `diagnostics` option into the shape the edge endpoints accept. */
|
|
523
|
+
coerceDiagnostics(diagnostics) {
|
|
524
|
+
return typeof diagnostics === "boolean" ? diagnostics : diagnostics === "no-data" ? "no-data" : void 0;
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
// src/clients/CompositionDeliveryClient.ts
|
|
529
|
+
var EDGE_SINGLE_URL = "/api/v1/composition";
|
|
530
|
+
var EDGE_LIST_URL = "/api/v1/compositions";
|
|
531
|
+
var CompositionDeliveryClient = class extends DeliveryClientBase {
|
|
532
|
+
constructor(options) {
|
|
533
|
+
super(options);
|
|
534
|
+
}
|
|
535
|
+
/** Fetches exactly one composition (throws `ApiClientError(404)` if absent). */
|
|
536
|
+
get(args) {
|
|
537
|
+
var _a;
|
|
538
|
+
const { diagnostics, select, ...rest } = args;
|
|
539
|
+
const { readOptions, compositionId, versionId, pinnedEdition } = resolveCompositionSelector(rest);
|
|
540
|
+
const url = this.createUrl(
|
|
541
|
+
EDGE_SINGLE_URL,
|
|
542
|
+
{
|
|
543
|
+
...readOptions,
|
|
544
|
+
...projectionToQuery(select),
|
|
545
|
+
// A pinned edition is folded into compositionId (raw matches edition or
|
|
546
|
+
// composition id); there is no editionId query param on this endpoint.
|
|
547
|
+
compositionId,
|
|
548
|
+
versionId,
|
|
549
|
+
projectId: this.options.projectId,
|
|
550
|
+
state: (_a = args.state) != null ? _a : CANVAS_PUBLISHED_STATE,
|
|
551
|
+
// editionId pins a specific edition for preview; otherwise locale-best.
|
|
552
|
+
editions: pinnedEdition ? "raw" : "auto",
|
|
553
|
+
diagnostics: this.coerceDiagnostics(diagnostics)
|
|
554
|
+
},
|
|
555
|
+
this.edgeApiHost
|
|
556
|
+
);
|
|
557
|
+
return this.apiClient(url, this.edgeRequestInit);
|
|
558
|
+
}
|
|
559
|
+
/** Fetches a list of compositions, optionally filtered. */
|
|
560
|
+
list(args = {}) {
|
|
561
|
+
var _a;
|
|
562
|
+
const { diagnostics, filters, select, ...rest } = args;
|
|
563
|
+
const url = this.createUrl(
|
|
564
|
+
EDGE_LIST_URL,
|
|
565
|
+
{
|
|
566
|
+
...rest,
|
|
567
|
+
...(0, import_api5.rewriteFiltersForApi)(filters),
|
|
568
|
+
...projectionToQuery(select),
|
|
569
|
+
projectId: this.options.projectId,
|
|
570
|
+
state: (_a = args.state) != null ? _a : CANVAS_PUBLISHED_STATE,
|
|
571
|
+
diagnostics: this.coerceDiagnostics(diagnostics)
|
|
572
|
+
},
|
|
573
|
+
this.edgeApiHost
|
|
574
|
+
);
|
|
575
|
+
return this.apiClient(url, this.edgeRequestInit);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
// src/clients/CompositionManagementClient.ts
|
|
580
|
+
var import_api6 = require("@uniformdev/context/api");
|
|
581
|
+
|
|
582
|
+
// src/clients/resolveManagementEditions.ts
|
|
583
|
+
function resolveManagementEditions({
|
|
584
|
+
explicit,
|
|
585
|
+
pinnedEdition,
|
|
586
|
+
hasId,
|
|
587
|
+
hasLocale
|
|
588
|
+
}) {
|
|
589
|
+
if (explicit) {
|
|
590
|
+
return explicit;
|
|
591
|
+
}
|
|
592
|
+
if (pinnedEdition) {
|
|
593
|
+
return "raw";
|
|
594
|
+
}
|
|
595
|
+
if (!hasId) {
|
|
596
|
+
return void 0;
|
|
597
|
+
}
|
|
598
|
+
return hasLocale ? "auto" : "raw";
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// src/clients/CompositionManagementClient.ts
|
|
602
|
+
var CANVAS_URL = "/api/v1/canvas";
|
|
603
|
+
var CANVAS_HISTORY_URL = "/api/v1/canvas-history";
|
|
604
|
+
var CompositionManagementClient = class extends ContentClientBase {
|
|
605
|
+
constructor(options) {
|
|
606
|
+
super(
|
|
607
|
+
options,
|
|
608
|
+
/* defaultBypassCache */
|
|
609
|
+
true
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Fetches one composition in canonical shape (throws `ApiClientError(404)` if
|
|
614
|
+
* absent).
|
|
615
|
+
*/
|
|
616
|
+
get(args) {
|
|
617
|
+
var _a;
|
|
618
|
+
const { select, ...selectorArgs } = args;
|
|
619
|
+
const { readOptions, compositionId, versionId, hasCompositionId, pinnedEdition } = resolveCompositionSelector(selectorArgs);
|
|
620
|
+
const url = this.createUrl(CANVAS_URL, {
|
|
621
|
+
format: CANONICAL_FORMAT,
|
|
622
|
+
// Caller-supplied shaping flags and non-id selector keys ride along and
|
|
623
|
+
// override the format alias server-side.
|
|
624
|
+
...readOptions,
|
|
625
|
+
...projectionToQuery(select),
|
|
626
|
+
// A pinned edition is folded into compositionId; there is no editionId
|
|
627
|
+
// query param on this endpoint.
|
|
628
|
+
compositionId,
|
|
629
|
+
versionId,
|
|
630
|
+
projectId: this.options.projectId,
|
|
631
|
+
state: (_a = args.state) != null ? _a : CANVAS_DRAFT_STATE,
|
|
632
|
+
editions: resolveManagementEditions({
|
|
633
|
+
explicit: readOptions.editions,
|
|
634
|
+
pinnedEdition,
|
|
635
|
+
hasId: hasCompositionId,
|
|
636
|
+
hasLocale: readOptions.locale != null
|
|
637
|
+
})
|
|
638
|
+
});
|
|
639
|
+
return this.apiClient(url);
|
|
640
|
+
}
|
|
641
|
+
/** Fetches a list of compositions in canonical shape. */
|
|
642
|
+
list(args = {}) {
|
|
643
|
+
var _a;
|
|
644
|
+
const { filters, select, ...rest } = args;
|
|
645
|
+
const url = this.createUrl(CANVAS_URL, {
|
|
646
|
+
format: CANONICAL_FORMAT,
|
|
647
|
+
...rest,
|
|
648
|
+
...(0, import_api6.rewriteFiltersForApi)(filters),
|
|
649
|
+
...projectionToQuery(select),
|
|
650
|
+
projectId: this.options.projectId,
|
|
651
|
+
state: (_a = args.state) != null ? _a : CANVAS_DRAFT_STATE
|
|
652
|
+
});
|
|
653
|
+
return this.apiClient(url);
|
|
654
|
+
}
|
|
655
|
+
/** Creates or updates a composition. Returns the new `x-modified-at` timestamp. */
|
|
656
|
+
async save(body, opts) {
|
|
657
|
+
const url = this.createUrl(CANVAS_URL);
|
|
658
|
+
const headers = {};
|
|
659
|
+
if (opts == null ? void 0 : opts.ifUnmodifiedSince) {
|
|
660
|
+
headers["x-if-unmodified-since"] = opts.ifUnmodifiedSince;
|
|
661
|
+
}
|
|
662
|
+
const { response } = await this.apiClientWithResponse(url, {
|
|
663
|
+
method: "PUT",
|
|
664
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
665
|
+
expectNoContent: true,
|
|
666
|
+
headers
|
|
667
|
+
});
|
|
668
|
+
return { modified: response.headers.get("x-modified-at") };
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Saves the draft and publishes in one call (two PUTs). The optimistic
|
|
672
|
+
* concurrency guard, if any, applies to the draft write.
|
|
673
|
+
*/
|
|
674
|
+
async saveAndPublish(body, opts) {
|
|
675
|
+
await this.save({ ...body, state: CANVAS_DRAFT_STATE }, opts);
|
|
676
|
+
return this.save({ ...body, state: CANVAS_PUBLISHED_STATE });
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Removes only the published state, leaving the draft intact. Scoped to a
|
|
680
|
+
* single edition when `editionId` is supplied; otherwise unpublishes all editions.
|
|
681
|
+
* To unpublish only the base edition, pass editionId and compositionId as the same value.
|
|
682
|
+
*/
|
|
683
|
+
async unpublish(selector) {
|
|
684
|
+
await this.deleteComposition({ ...selector, state: CANVAS_PUBLISHED_STATE });
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Deletes across all states. Scoped to a single edition when `editionId` is
|
|
688
|
+
* supplied; otherwise deletes all states and editions.
|
|
689
|
+
* Use `unpublish` to drop only the published state.
|
|
690
|
+
*/
|
|
691
|
+
async remove(selector) {
|
|
692
|
+
await this.deleteComposition(selector);
|
|
693
|
+
}
|
|
694
|
+
/** Fetches historical versions of a composition or pattern. */
|
|
695
|
+
history(args) {
|
|
696
|
+
const url = this.createUrl(CANVAS_HISTORY_URL, { ...args, projectId: this.options.projectId });
|
|
697
|
+
return this.apiClient(url);
|
|
698
|
+
}
|
|
699
|
+
async deleteComposition(body) {
|
|
700
|
+
const url = this.createUrl(CANVAS_URL);
|
|
701
|
+
await this.apiClient(url, {
|
|
702
|
+
method: "DELETE",
|
|
703
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
704
|
+
expectNoContent: true
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
// src/clients/ContentTypeClient.ts
|
|
710
|
+
var import_api7 = require("@uniformdev/context/api");
|
|
711
|
+
var CONTENT_TYPES_URL = "/api/v1/content-types";
|
|
712
|
+
var ContentTypeClient = class extends ContentClientBase {
|
|
713
|
+
constructor(options) {
|
|
714
|
+
super(
|
|
715
|
+
options,
|
|
716
|
+
/* defaultBypassCache */
|
|
717
|
+
true
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
/** Fetches one content type by id (throws `ApiClientError(404)` if absent). */
|
|
721
|
+
async get(args) {
|
|
722
|
+
var _a;
|
|
723
|
+
const url = this.createUrl(CONTENT_TYPES_URL, {
|
|
724
|
+
contentTypeIDs: [args.contentTypeId],
|
|
725
|
+
limit: 1,
|
|
726
|
+
projectId: this.options.projectId
|
|
727
|
+
});
|
|
728
|
+
const res = await this.apiClient(url);
|
|
729
|
+
const contentType = (_a = res.contentTypes) == null ? void 0 : _a[0];
|
|
730
|
+
if (!contentType) {
|
|
731
|
+
throw new import_api7.ApiClientError("Content type not found", "GET", url.toString(), 404, "Not Found");
|
|
732
|
+
}
|
|
733
|
+
return contentType;
|
|
734
|
+
}
|
|
735
|
+
/** Fetches a list of content types. */
|
|
736
|
+
list(args) {
|
|
737
|
+
const url = this.createUrl(CONTENT_TYPES_URL, { ...args, projectId: this.options.projectId });
|
|
738
|
+
return this.apiClient(url);
|
|
739
|
+
}
|
|
740
|
+
/** Creates or updates a content type. */
|
|
741
|
+
async save(body, opts = {}) {
|
|
742
|
+
const url = this.createUrl(CONTENT_TYPES_URL);
|
|
743
|
+
let contentType = body.contentType;
|
|
744
|
+
if (typeof contentType.slugSettings === "object" && contentType.slugSettings !== null && Object.keys(contentType.slugSettings).length === 0) {
|
|
745
|
+
const { slugSettings: _omitEmptySlugSettings, ...rest } = contentType;
|
|
746
|
+
contentType = rest;
|
|
590
747
|
}
|
|
591
|
-
this.
|
|
592
|
-
|
|
748
|
+
await this.apiClient(url, {
|
|
749
|
+
method: "PUT",
|
|
750
|
+
body: JSON.stringify({ ...body, contentType, projectId: this.options.projectId }),
|
|
751
|
+
expectNoContent: true,
|
|
752
|
+
headers: opts.autogenerateDataTypes ? { "x-uniform-autogenerate-data-types": "true" } : {}
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
/** Deletes a content type. */
|
|
756
|
+
async remove(args) {
|
|
757
|
+
const url = this.createUrl(CONTENT_TYPES_URL);
|
|
758
|
+
await this.apiClient(url, {
|
|
759
|
+
method: "DELETE",
|
|
760
|
+
body: JSON.stringify({ ...args, projectId: this.options.projectId }),
|
|
761
|
+
expectNoContent: true
|
|
762
|
+
});
|
|
593
763
|
}
|
|
594
764
|
};
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
...options
|
|
765
|
+
|
|
766
|
+
// src/clients/EntryDeliveryClient.ts
|
|
767
|
+
var import_api9 = require("@uniformdev/context/api");
|
|
768
|
+
|
|
769
|
+
// src/clients/entryHelpers.ts
|
|
770
|
+
var import_api8 = require("@uniformdev/context/api");
|
|
771
|
+
function resolveEntrySelector(args) {
|
|
772
|
+
if ("entryId" in args) {
|
|
773
|
+
const { entryId, editionId, versionId, ...readOptions2 } = args;
|
|
774
|
+
return {
|
|
775
|
+
readOptions: readOptions2,
|
|
776
|
+
entryIDs: [editionId != null ? editionId : entryId],
|
|
777
|
+
versionId,
|
|
778
|
+
pinnedEdition: editionId !== void 0
|
|
610
779
|
};
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
reject(error.originalError);
|
|
623
|
-
} else if (error instanceof TypeError && !isNetworkError(error.message)) {
|
|
624
|
-
operation.stop();
|
|
625
|
-
reject(error);
|
|
626
|
-
} else {
|
|
627
|
-
decorateErrorWithCounts(error, attemptNumber, options);
|
|
628
|
-
try {
|
|
629
|
-
await options.onFailedAttempt(error);
|
|
630
|
-
} catch (error2) {
|
|
631
|
-
reject(error2);
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
if (!operation.retry(error)) {
|
|
635
|
-
reject(operation.mainError());
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
});
|
|
640
|
-
if (options.signal && !options.signal.aborted) {
|
|
641
|
-
options.signal.addEventListener("abort", () => {
|
|
642
|
-
operation.stop();
|
|
643
|
-
const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
|
|
644
|
-
reject(reason instanceof Error ? reason : getDOMException(reason));
|
|
645
|
-
}, {
|
|
646
|
-
once: true
|
|
647
|
-
});
|
|
648
|
-
}
|
|
649
|
-
});
|
|
780
|
+
}
|
|
781
|
+
const { slug, ...readOptions } = args;
|
|
782
|
+
return { readOptions, slug, pinnedEdition: false };
|
|
783
|
+
}
|
|
784
|
+
function unwrapSingleEntry(res, url) {
|
|
785
|
+
var _a;
|
|
786
|
+
const entry = (_a = res.entries) == null ? void 0 : _a[0];
|
|
787
|
+
if (!entry) {
|
|
788
|
+
throw new import_api8.ApiClientError("Entry not found", "GET", url.toString(), 404, "Not Found");
|
|
789
|
+
}
|
|
790
|
+
return entry;
|
|
650
791
|
}
|
|
651
792
|
|
|
652
|
-
//
|
|
653
|
-
var
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
793
|
+
// src/clients/EntryDeliveryClient.ts
|
|
794
|
+
var ENTRIES_URL = "/api/v1/entries";
|
|
795
|
+
var EntryDeliveryClient = class extends DeliveryClientBase {
|
|
796
|
+
constructor(options) {
|
|
797
|
+
super(options);
|
|
657
798
|
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
799
|
+
/** Fetches exactly one entry by id or slug (throws `ApiClientError(404)` if absent). */
|
|
800
|
+
async get(args) {
|
|
801
|
+
var _a, _b;
|
|
802
|
+
const { diagnostics, select, ...rest } = args;
|
|
803
|
+
const { entryIDs, slug, versionId, pinnedEdition, readOptions } = resolveEntrySelector(rest);
|
|
804
|
+
const url = this.createUrl(
|
|
805
|
+
ENTRIES_URL,
|
|
806
|
+
{
|
|
807
|
+
...readOptions,
|
|
808
|
+
...projectionToQuery(select),
|
|
809
|
+
projectId: this.options.projectId,
|
|
810
|
+
state: (_a = args.state) != null ? _a : CANVAS_PUBLISHED_STATE,
|
|
811
|
+
entryIDs,
|
|
812
|
+
slug,
|
|
813
|
+
versionId,
|
|
814
|
+
// A pinned edition is fetched exactly; otherwise locale-best.
|
|
815
|
+
editions: pinnedEdition ? "raw" : "auto",
|
|
816
|
+
// An id lookup wants that exact entity regardless of type, so default the
|
|
817
|
+
// pattern filter to 'any' (origin default `false` would 404 a pattern id).
|
|
818
|
+
// Scoped to id lookups; slug reads keep the origin default. Explicit
|
|
819
|
+
// `pattern` overrides via the `...readOptions` spread above.
|
|
820
|
+
pattern: (_b = args.pattern) != null ? _b : entryIDs ? "any" : void 0,
|
|
821
|
+
diagnostics: this.coerceDiagnostics(diagnostics)
|
|
822
|
+
},
|
|
823
|
+
this.edgeApiHost
|
|
824
|
+
);
|
|
825
|
+
const res = await this.apiClient(url, this.edgeRequestInit);
|
|
826
|
+
return unwrapSingleEntry(res, url);
|
|
662
827
|
}
|
|
663
|
-
|
|
664
|
-
|
|
828
|
+
/** Fetches a list of entries, optionally filtered. */
|
|
829
|
+
list(args = {}) {
|
|
830
|
+
var _a;
|
|
831
|
+
const { diagnostics, filters, select, ...rest } = args;
|
|
832
|
+
const url = this.createUrl(
|
|
833
|
+
ENTRIES_URL,
|
|
834
|
+
{
|
|
835
|
+
...rest,
|
|
836
|
+
...(0, import_api9.rewriteFiltersForApi)(filters),
|
|
837
|
+
...projectionToQuery(select),
|
|
838
|
+
projectId: this.options.projectId,
|
|
839
|
+
state: (_a = args.state) != null ? _a : CANVAS_PUBLISHED_STATE,
|
|
840
|
+
diagnostics: this.coerceDiagnostics(diagnostics)
|
|
841
|
+
},
|
|
842
|
+
this.edgeApiHost
|
|
843
|
+
);
|
|
844
|
+
return this.apiClient(url, this.edgeRequestInit);
|
|
665
845
|
}
|
|
666
|
-
|
|
667
|
-
let currentTick = 0;
|
|
668
|
-
let activeCount = 0;
|
|
669
|
-
function windowedDelay() {
|
|
670
|
-
const now = Date.now();
|
|
671
|
-
if (now - currentTick > interval) {
|
|
672
|
-
activeCount = 1;
|
|
673
|
-
currentTick = now;
|
|
674
|
-
return 0;
|
|
675
|
-
}
|
|
676
|
-
if (activeCount < limit) {
|
|
677
|
-
activeCount++;
|
|
678
|
-
} else {
|
|
679
|
-
currentTick += interval;
|
|
680
|
-
activeCount = 1;
|
|
681
|
-
}
|
|
682
|
-
return currentTick - now;
|
|
683
|
-
}
|
|
684
|
-
const strictTicks = [];
|
|
685
|
-
function strictDelay() {
|
|
686
|
-
const now = Date.now();
|
|
687
|
-
if (strictTicks.length < limit) {
|
|
688
|
-
strictTicks.push(now);
|
|
689
|
-
return 0;
|
|
690
|
-
}
|
|
691
|
-
const earliestTime = strictTicks.shift() + interval;
|
|
692
|
-
if (now >= earliestTime) {
|
|
693
|
-
strictTicks.push(now);
|
|
694
|
-
return 0;
|
|
695
|
-
}
|
|
696
|
-
strictTicks.push(earliestTime);
|
|
697
|
-
return earliestTime - now;
|
|
698
|
-
}
|
|
699
|
-
const getDelay = strict ? strictDelay : windowedDelay;
|
|
700
|
-
return (function_) => {
|
|
701
|
-
const throttled = function(...args) {
|
|
702
|
-
if (!throttled.isEnabled) {
|
|
703
|
-
return (async () => function_.apply(this, args))();
|
|
704
|
-
}
|
|
705
|
-
let timeout;
|
|
706
|
-
return new Promise((resolve, reject) => {
|
|
707
|
-
const execute = () => {
|
|
708
|
-
resolve(function_.apply(this, args));
|
|
709
|
-
queue.delete(timeout);
|
|
710
|
-
};
|
|
711
|
-
timeout = setTimeout(execute, getDelay());
|
|
712
|
-
queue.set(timeout, reject);
|
|
713
|
-
});
|
|
714
|
-
};
|
|
715
|
-
throttled.abort = () => {
|
|
716
|
-
for (const timeout of queue.keys()) {
|
|
717
|
-
clearTimeout(timeout);
|
|
718
|
-
queue.get(timeout)(new AbortError2());
|
|
719
|
-
}
|
|
720
|
-
queue.clear();
|
|
721
|
-
strictTicks.splice(0, strictTicks.length);
|
|
722
|
-
};
|
|
723
|
-
throttled.isEnabled = true;
|
|
724
|
-
return throttled;
|
|
725
|
-
};
|
|
726
|
-
}
|
|
846
|
+
};
|
|
727
847
|
|
|
728
|
-
// src/
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
848
|
+
// src/clients/EntryManagementClient.ts
|
|
849
|
+
var import_api10 = require("@uniformdev/context/api");
|
|
850
|
+
var ENTRIES_URL2 = "/api/v1/entries";
|
|
851
|
+
var ENTRIES_HISTORY_URL = "/api/v1/entries-history";
|
|
852
|
+
var EntryManagementClient = class extends ContentClientBase {
|
|
853
|
+
constructor(options) {
|
|
854
|
+
super(
|
|
855
|
+
options,
|
|
856
|
+
/* defaultBypassCache */
|
|
857
|
+
true
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Fetches one entry by id or slug in canonical shape (throws
|
|
862
|
+
* `ApiClientError(404)` if absent).
|
|
863
|
+
*/
|
|
864
|
+
async get(args) {
|
|
865
|
+
var _a, _b;
|
|
866
|
+
const { select, ...selectorArgs } = args;
|
|
867
|
+
const { entryIDs, slug, versionId, readOptions, pinnedEdition } = resolveEntrySelector(selectorArgs);
|
|
868
|
+
const url = this.createUrl(ENTRIES_URL2, {
|
|
869
|
+
format: CANONICAL_FORMAT,
|
|
870
|
+
...readOptions,
|
|
871
|
+
...projectionToQuery(select),
|
|
872
|
+
projectId: this.options.projectId,
|
|
873
|
+
state: (_a = args.state) != null ? _a : CANVAS_DRAFT_STATE,
|
|
874
|
+
editions: resolveManagementEditions({
|
|
875
|
+
explicit: readOptions.editions,
|
|
876
|
+
pinnedEdition,
|
|
877
|
+
hasId: entryIDs != null,
|
|
878
|
+
hasLocale: readOptions.locale != null
|
|
879
|
+
}),
|
|
880
|
+
// An id lookup wants that exact entity regardless of type, so default the
|
|
881
|
+
// pattern filter to 'any' (origin default `false` would 404 a pattern id).
|
|
882
|
+
// Scoped to id lookups; slug reads keep the origin default. Explicit
|
|
883
|
+
// `pattern` overrides via the `...readOptions` spread above.
|
|
884
|
+
pattern: (_b = args.pattern) != null ? _b : entryIDs ? "any" : void 0,
|
|
885
|
+
entryIDs,
|
|
886
|
+
slug,
|
|
887
|
+
versionId
|
|
888
|
+
});
|
|
889
|
+
const res = await this.apiClient(url);
|
|
890
|
+
return unwrapSingleEntry(res, url);
|
|
891
|
+
}
|
|
892
|
+
/** Fetches a list of entries in canonical shape. */
|
|
893
|
+
list(args = {}) {
|
|
894
|
+
var _a;
|
|
895
|
+
const { filters, select, ...rest } = args;
|
|
896
|
+
const url = this.createUrl(ENTRIES_URL2, {
|
|
897
|
+
format: CANONICAL_FORMAT,
|
|
898
|
+
...rest,
|
|
899
|
+
...(0, import_api10.rewriteFiltersForApi)(filters),
|
|
900
|
+
...projectionToQuery(select),
|
|
901
|
+
projectId: this.options.projectId,
|
|
902
|
+
state: (_a = args.state) != null ? _a : CANVAS_DRAFT_STATE
|
|
903
|
+
});
|
|
904
|
+
return this.apiClient(url);
|
|
905
|
+
}
|
|
906
|
+
/** Creates or updates an entry. Returns the new `x-modified-at` timestamp. */
|
|
907
|
+
async save(body, opts) {
|
|
908
|
+
const url = this.createUrl(ENTRIES_URL2);
|
|
909
|
+
const headers = {};
|
|
910
|
+
if (opts == null ? void 0 : opts.ifUnmodifiedSince) {
|
|
911
|
+
headers["x-if-unmodified-since"] = opts.ifUnmodifiedSince;
|
|
759
912
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
)
|
|
779
|
-
}
|
|
913
|
+
const { response } = await this.apiClientWithResponse(url, {
|
|
914
|
+
method: "PUT",
|
|
915
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
916
|
+
expectNoContent: true,
|
|
917
|
+
headers
|
|
918
|
+
});
|
|
919
|
+
return { modified: response.headers.get("x-modified-at") };
|
|
920
|
+
}
|
|
921
|
+
/** Saves the draft and publishes in one call (two PUTs). */
|
|
922
|
+
async saveAndPublish(body, opts) {
|
|
923
|
+
await this.save({ ...body, state: CANVAS_DRAFT_STATE }, opts);
|
|
924
|
+
return this.save({ ...body, state: CANVAS_PUBLISHED_STATE });
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Removes only the published state, leaving the draft intact. Scoped to a
|
|
928
|
+
* single edition when `editionId` is supplied; otherwise unpublishes all editions.
|
|
929
|
+
* To unpublish only the base edition, pass editionId and entryId as the same value.
|
|
930
|
+
*/
|
|
931
|
+
async unpublish(selector) {
|
|
932
|
+
await this.deleteEntry({ ...selector, state: CANVAS_PUBLISHED_STATE });
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Deletes across all states. Scoped to a single edition when `editionId` is
|
|
936
|
+
* supplied; otherwise deletes all states and editions.
|
|
937
|
+
* Use `unpublish` to drop only the published state.
|
|
938
|
+
*/
|
|
939
|
+
async remove(selector) {
|
|
940
|
+
await this.deleteEntry(selector);
|
|
941
|
+
}
|
|
942
|
+
/** Fetches historical versions of an entry. */
|
|
943
|
+
history(args) {
|
|
944
|
+
const url = this.createUrl(ENTRIES_HISTORY_URL, { ...args, projectId: this.options.projectId });
|
|
945
|
+
return this.apiClient(url);
|
|
946
|
+
}
|
|
947
|
+
async deleteEntry(body) {
|
|
948
|
+
const url = this.createUrl(ENTRIES_URL2);
|
|
949
|
+
await this.apiClient(url, {
|
|
950
|
+
method: "DELETE",
|
|
951
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
952
|
+
expectNoContent: true
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
};
|
|
780
956
|
|
|
781
|
-
// src/CanvasClient.ts
|
|
782
|
-
var
|
|
783
|
-
var
|
|
957
|
+
// src/clients/deprecated/CanvasClient.ts
|
|
958
|
+
var import_api11 = require("@uniformdev/context/api");
|
|
959
|
+
var CANVAS_URL2 = "/api/v1/canvas";
|
|
960
|
+
var CanvasClient = class extends import_api11.ApiClient {
|
|
784
961
|
constructor(options) {
|
|
785
962
|
var _a;
|
|
786
963
|
if (!options.limitPolicy) {
|
|
@@ -793,17 +970,24 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
|
793
970
|
/** Fetches lists of Canvas compositions, optionally by type */
|
|
794
971
|
async getCompositionList(params = {}) {
|
|
795
972
|
const { projectId } = this.options;
|
|
796
|
-
const { resolveData, filters, ...originParams } = params;
|
|
797
|
-
const rewrittenFilters =
|
|
973
|
+
const { resolveData, filters, select, ...originParams } = params;
|
|
974
|
+
const rewrittenFilters = (0, import_api11.rewriteFiltersForApi)(filters);
|
|
975
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
798
976
|
if (!resolveData) {
|
|
799
|
-
const fetchUri = this.createUrl(
|
|
977
|
+
const fetchUri = this.createUrl(CANVAS_URL2, {
|
|
978
|
+
...originParams,
|
|
979
|
+
projectId,
|
|
980
|
+
...rewrittenFilters,
|
|
981
|
+
...rewrittenSelect
|
|
982
|
+
});
|
|
800
983
|
return this.apiClient(fetchUri);
|
|
801
984
|
}
|
|
802
985
|
const edgeParams = {
|
|
803
986
|
...originParams,
|
|
804
987
|
projectId,
|
|
805
988
|
diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
|
|
806
|
-
...rewrittenFilters
|
|
989
|
+
...rewrittenFilters,
|
|
990
|
+
...rewrittenSelect
|
|
807
991
|
};
|
|
808
992
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
|
809
993
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
@@ -838,7 +1022,7 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
|
838
1022
|
}) {
|
|
839
1023
|
const { projectId } = this.options;
|
|
840
1024
|
if (skipDataResolution) {
|
|
841
|
-
return this.apiClient(this.createUrl(
|
|
1025
|
+
return this.apiClient(this.createUrl(CANVAS_URL2, { ...params, projectId }));
|
|
842
1026
|
}
|
|
843
1027
|
const edgeParams = {
|
|
844
1028
|
...params,
|
|
@@ -850,7 +1034,7 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
|
850
1034
|
}
|
|
851
1035
|
/** Updates or creates a Canvas component definition */
|
|
852
1036
|
async updateComposition(body, options) {
|
|
853
|
-
const fetchUri = this.createUrl(
|
|
1037
|
+
const fetchUri = this.createUrl(CANVAS_URL2);
|
|
854
1038
|
const headers = {};
|
|
855
1039
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
856
1040
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -865,7 +1049,7 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
|
865
1049
|
}
|
|
866
1050
|
/** Deletes a Canvas component definition */
|
|
867
1051
|
async removeComposition(body) {
|
|
868
|
-
const fetchUri = this.createUrl(
|
|
1052
|
+
const fetchUri = this.createUrl(CANVAS_URL2);
|
|
869
1053
|
const { projectId } = this.options;
|
|
870
1054
|
await this.apiClient(fetchUri, {
|
|
871
1055
|
method: "DELETE",
|
|
@@ -904,53 +1088,10 @@ var UncachedCanvasClient = class extends CanvasClient {
|
|
|
904
1088
|
}
|
|
905
1089
|
};
|
|
906
1090
|
|
|
907
|
-
// src/
|
|
908
|
-
var
|
|
909
|
-
var CATEGORIES_URL = "/api/v1/categories";
|
|
910
|
-
var CategoryClient = class extends import_api3.ApiClient {
|
|
911
|
-
constructor(options) {
|
|
912
|
-
if (!options.limitPolicy) {
|
|
913
|
-
options.limitPolicy = createLimitPolicy({});
|
|
914
|
-
}
|
|
915
|
-
super(options);
|
|
916
|
-
}
|
|
917
|
-
/** Fetches all categories created in given project */
|
|
918
|
-
async getCategories(options) {
|
|
919
|
-
const { projectId } = this.options;
|
|
920
|
-
const fetchUri = this.createUrl("/api/v1/categories", { ...options, projectId });
|
|
921
|
-
return await this.apiClient(fetchUri);
|
|
922
|
-
}
|
|
923
|
-
/** Updates or creates a category, also used to re-order them */
|
|
924
|
-
async upsertCategories(categories) {
|
|
925
|
-
const { projectId } = this.options;
|
|
926
|
-
const fetchUri = this.createUrl(CATEGORIES_URL);
|
|
927
|
-
return await this.apiClient(fetchUri, {
|
|
928
|
-
method: "PUT",
|
|
929
|
-
body: JSON.stringify({ categories, projectId }),
|
|
930
|
-
expectNoContent: true
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
|
-
/** Deletes a category */
|
|
934
|
-
async removeCategory(options) {
|
|
935
|
-
const { projectId } = this.options;
|
|
936
|
-
const fetchUri = this.createUrl(CATEGORIES_URL);
|
|
937
|
-
return await this.apiClient(fetchUri, {
|
|
938
|
-
method: "DELETE",
|
|
939
|
-
body: JSON.stringify({ projectId, categoryId: options.categoryId }),
|
|
940
|
-
expectNoContent: true
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
};
|
|
944
|
-
var UncachedCategoryClient = class extends CategoryClient {
|
|
945
|
-
constructor(options) {
|
|
946
|
-
super({ ...options, bypassCache: true });
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
|
|
950
|
-
// src/ContentClient.ts
|
|
951
|
-
var import_api4 = require("@uniformdev/context/api");
|
|
1091
|
+
// src/clients/deprecated/ContentClient.ts
|
|
1092
|
+
var import_api12 = require("@uniformdev/context/api");
|
|
952
1093
|
var _contentTypesUrl, _entriesUrl;
|
|
953
|
-
var _ContentClient = class _ContentClient extends
|
|
1094
|
+
var _ContentClient = class _ContentClient extends import_api12.ApiClient {
|
|
954
1095
|
constructor(options) {
|
|
955
1096
|
var _a;
|
|
956
1097
|
super(options);
|
|
@@ -963,15 +1104,21 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
|
|
|
963
1104
|
}
|
|
964
1105
|
getEntries(options) {
|
|
965
1106
|
const { projectId } = this.options;
|
|
966
|
-
const { skipDataResolution, filters, ...params } = options;
|
|
967
|
-
const rewrittenFilters =
|
|
1107
|
+
const { skipDataResolution, filters, select, ...params } = options;
|
|
1108
|
+
const rewrittenFilters = (0, import_api12.rewriteFiltersForApi)(filters);
|
|
1109
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
968
1110
|
if (skipDataResolution) {
|
|
969
|
-
const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), {
|
|
1111
|
+
const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), {
|
|
1112
|
+
...params,
|
|
1113
|
+
...rewrittenFilters,
|
|
1114
|
+
...rewrittenSelect,
|
|
1115
|
+
projectId
|
|
1116
|
+
});
|
|
970
1117
|
return this.apiClient(url);
|
|
971
1118
|
}
|
|
972
1119
|
const edgeUrl = this.createUrl(
|
|
973
1120
|
__privateGet(_ContentClient, _entriesUrl),
|
|
974
|
-
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1121
|
+
{ ...this.getEdgeOptions(params), ...rewrittenFilters, ...rewrittenSelect },
|
|
975
1122
|
this.edgeApiHost
|
|
976
1123
|
);
|
|
977
1124
|
return this.apiClient(
|
|
@@ -1051,27 +1198,31 @@ var UncachedContentClient = class extends ContentClient {
|
|
|
1051
1198
|
};
|
|
1052
1199
|
|
|
1053
1200
|
// src/DataSourceClient.ts
|
|
1054
|
-
var
|
|
1201
|
+
var import_api13 = require("@uniformdev/context/api");
|
|
1055
1202
|
var dataSourceUrl = "/api/v1/data-source";
|
|
1056
1203
|
var dataSourcesUrl = "/api/v1/data-sources";
|
|
1057
|
-
var DataSourceClient = class extends
|
|
1204
|
+
var DataSourceClient = class extends import_api13.ApiClient {
|
|
1058
1205
|
constructor(options) {
|
|
1059
1206
|
super(options);
|
|
1060
1207
|
}
|
|
1061
|
-
/** Fetches
|
|
1208
|
+
/** Fetches a single DataSource by id (with decrypted secrets). */
|
|
1062
1209
|
async get(options) {
|
|
1063
1210
|
const { projectId } = this.options;
|
|
1064
1211
|
const fetchUri = this.createUrl(dataSourceUrl, { ...options, projectId });
|
|
1065
1212
|
return await this.apiClient(fetchUri);
|
|
1066
1213
|
}
|
|
1067
|
-
/** Fetches
|
|
1068
|
-
async
|
|
1214
|
+
/** Fetches the list of DataSources for a project (secrets masked). */
|
|
1215
|
+
async list(options) {
|
|
1069
1216
|
const { projectId } = this.options;
|
|
1070
1217
|
const fetchUri = this.createUrl(dataSourcesUrl, { ...options, projectId });
|
|
1071
1218
|
return await this.apiClient(fetchUri);
|
|
1072
1219
|
}
|
|
1220
|
+
/** @deprecated Use {@link list} instead. */
|
|
1221
|
+
async getList(options) {
|
|
1222
|
+
return this.list(options);
|
|
1223
|
+
}
|
|
1073
1224
|
/** Updates or creates (based on id) a DataSource */
|
|
1074
|
-
async
|
|
1225
|
+
async save(body) {
|
|
1075
1226
|
const fetchUri = this.createUrl(dataSourceUrl);
|
|
1076
1227
|
await this.apiClient(fetchUri, {
|
|
1077
1228
|
method: "PUT",
|
|
@@ -1079,6 +1230,10 @@ var DataSourceClient = class extends import_api5.ApiClient {
|
|
|
1079
1230
|
expectNoContent: true
|
|
1080
1231
|
});
|
|
1081
1232
|
}
|
|
1233
|
+
/** @deprecated Use {@link save} instead. */
|
|
1234
|
+
async upsert(body) {
|
|
1235
|
+
return this.save(body);
|
|
1236
|
+
}
|
|
1082
1237
|
/** Deletes a DataSource */
|
|
1083
1238
|
async remove(body) {
|
|
1084
1239
|
const fetchUri = this.createUrl(dataSourceUrl);
|
|
@@ -1091,20 +1246,24 @@ var DataSourceClient = class extends import_api5.ApiClient {
|
|
|
1091
1246
|
};
|
|
1092
1247
|
|
|
1093
1248
|
// src/DataTypeClient.ts
|
|
1094
|
-
var
|
|
1249
|
+
var import_api14 = require("@uniformdev/context/api");
|
|
1095
1250
|
var _url;
|
|
1096
|
-
var _DataTypeClient = class _DataTypeClient extends
|
|
1251
|
+
var _DataTypeClient = class _DataTypeClient extends import_api14.ApiClient {
|
|
1097
1252
|
constructor(options) {
|
|
1098
1253
|
super(options);
|
|
1099
1254
|
}
|
|
1100
|
-
/** Fetches
|
|
1101
|
-
async
|
|
1255
|
+
/** Fetches a list of DataTypes for a project */
|
|
1256
|
+
async list(options) {
|
|
1102
1257
|
const { projectId } = this.options;
|
|
1103
1258
|
const fetchUri = this.createUrl(__privateGet(_DataTypeClient, _url), { ...options, projectId });
|
|
1104
1259
|
return await this.apiClient(fetchUri);
|
|
1105
1260
|
}
|
|
1261
|
+
/** @deprecated Use {@link list} instead. */
|
|
1262
|
+
async get(options) {
|
|
1263
|
+
return this.list(options);
|
|
1264
|
+
}
|
|
1106
1265
|
/** Updates or creates (based on id) a DataType */
|
|
1107
|
-
async
|
|
1266
|
+
async save(body) {
|
|
1108
1267
|
const fetchUri = this.createUrl(__privateGet(_DataTypeClient, _url));
|
|
1109
1268
|
await this.apiClient(fetchUri, {
|
|
1110
1269
|
method: "PUT",
|
|
@@ -1112,6 +1271,10 @@ var _DataTypeClient = class _DataTypeClient extends import_api6.ApiClient {
|
|
|
1112
1271
|
expectNoContent: true
|
|
1113
1272
|
});
|
|
1114
1273
|
}
|
|
1274
|
+
/** @deprecated Use {@link save} instead. */
|
|
1275
|
+
async upsert(body) {
|
|
1276
|
+
return this.save(body);
|
|
1277
|
+
}
|
|
1115
1278
|
/** Deletes a DataType */
|
|
1116
1279
|
async remove(body) {
|
|
1117
1280
|
const fetchUri = this.createUrl(__privateGet(_DataTypeClient, _url));
|
|
@@ -1144,7 +1307,7 @@ var BatchEntry = class {
|
|
|
1144
1307
|
this._reject(reason);
|
|
1145
1308
|
this._isCompleted = true;
|
|
1146
1309
|
}
|
|
1147
|
-
/** @
|
|
1310
|
+
/** @returns Whether the batch entry has been completed (resolved or rejected). */
|
|
1148
1311
|
get isCompleted() {
|
|
1149
1312
|
return this._isCompleted;
|
|
1150
1313
|
}
|
|
@@ -1247,60 +1410,6 @@ function getComponentPath(ancestorsAndSelf) {
|
|
|
1247
1410
|
return `.${path.join(".")}`;
|
|
1248
1411
|
}
|
|
1249
1412
|
|
|
1250
|
-
// src/utils/constants.ts
|
|
1251
|
-
var CANVAS_PERSONALIZE_TYPE = "$personalization";
|
|
1252
|
-
var CANVAS_TEST_TYPE = "$test";
|
|
1253
|
-
var CANVAS_LOCALIZATION_TYPE = "$localization";
|
|
1254
|
-
var CANVAS_SLOT_SECTION_TYPE = "$slotSection";
|
|
1255
|
-
var CANVAS_INTENT_TAG_PARAM = "intentTag";
|
|
1256
|
-
var CANVAS_LOCALE_TAG_PARAM = "locale";
|
|
1257
|
-
var CANVAS_BLOCK_PARAM_TYPE = "$block";
|
|
1258
|
-
var CANVAS_PERSONALIZE_SLOT = "pz";
|
|
1259
|
-
var CANVAS_TEST_SLOT = "test";
|
|
1260
|
-
var CANVAS_LOCALIZATION_SLOT = "localized";
|
|
1261
|
-
var CANVAS_SLOT_SECTION_SLOT = "$slotSectionItems";
|
|
1262
|
-
var CANVAS_SLOT_SECTION_NAME_PARAM = "name";
|
|
1263
|
-
var CANVAS_SLOT_SECTION_MIN_PARAM = "min";
|
|
1264
|
-
var CANVAS_SLOT_SECTION_MAX_PARAM = "max";
|
|
1265
|
-
var CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM = "groupType";
|
|
1266
|
-
var CANVAS_SLOT_SECTION_SPECIFIC_PARAM = "specific";
|
|
1267
|
-
var CANVAS_DRAFT_STATE = 0;
|
|
1268
|
-
var CANVAS_PUBLISHED_STATE = 64;
|
|
1269
|
-
var CANVAS_EDITOR_STATE = 63;
|
|
1270
|
-
var CANVAS_PERSONALIZATION_PARAM = "$pzCrit";
|
|
1271
|
-
var CANVAS_PERSONALIZATION_EVENT_NAME_PARAM = "trackingEventName";
|
|
1272
|
-
var CANVAS_PERSONALIZATION_ALGORITHM_PARAM = "algorithm";
|
|
1273
|
-
var CANVAS_PERSONALIZATION_ALGORITHM_TYPE = "pzAlgorithm";
|
|
1274
|
-
var CANVAS_PERSONALIZATION_TAKE_PARAM = "count";
|
|
1275
|
-
var CANVAS_TEST_VARIANT_PARAM = "$tstVrnt";
|
|
1276
|
-
var CANVAS_ENRICHMENT_TAG_PARAM = "$enr";
|
|
1277
|
-
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
1278
|
-
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
1279
|
-
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
1280
|
-
var CANVAS_CONTEXTUAL_EDITING_PARAM = "$contextualEditing";
|
|
1281
|
-
var SECRET_QUERY_STRING_PARAM = "secret";
|
|
1282
|
-
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1283
|
-
var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
|
|
1284
|
-
var IN_CONTEXT_EDITOR_FORCED_SETTINGS_QUERY_STRING_PARAM = "is_incontext_editing_forced_settings";
|
|
1285
|
-
var IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM = "is_config_check";
|
|
1286
|
-
var IN_CONTEXT_EDITOR_COMPONENT_START_ROLE = "uniform-component-start";
|
|
1287
|
-
var IN_CONTEXT_EDITOR_COMPONENT_END_ROLE = "uniform-component-end";
|
|
1288
|
-
var IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID = "uniform-canvas-preview-script";
|
|
1289
|
-
var IS_RENDERED_BY_UNIFORM_ATTRIBUTE = "data-is-rendered-by-uniform";
|
|
1290
|
-
var PLACEHOLDER_ID = "placeholder";
|
|
1291
|
-
var EMPTY_COMPOSITION = {
|
|
1292
|
-
_id: "_empty_composition_id",
|
|
1293
|
-
_name: "An empty composition used for contextual editing",
|
|
1294
|
-
type: "_empty_composition_type"
|
|
1295
|
-
};
|
|
1296
|
-
var EDGE_MIN_CACHE_TTL = 10;
|
|
1297
|
-
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
1298
|
-
var EDGE_DEFAULT_CACHE_TTL = 30;
|
|
1299
|
-
var EDGE_CACHE_DISABLED = -1;
|
|
1300
|
-
var ASSET_PARAMETER_TYPE = "asset";
|
|
1301
|
-
var ASSETS_SOURCE_UNIFORM = "uniform-assets";
|
|
1302
|
-
var ASSETS_SOURCE_CUSTOM_URL = "custom-url";
|
|
1303
|
-
|
|
1304
1413
|
// src/utils/guards.ts
|
|
1305
1414
|
function isRootEntryReference(root) {
|
|
1306
1415
|
return root.type === "root" && isEntryData(root.node);
|
|
@@ -1367,10 +1476,12 @@ function flattenSingleNodeValues(data, options = {}) {
|
|
|
1367
1476
|
) : properties;
|
|
1368
1477
|
}
|
|
1369
1478
|
|
|
1370
|
-
// src/utils/variables/
|
|
1371
|
-
var escapeCharacter = "\\";
|
|
1479
|
+
// src/utils/variables/variableSyntax.ts
|
|
1372
1480
|
var variablePrefix = "${";
|
|
1373
1481
|
var variableSuffix = "}";
|
|
1482
|
+
|
|
1483
|
+
// src/utils/variables/parseVariableExpression.ts
|
|
1484
|
+
var escapeCharacter = "\\";
|
|
1374
1485
|
function parseVariableExpression(serialized, onToken) {
|
|
1375
1486
|
if (typeof serialized !== "string") {
|
|
1376
1487
|
throw new TypeError("Variable expression must be a string");
|
|
@@ -1378,9 +1489,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1378
1489
|
let bufferStartIndex = 0;
|
|
1379
1490
|
let bufferEndIndex = 0;
|
|
1380
1491
|
let tokenCount = 0;
|
|
1381
|
-
const handleToken = (token, type) => {
|
|
1492
|
+
const handleToken = (token, type, offset) => {
|
|
1382
1493
|
tokenCount++;
|
|
1383
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1494
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1384
1495
|
};
|
|
1385
1496
|
let state = "text";
|
|
1386
1497
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1391,20 +1502,26 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1391
1502
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1392
1503
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1393
1504
|
bufferEndIndex -= escapeCharacter.length;
|
|
1394
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1505
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1395
1506
|
return tokenCount;
|
|
1396
1507
|
}
|
|
1397
1508
|
bufferStartIndex = index;
|
|
1398
1509
|
bufferEndIndex = index + 1;
|
|
1399
1510
|
continue;
|
|
1400
1511
|
}
|
|
1401
|
-
state
|
|
1402
|
-
|
|
1403
|
-
if (handleToken(serialized.substring(
|
|
1512
|
+
if (state === "variable") {
|
|
1513
|
+
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1514
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1515
|
+
return tokenCount;
|
|
1516
|
+
}
|
|
1517
|
+
bufferStartIndex = bufferEndIndex;
|
|
1518
|
+
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1519
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1404
1520
|
return tokenCount;
|
|
1405
1521
|
}
|
|
1406
1522
|
bufferStartIndex = bufferEndIndex;
|
|
1407
1523
|
}
|
|
1524
|
+
state = "variable";
|
|
1408
1525
|
index += variablePrefix.length - 1;
|
|
1409
1526
|
bufferStartIndex += variablePrefix.length;
|
|
1410
1527
|
continue;
|
|
@@ -1417,7 +1534,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1417
1534
|
state = "text";
|
|
1418
1535
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1419
1536
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1420
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1537
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1421
1538
|
return tokenCount;
|
|
1422
1539
|
}
|
|
1423
1540
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1426,12 +1543,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1426
1543
|
}
|
|
1427
1544
|
bufferEndIndex++;
|
|
1428
1545
|
}
|
|
1429
|
-
if (
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1546
|
+
if (state === "variable") {
|
|
1547
|
+
state = "text";
|
|
1548
|
+
bufferStartIndex -= variablePrefix.length;
|
|
1549
|
+
}
|
|
1550
|
+
if (bufferStartIndex < serialized.length) {
|
|
1551
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1435
1552
|
}
|
|
1436
1553
|
return tokenCount;
|
|
1437
1554
|
}
|
|
@@ -1452,7 +1569,7 @@ function hasReferencedVariables(value) {
|
|
|
1452
1569
|
|
|
1453
1570
|
// src/enhancement/walkNodeTree.ts
|
|
1454
1571
|
function walkNodeTree(node, visitor, options) {
|
|
1455
|
-
var _a, _b;
|
|
1572
|
+
var _a, _b, _c;
|
|
1456
1573
|
const componentQueue = [
|
|
1457
1574
|
{
|
|
1458
1575
|
ancestorsAndSelf: Array.isArray(node) ? node : [{ node, type: "root" }],
|
|
@@ -1460,12 +1577,14 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1460
1577
|
}
|
|
1461
1578
|
];
|
|
1462
1579
|
const childContexts = /* @__PURE__ */ new Map();
|
|
1580
|
+
const order = (_a = options == null ? void 0 : options.order) != null ? _a : "dfs";
|
|
1581
|
+
const takeNext = () => order === "bfs" ? componentQueue.shift() : componentQueue.pop();
|
|
1463
1582
|
do {
|
|
1464
|
-
const currentQueueEntry =
|
|
1583
|
+
const currentQueueEntry = takeNext();
|
|
1465
1584
|
if (!currentQueueEntry) continue;
|
|
1466
1585
|
const currentComponent = currentQueueEntry.ancestorsAndSelf[0];
|
|
1467
1586
|
let visitDescendants = true;
|
|
1468
|
-
let descendantContext = (
|
|
1587
|
+
let descendantContext = (_b = childContexts.get(currentComponent.node)) != null ? _b : currentQueueEntry.context;
|
|
1469
1588
|
let visitorInfo;
|
|
1470
1589
|
if (currentComponent.type === "root" && isRootEntryReference(currentComponent) || currentComponent.type === "block") {
|
|
1471
1590
|
visitorInfo = {
|
|
@@ -1567,7 +1686,8 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1567
1686
|
"_dataResources",
|
|
1568
1687
|
"_overridability",
|
|
1569
1688
|
"_overrides",
|
|
1570
|
-
"_patternDataResources"
|
|
1689
|
+
"_patternDataResources",
|
|
1690
|
+
"_patternOptedInQueryStrings"
|
|
1571
1691
|
];
|
|
1572
1692
|
propertiesToCheck.forEach((property) => {
|
|
1573
1693
|
if (!replacementComponent[property]) {
|
|
@@ -1652,39 +1772,11 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1652
1772
|
continue;
|
|
1653
1773
|
}
|
|
1654
1774
|
const slots = "slots" in currentComponent.node && currentComponent.node.slots;
|
|
1655
|
-
|
|
1656
|
-
const slotKeys = Object.keys(slots);
|
|
1657
|
-
for (let slotIndex = slotKeys.length - 1; slotIndex >= 0; slotIndex--) {
|
|
1658
|
-
const slotKey = slotKeys[slotIndex];
|
|
1659
|
-
const components = slots[slotKey];
|
|
1660
|
-
for (let componentIndex = components.length - 1; componentIndex >= 0; componentIndex--) {
|
|
1661
|
-
const enqueueingComponent = components[componentIndex];
|
|
1662
|
-
const parentSlotIndexFn = () => {
|
|
1663
|
-
const result = currentComponent.node.slots[slotKey].findIndex(
|
|
1664
|
-
(x) => x === enqueueingComponent
|
|
1665
|
-
);
|
|
1666
|
-
return result;
|
|
1667
|
-
};
|
|
1668
|
-
componentQueue.push({
|
|
1669
|
-
ancestorsAndSelf: [
|
|
1670
|
-
{
|
|
1671
|
-
type: "slot",
|
|
1672
|
-
node: enqueueingComponent,
|
|
1673
|
-
parentSlot: slotKey,
|
|
1674
|
-
parentSlotIndexFn
|
|
1675
|
-
},
|
|
1676
|
-
...currentQueueEntry.ancestorsAndSelf
|
|
1677
|
-
],
|
|
1678
|
-
context: descendantContext
|
|
1679
|
-
});
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1775
|
+
const childEntries = [];
|
|
1683
1776
|
const properties = getPropertiesValue(currentComponent.node);
|
|
1684
1777
|
if (properties) {
|
|
1685
1778
|
const propertyEntries = Object.entries(properties);
|
|
1686
|
-
for (
|
|
1687
|
-
const [propKey, propObject] = propertyEntries[propIndex];
|
|
1779
|
+
for (const [propKey, propObject] of propertyEntries) {
|
|
1688
1780
|
if (!isNestedNodeType(propObject.type)) {
|
|
1689
1781
|
continue;
|
|
1690
1782
|
}
|
|
@@ -1704,13 +1796,12 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1704
1796
|
continue;
|
|
1705
1797
|
}
|
|
1706
1798
|
}
|
|
1707
|
-
const blocks = (
|
|
1708
|
-
for (
|
|
1709
|
-
const enqueueingBlock = blocks[blockIndex];
|
|
1799
|
+
const blocks = (_c = propObject.value) != null ? _c : [];
|
|
1800
|
+
for (const enqueueingBlock of blocks) {
|
|
1710
1801
|
const blockIndexFn = () => {
|
|
1711
1802
|
return getBlockValue(currentComponent.node, propKey).findIndex((x) => x === enqueueingBlock);
|
|
1712
1803
|
};
|
|
1713
|
-
|
|
1804
|
+
childEntries.push({
|
|
1714
1805
|
ancestorsAndSelf: [
|
|
1715
1806
|
{
|
|
1716
1807
|
type: "block",
|
|
@@ -1725,6 +1816,36 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1725
1816
|
}
|
|
1726
1817
|
}
|
|
1727
1818
|
}
|
|
1819
|
+
if (slots) {
|
|
1820
|
+
const slotKeys = Object.keys(slots);
|
|
1821
|
+
for (const slotKey of slotKeys) {
|
|
1822
|
+
const components = slots[slotKey];
|
|
1823
|
+
for (const enqueueingComponent of components) {
|
|
1824
|
+
const parentSlotIndexFn = () => {
|
|
1825
|
+
const result = currentComponent.node.slots[slotKey].findIndex(
|
|
1826
|
+
(x) => x === enqueueingComponent
|
|
1827
|
+
);
|
|
1828
|
+
return result;
|
|
1829
|
+
};
|
|
1830
|
+
childEntries.push({
|
|
1831
|
+
ancestorsAndSelf: [
|
|
1832
|
+
{
|
|
1833
|
+
type: "slot",
|
|
1834
|
+
node: enqueueingComponent,
|
|
1835
|
+
parentSlot: slotKey,
|
|
1836
|
+
parentSlotIndexFn
|
|
1837
|
+
},
|
|
1838
|
+
...currentQueueEntry.ancestorsAndSelf
|
|
1839
|
+
],
|
|
1840
|
+
context: descendantContext
|
|
1841
|
+
});
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
if (order === "dfs") {
|
|
1846
|
+
childEntries.reverse();
|
|
1847
|
+
}
|
|
1848
|
+
componentQueue.push(...childEntries);
|
|
1728
1849
|
} while (componentQueue.length > 0);
|
|
1729
1850
|
}
|
|
1730
1851
|
function isNestedNodeType(type) {
|
|
@@ -2150,7 +2271,7 @@ function getLocaleMatch(index, locale, greedy) {
|
|
|
2150
2271
|
}
|
|
2151
2272
|
const match = index[locale];
|
|
2152
2273
|
if (match === void 0 && greedy) {
|
|
2153
|
-
return Object.values(index)
|
|
2274
|
+
return Object.values(index).find((value) => value !== void 0);
|
|
2154
2275
|
}
|
|
2155
2276
|
return match;
|
|
2156
2277
|
}
|
|
@@ -2158,6 +2279,9 @@ function getLocaleMatch(index, locale, greedy) {
|
|
|
2158
2279
|
// src/enhancement/visibility/evaluateVisibilityCriteriaGroup.ts
|
|
2159
2280
|
function evaluateVisibilityCriteriaGroup(options) {
|
|
2160
2281
|
const { criteriaGroup, simplifyCriteria } = options;
|
|
2282
|
+
if (criteriaGroup.clauses.length === 0) {
|
|
2283
|
+
return true;
|
|
2284
|
+
}
|
|
2161
2285
|
const earlyExitResult = criteriaGroup.op === "&" || !criteriaGroup.op ? false : true;
|
|
2162
2286
|
let hasIndeterminateClauses = false;
|
|
2163
2287
|
for (let index = criteriaGroup.clauses.length - 1; index >= 0; index--) {
|
|
@@ -2166,6 +2290,9 @@ function evaluateVisibilityCriteriaGroup(options) {
|
|
|
2166
2290
|
if (criteriaResult === null) {
|
|
2167
2291
|
hasIndeterminateClauses = true;
|
|
2168
2292
|
} else if (criteriaResult === earlyExitResult) {
|
|
2293
|
+
if (simplifyCriteria && earlyExitResult) {
|
|
2294
|
+
criteriaGroup.clauses.splice(0);
|
|
2295
|
+
}
|
|
2169
2296
|
return earlyExitResult;
|
|
2170
2297
|
} else if (criteriaResult !== null && simplifyCriteria) {
|
|
2171
2298
|
criteriaGroup.clauses.splice(index, 1);
|
|
@@ -2353,7 +2480,11 @@ function evaluateWalkTreePropertyCriteria({
|
|
|
2353
2480
|
delete properties[propertyName];
|
|
2354
2481
|
}
|
|
2355
2482
|
} else {
|
|
2356
|
-
const { currentValue, remainingConditionalValues } =
|
|
2483
|
+
const { currentValue, remainingConditionalValues } = property.conditions === void 0 ? (
|
|
2484
|
+
// most properties have no conditions: this is what evaluatePropertyCriteria returns for them,
|
|
2485
|
+
// without the cost of calling it for every property
|
|
2486
|
+
{ currentValue: property.value, remainingConditionalValues: void 0 }
|
|
2487
|
+
) : evaluatePropertyCriteria({
|
|
2357
2488
|
baseValue: property.value,
|
|
2358
2489
|
conditionalValues: property.conditions,
|
|
2359
2490
|
rules,
|
|
@@ -2413,11 +2544,34 @@ var stringOperatorEvaluators = {
|
|
|
2413
2544
|
endswith: endsWithEvaluator,
|
|
2414
2545
|
empty: emptyEvaluator
|
|
2415
2546
|
};
|
|
2547
|
+
var numericOperatorEvaluators = {
|
|
2548
|
+
gt: (left, right) => left > right,
|
|
2549
|
+
lt: (left, right) => left < right
|
|
2550
|
+
};
|
|
2551
|
+
function evaluateNumericOperator(criteria, matchValue) {
|
|
2552
|
+
const { op, value } = criteria;
|
|
2553
|
+
const evaluator = numericOperatorEvaluators[op];
|
|
2554
|
+
if (!evaluator) {
|
|
2555
|
+
return null;
|
|
2556
|
+
}
|
|
2557
|
+
if (typeof matchValue === "string" && matchValue.trim() === "" || typeof value === "string" && value.trim() === "") {
|
|
2558
|
+
return false;
|
|
2559
|
+
}
|
|
2560
|
+
const leftNum = Number(matchValue);
|
|
2561
|
+
const rightNum = Number(value);
|
|
2562
|
+
if (isNaN(leftNum) || isNaN(rightNum)) {
|
|
2563
|
+
return false;
|
|
2564
|
+
}
|
|
2565
|
+
return evaluator(leftNum, rightNum);
|
|
2566
|
+
}
|
|
2416
2567
|
function evaluateStringMatch(criteria, matchValue, allow) {
|
|
2417
2568
|
const { op, value } = criteria;
|
|
2418
2569
|
if (allow && !allow.has(op)) {
|
|
2419
2570
|
return null;
|
|
2420
2571
|
}
|
|
2572
|
+
if (op in numericOperatorEvaluators) {
|
|
2573
|
+
return evaluateNumericOperator(criteria, matchValue);
|
|
2574
|
+
}
|
|
2421
2575
|
let opMatch = op;
|
|
2422
2576
|
const negation = op.startsWith("!");
|
|
2423
2577
|
if (negation) {
|
|
@@ -2466,17 +2620,49 @@ var dynamicTokenVisibilityOperators = /* @__PURE__ */ new Set([
|
|
|
2466
2620
|
"endswith",
|
|
2467
2621
|
"!endswith",
|
|
2468
2622
|
"empty",
|
|
2469
|
-
"!empty"
|
|
2623
|
+
"!empty",
|
|
2624
|
+
"gt",
|
|
2625
|
+
"lt"
|
|
2470
2626
|
]);
|
|
2471
2627
|
var CANVAS_VIZ_DYNAMIC_TOKEN_RULE = "$dt";
|
|
2628
|
+
function toStringValue(value) {
|
|
2629
|
+
if (typeof value === "string") {
|
|
2630
|
+
return value;
|
|
2631
|
+
}
|
|
2632
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
2633
|
+
return String(value);
|
|
2634
|
+
}
|
|
2635
|
+
return "";
|
|
2636
|
+
}
|
|
2637
|
+
function toStringCriteriaValue(value) {
|
|
2638
|
+
if (Array.isArray(value)) {
|
|
2639
|
+
return value.map((v) => toStringValue(v));
|
|
2640
|
+
}
|
|
2641
|
+
return toStringValue(value);
|
|
2642
|
+
}
|
|
2643
|
+
function isUnbound(value) {
|
|
2644
|
+
if (value === void 0 || value === null) {
|
|
2645
|
+
return true;
|
|
2646
|
+
}
|
|
2647
|
+
if (typeof value === "string") {
|
|
2648
|
+
return hasReferencedVariables(value) > 0;
|
|
2649
|
+
}
|
|
2650
|
+
return false;
|
|
2651
|
+
}
|
|
2472
2652
|
function createDynamicTokenVisibilityRule() {
|
|
2473
2653
|
return {
|
|
2474
2654
|
[CANVAS_VIZ_DYNAMIC_TOKEN_RULE]: (criterion) => {
|
|
2475
|
-
|
|
2476
|
-
if (
|
|
2655
|
+
const { source, value } = criterion;
|
|
2656
|
+
if (isUnbound(source)) {
|
|
2477
2657
|
return null;
|
|
2478
2658
|
}
|
|
2479
|
-
|
|
2659
|
+
const stringSource = toStringValue(source);
|
|
2660
|
+
const stringValue = toStringCriteriaValue(value);
|
|
2661
|
+
const stringCriterion = {
|
|
2662
|
+
...criterion,
|
|
2663
|
+
value: stringValue
|
|
2664
|
+
};
|
|
2665
|
+
return evaluateStringMatch(stringCriterion, stringSource, dynamicTokenVisibilityOperators);
|
|
2480
2666
|
}
|
|
2481
2667
|
};
|
|
2482
2668
|
}
|
|
@@ -2535,8 +2721,7 @@ function extractLocales({ component }) {
|
|
|
2535
2721
|
return variations;
|
|
2536
2722
|
}
|
|
2537
2723
|
function localize(options) {
|
|
2538
|
-
const nodes = options
|
|
2539
|
-
const locale = options.locale;
|
|
2724
|
+
const { nodes, locale, keepLocalesFor } = options;
|
|
2540
2725
|
if (!locale) {
|
|
2541
2726
|
return;
|
|
2542
2727
|
}
|
|
@@ -2544,7 +2729,7 @@ function localize(options) {
|
|
|
2544
2729
|
walkNodeTree(nodes, (context) => {
|
|
2545
2730
|
const { type, node, actions } = context;
|
|
2546
2731
|
if (type !== "component") {
|
|
2547
|
-
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2732
|
+
localizeProperties(node, locale, vizControlLocaleRule, keepLocalesFor);
|
|
2548
2733
|
return;
|
|
2549
2734
|
}
|
|
2550
2735
|
const result = evaluateWalkTreeNodeVisibility({
|
|
@@ -2565,7 +2750,7 @@ function localize(options) {
|
|
|
2565
2750
|
if (replaceComponent == null ? void 0 : replaceComponent.length) {
|
|
2566
2751
|
replaceComponent.forEach((component) => {
|
|
2567
2752
|
removeLocaleProperty(component);
|
|
2568
|
-
localizeProperties(component, locale, vizControlLocaleRule);
|
|
2753
|
+
localizeProperties(component, locale, vizControlLocaleRule, keepLocalesFor);
|
|
2569
2754
|
});
|
|
2570
2755
|
const [first, ...rest] = replaceComponent;
|
|
2571
2756
|
actions.replace(first);
|
|
@@ -2576,7 +2761,7 @@ function localize(options) {
|
|
|
2576
2761
|
actions.remove();
|
|
2577
2762
|
}
|
|
2578
2763
|
} else {
|
|
2579
|
-
localizeProperties(node, locale, vizControlLocaleRule);
|
|
2764
|
+
localizeProperties(node, locale, vizControlLocaleRule, keepLocalesFor);
|
|
2580
2765
|
}
|
|
2581
2766
|
});
|
|
2582
2767
|
}
|
|
@@ -2595,7 +2780,7 @@ function removeLocaleProperty(component) {
|
|
|
2595
2780
|
}
|
|
2596
2781
|
}
|
|
2597
2782
|
}
|
|
2598
|
-
function localizeProperties(node, locale, rules) {
|
|
2783
|
+
function localizeProperties(node, locale, rules, keepLocalesFor) {
|
|
2599
2784
|
const properties = getPropertiesValue(node);
|
|
2600
2785
|
if (!properties) {
|
|
2601
2786
|
return void 0;
|
|
@@ -2614,10 +2799,16 @@ function localizeProperties(node, locale, rules) {
|
|
|
2614
2799
|
if (currentLocaleConditionalValues !== void 0) {
|
|
2615
2800
|
propertyValue.conditions = currentLocaleConditionalValues;
|
|
2616
2801
|
}
|
|
2617
|
-
|
|
2618
|
-
|
|
2802
|
+
const preserveLocales = (keepLocalesFor == null ? void 0 : keepLocalesFor(propertyId)) === true;
|
|
2803
|
+
if (!preserveLocales) {
|
|
2804
|
+
delete propertyValue.locales;
|
|
2805
|
+
delete propertyValue.localesConditions;
|
|
2806
|
+
}
|
|
2619
2807
|
if (propertyValue.value === void 0 && propertyValue.conditions === void 0) {
|
|
2620
|
-
|
|
2808
|
+
const hasLocales = preserveLocales && (propertyValue.locales || propertyValue.localesConditions);
|
|
2809
|
+
if (!hasLocales) {
|
|
2810
|
+
delete properties[propertyId];
|
|
2811
|
+
}
|
|
2621
2812
|
}
|
|
2622
2813
|
});
|
|
2623
2814
|
evaluateWalkTreePropertyCriteria({
|
|
@@ -2685,24 +2876,28 @@ function walkPropertyValues(property, visitor) {
|
|
|
2685
2876
|
}
|
|
2686
2877
|
|
|
2687
2878
|
// src/EntityReleasesClient.ts
|
|
2688
|
-
var
|
|
2689
|
-
var
|
|
2690
|
-
var EntityReleasesClient = class extends
|
|
2879
|
+
var import_api15 = require("@uniformdev/context/api");
|
|
2880
|
+
var entityReleasesUrl = "/api/v1/entity-releases";
|
|
2881
|
+
var EntityReleasesClient = class extends import_api15.ApiClient {
|
|
2691
2882
|
constructor(options) {
|
|
2692
2883
|
super(options);
|
|
2693
2884
|
}
|
|
2694
2885
|
/** Fetches entity across all releases (and base) */
|
|
2695
|
-
async
|
|
2886
|
+
async list(options) {
|
|
2696
2887
|
const { projectId } = this.options;
|
|
2697
|
-
const fetchUri = this.createUrl(
|
|
2888
|
+
const fetchUri = this.createUrl(entityReleasesUrl, { ...options, projectId });
|
|
2698
2889
|
return await this.apiClient(fetchUri);
|
|
2699
2890
|
}
|
|
2891
|
+
/** @deprecated Use {@link list} instead. */
|
|
2892
|
+
async get(options) {
|
|
2893
|
+
return this.list(options);
|
|
2894
|
+
}
|
|
2700
2895
|
};
|
|
2701
2896
|
|
|
2702
2897
|
// src/IntegrationPropertyEditorsClient.ts
|
|
2703
|
-
var
|
|
2898
|
+
var import_api16 = require("@uniformdev/context/api");
|
|
2704
2899
|
var _baseUrl;
|
|
2705
|
-
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient extends
|
|
2900
|
+
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient extends import_api16.ApiClient {
|
|
2706
2901
|
constructor(options) {
|
|
2707
2902
|
super(options);
|
|
2708
2903
|
this.teamId = options.teamId;
|
|
@@ -2744,21 +2939,74 @@ _baseUrl = new WeakMap();
|
|
|
2744
2939
|
__privateAdd(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
2745
2940
|
var IntegrationPropertyEditorsClient = _IntegrationPropertyEditorsClient;
|
|
2746
2941
|
|
|
2942
|
+
// src/LabelClient.ts
|
|
2943
|
+
var import_api17 = require("@uniformdev/context/api");
|
|
2944
|
+
var LABELS_URL = "/api/v1/labels";
|
|
2945
|
+
var LabelClient = class extends import_api17.ApiClient {
|
|
2946
|
+
/** Fetches a list of labels for the current project. */
|
|
2947
|
+
async list(options) {
|
|
2948
|
+
const { projectId } = this.options;
|
|
2949
|
+
const fetchUri = this.createUrl(LABELS_URL, { ...options, projectId });
|
|
2950
|
+
return await this.apiClient(fetchUri);
|
|
2951
|
+
}
|
|
2952
|
+
/** @deprecated Use {@link list} instead. */
|
|
2953
|
+
async getLabels(options) {
|
|
2954
|
+
return this.list(options);
|
|
2955
|
+
}
|
|
2956
|
+
/** Updates or creates a label. */
|
|
2957
|
+
async save(body) {
|
|
2958
|
+
const { projectId } = this.options;
|
|
2959
|
+
const fetchUri = this.createUrl(LABELS_URL);
|
|
2960
|
+
await this.apiClient(fetchUri, {
|
|
2961
|
+
method: "PUT",
|
|
2962
|
+
body: JSON.stringify({ ...body, projectId }),
|
|
2963
|
+
expectNoContent: true
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
/** @deprecated Use {@link save} instead. */
|
|
2967
|
+
async upsertLabel(body) {
|
|
2968
|
+
return this.save(body);
|
|
2969
|
+
}
|
|
2970
|
+
/** Deletes a label by id. */
|
|
2971
|
+
async remove(options) {
|
|
2972
|
+
const { projectId } = this.options;
|
|
2973
|
+
const fetchUri = this.createUrl(LABELS_URL);
|
|
2974
|
+
await this.apiClient(fetchUri, {
|
|
2975
|
+
method: "DELETE",
|
|
2976
|
+
body: JSON.stringify({ ...options, projectId }),
|
|
2977
|
+
expectNoContent: true
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
/** @deprecated Use {@link remove} instead. */
|
|
2981
|
+
async removeLabel(options) {
|
|
2982
|
+
return this.remove(options);
|
|
2983
|
+
}
|
|
2984
|
+
};
|
|
2985
|
+
var UncachedLabelClient = class extends LabelClient {
|
|
2986
|
+
constructor(options) {
|
|
2987
|
+
super({ ...options, bypassCache: true });
|
|
2988
|
+
}
|
|
2989
|
+
};
|
|
2990
|
+
|
|
2747
2991
|
// src/LocaleClient.ts
|
|
2748
|
-
var
|
|
2992
|
+
var import_api18 = require("@uniformdev/context/api");
|
|
2749
2993
|
var localesUrl = "/api/v1/locales";
|
|
2750
|
-
var LocaleClient = class extends
|
|
2994
|
+
var LocaleClient = class extends import_api18.ApiClient {
|
|
2751
2995
|
constructor(options) {
|
|
2752
2996
|
super(options);
|
|
2753
2997
|
}
|
|
2754
|
-
/** Fetches
|
|
2755
|
-
async
|
|
2998
|
+
/** Fetches a list of locales for a project */
|
|
2999
|
+
async list(options) {
|
|
2756
3000
|
const { projectId } = this.options;
|
|
2757
3001
|
const fetchUri = this.createUrl(localesUrl, { ...options, projectId });
|
|
2758
3002
|
return await this.apiClient(fetchUri);
|
|
2759
3003
|
}
|
|
3004
|
+
/** @deprecated Use {@link list} instead. */
|
|
3005
|
+
async get(options) {
|
|
3006
|
+
return this.list(options);
|
|
3007
|
+
}
|
|
2760
3008
|
/** Updates or creates (based on id) a locale */
|
|
2761
|
-
async
|
|
3009
|
+
async save(body) {
|
|
2762
3010
|
const fetchUri = this.createUrl(localesUrl);
|
|
2763
3011
|
await this.apiClient(fetchUri, {
|
|
2764
3012
|
method: "PUT",
|
|
@@ -2766,6 +3014,10 @@ var LocaleClient = class extends import_api9.ApiClient {
|
|
|
2766
3014
|
expectNoContent: true
|
|
2767
3015
|
});
|
|
2768
3016
|
}
|
|
3017
|
+
/** @deprecated Use {@link save} instead. */
|
|
3018
|
+
async upsert(body) {
|
|
3019
|
+
return this.save(body);
|
|
3020
|
+
}
|
|
2769
3021
|
/** Deletes a locale */
|
|
2770
3022
|
async remove(body) {
|
|
2771
3023
|
const fetchUri = this.createUrl(localesUrl);
|
|
@@ -2802,6 +3054,12 @@ var isSelectComponentMessage = (message) => {
|
|
|
2802
3054
|
var isReadyMessage = (message) => {
|
|
2803
3055
|
return message.type === "ready";
|
|
2804
3056
|
};
|
|
3057
|
+
var isSessionPendingMessage = (message) => {
|
|
3058
|
+
return message.type === "session-pending";
|
|
3059
|
+
};
|
|
3060
|
+
var isAwaitingReadyMessage = (message) => {
|
|
3061
|
+
return message.type === "awaiting-ready";
|
|
3062
|
+
};
|
|
2805
3063
|
var isComponentActionMessage = (message) => {
|
|
2806
3064
|
return message.type === "trigger-component-action";
|
|
2807
3065
|
};
|
|
@@ -2904,6 +3162,14 @@ var createCanvasChannel = ({
|
|
|
2904
3162
|
};
|
|
2905
3163
|
postMessage(message);
|
|
2906
3164
|
};
|
|
3165
|
+
const sessionPending = () => {
|
|
3166
|
+
const message = { type: "session-pending" };
|
|
3167
|
+
postMessage(message);
|
|
3168
|
+
};
|
|
3169
|
+
const awaitingReady = () => {
|
|
3170
|
+
const message = { type: "awaiting-ready" };
|
|
3171
|
+
postMessage(message);
|
|
3172
|
+
};
|
|
2907
3173
|
const on = (types, handler) => {
|
|
2908
3174
|
const handlerId = ++handlerCounter;
|
|
2909
3175
|
handlers[handlerId] = {
|
|
@@ -3103,6 +3369,8 @@ var createCanvasChannel = ({
|
|
|
3103
3369
|
return {
|
|
3104
3370
|
broadcastTo: broadcastToItems,
|
|
3105
3371
|
ready,
|
|
3372
|
+
sessionPending,
|
|
3373
|
+
awaitingReady,
|
|
3106
3374
|
destroy,
|
|
3107
3375
|
addBroadcastTarget,
|
|
3108
3376
|
triggerComponentAction,
|
|
@@ -3133,10 +3401,10 @@ var createCanvasChannel = ({
|
|
|
3133
3401
|
};
|
|
3134
3402
|
|
|
3135
3403
|
// src/PreviewClient.ts
|
|
3136
|
-
var
|
|
3404
|
+
var import_api19 = require("@uniformdev/context/api");
|
|
3137
3405
|
var previewUrlsUrl = "/api/v1/preview-urls";
|
|
3138
3406
|
var previewViewportsUrl = "/api/v1/preview-viewports";
|
|
3139
|
-
var PreviewClient = class extends
|
|
3407
|
+
var PreviewClient = class extends import_api19.ApiClient {
|
|
3140
3408
|
constructor(options) {
|
|
3141
3409
|
super(options);
|
|
3142
3410
|
}
|
|
@@ -3199,9 +3467,9 @@ var PreviewClient = class extends import_api10.ApiClient {
|
|
|
3199
3467
|
};
|
|
3200
3468
|
|
|
3201
3469
|
// src/ProjectClient.ts
|
|
3202
|
-
var
|
|
3203
|
-
var _url2;
|
|
3204
|
-
var _ProjectClient = class _ProjectClient extends
|
|
3470
|
+
var import_api20 = require("@uniformdev/context/api");
|
|
3471
|
+
var _url2, _projectsUrl;
|
|
3472
|
+
var _ProjectClient = class _ProjectClient extends import_api20.ApiClient {
|
|
3205
3473
|
constructor(options) {
|
|
3206
3474
|
super({ ...options, bypassCache: true });
|
|
3207
3475
|
}
|
|
@@ -3210,16 +3478,33 @@ var _ProjectClient = class _ProjectClient extends import_api11.ApiClient {
|
|
|
3210
3478
|
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2), { ...options });
|
|
3211
3479
|
return await this.apiClient(fetchUri);
|
|
3212
3480
|
}
|
|
3481
|
+
/**
|
|
3482
|
+
* Fetches projects grouped by team.
|
|
3483
|
+
* When teamId is provided, returns a single team with its projects.
|
|
3484
|
+
* When omitted, returns all accessible teams and their projects.
|
|
3485
|
+
*/
|
|
3486
|
+
async list(options) {
|
|
3487
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _projectsUrl), options ? { ...options } : {});
|
|
3488
|
+
return await this.apiClient(fetchUri);
|
|
3489
|
+
}
|
|
3490
|
+
/** @deprecated Use {@link list} instead. */
|
|
3491
|
+
async getProjects(options) {
|
|
3492
|
+
return this.list(options);
|
|
3493
|
+
}
|
|
3213
3494
|
/** Updates or creates (based on id) a Project */
|
|
3214
|
-
async
|
|
3495
|
+
async save(body) {
|
|
3215
3496
|
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
|
|
3216
3497
|
return await this.apiClient(fetchUri, {
|
|
3217
3498
|
method: "PUT",
|
|
3218
3499
|
body: JSON.stringify({ ...body })
|
|
3219
3500
|
});
|
|
3220
3501
|
}
|
|
3502
|
+
/** @deprecated Use {@link save} instead. */
|
|
3503
|
+
async upsert(body) {
|
|
3504
|
+
return this.save(body);
|
|
3505
|
+
}
|
|
3221
3506
|
/** Deletes a Project */
|
|
3222
|
-
async
|
|
3507
|
+
async remove(body) {
|
|
3223
3508
|
const fetchUri = this.createUrl(__privateGet(_ProjectClient, _url2));
|
|
3224
3509
|
await this.apiClient(fetchUri, {
|
|
3225
3510
|
method: "DELETE",
|
|
@@ -3227,15 +3512,203 @@ var _ProjectClient = class _ProjectClient extends import_api11.ApiClient {
|
|
|
3227
3512
|
expectNoContent: true
|
|
3228
3513
|
});
|
|
3229
3514
|
}
|
|
3515
|
+
/** @deprecated Use {@link remove} instead. */
|
|
3516
|
+
async delete(body) {
|
|
3517
|
+
return this.remove(body);
|
|
3518
|
+
}
|
|
3230
3519
|
};
|
|
3231
3520
|
_url2 = new WeakMap();
|
|
3521
|
+
_projectsUrl = new WeakMap();
|
|
3232
3522
|
__privateAdd(_ProjectClient, _url2, "/api/v1/project");
|
|
3523
|
+
__privateAdd(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
3233
3524
|
var ProjectClient = _ProjectClient;
|
|
3234
3525
|
|
|
3526
|
+
// src/projection/matchesProjectionPattern.ts
|
|
3527
|
+
var DISALLOWED_PATTERN_CHARS = /[,&=?#[\]\s]/;
|
|
3528
|
+
var REGEX_METACHAR = /[\\^$.|?*+()[\]{}]/g;
|
|
3529
|
+
function isValidProjectionPattern(pattern) {
|
|
3530
|
+
if (typeof pattern !== "string" || pattern.length === 0) {
|
|
3531
|
+
return false;
|
|
3532
|
+
}
|
|
3533
|
+
if (DISALLOWED_PATTERN_CHARS.test(pattern)) {
|
|
3534
|
+
return false;
|
|
3535
|
+
}
|
|
3536
|
+
return true;
|
|
3537
|
+
}
|
|
3538
|
+
function compilePattern(pattern) {
|
|
3539
|
+
let regexSource = "^";
|
|
3540
|
+
for (const ch of pattern) {
|
|
3541
|
+
if (ch === "*") {
|
|
3542
|
+
regexSource += ".*";
|
|
3543
|
+
} else {
|
|
3544
|
+
regexSource += ch.replace(REGEX_METACHAR, "\\$&");
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
regexSource += "$";
|
|
3548
|
+
return new RegExp(regexSource);
|
|
3549
|
+
}
|
|
3550
|
+
var PATTERN_CACHE_MAX = 1024;
|
|
3551
|
+
var patternRegexCache = /* @__PURE__ */ new Map();
|
|
3552
|
+
function matchesProjectionPattern(pattern, value) {
|
|
3553
|
+
let re = patternRegexCache.get(pattern);
|
|
3554
|
+
if (re === void 0) {
|
|
3555
|
+
if (!isValidProjectionPattern(pattern)) {
|
|
3556
|
+
throw new Error(`Invalid projection pattern: ${JSON.stringify(pattern)}`);
|
|
3557
|
+
}
|
|
3558
|
+
re = compilePattern(pattern);
|
|
3559
|
+
if (patternRegexCache.size >= PATTERN_CACHE_MAX) {
|
|
3560
|
+
const oldest = patternRegexCache.keys().next().value;
|
|
3561
|
+
if (oldest !== void 0) patternRegexCache.delete(oldest);
|
|
3562
|
+
}
|
|
3563
|
+
patternRegexCache.set(pattern, re);
|
|
3564
|
+
}
|
|
3565
|
+
return re.test(value);
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
// src/projection/queryToProjection.ts
|
|
3569
|
+
var TOP_LEVEL_OPERATOR_KEY = /^(fields|fieldTypes|slots)\[([A-Za-z]+)\]$/;
|
|
3570
|
+
var SLOTS_NAMED_KEY = /^slots\.([A-Za-z0-9_-]+)\[([A-Za-z]+)\]$/;
|
|
3571
|
+
function toStringValue2(value) {
|
|
3572
|
+
if (Array.isArray(value)) {
|
|
3573
|
+
return value.join(",");
|
|
3574
|
+
}
|
|
3575
|
+
return value;
|
|
3576
|
+
}
|
|
3577
|
+
function parseCsv(value) {
|
|
3578
|
+
const str = toStringValue2(value);
|
|
3579
|
+
if (!str) {
|
|
3580
|
+
return [];
|
|
3581
|
+
}
|
|
3582
|
+
return str.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
3583
|
+
}
|
|
3584
|
+
function parseDepth(value, key) {
|
|
3585
|
+
const str = toStringValue2(value);
|
|
3586
|
+
if (str === void 0 || str === "") {
|
|
3587
|
+
throw new Error(`Invalid select projection: '${key}' requires a non-negative integer value`);
|
|
3588
|
+
}
|
|
3589
|
+
if (!/^\d+$/.test(str)) {
|
|
3590
|
+
throw new Error(
|
|
3591
|
+
`Invalid select projection: '${key}' must be a non-negative integer (got ${JSON.stringify(str)})`
|
|
3592
|
+
);
|
|
3593
|
+
}
|
|
3594
|
+
return Number(str);
|
|
3595
|
+
}
|
|
3596
|
+
function parseBlockDepth(value, key) {
|
|
3597
|
+
const str = toStringValue2(value);
|
|
3598
|
+
if (str === "preserveAll") {
|
|
3599
|
+
return "preserveAll";
|
|
3600
|
+
}
|
|
3601
|
+
if (str === void 0 || str === "" || !/^\d+$/.test(str)) {
|
|
3602
|
+
throw new Error(
|
|
3603
|
+
`Invalid select projection: '${key}' must be a non-negative integer or 'preserveAll' (got ${JSON.stringify(str)})`
|
|
3604
|
+
);
|
|
3605
|
+
}
|
|
3606
|
+
return Number(str);
|
|
3607
|
+
}
|
|
3608
|
+
function extractSelectKeys(source) {
|
|
3609
|
+
if (source instanceof URLSearchParams) {
|
|
3610
|
+
let out2;
|
|
3611
|
+
for (const [key, value] of source.entries()) {
|
|
3612
|
+
if (!key.startsWith(SELECT_QUERY_PREFIX)) continue;
|
|
3613
|
+
out2 != null ? out2 : out2 = {};
|
|
3614
|
+
out2[key] = out2[key] === void 0 ? value : `${out2[key]},${value}`;
|
|
3615
|
+
}
|
|
3616
|
+
return out2;
|
|
3617
|
+
}
|
|
3618
|
+
let out;
|
|
3619
|
+
for (const key in source) {
|
|
3620
|
+
if (!key.startsWith(SELECT_QUERY_PREFIX)) continue;
|
|
3621
|
+
out != null ? out : out = {};
|
|
3622
|
+
out[key] = source[key];
|
|
3623
|
+
}
|
|
3624
|
+
return out;
|
|
3625
|
+
}
|
|
3626
|
+
function queryToProjection(source) {
|
|
3627
|
+
var _a, _b, _c, _d, _e;
|
|
3628
|
+
if (!source) {
|
|
3629
|
+
return void 0;
|
|
3630
|
+
}
|
|
3631
|
+
const query = extractSelectKeys(source);
|
|
3632
|
+
if (!query) {
|
|
3633
|
+
return void 0;
|
|
3634
|
+
}
|
|
3635
|
+
const spec = {};
|
|
3636
|
+
for (const [rawKey, value] of Object.entries(query)) {
|
|
3637
|
+
const key = rawKey.slice(SELECT_QUERY_PREFIX.length);
|
|
3638
|
+
const namedMatch = SLOTS_NAMED_KEY.exec(key);
|
|
3639
|
+
if (namedMatch) {
|
|
3640
|
+
const [, slotName, operator2] = namedMatch;
|
|
3641
|
+
if (operator2 !== "depth") {
|
|
3642
|
+
throw new Error(
|
|
3643
|
+
`Invalid select projection: unsupported operator '${operator2}' for slots.${slotName}`
|
|
3644
|
+
);
|
|
3645
|
+
}
|
|
3646
|
+
const slots = (_a = spec.slots) != null ? _a : spec.slots = {};
|
|
3647
|
+
const named = (_b = slots.named) != null ? _b : slots.named = {};
|
|
3648
|
+
named[slotName] = { ...named[slotName], depth: parseDepth(value, rawKey) };
|
|
3649
|
+
continue;
|
|
3650
|
+
}
|
|
3651
|
+
const topMatch = TOP_LEVEL_OPERATOR_KEY.exec(key);
|
|
3652
|
+
if (!topMatch) {
|
|
3653
|
+
throw new Error(`Invalid select projection key: ${JSON.stringify(rawKey)}`);
|
|
3654
|
+
}
|
|
3655
|
+
const [, bucket, operator] = topMatch;
|
|
3656
|
+
if (bucket === "fields") {
|
|
3657
|
+
const fields = (_c = spec.fields) != null ? _c : spec.fields = {};
|
|
3658
|
+
switch (operator) {
|
|
3659
|
+
case "only":
|
|
3660
|
+
fields.only = parseCsv(value);
|
|
3661
|
+
break;
|
|
3662
|
+
case "except":
|
|
3663
|
+
fields.except = parseCsv(value);
|
|
3664
|
+
break;
|
|
3665
|
+
case "locales":
|
|
3666
|
+
fields.locales = parseCsv(value);
|
|
3667
|
+
break;
|
|
3668
|
+
case "blockDepth":
|
|
3669
|
+
fields.blockDepth = parseBlockDepth(value, rawKey);
|
|
3670
|
+
break;
|
|
3671
|
+
default:
|
|
3672
|
+
throw new Error(`Invalid select projection: unsupported operator 'fields[${operator}]'`);
|
|
3673
|
+
}
|
|
3674
|
+
} else if (bucket === "fieldTypes") {
|
|
3675
|
+
const fieldTypes = (_d = spec.fieldTypes) != null ? _d : spec.fieldTypes = {};
|
|
3676
|
+
switch (operator) {
|
|
3677
|
+
case "only":
|
|
3678
|
+
fieldTypes.only = parseCsv(value);
|
|
3679
|
+
break;
|
|
3680
|
+
case "except":
|
|
3681
|
+
fieldTypes.except = parseCsv(value);
|
|
3682
|
+
break;
|
|
3683
|
+
default:
|
|
3684
|
+
throw new Error(`Invalid select projection: unsupported operator 'fieldTypes[${operator}]'`);
|
|
3685
|
+
}
|
|
3686
|
+
} else if (bucket === "slots") {
|
|
3687
|
+
const slots = (_e = spec.slots) != null ? _e : spec.slots = {};
|
|
3688
|
+
switch (operator) {
|
|
3689
|
+
case "only":
|
|
3690
|
+
slots.only = parseCsv(value);
|
|
3691
|
+
break;
|
|
3692
|
+
case "except":
|
|
3693
|
+
slots.except = parseCsv(value);
|
|
3694
|
+
break;
|
|
3695
|
+
case "depth":
|
|
3696
|
+
slots.depth = parseDepth(value, rawKey);
|
|
3697
|
+
break;
|
|
3698
|
+
default:
|
|
3699
|
+
throw new Error(`Invalid select projection: unsupported operator 'slots[${operator}]'`);
|
|
3700
|
+
}
|
|
3701
|
+
} else {
|
|
3702
|
+
throw new Error(`Invalid select projection key: ${JSON.stringify(rawKey)}`);
|
|
3703
|
+
}
|
|
3704
|
+
}
|
|
3705
|
+
return spec;
|
|
3706
|
+
}
|
|
3707
|
+
|
|
3235
3708
|
// src/PromptClient.ts
|
|
3236
|
-
var
|
|
3709
|
+
var import_api21 = require("@uniformdev/context/api");
|
|
3237
3710
|
var PromptsUrl = "/api/v1/prompts";
|
|
3238
|
-
var PromptClient = class extends
|
|
3711
|
+
var PromptClient = class extends import_api21.ApiClient {
|
|
3239
3712
|
constructor(options) {
|
|
3240
3713
|
super(options);
|
|
3241
3714
|
}
|
|
@@ -3266,34 +3739,42 @@ var PromptClient = class extends import_api12.ApiClient {
|
|
|
3266
3739
|
};
|
|
3267
3740
|
|
|
3268
3741
|
// src/RelationshipClient.ts
|
|
3269
|
-
var
|
|
3742
|
+
var import_api22 = require("@uniformdev/context/api");
|
|
3270
3743
|
var RELATIONSHIPS_URL = "/api/v1/relationships";
|
|
3271
|
-
var RelationshipClient = class extends
|
|
3744
|
+
var RelationshipClient = class extends import_api22.ApiClient {
|
|
3272
3745
|
constructor(options) {
|
|
3273
3746
|
super(options);
|
|
3274
|
-
this.
|
|
3747
|
+
this.list = async (options) => {
|
|
3275
3748
|
const { projectId } = this.options;
|
|
3276
3749
|
const url = this.createUrl(RELATIONSHIPS_URL, { ...options, projectId });
|
|
3277
3750
|
return this.apiClient(url);
|
|
3278
3751
|
};
|
|
3752
|
+
/** @deprecated Use {@link list} instead. */
|
|
3753
|
+
this.get = async (options) => {
|
|
3754
|
+
return this.list(options);
|
|
3755
|
+
};
|
|
3279
3756
|
}
|
|
3280
3757
|
};
|
|
3281
3758
|
|
|
3282
3759
|
// src/ReleaseClient.ts
|
|
3283
|
-
var
|
|
3760
|
+
var import_api23 = require("@uniformdev/context/api");
|
|
3284
3761
|
var releasesUrl = "/api/v1/releases";
|
|
3285
|
-
var ReleaseClient = class extends
|
|
3762
|
+
var ReleaseClient = class extends import_api23.ApiClient {
|
|
3286
3763
|
constructor(options) {
|
|
3287
3764
|
super(options);
|
|
3288
3765
|
}
|
|
3289
|
-
/** Fetches
|
|
3290
|
-
async
|
|
3766
|
+
/** Fetches a list of releases for a project */
|
|
3767
|
+
async list(options) {
|
|
3291
3768
|
const { projectId } = this.options;
|
|
3292
3769
|
const fetchUri = this.createUrl(releasesUrl, { ...options, projectId });
|
|
3293
3770
|
return await this.apiClient(fetchUri);
|
|
3294
3771
|
}
|
|
3772
|
+
/** @deprecated Use {@link list} instead. */
|
|
3773
|
+
async get(options) {
|
|
3774
|
+
return this.list(options);
|
|
3775
|
+
}
|
|
3295
3776
|
/** Updates or creates (based on id) a release */
|
|
3296
|
-
async
|
|
3777
|
+
async save(body) {
|
|
3297
3778
|
const fetchUri = this.createUrl(releasesUrl);
|
|
3298
3779
|
await this.apiClient(fetchUri, {
|
|
3299
3780
|
method: "PUT",
|
|
@@ -3301,6 +3782,10 @@ var ReleaseClient = class extends import_api14.ApiClient {
|
|
|
3301
3782
|
expectNoContent: true
|
|
3302
3783
|
});
|
|
3303
3784
|
}
|
|
3785
|
+
/** @deprecated Use {@link save} instead. */
|
|
3786
|
+
async upsert(body) {
|
|
3787
|
+
return this.save(body);
|
|
3788
|
+
}
|
|
3304
3789
|
/** Deletes a release */
|
|
3305
3790
|
async remove(body) {
|
|
3306
3791
|
const fetchUri = this.createUrl(releasesUrl);
|
|
@@ -3322,21 +3807,25 @@ var ReleaseClient = class extends import_api14.ApiClient {
|
|
|
3322
3807
|
};
|
|
3323
3808
|
|
|
3324
3809
|
// src/ReleaseContentsClient.ts
|
|
3325
|
-
var
|
|
3326
|
-
var
|
|
3327
|
-
var ReleaseContentsClient = class extends
|
|
3810
|
+
var import_api24 = require("@uniformdev/context/api");
|
|
3811
|
+
var releaseContentsUrl = "/api/v1/release-contents";
|
|
3812
|
+
var ReleaseContentsClient = class extends import_api24.ApiClient {
|
|
3328
3813
|
constructor(options) {
|
|
3329
3814
|
super(options);
|
|
3330
3815
|
}
|
|
3331
|
-
/** Fetches
|
|
3332
|
-
async
|
|
3816
|
+
/** Fetches a list of entities added to a release */
|
|
3817
|
+
async list(options) {
|
|
3333
3818
|
const { projectId } = this.options;
|
|
3334
|
-
const fetchUri = this.createUrl(
|
|
3819
|
+
const fetchUri = this.createUrl(releaseContentsUrl, { ...options, projectId });
|
|
3335
3820
|
return await this.apiClient(fetchUri);
|
|
3336
3821
|
}
|
|
3822
|
+
/** @deprecated Use {@link list} instead. */
|
|
3823
|
+
async get(options) {
|
|
3824
|
+
return this.list(options);
|
|
3825
|
+
}
|
|
3337
3826
|
/** Removes a release content from a release */
|
|
3338
3827
|
async remove(body) {
|
|
3339
|
-
const fetchUri = this.createUrl(
|
|
3828
|
+
const fetchUri = this.createUrl(releaseContentsUrl);
|
|
3340
3829
|
await this.apiClient(fetchUri, {
|
|
3341
3830
|
method: "DELETE",
|
|
3342
3831
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -3346,9 +3835,9 @@ var ReleaseContentsClient = class extends import_api15.ApiClient {
|
|
|
3346
3835
|
};
|
|
3347
3836
|
|
|
3348
3837
|
// src/RouteClient.ts
|
|
3349
|
-
var
|
|
3838
|
+
var import_api25 = require("@uniformdev/context/api");
|
|
3350
3839
|
var ROUTE_URL = "/api/v1/route";
|
|
3351
|
-
var RouteClient = class extends
|
|
3840
|
+
var RouteClient = class extends import_api25.ApiClient {
|
|
3352
3841
|
constructor(options) {
|
|
3353
3842
|
var _a;
|
|
3354
3843
|
if (!options.limitPolicy) {
|
|
@@ -3357,15 +3846,27 @@ var RouteClient = class extends import_api16.ApiClient {
|
|
|
3357
3846
|
super(options);
|
|
3358
3847
|
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
|
3359
3848
|
}
|
|
3360
|
-
/**
|
|
3361
|
-
|
|
3849
|
+
/**
|
|
3850
|
+
* Resolves a route to a composition, redirect, or not-found result.
|
|
3851
|
+
*
|
|
3852
|
+
* An optional `select` projection applies to the resolved composition when
|
|
3853
|
+
* the route matches one; redirect / notFound responses pass through
|
|
3854
|
+
* untouched.
|
|
3855
|
+
*/
|
|
3856
|
+
async get(options) {
|
|
3362
3857
|
const { projectId } = this.options;
|
|
3363
|
-
const
|
|
3858
|
+
const { select, ...rest } = options != null ? options : {};
|
|
3859
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
3860
|
+
const fetchUri = this.createUrl(ROUTE_URL, { ...rest, projectId, ...rewrittenSelect }, this.edgeApiHost);
|
|
3364
3861
|
return await this.apiClient(
|
|
3365
3862
|
fetchUri,
|
|
3366
3863
|
this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
|
|
3367
3864
|
);
|
|
3368
3865
|
}
|
|
3866
|
+
/** @deprecated use {@link RouteClient.get} instead (renamed). */
|
|
3867
|
+
async getRoute(options) {
|
|
3868
|
+
return this.get(options);
|
|
3869
|
+
}
|
|
3369
3870
|
};
|
|
3370
3871
|
|
|
3371
3872
|
// src/types/locales.ts
|
|
@@ -3473,6 +3974,7 @@ function convertEntryToPutEntry(entry) {
|
|
|
3473
3974
|
releaseId: entry.releaseId,
|
|
3474
3975
|
workflowId: entry.workflowId,
|
|
3475
3976
|
workflowStageId: entry.workflowStageId,
|
|
3977
|
+
instanceWorkflowId: entry.instanceWorkflowId,
|
|
3476
3978
|
editionId: entry.editionId,
|
|
3477
3979
|
editionName: entry.editionName,
|
|
3478
3980
|
editionPriority: entry.editionPriority
|
|
@@ -3523,8 +4025,13 @@ var getParameterAttributes = ({
|
|
|
3523
4025
|
};
|
|
3524
4026
|
|
|
3525
4027
|
// src/utils/isAllowedReferrer.ts
|
|
4028
|
+
var ALLOWED_REFERRER_ORIGIN = /^https:\/\/([\w-]+\.)*(uniform\.(app|wtf)|uniformcode\.ai)$|^https?:\/\/localhost:\d{4}$/;
|
|
3526
4029
|
var isAllowedReferrer = (referrer) => {
|
|
3527
|
-
|
|
4030
|
+
try {
|
|
4031
|
+
return ALLOWED_REFERRER_ORIGIN.test(new URL(referrer != null ? referrer : "").origin);
|
|
4032
|
+
} catch (e) {
|
|
4033
|
+
return false;
|
|
4034
|
+
}
|
|
3528
4035
|
};
|
|
3529
4036
|
|
|
3530
4037
|
// src/utils/isSystemComponentDefinition.ts
|
|
@@ -3608,6 +4115,9 @@ function bindVariables({
|
|
|
3608
4115
|
errorPrefix = "Variable",
|
|
3609
4116
|
handleBinding
|
|
3610
4117
|
}) {
|
|
4118
|
+
if (!value.includes(variablePrefix)) {
|
|
4119
|
+
return { result: value, boundCount: 0, errors: void 0 };
|
|
4120
|
+
}
|
|
3611
4121
|
let boundCount = 0;
|
|
3612
4122
|
let tokenCount = 0;
|
|
3613
4123
|
const errors = [];
|
|
@@ -3638,13 +4148,15 @@ function bindVariables({
|
|
|
3638
4148
|
}
|
|
3639
4149
|
|
|
3640
4150
|
// src/utils/variables/bindVariablesToObject.ts
|
|
3641
|
-
var import_immer = require("immer");
|
|
3642
4151
|
function bindVariablesToObject(options) {
|
|
3643
|
-
|
|
4152
|
+
const { value } = options;
|
|
4153
|
+
const bindableObjects = typeof value === "object" && value !== null ? findBindableObjects(value) : void 0;
|
|
4154
|
+
return bindVariablesToObjectRecursive({ ...options, bindableObjects });
|
|
3644
4155
|
}
|
|
3645
4156
|
function bindVariablesToObjectRecursive({
|
|
3646
4157
|
value,
|
|
3647
4158
|
recursivePath,
|
|
4159
|
+
bindableObjects,
|
|
3648
4160
|
...bindVariablesOptions
|
|
3649
4161
|
}) {
|
|
3650
4162
|
let boundCount = 0;
|
|
@@ -3659,50 +4171,93 @@ function bindVariablesToObjectRecursive({
|
|
|
3659
4171
|
if (richTextNodeResult !== void 0) {
|
|
3660
4172
|
return richTextNodeResult;
|
|
3661
4173
|
}
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
4174
|
+
if (bindableObjects && !bindableObjects.has(value)) {
|
|
4175
|
+
return { boundCount: 0, result: value };
|
|
4176
|
+
}
|
|
4177
|
+
let copy;
|
|
4178
|
+
const assign = (property, boundValue) => {
|
|
4179
|
+
copy != null ? copy : copy = Array.isArray(value) ? value.slice() : Object.assign(Object.create(Object.getPrototypeOf(value)), value);
|
|
4180
|
+
copy[property] = boundValue;
|
|
3665
4181
|
};
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
if (
|
|
3670
|
-
const bindResult = bindVariables({ ...bindVariablesOptions, value: oldValue });
|
|
3671
|
-
if (oldValue !== bindResult.result || bindResult.errors) {
|
|
3672
|
-
boundCount += bindResult.boundCount;
|
|
3673
|
-
draft[property] = bindResult.result;
|
|
3674
|
-
if (bindResult.errors) {
|
|
3675
|
-
errors.push(
|
|
3676
|
-
...bindResult.errors.map((e) => {
|
|
3677
|
-
if (typeof e === "string") {
|
|
3678
|
-
return `${currentObjectPath}: ${e}`;
|
|
3679
|
-
}
|
|
3680
|
-
e.message = `${currentObjectPath}: ${e.message}`;
|
|
3681
|
-
return e;
|
|
3682
|
-
})
|
|
3683
|
-
);
|
|
3684
|
-
}
|
|
3685
|
-
}
|
|
4182
|
+
Object.entries(value).forEach(([property, oldValue]) => {
|
|
4183
|
+
const currentObjectPath = recursivePath ? `${recursivePath}.${property}` : property;
|
|
4184
|
+
if (typeof oldValue === "string") {
|
|
4185
|
+
if (!oldValue.includes(variablePrefix)) {
|
|
3686
4186
|
return;
|
|
3687
4187
|
}
|
|
3688
|
-
const
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
4188
|
+
const bindResult = bindVariables({ ...bindVariablesOptions, value: oldValue });
|
|
4189
|
+
if (oldValue !== bindResult.result || bindResult.errors) {
|
|
4190
|
+
boundCount += bindResult.boundCount;
|
|
4191
|
+
assign(property, bindResult.result);
|
|
4192
|
+
if (bindResult.errors) {
|
|
4193
|
+
errors.push(
|
|
4194
|
+
...bindResult.errors.map((e) => {
|
|
4195
|
+
if (typeof e === "string") {
|
|
4196
|
+
return `${currentObjectPath}: ${e}`;
|
|
4197
|
+
}
|
|
4198
|
+
e.message = `${currentObjectPath}: ${e.message}`;
|
|
4199
|
+
return e;
|
|
4200
|
+
})
|
|
4201
|
+
);
|
|
3698
4202
|
}
|
|
3699
4203
|
}
|
|
4204
|
+
return;
|
|
4205
|
+
}
|
|
4206
|
+
const childBind = bindVariablesToObjectRecursive({
|
|
4207
|
+
...bindVariablesOptions,
|
|
4208
|
+
value: oldValue,
|
|
4209
|
+
recursivePath: currentObjectPath,
|
|
4210
|
+
bindableObjects
|
|
3700
4211
|
});
|
|
4212
|
+
if (childBind.boundCount || childBind.errors) {
|
|
4213
|
+
boundCount += childBind.boundCount;
|
|
4214
|
+
assign(property, childBind.result);
|
|
4215
|
+
if (childBind.errors) {
|
|
4216
|
+
errors.push(...childBind.errors);
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
3701
4219
|
});
|
|
4220
|
+
const result = copy != null ? copy : value;
|
|
3702
4221
|
return { boundCount, result, errors: errors.length > 0 ? errors : void 0 };
|
|
3703
4222
|
}
|
|
4223
|
+
function findBindableObjects(root) {
|
|
4224
|
+
const bindable = /* @__PURE__ */ new Set();
|
|
4225
|
+
const visit = (value) => {
|
|
4226
|
+
if (typeof value === "string") {
|
|
4227
|
+
return value.includes(variablePrefix);
|
|
4228
|
+
}
|
|
4229
|
+
if (typeof value !== "object" || value === null) {
|
|
4230
|
+
return false;
|
|
4231
|
+
}
|
|
4232
|
+
if (bindable.has(value)) {
|
|
4233
|
+
return true;
|
|
4234
|
+
}
|
|
4235
|
+
let found = isRichTextVariableNode(value);
|
|
4236
|
+
if (!found) {
|
|
4237
|
+
if (Array.isArray(value)) {
|
|
4238
|
+
for (let i = 0; i < value.length; i++) {
|
|
4239
|
+
found = visit(value[i]) || found;
|
|
4240
|
+
}
|
|
4241
|
+
} else {
|
|
4242
|
+
const keys = Object.keys(value);
|
|
4243
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4244
|
+
found = visit(value[keys[i]]) || found;
|
|
4245
|
+
}
|
|
4246
|
+
}
|
|
4247
|
+
}
|
|
4248
|
+
if (found) {
|
|
4249
|
+
bindable.add(value);
|
|
4250
|
+
}
|
|
4251
|
+
return found;
|
|
4252
|
+
};
|
|
4253
|
+
visit(root);
|
|
4254
|
+
return bindable;
|
|
4255
|
+
}
|
|
4256
|
+
function isRichTextVariableNode(object) {
|
|
4257
|
+
return "type" in object && object.type === "variable" && "reference" in object && typeof object.reference === "string" && "version" in object && object.version === 1;
|
|
4258
|
+
}
|
|
3704
4259
|
function handleRichTextNodeBinding(object, options) {
|
|
3705
|
-
if (
|
|
4260
|
+
if (isRichTextVariableNode(object)) {
|
|
3706
4261
|
const value = createVariableReference(object.reference);
|
|
3707
4262
|
const bindResult = bindVariables({ ...options, value });
|
|
3708
4263
|
const bindResultAsTextNode = {
|
|
@@ -3720,26 +4275,30 @@ function handleRichTextNodeBinding(object, options) {
|
|
|
3720
4275
|
}
|
|
3721
4276
|
|
|
3722
4277
|
// src/index.ts
|
|
3723
|
-
var
|
|
4278
|
+
var import_api27 = require("@uniformdev/context/api");
|
|
3724
4279
|
|
|
3725
4280
|
// src/.version.ts
|
|
3726
|
-
var version = "20.
|
|
4281
|
+
var version = "20.87.0";
|
|
3727
4282
|
|
|
3728
4283
|
// src/WorkflowClient.ts
|
|
3729
|
-
var
|
|
4284
|
+
var import_api26 = require("@uniformdev/context/api");
|
|
3730
4285
|
var workflowsUrl = "/api/v1/workflows";
|
|
3731
|
-
var WorkflowClient = class extends
|
|
4286
|
+
var WorkflowClient = class extends import_api26.ApiClient {
|
|
3732
4287
|
constructor(options) {
|
|
3733
4288
|
super(options);
|
|
3734
4289
|
}
|
|
3735
|
-
/** Fetches workflows for a project */
|
|
3736
|
-
async
|
|
4290
|
+
/** Fetches a list of workflows for a project */
|
|
4291
|
+
async list(options) {
|
|
3737
4292
|
const { projectId } = this.options;
|
|
3738
4293
|
const fetchUri = this.createUrl(workflowsUrl, { ...options, projectId });
|
|
3739
4294
|
return await this.apiClient(fetchUri);
|
|
3740
4295
|
}
|
|
4296
|
+
/** @deprecated Use {@link list} instead. */
|
|
4297
|
+
async get(options) {
|
|
4298
|
+
return this.list(options);
|
|
4299
|
+
}
|
|
3741
4300
|
/** Updates or creates a workflow definition */
|
|
3742
|
-
async
|
|
4301
|
+
async save(body) {
|
|
3743
4302
|
const fetchUri = this.createUrl(workflowsUrl);
|
|
3744
4303
|
await this.apiClient(fetchUri, {
|
|
3745
4304
|
method: "PUT",
|
|
@@ -3747,6 +4306,10 @@ var WorkflowClient = class extends import_api17.ApiClient {
|
|
|
3747
4306
|
expectNoContent: true
|
|
3748
4307
|
});
|
|
3749
4308
|
}
|
|
4309
|
+
/** @deprecated Use {@link save} instead. */
|
|
4310
|
+
async upsert(body) {
|
|
4311
|
+
return this.save(body);
|
|
4312
|
+
}
|
|
3750
4313
|
/** Deletes a workflow definition */
|
|
3751
4314
|
async remove(body) {
|
|
3752
4315
|
const fetchUri = this.createUrl(workflowsUrl);
|
|
@@ -3759,7 +4322,7 @@ var WorkflowClient = class extends import_api17.ApiClient {
|
|
|
3759
4322
|
};
|
|
3760
4323
|
|
|
3761
4324
|
// src/index.ts
|
|
3762
|
-
var CanvasClientError =
|
|
4325
|
+
var CanvasClientError = import_api27.ApiClientError;
|
|
3763
4326
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3764
4327
|
0 && (module.exports = {
|
|
3765
4328
|
ASSETS_SOURCE_CUSTOM_URL,
|
|
@@ -3813,7 +4376,11 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3813
4376
|
CanvasClientError,
|
|
3814
4377
|
CategoryClient,
|
|
3815
4378
|
ChildEnhancerBuilder,
|
|
4379
|
+
ComponentDefinitionClient,
|
|
4380
|
+
CompositionDeliveryClient,
|
|
4381
|
+
CompositionManagementClient,
|
|
3816
4382
|
ContentClient,
|
|
4383
|
+
ContentTypeClient,
|
|
3817
4384
|
DataSourceClient,
|
|
3818
4385
|
DataTypeClient,
|
|
3819
4386
|
EDGE_CACHE_DISABLED,
|
|
@@ -3823,6 +4390,8 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3823
4390
|
EMPTY_COMPOSITION,
|
|
3824
4391
|
EnhancerBuilder,
|
|
3825
4392
|
EntityReleasesClient,
|
|
4393
|
+
EntryDeliveryClient,
|
|
4394
|
+
EntryManagementClient,
|
|
3826
4395
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
|
3827
4396
|
IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
|
|
3828
4397
|
IN_CONTEXT_EDITOR_CONFIG_CHECK_QUERY_STRING_PARAM,
|
|
@@ -3833,19 +4402,23 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3833
4402
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
|
3834
4403
|
IntegrationPropertyEditorsClient,
|
|
3835
4404
|
LOCALE_DYNAMIC_INPUT_NAME,
|
|
4405
|
+
LabelClient,
|
|
3836
4406
|
LocaleClient,
|
|
3837
4407
|
PLACEHOLDER_ID,
|
|
3838
4408
|
PreviewClient,
|
|
3839
4409
|
ProjectClient,
|
|
3840
4410
|
PromptClient,
|
|
4411
|
+
REFERENCE_DATA_TYPE_ID,
|
|
3841
4412
|
RelationshipClient,
|
|
3842
4413
|
ReleaseClient,
|
|
3843
4414
|
ReleaseContentsClient,
|
|
3844
4415
|
RouteClient,
|
|
3845
4416
|
SECRET_QUERY_STRING_PARAM,
|
|
4417
|
+
SELECT_QUERY_PREFIX,
|
|
3846
4418
|
UncachedCanvasClient,
|
|
3847
4419
|
UncachedCategoryClient,
|
|
3848
4420
|
UncachedContentClient,
|
|
4421
|
+
UncachedLabelClient,
|
|
3849
4422
|
UniqueBatchEntries,
|
|
3850
4423
|
WorkflowClient,
|
|
3851
4424
|
autoFixParameterGroups,
|
|
@@ -3892,6 +4465,7 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3892
4465
|
isAllowedReferrer,
|
|
3893
4466
|
isAssetParamValue,
|
|
3894
4467
|
isAssetParamValueItem,
|
|
4468
|
+
isAwaitingReadyMessage,
|
|
3895
4469
|
isComponentActionMessage,
|
|
3896
4470
|
isComponentPlaceholderId,
|
|
3897
4471
|
isContextStorageUpdatedMessage,
|
|
@@ -3907,6 +4481,7 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3907
4481
|
isRootEntryReference,
|
|
3908
4482
|
isSelectComponentMessage,
|
|
3909
4483
|
isSelectParameterMessage,
|
|
4484
|
+
isSessionPendingMessage,
|
|
3910
4485
|
isSuggestComponentMessage,
|
|
3911
4486
|
isSystemComponentDefinition,
|
|
3912
4487
|
isTriggerCompositionActionMessage,
|
|
@@ -3921,10 +4496,13 @@ var CanvasClientError = import_api18.ApiClientError;
|
|
|
3921
4496
|
localize,
|
|
3922
4497
|
mapSlotToPersonalizedVariations,
|
|
3923
4498
|
mapSlotToTestVariations,
|
|
4499
|
+
matchesProjectionPattern,
|
|
3924
4500
|
mergeAssetConfigWithDefaults,
|
|
3925
4501
|
nullLimitPolicy,
|
|
3926
4502
|
parseComponentPlaceholderId,
|
|
3927
4503
|
parseVariableExpression,
|
|
4504
|
+
projectionToQuery,
|
|
4505
|
+
queryToProjection,
|
|
3928
4506
|
version,
|
|
3929
4507
|
walkNodeTree,
|
|
3930
4508
|
walkPropertyValues
|