@uniformdev/canvas 19.62.0 → 19.63.0
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 +1871 -413
- package/dist/index.d.ts +1871 -413
- package/dist/index.esm.js +45 -10
- package/dist/index.js +49 -16
- package/dist/index.mjs +45 -10
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
@@ -977,13 +977,10 @@ var EMPTY_COMPOSITION = {
|
|
977
977
|
_name: "An empty composition used for contextual editing",
|
978
978
|
type: "_empty_composition_type"
|
979
979
|
};
|
980
|
-
var EDGE_MIN_CACHE_TTL =
|
981
|
-
var EDGE_MAX_CACHE_TTL =
|
980
|
+
var EDGE_MIN_CACHE_TTL = 10;
|
981
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
982
982
|
var EDGE_DEFAULT_CACHE_TTL = 30;
|
983
983
|
var EDGE_CACHE_DISABLED = -1;
|
984
|
-
var EDGE_MIN_L2_CACHE_TTL_IN_HOURS = 1;
|
985
|
-
var EDGE_MAX_L2_CACHE_TTL_IN_HOURS = 4 * 7 * 24;
|
986
|
-
var EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS = 24;
|
987
984
|
|
988
985
|
// src/utils/entryConverter.ts
|
989
986
|
function convertEntryToPutEntry(entry) {
|
@@ -2079,10 +2076,50 @@ function subscribeToComposition({
|
|
2079
2076
|
};
|
2080
2077
|
}
|
2081
2078
|
|
2082
|
-
// src/
|
2079
|
+
// src/PromptClient.ts
|
2083
2080
|
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
2081
|
+
var PromptUrl = "/api/v1/prompt";
|
2082
|
+
var PromptsUrl = "/api/v1/prompts";
|
2083
|
+
var PromptClient = class extends ApiClient7 {
|
2084
|
+
constructor(options) {
|
2085
|
+
super(options);
|
2086
|
+
}
|
2087
|
+
/** Fetches all Prompts for a project */
|
2088
|
+
async get(options) {
|
2089
|
+
const { projectId } = this.options;
|
2090
|
+
const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
|
2091
|
+
return await this.apiClient(fetchUri);
|
2092
|
+
}
|
2093
|
+
/** Fetches all Prompts for a project */
|
2094
|
+
async getList(options) {
|
2095
|
+
const { projectId } = this.options;
|
2096
|
+
const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
|
2097
|
+
return await this.apiClient(fetchUri);
|
2098
|
+
}
|
2099
|
+
/** Updates or creates (based on id) a Prompt */
|
2100
|
+
async upsert(body) {
|
2101
|
+
const fetchUri = this.createUrl(PromptUrl);
|
2102
|
+
await this.apiClient(fetchUri, {
|
2103
|
+
method: "PUT",
|
2104
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2105
|
+
expectNoContent: true
|
2106
|
+
});
|
2107
|
+
}
|
2108
|
+
/** Deletes a Prompt */
|
2109
|
+
async remove(body) {
|
2110
|
+
const fetchUri = this.createUrl(PromptUrl);
|
2111
|
+
await this.apiClient(fetchUri, {
|
2112
|
+
method: "DELETE",
|
2113
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2114
|
+
expectNoContent: true
|
2115
|
+
});
|
2116
|
+
}
|
2117
|
+
};
|
2118
|
+
|
2119
|
+
// src/RouteClient.ts
|
2120
|
+
import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
|
2084
2121
|
var ROUTE_URL = "/api/v1/route";
|
2085
|
-
var RouteClient = class extends
|
2122
|
+
var RouteClient = class extends ApiClient8 {
|
2086
2123
|
constructor(options) {
|
2087
2124
|
var _a;
|
2088
2125
|
if (!options.limitPolicy) {
|
@@ -2425,11 +2462,8 @@ export {
|
|
2425
2462
|
DataTypeClient,
|
2426
2463
|
EDGE_CACHE_DISABLED,
|
2427
2464
|
EDGE_DEFAULT_CACHE_TTL,
|
2428
|
-
EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS,
|
2429
2465
|
EDGE_MAX_CACHE_TTL,
|
2430
|
-
EDGE_MAX_L2_CACHE_TTL_IN_HOURS,
|
2431
2466
|
EDGE_MIN_CACHE_TTL,
|
2432
|
-
EDGE_MIN_L2_CACHE_TTL_IN_HOURS,
|
2433
2467
|
EMPTY_COMPOSITION,
|
2434
2468
|
EnhancerBuilder,
|
2435
2469
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
@@ -2440,6 +2474,7 @@ export {
|
|
2440
2474
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
2441
2475
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
2442
2476
|
PLACEHOLDER_ID,
|
2477
|
+
PromptClient,
|
2443
2478
|
RouteClient,
|
2444
2479
|
SECRET_QUERY_STRING_PARAM,
|
2445
2480
|
UncachedCanvasClient,
|
package/dist/index.js
CHANGED
@@ -283,7 +283,7 @@ __export(src_exports, {
|
|
283
283
|
ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
|
284
284
|
ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
|
285
285
|
ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
|
286
|
-
ApiClientError: () =>
|
286
|
+
ApiClientError: () => import_api10.ApiClientError,
|
287
287
|
BatchEntry: () => BatchEntry,
|
288
288
|
CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
|
289
289
|
CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
|
@@ -309,11 +309,8 @@ __export(src_exports, {
|
|
309
309
|
DataTypeClient: () => DataTypeClient,
|
310
310
|
EDGE_CACHE_DISABLED: () => EDGE_CACHE_DISABLED,
|
311
311
|
EDGE_DEFAULT_CACHE_TTL: () => EDGE_DEFAULT_CACHE_TTL,
|
312
|
-
EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS: () => EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS,
|
313
312
|
EDGE_MAX_CACHE_TTL: () => EDGE_MAX_CACHE_TTL,
|
314
|
-
EDGE_MAX_L2_CACHE_TTL_IN_HOURS: () => EDGE_MAX_L2_CACHE_TTL_IN_HOURS,
|
315
313
|
EDGE_MIN_CACHE_TTL: () => EDGE_MIN_CACHE_TTL,
|
316
|
-
EDGE_MIN_L2_CACHE_TTL_IN_HOURS: () => EDGE_MIN_L2_CACHE_TTL_IN_HOURS,
|
317
314
|
EMPTY_COMPOSITION: () => EMPTY_COMPOSITION,
|
318
315
|
EnhancerBuilder: () => EnhancerBuilder,
|
319
316
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE: () => IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
@@ -324,6 +321,7 @@ __export(src_exports, {
|
|
324
321
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM: () => IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
325
322
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE: () => IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
326
323
|
PLACEHOLDER_ID: () => PLACEHOLDER_ID,
|
324
|
+
PromptClient: () => PromptClient,
|
327
325
|
RouteClient: () => RouteClient,
|
328
326
|
SECRET_QUERY_STRING_PARAM: () => SECRET_QUERY_STRING_PARAM,
|
329
327
|
UncachedCanvasClient: () => UncachedCanvasClient,
|
@@ -1091,13 +1089,10 @@ var EMPTY_COMPOSITION = {
|
|
1091
1089
|
_name: "An empty composition used for contextual editing",
|
1092
1090
|
type: "_empty_composition_type"
|
1093
1091
|
};
|
1094
|
-
var EDGE_MIN_CACHE_TTL =
|
1095
|
-
var EDGE_MAX_CACHE_TTL =
|
1092
|
+
var EDGE_MIN_CACHE_TTL = 10;
|
1093
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
1096
1094
|
var EDGE_DEFAULT_CACHE_TTL = 30;
|
1097
1095
|
var EDGE_CACHE_DISABLED = -1;
|
1098
|
-
var EDGE_MIN_L2_CACHE_TTL_IN_HOURS = 1;
|
1099
|
-
var EDGE_MAX_L2_CACHE_TTL_IN_HOURS = 4 * 7 * 24;
|
1100
|
-
var EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS = 24;
|
1101
1096
|
|
1102
1097
|
// src/utils/entryConverter.ts
|
1103
1098
|
function convertEntryToPutEntry(entry) {
|
@@ -2193,10 +2188,50 @@ function subscribeToComposition({
|
|
2193
2188
|
};
|
2194
2189
|
}
|
2195
2190
|
|
2196
|
-
// src/
|
2191
|
+
// src/PromptClient.ts
|
2197
2192
|
var import_api8 = require("@uniformdev/context/api");
|
2193
|
+
var PromptUrl = "/api/v1/prompt";
|
2194
|
+
var PromptsUrl = "/api/v1/prompts";
|
2195
|
+
var PromptClient = class extends import_api8.ApiClient {
|
2196
|
+
constructor(options) {
|
2197
|
+
super(options);
|
2198
|
+
}
|
2199
|
+
/** Fetches all Prompts for a project */
|
2200
|
+
async get(options) {
|
2201
|
+
const { projectId } = this.options;
|
2202
|
+
const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
|
2203
|
+
return await this.apiClient(fetchUri);
|
2204
|
+
}
|
2205
|
+
/** Fetches all Prompts for a project */
|
2206
|
+
async getList(options) {
|
2207
|
+
const { projectId } = this.options;
|
2208
|
+
const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
|
2209
|
+
return await this.apiClient(fetchUri);
|
2210
|
+
}
|
2211
|
+
/** Updates or creates (based on id) a Prompt */
|
2212
|
+
async upsert(body) {
|
2213
|
+
const fetchUri = this.createUrl(PromptUrl);
|
2214
|
+
await this.apiClient(fetchUri, {
|
2215
|
+
method: "PUT",
|
2216
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2217
|
+
expectNoContent: true
|
2218
|
+
});
|
2219
|
+
}
|
2220
|
+
/** Deletes a Prompt */
|
2221
|
+
async remove(body) {
|
2222
|
+
const fetchUri = this.createUrl(PromptUrl);
|
2223
|
+
await this.apiClient(fetchUri, {
|
2224
|
+
method: "DELETE",
|
2225
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2226
|
+
expectNoContent: true
|
2227
|
+
});
|
2228
|
+
}
|
2229
|
+
};
|
2230
|
+
|
2231
|
+
// src/RouteClient.ts
|
2232
|
+
var import_api9 = require("@uniformdev/context/api");
|
2198
2233
|
var ROUTE_URL = "/api/v1/route";
|
2199
|
-
var RouteClient = class extends
|
2234
|
+
var RouteClient = class extends import_api9.ApiClient {
|
2200
2235
|
constructor(options) {
|
2201
2236
|
var _a;
|
2202
2237
|
if (!options.limitPolicy) {
|
@@ -2504,8 +2539,8 @@ function handleRichTextNodeBinding(object, options) {
|
|
2504
2539
|
}
|
2505
2540
|
|
2506
2541
|
// src/index.ts
|
2507
|
-
var
|
2508
|
-
var CanvasClientError =
|
2542
|
+
var import_api10 = require("@uniformdev/context/api");
|
2543
|
+
var CanvasClientError = import_api10.ApiClientError;
|
2509
2544
|
// Annotate the CommonJS export names for ESM import in node:
|
2510
2545
|
0 && (module.exports = {
|
2511
2546
|
ATTRIBUTE_COMPONENT_ID,
|
@@ -2540,11 +2575,8 @@ var CanvasClientError = import_api9.ApiClientError;
|
|
2540
2575
|
DataTypeClient,
|
2541
2576
|
EDGE_CACHE_DISABLED,
|
2542
2577
|
EDGE_DEFAULT_CACHE_TTL,
|
2543
|
-
EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS,
|
2544
2578
|
EDGE_MAX_CACHE_TTL,
|
2545
|
-
EDGE_MAX_L2_CACHE_TTL_IN_HOURS,
|
2546
2579
|
EDGE_MIN_CACHE_TTL,
|
2547
|
-
EDGE_MIN_L2_CACHE_TTL_IN_HOURS,
|
2548
2580
|
EMPTY_COMPOSITION,
|
2549
2581
|
EnhancerBuilder,
|
2550
2582
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
@@ -2555,6 +2587,7 @@ var CanvasClientError = import_api9.ApiClientError;
|
|
2555
2587
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
2556
2588
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
2557
2589
|
PLACEHOLDER_ID,
|
2590
|
+
PromptClient,
|
2558
2591
|
RouteClient,
|
2559
2592
|
SECRET_QUERY_STRING_PARAM,
|
2560
2593
|
UncachedCanvasClient,
|
package/dist/index.mjs
CHANGED
@@ -977,13 +977,10 @@ var EMPTY_COMPOSITION = {
|
|
977
977
|
_name: "An empty composition used for contextual editing",
|
978
978
|
type: "_empty_composition_type"
|
979
979
|
};
|
980
|
-
var EDGE_MIN_CACHE_TTL =
|
981
|
-
var EDGE_MAX_CACHE_TTL =
|
980
|
+
var EDGE_MIN_CACHE_TTL = 10;
|
981
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
982
982
|
var EDGE_DEFAULT_CACHE_TTL = 30;
|
983
983
|
var EDGE_CACHE_DISABLED = -1;
|
984
|
-
var EDGE_MIN_L2_CACHE_TTL_IN_HOURS = 1;
|
985
|
-
var EDGE_MAX_L2_CACHE_TTL_IN_HOURS = 4 * 7 * 24;
|
986
|
-
var EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS = 24;
|
987
984
|
|
988
985
|
// src/utils/entryConverter.ts
|
989
986
|
function convertEntryToPutEntry(entry) {
|
@@ -2079,10 +2076,50 @@ function subscribeToComposition({
|
|
2079
2076
|
};
|
2080
2077
|
}
|
2081
2078
|
|
2082
|
-
// src/
|
2079
|
+
// src/PromptClient.ts
|
2083
2080
|
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
2081
|
+
var PromptUrl = "/api/v1/prompt";
|
2082
|
+
var PromptsUrl = "/api/v1/prompts";
|
2083
|
+
var PromptClient = class extends ApiClient7 {
|
2084
|
+
constructor(options) {
|
2085
|
+
super(options);
|
2086
|
+
}
|
2087
|
+
/** Fetches all Prompts for a project */
|
2088
|
+
async get(options) {
|
2089
|
+
const { projectId } = this.options;
|
2090
|
+
const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
|
2091
|
+
return await this.apiClient(fetchUri);
|
2092
|
+
}
|
2093
|
+
/** Fetches all Prompts for a project */
|
2094
|
+
async getList(options) {
|
2095
|
+
const { projectId } = this.options;
|
2096
|
+
const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
|
2097
|
+
return await this.apiClient(fetchUri);
|
2098
|
+
}
|
2099
|
+
/** Updates or creates (based on id) a Prompt */
|
2100
|
+
async upsert(body) {
|
2101
|
+
const fetchUri = this.createUrl(PromptUrl);
|
2102
|
+
await this.apiClient(fetchUri, {
|
2103
|
+
method: "PUT",
|
2104
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2105
|
+
expectNoContent: true
|
2106
|
+
});
|
2107
|
+
}
|
2108
|
+
/** Deletes a Prompt */
|
2109
|
+
async remove(body) {
|
2110
|
+
const fetchUri = this.createUrl(PromptUrl);
|
2111
|
+
await this.apiClient(fetchUri, {
|
2112
|
+
method: "DELETE",
|
2113
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
2114
|
+
expectNoContent: true
|
2115
|
+
});
|
2116
|
+
}
|
2117
|
+
};
|
2118
|
+
|
2119
|
+
// src/RouteClient.ts
|
2120
|
+
import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
|
2084
2121
|
var ROUTE_URL = "/api/v1/route";
|
2085
|
-
var RouteClient = class extends
|
2122
|
+
var RouteClient = class extends ApiClient8 {
|
2086
2123
|
constructor(options) {
|
2087
2124
|
var _a;
|
2088
2125
|
if (!options.limitPolicy) {
|
@@ -2425,11 +2462,8 @@ export {
|
|
2425
2462
|
DataTypeClient,
|
2426
2463
|
EDGE_CACHE_DISABLED,
|
2427
2464
|
EDGE_DEFAULT_CACHE_TTL,
|
2428
|
-
EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS,
|
2429
2465
|
EDGE_MAX_CACHE_TTL,
|
2430
|
-
EDGE_MAX_L2_CACHE_TTL_IN_HOURS,
|
2431
2466
|
EDGE_MIN_CACHE_TTL,
|
2432
|
-
EDGE_MIN_L2_CACHE_TTL_IN_HOURS,
|
2433
2467
|
EMPTY_COMPOSITION,
|
2434
2468
|
EnhancerBuilder,
|
2435
2469
|
IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
|
@@ -2440,6 +2474,7 @@ export {
|
|
2440
2474
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
|
2441
2475
|
IS_RENDERED_BY_UNIFORM_ATTRIBUTE,
|
2442
2476
|
PLACEHOLDER_ID,
|
2477
|
+
PromptClient,
|
2443
2478
|
RouteClient,
|
2444
2479
|
SECRET_QUERY_STRING_PARAM,
|
2445
2480
|
UncachedCanvasClient,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/canvas",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.63.0",
|
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,7 +38,7 @@
|
|
38
38
|
"pusher-js": "8.2.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@uniformdev/context": "19.
|
41
|
+
"@uniformdev/context": "19.63.0",
|
42
42
|
"immer": "9.0.21"
|
43
43
|
},
|
44
44
|
"files": [
|
@@ -47,5 +47,5 @@
|
|
47
47
|
"publishConfig": {
|
48
48
|
"access": "public"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "2db8896a68c034ae5ab69fcb56a4c8c0077a8776"
|
51
51
|
}
|