@relyio/sdk 0.3.0 → 0.4.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.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkHMVGXUGR_cjs = require('./chunk-HMVGXUGR.cjs');
6
- var chunk54WP2PWG_cjs = require('./chunk-54WP2PWG.cjs');
5
+ var chunkHAQELDZN_cjs = require('./chunk-HAQELDZN.cjs');
6
+ var chunkXS32U2UP_cjs = require('./chunk-XS32U2UP.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 chunkHMVGXUGR_cjs.defineAssetType; }
194
+ get: function () { return chunkHAQELDZN_cjs.defineAssetType; }
154
195
  });
155
196
  Object.defineProperty(exports, "defineComponent", {
156
197
  enumerable: true,
157
- get: function () { return chunkHMVGXUGR_cjs.defineComponent; }
198
+ get: function () { return chunkHAQELDZN_cjs.defineComponent; }
158
199
  });
159
200
  Object.defineProperty(exports, "defineContentType", {
160
201
  enumerable: true,
161
- get: function () { return chunkHMVGXUGR_cjs.defineContentType; }
202
+ get: function () { return chunkHAQELDZN_cjs.defineContentType; }
162
203
  });
163
204
  Object.defineProperty(exports, "defineQuery", {
164
205
  enumerable: true,
165
- get: function () { return chunkHMVGXUGR_cjs.defineQuery; }
206
+ get: function () { return chunkHAQELDZN_cjs.defineQuery; }
166
207
  });
167
208
  Object.defineProperty(exports, "defineSchema", {
168
209
  enumerable: true,
169
- get: function () { return chunkHMVGXUGR_cjs.defineSchema; }
210
+ get: function () { return chunkHAQELDZN_cjs.defineSchema; }
170
211
  });
171
212
  Object.defineProperty(exports, "defineSettingsGroup", {
172
213
  enumerable: true,
173
- get: function () { return chunkHMVGXUGR_cjs.defineSettingsGroup; }
214
+ get: function () { return chunkHAQELDZN_cjs.defineSettingsGroup; }
174
215
  });
175
216
  Object.defineProperty(exports, "defineSingleton", {
176
217
  enumerable: true,
177
- get: function () { return chunkHMVGXUGR_cjs.defineSingleton; }
218
+ get: function () { return chunkHAQELDZN_cjs.defineSingleton; }
178
219
  });
179
220
  Object.defineProperty(exports, "defineSingletonContentType", {
180
221
  enumerable: true,
181
- get: function () { return chunkHMVGXUGR_cjs.defineSingletonContentType; }
222
+ get: function () { return chunkHAQELDZN_cjs.defineSingletonContentType; }
182
223
  });
183
224
  Object.defineProperty(exports, "fields", {
184
225
  enumerable: true,
185
- get: function () { return chunkHMVGXUGR_cjs.fields; }
226
+ get: function () { return chunkHAQELDZN_cjs.fields; }
186
227
  });
187
228
  Object.defineProperty(exports, "fieldset", {
188
229
  enumerable: true,
189
- get: function () { return chunkHMVGXUGR_cjs.fieldset; }
230
+ get: function () { return chunkHAQELDZN_cjs.fieldset; }
190
231
  });
191
232
  Object.defineProperty(exports, "AdhocQueryBuilder", {
192
233
  enumerable: true,
193
- get: function () { return chunk54WP2PWG_cjs.AdhocQueryBuilder; }
234
+ get: function () { return chunkXS32U2UP_cjs.AdhocQueryBuilder; }
194
235
  });
195
236
  Object.defineProperty(exports, "AdhocQueryClient", {
196
237
  enumerable: true,
197
- get: function () { return chunk54WP2PWG_cjs.AdhocQueryClient; }
238
+ get: function () { return chunkXS32U2UP_cjs.AdhocQueryClient; }
198
239
  });
199
240
  Object.defineProperty(exports, "AssetClient", {
200
241
  enumerable: true,
201
- get: function () { return chunk54WP2PWG_cjs.AssetClient; }
242
+ get: function () { return chunkXS32U2UP_cjs.AssetClient; }
202
243
  });
203
244
  Object.defineProperty(exports, "AssetFileBuilder", {
204
245
  enumerable: true,
205
- get: function () { return chunk54WP2PWG_cjs.AssetFileBuilder; }
246
+ get: function () { return chunkXS32U2UP_cjs.AssetFileBuilder; }
206
247
  });
207
248
  Object.defineProperty(exports, "AssetUploadBuilder", {
208
249
  enumerable: true,
209
- get: function () { return chunk54WP2PWG_cjs.AssetUploadBuilder; }
250
+ get: function () { return chunkXS32U2UP_cjs.AssetUploadBuilder; }
210
251
  });
211
252
  Object.defineProperty(exports, "AuthenticationError", {
212
253
  enumerable: true,
213
- get: function () { return chunk54WP2PWG_cjs.AuthenticationError; }
254
+ get: function () { return chunkXS32U2UP_cjs.AuthenticationError; }
214
255
  });
215
256
  Object.defineProperty(exports, "AuthorizationError", {
216
257
  enumerable: true,
217
- get: function () { return chunk54WP2PWG_cjs.AuthorizationError; }
258
+ get: function () { return chunkXS32U2UP_cjs.AuthorizationError; }
218
259
  });
219
260
  Object.defineProperty(exports, "AutocompleteBuilder", {
220
261
  enumerable: true,
221
- get: function () { return chunk54WP2PWG_cjs.AutocompleteBuilder; }
262
+ get: function () { return chunkXS32U2UP_cjs.AutocompleteBuilder; }
222
263
  });
223
264
  Object.defineProperty(exports, "BaseValidationError", {
224
265
  enumerable: true,
225
- get: function () { return chunk54WP2PWG_cjs.BaseValidationError; }
266
+ get: function () { return chunkXS32U2UP_cjs.BaseValidationError; }
226
267
  });
227
268
  Object.defineProperty(exports, "BatchBuilder", {
228
269
  enumerable: true,
229
- get: function () { return chunk54WP2PWG_cjs.BatchBuilder; }
270
+ get: function () { return chunkXS32U2UP_cjs.BatchBuilder; }
230
271
  });
231
272
  Object.defineProperty(exports, "BatchClient", {
232
273
  enumerable: true,
233
- get: function () { return chunk54WP2PWG_cjs.BatchClient; }
274
+ get: function () { return chunkXS32U2UP_cjs.BatchClient; }
275
+ });
276
+ Object.defineProperty(exports, "ChangesExpiredError", {
277
+ enumerable: true,
278
+ get: function () { return chunkXS32U2UP_cjs.ChangesExpiredError; }
234
279
  });
235
280
  Object.defineProperty(exports, "ConnectionError", {
236
281
  enumerable: true,
237
- get: function () { return chunk54WP2PWG_cjs.ConnectionError; }
282
+ get: function () { return chunkXS32U2UP_cjs.ConnectionError; }
238
283
  });
239
284
  Object.defineProperty(exports, "ContentByIdBuilder", {
240
285
  enumerable: true,
241
- get: function () { return chunk54WP2PWG_cjs.ContentByIdBuilder; }
286
+ get: function () { return chunkXS32U2UP_cjs.ContentByIdBuilder; }
242
287
  });
243
288
  Object.defineProperty(exports, "ContentClient", {
244
289
  enumerable: true,
245
- get: function () { return chunk54WP2PWG_cjs.ContentClient; }
290
+ get: function () { return chunkXS32U2UP_cjs.ContentClient; }
246
291
  });
247
292
  Object.defineProperty(exports, "ContentQueryBuilder", {
248
293
  enumerable: true,
249
- get: function () { return chunk54WP2PWG_cjs.ContentQueryBuilder; }
294
+ get: function () { return chunkXS32U2UP_cjs.ContentQueryBuilder; }
250
295
  });
251
296
  Object.defineProperty(exports, "ErrorMapper", {
252
297
  enumerable: true,
253
- get: function () { return chunk54WP2PWG_cjs.ErrorMapper; }
298
+ get: function () { return chunkXS32U2UP_cjs.ErrorMapper; }
254
299
  });
255
300
  Object.defineProperty(exports, "FileUploadError", {
256
301
  enumerable: true,
257
- get: function () { return chunk54WP2PWG_cjs.FileUploadError; }
302
+ get: function () { return chunkXS32U2UP_cjs.FileUploadError; }
258
303
  });
259
304
  Object.defineProperty(exports, "FileValidationError", {
260
305
  enumerable: true,
261
- get: function () { return chunk54WP2PWG_cjs.FileValidationError; }
306
+ get: function () { return chunkXS32U2UP_cjs.FileValidationError; }
262
307
  });
263
308
  Object.defineProperty(exports, "HttpClient", {
264
309
  enumerable: true,
265
- get: function () { return chunk54WP2PWG_cjs.HttpClient; }
310
+ get: function () { return chunkXS32U2UP_cjs.HttpClient; }
266
311
  });
267
312
  Object.defineProperty(exports, "InvalidApiKeyError", {
268
313
  enumerable: true,
269
- get: function () { return chunk54WP2PWG_cjs.InvalidApiKeyError; }
314
+ get: function () { return chunkXS32U2UP_cjs.InvalidApiKeyError; }
270
315
  });
271
316
  Object.defineProperty(exports, "InvalidFieldTypeError", {
272
317
  enumerable: true,
273
- get: function () { return chunk54WP2PWG_cjs.InvalidFieldTypeError; }
318
+ get: function () { return chunkXS32U2UP_cjs.InvalidFieldTypeError; }
274
319
  });
275
320
  Object.defineProperty(exports, "InvalidPayloadError", {
276
321
  enumerable: true,
277
- get: function () { return chunk54WP2PWG_cjs.InvalidPayloadError; }
322
+ get: function () { return chunkXS32U2UP_cjs.InvalidPayloadError; }
278
323
  });
279
324
  Object.defineProperty(exports, "MethodNotAllowedError", {
280
325
  enumerable: true,
281
- get: function () { return chunk54WP2PWG_cjs.MethodNotAllowedError; }
326
+ get: function () { return chunkXS32U2UP_cjs.MethodNotAllowedError; }
282
327
  });
283
328
  Object.defineProperty(exports, "MissingApiKeyError", {
284
329
  enumerable: true,
285
- get: function () { return chunk54WP2PWG_cjs.MissingApiKeyError; }
330
+ get: function () { return chunkXS32U2UP_cjs.MissingApiKeyError; }
286
331
  });
287
332
  Object.defineProperty(exports, "NetworkError", {
288
333
  enumerable: true,
289
- get: function () { return chunk54WP2PWG_cjs.NetworkError; }
334
+ get: function () { return chunkXS32U2UP_cjs.NetworkError; }
290
335
  });
291
336
  Object.defineProperty(exports, "PayloadTooLargeError", {
292
337
  enumerable: true,
293
- get: function () { return chunk54WP2PWG_cjs.PayloadTooLargeError; }
338
+ get: function () { return chunkXS32U2UP_cjs.PayloadTooLargeError; }
294
339
  });
295
340
  Object.defineProperty(exports, "PlanFeatureUnavailableError", {
296
341
  enumerable: true,
297
- get: function () { return chunk54WP2PWG_cjs.PlanFeatureUnavailableError; }
342
+ get: function () { return chunkXS32U2UP_cjs.PlanFeatureUnavailableError; }
298
343
  });
299
344
  Object.defineProperty(exports, "RateLimitError", {
300
345
  enumerable: true,
301
- get: function () { return chunk54WP2PWG_cjs.RateLimitError; }
346
+ get: function () { return chunkXS32U2UP_cjs.RateLimitError; }
302
347
  });
303
348
  Object.defineProperty(exports, "ReadOnlyKeyError", {
304
349
  enumerable: true,
305
- get: function () { return chunk54WP2PWG_cjs.ReadOnlyKeyError; }
350
+ get: function () { return chunkXS32U2UP_cjs.ReadOnlyKeyError; }
306
351
  });
307
352
  Object.defineProperty(exports, "RequiredFieldError", {
308
353
  enumerable: true,
309
- get: function () { return chunk54WP2PWG_cjs.RequiredFieldError; }
354
+ get: function () { return chunkXS32U2UP_cjs.RequiredFieldError; }
310
355
  });
311
356
  Object.defineProperty(exports, "ResourceConflictError", {
312
357
  enumerable: true,
313
- get: function () { return chunk54WP2PWG_cjs.ResourceConflictError; }
358
+ get: function () { return chunkXS32U2UP_cjs.ResourceConflictError; }
314
359
  });
315
360
  Object.defineProperty(exports, "ResourceExpiredError", {
316
361
  enumerable: true,
317
- get: function () { return chunk54WP2PWG_cjs.ResourceExpiredError; }
362
+ get: function () { return chunkXS32U2UP_cjs.ResourceExpiredError; }
318
363
  });
319
364
  Object.defineProperty(exports, "ResourceNotFoundError", {
320
365
  enumerable: true,
321
- get: function () { return chunk54WP2PWG_cjs.ResourceNotFoundError; }
366
+ get: function () { return chunkXS32U2UP_cjs.ResourceNotFoundError; }
322
367
  });
323
368
  Object.defineProperty(exports, "SDKError", {
324
369
  enumerable: true,
325
- get: function () { return chunk54WP2PWG_cjs.SDKError; }
370
+ get: function () { return chunkXS32U2UP_cjs.SDKError; }
326
371
  });
327
372
  Object.defineProperty(exports, "SchemaValidationError", {
328
373
  enumerable: true,
329
- get: function () { return chunk54WP2PWG_cjs.SchemaValidationError; }
374
+ get: function () { return chunkXS32U2UP_cjs.SchemaValidationError; }
330
375
  });
331
376
  Object.defineProperty(exports, "SearchBuilder", {
332
377
  enumerable: true,
333
- get: function () { return chunk54WP2PWG_cjs.SearchBuilder; }
378
+ get: function () { return chunkXS32U2UP_cjs.SearchBuilder; }
334
379
  });
335
380
  Object.defineProperty(exports, "SearchClient", {
336
381
  enumerable: true,
337
- get: function () { return chunk54WP2PWG_cjs.SearchClient; }
382
+ get: function () { return chunkXS32U2UP_cjs.SearchClient; }
338
383
  });
339
384
  Object.defineProperty(exports, "ServerError", {
340
385
  enumerable: true,
341
- get: function () { return chunk54WP2PWG_cjs.ServerError; }
386
+ get: function () { return chunkXS32U2UP_cjs.ServerError; }
342
387
  });
343
388
  Object.defineProperty(exports, "ServiceIndeterminateError", {
344
389
  enumerable: true,
345
- get: function () { return chunk54WP2PWG_cjs.ServiceIndeterminateError; }
390
+ get: function () { return chunkXS32U2UP_cjs.ServiceIndeterminateError; }
346
391
  });
347
392
  Object.defineProperty(exports, "SettingsClient", {
348
393
  enumerable: true,
349
- get: function () { return chunk54WP2PWG_cjs.SettingsClient; }
394
+ get: function () { return chunkXS32U2UP_cjs.SettingsClient; }
350
395
  });
351
396
  Object.defineProperty(exports, "SimilarBuilder", {
352
397
  enumerable: true,
353
- get: function () { return chunk54WP2PWG_cjs.SimilarBuilder; }
398
+ get: function () { return chunkXS32U2UP_cjs.SimilarBuilder; }
354
399
  });
355
400
  Object.defineProperty(exports, "SingletonClient", {
356
401
  enumerable: true,
357
- get: function () { return chunk54WP2PWG_cjs.SingletonClient; }
402
+ get: function () { return chunkXS32U2UP_cjs.SingletonClient; }
358
403
  });
359
404
  Object.defineProperty(exports, "TimeoutError", {
360
405
  enumerable: true,
361
- get: function () { return chunk54WP2PWG_cjs.TimeoutError; }
406
+ get: function () { return chunkXS32U2UP_cjs.TimeoutError; }
362
407
  });
363
408
  Object.defineProperty(exports, "TransactionRolledBackError", {
364
409
  enumerable: true,
365
- get: function () { return chunk54WP2PWG_cjs.TransactionRolledBackError; }
410
+ get: function () { return chunkXS32U2UP_cjs.TransactionRolledBackError; }
366
411
  });
367
412
  Object.defineProperty(exports, "TypedRelyIOClient", {
368
413
  enumerable: true,
369
- get: function () { return chunk54WP2PWG_cjs.TypedRelyIOClient; }
414
+ get: function () { return chunkXS32U2UP_cjs.TypedRelyIOClient; }
370
415
  });
371
416
  Object.defineProperty(exports, "UnknownContractError", {
372
417
  enumerable: true,
373
- get: function () { return chunk54WP2PWG_cjs.UnknownContractError; }
418
+ get: function () { return chunkXS32U2UP_cjs.UnknownContractError; }
374
419
  });
375
420
  Object.defineProperty(exports, "UsageQuotaExceededError", {
376
421
  enumerable: true,
377
- get: function () { return chunk54WP2PWG_cjs.UsageQuotaExceededError; }
422
+ get: function () { return chunkXS32U2UP_cjs.UsageQuotaExceededError; }
378
423
  });
379
424
  Object.defineProperty(exports, "ValidationError", {
380
425
  enumerable: true,
381
- get: function () { return chunk54WP2PWG_cjs.ValidationError; }
426
+ get: function () { return chunkXS32U2UP_cjs.ValidationError; }
382
427
  });
383
428
  Object.defineProperty(exports, "createClient", {
384
429
  enumerable: true,
385
- get: function () { return chunk54WP2PWG_cjs.createClient; }
430
+ get: function () { return chunkXS32U2UP_cjs.createClient; }
386
431
  });
387
432
  Object.defineProperty(exports, "default", {
388
433
  enumerable: true,
389
- get: function () { return chunk54WP2PWG_cjs.createClient; }
434
+ get: function () { return chunkXS32U2UP_cjs.createClient; }
390
435
  });
391
436
  Object.defineProperty(exports, "entityTagOf", {
392
437
  enumerable: true,
393
- get: function () { return chunk54WP2PWG_cjs.entityTagOf; }
438
+ get: function () { return chunkXS32U2UP_cjs.entityTagOf; }
394
439
  });
395
440
  Object.defineProperty(exports, "isAssetEntry", {
396
441
  enumerable: true,
397
- get: function () { return chunk54WP2PWG_cjs.isAssetEntry; }
442
+ get: function () { return chunkXS32U2UP_cjs.isAssetEntry; }
398
443
  });
399
444
  Object.defineProperty(exports, "isResourceNotFound", {
400
445
  enumerable: true,
401
- get: function () { return chunk54WP2PWG_cjs.isResourceNotFound; }
446
+ get: function () { return chunkXS32U2UP_cjs.isResourceNotFound; }
447
+ });
448
+ Object.defineProperty(exports, "matchRoute", {
449
+ enumerable: true,
450
+ get: function () { return chunkXS32U2UP_cjs.matchRoute; }
402
451
  });
403
452
  Object.defineProperty(exports, "validateFile", {
404
453
  enumerable: true,
405
- get: function () { return chunk54WP2PWG_cjs.validateFile; }
454
+ get: function () { return chunkXS32U2UP_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,9 +1,9 @@
1
- export { N as AdhocAggregateBlock, M as AdhocFetchBlock, L as AdhocQueryBuilder, K as AdhocQueryClient, W as AdhocQueryDefinition, X as AdhocQueryOptions, Z as AdhocQueryResult, P as AdhocSearchBlock, Q as AdhocSimilarBlock, O as AggregateMetric, _ as AssetClient, a8 as AssetEntryResponse, a5 as AssetFileBlock, $ as AssetFileBuilder, a6 as AssetFileExtracted, a0 as AssetUploadBuilder, a7 as AssetUrls, a2 as AssetVisibility, A as AutocompleteBuilder, t as AutocompleteResponse, s as AutocompleteSuggestion, y as BatchBuilder, B as BatchClient, z as BatchMethod, D as BatchOperation, G as BatchOperationResult, F as BatchOptions, J as BatchResponse, I as BatchSummary, j as ChildrenOptions, C as ClientSchema, b as ConditionalWriteOptions, ac as ConfirmInput, ad as ConfirmResult, i as ContentByIdBuilder, d as ContentClient, h as ContentQueryBuilder, ag as CreateAssetOptions, E as ExtendedQueryResult, a4 as FileBackend, am as FileErrorCode, a3 as FileStatus, an as FileUploadError, ap as FileValidationConstraints, ao as FileValidationError, U as FilterValue, V as FullTextConfig, H as HttpClient, ai as MultipartCreateResult, aj as MultipartPart, ak as MultipartTarget, a9 as PopulatedAssetReference, aa as PresignInput, ab as PresignResult, Y as QueryMetadata, ae as ResolveUrlInput, af as ResolveUrlResult, R as RetryableWriteOptions, n as SearchBuilder, m as SearchClient, x as SearchFields, w as SearchFilter, p as SearchMode, r as SearchResponse, q as SearchResultItem, S as SendOptions, g as SettingsClient, l as SettingsFetchOptions, o as SimilarBuilder, v as SimilarResponse, u as SimilarResult, f as SingletonClient, k as SingletonFetchOptions, a as TypedClientConfig, T as TypedRelyIOClient, al as UploadProgress, ah as WaitUntilReadyOptions, c as createClient, c as default, e as entityTagOf, a1 as isAssetEntry, aq as validateFile } from './index-BDpar3FO.cjs';
1
+ export { W as AdhocAggregateBlock, V as AdhocFetchBlock, U as AdhocQueryBuilder, Q as AdhocQueryClient, a0 as AdhocQueryDefinition, a1 as AdhocQueryOptions, a3 as AdhocQueryResult, Y as AdhocSearchBlock, Z as AdhocSimilarBlock, X as AggregateMetric, a4 as AssetClient, ae as AssetEntryResponse, ab as AssetFileBlock, a5 as AssetFileBuilder, ac as AssetFileExtracted, a6 as AssetUploadBuilder, ad as AssetUrls, a8 as AssetVisibility, A as AutocompleteBuilder, z as AutocompleteResponse, y as AutocompleteSuggestion, J as BatchBuilder, I as BatchClient, K as BatchMethod, L as BatchOperation, N as BatchOperationResult, M as BatchOptions, P as BatchResponse, O as BatchSummary, h as Change, g as ChangesExpiredError, j as ChangesExpiredReason, i as ChangesOptions, p as ChildrenOptions, C as ClientSchema, d as ConditionalWriteOptions, ai as ConfirmInput, aj as ConfirmResult, o as ContentByIdBuilder, k as ContentClient, n as ContentQueryBuilder, am as CreateAssetOptions, E as ExtendedQueryResult, aa as FileBackend, aw as FileErrorCode, a9 as FileStatus, ax as FileUploadError, az as FileValidationConstraints, ay as FileValidationError, _ as FilterValue, $ as FullTextConfig, H as HttpClient, ao as MultipartCreateResult, ap as MultipartPart, aq as MultipartTarget, af as PopulatedAssetReference, ag as PresignInput, ah as PresignResult, a2 as QueryMetadata, R as Register, b as RegisteredSchema, ak as ResolveUrlInput, al as ResolveUrlResult, at as ResourceConflictError, au as ResourceExpiredError, as as ResourceNotFoundError, f as RetryableWriteOptions, t as SearchBuilder, s as SearchClient, G as SearchFields, F as SearchFilter, v as SearchMode, x as SearchResponse, w as SearchResultItem, S as SendOptions, m as SettingsClient, r as SettingsFetchOptions, u as SimilarBuilder, D as SimilarResponse, B as SimilarResult, l as SingletonClient, q as SingletonFetchOptions, a as TypedClientConfig, T as TypedRelyIOClient, ar as UploadProgress, an as WaitUntilReadyOptions, c as createClient, c as default, e as entityTagOf, a7 as isAssetEntry, av as isResourceNotFound, aA as validateFile } from './index-BvO6HDtY.cjs';
2
2
  export { fields } from './schema/index.cjs';
3
- import { S as SDKError } from './index-ulOrcfPa.cjs';
4
- export { a as ApiMethod, A as ApiPath, r as ApiResponse, b as ApiSuccessBody, B as BaseContent, v as BaseValidationError, o as CacheConfig, t as CacheStrategy, f as ContentQueryResult, j as ContentTypeSchema, C as CreateInput, i as CustomQuery, D as DebugConfig, E as Environment, k as FieldOptions, F as FieldTypeName, z as InvalidFieldTypeError, I as InvalidPayloadError, L as LogLevel, P as PerformanceMetrics, Q as QueryOptions, p as RealtimeConfig, m as RealtimeEvent, l as RealtimeEventType, R as RelyIOConfig, q as RequestConfig, y as RequiredFieldError, s as RetryConfig, x as SchemaValidationError, h as SettingsGroup, g as SingletonContent, e as SortOptions, n as SubscriptionOptions, U as UpdateInput, w as ValidationError, V as ValidationRule, u as ValidationViolation, c as WhereClause, d as WhereOperator, W as Wire } from './index-ulOrcfPa.cjs';
3
+ import { S as SDKError, B as BaseContent } from './index-DFehx5sI.cjs';
4
+ 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-DFehx5sI.cjs';
5
5
  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-BfXeR6K8.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-2xbHgtK-.cjs';
7
7
  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';
8
8
 
9
9
  /**
@@ -57,47 +57,6 @@ declare class InvalidApiKeyError extends SDKError {
57
57
  getUserMessage(): string;
58
58
  }
59
59
 
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
60
  /**
102
61
  * One class per contract code that had none.
103
62
  *
@@ -499,6 +458,113 @@ declare const localeHelpers: {
499
458
  getAllLocalizedValues: typeof getAllLocalizedValues;
500
459
  };
501
460
 
461
+ /**
462
+ * The DOM↔field binding contract, as the one pure helper that emits it.
463
+ *
464
+ * Spread onto the element that renders a field, it stamps which entry, content type, field and
465
+ * locale produced that element, so an editing surface can find the field by scanning the DOM
466
+ * rather than by guessing (`INV-TB-BINDING`). The contract is `toolbar-spec.md` §DOM↔field; this
467
+ * file is its only implementation.
468
+ *
469
+ * **Frozen** (`INV-SS-BINDING-FROZEN`). The attribute set is exactly the five below. Adding,
470
+ * renaming or dropping one is a new contract, and a new contract is a bump of `data-relyio-v` — a
471
+ * page built against version 1 keeps being read as version 1 by any surface that scans it.
472
+ *
473
+ * **Pure** (`INV-TB-SDK-PURE`). It reads the entry it is handed and returns attributes. It imports
474
+ * nothing but the SDK's own types: no realtime, no AI, no first-party code, no framework. That is
475
+ * what lets it live in the customer SDK and run on a server render as happily as in a browser.
476
+ *
477
+ * **Every value comes from the entry.** The id, the content type and the locale are the ones the
478
+ * API reported in `_metadata` — the locale is the one the payload's field values were composed
479
+ * for. There is deliberately no `locale` argument: a caller-supplied locale could bind a node to a
480
+ * locale whose value it is not rendering, which is the silently inferred binding `INV-TB-BINDING`
481
+ * forbids.
482
+ */
483
+
484
+ /** The version of the binding contract this helper emits. */
485
+ declare const BINDING_VERSION = "1";
486
+ /** The attributes `relyioField` returns — the whole of binding contract version 1. */
487
+ interface RelyIOFieldAttributes {
488
+ /** The entry's id (`_metadata.id`). */
489
+ readonly 'data-relyio-entry': string;
490
+ /** The entry's content type (`_metadata.type`); every customer read is keyed by it. */
491
+ readonly 'data-relyio-type': string;
492
+ /** The field the element renders. */
493
+ readonly 'data-relyio-field': string;
494
+ /** The locale the entry's field values were composed for (`_metadata.locale`). */
495
+ readonly 'data-relyio-locale': string;
496
+ /** The binding contract's version. */
497
+ readonly 'data-relyio-v': typeof BINDING_VERSION;
498
+ }
499
+ /**
500
+ * The field names `relyioField` accepts for an entry of type `T`.
501
+ *
502
+ * A schema-typed entry narrows to its declared field names, so they autocomplete and a misspelt
503
+ * one does not compile. An entry with no declared fields — `BaseContent`, which is what an
504
+ * un-generated client returns — has none to narrow to, and `keyof` of it is `never`; that would
505
+ * make the helper uncallable for every untyped customer, so it accepts any field name instead.
506
+ */
507
+ type RelyIOFieldName<T extends BaseContent> = [Exclude<keyof T, '_metadata'>] extends [never] ? string : string & Exclude<keyof T, '_metadata'>;
508
+ /**
509
+ * Binding attributes for one field of one entry.
510
+ *
511
+ * @example
512
+ * ```tsx
513
+ * import { relyioField } from '@relyio/sdk'
514
+ *
515
+ * <h1 {...relyioField(post, 'title')}>{post.title}</h1>
516
+ * // → data-relyio-entry="6710f…" data-relyio-type="post" data-relyio-field="title"
517
+ * // data-relyio-locale="en-US" data-relyio-v="1"
518
+ * ```
519
+ *
520
+ * @throws {TypeError} when the entry's `_metadata` lacks its id, content type or locale. Every
521
+ * entry the API returns carries all three, so this is reached only by a value that was not read
522
+ * from RelyIO. It throws rather than emitting a partial binding: a node stamped with no locale, or
523
+ * none at all, is a binding a surface would have to guess the rest of.
524
+ */
525
+ declare function relyioField<T extends BaseContent>(entry: T, field: RelyIOFieldName<T>): RelyIOFieldAttributes;
526
+
527
+ /**
528
+ * The DOM event a preview surface dispatches when content on the page has changed, and the one
529
+ * spelling of its name (`sdk-surfaces-spec.md` decision 23: the toolbar emits, the framework
530
+ * listens).
531
+ *
532
+ * It is the same kind of seam as the binding attributes beside it: a string both sides read from the
533
+ * core, so the preview toolbar needs no Next dependency and `@relyio/next`'s `<RelyIORefresh />`
534
+ * needs no toolbar dependency. Neither restates the name.
535
+ *
536
+ * **Dispatched on `window`.** Listeners subscribe with
537
+ * `window.addEventListener(RELYIO_CHANGE_EVENT, …)`; the toolbar renders inside a shadow root, and
538
+ * `window` is the one target both sides reach without knowing where the other is mounted.
539
+ *
540
+ * **The name is a wire contract.** A page can run a toolbar and a framework package released at
541
+ * different times, so renaming it silently disconnects them. The `detail` a dispatch carries is
542
+ * the preview toolbar's to declare (SS4); a listener that only refreshes reads none of it.
543
+ */
544
+ declare const RELYIO_CHANGE_EVENT = "relyio:change";
545
+
546
+ /**
547
+ * The width ladder the delivery Worker snaps every rendered dimension to
548
+ * (`INV-SS-ONE-LADDER`, sdk-surfaces-spec decision 14).
549
+ *
550
+ * A dimension is clamped to a ceiling and snapped to a bucket, so "any width"
551
+ * cannot become "unboundedly many distinct transforms". A client that asks the
552
+ * Worker for `w=749` is served the `w=700` render anyway; snapping on this side
553
+ * first means an image loader emits the URL the edge cache already holds.
554
+ *
555
+ * This is a **copy**, and deliberately so: the core cannot import
556
+ * `@relyio/storage` or the Worker. `apps/edge/cdn/src/__tests__/ladder-parity.test.ts`
557
+ * holds the two equal — the constants, and what the Worker actually renders for
558
+ * a sweep of requested widths — so a divergence fails the gate rather than a
559
+ * cache.
560
+ */
561
+ declare const IMAGE_LADDER: {
562
+ readonly maxDimension: 5000;
563
+ readonly bucket: 100;
564
+ };
565
+ /** Clamp to the ceiling, then snap to the nearest bucket — never below one bucket. */
566
+ declare function snapToLadder(value: number): number;
567
+
502
568
  /**
503
569
  * RelyIO SDK - Main Entry Point
504
570
  *
@@ -535,4 +601,4 @@ declare const localeHelpers: {
535
601
 
536
602
  declare const VERSION = "__VERSION__";
537
603
 
538
- export { AuthenticationError, AuthorizationError, ConnectionError, ErrorMapper, InvalidApiKeyError, type LanguageSwitcherOption, type LanguageSwitcherOptions, type LocaleMetadata, type LocaleStatus, type LocalizedEntry, MethodNotAllowedError, MissingApiKeyError, NetworkError, PayloadTooLargeError, PlanFeatureUnavailableError, RateLimitError, ReadOnlyKeyError, ResourceConflictError, ResourceExpiredError, ResourceNotFoundError, SDKError, ServerError, ServiceIndeterminateError, TimeoutError, TransactionRolledBackError, type TranslationCompleteness, UnknownContractError, UsageQuotaExceededError, VERSION, buildLanguageSwitcher, estimateTranslationCompleteness, getAllLocalizedValues, getAvailableLocaleCodes, getDefaultLocale, getFallbackFields, getFieldFallbackLocale, getLocalizedField, getPublishedLocaleCodes, getRequestedLocale, hasLocale, isFieldFallback, isPublishedInLocale, isResourceNotFound, localeHelpers, needsTranslation };
604
+ export { AuthenticationError, AuthorizationError, BaseContent, 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 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 };