@relyio/sdk 0.3.0 → 0.5.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 +109 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/{chunk-QIZOBT5F.js → chunk-5AZUUV5B.js} +349 -25
- package/dist/{chunk-54WP2PWG.cjs → chunk-CIRT6TVT.cjs} +350 -24
- package/dist/{chunk-HMVGXUGR.cjs → chunk-HAQELDZN.cjs} +2 -2
- package/dist/{chunk-LYRYCIX5.js → chunk-XY5KFEFY.js} +2 -2
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +4 -3
- package/dist/client/index.d.ts +4 -3
- package/dist/client/index.js +1 -1
- package/dist/{define-schema-BfXeR6K8.d.cts → define-schema-2xbHgtK-.d.cts} +8 -4
- package/dist/{define-schema-BD6HSPnG.d.ts → define-schema-DzYXk4HL.d.ts} +8 -4
- package/dist/{index-BDpar3FO.d.cts → index-BozPz4n1.d.cts} +320 -8
- package/dist/{index-ulOrcfPa.d.cts → index-C5mRBb6t.d.cts} +368 -11
- package/dist/{index-Dx01iwaf.d.ts → index-Dzo-upNS.d.ts} +320 -8
- package/dist/{index-DuEhsGdE.d.ts → index-mXUx2H99.d.ts} +368 -11
- package/dist/index.cjs +119 -66
- package/dist/index.d.cts +131 -46
- package/dist/index.d.ts +131 -46
- package/dist/index.js +44 -3
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -13
- package/dist/react/index.cjs +0 -4
- package/dist/react/index.d.cts +0 -2
- package/dist/react/index.d.ts +0 -2
- package/dist/react/index.js +0 -3
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkHAQELDZN_cjs = require('./chunk-HAQELDZN.cjs');
|
|
6
|
+
var chunkCIRT6TVT_cjs = require('./chunk-CIRT6TVT.cjs');
|
|
7
7
|
require('./chunk-LSRPMNPT.cjs');
|
|
8
8
|
require('./chunk-PPA2WWOH.cjs');
|
|
9
9
|
var chunkHT6NFRM2_cjs = require('./chunk-HT6NFRM2.cjs');
|
|
@@ -145,264 +145,313 @@ var localeHelpers = {
|
|
|
145
145
|
getAllLocalizedValues
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
+
// src/binding/relyio-field.ts
|
|
149
|
+
var BINDING_VERSION = "1";
|
|
150
|
+
function relyioField(entry, field) {
|
|
151
|
+
const metadata = entry._metadata;
|
|
152
|
+
return {
|
|
153
|
+
"data-relyio-entry": requireMetadata(metadata, "id", field),
|
|
154
|
+
"data-relyio-type": requireMetadata(metadata, "type", field),
|
|
155
|
+
"data-relyio-field": field,
|
|
156
|
+
"data-relyio-locale": requireMetadata(metadata, "locale", field),
|
|
157
|
+
"data-relyio-v": BINDING_VERSION
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
chunkMWMSFIWN_cjs.__name(relyioField, "relyioField");
|
|
161
|
+
function requireMetadata(metadata, key, field) {
|
|
162
|
+
const value = metadata?.[key];
|
|
163
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
164
|
+
throw new TypeError(
|
|
165
|
+
`relyioField(entry, '${field}'): the entry has no _metadata.${key}, so the field cannot be bound. Pass an entry as the RelyIO API returned it.`
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
chunkMWMSFIWN_cjs.__name(requireMetadata, "requireMetadata");
|
|
171
|
+
|
|
172
|
+
// src/binding/change-event.ts
|
|
173
|
+
var RELYIO_CHANGE_EVENT = "relyio:change";
|
|
174
|
+
|
|
175
|
+
// src/image/ladder.ts
|
|
176
|
+
var IMAGE_LADDER = {
|
|
177
|
+
maxDimension: 5e3,
|
|
178
|
+
bucket: 100
|
|
179
|
+
};
|
|
180
|
+
function snapToLadder(value) {
|
|
181
|
+
const clamped = Math.min(Math.max(value, 1), IMAGE_LADDER.maxDimension);
|
|
182
|
+
return Math.max(
|
|
183
|
+
IMAGE_LADDER.bucket,
|
|
184
|
+
Math.round(clamped / IMAGE_LADDER.bucket) * IMAGE_LADDER.bucket
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
chunkMWMSFIWN_cjs.__name(snapToLadder, "snapToLadder");
|
|
188
|
+
|
|
148
189
|
// src/index.ts
|
|
149
190
|
var VERSION = "__VERSION__";
|
|
150
191
|
|
|
151
192
|
Object.defineProperty(exports, "defineAssetType", {
|
|
152
193
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkHAQELDZN_cjs.defineAssetType; }
|
|
154
195
|
});
|
|
155
196
|
Object.defineProperty(exports, "defineComponent", {
|
|
156
197
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunkHAQELDZN_cjs.defineComponent; }
|
|
158
199
|
});
|
|
159
200
|
Object.defineProperty(exports, "defineContentType", {
|
|
160
201
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkHAQELDZN_cjs.defineContentType; }
|
|
162
203
|
});
|
|
163
204
|
Object.defineProperty(exports, "defineQuery", {
|
|
164
205
|
enumerable: true,
|
|
165
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkHAQELDZN_cjs.defineQuery; }
|
|
166
207
|
});
|
|
167
208
|
Object.defineProperty(exports, "defineSchema", {
|
|
168
209
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunkHAQELDZN_cjs.defineSchema; }
|
|
170
211
|
});
|
|
171
212
|
Object.defineProperty(exports, "defineSettingsGroup", {
|
|
172
213
|
enumerable: true,
|
|
173
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkHAQELDZN_cjs.defineSettingsGroup; }
|
|
174
215
|
});
|
|
175
216
|
Object.defineProperty(exports, "defineSingleton", {
|
|
176
217
|
enumerable: true,
|
|
177
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkHAQELDZN_cjs.defineSingleton; }
|
|
178
219
|
});
|
|
179
220
|
Object.defineProperty(exports, "defineSingletonContentType", {
|
|
180
221
|
enumerable: true,
|
|
181
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkHAQELDZN_cjs.defineSingletonContentType; }
|
|
182
223
|
});
|
|
183
224
|
Object.defineProperty(exports, "fields", {
|
|
184
225
|
enumerable: true,
|
|
185
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkHAQELDZN_cjs.fields; }
|
|
186
227
|
});
|
|
187
228
|
Object.defineProperty(exports, "fieldset", {
|
|
188
229
|
enumerable: true,
|
|
189
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkHAQELDZN_cjs.fieldset; }
|
|
190
231
|
});
|
|
191
232
|
Object.defineProperty(exports, "AdhocQueryBuilder", {
|
|
192
233
|
enumerable: true,
|
|
193
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkCIRT6TVT_cjs.AdhocQueryBuilder; }
|
|
194
235
|
});
|
|
195
236
|
Object.defineProperty(exports, "AdhocQueryClient", {
|
|
196
237
|
enumerable: true,
|
|
197
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkCIRT6TVT_cjs.AdhocQueryClient; }
|
|
198
239
|
});
|
|
199
240
|
Object.defineProperty(exports, "AssetClient", {
|
|
200
241
|
enumerable: true,
|
|
201
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkCIRT6TVT_cjs.AssetClient; }
|
|
202
243
|
});
|
|
203
244
|
Object.defineProperty(exports, "AssetFileBuilder", {
|
|
204
245
|
enumerable: true,
|
|
205
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkCIRT6TVT_cjs.AssetFileBuilder; }
|
|
206
247
|
});
|
|
207
248
|
Object.defineProperty(exports, "AssetUploadBuilder", {
|
|
208
249
|
enumerable: true,
|
|
209
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkCIRT6TVT_cjs.AssetUploadBuilder; }
|
|
210
251
|
});
|
|
211
252
|
Object.defineProperty(exports, "AuthenticationError", {
|
|
212
253
|
enumerable: true,
|
|
213
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkCIRT6TVT_cjs.AuthenticationError; }
|
|
214
255
|
});
|
|
215
256
|
Object.defineProperty(exports, "AuthorizationError", {
|
|
216
257
|
enumerable: true,
|
|
217
|
-
get: function () { return
|
|
258
|
+
get: function () { return chunkCIRT6TVT_cjs.AuthorizationError; }
|
|
218
259
|
});
|
|
219
260
|
Object.defineProperty(exports, "AutocompleteBuilder", {
|
|
220
261
|
enumerable: true,
|
|
221
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkCIRT6TVT_cjs.AutocompleteBuilder; }
|
|
222
263
|
});
|
|
223
264
|
Object.defineProperty(exports, "BaseValidationError", {
|
|
224
265
|
enumerable: true,
|
|
225
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkCIRT6TVT_cjs.BaseValidationError; }
|
|
226
267
|
});
|
|
227
268
|
Object.defineProperty(exports, "BatchBuilder", {
|
|
228
269
|
enumerable: true,
|
|
229
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkCIRT6TVT_cjs.BatchBuilder; }
|
|
230
271
|
});
|
|
231
272
|
Object.defineProperty(exports, "BatchClient", {
|
|
232
273
|
enumerable: true,
|
|
233
|
-
get: function () { return
|
|
274
|
+
get: function () { return chunkCIRT6TVT_cjs.BatchClient; }
|
|
275
|
+
});
|
|
276
|
+
Object.defineProperty(exports, "ChangesExpiredError", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function () { return chunkCIRT6TVT_cjs.ChangesExpiredError; }
|
|
234
279
|
});
|
|
235
280
|
Object.defineProperty(exports, "ConnectionError", {
|
|
236
281
|
enumerable: true,
|
|
237
|
-
get: function () { return
|
|
282
|
+
get: function () { return chunkCIRT6TVT_cjs.ConnectionError; }
|
|
238
283
|
});
|
|
239
284
|
Object.defineProperty(exports, "ContentByIdBuilder", {
|
|
240
285
|
enumerable: true,
|
|
241
|
-
get: function () { return
|
|
286
|
+
get: function () { return chunkCIRT6TVT_cjs.ContentByIdBuilder; }
|
|
242
287
|
});
|
|
243
288
|
Object.defineProperty(exports, "ContentClient", {
|
|
244
289
|
enumerable: true,
|
|
245
|
-
get: function () { return
|
|
290
|
+
get: function () { return chunkCIRT6TVT_cjs.ContentClient; }
|
|
246
291
|
});
|
|
247
292
|
Object.defineProperty(exports, "ContentQueryBuilder", {
|
|
248
293
|
enumerable: true,
|
|
249
|
-
get: function () { return
|
|
294
|
+
get: function () { return chunkCIRT6TVT_cjs.ContentQueryBuilder; }
|
|
250
295
|
});
|
|
251
296
|
Object.defineProperty(exports, "ErrorMapper", {
|
|
252
297
|
enumerable: true,
|
|
253
|
-
get: function () { return
|
|
298
|
+
get: function () { return chunkCIRT6TVT_cjs.ErrorMapper; }
|
|
254
299
|
});
|
|
255
300
|
Object.defineProperty(exports, "FileUploadError", {
|
|
256
301
|
enumerable: true,
|
|
257
|
-
get: function () { return
|
|
302
|
+
get: function () { return chunkCIRT6TVT_cjs.FileUploadError; }
|
|
258
303
|
});
|
|
259
304
|
Object.defineProperty(exports, "FileValidationError", {
|
|
260
305
|
enumerable: true,
|
|
261
|
-
get: function () { return
|
|
306
|
+
get: function () { return chunkCIRT6TVT_cjs.FileValidationError; }
|
|
262
307
|
});
|
|
263
308
|
Object.defineProperty(exports, "HttpClient", {
|
|
264
309
|
enumerable: true,
|
|
265
|
-
get: function () { return
|
|
310
|
+
get: function () { return chunkCIRT6TVT_cjs.HttpClient; }
|
|
266
311
|
});
|
|
267
312
|
Object.defineProperty(exports, "InvalidApiKeyError", {
|
|
268
313
|
enumerable: true,
|
|
269
|
-
get: function () { return
|
|
314
|
+
get: function () { return chunkCIRT6TVT_cjs.InvalidApiKeyError; }
|
|
270
315
|
});
|
|
271
316
|
Object.defineProperty(exports, "InvalidFieldTypeError", {
|
|
272
317
|
enumerable: true,
|
|
273
|
-
get: function () { return
|
|
318
|
+
get: function () { return chunkCIRT6TVT_cjs.InvalidFieldTypeError; }
|
|
274
319
|
});
|
|
275
320
|
Object.defineProperty(exports, "InvalidPayloadError", {
|
|
276
321
|
enumerable: true,
|
|
277
|
-
get: function () { return
|
|
322
|
+
get: function () { return chunkCIRT6TVT_cjs.InvalidPayloadError; }
|
|
278
323
|
});
|
|
279
324
|
Object.defineProperty(exports, "MethodNotAllowedError", {
|
|
280
325
|
enumerable: true,
|
|
281
|
-
get: function () { return
|
|
326
|
+
get: function () { return chunkCIRT6TVT_cjs.MethodNotAllowedError; }
|
|
282
327
|
});
|
|
283
328
|
Object.defineProperty(exports, "MissingApiKeyError", {
|
|
284
329
|
enumerable: true,
|
|
285
|
-
get: function () { return
|
|
330
|
+
get: function () { return chunkCIRT6TVT_cjs.MissingApiKeyError; }
|
|
286
331
|
});
|
|
287
332
|
Object.defineProperty(exports, "NetworkError", {
|
|
288
333
|
enumerable: true,
|
|
289
|
-
get: function () { return
|
|
334
|
+
get: function () { return chunkCIRT6TVT_cjs.NetworkError; }
|
|
290
335
|
});
|
|
291
336
|
Object.defineProperty(exports, "PayloadTooLargeError", {
|
|
292
337
|
enumerable: true,
|
|
293
|
-
get: function () { return
|
|
338
|
+
get: function () { return chunkCIRT6TVT_cjs.PayloadTooLargeError; }
|
|
294
339
|
});
|
|
295
340
|
Object.defineProperty(exports, "PlanFeatureUnavailableError", {
|
|
296
341
|
enumerable: true,
|
|
297
|
-
get: function () { return
|
|
342
|
+
get: function () { return chunkCIRT6TVT_cjs.PlanFeatureUnavailableError; }
|
|
298
343
|
});
|
|
299
344
|
Object.defineProperty(exports, "RateLimitError", {
|
|
300
345
|
enumerable: true,
|
|
301
|
-
get: function () { return
|
|
346
|
+
get: function () { return chunkCIRT6TVT_cjs.RateLimitError; }
|
|
302
347
|
});
|
|
303
348
|
Object.defineProperty(exports, "ReadOnlyKeyError", {
|
|
304
349
|
enumerable: true,
|
|
305
|
-
get: function () { return
|
|
350
|
+
get: function () { return chunkCIRT6TVT_cjs.ReadOnlyKeyError; }
|
|
306
351
|
});
|
|
307
352
|
Object.defineProperty(exports, "RequiredFieldError", {
|
|
308
353
|
enumerable: true,
|
|
309
|
-
get: function () { return
|
|
354
|
+
get: function () { return chunkCIRT6TVT_cjs.RequiredFieldError; }
|
|
310
355
|
});
|
|
311
356
|
Object.defineProperty(exports, "ResourceConflictError", {
|
|
312
357
|
enumerable: true,
|
|
313
|
-
get: function () { return
|
|
358
|
+
get: function () { return chunkCIRT6TVT_cjs.ResourceConflictError; }
|
|
314
359
|
});
|
|
315
360
|
Object.defineProperty(exports, "ResourceExpiredError", {
|
|
316
361
|
enumerable: true,
|
|
317
|
-
get: function () { return
|
|
362
|
+
get: function () { return chunkCIRT6TVT_cjs.ResourceExpiredError; }
|
|
318
363
|
});
|
|
319
364
|
Object.defineProperty(exports, "ResourceNotFoundError", {
|
|
320
365
|
enumerable: true,
|
|
321
|
-
get: function () { return
|
|
366
|
+
get: function () { return chunkCIRT6TVT_cjs.ResourceNotFoundError; }
|
|
322
367
|
});
|
|
323
368
|
Object.defineProperty(exports, "SDKError", {
|
|
324
369
|
enumerable: true,
|
|
325
|
-
get: function () { return
|
|
370
|
+
get: function () { return chunkCIRT6TVT_cjs.SDKError; }
|
|
326
371
|
});
|
|
327
372
|
Object.defineProperty(exports, "SchemaValidationError", {
|
|
328
373
|
enumerable: true,
|
|
329
|
-
get: function () { return
|
|
374
|
+
get: function () { return chunkCIRT6TVT_cjs.SchemaValidationError; }
|
|
330
375
|
});
|
|
331
376
|
Object.defineProperty(exports, "SearchBuilder", {
|
|
332
377
|
enumerable: true,
|
|
333
|
-
get: function () { return
|
|
378
|
+
get: function () { return chunkCIRT6TVT_cjs.SearchBuilder; }
|
|
334
379
|
});
|
|
335
380
|
Object.defineProperty(exports, "SearchClient", {
|
|
336
381
|
enumerable: true,
|
|
337
|
-
get: function () { return
|
|
382
|
+
get: function () { return chunkCIRT6TVT_cjs.SearchClient; }
|
|
338
383
|
});
|
|
339
384
|
Object.defineProperty(exports, "ServerError", {
|
|
340
385
|
enumerable: true,
|
|
341
|
-
get: function () { return
|
|
386
|
+
get: function () { return chunkCIRT6TVT_cjs.ServerError; }
|
|
342
387
|
});
|
|
343
388
|
Object.defineProperty(exports, "ServiceIndeterminateError", {
|
|
344
389
|
enumerable: true,
|
|
345
|
-
get: function () { return
|
|
390
|
+
get: function () { return chunkCIRT6TVT_cjs.ServiceIndeterminateError; }
|
|
346
391
|
});
|
|
347
392
|
Object.defineProperty(exports, "SettingsClient", {
|
|
348
393
|
enumerable: true,
|
|
349
|
-
get: function () { return
|
|
394
|
+
get: function () { return chunkCIRT6TVT_cjs.SettingsClient; }
|
|
350
395
|
});
|
|
351
396
|
Object.defineProperty(exports, "SimilarBuilder", {
|
|
352
397
|
enumerable: true,
|
|
353
|
-
get: function () { return
|
|
398
|
+
get: function () { return chunkCIRT6TVT_cjs.SimilarBuilder; }
|
|
354
399
|
});
|
|
355
400
|
Object.defineProperty(exports, "SingletonClient", {
|
|
356
401
|
enumerable: true,
|
|
357
|
-
get: function () { return
|
|
402
|
+
get: function () { return chunkCIRT6TVT_cjs.SingletonClient; }
|
|
358
403
|
});
|
|
359
404
|
Object.defineProperty(exports, "TimeoutError", {
|
|
360
405
|
enumerable: true,
|
|
361
|
-
get: function () { return
|
|
406
|
+
get: function () { return chunkCIRT6TVT_cjs.TimeoutError; }
|
|
362
407
|
});
|
|
363
408
|
Object.defineProperty(exports, "TransactionRolledBackError", {
|
|
364
409
|
enumerable: true,
|
|
365
|
-
get: function () { return
|
|
410
|
+
get: function () { return chunkCIRT6TVT_cjs.TransactionRolledBackError; }
|
|
366
411
|
});
|
|
367
412
|
Object.defineProperty(exports, "TypedRelyIOClient", {
|
|
368
413
|
enumerable: true,
|
|
369
|
-
get: function () { return
|
|
414
|
+
get: function () { return chunkCIRT6TVT_cjs.TypedRelyIOClient; }
|
|
370
415
|
});
|
|
371
416
|
Object.defineProperty(exports, "UnknownContractError", {
|
|
372
417
|
enumerable: true,
|
|
373
|
-
get: function () { return
|
|
418
|
+
get: function () { return chunkCIRT6TVT_cjs.UnknownContractError; }
|
|
374
419
|
});
|
|
375
420
|
Object.defineProperty(exports, "UsageQuotaExceededError", {
|
|
376
421
|
enumerable: true,
|
|
377
|
-
get: function () { return
|
|
422
|
+
get: function () { return chunkCIRT6TVT_cjs.UsageQuotaExceededError; }
|
|
378
423
|
});
|
|
379
424
|
Object.defineProperty(exports, "ValidationError", {
|
|
380
425
|
enumerable: true,
|
|
381
|
-
get: function () { return
|
|
426
|
+
get: function () { return chunkCIRT6TVT_cjs.ValidationError; }
|
|
382
427
|
});
|
|
383
428
|
Object.defineProperty(exports, "createClient", {
|
|
384
429
|
enumerable: true,
|
|
385
|
-
get: function () { return
|
|
430
|
+
get: function () { return chunkCIRT6TVT_cjs.createClient; }
|
|
386
431
|
});
|
|
387
432
|
Object.defineProperty(exports, "default", {
|
|
388
433
|
enumerable: true,
|
|
389
|
-
get: function () { return
|
|
434
|
+
get: function () { return chunkCIRT6TVT_cjs.createClient; }
|
|
390
435
|
});
|
|
391
436
|
Object.defineProperty(exports, "entityTagOf", {
|
|
392
437
|
enumerable: true,
|
|
393
|
-
get: function () { return
|
|
438
|
+
get: function () { return chunkCIRT6TVT_cjs.entityTagOf; }
|
|
394
439
|
});
|
|
395
440
|
Object.defineProperty(exports, "isAssetEntry", {
|
|
396
441
|
enumerable: true,
|
|
397
|
-
get: function () { return
|
|
442
|
+
get: function () { return chunkCIRT6TVT_cjs.isAssetEntry; }
|
|
398
443
|
});
|
|
399
444
|
Object.defineProperty(exports, "isResourceNotFound", {
|
|
400
445
|
enumerable: true,
|
|
401
|
-
get: function () { return
|
|
446
|
+
get: function () { return chunkCIRT6TVT_cjs.isResourceNotFound; }
|
|
447
|
+
});
|
|
448
|
+
Object.defineProperty(exports, "matchRoute", {
|
|
449
|
+
enumerable: true,
|
|
450
|
+
get: function () { return chunkCIRT6TVT_cjs.matchRoute; }
|
|
402
451
|
});
|
|
403
452
|
Object.defineProperty(exports, "validateFile", {
|
|
404
453
|
enumerable: true,
|
|
405
|
-
get: function () { return
|
|
454
|
+
get: function () { return chunkCIRT6TVT_cjs.validateFile; }
|
|
406
455
|
});
|
|
407
456
|
Object.defineProperty(exports, "camelToSnake", {
|
|
408
457
|
enumerable: true,
|
|
@@ -476,6 +525,8 @@ Object.defineProperty(exports, "toSafeString", {
|
|
|
476
525
|
enumerable: true,
|
|
477
526
|
get: function () { return chunkHT6NFRM2_cjs.toSafeString; }
|
|
478
527
|
});
|
|
528
|
+
exports.IMAGE_LADDER = IMAGE_LADDER;
|
|
529
|
+
exports.RELYIO_CHANGE_EVENT = RELYIO_CHANGE_EVENT;
|
|
479
530
|
exports.VERSION = VERSION;
|
|
480
531
|
exports.buildLanguageSwitcher = buildLanguageSwitcher;
|
|
481
532
|
exports.estimateTranslationCompleteness = estimateTranslationCompleteness;
|
|
@@ -492,5 +543,7 @@ exports.isFieldFallback = isFieldFallback;
|
|
|
492
543
|
exports.isPublishedInLocale = isPublishedInLocale;
|
|
493
544
|
exports.localeHelpers = localeHelpers;
|
|
494
545
|
exports.needsTranslation = needsTranslation;
|
|
546
|
+
exports.relyioField = relyioField;
|
|
547
|
+
exports.snapToLadder = snapToLadder;
|
|
495
548
|
//# sourceMappingURL=index.cjs.map
|
|
496
549
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { C as Change } from './index-BozPz4n1.cjs';
|
|
2
|
+
export { A as ActiveSandbox, Z as AdhocAggregateBlock, Y as AdhocFetchBlock, X as AdhocQueryBuilder, W as AdhocQueryClient, a3 as AdhocQueryDefinition, a4 as AdhocQueryOptions, a6 as AdhocQueryResult, $ as AdhocSearchBlock, a0 as AdhocSimilarBlock, _ as AggregateMetric, a7 as AssetClient, ah as AssetEntryResponse, ae as AssetFileBlock, a8 as AssetFileBuilder, af as AssetFileExtracted, a9 as AssetUploadBuilder, ag as AssetUrls, ab as AssetVisibility, v as AutocompleteBuilder, D as AutocompleteResponse, B as AutocompleteSuggestion, L as BatchBuilder, K as BatchClient, M as BatchMethod, N as BatchOperation, Q as BatchOperationResult, O as BatchOptions, V as BatchResponse, U as BatchSummary, i as ChangesExpiredError, k as ChangesExpiredReason, j as ChangesOptions, q as ChildrenOptions, b as ClientSchema, g as ConditionalWriteOptions, al as ConfirmInput, am as ConfirmResult, p as ContentByIdBuilder, l as ContentClient, o as ContentQueryBuilder, ap as CreateAssetOptions, E as ExtendedQueryResult, ad as FileBackend, az as FileErrorCode, ac as FileStatus, aA as FileUploadError, aC as FileValidationConstraints, aB as FileValidationError, a1 as FilterValue, a2 as FullTextConfig, H as HttpClient, ar as MultipartCreateResult, as as MultipartPart, at as MultipartTarget, ai as PopulatedAssetReference, aj as PresignInput, ak as PresignResult, P as Project, a5 as QueryMetadata, R as Register, d as RegisteredSchema, an as ResolveUrlInput, ao as ResolveUrlResult, aw as ResourceConflictError, ax as ResourceExpiredError, av as ResourceNotFoundError, h as RetryableWriteOptions, S as SandboxState, u as SearchBuilder, t as SearchClient, J as SearchFields, I as SearchFilter, x as SearchMode, z as SearchResponse, y as SearchResultItem, e as SendOptions, n as SettingsClient, s as SettingsFetchOptions, w as SimilarBuilder, G as SimilarResponse, F as SimilarResult, m as SingletonClient, r as SingletonFetchOptions, a as TypedClientConfig, T as TypedRelyIOClient, au as UploadProgress, aq as WaitUntilReadyOptions, c as createClient, c as default, f as entityTagOf, aa as isAssetEntry, ay as isResourceNotFound, aD as validateFile } from './index-BozPz4n1.cjs';
|
|
2
3
|
export { fields } from './schema/index.cjs';
|
|
3
|
-
import { S as SDKError } from './index-
|
|
4
|
-
export { a as ApiMethod, A as ApiPath,
|
|
4
|
+
import { S as SDKError, B as BaseContent } from './index-C5mRBb6t.cjs';
|
|
5
|
+
export { a as ApiMethod, A as ApiPath, t as ApiResponse, b as ApiSuccessBody, x as BaseValidationError, q as CacheConfig, v as CacheStrategy, g as ContentQueryResult, k as ContentTypeSchema, C as CreateInput, j as CustomQuery, D as DebugConfig, E as Environment, l as FieldOptions, F as FieldTypeName, H as InvalidFieldTypeError, I as InvalidPayloadError, L as LogLevel, M as MatchRouteOptions, P as PerformanceMetrics, Q as QueryOptions, r as RealtimeConfig, o as RealtimeEvent, n as RealtimeEventType, R as RelyIOConfig, s as RequestConfig, G as RequiredFieldError, u as RetryConfig, c as RouteMatch, z as SchemaValidationError, i as SettingsGroup, h as SingletonContent, f as SortOptions, p as SubscriptionOptions, U as UpdateInput, y as ValidationError, V as ValidationRule, w as ValidationViolation, d as WhereClause, e as WhereOperator, W as Wire, m as matchRoute } from './index-C5mRBb6t.cjs';
|
|
5
6
|
export { camelToSnake, createDeferred, debounce, deepClone, generateId, isBrowser, isNode, isPlainObject, isValidEmail, isValidUrl, mergeDeep, omit, pick, retry, sleep, snakeToCamel, throttle, toSafeString } from './utils/index.cjs';
|
|
6
|
-
export { ax as AggregateBlock, G as AssetTypeConfig, K as AssetTypeDefinition, C as ComponentConfig, v as ComponentDefinition, w as ComponentMetadata, aw as FetchBlock, O as FileKindConfig, a3 as FileScanConfig, a2 as FileUploadConfig, aH as FilterDefinition, X as ImageExifConfig, N as ImageKindConfig, W as ImageSourceConfig, U as ImageUploadConfig, aF as IncludeDefinition, M as InferAssetType, aR as InferQueryParams, aQ as InferQueryResponse, t as InferSingleton, I as InferSingletonContentType, au as QueryConfig, av as QueryDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ay as SearchBlock, aG as SelectMapping, A as SettingsGroupConfig, B as SettingsGroupDefinition, az as SimilarBlock, r as SingletonContentTypeDefinition, s as SingletonMetadata, aD as SortCondition, Y as VariantDefinition, $ as VideoCaptionsConfig, a0 as VideoDownloadConfig, V as VideoKindConfig, _ as VideoPosterConfig, Z as VideoUploadConfig, a1 as VideoWatermarkConfig, aA as WhereCondition, F as defineAssetType, u as defineComponent, at as defineQuery, d as defineSchema, z as defineSettingsGroup, q as defineSingleton, p as defineSingletonContentType } from './define-schema-
|
|
7
|
+
export { ax as AggregateBlock, G as AssetTypeConfig, K as AssetTypeDefinition, C as ComponentConfig, v as ComponentDefinition, w as ComponentMetadata, aw as FetchBlock, O as FileKindConfig, a3 as FileScanConfig, a2 as FileUploadConfig, aH as FilterDefinition, X as ImageExifConfig, N as ImageKindConfig, W as ImageSourceConfig, U as ImageUploadConfig, aF as IncludeDefinition, M as InferAssetType, aR as InferQueryParams, aQ as InferQueryResponse, t as InferSingleton, I as InferSingletonContentType, au as QueryConfig, av as QueryDefinition, h as SchemaAssetTypeNames, S as SchemaConfig, b as SchemaContentTypeNames, a as SchemaDefinition, f as SchemaLocaleCodes, e as SchemaQueryNames, g as SchemaSettingsGroupNames, c as SchemaSingletonNames, ay as SearchBlock, aG as SelectMapping, A as SettingsGroupConfig, B as SettingsGroupDefinition, az as SimilarBlock, r as SingletonContentTypeDefinition, s as SingletonMetadata, aD as SortCondition, Y as VariantDefinition, $ as VideoCaptionsConfig, a0 as VideoDownloadConfig, V as VideoKindConfig, _ as VideoPosterConfig, Z as VideoUploadConfig, a1 as VideoWatermarkConfig, aA as WhereCondition, F as defineAssetType, u as defineComponent, at as defineQuery, d as defineSchema, z as defineSettingsGroup, q as defineSingleton, p as defineSingletonContentType } from './define-schema-2xbHgtK-.cjs';
|
|
7
8
|
export { n as BaseFieldConfig, x as ContentTypeConfig, y as ContentTypeConfigWithFields, z as ContentTypeConfigWithFieldsets, G as ContentTypeDefinition, H as EntryMetadata, c as FieldDefinition, b as FieldRule, o as FieldType, F as FieldUIConfig, w as Fieldset, J as InferContentType, K as LocalePublicationFields, L as LocalizationConfig, u as defineContentType, v as fieldset } from './define-content-type-CBfnTWSS.cjs';
|
|
9
|
+
import './dev-handshake/index.cjs';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Network-related errors
|
|
@@ -57,47 +59,6 @@ declare class InvalidApiKeyError extends SDKError {
|
|
|
57
59
|
getUserMessage(): string;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
/**
|
|
61
|
-
* Content and resource errors.
|
|
62
|
-
*
|
|
63
|
-
* `ContentTypeNotFoundError` and `ContentNotFoundError` were deleted at API5.
|
|
64
|
-
* The mapper reached them by sniffing `CONTENT_TYPE_NOT_FOUND` and
|
|
65
|
-
* `CONTENT_NOT_FOUND`, neither of which is in the closed vocabulary, so neither
|
|
66
|
-
* class was reachable. Both cases are `RESOURCE_NOT_FOUND`, whose declared
|
|
67
|
-
* `details` are `{ kind, id? }` — the same two facts, from the one code a route
|
|
68
|
-
* can actually declare.
|
|
69
|
-
*/
|
|
70
|
-
declare class ResourceNotFoundError extends SDKError {
|
|
71
|
-
readonly code = "RESOURCE_NOT_FOUND";
|
|
72
|
-
readonly retryable = false;
|
|
73
|
-
constructor(message?: string, statusCode?: number, cause?: Error, context?: Record<string, unknown>);
|
|
74
|
-
getUserMessage(): string;
|
|
75
|
-
}
|
|
76
|
-
declare class ResourceConflictError extends SDKError {
|
|
77
|
-
readonly code = "RESOURCE_CONFLICT";
|
|
78
|
-
readonly retryable = false;
|
|
79
|
-
constructor(message?: string, statusCode?: number, cause?: Error, context?: Record<string, unknown>);
|
|
80
|
-
getUserMessage(): string;
|
|
81
|
-
}
|
|
82
|
-
declare class ResourceExpiredError extends SDKError {
|
|
83
|
-
readonly code = "RESOURCE_EXPIRED";
|
|
84
|
-
readonly retryable = false;
|
|
85
|
-
constructor(message?: string, statusCode?: number, cause?: Error, context?: Record<string, unknown>);
|
|
86
|
-
getUserMessage(): string;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* "Did the service say this resource does not exist?"
|
|
90
|
-
*
|
|
91
|
-
* Reads the **code**, not the status. Four contract codes are 4xx on a read and
|
|
92
|
-
* only one of them means "not there"; the incumbent checked `statusCode === 404`
|
|
93
|
-
* on the thrown value, and a second arm duck-typed a plain object for the same
|
|
94
|
-
* number so a hand-written test double would pass. Both are the branch
|
|
95
|
-
* `INV-API-CLIENT-IS-DERIVED` forbids where a code exists — and the second one
|
|
96
|
-
* only existed because the tests faked the boundary (rule 20). They now stub
|
|
97
|
-
* `fetch`, so the double is gone with the branch.
|
|
98
|
-
*/
|
|
99
|
-
declare function isResourceNotFound(error: unknown): boolean;
|
|
100
|
-
|
|
101
62
|
/**
|
|
102
63
|
* One class per contract code that had none.
|
|
103
64
|
*
|
|
@@ -499,6 +460,130 @@ declare const localeHelpers: {
|
|
|
499
460
|
getAllLocalizedValues: typeof getAllLocalizedValues;
|
|
500
461
|
};
|
|
501
462
|
|
|
463
|
+
/**
|
|
464
|
+
* The DOM↔field binding contract, as the one pure helper that emits it.
|
|
465
|
+
*
|
|
466
|
+
* Spread onto the element that renders a field, it stamps which entry, content type, field and
|
|
467
|
+
* locale produced that element, so an editing surface can find the field by scanning the DOM
|
|
468
|
+
* rather than by guessing (`INV-TB-BINDING`). The contract is `toolbar-spec.md` §DOM↔field; this
|
|
469
|
+
* file is its only implementation.
|
|
470
|
+
*
|
|
471
|
+
* **Frozen** (`INV-SS-BINDING-FROZEN`). The attribute set is exactly the five below. Adding,
|
|
472
|
+
* renaming or dropping one is a new contract, and a new contract is a bump of `data-relyio-v` — a
|
|
473
|
+
* page built against version 1 keeps being read as version 1 by any surface that scans it.
|
|
474
|
+
*
|
|
475
|
+
* **Pure** (`INV-TB-SDK-PURE`). It reads the entry it is handed and returns attributes. It imports
|
|
476
|
+
* nothing but the SDK's own types: no realtime, no AI, no first-party code, no framework. That is
|
|
477
|
+
* what lets it live in the customer SDK and run on a server render as happily as in a browser.
|
|
478
|
+
*
|
|
479
|
+
* **Every value comes from the entry.** The id, the content type and the locale are the ones the
|
|
480
|
+
* API reported in `_metadata` — the locale is the one the payload's field values were composed
|
|
481
|
+
* for. There is deliberately no `locale` argument: a caller-supplied locale could bind a node to a
|
|
482
|
+
* locale whose value it is not rendering, which is the silently inferred binding `INV-TB-BINDING`
|
|
483
|
+
* forbids.
|
|
484
|
+
*/
|
|
485
|
+
|
|
486
|
+
/** The version of the binding contract this helper emits. */
|
|
487
|
+
declare const BINDING_VERSION = "1";
|
|
488
|
+
/** The attributes `relyioField` returns — the whole of binding contract version 1. */
|
|
489
|
+
interface RelyIOFieldAttributes {
|
|
490
|
+
/** The entry's id (`_metadata.id`). */
|
|
491
|
+
readonly 'data-relyio-entry': string;
|
|
492
|
+
/** The entry's content type (`_metadata.type`); every customer read is keyed by it. */
|
|
493
|
+
readonly 'data-relyio-type': string;
|
|
494
|
+
/** The field the element renders. */
|
|
495
|
+
readonly 'data-relyio-field': string;
|
|
496
|
+
/** The locale the entry's field values were composed for (`_metadata.locale`). */
|
|
497
|
+
readonly 'data-relyio-locale': string;
|
|
498
|
+
/** The binding contract's version. */
|
|
499
|
+
readonly 'data-relyio-v': typeof BINDING_VERSION;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* The field names `relyioField` accepts for an entry of type `T`.
|
|
503
|
+
*
|
|
504
|
+
* A schema-typed entry narrows to its declared field names, so they autocomplete and a misspelt
|
|
505
|
+
* one does not compile. An entry with no declared fields — `BaseContent`, which is what an
|
|
506
|
+
* un-generated client returns — has none to narrow to, and `keyof` of it is `never`; that would
|
|
507
|
+
* make the helper uncallable for every untyped customer, so it accepts any field name instead.
|
|
508
|
+
*/
|
|
509
|
+
type RelyIOFieldName<T extends BaseContent> = [Exclude<keyof T, '_metadata'>] extends [never] ? string : string & Exclude<keyof T, '_metadata'>;
|
|
510
|
+
/**
|
|
511
|
+
* Binding attributes for one field of one entry.
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* ```tsx
|
|
515
|
+
* import { relyioField } from '@relyio/sdk'
|
|
516
|
+
*
|
|
517
|
+
* <h1 {...relyioField(post, 'title')}>{post.title}</h1>
|
|
518
|
+
* // → data-relyio-entry="6710f…" data-relyio-type="post" data-relyio-field="title"
|
|
519
|
+
* // data-relyio-locale="en-US" data-relyio-v="1"
|
|
520
|
+
* ```
|
|
521
|
+
*
|
|
522
|
+
* @throws {TypeError} when the entry's `_metadata` lacks its id, content type or locale. Every
|
|
523
|
+
* entry the API returns carries all three, so this is reached only by a value that was not read
|
|
524
|
+
* from RelyIO. It throws rather than emitting a partial binding: a node stamped with no locale, or
|
|
525
|
+
* none at all, is a binding a surface would have to guess the rest of.
|
|
526
|
+
*/
|
|
527
|
+
declare function relyioField<T extends BaseContent>(entry: T, field: RelyIOFieldName<T>): RelyIOFieldAttributes;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* The DOM event a preview surface dispatches when content on the page has changed, and the one
|
|
531
|
+
* spelling of its name (`sdk-surfaces-spec.md` decision 23: the toolbar emits, the framework
|
|
532
|
+
* listens).
|
|
533
|
+
*
|
|
534
|
+
* It is the same kind of seam as the binding attributes beside it: a string both sides read from the
|
|
535
|
+
* core, so the preview toolbar needs no Next dependency and `@relyio/next`'s `<RelyIORefresh />`
|
|
536
|
+
* needs no toolbar dependency. Neither restates the name.
|
|
537
|
+
*
|
|
538
|
+
* **Dispatched on `window`.** Listeners subscribe with
|
|
539
|
+
* `window.addEventListener(RELYIO_CHANGE_EVENT, …)`; the toolbar renders inside a shadow root, and
|
|
540
|
+
* `window` is the one target both sides reach without knowing where the other is mounted.
|
|
541
|
+
*
|
|
542
|
+
* **The name is a wire contract.** A page can run a toolbar and a framework package released at
|
|
543
|
+
* different times, so renaming it silently disconnects them. The `detail` a dispatch carries is
|
|
544
|
+
* {@link RelyIOChangeDetail}; a listener that only refreshes reads none of it.
|
|
545
|
+
*/
|
|
546
|
+
declare const RELYIO_CHANGE_EVENT = "relyio:change";
|
|
547
|
+
/**
|
|
548
|
+
* The `detail` of a {@link RELYIO_CHANGE_EVENT} dispatch: the feed change that prompted it, as
|
|
549
|
+
* `relyio.changes()` yielded it — `{ entryId, contentType, locale, kind, cursor }`, ids and never a
|
|
550
|
+
* document (`INV-SS-CHANGE-IS-IDS`, decision 18).
|
|
551
|
+
*
|
|
552
|
+
* It **is** {@link Change}, not a restatement of it. That type is read from the committed API
|
|
553
|
+
* document, so the event's payload and the feed's item cannot drift; `change-event.types.ts` holds
|
|
554
|
+
* the two equal.
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* ```ts
|
|
558
|
+
* window.addEventListener(RELYIO_CHANGE_EVENT, event => {
|
|
559
|
+
* const change = (event as CustomEvent<RelyIOChangeDetail>).detail
|
|
560
|
+
* })
|
|
561
|
+
* ```
|
|
562
|
+
*/
|
|
563
|
+
type RelyIOChangeDetail = Change;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* The width ladder the delivery Worker snaps every rendered dimension to
|
|
567
|
+
* (`INV-SS-ONE-LADDER`, sdk-surfaces-spec decision 14).
|
|
568
|
+
*
|
|
569
|
+
* A dimension is clamped to a ceiling and snapped to a bucket, so "any width"
|
|
570
|
+
* cannot become "unboundedly many distinct transforms". A client that asks the
|
|
571
|
+
* Worker for `w=749` is served the `w=700` render anyway; snapping on this side
|
|
572
|
+
* first means an image loader emits the URL the edge cache already holds.
|
|
573
|
+
*
|
|
574
|
+
* This is a **copy**, and deliberately so: the core cannot import
|
|
575
|
+
* `@relyio/storage` or the Worker. `apps/edge/cdn/src/__tests__/ladder-parity.test.ts`
|
|
576
|
+
* holds the two equal — the constants, and what the Worker actually renders for
|
|
577
|
+
* a sweep of requested widths — so a divergence fails the gate rather than a
|
|
578
|
+
* cache.
|
|
579
|
+
*/
|
|
580
|
+
declare const IMAGE_LADDER: {
|
|
581
|
+
readonly maxDimension: 5000;
|
|
582
|
+
readonly bucket: 100;
|
|
583
|
+
};
|
|
584
|
+
/** Clamp to the ceiling, then snap to the nearest bucket — never below one bucket. */
|
|
585
|
+
declare function snapToLadder(value: number): number;
|
|
586
|
+
|
|
502
587
|
/**
|
|
503
588
|
* RelyIO SDK - Main Entry Point
|
|
504
589
|
*
|
|
@@ -535,4 +620,4 @@ declare const localeHelpers: {
|
|
|
535
620
|
|
|
536
621
|
declare const VERSION = "__VERSION__";
|
|
537
622
|
|
|
538
|
-
export { AuthenticationError, AuthorizationError, ConnectionError, ErrorMapper, InvalidApiKeyError, type LanguageSwitcherOption, type LanguageSwitcherOptions, type LocaleMetadata, type LocaleStatus, type LocalizedEntry, MethodNotAllowedError, MissingApiKeyError, NetworkError, PayloadTooLargeError, PlanFeatureUnavailableError, RateLimitError, ReadOnlyKeyError,
|
|
623
|
+
export { AuthenticationError, AuthorizationError, BaseContent, Change, ConnectionError, ErrorMapper, IMAGE_LADDER, InvalidApiKeyError, type LanguageSwitcherOption, type LanguageSwitcherOptions, type LocaleMetadata, type LocaleStatus, type LocalizedEntry, MethodNotAllowedError, MissingApiKeyError, NetworkError, PayloadTooLargeError, PlanFeatureUnavailableError, RELYIO_CHANGE_EVENT, RateLimitError, ReadOnlyKeyError, type RelyIOChangeDetail, type RelyIOFieldAttributes, type RelyIOFieldName, SDKError, ServerError, ServiceIndeterminateError, TimeoutError, TransactionRolledBackError, type TranslationCompleteness, UnknownContractError, UsageQuotaExceededError, VERSION, buildLanguageSwitcher, estimateTranslationCompleteness, getAllLocalizedValues, getAvailableLocaleCodes, getDefaultLocale, getFallbackFields, getFieldFallbackLocale, getLocalizedField, getPublishedLocaleCodes, getRequestedLocale, hasLocale, isFieldFallback, isPublishedInLocale, localeHelpers, needsTranslation, relyioField, snapToLadder };
|