@relyio/sdk 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/{chunk-QIZOBT5F.js → chunk-5AZUUV5B.js} +349 -25
- package/dist/{chunk-54WP2PWG.cjs → chunk-CIRT6TVT.cjs} +350 -24
- package/dist/{chunk-HMVGXUGR.cjs → chunk-HAQELDZN.cjs} +2 -2
- package/dist/{chunk-LYRYCIX5.js → chunk-XY5KFEFY.js} +2 -2
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +4 -3
- package/dist/client/index.d.ts +4 -3
- package/dist/client/index.js +1 -1
- package/dist/{define-schema-BfXeR6K8.d.cts → define-schema-2xbHgtK-.d.cts} +8 -4
- package/dist/{define-schema-BD6HSPnG.d.ts → define-schema-DzYXk4HL.d.ts} +8 -4
- package/dist/{index-BDpar3FO.d.cts → index-BozPz4n1.d.cts} +320 -8
- package/dist/{index-ulOrcfPa.d.cts → index-C5mRBb6t.d.cts} +368 -11
- package/dist/{index-Dx01iwaf.d.ts → index-Dzo-upNS.d.ts} +320 -8
- package/dist/{index-DuEhsGdE.d.ts → index-mXUx2H99.d.ts} +368 -11
- package/dist/index.cjs +119 -66
- package/dist/index.d.cts +131 -46
- package/dist/index.d.ts +131 -46
- package/dist/index.js +44 -3
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -13
- package/dist/react/index.cjs +0 -4
- package/dist/react/index.d.cts +0 -2
- package/dist/react/index.d.ts +0 -2
- package/dist/react/index.js +0 -3
|
@@ -452,6 +452,26 @@ interface paths {
|
|
|
452
452
|
patch?: never;
|
|
453
453
|
trace?: never;
|
|
454
454
|
};
|
|
455
|
+
'/v1/changes': {
|
|
456
|
+
parameters: {
|
|
457
|
+
query?: never;
|
|
458
|
+
header?: never;
|
|
459
|
+
path?: never;
|
|
460
|
+
cookie?: never;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* Poll the changes feed
|
|
464
|
+
* @description Long-polls: when nothing after `since` is visible to this key yet, the request is held until a write lands in the dataset or the hold ends, then answered with what the ledger says. Each change carries ids only — entry, content type, locale, kind and cursor — and is refetched through the ordinary read path. The key decides what is visible: a published key sees publication changes, a preview key sees draft changes as well. `RESOURCE_EXPIRED` means the cursor can no longer be replayed; resync and start again without one. With `Accept: text/event-stream` the same request is a Server-Sent Events stream instead: a `change` frame per change, a `heartbeat` carrying the cursor when nothing has happened for a while, and `complete` with the cursor to reconnect from before the stream ends — which it does after a few minutes, by design. A refusal before the stream opens is an `error` frame at the refusal’s status; one after it is the last frame. When the service is holding as many of these as it can, or the key as many as its plan allows, the request is answered at once instead — an empty page whose `nextCursor` is `since`, or a stream that is only `complete` — with `Retry-After` saying how many seconds to wait before asking again.
|
|
465
|
+
*/
|
|
466
|
+
get: operations['pollChanges'];
|
|
467
|
+
put?: never;
|
|
468
|
+
post?: never;
|
|
469
|
+
delete?: never;
|
|
470
|
+
options?: never;
|
|
471
|
+
head?: never;
|
|
472
|
+
patch?: never;
|
|
473
|
+
trace?: never;
|
|
474
|
+
};
|
|
455
475
|
'/v1/meta/content-types': {
|
|
456
476
|
parameters: {
|
|
457
477
|
query?: never;
|
|
@@ -554,6 +574,26 @@ interface paths {
|
|
|
554
574
|
patch?: never;
|
|
555
575
|
trace?: never;
|
|
556
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
|
+
};
|
|
557
597
|
'/v1/query': {
|
|
558
598
|
parameters: {
|
|
559
599
|
query?: never;
|
|
@@ -797,6 +837,17 @@ interface paths {
|
|
|
797
837
|
}
|
|
798
838
|
interface components {
|
|
799
839
|
schemas: {
|
|
840
|
+
/** @description One change to one entry, ids only. Refetch the entry through the ordinary read path to see it. */
|
|
841
|
+
Change: {
|
|
842
|
+
entryId: string;
|
|
843
|
+
contentType: string;
|
|
844
|
+
/** @description The locale the write addressed, or null when it addressed the whole entry. */
|
|
845
|
+
locale: string | null;
|
|
846
|
+
/** @enum {string} */
|
|
847
|
+
kind: 'deleted' | 'published' | 'unpublished' | 'updated';
|
|
848
|
+
/** @description Opaque. The cursor of the ledger row this change came from; changes from one row share it. */
|
|
849
|
+
cursor: string;
|
|
850
|
+
};
|
|
800
851
|
CursorPage: {
|
|
801
852
|
nextCursor: string | null;
|
|
802
853
|
hasMore: boolean;
|
|
@@ -804,7 +855,7 @@ interface components {
|
|
|
804
855
|
ErrorResponse: {
|
|
805
856
|
error: {
|
|
806
857
|
/** @enum {string} */
|
|
807
|
-
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'PAYLOAD_TOO_LARGE' | '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' | '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';
|
|
808
859
|
messages: string[];
|
|
809
860
|
details?: {
|
|
810
861
|
[key: string]: unknown;
|
|
@@ -832,6 +883,28 @@ interface components {
|
|
|
832
883
|
limit: number;
|
|
833
884
|
total: number;
|
|
834
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
|
+
};
|
|
835
908
|
RefusalAccessDenied: {
|
|
836
909
|
error: {
|
|
837
910
|
/** @enum {string} */
|
|
@@ -967,7 +1040,7 @@ interface components {
|
|
|
967
1040
|
id?: string;
|
|
968
1041
|
error: {
|
|
969
1042
|
/** @enum {string} */
|
|
970
|
-
code: 'ACCESS_DENIED' | 'CONTENT_INVALID' | 'INTERNAL_ERROR' | 'INVALID_API_KEY' | 'METHOD_NOT_ALLOWED' | 'MISSING_API_KEY' | 'PAYLOAD_TOO_LARGE' | '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' | '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';
|
|
971
1044
|
messages: string[];
|
|
972
1045
|
details?: {
|
|
973
1046
|
[key: string]: unknown;
|
|
@@ -3526,6 +3599,150 @@ interface operations {
|
|
|
3526
3599
|
};
|
|
3527
3600
|
};
|
|
3528
3601
|
};
|
|
3602
|
+
pollChanges: {
|
|
3603
|
+
parameters: {
|
|
3604
|
+
query?: {
|
|
3605
|
+
/** @description Comma-separated entry ids to keep, at most 100. Omitted keeps every entry. */
|
|
3606
|
+
ids?: string;
|
|
3607
|
+
/** @description Ledger rows to scan, 1 to 500; default 100. Rows, not changes: one write can name many entries, and a page never ends inside one. */
|
|
3608
|
+
limit?: number;
|
|
3609
|
+
/** @description The opaque cursor a previous page returned as `page.nextCursor`. Omitted, the answer is the dataset’s current position and no changes, at once. */
|
|
3610
|
+
since?: string;
|
|
3611
|
+
/** @description Comma-separated content types to keep. Omitted keeps every type. */
|
|
3612
|
+
types?: string;
|
|
3613
|
+
};
|
|
3614
|
+
header?: never;
|
|
3615
|
+
path?: never;
|
|
3616
|
+
cookie?: never;
|
|
3617
|
+
};
|
|
3618
|
+
requestBody?: never;
|
|
3619
|
+
responses: {
|
|
3620
|
+
/** @description Success. */
|
|
3621
|
+
200: {
|
|
3622
|
+
headers: {
|
|
3623
|
+
'Retry-After'?: string;
|
|
3624
|
+
[name: string]: unknown;
|
|
3625
|
+
};
|
|
3626
|
+
content: {
|
|
3627
|
+
'application/json': {
|
|
3628
|
+
data: components['schemas']['Change'][];
|
|
3629
|
+
page: components['schemas']['CursorPage'];
|
|
3630
|
+
};
|
|
3631
|
+
'text/event-stream': {
|
|
3632
|
+
/** @enum {string} */
|
|
3633
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3634
|
+
} & {
|
|
3635
|
+
[key: string]: unknown;
|
|
3636
|
+
};
|
|
3637
|
+
};
|
|
3638
|
+
};
|
|
3639
|
+
/** @description REQUEST_INVALID */
|
|
3640
|
+
400: {
|
|
3641
|
+
headers: {
|
|
3642
|
+
[name: string]: unknown;
|
|
3643
|
+
};
|
|
3644
|
+
content: {
|
|
3645
|
+
'application/json': components['schemas']['RefusalRequestInvalid'];
|
|
3646
|
+
'text/event-stream': {
|
|
3647
|
+
/** @enum {string} */
|
|
3648
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3649
|
+
} & {
|
|
3650
|
+
[key: string]: unknown;
|
|
3651
|
+
};
|
|
3652
|
+
};
|
|
3653
|
+
};
|
|
3654
|
+
/** @description INVALID_API_KEY, MISSING_API_KEY */
|
|
3655
|
+
401: {
|
|
3656
|
+
headers: {
|
|
3657
|
+
[name: string]: unknown;
|
|
3658
|
+
};
|
|
3659
|
+
content: {
|
|
3660
|
+
'application/json': components['schemas']['RefusalInvalidApiKeyOrMissingApiKey'];
|
|
3661
|
+
'text/event-stream': {
|
|
3662
|
+
/** @enum {string} */
|
|
3663
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3664
|
+
} & {
|
|
3665
|
+
[key: string]: unknown;
|
|
3666
|
+
};
|
|
3667
|
+
};
|
|
3668
|
+
};
|
|
3669
|
+
/** @description ACCESS_DENIED, PLAN_FEATURE_UNAVAILABLE, USAGE_QUOTA_EXCEEDED */
|
|
3670
|
+
403: {
|
|
3671
|
+
headers: {
|
|
3672
|
+
[name: string]: unknown;
|
|
3673
|
+
};
|
|
3674
|
+
content: {
|
|
3675
|
+
'application/json': components['schemas']['RefusalAccessDeniedOrPlanFeatureUnavailableOrUsageQuotaExceeded'];
|
|
3676
|
+
'text/event-stream': {
|
|
3677
|
+
/** @enum {string} */
|
|
3678
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3679
|
+
} & {
|
|
3680
|
+
[key: string]: unknown;
|
|
3681
|
+
};
|
|
3682
|
+
};
|
|
3683
|
+
};
|
|
3684
|
+
/** @description RESOURCE_EXPIRED */
|
|
3685
|
+
410: {
|
|
3686
|
+
headers: {
|
|
3687
|
+
[name: string]: unknown;
|
|
3688
|
+
};
|
|
3689
|
+
content: {
|
|
3690
|
+
'application/json': components['schemas']['RefusalResourceExpired'];
|
|
3691
|
+
'text/event-stream': {
|
|
3692
|
+
/** @enum {string} */
|
|
3693
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3694
|
+
} & {
|
|
3695
|
+
[key: string]: unknown;
|
|
3696
|
+
};
|
|
3697
|
+
};
|
|
3698
|
+
};
|
|
3699
|
+
/** @description RATE_LIMIT_EXCEEDED */
|
|
3700
|
+
429: {
|
|
3701
|
+
headers: {
|
|
3702
|
+
[name: string]: unknown;
|
|
3703
|
+
};
|
|
3704
|
+
content: {
|
|
3705
|
+
'application/json': components['schemas']['RefusalRateLimitExceeded'];
|
|
3706
|
+
'text/event-stream': {
|
|
3707
|
+
/** @enum {string} */
|
|
3708
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3709
|
+
} & {
|
|
3710
|
+
[key: string]: unknown;
|
|
3711
|
+
};
|
|
3712
|
+
};
|
|
3713
|
+
};
|
|
3714
|
+
/** @description INTERNAL_ERROR */
|
|
3715
|
+
500: {
|
|
3716
|
+
headers: {
|
|
3717
|
+
[name: string]: unknown;
|
|
3718
|
+
};
|
|
3719
|
+
content: {
|
|
3720
|
+
'application/json': components['schemas']['RefusalInternalError'];
|
|
3721
|
+
'text/event-stream': {
|
|
3722
|
+
/** @enum {string} */
|
|
3723
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3724
|
+
} & {
|
|
3725
|
+
[key: string]: unknown;
|
|
3726
|
+
};
|
|
3727
|
+
};
|
|
3728
|
+
};
|
|
3729
|
+
/** @description SERVICE_INDETERMINATE */
|
|
3730
|
+
503: {
|
|
3731
|
+
headers: {
|
|
3732
|
+
[name: string]: unknown;
|
|
3733
|
+
};
|
|
3734
|
+
content: {
|
|
3735
|
+
'application/json': components['schemas']['RefusalServiceIndeterminate'];
|
|
3736
|
+
'text/event-stream': {
|
|
3737
|
+
/** @enum {string} */
|
|
3738
|
+
type: 'change' | 'complete' | 'error' | 'heartbeat';
|
|
3739
|
+
} & {
|
|
3740
|
+
[key: string]: unknown;
|
|
3741
|
+
};
|
|
3742
|
+
};
|
|
3743
|
+
};
|
|
3744
|
+
};
|
|
3745
|
+
};
|
|
3529
3746
|
listContentTypes: {
|
|
3530
3747
|
parameters: {
|
|
3531
3748
|
query?: never;
|
|
@@ -3539,7 +3756,6 @@ interface operations {
|
|
|
3539
3756
|
200: {
|
|
3540
3757
|
headers: {
|
|
3541
3758
|
'Cache-Control'?: string;
|
|
3542
|
-
ETag?: string;
|
|
3543
3759
|
Vary?: string;
|
|
3544
3760
|
'X-Cache'?: string;
|
|
3545
3761
|
'X-Cache-Key'?: string;
|
|
@@ -3621,7 +3837,6 @@ interface operations {
|
|
|
3621
3837
|
200: {
|
|
3622
3838
|
headers: {
|
|
3623
3839
|
'Cache-Control'?: string;
|
|
3624
|
-
ETag?: string;
|
|
3625
3840
|
Vary?: string;
|
|
3626
3841
|
'X-Cache'?: string;
|
|
3627
3842
|
'X-Cache-Key'?: string;
|
|
@@ -3712,7 +3927,6 @@ interface operations {
|
|
|
3712
3927
|
200: {
|
|
3713
3928
|
headers: {
|
|
3714
3929
|
'Cache-Control'?: string;
|
|
3715
|
-
ETag?: string;
|
|
3716
3930
|
Vary?: string;
|
|
3717
3931
|
'X-Cache'?: string;
|
|
3718
3932
|
'X-Cache-Key'?: string;
|
|
@@ -3794,7 +4008,6 @@ interface operations {
|
|
|
3794
4008
|
200: {
|
|
3795
4009
|
headers: {
|
|
3796
4010
|
'Cache-Control'?: string;
|
|
3797
|
-
ETag?: string;
|
|
3798
4011
|
Vary?: string;
|
|
3799
4012
|
'X-Cache'?: string;
|
|
3800
4013
|
'X-Cache-Key'?: string;
|
|
@@ -3887,7 +4100,6 @@ interface operations {
|
|
|
3887
4100
|
200: {
|
|
3888
4101
|
headers: {
|
|
3889
4102
|
'Cache-Control'?: string;
|
|
3890
|
-
ETag?: string;
|
|
3891
4103
|
Vary?: string;
|
|
3892
4104
|
'X-Cache'?: string;
|
|
3893
4105
|
'X-Cache-Key'?: string;
|
|
@@ -3980,7 +4192,6 @@ interface operations {
|
|
|
3980
4192
|
200: {
|
|
3981
4193
|
headers: {
|
|
3982
4194
|
'Cache-Control'?: string;
|
|
3983
|
-
ETag?: string;
|
|
3984
4195
|
Vary?: string;
|
|
3985
4196
|
'X-Cache'?: string;
|
|
3986
4197
|
'X-Cache-Key'?: string;
|
|
@@ -4058,6 +4269,92 @@ interface operations {
|
|
|
4058
4269
|
};
|
|
4059
4270
|
};
|
|
4060
4271
|
};
|
|
4272
|
+
getProject: {
|
|
4273
|
+
parameters: {
|
|
4274
|
+
query?: never;
|
|
4275
|
+
header?: never;
|
|
4276
|
+
path?: never;
|
|
4277
|
+
cookie?: never;
|
|
4278
|
+
};
|
|
4279
|
+
requestBody?: never;
|
|
4280
|
+
responses: {
|
|
4281
|
+
/** @description Success. */
|
|
4282
|
+
200: {
|
|
4283
|
+
headers: {
|
|
4284
|
+
'Cache-Control'?: string;
|
|
4285
|
+
[name: string]: unknown;
|
|
4286
|
+
};
|
|
4287
|
+
content: {
|
|
4288
|
+
'application/json': {
|
|
4289
|
+
data: components['schemas']['Project'];
|
|
4290
|
+
};
|
|
4291
|
+
};
|
|
4292
|
+
};
|
|
4293
|
+
/** @description REQUEST_INVALID */
|
|
4294
|
+
400: {
|
|
4295
|
+
headers: {
|
|
4296
|
+
[name: string]: unknown;
|
|
4297
|
+
};
|
|
4298
|
+
content: {
|
|
4299
|
+
'application/json': components['schemas']['RefusalRequestInvalid'];
|
|
4300
|
+
};
|
|
4301
|
+
};
|
|
4302
|
+
/** @description INVALID_API_KEY, MISSING_API_KEY */
|
|
4303
|
+
401: {
|
|
4304
|
+
headers: {
|
|
4305
|
+
[name: string]: unknown;
|
|
4306
|
+
};
|
|
4307
|
+
content: {
|
|
4308
|
+
'application/json': components['schemas']['RefusalInvalidApiKeyOrMissingApiKey'];
|
|
4309
|
+
};
|
|
4310
|
+
};
|
|
4311
|
+
/** @description ACCESS_DENIED, PLAN_FEATURE_UNAVAILABLE, USAGE_QUOTA_EXCEEDED */
|
|
4312
|
+
403: {
|
|
4313
|
+
headers: {
|
|
4314
|
+
[name: string]: unknown;
|
|
4315
|
+
};
|
|
4316
|
+
content: {
|
|
4317
|
+
'application/json': components['schemas']['RefusalAccessDeniedOrPlanFeatureUnavailableOrUsageQuotaExceeded'];
|
|
4318
|
+
};
|
|
4319
|
+
};
|
|
4320
|
+
/** @description RESOURCE_NOT_FOUND */
|
|
4321
|
+
404: {
|
|
4322
|
+
headers: {
|
|
4323
|
+
[name: string]: unknown;
|
|
4324
|
+
};
|
|
4325
|
+
content: {
|
|
4326
|
+
'application/json': components['schemas']['RefusalResourceNotFound'];
|
|
4327
|
+
};
|
|
4328
|
+
};
|
|
4329
|
+
/** @description RATE_LIMIT_EXCEEDED */
|
|
4330
|
+
429: {
|
|
4331
|
+
headers: {
|
|
4332
|
+
[name: string]: unknown;
|
|
4333
|
+
};
|
|
4334
|
+
content: {
|
|
4335
|
+
'application/json': components['schemas']['RefusalRateLimitExceeded'];
|
|
4336
|
+
};
|
|
4337
|
+
};
|
|
4338
|
+
/** @description INTERNAL_ERROR */
|
|
4339
|
+
500: {
|
|
4340
|
+
headers: {
|
|
4341
|
+
[name: string]: unknown;
|
|
4342
|
+
};
|
|
4343
|
+
content: {
|
|
4344
|
+
'application/json': components['schemas']['RefusalInternalError'];
|
|
4345
|
+
};
|
|
4346
|
+
};
|
|
4347
|
+
/** @description SERVICE_INDETERMINATE */
|
|
4348
|
+
503: {
|
|
4349
|
+
headers: {
|
|
4350
|
+
[name: string]: unknown;
|
|
4351
|
+
};
|
|
4352
|
+
content: {
|
|
4353
|
+
'application/json': components['schemas']['RefusalServiceIndeterminate'];
|
|
4354
|
+
};
|
|
4355
|
+
};
|
|
4356
|
+
};
|
|
4357
|
+
};
|
|
4061
4358
|
executeAdhocQuery: {
|
|
4062
4359
|
parameters: {
|
|
4063
4360
|
query?: never;
|
|
@@ -5629,10 +5926,40 @@ type PathParamsOf<P extends ApiPath, M extends ApiMethod<P>> = Operation<P, M> e
|
|
|
5629
5926
|
path?: infer X;
|
|
5630
5927
|
};
|
|
5631
5928
|
} ? [X] extends [undefined] ? never : NonNullable<X> : never;
|
|
5929
|
+
/** What {@link matchRoute} recovers from a URL the client emitted. */
|
|
5930
|
+
interface RouteMatch {
|
|
5931
|
+
/** The document's path template — the value a tag translator switches on. */
|
|
5932
|
+
path: ApiPath;
|
|
5933
|
+
/** The template's `{name}` segments, decoded: the inverse of {@link fillPath}. */
|
|
5934
|
+
params: Record<string, string>;
|
|
5935
|
+
/** The query string; a key that appears more than once comes back as an array. */
|
|
5936
|
+
query: Record<string, string | string[]>;
|
|
5937
|
+
}
|
|
5938
|
+
interface MatchRouteOptions {
|
|
5939
|
+
/**
|
|
5940
|
+
* The client's `baseUrl`, when it carries a path prefix of its own
|
|
5941
|
+
* (`https://example.com/relyio`). Its path is removed before the template is
|
|
5942
|
+
* matched. Unneeded for the default `https://api.relyio.com`.
|
|
5943
|
+
*/
|
|
5944
|
+
baseUrl?: string;
|
|
5945
|
+
}
|
|
5946
|
+
/**
|
|
5947
|
+
* Recover the route a URL names: the inverse of {@link fillPath}, over the same
|
|
5948
|
+
* committed document (`INV-API-CLIENT-IS-DERIVED`).
|
|
5949
|
+
*
|
|
5950
|
+
* `matchRoute(url).path` is an `ApiPath`, so anything that keys behaviour on a
|
|
5951
|
+
* request — a cache-tag translator, say — switches on the document's templates
|
|
5952
|
+
* and never on a route table of its own.
|
|
5953
|
+
*
|
|
5954
|
+
* Returns `null` for a URL no declared template matches — a presigned storage
|
|
5955
|
+
* URL, or a path outside `baseUrl` — rather than a guess.
|
|
5956
|
+
*/
|
|
5957
|
+
declare function matchRoute(url: string | URL, options?: MatchRouteOptions): RouteMatch | null;
|
|
5632
5958
|
|
|
5633
5959
|
/**
|
|
5634
5960
|
* Configuration types for the RelyIO SDK
|
|
5635
5961
|
*/
|
|
5962
|
+
|
|
5636
5963
|
interface RelyIOConfig {
|
|
5637
5964
|
/** API key for authentication */
|
|
5638
5965
|
apiKey: string;
|
|
@@ -5659,7 +5986,13 @@ interface RelyIOConfig {
|
|
|
5659
5986
|
useSsl?: boolean;
|
|
5660
5987
|
/** Environment mode */
|
|
5661
5988
|
environment?: 'development' | 'staging' | 'production';
|
|
5662
|
-
/**
|
|
5989
|
+
/**
|
|
5990
|
+
* Cache configuration.
|
|
5991
|
+
*
|
|
5992
|
+
* Declarative only: the client keeps no response cache, and nothing in it reads
|
|
5993
|
+
* these values, so every call goes to `fetch`. There is no SDK-side cache to
|
|
5994
|
+
* turn off under a framework that caches `fetch` itself (Next.js).
|
|
5995
|
+
*/
|
|
5663
5996
|
cache?: CacheConfig;
|
|
5664
5997
|
/** Real-time configuration */
|
|
5665
5998
|
realtime?: RealtimeConfig;
|
|
@@ -5667,6 +6000,25 @@ interface RelyIOConfig {
|
|
|
5667
6000
|
debug?: DebugConfig;
|
|
5668
6001
|
/** Custom headers to include with requests */
|
|
5669
6002
|
headers?: Record<string, string>;
|
|
6003
|
+
/**
|
|
6004
|
+
* The function every request to the RelyIO API is sent through. Omit it and the
|
|
6005
|
+
* client calls the runtime's `globalThis.fetch`, looked up per request. File
|
|
6006
|
+
* bytes an asset upload PUTs straight to a presigned storage URL do not pass
|
|
6007
|
+
* through it.
|
|
6008
|
+
*
|
|
6009
|
+
* The client still builds every request — URL, method, headers, body, signal —
|
|
6010
|
+
* and hands this function that `RequestInit` unchanged, retries included, so an
|
|
6011
|
+
* `Idempotency-Key` minted for a write is the same on every attempt. Supply one
|
|
6012
|
+
* to add what your framework reads off the `RequestInit`, for example Next.js
|
|
6013
|
+
* cache tags:
|
|
6014
|
+
*
|
|
6015
|
+
* @example
|
|
6016
|
+
* const client = createClient({
|
|
6017
|
+
* apiKey: '...',
|
|
6018
|
+
* fetch: (input, init) => fetch(input, { ...init, next: { tags: ['posts'] } }),
|
|
6019
|
+
* })
|
|
6020
|
+
*/
|
|
6021
|
+
fetch?: typeof globalThis.fetch;
|
|
5670
6022
|
/** Browser-specific configuration */
|
|
5671
6023
|
browser?: BrowserConfig;
|
|
5672
6024
|
/**
|
|
@@ -5800,7 +6152,12 @@ interface BrowserConfig {
|
|
|
5800
6152
|
type CacheStrategy = 'memory' | 'persistent' | 'network-first' | 'cache-first' | 'stale-while-revalidate';
|
|
5801
6153
|
type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
5802
6154
|
type Environment = 'development' | 'staging' | 'production';
|
|
5803
|
-
|
|
6155
|
+
/**
|
|
6156
|
+
* `fetch` stays optional after the merge: absent means the runtime's own, and
|
|
6157
|
+
* that is read per request rather than captured here, so no default value
|
|
6158
|
+
* stands in for it.
|
|
6159
|
+
*/
|
|
6160
|
+
type MergedRelyIOConfig = Required<Omit<RelyIOConfig, 'dataset' | 'locale' | 'dev' | 'fetch'>> & Pick<RelyIOConfig, 'dataset' | 'locale' | 'dev' | 'fetch'>;
|
|
5804
6161
|
|
|
5805
6162
|
/**
|
|
5806
6163
|
* Base error class for all RelyIO SDK errors
|
|
@@ -6213,4 +6570,4 @@ interface PerformanceMetrics {
|
|
|
6213
6570
|
cacheHitRatio?: number;
|
|
6214
6571
|
}
|
|
6215
6572
|
|
|
6216
|
-
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,
|
|
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, RequiredFieldError as G, InvalidFieldTypeError as H, InvalidPayloadError as I, type MergedRelyIOConfig as J, type PathParamsOf as K, type LogLevel as L, type MatchRouteOptions as M, type components as N, type paths as O, type PerformanceMetrics as P, type QueryOptions as Q, type RelyIOConfig as R, SDKError as S, type FieldDefinition as T, type UpdateInput as U, type ValidationRule as V, type Wire as W, type ApiMethod as a, type ApiSuccessBody as b, type RouteMatch as c, type WhereClause as d, type WhereOperator as e, type SortOptions as f, type ContentQueryResult as g, type SingletonContent as h, type SettingsGroup as i, type CustomQuery as j, type ContentTypeSchema as k, type FieldOptions as l, matchRoute as m, type RealtimeEventType as n, type RealtimeEvent as o, type SubscriptionOptions as p, type CacheConfig as q, type RealtimeConfig as r, type RequestConfig as s, type ApiResponse as t, type RetryConfig as u, type CacheStrategy as v, type ValidationViolation as w, BaseValidationError as x, ValidationError as y, SchemaValidationError as z };
|