@uniformdev/canvas 19.154.1-alpha.22 → 19.154.1-alpha.26
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 +5169 -5288
- package/dist/index.d.ts +5169 -5288
- package/dist/index.esm.js +15 -55
- package/dist/index.js +15 -55
- package/dist/index.mjs +15 -55
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
@@ -466,6 +466,19 @@ function createLimitPolicy({
|
|
466
466
|
}
|
467
467
|
var nullLimitPolicy = async (func) => await func();
|
468
468
|
|
469
|
+
// src/utils/rewriteFilters.ts
|
470
|
+
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
471
|
+
function rewriteFilters(filters) {
|
472
|
+
return Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
|
473
|
+
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
474
|
+
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
475
|
+
return {
|
476
|
+
...acc,
|
477
|
+
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
478
|
+
};
|
479
|
+
}, {});
|
480
|
+
}
|
481
|
+
|
469
482
|
// src/CanvasClient.ts
|
470
483
|
var CANVAS_URL = "/api/v1/canvas";
|
471
484
|
var CanvasClient = class extends ApiClient {
|
@@ -482,12 +495,7 @@ var CanvasClient = class extends ApiClient {
|
|
482
495
|
async getCompositionList(params = {}) {
|
483
496
|
const { projectId } = this.options;
|
484
497
|
const { resolveData, filters, ...originParams } = params;
|
485
|
-
const rewrittenFilters =
|
486
|
-
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
487
|
-
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
488
|
-
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
489
|
-
return { ...acc, [lhs]: rhs };
|
490
|
-
}, {});
|
498
|
+
const rewrittenFilters = rewriteFilters(filters);
|
491
499
|
if (!resolveData) {
|
492
500
|
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
493
501
|
return this.apiClient(fetchUri);
|
@@ -651,12 +659,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
651
659
|
getEntries(options) {
|
652
660
|
const { projectId } = this.options;
|
653
661
|
const { skipDataResolution, filters, ...params } = options;
|
654
|
-
const rewrittenFilters =
|
655
|
-
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
656
|
-
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
657
|
-
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
658
|
-
return { ...acc, [lhs]: rhs };
|
659
|
-
}, {});
|
662
|
+
const rewrittenFilters = rewriteFilters(filters);
|
660
663
|
if (skipDataResolution) {
|
661
664
|
const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
662
665
|
return this.apiClient(url);
|
@@ -2302,49 +2305,6 @@ var RelationshipClient = class extends ApiClient8 {
|
|
2302
2305
|
const url = this.createUrl(RELATIONSHIPS_URL, { ...options, projectId });
|
2303
2306
|
return this.apiClient(url);
|
2304
2307
|
};
|
2305
|
-
this.clearProjectRelationships = async () => {
|
2306
|
-
const { projectId } = this.options;
|
2307
|
-
const url = this.createUrl(RELATIONSHIPS_URL);
|
2308
|
-
return this.apiClient(url, {
|
2309
|
-
method: "POST",
|
2310
|
-
body: JSON.stringify({
|
2311
|
-
action: "clear",
|
2312
|
-
projectId
|
2313
|
-
})
|
2314
|
-
});
|
2315
|
-
};
|
2316
|
-
this.indexRelationships = async ({ state, id, type }) => {
|
2317
|
-
const { projectId } = this.options;
|
2318
|
-
const url = this.createUrl(RELATIONSHIPS_URL);
|
2319
|
-
return this.apiClient(url, {
|
2320
|
-
method: "POST",
|
2321
|
-
body: JSON.stringify({
|
2322
|
-
action: "index",
|
2323
|
-
type,
|
2324
|
-
projectId,
|
2325
|
-
state,
|
2326
|
-
id
|
2327
|
-
})
|
2328
|
-
});
|
2329
|
-
};
|
2330
|
-
this.getVersion = async () => {
|
2331
|
-
const { projectId } = this.options;
|
2332
|
-
const url = this.createUrl("/api/v1/usage-tracking", {
|
2333
|
-
projectId
|
2334
|
-
});
|
2335
|
-
return this.apiClient(url).then((response) => response.version);
|
2336
|
-
};
|
2337
|
-
this.setVersion = async (version) => {
|
2338
|
-
const { projectId } = this.options;
|
2339
|
-
const url = this.createUrl("/api/v1/usage-tracking");
|
2340
|
-
return this.apiClient(url, {
|
2341
|
-
method: "POST",
|
2342
|
-
body: JSON.stringify({
|
2343
|
-
projectId,
|
2344
|
-
version
|
2345
|
-
})
|
2346
|
-
});
|
2347
|
-
};
|
2348
2308
|
}
|
2349
2309
|
};
|
2350
2310
|
|
package/dist/index.js
CHANGED
@@ -603,6 +603,19 @@ function createLimitPolicy({
|
|
603
603
|
}
|
604
604
|
var nullLimitPolicy = async (func) => await func();
|
605
605
|
|
606
|
+
// src/utils/rewriteFilters.ts
|
607
|
+
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
608
|
+
function rewriteFilters(filters) {
|
609
|
+
return Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
|
610
|
+
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
611
|
+
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
612
|
+
return {
|
613
|
+
...acc,
|
614
|
+
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
615
|
+
};
|
616
|
+
}, {});
|
617
|
+
}
|
618
|
+
|
606
619
|
// src/CanvasClient.ts
|
607
620
|
var CANVAS_URL = "/api/v1/canvas";
|
608
621
|
var CanvasClient = class extends import_api2.ApiClient {
|
@@ -619,12 +632,7 @@ var CanvasClient = class extends import_api2.ApiClient {
|
|
619
632
|
async getCompositionList(params = {}) {
|
620
633
|
const { projectId } = this.options;
|
621
634
|
const { resolveData, filters, ...originParams } = params;
|
622
|
-
const rewrittenFilters =
|
623
|
-
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
624
|
-
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
625
|
-
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
626
|
-
return { ...acc, [lhs]: rhs };
|
627
|
-
}, {});
|
635
|
+
const rewrittenFilters = rewriteFilters(filters);
|
628
636
|
if (!resolveData) {
|
629
637
|
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
630
638
|
return this.apiClient(fetchUri);
|
@@ -788,12 +796,7 @@ var _ContentClient = class _ContentClient extends import_api4.ApiClient {
|
|
788
796
|
getEntries(options) {
|
789
797
|
const { projectId } = this.options;
|
790
798
|
const { skipDataResolution, filters, ...params } = options;
|
791
|
-
const rewrittenFilters =
|
792
|
-
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
793
|
-
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
794
|
-
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
795
|
-
return { ...acc, [lhs]: rhs };
|
796
|
-
}, {});
|
799
|
+
const rewrittenFilters = rewriteFilters(filters);
|
797
800
|
if (skipDataResolution) {
|
798
801
|
const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
799
802
|
return this.apiClient(url);
|
@@ -2439,49 +2442,6 @@ var RelationshipClient = class extends import_api9.ApiClient {
|
|
2439
2442
|
const url = this.createUrl(RELATIONSHIPS_URL, { ...options, projectId });
|
2440
2443
|
return this.apiClient(url);
|
2441
2444
|
};
|
2442
|
-
this.clearProjectRelationships = async () => {
|
2443
|
-
const { projectId } = this.options;
|
2444
|
-
const url = this.createUrl(RELATIONSHIPS_URL);
|
2445
|
-
return this.apiClient(url, {
|
2446
|
-
method: "POST",
|
2447
|
-
body: JSON.stringify({
|
2448
|
-
action: "clear",
|
2449
|
-
projectId
|
2450
|
-
})
|
2451
|
-
});
|
2452
|
-
};
|
2453
|
-
this.indexRelationships = async ({ state, id, type }) => {
|
2454
|
-
const { projectId } = this.options;
|
2455
|
-
const url = this.createUrl(RELATIONSHIPS_URL);
|
2456
|
-
return this.apiClient(url, {
|
2457
|
-
method: "POST",
|
2458
|
-
body: JSON.stringify({
|
2459
|
-
action: "index",
|
2460
|
-
type,
|
2461
|
-
projectId,
|
2462
|
-
state,
|
2463
|
-
id
|
2464
|
-
})
|
2465
|
-
});
|
2466
|
-
};
|
2467
|
-
this.getVersion = async () => {
|
2468
|
-
const { projectId } = this.options;
|
2469
|
-
const url = this.createUrl("/api/v1/usage-tracking", {
|
2470
|
-
projectId
|
2471
|
-
});
|
2472
|
-
return this.apiClient(url).then((response) => response.version);
|
2473
|
-
};
|
2474
|
-
this.setVersion = async (version) => {
|
2475
|
-
const { projectId } = this.options;
|
2476
|
-
const url = this.createUrl("/api/v1/usage-tracking");
|
2477
|
-
return this.apiClient(url, {
|
2478
|
-
method: "POST",
|
2479
|
-
body: JSON.stringify({
|
2480
|
-
projectId,
|
2481
|
-
version
|
2482
|
-
})
|
2483
|
-
});
|
2484
|
-
};
|
2485
2445
|
}
|
2486
2446
|
};
|
2487
2447
|
|
package/dist/index.mjs
CHANGED
@@ -466,6 +466,19 @@ function createLimitPolicy({
|
|
466
466
|
}
|
467
467
|
var nullLimitPolicy = async (func) => await func();
|
468
468
|
|
469
|
+
// src/utils/rewriteFilters.ts
|
470
|
+
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
471
|
+
function rewriteFilters(filters) {
|
472
|
+
return Object.entries(filters != null ? filters : {}).reduce((acc, [key, value]) => {
|
473
|
+
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
474
|
+
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
475
|
+
return {
|
476
|
+
...acc,
|
477
|
+
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
478
|
+
};
|
479
|
+
}, {});
|
480
|
+
}
|
481
|
+
|
469
482
|
// src/CanvasClient.ts
|
470
483
|
var CANVAS_URL = "/api/v1/canvas";
|
471
484
|
var CanvasClient = class extends ApiClient {
|
@@ -482,12 +495,7 @@ var CanvasClient = class extends ApiClient {
|
|
482
495
|
async getCompositionList(params = {}) {
|
483
496
|
const { projectId } = this.options;
|
484
497
|
const { resolveData, filters, ...originParams } = params;
|
485
|
-
const rewrittenFilters =
|
486
|
-
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
487
|
-
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
488
|
-
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
489
|
-
return { ...acc, [lhs]: rhs };
|
490
|
-
}, {});
|
498
|
+
const rewrittenFilters = rewriteFilters(filters);
|
491
499
|
if (!resolveData) {
|
492
500
|
const fetchUri = this.createUrl(CANVAS_URL, { ...originParams, projectId, ...rewrittenFilters });
|
493
501
|
return this.apiClient(fetchUri);
|
@@ -651,12 +659,7 @@ var _ContentClient = class _ContentClient extends ApiClient3 {
|
|
651
659
|
getEntries(options) {
|
652
660
|
const { projectId } = this.options;
|
653
661
|
const { skipDataResolution, filters, ...params } = options;
|
654
|
-
const rewrittenFilters =
|
655
|
-
const lhs = `filters.${key}` + (typeof value === "object" ? `[${Object.keys(value)[0]}]` : "");
|
656
|
-
let rhs = typeof value === "object" ? Object.values(value)[0] : value;
|
657
|
-
rhs = Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim();
|
658
|
-
return { ...acc, [lhs]: rhs };
|
659
|
-
}, {});
|
662
|
+
const rewrittenFilters = rewriteFilters(filters);
|
660
663
|
if (skipDataResolution) {
|
661
664
|
const url = this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
662
665
|
return this.apiClient(url);
|
@@ -2302,49 +2305,6 @@ var RelationshipClient = class extends ApiClient8 {
|
|
2302
2305
|
const url = this.createUrl(RELATIONSHIPS_URL, { ...options, projectId });
|
2303
2306
|
return this.apiClient(url);
|
2304
2307
|
};
|
2305
|
-
this.clearProjectRelationships = async () => {
|
2306
|
-
const { projectId } = this.options;
|
2307
|
-
const url = this.createUrl(RELATIONSHIPS_URL);
|
2308
|
-
return this.apiClient(url, {
|
2309
|
-
method: "POST",
|
2310
|
-
body: JSON.stringify({
|
2311
|
-
action: "clear",
|
2312
|
-
projectId
|
2313
|
-
})
|
2314
|
-
});
|
2315
|
-
};
|
2316
|
-
this.indexRelationships = async ({ state, id, type }) => {
|
2317
|
-
const { projectId } = this.options;
|
2318
|
-
const url = this.createUrl(RELATIONSHIPS_URL);
|
2319
|
-
return this.apiClient(url, {
|
2320
|
-
method: "POST",
|
2321
|
-
body: JSON.stringify({
|
2322
|
-
action: "index",
|
2323
|
-
type,
|
2324
|
-
projectId,
|
2325
|
-
state,
|
2326
|
-
id
|
2327
|
-
})
|
2328
|
-
});
|
2329
|
-
};
|
2330
|
-
this.getVersion = async () => {
|
2331
|
-
const { projectId } = this.options;
|
2332
|
-
const url = this.createUrl("/api/v1/usage-tracking", {
|
2333
|
-
projectId
|
2334
|
-
});
|
2335
|
-
return this.apiClient(url).then((response) => response.version);
|
2336
|
-
};
|
2337
|
-
this.setVersion = async (version) => {
|
2338
|
-
const { projectId } = this.options;
|
2339
|
-
const url = this.createUrl("/api/v1/usage-tracking");
|
2340
|
-
return this.apiClient(url, {
|
2341
|
-
method: "POST",
|
2342
|
-
body: JSON.stringify({
|
2343
|
-
projectId,
|
2344
|
-
version
|
2345
|
-
})
|
2346
|
-
});
|
2347
|
-
};
|
2348
2308
|
}
|
2349
2309
|
};
|
2350
2310
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.154.1-alpha.
|
3
|
+
"version": "19.154.1-alpha.26+791f903a70",
|
4
4
|
"description": "Common functionality and types for Uniform Canvas",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -38,8 +38,8 @@
|
|
38
38
|
"pusher-js": "8.2.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/assets": "19.154.1-alpha.
|
42
|
-
"@uniformdev/context": "19.154.1-alpha.
|
41
|
+
"@uniformdev/assets": "19.154.1-alpha.26+791f903a70",
|
42
|
+
"@uniformdev/context": "19.154.1-alpha.26+791f903a70",
|
43
43
|
"immer": "10.0.4"
|
44
44
|
},
|
45
45
|
"files": [
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"publishConfig": {
|
49
49
|
"access": "public"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "791f903a7000c4e5402004190fad51d8cb2b13d5"
|
52
52
|
}
|