@relyio/sdk 0.4.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 +193 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/{chunk-43VPZT2G.js → chunk-7ABNXVWL.js} +464 -200
- package/dist/{chunk-HAQELDZN.cjs → chunk-DY2XT7OF.cjs} +2 -2
- package/dist/{chunk-XS32U2UP.cjs → chunk-GCMQUM6N.cjs} +466 -199
- package/dist/{chunk-XY5KFEFY.js → chunk-XJVY2CLY.js} +2 -2
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +5 -4
- package/dist/client/index.d.ts +5 -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-BzOFJJKS.d.ts → index-Df1VsfJR.d.cts} +334 -72
- package/dist/{index-BvO6HDtY.d.cts → index-XqoGUaAY.d.ts} +334 -72
- package/dist/{index-DFehx5sI.d.cts → index-d1Kz1e19.d.cts} +191 -29
- package/dist/{index-FDak5ofk.d.ts → index-yPbhZc6q.d.ts} +191 -29
- package/dist/index.cjs +161 -68
- package/dist/index.d.cts +302 -8
- package/dist/index.d.ts +302 -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 +3 -3
- 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.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Generated by scripts/emit-openapi-types.mjs from @relyio/api's committed
|
|
@@ -574,6 +574,26 @@ interface paths {
|
|
|
574
574
|
patch?: never;
|
|
575
575
|
trace?: never;
|
|
576
576
|
};
|
|
577
|
+
'/v1/project': {
|
|
578
|
+
parameters: {
|
|
579
|
+
query?: never;
|
|
580
|
+
header?: never;
|
|
581
|
+
path?: never;
|
|
582
|
+
cookie?: never;
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* Describe the key's project
|
|
586
|
+
* @description The organization, project, dataset and branch this key resolves to, each with its id and name, and `studioUrl` — the Studio root for the project, built from ids. `dataset` is the one this request selected (`X-RelyIO-Dataset`, or the key’s default), which is not always the project’s default: a Studio link should carry it as `?dataset=`. `studioUrl` is `null` when the service has no Dashboard address configured. Never cached.
|
|
587
|
+
*/
|
|
588
|
+
get: operations['getProject'];
|
|
589
|
+
put?: never;
|
|
590
|
+
post?: never;
|
|
591
|
+
delete?: never;
|
|
592
|
+
options?: never;
|
|
593
|
+
head?: never;
|
|
594
|
+
patch?: never;
|
|
595
|
+
trace?: never;
|
|
596
|
+
};
|
|
577
597
|
'/v1/query': {
|
|
578
598
|
parameters: {
|
|
579
599
|
query?: never;
|
|
@@ -835,7 +855,7 @@ interface components {
|
|
|
835
855
|
ErrorResponse: {
|
|
836
856
|
error: {
|
|
837
857
|
/** @enum {string} */
|
|
838
|
-
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';
|
|
839
859
|
messages: string[];
|
|
840
860
|
details?: {
|
|
841
861
|
[key: string]: unknown;
|
|
@@ -863,6 +883,28 @@ interface components {
|
|
|
863
883
|
limit: number;
|
|
864
884
|
total: number;
|
|
865
885
|
};
|
|
886
|
+
/** @description The place this key resolves to, named, and the Studio root for its project. `id` and `name` are the project’s. */
|
|
887
|
+
Project: {
|
|
888
|
+
id: string;
|
|
889
|
+
name: string;
|
|
890
|
+
/** @description The organization that owns the project. */
|
|
891
|
+
organization: {
|
|
892
|
+
id: string;
|
|
893
|
+
name: string;
|
|
894
|
+
};
|
|
895
|
+
/** @description The dataset this request was answered from — the one `X-RelyIO-Dataset` selected, or the key’s default. */
|
|
896
|
+
dataset: {
|
|
897
|
+
id: string;
|
|
898
|
+
name: string;
|
|
899
|
+
};
|
|
900
|
+
/** @description The branch that dataset is assigned to. */
|
|
901
|
+
branch: {
|
|
902
|
+
id: string;
|
|
903
|
+
name: string;
|
|
904
|
+
};
|
|
905
|
+
/** @description `<dashboard>/o/<organization id>/<project id>/studio`, or null when the service has no Dashboard address configured. */
|
|
906
|
+
studioUrl: string | null;
|
|
907
|
+
};
|
|
866
908
|
RefusalAccessDenied: {
|
|
867
909
|
error: {
|
|
868
910
|
/** @enum {string} */
|
|
@@ -998,7 +1040,7 @@ interface components {
|
|
|
998
1040
|
id?: string;
|
|
999
1041
|
error: {
|
|
1000
1042
|
/** @enum {string} */
|
|
1001
|
-
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';
|
|
1002
1044
|
messages: string[];
|
|
1003
1045
|
details?: {
|
|
1004
1046
|
[key: string]: unknown;
|
|
@@ -1530,7 +1572,6 @@ interface operations {
|
|
|
1530
1572
|
ETag?: string;
|
|
1531
1573
|
Vary?: string;
|
|
1532
1574
|
'X-Cache'?: string;
|
|
1533
|
-
'X-Cache-Key'?: string;
|
|
1534
1575
|
[name: string]: unknown;
|
|
1535
1576
|
};
|
|
1536
1577
|
content: {
|
|
@@ -1732,7 +1773,6 @@ interface operations {
|
|
|
1732
1773
|
ETag?: string;
|
|
1733
1774
|
Vary?: string;
|
|
1734
1775
|
'X-Cache'?: string;
|
|
1735
|
-
'X-Cache-Key'?: string;
|
|
1736
1776
|
'X-Entity-Tag'?: string;
|
|
1737
1777
|
[name: string]: unknown;
|
|
1738
1778
|
};
|
|
@@ -2042,7 +2082,6 @@ interface operations {
|
|
|
2042
2082
|
ETag?: string;
|
|
2043
2083
|
Vary?: string;
|
|
2044
2084
|
'X-Cache'?: string;
|
|
2045
|
-
'X-Cache-Key'?: string;
|
|
2046
2085
|
[name: string]: unknown;
|
|
2047
2086
|
};
|
|
2048
2087
|
content: {
|
|
@@ -3715,8 +3754,6 @@ interface operations {
|
|
|
3715
3754
|
headers: {
|
|
3716
3755
|
'Cache-Control'?: string;
|
|
3717
3756
|
Vary?: string;
|
|
3718
|
-
'X-Cache'?: string;
|
|
3719
|
-
'X-Cache-Key'?: string;
|
|
3720
3757
|
[name: string]: unknown;
|
|
3721
3758
|
};
|
|
3722
3759
|
content: {
|
|
@@ -3796,8 +3833,6 @@ interface operations {
|
|
|
3796
3833
|
headers: {
|
|
3797
3834
|
'Cache-Control'?: string;
|
|
3798
3835
|
Vary?: string;
|
|
3799
|
-
'X-Cache'?: string;
|
|
3800
|
-
'X-Cache-Key'?: string;
|
|
3801
3836
|
[name: string]: unknown;
|
|
3802
3837
|
};
|
|
3803
3838
|
content: {
|
|
@@ -3886,8 +3921,6 @@ interface operations {
|
|
|
3886
3921
|
headers: {
|
|
3887
3922
|
'Cache-Control'?: string;
|
|
3888
3923
|
Vary?: string;
|
|
3889
|
-
'X-Cache'?: string;
|
|
3890
|
-
'X-Cache-Key'?: string;
|
|
3891
3924
|
[name: string]: unknown;
|
|
3892
3925
|
};
|
|
3893
3926
|
content: {
|
|
@@ -3967,8 +4000,6 @@ interface operations {
|
|
|
3967
4000
|
headers: {
|
|
3968
4001
|
'Cache-Control'?: string;
|
|
3969
4002
|
Vary?: string;
|
|
3970
|
-
'X-Cache'?: string;
|
|
3971
|
-
'X-Cache-Key'?: string;
|
|
3972
4003
|
[name: string]: unknown;
|
|
3973
4004
|
};
|
|
3974
4005
|
content: {
|
|
@@ -4059,8 +4090,6 @@ interface operations {
|
|
|
4059
4090
|
headers: {
|
|
4060
4091
|
'Cache-Control'?: string;
|
|
4061
4092
|
Vary?: string;
|
|
4062
|
-
'X-Cache'?: string;
|
|
4063
|
-
'X-Cache-Key'?: string;
|
|
4064
4093
|
[name: string]: unknown;
|
|
4065
4094
|
};
|
|
4066
4095
|
content: {
|
|
@@ -4151,8 +4180,6 @@ interface operations {
|
|
|
4151
4180
|
headers: {
|
|
4152
4181
|
'Cache-Control'?: string;
|
|
4153
4182
|
Vary?: string;
|
|
4154
|
-
'X-Cache'?: string;
|
|
4155
|
-
'X-Cache-Key'?: string;
|
|
4156
4183
|
[name: string]: unknown;
|
|
4157
4184
|
};
|
|
4158
4185
|
content: {
|
|
@@ -4227,6 +4254,92 @@ interface operations {
|
|
|
4227
4254
|
};
|
|
4228
4255
|
};
|
|
4229
4256
|
};
|
|
4257
|
+
getProject: {
|
|
4258
|
+
parameters: {
|
|
4259
|
+
query?: never;
|
|
4260
|
+
header?: never;
|
|
4261
|
+
path?: never;
|
|
4262
|
+
cookie?: never;
|
|
4263
|
+
};
|
|
4264
|
+
requestBody?: never;
|
|
4265
|
+
responses: {
|
|
4266
|
+
/** @description Success. */
|
|
4267
|
+
200: {
|
|
4268
|
+
headers: {
|
|
4269
|
+
'Cache-Control'?: string;
|
|
4270
|
+
[name: string]: unknown;
|
|
4271
|
+
};
|
|
4272
|
+
content: {
|
|
4273
|
+
'application/json': {
|
|
4274
|
+
data: components['schemas']['Project'];
|
|
4275
|
+
};
|
|
4276
|
+
};
|
|
4277
|
+
};
|
|
4278
|
+
/** @description REQUEST_INVALID */
|
|
4279
|
+
400: {
|
|
4280
|
+
headers: {
|
|
4281
|
+
[name: string]: unknown;
|
|
4282
|
+
};
|
|
4283
|
+
content: {
|
|
4284
|
+
'application/json': components['schemas']['RefusalRequestInvalid'];
|
|
4285
|
+
};
|
|
4286
|
+
};
|
|
4287
|
+
/** @description INVALID_API_KEY, MISSING_API_KEY */
|
|
4288
|
+
401: {
|
|
4289
|
+
headers: {
|
|
4290
|
+
[name: string]: unknown;
|
|
4291
|
+
};
|
|
4292
|
+
content: {
|
|
4293
|
+
'application/json': components['schemas']['RefusalInvalidApiKeyOrMissingApiKey'];
|
|
4294
|
+
};
|
|
4295
|
+
};
|
|
4296
|
+
/** @description ACCESS_DENIED, PLAN_FEATURE_UNAVAILABLE, USAGE_QUOTA_EXCEEDED */
|
|
4297
|
+
403: {
|
|
4298
|
+
headers: {
|
|
4299
|
+
[name: string]: unknown;
|
|
4300
|
+
};
|
|
4301
|
+
content: {
|
|
4302
|
+
'application/json': components['schemas']['RefusalAccessDeniedOrPlanFeatureUnavailableOrUsageQuotaExceeded'];
|
|
4303
|
+
};
|
|
4304
|
+
};
|
|
4305
|
+
/** @description RESOURCE_NOT_FOUND */
|
|
4306
|
+
404: {
|
|
4307
|
+
headers: {
|
|
4308
|
+
[name: string]: unknown;
|
|
4309
|
+
};
|
|
4310
|
+
content: {
|
|
4311
|
+
'application/json': components['schemas']['RefusalResourceNotFound'];
|
|
4312
|
+
};
|
|
4313
|
+
};
|
|
4314
|
+
/** @description RATE_LIMIT_EXCEEDED */
|
|
4315
|
+
429: {
|
|
4316
|
+
headers: {
|
|
4317
|
+
[name: string]: unknown;
|
|
4318
|
+
};
|
|
4319
|
+
content: {
|
|
4320
|
+
'application/json': components['schemas']['RefusalRateLimitExceeded'];
|
|
4321
|
+
};
|
|
4322
|
+
};
|
|
4323
|
+
/** @description INTERNAL_ERROR */
|
|
4324
|
+
500: {
|
|
4325
|
+
headers: {
|
|
4326
|
+
[name: string]: unknown;
|
|
4327
|
+
};
|
|
4328
|
+
content: {
|
|
4329
|
+
'application/json': components['schemas']['RefusalInternalError'];
|
|
4330
|
+
};
|
|
4331
|
+
};
|
|
4332
|
+
/** @description SERVICE_INDETERMINATE */
|
|
4333
|
+
503: {
|
|
4334
|
+
headers: {
|
|
4335
|
+
[name: string]: unknown;
|
|
4336
|
+
};
|
|
4337
|
+
content: {
|
|
4338
|
+
'application/json': components['schemas']['RefusalServiceIndeterminate'];
|
|
4339
|
+
};
|
|
4340
|
+
};
|
|
4341
|
+
};
|
|
4342
|
+
};
|
|
4230
4343
|
executeAdhocQuery: {
|
|
4231
4344
|
parameters: {
|
|
4232
4345
|
query?: never;
|
|
@@ -4239,6 +4352,8 @@ interface operations {
|
|
|
4239
4352
|
/** @description Success. */
|
|
4240
4353
|
200: {
|
|
4241
4354
|
headers: {
|
|
4355
|
+
'Cache-Control'?: string;
|
|
4356
|
+
'X-Cache'?: string;
|
|
4242
4357
|
[name: string]: unknown;
|
|
4243
4358
|
};
|
|
4244
4359
|
content: {
|
|
@@ -4334,6 +4449,8 @@ interface operations {
|
|
|
4334
4449
|
/** @description Success. */
|
|
4335
4450
|
200: {
|
|
4336
4451
|
headers: {
|
|
4452
|
+
'Cache-Control'?: string;
|
|
4453
|
+
'X-Cache'?: string;
|
|
4337
4454
|
[name: string]: unknown;
|
|
4338
4455
|
};
|
|
4339
4456
|
content: {
|
|
@@ -4423,6 +4540,8 @@ interface operations {
|
|
|
4423
4540
|
/** @description Success. */
|
|
4424
4541
|
200: {
|
|
4425
4542
|
headers: {
|
|
4543
|
+
'Cache-Control'?: string;
|
|
4544
|
+
'X-Cache'?: string;
|
|
4426
4545
|
[name: string]: unknown;
|
|
4427
4546
|
};
|
|
4428
4547
|
content: {
|
|
@@ -4503,6 +4622,8 @@ interface operations {
|
|
|
4503
4622
|
/** @description Success. */
|
|
4504
4623
|
200: {
|
|
4505
4624
|
headers: {
|
|
4625
|
+
'Cache-Control'?: string;
|
|
4626
|
+
'X-Cache'?: string;
|
|
4506
4627
|
[name: string]: unknown;
|
|
4507
4628
|
};
|
|
4508
4629
|
content: {
|
|
@@ -4596,7 +4717,6 @@ interface operations {
|
|
|
4596
4717
|
ETag?: string;
|
|
4597
4718
|
Vary?: string;
|
|
4598
4719
|
'X-Cache'?: string;
|
|
4599
|
-
'X-Cache-Key'?: string;
|
|
4600
4720
|
[name: string]: unknown;
|
|
4601
4721
|
};
|
|
4602
4722
|
content: {
|
|
@@ -4680,7 +4800,6 @@ interface operations {
|
|
|
4680
4800
|
ETag?: string;
|
|
4681
4801
|
Vary?: string;
|
|
4682
4802
|
'X-Cache'?: string;
|
|
4683
|
-
'X-Cache-Key'?: string;
|
|
4684
4803
|
'X-Entity-Tag'?: string;
|
|
4685
4804
|
[name: string]: unknown;
|
|
4686
4805
|
};
|
|
@@ -5257,7 +5376,6 @@ interface operations {
|
|
|
5257
5376
|
ETag?: string;
|
|
5258
5377
|
Vary?: string;
|
|
5259
5378
|
'X-Cache'?: string;
|
|
5260
|
-
'X-Cache-Key'?: string;
|
|
5261
5379
|
'X-Entity-Tag'?: string;
|
|
5262
5380
|
[name: string]: unknown;
|
|
5263
5381
|
};
|
|
@@ -5831,8 +5949,16 @@ declare function matchRoute(url: string | URL, options?: MatchRouteOptions): Rou
|
|
|
5831
5949
|
/**
|
|
5832
5950
|
* Configuration types for the RelyIO SDK
|
|
5833
5951
|
*/
|
|
5952
|
+
|
|
5834
5953
|
interface RelyIOConfig {
|
|
5835
|
-
/**
|
|
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
|
+
*/
|
|
5836
5962
|
apiKey: string;
|
|
5837
5963
|
/** Base URL for the RelyIO API */
|
|
5838
5964
|
baseUrl?: string;
|
|
@@ -6013,7 +6139,19 @@ interface ApiResponse<T = unknown> {
|
|
|
6013
6139
|
};
|
|
6014
6140
|
}
|
|
6015
6141
|
interface BrowserConfig {
|
|
6016
|
-
/**
|
|
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
|
+
*/
|
|
6017
6155
|
includeCredentials?: boolean;
|
|
6018
6156
|
/** Whether to use relative URLs for same-origin requests (defaults to false) */
|
|
6019
6157
|
useRelativeUrls?: boolean;
|
|
@@ -6092,7 +6230,12 @@ interface ValidationViolation {
|
|
|
6092
6230
|
declare abstract class BaseValidationError extends SDKError {
|
|
6093
6231
|
readonly retryable = false;
|
|
6094
6232
|
readonly violations: ValidationViolation[];
|
|
6095
|
-
|
|
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>);
|
|
6096
6239
|
getUserMessage(): string;
|
|
6097
6240
|
/**
|
|
6098
6241
|
* Get violations for a specific field
|
|
@@ -6112,7 +6255,7 @@ declare class ValidationError extends BaseValidationError {
|
|
|
6112
6255
|
}
|
|
6113
6256
|
declare class InvalidPayloadError extends BaseValidationError {
|
|
6114
6257
|
readonly code = "INVALID_PAYLOAD";
|
|
6115
|
-
constructor(message?: string, violations?: ValidationViolation[], cause?: Error);
|
|
6258
|
+
constructor(message?: string, violations?: ValidationViolation[], cause?: Error, context?: Record<string, unknown>);
|
|
6116
6259
|
getUserMessage(): string;
|
|
6117
6260
|
}
|
|
6118
6261
|
declare class SchemaValidationError extends BaseValidationError {
|
|
@@ -6156,13 +6299,32 @@ interface BaseContent {
|
|
|
6156
6299
|
sourceDatasetId?: string;
|
|
6157
6300
|
};
|
|
6158
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>>;
|
|
6159
6313
|
/**
|
|
6160
6314
|
* Query conditions for filtering content
|
|
6161
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.
|
|
6162
6320
|
*/
|
|
6163
|
-
type WhereClause<T extends BaseContent = BaseContent> =
|
|
6164
|
-
|
|
6165
|
-
|
|
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
|
+
}) & {
|
|
6166
6328
|
/** Metadata field conditions */
|
|
6167
6329
|
_metadata?: {
|
|
6168
6330
|
[K in keyof T['_metadata']]?: T['_metadata'][K] | WhereOperator<T['_metadata'][K]>;
|
|
@@ -6441,4 +6603,4 @@ interface PerformanceMetrics {
|
|
|
6441
6603
|
cacheHitRatio?: number;
|
|
6442
6604
|
}
|
|
6443
6605
|
|
|
6444
|
-
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 };
|