@relyio/sdk 0.16.0 → 0.17.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/CHANGELOG.md +8 -0
- package/dist/{chunk-RLLZUFDB.cjs → chunk-6E22GYPB.cjs} +55 -53
- package/dist/{chunk-7BZW6XYJ.cjs → chunk-6PTRZP5U.cjs} +2 -2
- package/dist/{chunk-CQHEG7QA.js → chunk-OVMIHAYK.js} +2 -2
- package/dist/{chunk-NIUOPIIB.js → chunk-VS2DEUTN.js} +16 -14
- package/dist/client/index.cjs +4 -4
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +2 -2
- package/dist/{define-content-type-LkI0rS2W.d.cts → define-content-type-AuL9-oz6.d.cts} +142 -8
- package/dist/{define-content-type-CAWSlgn0.d.ts → define-content-type-BGoQxqLf.d.ts} +142 -8
- package/dist/{define-schema-Dxu3RoHV.d.ts → define-schema-DgCX9YB7.d.ts} +1 -1
- package/dist/{define-schema-wlsJOrnY.d.cts → define-schema-DkXwpp0I.d.cts} +1 -1
- package/dist/{index-BH8JksfG.d.ts → index-BBp8_tn9.d.ts} +22 -16
- package/dist/{index-CcHmRALk.d.cts → index-Bp4AiNT3.d.cts} +1 -1
- package/dist/{index-CGtYxUuh.d.ts → index-DaMZ4FQ_.d.ts} +1 -1
- package/dist/{index-D80MXUkf.d.cts → index-DxRmKPrR.d.cts} +22 -16
- package/dist/index.cjs +68 -68
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/dist/preview/index.cjs +6 -6
- package/dist/preview/index.js +1 -1
- package/dist/rich-text/index.d.cts +2 -2
- package/dist/rich-text/index.d.ts +2 -2
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @relyio/sdk
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fb6625a: `content(type).create()` and `update()` answer `_metadata.warnings`: each reference the content type declares `weak` that the write published while the entry it points at is unpublished, as `{ path, code: 'REFERENCE_NOT_PUBLISHED', message }`. Always present, `[]` when there are none; the write is never refused for them. `create()` now returns `CreatedContent<T>`, the entry with that list.
|
|
8
|
+
|
|
9
|
+
`singleton(key).update()`, `settings(group).update()` and `settings(group).reset()` answer the same `_metadata.warnings`, beside the `_metadata.brokenLinks` they already carried; they now return `WrittenSingleton<T>` and `WrittenSettingsGroup<T>`. A `batch()` item for any write but a delete carries the list under `data._metadata.warnings` as well.
|
|
10
|
+
|
|
3
11
|
## 0.16.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkLSRPMNPT_cjs = require('./chunk-LSRPMNPT.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk6PTRZP5U_cjs = require('./chunk-6PTRZP5U.cjs');
|
|
5
5
|
var chunkTZL374LS_cjs = require('./chunk-TZL374LS.cjs');
|
|
6
6
|
var chunkMWMSFIWN_cjs = require('./chunk-MWMSFIWN.cjs');
|
|
7
7
|
|
|
@@ -516,7 +516,7 @@ var _ErrorMapper = class _ErrorMapper {
|
|
|
516
516
|
return new NetworkError(`HTTP ${status}: ${statusText}`.trim(), status, void 0, context);
|
|
517
517
|
}
|
|
518
518
|
const retryAfterMs = parseRetryAfterMs(
|
|
519
|
-
headerValue(headers,
|
|
519
|
+
headerValue(headers, chunk6PTRZP5U_cjs.HEADER_RETRY_AFTER.name),
|
|
520
520
|
Date.now()
|
|
521
521
|
);
|
|
522
522
|
return this.fromContractCode(refusal, status, context, retryAfterMs);
|
|
@@ -859,7 +859,7 @@ var IDEMPOTENT_METHODS = /* @__PURE__ */ new Set([
|
|
|
859
859
|
]);
|
|
860
860
|
function isReplaySafe(request) {
|
|
861
861
|
if (IDEMPOTENT_METHODS.has(request.method.toUpperCase())) return true;
|
|
862
|
-
return headerValue(request.headers,
|
|
862
|
+
return headerValue(request.headers, chunk6PTRZP5U_cjs.HEADER_IDEMPOTENCY_KEY.name) !== void 0;
|
|
863
863
|
}
|
|
864
864
|
chunkMWMSFIWN_cjs.__name(isReplaySafe, "isReplaySafe");
|
|
865
865
|
var UNREACHABLE_CODES = /* @__PURE__ */ new Set(["ECONNREFUSED", "ENOTFOUND"]);
|
|
@@ -920,7 +920,7 @@ chunkMWMSFIWN_cjs.__name(isDerivedPreview, "isDerivedPreview");
|
|
|
920
920
|
function isUnknownPreview(dataset) {
|
|
921
921
|
const since = unknown.get(dataset);
|
|
922
922
|
if (since === void 0) return false;
|
|
923
|
-
if (Date.now() - since <
|
|
923
|
+
if (Date.now() - since < chunk6PTRZP5U_cjs.UNKNOWN_PREVIEW_RECHECK_MS) return true;
|
|
924
924
|
unknown.delete(dataset);
|
|
925
925
|
return false;
|
|
926
926
|
}
|
|
@@ -1453,7 +1453,7 @@ chunkMWMSFIWN_cjs.__name(credentialsModeFor, "credentialsModeFor");
|
|
|
1453
1453
|
// src/http/write-options.ts
|
|
1454
1454
|
function versionCheckOf(entry) {
|
|
1455
1455
|
const { id, locale, version, sharedVersion } = entry._metadata;
|
|
1456
|
-
return { id, locale, ifMatch:
|
|
1456
|
+
return { id, locale, ifMatch: chunk6PTRZP5U_cjs.entityTag({ entryUid: id, locale, version, sharedVersion }) };
|
|
1457
1457
|
}
|
|
1458
1458
|
chunkMWMSFIWN_cjs.__name(versionCheckOf, "versionCheckOf");
|
|
1459
1459
|
function mintIdempotencyKey() {
|
|
@@ -1465,11 +1465,11 @@ chunkMWMSFIWN_cjs.__name(mintIdempotencyKey, "mintIdempotencyKey");
|
|
|
1465
1465
|
function writeHeaders(options) {
|
|
1466
1466
|
const headers = {};
|
|
1467
1467
|
if (options?.ifMatch !== void 0) {
|
|
1468
|
-
headers[
|
|
1468
|
+
headers[chunk6PTRZP5U_cjs.HEADER_IF_MATCH.name] = options.ifMatch;
|
|
1469
1469
|
}
|
|
1470
1470
|
const idempotencyKey = options?.idempotencyKey ?? mintIdempotencyKey();
|
|
1471
1471
|
if (idempotencyKey !== void 0) {
|
|
1472
|
-
headers[
|
|
1472
|
+
headers[chunk6PTRZP5U_cjs.HEADER_IDEMPOTENCY_KEY.name] = idempotencyKey;
|
|
1473
1473
|
}
|
|
1474
1474
|
return Object.keys(headers).length > 0 ? headers : void 0;
|
|
1475
1475
|
}
|
|
@@ -1566,7 +1566,7 @@ function writeDocumentTerms(query, options, clientLocale) {
|
|
|
1566
1566
|
query.include = options.include.join(",");
|
|
1567
1567
|
}
|
|
1568
1568
|
writeLocale(query, options.locale ?? clientLocale);
|
|
1569
|
-
if (typeof options.fresh === "string") query[
|
|
1569
|
+
if (typeof options.fresh === "string") query[chunk6PTRZP5U_cjs.FRESH_PARAMETER] = options.fresh;
|
|
1570
1570
|
}
|
|
1571
1571
|
chunkMWMSFIWN_cjs.__name(writeDocumentTerms, "writeDocumentTerms");
|
|
1572
1572
|
function writeLocale(query, locale) {
|
|
@@ -1736,7 +1736,10 @@ var EntryHandle = _EntryHandle;
|
|
|
1736
1736
|
// src/content/content-client.ts
|
|
1737
1737
|
var _ContentClient = class _ContentClient extends EntryHandle {
|
|
1738
1738
|
/**
|
|
1739
|
-
* Create a new content entry.
|
|
1739
|
+
* Create a new content entry, published. The answer's `_metadata.warnings` lists each reference
|
|
1740
|
+
* the content type declares `weak` that the create made live while the entry it points at is
|
|
1741
|
+
* unpublished (`REFERENCE_NOT_PUBLISHED`) — `[]` when there are none; the create is never refused
|
|
1742
|
+
* for them.
|
|
1740
1743
|
*
|
|
1741
1744
|
* `locale` defaults to the client's own, and `dataset` to the client's (`client.with({ dataset })`
|
|
1742
1745
|
* sets it for every call).
|
|
@@ -2642,7 +2645,10 @@ var _SingletonClient = class _SingletonClient extends DocumentHandle {
|
|
|
2642
2645
|
throw error;
|
|
2643
2646
|
}
|
|
2644
2647
|
}
|
|
2645
|
-
/**
|
|
2648
|
+
/**
|
|
2649
|
+
* The API publishes on PATCH: there is no separate publish route. The answer's `_metadata` also
|
|
2650
|
+
* lists the links the write left pointing nowhere and its `warnings` (REL-3097).
|
|
2651
|
+
*/
|
|
2646
2652
|
patch(write, options) {
|
|
2647
2653
|
return this.httpClient.fetchPayload(
|
|
2648
2654
|
"/v1/singletons/{key}",
|
|
@@ -2702,15 +2708,11 @@ var _SettingsClient = class _SettingsClient extends DocumentHandle {
|
|
|
2702
2708
|
async reset(...args) {
|
|
2703
2709
|
const [first, second] = args;
|
|
2704
2710
|
const write = first !== void 0 && isRead(first) ? { ...versionCheckOf(first), options: second } : { locale: this.localeOf(first?.locale), ifMatch: void 0, options: first };
|
|
2705
|
-
return this.httpClient.fetchPayload(
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
query: write.locale === void 0 ? void 0 : { locale: write.locale },
|
|
2711
|
-
headers: DocumentHandle.headersOf(write, write.options)
|
|
2712
|
-
}
|
|
2713
|
-
);
|
|
2711
|
+
return this.httpClient.fetchPayload("/v1/settings/{groupId}/reset", "post", {
|
|
2712
|
+
path: { groupId: this.name },
|
|
2713
|
+
query: write.locale === void 0 ? void 0 : { locale: write.locale },
|
|
2714
|
+
headers: DocumentHandle.headersOf(write, write.options)
|
|
2715
|
+
});
|
|
2714
2716
|
}
|
|
2715
2717
|
/** The group's default values, as the schema declares them. */
|
|
2716
2718
|
async getDefaults() {
|
|
@@ -2959,7 +2961,7 @@ chunkMWMSFIWN_cjs.__name(originOf, "originOf");
|
|
|
2959
2961
|
|
|
2960
2962
|
// src/changes/live-edge.ts
|
|
2961
2963
|
var LIVE_KEEPALIVE_INTERVAL_MS = 3e4;
|
|
2962
|
-
var LIVE_SOCKET_OPEN_TIMEOUT_MS =
|
|
2964
|
+
var LIVE_SOCKET_OPEN_TIMEOUT_MS = chunk6PTRZP5U_cjs.VISITOR_POLL_INTERVAL_MS;
|
|
2963
2965
|
var LIVE_POLLS_BEFORE_SOCKET = 4;
|
|
2964
2966
|
async function* subscribeLiveEdge(client, options = {}) {
|
|
2965
2967
|
const { signal } = options;
|
|
@@ -3029,12 +3031,12 @@ async function* followSocket(socket, reach, options) {
|
|
|
3029
3031
|
return "unopened";
|
|
3030
3032
|
}
|
|
3031
3033
|
case "message": {
|
|
3032
|
-
if (event.data ===
|
|
3033
|
-
const frame = typeof event.data === "string" ?
|
|
3034
|
+
if (event.data === chunk6PTRZP5U_cjs.VISITOR_KEEPALIVE.response) continue;
|
|
3035
|
+
const frame = typeof event.data === "string" ? chunk6PTRZP5U_cjs.parseVisitorFrame(event.data) : null;
|
|
3034
3036
|
if (frame === null)
|
|
3035
3037
|
throw unreadable(`a frame the wire does not declare: ${sample(event.data)}`);
|
|
3036
3038
|
switch (frame.type) {
|
|
3037
|
-
case
|
|
3039
|
+
case chunk6PTRZP5U_cjs.VISITOR_FRAMES.opened: {
|
|
3038
3040
|
caughtUp = true;
|
|
3039
3041
|
inbox.caughtUp();
|
|
3040
3042
|
reach.position = frame.cursor;
|
|
@@ -3042,7 +3044,7 @@ async function* followSocket(socket, reach, options) {
|
|
|
3042
3044
|
options.reached?.(frame.cursor);
|
|
3043
3045
|
continue;
|
|
3044
3046
|
}
|
|
3045
|
-
case
|
|
3047
|
+
case chunk6PTRZP5U_cjs.VISITOR_FRAMES.changes: {
|
|
3046
3048
|
const prior = reach.position;
|
|
3047
3049
|
if (prior === void 0) throw unreadable("changes before the socket had a position");
|
|
3048
3050
|
for (const change of changesOf(frame.changes, frame.cursor, prior)) {
|
|
@@ -3053,7 +3055,7 @@ async function* followSocket(socket, reach, options) {
|
|
|
3053
3055
|
if (frame.changes.length === 0) options.reached?.(frame.cursor);
|
|
3054
3056
|
continue;
|
|
3055
3057
|
}
|
|
3056
|
-
case
|
|
3058
|
+
case chunk6PTRZP5U_cjs.VISITOR_FRAMES.resync: {
|
|
3057
3059
|
await expire(frame.reason, frame.cursor, options);
|
|
3058
3060
|
if (isAborted(signal)) return "aborted";
|
|
3059
3061
|
reach.position = frame.cursor;
|
|
@@ -3125,7 +3127,7 @@ function socketInbox(socket, signal) {
|
|
|
3125
3127
|
return;
|
|
3126
3128
|
}
|
|
3127
3129
|
heard = false;
|
|
3128
|
-
if (socket.readyState === SOCKET_OPEN) socket.send(
|
|
3130
|
+
if (socket.readyState === SOCKET_OPEN) socket.send(chunk6PTRZP5U_cjs.VISITOR_KEEPALIVE.request);
|
|
3129
3131
|
}, LIVE_KEEPALIVE_INTERVAL_MS);
|
|
3130
3132
|
},
|
|
3131
3133
|
caughtUp() {
|
|
@@ -3161,19 +3163,19 @@ var AFTER_A_CLOSE = {
|
|
|
3161
3163
|
"back-off": "Retrying after a back-off of at least a minute, without polling, which the same admission refuses."
|
|
3162
3164
|
};
|
|
3163
3165
|
function closeRetryOf(code) {
|
|
3164
|
-
if (hasOwn(
|
|
3166
|
+
if (hasOwn(chunk6PTRZP5U_cjs.VISITOR_CLOSE_RETRY, code)) return chunk6PTRZP5U_cjs.VISITOR_CLOSE_RETRY[code];
|
|
3165
3167
|
return code < 4e3 ? "retry" : "stop";
|
|
3166
3168
|
}
|
|
3167
3169
|
chunkMWMSFIWN_cjs.__name(closeRetryOf, "closeRetryOf");
|
|
3168
3170
|
var CLOSE_MEANING = {
|
|
3169
|
-
[
|
|
3170
|
-
[
|
|
3171
|
-
[
|
|
3172
|
-
[
|
|
3173
|
-
[
|
|
3174
|
-
[
|
|
3175
|
-
[
|
|
3176
|
-
[
|
|
3171
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.requestInvalid]: "the edge could not read the request \u2014 a malformed cursor or filter",
|
|
3172
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.keyRefused]: "the key is not a publishable key the edge accepts \u2014 unknown, revoked or expired",
|
|
3173
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.originRefused]: "this page\u2019s origin is not on the publishable key\u2019s allowed origins",
|
|
3174
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.datasetRefused]: "`dataset` names no dataset the key reaches",
|
|
3175
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.unavailable]: "the edge could not serve this connection just now \u2014 it could not reach what it needed",
|
|
3176
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.allowanceReached]: "the project holds as many live connections as its plan allows",
|
|
3177
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.addressLimitReached]: "this address holds as many live connections to the project as one address may",
|
|
3178
|
+
[chunk6PTRZP5U_cjs.VISITOR_CLOSE_CODES.ceilingReached]: "the project is at its safety ceiling of live connections"
|
|
3177
3179
|
};
|
|
3178
3180
|
async function* followPolls(client, request, reach, options) {
|
|
3179
3181
|
const { signal } = options;
|
|
@@ -3201,7 +3203,7 @@ async function* followPolls(client, request, reach, options) {
|
|
|
3201
3203
|
if (starting) options.reached?.(answer.cursor);
|
|
3202
3204
|
}
|
|
3203
3205
|
starting = false;
|
|
3204
|
-
await sleep(
|
|
3206
|
+
await sleep(chunk6PTRZP5U_cjs.VISITOR_POLL_INTERVAL_MS, signal);
|
|
3205
3207
|
}
|
|
3206
3208
|
return isAborted(signal) ? "aborted" : "socket";
|
|
3207
3209
|
}
|
|
@@ -3243,7 +3245,7 @@ async function pollOnce2(client, request, since, signal) {
|
|
|
3243
3245
|
}
|
|
3244
3246
|
const body = parseJson(text);
|
|
3245
3247
|
if (!response.ok) throw refusedPoll(response, body, context);
|
|
3246
|
-
const answer =
|
|
3248
|
+
const answer = chunk6PTRZP5U_cjs.readVisitorPollAnswer(isRecord(body) ? body["data"] : void 0);
|
|
3247
3249
|
if (answer === null)
|
|
3248
3250
|
throw unreadable(`a poll answer the wire does not declare: ${sample(text)}`);
|
|
3249
3251
|
return answer;
|
|
@@ -3263,13 +3265,13 @@ function refusedPoll(response, body, context) {
|
|
|
3263
3265
|
{ ...context, method: "GET" }
|
|
3264
3266
|
);
|
|
3265
3267
|
const refusal = readError(body);
|
|
3266
|
-
if (refusal === void 0 || !hasOwn(
|
|
3268
|
+
if (refusal === void 0 || !hasOwn(chunk6PTRZP5U_cjs.VISITOR_POLL_RETRY, refusal.code)) return mapped;
|
|
3267
3269
|
const code = refusal.code;
|
|
3268
3270
|
const retryAfterMs = parseRetryAfterMs(headerValue(headers, "Retry-After"), Date.now());
|
|
3269
3271
|
return new LiveEdgeError(
|
|
3270
3272
|
`The live edge refused a poll (${code}): ${refusal.messages[0] ?? mapped.message}`,
|
|
3271
3273
|
{ kind: "refused", code },
|
|
3272
|
-
|
|
3274
|
+
chunk6PTRZP5U_cjs.VISITOR_POLL_RETRY[code],
|
|
3273
3275
|
{
|
|
3274
3276
|
statusCode: response.status,
|
|
3275
3277
|
cause: mapped,
|
|
@@ -3297,17 +3299,17 @@ function edgeRequest(client, filter) {
|
|
|
3297
3299
|
chunkMWMSFIWN_cjs.__name(edgeRequest, "edgeRequest");
|
|
3298
3300
|
function edgeUrl(request, since, transport, clientId) {
|
|
3299
3301
|
const url = new URL(request.base.href);
|
|
3300
|
-
url.pathname = `${url.pathname.replace(/\/+$/, "")}${
|
|
3302
|
+
url.pathname = `${url.pathname.replace(/\/+$/, "")}${chunk6PTRZP5U_cjs.VISITOR_LIVE_PATH}`;
|
|
3301
3303
|
if (transport === "socket") url.protocol = url.protocol === "http:" ? "ws:" : "wss:";
|
|
3302
3304
|
const query = new URLSearchParams();
|
|
3303
|
-
if (request.key !== void 0) query.set(
|
|
3305
|
+
if (request.key !== void 0) query.set(chunk6PTRZP5U_cjs.VISITOR_QUERY.key, request.key);
|
|
3304
3306
|
if (request.dataset !== void 0 && request.dataset !== "") {
|
|
3305
|
-
query.set(
|
|
3307
|
+
query.set(chunk6PTRZP5U_cjs.VISITOR_QUERY.dataset, request.dataset);
|
|
3306
3308
|
}
|
|
3307
|
-
if (since !== void 0) query.set(
|
|
3308
|
-
if (request.types !== void 0) query.set(
|
|
3309
|
-
if (request.ids !== void 0) query.set(
|
|
3310
|
-
if (transport === "poll" && clientId !== void 0) query.set(
|
|
3309
|
+
if (since !== void 0) query.set(chunk6PTRZP5U_cjs.VISITOR_QUERY.since, since);
|
|
3310
|
+
if (request.types !== void 0) query.set(chunk6PTRZP5U_cjs.VISITOR_QUERY.types, request.types.join(","));
|
|
3311
|
+
if (request.ids !== void 0) query.set(chunk6PTRZP5U_cjs.VISITOR_QUERY.ids, request.ids.join(","));
|
|
3312
|
+
if (transport === "poll" && clientId !== void 0) query.set(chunk6PTRZP5U_cjs.VISITOR_QUERY.client, clientId);
|
|
3311
3313
|
url.search = query.toString();
|
|
3312
3314
|
return url.href;
|
|
3313
3315
|
}
|
|
@@ -3394,7 +3396,7 @@ function transportOf(options) {
|
|
|
3394
3396
|
return {
|
|
3395
3397
|
...signalOf(options),
|
|
3396
3398
|
...headers === void 0 ? {} : { headers },
|
|
3397
|
-
...typeof options.fresh === "string" ? { query: { [
|
|
3399
|
+
...typeof options.fresh === "string" ? { query: { [chunk6PTRZP5U_cjs.FRESH_PARAMETER]: options.fresh } } : {}
|
|
3398
3400
|
};
|
|
3399
3401
|
}
|
|
3400
3402
|
chunkMWMSFIWN_cjs.__name(transportOf, "transportOf");
|
|
@@ -3575,7 +3577,7 @@ async function runAdhocQuery(http, query, clientLocale) {
|
|
|
3575
3577
|
const terms = {};
|
|
3576
3578
|
if (query.cursor !== void 0) terms.cursor = query.cursor;
|
|
3577
3579
|
writeLocale(terms, query.locale ?? clientLocale);
|
|
3578
|
-
if (typeof query.fresh === "string") terms[
|
|
3580
|
+
if (typeof query.fresh === "string") terms[chunk6PTRZP5U_cjs.FRESH_PARAMETER] = query.fresh;
|
|
3579
3581
|
const parameters = { ...query.params };
|
|
3580
3582
|
const body = {
|
|
3581
3583
|
query: {
|
|
@@ -3610,7 +3612,7 @@ async function runNamedQuery(http, name, options, clientLocale) {
|
|
|
3610
3612
|
const locale = options.locale ?? clientLocale;
|
|
3611
3613
|
const terms = {};
|
|
3612
3614
|
if (locale !== void 0 && locale !== "") terms.locale = locale;
|
|
3613
|
-
if (typeof options.fresh === "string") terms[
|
|
3615
|
+
if (typeof options.fresh === "string") terms[chunk6PTRZP5U_cjs.FRESH_PARAMETER] = options.fresh;
|
|
3614
3616
|
const headers = readHeaders(options);
|
|
3615
3617
|
const response = await http.send(
|
|
3616
3618
|
"/v1/queries/{name}",
|
|
@@ -3731,7 +3733,7 @@ chunkMWMSFIWN_cjs.__name(resolveDevOverride, "resolveDevOverride");
|
|
|
3731
3733
|
// src/config/preview-environment.ts
|
|
3732
3734
|
function readPreviewAtRequest() {
|
|
3733
3735
|
const env = typeof process === "undefined" ? void 0 : process.env;
|
|
3734
|
-
return
|
|
3736
|
+
return chunk6PTRZP5U_cjs.previewAtRequest(isEnvironment(env) ? env : {});
|
|
3735
3737
|
}
|
|
3736
3738
|
chunkMWMSFIWN_cjs.__name(readPreviewAtRequest, "readPreviewAtRequest");
|
|
3737
3739
|
function isEnvironment(value) {
|
|
@@ -3841,7 +3843,7 @@ function withPreview(configured) {
|
|
|
3841
3843
|
if (configured.dataset !== void 0 || !isPreviewKey(configured.apiKey)) return configured;
|
|
3842
3844
|
const preview = readPreviewAtRequest();
|
|
3843
3845
|
if (preview.state !== "preview") return configured;
|
|
3844
|
-
const dataset =
|
|
3846
|
+
const dataset = chunk6PTRZP5U_cjs.previewDatasetSlug(preview.branch);
|
|
3845
3847
|
noteDerivedPreview(dataset);
|
|
3846
3848
|
if (!previewNotified) {
|
|
3847
3849
|
previewNotified = true;
|
|
@@ -4487,5 +4489,5 @@ exports.serviceInstructedDelayMs = serviceInstructedDelayMs;
|
|
|
4487
4489
|
exports.sleep = sleep;
|
|
4488
4490
|
exports.validateFile = validateFile;
|
|
4489
4491
|
exports.versionCheckOf = versionCheckOf;
|
|
4490
|
-
//# sourceMappingURL=chunk-
|
|
4491
|
-
//# sourceMappingURL=chunk-
|
|
4492
|
+
//# sourceMappingURL=chunk-6E22GYPB.cjs.map
|
|
4493
|
+
//# sourceMappingURL=chunk-6E22GYPB.cjs.map
|
|
@@ -429,5 +429,5 @@ exports.previewAtBuild = previewAtBuild;
|
|
|
429
429
|
exports.previewAtRequest = previewAtRequest;
|
|
430
430
|
exports.previewDatasetSlug = previewDatasetSlug;
|
|
431
431
|
exports.readVisitorPollAnswer = readVisitorPollAnswer;
|
|
432
|
-
//# sourceMappingURL=chunk-
|
|
433
|
-
//# sourceMappingURL=chunk-
|
|
432
|
+
//# sourceMappingURL=chunk-6PTRZP5U.cjs.map
|
|
433
|
+
//# sourceMappingURL=chunk-6PTRZP5U.cjs.map
|
|
@@ -407,5 +407,5 @@ function hasValue(value) {
|
|
|
407
407
|
__name(hasValue, "hasValue");
|
|
408
408
|
|
|
409
409
|
export { FRESH_PARAMETER, HEADER_IDEMPOTENCY_KEY, HEADER_IF_MATCH, HEADER_RETRY_AFTER, PREVIEW_DATASET_PREFIX, UNKNOWN_PREVIEW_RECHECK_MS, VISITOR_ADMISSION_RETRY_AFTER_SECONDS, VISITOR_CLOSE_CODES, VISITOR_CLOSE_RETRY, VISITOR_FRAMES, VISITOR_KEEPALIVE, VISITOR_LIVE_PATH, VISITOR_POLL_INTERVAL_MS, VISITOR_POLL_RETRY, VISITOR_QUERY, entityTag, parseVisitorFrame, previewAtBuild, previewAtRequest, previewDatasetSlug, readVisitorPollAnswer };
|
|
410
|
-
//# sourceMappingURL=chunk-
|
|
411
|
-
//# sourceMappingURL=chunk-
|
|
410
|
+
//# sourceMappingURL=chunk-OVMIHAYK.js.map
|
|
411
|
+
//# sourceMappingURL=chunk-OVMIHAYK.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseDevEnv, DEV_CONTEXT_DIR, DEV_CONTEXT_FILENAME, parseDevContextFile } from './chunk-BBUB7C2Z.js';
|
|
2
|
-
import { VISITOR_CLOSE_CODES, HEADER_RETRY_AFTER, HEADER_IDEMPOTENCY_KEY, UNKNOWN_PREVIEW_RECHECK_MS, entityTag, HEADER_IF_MATCH, FRESH_PARAMETER, VISITOR_KEEPALIVE, parseVisitorFrame, VISITOR_FRAMES, VISITOR_POLL_INTERVAL_MS, VISITOR_CLOSE_RETRY, readVisitorPollAnswer, VISITOR_POLL_RETRY, VISITOR_LIVE_PATH, VISITOR_QUERY, previewAtRequest, previewDatasetSlug } from './chunk-
|
|
2
|
+
import { VISITOR_CLOSE_CODES, HEADER_RETRY_AFTER, HEADER_IDEMPOTENCY_KEY, UNKNOWN_PREVIEW_RECHECK_MS, entityTag, HEADER_IF_MATCH, FRESH_PARAMETER, VISITOR_KEEPALIVE, parseVisitorFrame, VISITOR_FRAMES, VISITOR_POLL_INTERVAL_MS, VISITOR_CLOSE_RETRY, readVisitorPollAnswer, VISITOR_POLL_RETRY, VISITOR_LIVE_PATH, VISITOR_QUERY, previewAtRequest, previewDatasetSlug } from './chunk-OVMIHAYK.js';
|
|
3
3
|
import { isBrowser } from './chunk-H6IBQSMM.js';
|
|
4
4
|
import { __name, __publicField } from './chunk-XQ4QHWZE.js';
|
|
5
5
|
|
|
@@ -1734,7 +1734,10 @@ var EntryHandle = _EntryHandle;
|
|
|
1734
1734
|
// src/content/content-client.ts
|
|
1735
1735
|
var _ContentClient = class _ContentClient extends EntryHandle {
|
|
1736
1736
|
/**
|
|
1737
|
-
* Create a new content entry.
|
|
1737
|
+
* Create a new content entry, published. The answer's `_metadata.warnings` lists each reference
|
|
1738
|
+
* the content type declares `weak` that the create made live while the entry it points at is
|
|
1739
|
+
* unpublished (`REFERENCE_NOT_PUBLISHED`) — `[]` when there are none; the create is never refused
|
|
1740
|
+
* for them.
|
|
1738
1741
|
*
|
|
1739
1742
|
* `locale` defaults to the client's own, and `dataset` to the client's (`client.with({ dataset })`
|
|
1740
1743
|
* sets it for every call).
|
|
@@ -2640,7 +2643,10 @@ var _SingletonClient = class _SingletonClient extends DocumentHandle {
|
|
|
2640
2643
|
throw error;
|
|
2641
2644
|
}
|
|
2642
2645
|
}
|
|
2643
|
-
/**
|
|
2646
|
+
/**
|
|
2647
|
+
* The API publishes on PATCH: there is no separate publish route. The answer's `_metadata` also
|
|
2648
|
+
* lists the links the write left pointing nowhere and its `warnings` (REL-3097).
|
|
2649
|
+
*/
|
|
2644
2650
|
patch(write, options) {
|
|
2645
2651
|
return this.httpClient.fetchPayload(
|
|
2646
2652
|
"/v1/singletons/{key}",
|
|
@@ -2700,15 +2706,11 @@ var _SettingsClient = class _SettingsClient extends DocumentHandle {
|
|
|
2700
2706
|
async reset(...args) {
|
|
2701
2707
|
const [first, second] = args;
|
|
2702
2708
|
const write = first !== void 0 && isRead(first) ? { ...versionCheckOf(first), options: second } : { locale: this.localeOf(first?.locale), ifMatch: void 0, options: first };
|
|
2703
|
-
return this.httpClient.fetchPayload(
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
query: write.locale === void 0 ? void 0 : { locale: write.locale },
|
|
2709
|
-
headers: DocumentHandle.headersOf(write, write.options)
|
|
2710
|
-
}
|
|
2711
|
-
);
|
|
2709
|
+
return this.httpClient.fetchPayload("/v1/settings/{groupId}/reset", "post", {
|
|
2710
|
+
path: { groupId: this.name },
|
|
2711
|
+
query: write.locale === void 0 ? void 0 : { locale: write.locale },
|
|
2712
|
+
headers: DocumentHandle.headersOf(write, write.options)
|
|
2713
|
+
});
|
|
2712
2714
|
}
|
|
2713
2715
|
/** The group's default values, as the schema declares them. */
|
|
2714
2716
|
async getDefaults() {
|
|
@@ -4431,5 +4433,5 @@ function randomClientId() {
|
|
|
4431
4433
|
__name(randomClientId, "randomClientId");
|
|
4432
4434
|
|
|
4433
4435
|
export { AssetClient, AssetFileBuilder, AssetUploadBuilder, AuthorizationError, BaseValidationError, ChangesExpiredError, ConnectionError, ContentClient, DefaultRetryPolicy, ErrorMapper, FileUploadError, FileValidationError, HttpClient, InvalidApiKeyError, InvalidPayloadError, LIVE_KEEPALIVE_INTERVAL_MS, LIVE_SOCKET_OPEN_TIMEOUT_MS, LiveEdgeError, MethodNotAllowedError, MissingApiKeyError, NetworkError, PREVIEW_KEY_PREFIX, PUBLISHABLE_KEY_PREFIX, PayloadTooLargeError, PlanFeatureUnavailableError, RateLimitError, ReadOnlyKeyError, ResourceConflictError, ResourceExpiredError, ResourceNotFoundError, SDKError, ServerError, ServiceIndeterminateError, SettingsClient, SingletonClient, TimeoutError, TransactionRolledBackError, TypedRelyIOClient, UnknownContractError, UsageQuotaExceededError, ValidationError, createClient, isAborted, isAssetEntry, isMissingEntry, isPreviewKey, isPublishableKey, isReplaySafe, isResourceNotFound, matchRoute, retryPolicyFor, serviceInstructedDelayMs, sleep, validateFile, versionCheckOf };
|
|
4434
|
-
//# sourceMappingURL=chunk-
|
|
4435
|
-
//# sourceMappingURL=chunk-
|
|
4436
|
+
//# sourceMappingURL=chunk-VS2DEUTN.js.map
|
|
4437
|
+
//# sourceMappingURL=chunk-VS2DEUTN.js.map
|
package/dist/client/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6E22GYPB_cjs = require('../chunk-6E22GYPB.cjs');
|
|
4
4
|
require('../chunk-LSRPMNPT.cjs');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-6PTRZP5U.cjs');
|
|
6
6
|
require('../chunk-TZL374LS.cjs');
|
|
7
7
|
require('../chunk-MWMSFIWN.cjs');
|
|
8
8
|
|
|
@@ -10,11 +10,11 @@ require('../chunk-MWMSFIWN.cjs');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "TypedRelyIOClient", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk6E22GYPB_cjs.TypedRelyIOClient; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "createClient", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk6E22GYPB_cjs.createClient; }
|
|
18
18
|
});
|
|
19
19
|
//# sourceMappingURL=index.cjs.map
|
|
20
20
|
//# sourceMappingURL=index.cjs.map
|
package/dist/client/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { e as ClientDefaults, f as ClientSchema, R as Register, h as RegisteredSchema, d as TypedClientConfig, T as TypedRelyIOClient, c as createClient } from '../index-
|
|
2
|
-
import '../define-content-type-
|
|
1
|
+
export { e as ClientDefaults, f as ClientSchema, R as Register, h as RegisteredSchema, d as TypedClientConfig, T as TypedRelyIOClient, c as createClient } from '../index-DxRmKPrR.cjs';
|
|
2
|
+
import '../define-content-type-AuL9-oz6.cjs';
|
|
3
3
|
import '../rich-text.d-BWc-5gX1.cjs';
|
|
4
|
-
import '../define-schema-
|
|
4
|
+
import '../define-schema-DkXwpp0I.cjs';
|
|
5
5
|
import '../dev-handshake/index.cjs';
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { e as ClientDefaults, f as ClientSchema, R as Register, h as RegisteredSchema, d as TypedClientConfig, T as TypedRelyIOClient, c as createClient } from '../index-
|
|
2
|
-
import '../define-content-type-
|
|
1
|
+
export { e as ClientDefaults, f as ClientSchema, R as Register, h as RegisteredSchema, d as TypedClientConfig, T as TypedRelyIOClient, c as createClient } from '../index-BBp8_tn9.js';
|
|
2
|
+
import '../define-content-type-BGoQxqLf.js';
|
|
3
3
|
import '../rich-text.d-BWc-5gX1.js';
|
|
4
|
-
import '../define-schema-
|
|
4
|
+
import '../define-schema-DgCX9YB7.js';
|
|
5
5
|
import '../dev-handshake/index.js';
|
package/dist/client/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { TypedRelyIOClient, createClient } from '../chunk-
|
|
1
|
+
export { TypedRelyIOClient, createClient } from '../chunk-VS2DEUTN.js';
|
|
2
2
|
import '../chunk-BBUB7C2Z.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-OVMIHAYK.js';
|
|
4
4
|
import '../chunk-H6IBQSMM.js';
|
|
5
5
|
import '../chunk-XQ4QHWZE.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|