@relyio/sdk 0.5.0 → 0.6.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 +170 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/{chunk-5AZUUV5B.js → chunk-7ABNXVWL.js} +398 -184
- package/dist/{chunk-HAQELDZN.cjs → chunk-DY2XT7OF.cjs} +2 -2
- package/dist/{chunk-CIRT6TVT.cjs → chunk-GCMQUM6N.cjs} +400 -183
- package/dist/{chunk-XY5KFEFY.js → chunk-XJVY2CLY.js} +2 -2
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +1 -1
- package/dist/define-content-type-CDB3kyeA.d.cts +1173 -0
- package/dist/define-content-type-CDB3kyeA.d.ts +1173 -0
- package/dist/{define-schema-DzYXk4HL.d.ts → define-schema-1kr2HIzN.d.cts} +25 -347
- package/dist/{define-schema-2xbHgtK-.d.cts → define-schema-ChvAzY8H.d.ts} +25 -347
- package/dist/{index-BozPz4n1.d.cts → index-Df1VsfJR.d.cts} +233 -74
- package/dist/{index-Dzo-upNS.d.ts → index-XqoGUaAY.d.ts} +233 -74
- package/dist/{index-C5mRBb6t.d.cts → index-d1Kz1e19.d.cts} +62 -29
- package/dist/{index-mXUx2H99.d.ts → index-yPbhZc6q.d.ts} +62 -29
- package/dist/index.cjs +161 -68
- package/dist/index.d.cts +283 -8
- package/dist/index.d.ts +283 -8
- package/dist/index.js +90 -3
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +11 -7
- package/dist/schema/index.d.ts +11 -7
- package/dist/schema/index.js +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/define-content-type-CBfnTWSS.d.cts +0 -716
- package/dist/define-content-type-CBfnTWSS.d.ts +0 -716
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as EntryMetadata } from './define-content-type-CDB3kyeA.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Generated by scripts/emit-openapi-types.mjs from @relyio/api's committed
|
|
@@ -855,7 +855,7 @@ interface components {
|
|
|
855
855
|
ErrorResponse: {
|
|
856
856
|
error: {
|
|
857
857
|
/** @enum {string} */
|
|
858
|
-
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
858
|
+
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'ORGANIZATION_DELETE_BLOCKED' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
859
859
|
messages: string[];
|
|
860
860
|
details?: {
|
|
861
861
|
[key: string]: unknown;
|
|
@@ -1040,7 +1040,7 @@ interface components {
|
|
|
1040
1040
|
id?: string;
|
|
1041
1041
|
error: {
|
|
1042
1042
|
/** @enum {string} */
|
|
1043
|
-
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
1043
|
+
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'ORGANIZATION_DELETE_BLOCKED' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
1044
1044
|
messages: string[];
|
|
1045
1045
|
details?: {
|
|
1046
1046
|
[key: string]: unknown;
|
|
@@ -1572,7 +1572,6 @@ interface operations {
|
|
|
1572
1572
|
ETag?: string;
|
|
1573
1573
|
Vary?: string;
|
|
1574
1574
|
'X-Cache'?: string;
|
|
1575
|
-
'X-Cache-Key'?: string;
|
|
1576
1575
|
[name: string]: unknown;
|
|
1577
1576
|
};
|
|
1578
1577
|
content: {
|
|
@@ -1774,7 +1773,6 @@ interface operations {
|
|
|
1774
1773
|
ETag?: string;
|
|
1775
1774
|
Vary?: string;
|
|
1776
1775
|
'X-Cache'?: string;
|
|
1777
|
-
'X-Cache-Key'?: string;
|
|
1778
1776
|
'X-Entity-Tag'?: string;
|
|
1779
1777
|
[name: string]: unknown;
|
|
1780
1778
|
};
|
|
@@ -2084,7 +2082,6 @@ interface operations {
|
|
|
2084
2082
|
ETag?: string;
|
|
2085
2083
|
Vary?: string;
|
|
2086
2084
|
'X-Cache'?: string;
|
|
2087
|
-
'X-Cache-Key'?: string;
|
|
2088
2085
|
[name: string]: unknown;
|
|
2089
2086
|
};
|
|
2090
2087
|
content: {
|
|
@@ -3757,8 +3754,6 @@ interface operations {
|
|
|
3757
3754
|
headers: {
|
|
3758
3755
|
'Cache-Control'?: string;
|
|
3759
3756
|
Vary?: string;
|
|
3760
|
-
'X-Cache'?: string;
|
|
3761
|
-
'X-Cache-Key'?: string;
|
|
3762
3757
|
[name: string]: unknown;
|
|
3763
3758
|
};
|
|
3764
3759
|
content: {
|
|
@@ -3838,8 +3833,6 @@ interface operations {
|
|
|
3838
3833
|
headers: {
|
|
3839
3834
|
'Cache-Control'?: string;
|
|
3840
3835
|
Vary?: string;
|
|
3841
|
-
'X-Cache'?: string;
|
|
3842
|
-
'X-Cache-Key'?: string;
|
|
3843
3836
|
[name: string]: unknown;
|
|
3844
3837
|
};
|
|
3845
3838
|
content: {
|
|
@@ -3928,8 +3921,6 @@ interface operations {
|
|
|
3928
3921
|
headers: {
|
|
3929
3922
|
'Cache-Control'?: string;
|
|
3930
3923
|
Vary?: string;
|
|
3931
|
-
'X-Cache'?: string;
|
|
3932
|
-
'X-Cache-Key'?: string;
|
|
3933
3924
|
[name: string]: unknown;
|
|
3934
3925
|
};
|
|
3935
3926
|
content: {
|
|
@@ -4009,8 +4000,6 @@ interface operations {
|
|
|
4009
4000
|
headers: {
|
|
4010
4001
|
'Cache-Control'?: string;
|
|
4011
4002
|
Vary?: string;
|
|
4012
|
-
'X-Cache'?: string;
|
|
4013
|
-
'X-Cache-Key'?: string;
|
|
4014
4003
|
[name: string]: unknown;
|
|
4015
4004
|
};
|
|
4016
4005
|
content: {
|
|
@@ -4101,8 +4090,6 @@ interface operations {
|
|
|
4101
4090
|
headers: {
|
|
4102
4091
|
'Cache-Control'?: string;
|
|
4103
4092
|
Vary?: string;
|
|
4104
|
-
'X-Cache'?: string;
|
|
4105
|
-
'X-Cache-Key'?: string;
|
|
4106
4093
|
[name: string]: unknown;
|
|
4107
4094
|
};
|
|
4108
4095
|
content: {
|
|
@@ -4193,8 +4180,6 @@ interface operations {
|
|
|
4193
4180
|
headers: {
|
|
4194
4181
|
'Cache-Control'?: string;
|
|
4195
4182
|
Vary?: string;
|
|
4196
|
-
'X-Cache'?: string;
|
|
4197
|
-
'X-Cache-Key'?: string;
|
|
4198
4183
|
[name: string]: unknown;
|
|
4199
4184
|
};
|
|
4200
4185
|
content: {
|
|
@@ -4367,6 +4352,8 @@ interface operations {
|
|
|
4367
4352
|
/** @description Success. */
|
|
4368
4353
|
200: {
|
|
4369
4354
|
headers: {
|
|
4355
|
+
'Cache-Control'?: string;
|
|
4356
|
+
'X-Cache'?: string;
|
|
4370
4357
|
[name: string]: unknown;
|
|
4371
4358
|
};
|
|
4372
4359
|
content: {
|
|
@@ -4462,6 +4449,8 @@ interface operations {
|
|
|
4462
4449
|
/** @description Success. */
|
|
4463
4450
|
200: {
|
|
4464
4451
|
headers: {
|
|
4452
|
+
'Cache-Control'?: string;
|
|
4453
|
+
'X-Cache'?: string;
|
|
4465
4454
|
[name: string]: unknown;
|
|
4466
4455
|
};
|
|
4467
4456
|
content: {
|
|
@@ -4551,6 +4540,8 @@ interface operations {
|
|
|
4551
4540
|
/** @description Success. */
|
|
4552
4541
|
200: {
|
|
4553
4542
|
headers: {
|
|
4543
|
+
'Cache-Control'?: string;
|
|
4544
|
+
'X-Cache'?: string;
|
|
4554
4545
|
[name: string]: unknown;
|
|
4555
4546
|
};
|
|
4556
4547
|
content: {
|
|
@@ -4631,6 +4622,8 @@ interface operations {
|
|
|
4631
4622
|
/** @description Success. */
|
|
4632
4623
|
200: {
|
|
4633
4624
|
headers: {
|
|
4625
|
+
'Cache-Control'?: string;
|
|
4626
|
+
'X-Cache'?: string;
|
|
4634
4627
|
[name: string]: unknown;
|
|
4635
4628
|
};
|
|
4636
4629
|
content: {
|
|
@@ -4724,7 +4717,6 @@ interface operations {
|
|
|
4724
4717
|
ETag?: string;
|
|
4725
4718
|
Vary?: string;
|
|
4726
4719
|
'X-Cache'?: string;
|
|
4727
|
-
'X-Cache-Key'?: string;
|
|
4728
4720
|
[name: string]: unknown;
|
|
4729
4721
|
};
|
|
4730
4722
|
content: {
|
|
@@ -4808,7 +4800,6 @@ interface operations {
|
|
|
4808
4800
|
ETag?: string;
|
|
4809
4801
|
Vary?: string;
|
|
4810
4802
|
'X-Cache'?: string;
|
|
4811
|
-
'X-Cache-Key'?: string;
|
|
4812
4803
|
'X-Entity-Tag'?: string;
|
|
4813
4804
|
[name: string]: unknown;
|
|
4814
4805
|
};
|
|
@@ -5385,7 +5376,6 @@ interface operations {
|
|
|
5385
5376
|
ETag?: string;
|
|
5386
5377
|
Vary?: string;
|
|
5387
5378
|
'X-Cache'?: string;
|
|
5388
|
-
'X-Cache-Key'?: string;
|
|
5389
5379
|
'X-Entity-Tag'?: string;
|
|
5390
5380
|
[name: string]: unknown;
|
|
5391
5381
|
};
|
|
@@ -5961,7 +5951,14 @@ declare function matchRoute(url: string | URL, options?: MatchRouteOptions): Rou
|
|
|
5961
5951
|
*/
|
|
5962
5952
|
|
|
5963
5953
|
interface RelyIOConfig {
|
|
5964
|
-
/**
|
|
5954
|
+
/**
|
|
5955
|
+
* API key for authentication, sent as `X-API-Key`.
|
|
5956
|
+
*
|
|
5957
|
+
* Required by every request, not by construction: a client built without one — a module-scope
|
|
5958
|
+
* client whose `process.env` variable is unset during a build — constructs, and each request it
|
|
5959
|
+
* makes rejects with `MissingApiKeyError` before anything is sent. Under `relyio dev` the
|
|
5960
|
+
* sandbox's key is used instead, so none need be configured.
|
|
5961
|
+
*/
|
|
5965
5962
|
apiKey: string;
|
|
5966
5963
|
/** Base URL for the RelyIO API */
|
|
5967
5964
|
baseUrl?: string;
|
|
@@ -6142,7 +6139,19 @@ interface ApiResponse<T = unknown> {
|
|
|
6142
6139
|
};
|
|
6143
6140
|
}
|
|
6144
6141
|
interface BrowserConfig {
|
|
6145
|
-
/**
|
|
6142
|
+
/**
|
|
6143
|
+
* Whether requests the client sends from a web page carry the browser's cookies to another
|
|
6144
|
+
* origin (defaults to `true`).
|
|
6145
|
+
*
|
|
6146
|
+
* `true` sends every request with `credentials: 'include'`. `false` sends it with
|
|
6147
|
+
* `credentials: 'same-origin'`: nothing to another origin, and a same-origin request — the API
|
|
6148
|
+
* behind a proxy on your own host — sent as the platform's own `fetch` would send it. The RelyIO
|
|
6149
|
+
* API authenticates with your API key and reads no cookie, so `false` changes nothing it
|
|
6150
|
+
* answers.
|
|
6151
|
+
*
|
|
6152
|
+
* Applied only where `window` exists. On a server, in an edge runtime or in a Web Worker the
|
|
6153
|
+
* client sets no `credentials` mode at all, whatever this says.
|
|
6154
|
+
*/
|
|
6146
6155
|
includeCredentials?: boolean;
|
|
6147
6156
|
/** Whether to use relative URLs for same-origin requests (defaults to false) */
|
|
6148
6157
|
useRelativeUrls?: boolean;
|
|
@@ -6221,7 +6230,12 @@ interface ValidationViolation {
|
|
|
6221
6230
|
declare abstract class BaseValidationError extends SDKError {
|
|
6222
6231
|
readonly retryable = false;
|
|
6223
6232
|
readonly violations: ValidationViolation[];
|
|
6224
|
-
|
|
6233
|
+
/**
|
|
6234
|
+
* @param context - Carried beside `violations`. The mapper passes the refusal body as
|
|
6235
|
+
* `context.response`, as it does for every other contract code, so a consumer that hands the
|
|
6236
|
+
* service's own words on can read them here too.
|
|
6237
|
+
*/
|
|
6238
|
+
constructor(message?: string, violations?: ValidationViolation[], statusCode?: number, cause?: Error, context?: Record<string, unknown>);
|
|
6225
6239
|
getUserMessage(): string;
|
|
6226
6240
|
/**
|
|
6227
6241
|
* Get violations for a specific field
|
|
@@ -6241,7 +6255,7 @@ declare class ValidationError extends BaseValidationError {
|
|
|
6241
6255
|
}
|
|
6242
6256
|
declare class InvalidPayloadError extends BaseValidationError {
|
|
6243
6257
|
readonly code = "INVALID_PAYLOAD";
|
|
6244
|
-
constructor(message?: string, violations?: ValidationViolation[], cause?: Error);
|
|
6258
|
+
constructor(message?: string, violations?: ValidationViolation[], cause?: Error, context?: Record<string, unknown>);
|
|
6245
6259
|
getUserMessage(): string;
|
|
6246
6260
|
}
|
|
6247
6261
|
declare class SchemaValidationError extends BaseValidationError {
|
|
@@ -6285,13 +6299,32 @@ interface BaseContent {
|
|
|
6285
6299
|
sourceDatasetId?: string;
|
|
6286
6300
|
};
|
|
6287
6301
|
}
|
|
6302
|
+
/**
|
|
6303
|
+
* The value a `where` condition compares a field against: one of the values the field holds.
|
|
6304
|
+
*
|
|
6305
|
+
* Not the field's read type. The REST dialect (`fromRestWhere` in `@relyio/entry-reads`) reads a
|
|
6306
|
+
* bare value as `eq`, an array as `in` and an object as operators — refusing an object with none —
|
|
6307
|
+
* and drops `null`. So a list field (`tags`) is matched by one of its items, a reference by the
|
|
6308
|
+
* target's id, and a component or an expanded entry is never a value to send.
|
|
6309
|
+
*/
|
|
6310
|
+
type WhereScalar<V> = Exclude<V extends readonly (infer Item)[] ? Item : V, null | undefined | object>;
|
|
6311
|
+
/** One field's condition: a value (`eq`), a list of values (`in`), or operators. */
|
|
6312
|
+
type WhereFieldCondition<V> = WhereScalar<V> | WhereScalar<V>[] | WhereOperator<WhereScalar<V>>;
|
|
6288
6313
|
/**
|
|
6289
6314
|
* Query conditions for filtering content
|
|
6290
6315
|
* Supports both content fields and metadata fields
|
|
6316
|
+
*
|
|
6317
|
+
* Typed by the content type's fields where a schema types the client: each key is a declared field
|
|
6318
|
+
* and each value one of that field's values. Untyped (`BaseContent`, which declares no fields), any
|
|
6319
|
+
* field name is accepted — nothing declares which exist.
|
|
6291
6320
|
*/
|
|
6292
|
-
type WhereClause<T extends BaseContent = BaseContent> =
|
|
6293
|
-
|
|
6294
|
-
|
|
6321
|
+
type WhereClause<T extends BaseContent = BaseContent> = ([
|
|
6322
|
+
Exclude<keyof T, '_metadata'>
|
|
6323
|
+
] extends [never] ? {
|
|
6324
|
+
[field: string]: unknown;
|
|
6325
|
+
} : {
|
|
6326
|
+
[K in Exclude<keyof T, '_metadata'>]?: WhereFieldCondition<T[K]>;
|
|
6327
|
+
}) & {
|
|
6295
6328
|
/** Metadata field conditions */
|
|
6296
6329
|
_metadata?: {
|
|
6297
6330
|
[K in keyof T['_metadata']]?: T['_metadata'][K] | WhereOperator<T['_metadata'][K]>;
|
|
@@ -6570,4 +6603,4 @@ interface PerformanceMetrics {
|
|
|
6570
6603
|
cacheHitRatio?: number;
|
|
6571
6604
|
}
|
|
6572
6605
|
|
|
6573
|
-
export { type ApiPath as A, type BaseContent as B, type CreateInput as C, type DebugConfig as D, type Environment as E, type FieldTypeName as F,
|
|
6606
|
+
export { type ApiPath as A, type BaseContent as B, type CreateInput as C, type DebugConfig as D, type Environment as E, type FieldTypeName as F, ValidationError as G, SchemaValidationError as H, InvalidPayloadError as I, RequiredFieldError as J, InvalidFieldTypeError as K, type LogLevel as L, type MatchRouteOptions as M, type MergedRelyIOConfig as N, type PathParamsOf as O, type PerformanceMetrics as P, type QueryOptions as Q, type RelyIOConfig as R, SDKError as S, type components as T, type UpdateInput as U, type ValidationRule as V, type Wire as W, type paths as X, type FieldDefinition as Y, type ApiMethod as a, type ApiSuccessBody as b, type RouteMatch as c, type WhereScalar as d, type WhereFieldCondition as e, type WhereClause as f, type WhereOperator as g, type SortOptions as h, type ContentQueryResult as i, type SingletonContent as j, type SettingsGroup as k, type CustomQuery as l, matchRoute as m, type ContentTypeSchema as n, type FieldOptions as o, type RealtimeEventType as p, type RealtimeEvent as q, type SubscriptionOptions as r, type CacheConfig as s, type RealtimeConfig as t, type RequestConfig as u, type ApiResponse as v, type RetryConfig as w, type CacheStrategy as x, type ValidationViolation as y, BaseValidationError as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as EntryMetadata } from './define-content-type-CDB3kyeA.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Generated by scripts/emit-openapi-types.mjs from @relyio/api's committed
|
|
@@ -855,7 +855,7 @@ interface components {
|
|
|
855
855
|
ErrorResponse: {
|
|
856
856
|
error: {
|
|
857
857
|
/** @enum {string} */
|
|
858
|
-
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
858
|
+
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'ORGANIZATION_DELETE_BLOCKED' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
859
859
|
messages: string[];
|
|
860
860
|
details?: {
|
|
861
861
|
[key: string]: unknown;
|
|
@@ -1040,7 +1040,7 @@ interface components {
|
|
|
1040
1040
|
id?: string;
|
|
1041
1041
|
error: {
|
|
1042
1042
|
/** @enum {string} */
|
|
1043
|
-
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
1043
|
+
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'ORGANIZATION_DELETE_BLOCKED' | 'PAYLOAD_TOO_LARGE' | 'PLAN_DOWNGRADE_BLOCKED' | 'PLAN_FEATURE_UNAVAILABLE' | 'RATE_LIMIT_EXCEEDED' | 'READ_ONLY_KEY' | 'REQUEST_INVALID' | 'REQUEST_TIMEOUT' | 'RESOURCE_CONFLICT' | 'RESOURCE_EXPIRED' | 'RESOURCE_NOT_FOUND' | 'REVERIFICATION_REQUIRED' | 'SERVICE_INDETERMINATE' | 'TRANSACTION_ROLLED_BACK' | 'USAGE_QUOTA_EXCEEDED';
|
|
1044
1044
|
messages: string[];
|
|
1045
1045
|
details?: {
|
|
1046
1046
|
[key: string]: unknown;
|
|
@@ -1572,7 +1572,6 @@ interface operations {
|
|
|
1572
1572
|
ETag?: string;
|
|
1573
1573
|
Vary?: string;
|
|
1574
1574
|
'X-Cache'?: string;
|
|
1575
|
-
'X-Cache-Key'?: string;
|
|
1576
1575
|
[name: string]: unknown;
|
|
1577
1576
|
};
|
|
1578
1577
|
content: {
|
|
@@ -1774,7 +1773,6 @@ interface operations {
|
|
|
1774
1773
|
ETag?: string;
|
|
1775
1774
|
Vary?: string;
|
|
1776
1775
|
'X-Cache'?: string;
|
|
1777
|
-
'X-Cache-Key'?: string;
|
|
1778
1776
|
'X-Entity-Tag'?: string;
|
|
1779
1777
|
[name: string]: unknown;
|
|
1780
1778
|
};
|
|
@@ -2084,7 +2082,6 @@ interface operations {
|
|
|
2084
2082
|
ETag?: string;
|
|
2085
2083
|
Vary?: string;
|
|
2086
2084
|
'X-Cache'?: string;
|
|
2087
|
-
'X-Cache-Key'?: string;
|
|
2088
2085
|
[name: string]: unknown;
|
|
2089
2086
|
};
|
|
2090
2087
|
content: {
|
|
@@ -3757,8 +3754,6 @@ interface operations {
|
|
|
3757
3754
|
headers: {
|
|
3758
3755
|
'Cache-Control'?: string;
|
|
3759
3756
|
Vary?: string;
|
|
3760
|
-
'X-Cache'?: string;
|
|
3761
|
-
'X-Cache-Key'?: string;
|
|
3762
3757
|
[name: string]: unknown;
|
|
3763
3758
|
};
|
|
3764
3759
|
content: {
|
|
@@ -3838,8 +3833,6 @@ interface operations {
|
|
|
3838
3833
|
headers: {
|
|
3839
3834
|
'Cache-Control'?: string;
|
|
3840
3835
|
Vary?: string;
|
|
3841
|
-
'X-Cache'?: string;
|
|
3842
|
-
'X-Cache-Key'?: string;
|
|
3843
3836
|
[name: string]: unknown;
|
|
3844
3837
|
};
|
|
3845
3838
|
content: {
|
|
@@ -3928,8 +3921,6 @@ interface operations {
|
|
|
3928
3921
|
headers: {
|
|
3929
3922
|
'Cache-Control'?: string;
|
|
3930
3923
|
Vary?: string;
|
|
3931
|
-
'X-Cache'?: string;
|
|
3932
|
-
'X-Cache-Key'?: string;
|
|
3933
3924
|
[name: string]: unknown;
|
|
3934
3925
|
};
|
|
3935
3926
|
content: {
|
|
@@ -4009,8 +4000,6 @@ interface operations {
|
|
|
4009
4000
|
headers: {
|
|
4010
4001
|
'Cache-Control'?: string;
|
|
4011
4002
|
Vary?: string;
|
|
4012
|
-
'X-Cache'?: string;
|
|
4013
|
-
'X-Cache-Key'?: string;
|
|
4014
4003
|
[name: string]: unknown;
|
|
4015
4004
|
};
|
|
4016
4005
|
content: {
|
|
@@ -4101,8 +4090,6 @@ interface operations {
|
|
|
4101
4090
|
headers: {
|
|
4102
4091
|
'Cache-Control'?: string;
|
|
4103
4092
|
Vary?: string;
|
|
4104
|
-
'X-Cache'?: string;
|
|
4105
|
-
'X-Cache-Key'?: string;
|
|
4106
4093
|
[name: string]: unknown;
|
|
4107
4094
|
};
|
|
4108
4095
|
content: {
|
|
@@ -4193,8 +4180,6 @@ interface operations {
|
|
|
4193
4180
|
headers: {
|
|
4194
4181
|
'Cache-Control'?: string;
|
|
4195
4182
|
Vary?: string;
|
|
4196
|
-
'X-Cache'?: string;
|
|
4197
|
-
'X-Cache-Key'?: string;
|
|
4198
4183
|
[name: string]: unknown;
|
|
4199
4184
|
};
|
|
4200
4185
|
content: {
|
|
@@ -4367,6 +4352,8 @@ interface operations {
|
|
|
4367
4352
|
/** @description Success. */
|
|
4368
4353
|
200: {
|
|
4369
4354
|
headers: {
|
|
4355
|
+
'Cache-Control'?: string;
|
|
4356
|
+
'X-Cache'?: string;
|
|
4370
4357
|
[name: string]: unknown;
|
|
4371
4358
|
};
|
|
4372
4359
|
content: {
|
|
@@ -4462,6 +4449,8 @@ interface operations {
|
|
|
4462
4449
|
/** @description Success. */
|
|
4463
4450
|
200: {
|
|
4464
4451
|
headers: {
|
|
4452
|
+
'Cache-Control'?: string;
|
|
4453
|
+
'X-Cache'?: string;
|
|
4465
4454
|
[name: string]: unknown;
|
|
4466
4455
|
};
|
|
4467
4456
|
content: {
|
|
@@ -4551,6 +4540,8 @@ interface operations {
|
|
|
4551
4540
|
/** @description Success. */
|
|
4552
4541
|
200: {
|
|
4553
4542
|
headers: {
|
|
4543
|
+
'Cache-Control'?: string;
|
|
4544
|
+
'X-Cache'?: string;
|
|
4554
4545
|
[name: string]: unknown;
|
|
4555
4546
|
};
|
|
4556
4547
|
content: {
|
|
@@ -4631,6 +4622,8 @@ interface operations {
|
|
|
4631
4622
|
/** @description Success. */
|
|
4632
4623
|
200: {
|
|
4633
4624
|
headers: {
|
|
4625
|
+
'Cache-Control'?: string;
|
|
4626
|
+
'X-Cache'?: string;
|
|
4634
4627
|
[name: string]: unknown;
|
|
4635
4628
|
};
|
|
4636
4629
|
content: {
|
|
@@ -4724,7 +4717,6 @@ interface operations {
|
|
|
4724
4717
|
ETag?: string;
|
|
4725
4718
|
Vary?: string;
|
|
4726
4719
|
'X-Cache'?: string;
|
|
4727
|
-
'X-Cache-Key'?: string;
|
|
4728
4720
|
[name: string]: unknown;
|
|
4729
4721
|
};
|
|
4730
4722
|
content: {
|
|
@@ -4808,7 +4800,6 @@ interface operations {
|
|
|
4808
4800
|
ETag?: string;
|
|
4809
4801
|
Vary?: string;
|
|
4810
4802
|
'X-Cache'?: string;
|
|
4811
|
-
'X-Cache-Key'?: string;
|
|
4812
4803
|
'X-Entity-Tag'?: string;
|
|
4813
4804
|
[name: string]: unknown;
|
|
4814
4805
|
};
|
|
@@ -5385,7 +5376,6 @@ interface operations {
|
|
|
5385
5376
|
ETag?: string;
|
|
5386
5377
|
Vary?: string;
|
|
5387
5378
|
'X-Cache'?: string;
|
|
5388
|
-
'X-Cache-Key'?: string;
|
|
5389
5379
|
'X-Entity-Tag'?: string;
|
|
5390
5380
|
[name: string]: unknown;
|
|
5391
5381
|
};
|
|
@@ -5961,7 +5951,14 @@ declare function matchRoute(url: string | URL, options?: MatchRouteOptions): Rou
|
|
|
5961
5951
|
*/
|
|
5962
5952
|
|
|
5963
5953
|
interface RelyIOConfig {
|
|
5964
|
-
/**
|
|
5954
|
+
/**
|
|
5955
|
+
* API key for authentication, sent as `X-API-Key`.
|
|
5956
|
+
*
|
|
5957
|
+
* Required by every request, not by construction: a client built without one — a module-scope
|
|
5958
|
+
* client whose `process.env` variable is unset during a build — constructs, and each request it
|
|
5959
|
+
* makes rejects with `MissingApiKeyError` before anything is sent. Under `relyio dev` the
|
|
5960
|
+
* sandbox's key is used instead, so none need be configured.
|
|
5961
|
+
*/
|
|
5965
5962
|
apiKey: string;
|
|
5966
5963
|
/** Base URL for the RelyIO API */
|
|
5967
5964
|
baseUrl?: string;
|
|
@@ -6142,7 +6139,19 @@ interface ApiResponse<T = unknown> {
|
|
|
6142
6139
|
};
|
|
6143
6140
|
}
|
|
6144
6141
|
interface BrowserConfig {
|
|
6145
|
-
/**
|
|
6142
|
+
/**
|
|
6143
|
+
* Whether requests the client sends from a web page carry the browser's cookies to another
|
|
6144
|
+
* origin (defaults to `true`).
|
|
6145
|
+
*
|
|
6146
|
+
* `true` sends every request with `credentials: 'include'`. `false` sends it with
|
|
6147
|
+
* `credentials: 'same-origin'`: nothing to another origin, and a same-origin request — the API
|
|
6148
|
+
* behind a proxy on your own host — sent as the platform's own `fetch` would send it. The RelyIO
|
|
6149
|
+
* API authenticates with your API key and reads no cookie, so `false` changes nothing it
|
|
6150
|
+
* answers.
|
|
6151
|
+
*
|
|
6152
|
+
* Applied only where `window` exists. On a server, in an edge runtime or in a Web Worker the
|
|
6153
|
+
* client sets no `credentials` mode at all, whatever this says.
|
|
6154
|
+
*/
|
|
6146
6155
|
includeCredentials?: boolean;
|
|
6147
6156
|
/** Whether to use relative URLs for same-origin requests (defaults to false) */
|
|
6148
6157
|
useRelativeUrls?: boolean;
|
|
@@ -6221,7 +6230,12 @@ interface ValidationViolation {
|
|
|
6221
6230
|
declare abstract class BaseValidationError extends SDKError {
|
|
6222
6231
|
readonly retryable = false;
|
|
6223
6232
|
readonly violations: ValidationViolation[];
|
|
6224
|
-
|
|
6233
|
+
/**
|
|
6234
|
+
* @param context - Carried beside `violations`. The mapper passes the refusal body as
|
|
6235
|
+
* `context.response`, as it does for every other contract code, so a consumer that hands the
|
|
6236
|
+
* service's own words on can read them here too.
|
|
6237
|
+
*/
|
|
6238
|
+
constructor(message?: string, violations?: ValidationViolation[], statusCode?: number, cause?: Error, context?: Record<string, unknown>);
|
|
6225
6239
|
getUserMessage(): string;
|
|
6226
6240
|
/**
|
|
6227
6241
|
* Get violations for a specific field
|
|
@@ -6241,7 +6255,7 @@ declare class ValidationError extends BaseValidationError {
|
|
|
6241
6255
|
}
|
|
6242
6256
|
declare class InvalidPayloadError extends BaseValidationError {
|
|
6243
6257
|
readonly code = "INVALID_PAYLOAD";
|
|
6244
|
-
constructor(message?: string, violations?: ValidationViolation[], cause?: Error);
|
|
6258
|
+
constructor(message?: string, violations?: ValidationViolation[], cause?: Error, context?: Record<string, unknown>);
|
|
6245
6259
|
getUserMessage(): string;
|
|
6246
6260
|
}
|
|
6247
6261
|
declare class SchemaValidationError extends BaseValidationError {
|
|
@@ -6285,13 +6299,32 @@ interface BaseContent {
|
|
|
6285
6299
|
sourceDatasetId?: string;
|
|
6286
6300
|
};
|
|
6287
6301
|
}
|
|
6302
|
+
/**
|
|
6303
|
+
* The value a `where` condition compares a field against: one of the values the field holds.
|
|
6304
|
+
*
|
|
6305
|
+
* Not the field's read type. The REST dialect (`fromRestWhere` in `@relyio/entry-reads`) reads a
|
|
6306
|
+
* bare value as `eq`, an array as `in` and an object as operators — refusing an object with none —
|
|
6307
|
+
* and drops `null`. So a list field (`tags`) is matched by one of its items, a reference by the
|
|
6308
|
+
* target's id, and a component or an expanded entry is never a value to send.
|
|
6309
|
+
*/
|
|
6310
|
+
type WhereScalar<V> = Exclude<V extends readonly (infer Item)[] ? Item : V, null | undefined | object>;
|
|
6311
|
+
/** One field's condition: a value (`eq`), a list of values (`in`), or operators. */
|
|
6312
|
+
type WhereFieldCondition<V> = WhereScalar<V> | WhereScalar<V>[] | WhereOperator<WhereScalar<V>>;
|
|
6288
6313
|
/**
|
|
6289
6314
|
* Query conditions for filtering content
|
|
6290
6315
|
* Supports both content fields and metadata fields
|
|
6316
|
+
*
|
|
6317
|
+
* Typed by the content type's fields where a schema types the client: each key is a declared field
|
|
6318
|
+
* and each value one of that field's values. Untyped (`BaseContent`, which declares no fields), any
|
|
6319
|
+
* field name is accepted — nothing declares which exist.
|
|
6291
6320
|
*/
|
|
6292
|
-
type WhereClause<T extends BaseContent = BaseContent> =
|
|
6293
|
-
|
|
6294
|
-
|
|
6321
|
+
type WhereClause<T extends BaseContent = BaseContent> = ([
|
|
6322
|
+
Exclude<keyof T, '_metadata'>
|
|
6323
|
+
] extends [never] ? {
|
|
6324
|
+
[field: string]: unknown;
|
|
6325
|
+
} : {
|
|
6326
|
+
[K in Exclude<keyof T, '_metadata'>]?: WhereFieldCondition<T[K]>;
|
|
6327
|
+
}) & {
|
|
6295
6328
|
/** Metadata field conditions */
|
|
6296
6329
|
_metadata?: {
|
|
6297
6330
|
[K in keyof T['_metadata']]?: T['_metadata'][K] | WhereOperator<T['_metadata'][K]>;
|
|
@@ -6570,4 +6603,4 @@ interface PerformanceMetrics {
|
|
|
6570
6603
|
cacheHitRatio?: number;
|
|
6571
6604
|
}
|
|
6572
6605
|
|
|
6573
|
-
export { type ApiPath as A, type BaseContent as B, type CreateInput as C, type DebugConfig as D, type Environment as E, type FieldTypeName as F,
|
|
6606
|
+
export { type ApiPath as A, type BaseContent as B, type CreateInput as C, type DebugConfig as D, type Environment as E, type FieldTypeName as F, ValidationError as G, SchemaValidationError as H, InvalidPayloadError as I, RequiredFieldError as J, InvalidFieldTypeError as K, type LogLevel as L, type MatchRouteOptions as M, type MergedRelyIOConfig as N, type PathParamsOf as O, type PerformanceMetrics as P, type QueryOptions as Q, type RelyIOConfig as R, SDKError as S, type components as T, type UpdateInput as U, type ValidationRule as V, type Wire as W, type paths as X, type FieldDefinition as Y, type ApiMethod as a, type ApiSuccessBody as b, type RouteMatch as c, type WhereScalar as d, type WhereFieldCondition as e, type WhereClause as f, type WhereOperator as g, type SortOptions as h, type ContentQueryResult as i, type SingletonContent as j, type SettingsGroup as k, type CustomQuery as l, matchRoute as m, type ContentTypeSchema as n, type FieldOptions as o, type RealtimeEventType as p, type RealtimeEvent as q, type SubscriptionOptions as r, type CacheConfig as s, type RealtimeConfig as t, type RequestConfig as u, type ApiResponse as v, type RetryConfig as w, type CacheStrategy as x, type ValidationViolation as y, BaseValidationError as z };
|