@sanity/client 5.0.0-esm.7 → 5.0.0-esm.9
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/README.md +110 -57
- package/dist/index.browser.cjs +6 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +6 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +127 -121
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/SanityClient.ts +84 -83
- package/src/assets/AssetsClient.ts +4 -3
- package/src/config.ts +1 -0
- package/src/data/dataMethods.ts +28 -26
- package/src/data/encodeQueryString.ts +4 -4
- package/src/data/listen.ts +9 -9
- package/src/data/patch.ts +18 -17
- package/src/data/transaction.ts +15 -12
- package/src/http/errors.ts +7 -7
- package/src/http/request.ts +4 -4
- package/src/http/requestOptions.ts +4 -2
- package/src/types.ts +36 -30
- package/src/util/defaults.ts +4 -2
- package/src/util/once.ts +5 -3
- package/src/util/pick.ts +4 -2
- package/src/validators.ts +4 -4
- package/src/warnings.ts +2 -1
- package/umd/sanityClient.js +4990 -5753
- package/umd/sanityClient.min.js +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare class AssetsClient {
|
|
|
58
58
|
|
|
59
59
|
/** @internal */
|
|
60
60
|
export declare type AttributeSet = {
|
|
61
|
-
[key: string]:
|
|
61
|
+
[key: string]: FIXME
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/** @internal */
|
|
@@ -157,30 +157,30 @@ export declare class BasePatch {
|
|
|
157
157
|
* @param selector - JSONPath expression, eg `comments[-1]` or `blocks[_key=="abc123"]`
|
|
158
158
|
* @param items - Array of items to insert/replace
|
|
159
159
|
*/
|
|
160
|
-
insert(at: 'before' | 'after' | 'replace', selector: string, items:
|
|
160
|
+
insert(at: 'before' | 'after' | 'replace', selector: string, items: FIXME[]): this
|
|
161
161
|
/**
|
|
162
162
|
* Append the given items to the array at the given JSONPath
|
|
163
163
|
*
|
|
164
164
|
* @param selector - Attribute/path to append to, eg `comments` or `person.hobbies`
|
|
165
165
|
* @param items - Array of items to append to the array
|
|
166
166
|
*/
|
|
167
|
-
append(selector: string, items:
|
|
167
|
+
append(selector: string, items: FIXME[]): this
|
|
168
168
|
/**
|
|
169
169
|
* Prepend the given items to the array at the given JSONPath
|
|
170
170
|
*
|
|
171
171
|
* @param selector - Attribute/path to prepend to, eg `comments` or `person.hobbies`
|
|
172
172
|
* @param items - Array of items to prepend to the array
|
|
173
173
|
*/
|
|
174
|
-
prepend(selector: string, items:
|
|
174
|
+
prepend(selector: string, items: FIXME[]): this
|
|
175
175
|
/**
|
|
176
176
|
* Change the contents of an array by removing existing elements and/or adding new elements.
|
|
177
177
|
*
|
|
178
178
|
* @param selector - Attribute or JSONPath expression for array
|
|
179
179
|
* @param start - Index at which to start changing the array (with origin 0). If greater than the length of the array, actual starting index will be set to the length of the array. If negative, will begin that many elements from the end of the array (with origin -1) and will be set to 0 if absolute value is greater than the length of the array.x
|
|
180
180
|
* @param deleteCount - An integer indicating the number of old array elements to remove.
|
|
181
|
-
* @param items - The elements to add to the array, beginning at the start index. If you don't specify
|
|
181
|
+
* @param items - The elements to add to the array, beginning at the start index. If you don't specify FIXME elements, splice() will only remove elements from the array.
|
|
182
182
|
*/
|
|
183
|
-
splice(selector: string, start: number, deleteCount?: number, items?:
|
|
183
|
+
splice(selector: string, start: number, deleteCount?: number, items?: FIXME[]): this
|
|
184
184
|
/**
|
|
185
185
|
* Adds a revision clause, preventing the document from being patched if the `_rev` property does not match the given value
|
|
186
186
|
*
|
|
@@ -199,8 +199,8 @@ export declare class BasePatch {
|
|
|
199
199
|
* Clears the patch of all operations
|
|
200
200
|
*/
|
|
201
201
|
reset(): this
|
|
202
|
-
protected _assign(op: keyof PatchOperations, props:
|
|
203
|
-
protected _set(op: keyof PatchOperations, props:
|
|
202
|
+
protected _assign(op: keyof PatchOperations, props: FIXME, merge?: boolean): this
|
|
203
|
+
protected _set(op: keyof PatchOperations, props: FIXME): this
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/** @internal */
|
|
@@ -214,14 +214,14 @@ export declare class BaseTransaction {
|
|
|
214
214
|
*
|
|
215
215
|
* @param doc - Document to create. Requires a `_type` property.
|
|
216
216
|
*/
|
|
217
|
-
create<R extends Record<string,
|
|
217
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(doc: SanityDocumentStub<R>): this
|
|
218
218
|
/**
|
|
219
219
|
* Creates a new Sanity document. If a document with the same `_id` already exists, the create operation will be ignored.
|
|
220
220
|
* The operation is added to the current transaction, ready to be commited by `commit()`
|
|
221
221
|
*
|
|
222
222
|
* @param doc - Document to create if it does not already exist. Requires `_id` and `_type` properties.
|
|
223
223
|
*/
|
|
224
|
-
createIfNotExists<R extends Record<string,
|
|
224
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
225
225
|
doc: IdentifiedSanityDocumentStub<R>
|
|
226
226
|
): this
|
|
227
227
|
/**
|
|
@@ -230,7 +230,7 @@ export declare class BaseTransaction {
|
|
|
230
230
|
*
|
|
231
231
|
* @param doc - Document to create or replace. Requires `_id` and `_type` properties.
|
|
232
232
|
*/
|
|
233
|
-
createOrReplace<R extends Record<string,
|
|
233
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
234
234
|
doc: IdentifiedSanityDocumentStub<R>
|
|
235
235
|
): this
|
|
236
236
|
/**
|
|
@@ -241,7 +241,7 @@ export declare class BaseTransaction {
|
|
|
241
241
|
*/
|
|
242
242
|
delete(documentId: string): this
|
|
243
243
|
/**
|
|
244
|
-
* Gets the current transaction ID, if
|
|
244
|
+
* Gets the current transaction ID, if FIXME
|
|
245
245
|
*/
|
|
246
246
|
transactionId(): string | undefined
|
|
247
247
|
/**
|
|
@@ -301,7 +301,7 @@ export declare class ClientError extends BaseError {
|
|
|
301
301
|
statusCode: ErrorProps['statusCode']
|
|
302
302
|
responseBody: ErrorProps['responseBody']
|
|
303
303
|
details: ErrorProps['details']
|
|
304
|
-
constructor(res:
|
|
304
|
+
constructor(res: FIXME)
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
/** @public */
|
|
@@ -382,10 +382,10 @@ export declare type DisconnectEvent = {
|
|
|
382
382
|
/** @public */
|
|
383
383
|
export declare interface ErrorProps {
|
|
384
384
|
message: string
|
|
385
|
-
response:
|
|
385
|
+
response: FIXME
|
|
386
386
|
statusCode: number
|
|
387
|
-
responseBody:
|
|
388
|
-
details:
|
|
387
|
+
responseBody: FIXME
|
|
388
|
+
details: FIXME
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
/** @internal */
|
|
@@ -405,6 +405,12 @@ export declare type FirstDocumentMutationOptions = BaseMutationOptions & {
|
|
|
405
405
|
returnDocuments?: true
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
+
/**
|
|
409
|
+
* Used to tag types that is set to `any` as a temporary measure, but should be replaced with proper typings in the future
|
|
410
|
+
* @internal
|
|
411
|
+
*/
|
|
412
|
+
export declare type FIXME = any
|
|
413
|
+
|
|
408
414
|
/** @public */
|
|
409
415
|
export declare type HttpRequest = {
|
|
410
416
|
defaultRequester: Requester
|
|
@@ -416,7 +422,7 @@ export declare type HttpRequestEvent<T = unknown> = ResponseEvent<T> | ProgressE
|
|
|
416
422
|
|
|
417
423
|
/** @public */
|
|
418
424
|
export declare type IdentifiedSanityDocumentStub<
|
|
419
|
-
T extends Record<string,
|
|
425
|
+
T extends Record<string, FIXME> = Record<string, FIXME>
|
|
420
426
|
> = {
|
|
421
427
|
[P in keyof T]: T[P]
|
|
422
428
|
} & {
|
|
@@ -430,15 +436,15 @@ export declare interface InitializedClientConfig extends ClientConfig {
|
|
|
430
436
|
useProjectHostname: boolean
|
|
431
437
|
useCdn: boolean
|
|
432
438
|
/**
|
|
433
|
-
* @deprecated
|
|
439
|
+
* @deprecated Internal, don't use
|
|
434
440
|
*/
|
|
435
441
|
isDefaultApi: boolean
|
|
436
442
|
/**
|
|
437
|
-
* @deprecated
|
|
443
|
+
* @deprecated Internal, don't use
|
|
438
444
|
*/
|
|
439
445
|
url: string
|
|
440
446
|
/**
|
|
441
|
-
* @deprecated
|
|
447
|
+
* @deprecated Internal, don't use
|
|
442
448
|
*/
|
|
443
449
|
cdnUrl: string
|
|
444
450
|
}
|
|
@@ -447,15 +453,15 @@ export declare interface InitializedClientConfig extends ClientConfig {
|
|
|
447
453
|
export declare type InsertPatch =
|
|
448
454
|
| {
|
|
449
455
|
before: string
|
|
450
|
-
items:
|
|
456
|
+
items: FIXME[]
|
|
451
457
|
}
|
|
452
458
|
| {
|
|
453
459
|
after: string
|
|
454
|
-
items:
|
|
460
|
+
items: FIXME[]
|
|
455
461
|
}
|
|
456
462
|
| {
|
|
457
463
|
replace: string
|
|
458
|
-
items:
|
|
464
|
+
items: FIXME[]
|
|
459
465
|
}
|
|
460
466
|
|
|
461
467
|
/**
|
|
@@ -466,7 +472,7 @@ export declare type InsertPatch =
|
|
|
466
472
|
* @param options - Listener options
|
|
467
473
|
* @internal
|
|
468
474
|
*/
|
|
469
|
-
export declare function _listen<R extends Record<string,
|
|
475
|
+
export declare function _listen<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
470
476
|
this: SanityClient,
|
|
471
477
|
query: string,
|
|
472
478
|
params?: QueryParams
|
|
@@ -480,7 +486,7 @@ export declare function _listen<R extends Record<string, any> = Record<string, a
|
|
|
480
486
|
* @param options - Listener options
|
|
481
487
|
* @internal
|
|
482
488
|
*/
|
|
483
|
-
export declare function _listen<R extends Record<string,
|
|
489
|
+
export declare function _listen<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
484
490
|
this: SanityClient,
|
|
485
491
|
query: string,
|
|
486
492
|
params?: QueryParams,
|
|
@@ -488,7 +494,7 @@ export declare function _listen<R extends Record<string, any> = Record<string, a
|
|
|
488
494
|
): Observable<ListenEvent<R>>
|
|
489
495
|
|
|
490
496
|
/** @public */
|
|
491
|
-
export declare type ListenEvent<R extends Record<string,
|
|
497
|
+
export declare type ListenEvent<R extends Record<string, FIXME>> =
|
|
492
498
|
| MutationEvent_2<R>
|
|
493
499
|
| ChannelErrorEvent
|
|
494
500
|
| DisconnectEvent
|
|
@@ -519,7 +525,7 @@ export declare interface MultipleMutationResult {
|
|
|
519
525
|
}
|
|
520
526
|
|
|
521
527
|
/** @public */
|
|
522
|
-
export declare type Mutation<R extends Record<string,
|
|
528
|
+
export declare type Mutation<R extends Record<string, FIXME> = Record<string, FIXME>> =
|
|
523
529
|
| {
|
|
524
530
|
create: SanityDocumentStub<R>
|
|
525
531
|
}
|
|
@@ -537,7 +543,7 @@ export declare type Mutation<R extends Record<string, any> = Record<string, any>
|
|
|
537
543
|
}
|
|
538
544
|
|
|
539
545
|
/** @public */
|
|
540
|
-
declare type MutationEvent_2<R extends Record<string,
|
|
546
|
+
declare type MutationEvent_2<R extends Record<string, FIXME> = Record<string, FIXME>> = {
|
|
541
547
|
type: 'mutation'
|
|
542
548
|
documentId: string
|
|
543
549
|
eventId: string
|
|
@@ -682,7 +688,7 @@ export declare class ObservablePatch extends BasePatch {
|
|
|
682
688
|
*
|
|
683
689
|
* @param options - Options for the mutation operation
|
|
684
690
|
*/
|
|
685
|
-
commit<R extends Record<string,
|
|
691
|
+
commit<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
686
692
|
options: FirstDocumentMutationOptions
|
|
687
693
|
): Observable<SanityDocument<R>>
|
|
688
694
|
/**
|
|
@@ -690,7 +696,7 @@ export declare class ObservablePatch extends BasePatch {
|
|
|
690
696
|
*
|
|
691
697
|
* @param options - Options for the mutation operation
|
|
692
698
|
*/
|
|
693
|
-
commit<R extends Record<string,
|
|
699
|
+
commit<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
694
700
|
options: AllDocumentsMutationOptions
|
|
695
701
|
): Observable<SanityDocument<R>[]>
|
|
696
702
|
/**
|
|
@@ -710,7 +716,7 @@ export declare class ObservablePatch extends BasePatch {
|
|
|
710
716
|
*
|
|
711
717
|
* @param options - Options for the mutation operation
|
|
712
718
|
*/
|
|
713
|
-
commit<R extends Record<string,
|
|
719
|
+
commit<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
714
720
|
options?: BaseMutationOptions
|
|
715
721
|
): Observable<SanityDocument<R>>
|
|
716
722
|
}
|
|
@@ -766,14 +772,14 @@ export declare class ObservableSanityClient {
|
|
|
766
772
|
*
|
|
767
773
|
* @param query - GROQ-query to perform
|
|
768
774
|
*/
|
|
769
|
-
fetch<R =
|
|
775
|
+
fetch<R = FIXME>(query: string): Observable<R>
|
|
770
776
|
/**
|
|
771
777
|
* Perform a GROQ-query against the configured dataset.
|
|
772
778
|
*
|
|
773
779
|
* @param query - GROQ-query to perform
|
|
774
780
|
* @param params - Query parameters
|
|
775
781
|
*/
|
|
776
|
-
fetch<R =
|
|
782
|
+
fetch<R = FIXME>(query: string, params: QueryParams): Observable<R>
|
|
777
783
|
/**
|
|
778
784
|
* Perform a GROQ-query against the configured dataset.
|
|
779
785
|
*
|
|
@@ -781,7 +787,7 @@ export declare class ObservableSanityClient {
|
|
|
781
787
|
* @param params - Query parameters
|
|
782
788
|
* @param options - Request options
|
|
783
789
|
*/
|
|
784
|
-
fetch<R =
|
|
790
|
+
fetch<R = FIXME>(
|
|
785
791
|
query: string,
|
|
786
792
|
params: QueryParams | undefined,
|
|
787
793
|
options: FilteredResponseQueryOptions
|
|
@@ -793,7 +799,7 @@ export declare class ObservableSanityClient {
|
|
|
793
799
|
* @param params - Query parameters
|
|
794
800
|
* @param options - Request options
|
|
795
801
|
*/
|
|
796
|
-
fetch<R =
|
|
802
|
+
fetch<R = FIXME>(
|
|
797
803
|
query: string,
|
|
798
804
|
params: QueryParams | undefined,
|
|
799
805
|
options: UnfilteredResponseQueryOptions
|
|
@@ -804,7 +810,7 @@ export declare class ObservableSanityClient {
|
|
|
804
810
|
* @param id - Document ID to fetch
|
|
805
811
|
* @param options - Request options
|
|
806
812
|
*/
|
|
807
|
-
getDocument<R extends Record<string,
|
|
813
|
+
getDocument<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
808
814
|
id: string,
|
|
809
815
|
options?: {
|
|
810
816
|
tag?: string
|
|
@@ -814,12 +820,12 @@ export declare class ObservableSanityClient {
|
|
|
814
820
|
* Fetch multiple documents in one request.
|
|
815
821
|
* Should be used sparingly - performing a query is usually a better option.
|
|
816
822
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
817
|
-
* If a
|
|
823
|
+
* If a FIXME of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
818
824
|
*
|
|
819
825
|
* @param ids - Document IDs to fetch
|
|
820
826
|
* @param options - Request options
|
|
821
827
|
*/
|
|
822
|
-
getDocuments<R extends Record<string,
|
|
828
|
+
getDocuments<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
823
829
|
ids: string[],
|
|
824
830
|
options?: {
|
|
825
831
|
tag?: string
|
|
@@ -832,7 +838,7 @@ export declare class ObservableSanityClient {
|
|
|
832
838
|
* @param document - Document to create
|
|
833
839
|
* @param options - Mutation options
|
|
834
840
|
*/
|
|
835
|
-
create<R extends Record<string,
|
|
841
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
836
842
|
document: SanityDocumentStub<R>,
|
|
837
843
|
options: FirstDocumentMutationOptions
|
|
838
844
|
): Observable<SanityDocument<R>>
|
|
@@ -843,7 +849,7 @@ export declare class ObservableSanityClient {
|
|
|
843
849
|
* @param document - Document to create
|
|
844
850
|
* @param options - Mutation options
|
|
845
851
|
*/
|
|
846
|
-
create<R extends Record<string,
|
|
852
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
847
853
|
document: SanityDocumentStub<R>,
|
|
848
854
|
options: AllDocumentsMutationOptions
|
|
849
855
|
): Observable<SanityDocument<R>[]>
|
|
@@ -854,7 +860,7 @@ export declare class ObservableSanityClient {
|
|
|
854
860
|
* @param document - Document to create
|
|
855
861
|
* @param options - Mutation options
|
|
856
862
|
*/
|
|
857
|
-
create<R extends Record<string,
|
|
863
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
858
864
|
document: SanityDocumentStub<R>,
|
|
859
865
|
options: FirstDocumentIdMutationOptions
|
|
860
866
|
): Observable<SingleMutationResult>
|
|
@@ -865,7 +871,7 @@ export declare class ObservableSanityClient {
|
|
|
865
871
|
* @param document - Document to create
|
|
866
872
|
* @param options - Mutation options
|
|
867
873
|
*/
|
|
868
|
-
create<R extends Record<string,
|
|
874
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
869
875
|
document: SanityDocumentStub<R>,
|
|
870
876
|
options: AllDocumentIdsMutationOptions
|
|
871
877
|
): Observable<MultipleMutationResult>
|
|
@@ -876,7 +882,7 @@ export declare class ObservableSanityClient {
|
|
|
876
882
|
* @param document - Document to create
|
|
877
883
|
* @param options - Mutation options
|
|
878
884
|
*/
|
|
879
|
-
create<R extends Record<string,
|
|
885
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
880
886
|
document: SanityDocumentStub<R>,
|
|
881
887
|
options?: BaseMutationOptions
|
|
882
888
|
): Observable<SanityDocument<R>>
|
|
@@ -887,7 +893,7 @@ export declare class ObservableSanityClient {
|
|
|
887
893
|
* @param document - Document to create
|
|
888
894
|
* @param options - Mutation options
|
|
889
895
|
*/
|
|
890
|
-
createIfNotExists<R extends Record<string,
|
|
896
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
891
897
|
document: IdentifiedSanityDocumentStub<R>,
|
|
892
898
|
options: FirstDocumentMutationOptions
|
|
893
899
|
): Observable<SanityDocument<R>>
|
|
@@ -898,7 +904,7 @@ export declare class ObservableSanityClient {
|
|
|
898
904
|
* @param document - Document to create
|
|
899
905
|
* @param options - Mutation options
|
|
900
906
|
*/
|
|
901
|
-
createIfNotExists<R extends Record<string,
|
|
907
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
902
908
|
document: IdentifiedSanityDocumentStub<R>,
|
|
903
909
|
options: AllDocumentsMutationOptions
|
|
904
910
|
): Observable<SanityDocument<R>[]>
|
|
@@ -909,7 +915,7 @@ export declare class ObservableSanityClient {
|
|
|
909
915
|
* @param document - Document to create
|
|
910
916
|
* @param options - Mutation options
|
|
911
917
|
*/
|
|
912
|
-
createIfNotExists<R extends Record<string,
|
|
918
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
913
919
|
document: IdentifiedSanityDocumentStub<R>,
|
|
914
920
|
options: FirstDocumentIdMutationOptions
|
|
915
921
|
): Observable<SingleMutationResult>
|
|
@@ -920,7 +926,7 @@ export declare class ObservableSanityClient {
|
|
|
920
926
|
* @param document - Document to create
|
|
921
927
|
* @param options - Mutation options
|
|
922
928
|
*/
|
|
923
|
-
createIfNotExists<R extends Record<string,
|
|
929
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
924
930
|
document: IdentifiedSanityDocumentStub<R>,
|
|
925
931
|
options: AllDocumentIdsMutationOptions
|
|
926
932
|
): Observable<MultipleMutationResult>
|
|
@@ -931,7 +937,7 @@ export declare class ObservableSanityClient {
|
|
|
931
937
|
* @param document - Document to create
|
|
932
938
|
* @param options - Mutation options
|
|
933
939
|
*/
|
|
934
|
-
createIfNotExists<R extends Record<string,
|
|
940
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
935
941
|
document: IdentifiedSanityDocumentStub<R>,
|
|
936
942
|
options?: BaseMutationOptions
|
|
937
943
|
): Observable<SanityDocument<R>>
|
|
@@ -942,7 +948,7 @@ export declare class ObservableSanityClient {
|
|
|
942
948
|
* @param document - Document to either create or replace
|
|
943
949
|
* @param options - Mutation options
|
|
944
950
|
*/
|
|
945
|
-
createOrReplace<R extends Record<string,
|
|
951
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
946
952
|
document: IdentifiedSanityDocumentStub<R>,
|
|
947
953
|
options: FirstDocumentMutationOptions
|
|
948
954
|
): Observable<SanityDocument<R>>
|
|
@@ -953,7 +959,7 @@ export declare class ObservableSanityClient {
|
|
|
953
959
|
* @param document - Document to either create or replace
|
|
954
960
|
* @param options - Mutation options
|
|
955
961
|
*/
|
|
956
|
-
createOrReplace<R extends Record<string,
|
|
962
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
957
963
|
document: IdentifiedSanityDocumentStub<R>,
|
|
958
964
|
options: AllDocumentsMutationOptions
|
|
959
965
|
): Observable<SanityDocument<R>[]>
|
|
@@ -964,7 +970,7 @@ export declare class ObservableSanityClient {
|
|
|
964
970
|
* @param document - Document to either create or replace
|
|
965
971
|
* @param options - Mutation options
|
|
966
972
|
*/
|
|
967
|
-
createOrReplace<R extends Record<string,
|
|
973
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
968
974
|
document: IdentifiedSanityDocumentStub<R>,
|
|
969
975
|
options: FirstDocumentIdMutationOptions
|
|
970
976
|
): Observable<SingleMutationResult>
|
|
@@ -975,7 +981,7 @@ export declare class ObservableSanityClient {
|
|
|
975
981
|
* @param document - Document to either create or replace
|
|
976
982
|
* @param options - Mutation options
|
|
977
983
|
*/
|
|
978
|
-
createOrReplace<R extends Record<string,
|
|
984
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
979
985
|
document: IdentifiedSanityDocumentStub<R>,
|
|
980
986
|
options: AllDocumentIdsMutationOptions
|
|
981
987
|
): Observable<MultipleMutationResult>
|
|
@@ -986,7 +992,7 @@ export declare class ObservableSanityClient {
|
|
|
986
992
|
* @param document - Document to either create or replace
|
|
987
993
|
* @param options - Mutation options
|
|
988
994
|
*/
|
|
989
|
-
createOrReplace<R extends Record<string,
|
|
995
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
990
996
|
document: IdentifiedSanityDocumentStub<R>,
|
|
991
997
|
options?: BaseMutationOptions
|
|
992
998
|
): Observable<SanityDocument<R>>
|
|
@@ -997,7 +1003,7 @@ export declare class ObservableSanityClient {
|
|
|
997
1003
|
* @param id - Document ID to delete
|
|
998
1004
|
* @param options - Options for the mutation
|
|
999
1005
|
*/
|
|
1000
|
-
delete<R extends Record<string,
|
|
1006
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1001
1007
|
id: string,
|
|
1002
1008
|
options: FirstDocumentMutationOptions
|
|
1003
1009
|
): Observable<SanityDocument<R>>
|
|
@@ -1008,7 +1014,7 @@ export declare class ObservableSanityClient {
|
|
|
1008
1014
|
* @param id - Document ID to delete
|
|
1009
1015
|
* @param options - Options for the mutation
|
|
1010
1016
|
*/
|
|
1011
|
-
delete<R extends Record<string,
|
|
1017
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1012
1018
|
id: string,
|
|
1013
1019
|
options: AllDocumentsMutationOptions
|
|
1014
1020
|
): Observable<SanityDocument<R>[]>
|
|
@@ -1035,7 +1041,7 @@ export declare class ObservableSanityClient {
|
|
|
1035
1041
|
* @param id - Document ID to delete
|
|
1036
1042
|
* @param options - Options for the mutation
|
|
1037
1043
|
*/
|
|
1038
|
-
delete<R extends Record<string,
|
|
1044
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1039
1045
|
id: string,
|
|
1040
1046
|
options?: BaseMutationOptions
|
|
1041
1047
|
): Observable<SanityDocument<R>>
|
|
@@ -1046,7 +1052,7 @@ export declare class ObservableSanityClient {
|
|
|
1046
1052
|
* @param selection - An object with either an `id` or `query` key defining what to delete
|
|
1047
1053
|
* @param options - Options for the mutation
|
|
1048
1054
|
*/
|
|
1049
|
-
delete<R extends Record<string,
|
|
1055
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1050
1056
|
selection: MutationSelection,
|
|
1051
1057
|
options: FirstDocumentMutationOptions
|
|
1052
1058
|
): Observable<SanityDocument<R>>
|
|
@@ -1057,7 +1063,7 @@ export declare class ObservableSanityClient {
|
|
|
1057
1063
|
* @param selection - An object with either an `id` or `query` key defining what to delete
|
|
1058
1064
|
* @param options - Options for the mutation
|
|
1059
1065
|
*/
|
|
1060
|
-
delete<R extends Record<string,
|
|
1066
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1061
1067
|
selection: MutationSelection,
|
|
1062
1068
|
options: AllDocumentsMutationOptions
|
|
1063
1069
|
): Observable<SanityDocument<R>[]>
|
|
@@ -1090,7 +1096,7 @@ export declare class ObservableSanityClient {
|
|
|
1090
1096
|
* @param selection - An object with either an `id` or `query` key defining what to delete
|
|
1091
1097
|
* @param options - Options for the mutation
|
|
1092
1098
|
*/
|
|
1093
|
-
delete<R extends Record<string,
|
|
1099
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1094
1100
|
selection: MutationSelection,
|
|
1095
1101
|
options?: BaseMutationOptions
|
|
1096
1102
|
): Observable<SanityDocument<R>>
|
|
@@ -1101,7 +1107,7 @@ export declare class ObservableSanityClient {
|
|
|
1101
1107
|
* @param operations - Mutation operations to execute
|
|
1102
1108
|
* @param options - Mutation options
|
|
1103
1109
|
*/
|
|
1104
|
-
mutate<R extends Record<string,
|
|
1110
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1105
1111
|
operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
|
|
1106
1112
|
options: FirstDocumentMutationOptions
|
|
1107
1113
|
): Observable<SanityDocument<R>>
|
|
@@ -1112,7 +1118,7 @@ export declare class ObservableSanityClient {
|
|
|
1112
1118
|
* @param operations - Mutation operations to execute
|
|
1113
1119
|
* @param options - Mutation options
|
|
1114
1120
|
*/
|
|
1115
|
-
mutate<R extends Record<string,
|
|
1121
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1116
1122
|
operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
|
|
1117
1123
|
options: AllDocumentsMutationOptions
|
|
1118
1124
|
): Observable<SanityDocument<R>[]>
|
|
@@ -1123,7 +1129,7 @@ export declare class ObservableSanityClient {
|
|
|
1123
1129
|
* @param operations - Mutation operations to execute
|
|
1124
1130
|
* @param options - Mutation options
|
|
1125
1131
|
*/
|
|
1126
|
-
mutate<R extends Record<string,
|
|
1132
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1127
1133
|
operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
|
|
1128
1134
|
options: FirstDocumentIdMutationOptions
|
|
1129
1135
|
): Observable<SingleMutationResult>
|
|
@@ -1134,7 +1140,7 @@ export declare class ObservableSanityClient {
|
|
|
1134
1140
|
* @param operations - Mutation operations to execute
|
|
1135
1141
|
* @param options - Mutation options
|
|
1136
1142
|
*/
|
|
1137
|
-
mutate<R extends Record<string,
|
|
1143
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1138
1144
|
operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
|
|
1139
1145
|
options: AllDocumentIdsMutationOptions
|
|
1140
1146
|
): Observable<MultipleMutationResult>
|
|
@@ -1145,7 +1151,7 @@ export declare class ObservableSanityClient {
|
|
|
1145
1151
|
* @param operations - Mutation operations to execute
|
|
1146
1152
|
* @param options - Mutation options
|
|
1147
1153
|
*/
|
|
1148
|
-
mutate<R extends Record<string,
|
|
1154
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1149
1155
|
operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
|
|
1150
1156
|
options?: BaseMutationOptions
|
|
1151
1157
|
): Observable<SanityDocument<R>>
|
|
@@ -1161,7 +1167,7 @@ export declare class ObservableSanityClient {
|
|
|
1161
1167
|
*
|
|
1162
1168
|
* @param operations - Optional array of mutation operations to initialize the transaction instance with
|
|
1163
1169
|
*/
|
|
1164
|
-
transaction<R extends Record<string,
|
|
1170
|
+
transaction<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1165
1171
|
operations?: Mutation<R>[]
|
|
1166
1172
|
): ObservableTransaction
|
|
1167
1173
|
/**
|
|
@@ -1170,7 +1176,7 @@ export declare class ObservableSanityClient {
|
|
|
1170
1176
|
* @deprecated Use your own request library!
|
|
1171
1177
|
* @param options - Request options
|
|
1172
1178
|
*/
|
|
1173
|
-
request<R =
|
|
1179
|
+
request<R = FIXME>(options: RawRequestOptions): Observable<R>
|
|
1174
1180
|
}
|
|
1175
1181
|
|
|
1176
1182
|
/** @public */
|
|
@@ -1186,7 +1192,7 @@ export declare class ObservableTransaction extends BaseTransaction {
|
|
|
1186
1192
|
*
|
|
1187
1193
|
* @param options - Options for the mutation operation
|
|
1188
1194
|
*/
|
|
1189
|
-
commit<R extends Record<string,
|
|
1195
|
+
commit<R extends Record<string, FIXME>>(
|
|
1190
1196
|
options: TransactionFirstDocumentMutationOptions
|
|
1191
1197
|
): Observable<SanityDocument<R>>
|
|
1192
1198
|
/**
|
|
@@ -1194,7 +1200,7 @@ export declare class ObservableTransaction extends BaseTransaction {
|
|
|
1194
1200
|
*
|
|
1195
1201
|
* @param options - Options for the mutation operation
|
|
1196
1202
|
*/
|
|
1197
|
-
commit<R extends Record<string,
|
|
1203
|
+
commit<R extends Record<string, FIXME>>(
|
|
1198
1204
|
options: TransactionAllDocumentsMutationOptions
|
|
1199
1205
|
): Observable<SanityDocument<R>[]>
|
|
1200
1206
|
/**
|
|
@@ -1259,7 +1265,7 @@ export declare class Patch extends BasePatch {
|
|
|
1259
1265
|
*
|
|
1260
1266
|
* @param options - Options for the mutation operation
|
|
1261
1267
|
*/
|
|
1262
|
-
commit<R extends Record<string,
|
|
1268
|
+
commit<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1263
1269
|
options: FirstDocumentMutationOptions
|
|
1264
1270
|
): Promise<SanityDocument<R>>
|
|
1265
1271
|
/**
|
|
@@ -1267,7 +1273,7 @@ export declare class Patch extends BasePatch {
|
|
|
1267
1273
|
*
|
|
1268
1274
|
* @param options - Options for the mutation operation
|
|
1269
1275
|
*/
|
|
1270
|
-
commit<R extends Record<string,
|
|
1276
|
+
commit<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1271
1277
|
options: AllDocumentsMutationOptions
|
|
1272
1278
|
): Promise<SanityDocument<R>[]>
|
|
1273
1279
|
/**
|
|
@@ -1287,7 +1293,7 @@ export declare class Patch extends BasePatch {
|
|
|
1287
1293
|
*
|
|
1288
1294
|
* @param options - Options for the mutation operation
|
|
1289
1295
|
*/
|
|
1290
|
-
commit<R extends Record<string,
|
|
1296
|
+
commit<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1291
1297
|
options?: BaseMutationOptions
|
|
1292
1298
|
): Promise<SanityDocument<R>>
|
|
1293
1299
|
}
|
|
@@ -1301,13 +1307,13 @@ export declare type PatchMutationOperation = PatchOperations & MutationSelection
|
|
|
1301
1307
|
/** @internal */
|
|
1302
1308
|
export declare interface PatchOperations {
|
|
1303
1309
|
set?: {
|
|
1304
|
-
[key: string]:
|
|
1310
|
+
[key: string]: FIXME
|
|
1305
1311
|
}
|
|
1306
1312
|
setIfMissing?: {
|
|
1307
|
-
[key: string]:
|
|
1313
|
+
[key: string]: FIXME
|
|
1308
1314
|
}
|
|
1309
1315
|
diffMatchPatch?: {
|
|
1310
|
-
[key: string]:
|
|
1316
|
+
[key: string]: FIXME
|
|
1311
1317
|
}
|
|
1312
1318
|
unset?: string[]
|
|
1313
1319
|
inc?: {
|
|
@@ -1352,7 +1358,7 @@ export declare class ProjectsClient {
|
|
|
1352
1358
|
|
|
1353
1359
|
/** @public */
|
|
1354
1360
|
export declare type QueryParams = {
|
|
1355
|
-
[key: string]:
|
|
1361
|
+
[key: string]: FIXME
|
|
1356
1362
|
}
|
|
1357
1363
|
|
|
1358
1364
|
/** @internal */
|
|
@@ -1380,7 +1386,7 @@ export declare interface RawRequestOptions {
|
|
|
1380
1386
|
}
|
|
1381
1387
|
timeout?: number
|
|
1382
1388
|
proxy?: string
|
|
1383
|
-
body?:
|
|
1389
|
+
body?: FIXME
|
|
1384
1390
|
maxRedirects?: number
|
|
1385
1391
|
}
|
|
1386
1392
|
|
|
@@ -1407,8 +1413,8 @@ export declare interface RequestOptions {
|
|
|
1407
1413
|
tag?: string
|
|
1408
1414
|
headers?: Record<string, string>
|
|
1409
1415
|
method?: string
|
|
1410
|
-
query?:
|
|
1411
|
-
body?:
|
|
1416
|
+
query?: FIXME
|
|
1417
|
+
body?: FIXME
|
|
1412
1418
|
}
|
|
1413
1419
|
|
|
1414
1420
|
/** @public */
|
|
@@ -1475,14 +1481,14 @@ export declare class SanityClient {
|
|
|
1475
1481
|
*
|
|
1476
1482
|
* @param query - GROQ-query to perform
|
|
1477
1483
|
*/
|
|
1478
|
-
fetch<R =
|
|
1484
|
+
fetch<R = FIXME>(query: string): Promise<R>
|
|
1479
1485
|
/**
|
|
1480
1486
|
* Perform a GROQ-query against the configured dataset.
|
|
1481
1487
|
*
|
|
1482
1488
|
* @param query - GROQ-query to perform
|
|
1483
1489
|
* @param params - Optional query parameters
|
|
1484
1490
|
*/
|
|
1485
|
-
fetch<R =
|
|
1491
|
+
fetch<R = FIXME>(query: string, params: QueryParams): Promise<R>
|
|
1486
1492
|
/**
|
|
1487
1493
|
* Perform a GROQ-query against the configured dataset.
|
|
1488
1494
|
*
|
|
@@ -1490,7 +1496,7 @@ export declare class SanityClient {
|
|
|
1490
1496
|
* @param params - Optional query parameters
|
|
1491
1497
|
* @param options - Request options
|
|
1492
1498
|
*/
|
|
1493
|
-
fetch<R =
|
|
1499
|
+
fetch<R = FIXME>(
|
|
1494
1500
|
query: string,
|
|
1495
1501
|
params: QueryParams | undefined,
|
|
1496
1502
|
options: FilteredResponseQueryOptions
|
|
@@ -1502,7 +1508,7 @@ export declare class SanityClient {
|
|
|
1502
1508
|
* @param params - Optional query parameters
|
|
1503
1509
|
* @param options - Request options
|
|
1504
1510
|
*/
|
|
1505
|
-
fetch<R =
|
|
1511
|
+
fetch<R = FIXME>(
|
|
1506
1512
|
query: string,
|
|
1507
1513
|
params: QueryParams | undefined,
|
|
1508
1514
|
options: UnfilteredResponseQueryOptions
|
|
@@ -1513,7 +1519,7 @@ export declare class SanityClient {
|
|
|
1513
1519
|
* @param id - Document ID to fetch
|
|
1514
1520
|
* @param options - Request options
|
|
1515
1521
|
*/
|
|
1516
|
-
getDocument<R extends Record<string,
|
|
1522
|
+
getDocument<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1517
1523
|
id: string,
|
|
1518
1524
|
options?: {
|
|
1519
1525
|
tag?: string
|
|
@@ -1523,12 +1529,12 @@ export declare class SanityClient {
|
|
|
1523
1529
|
* Fetch multiple documents in one request.
|
|
1524
1530
|
* Should be used sparingly - performing a query is usually a better option.
|
|
1525
1531
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
1526
|
-
* If a
|
|
1532
|
+
* If a FIXME of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
1527
1533
|
*
|
|
1528
1534
|
* @param ids - Document IDs to fetch
|
|
1529
1535
|
* @param options - Request options
|
|
1530
1536
|
*/
|
|
1531
|
-
getDocuments<R extends Record<string,
|
|
1537
|
+
getDocuments<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1532
1538
|
ids: string[],
|
|
1533
1539
|
options?: {
|
|
1534
1540
|
tag?: string
|
|
@@ -1541,7 +1547,7 @@ export declare class SanityClient {
|
|
|
1541
1547
|
* @param document - Document to create
|
|
1542
1548
|
* @param options - Mutation options
|
|
1543
1549
|
*/
|
|
1544
|
-
create<R extends Record<string,
|
|
1550
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1545
1551
|
document: SanityDocumentStub<R>,
|
|
1546
1552
|
options: FirstDocumentMutationOptions
|
|
1547
1553
|
): Promise<SanityDocument<R>>
|
|
@@ -1552,7 +1558,7 @@ export declare class SanityClient {
|
|
|
1552
1558
|
* @param document - Document to create
|
|
1553
1559
|
* @param options - Mutation options
|
|
1554
1560
|
*/
|
|
1555
|
-
create<R extends Record<string,
|
|
1561
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1556
1562
|
document: SanityDocumentStub<R>,
|
|
1557
1563
|
options: AllDocumentsMutationOptions
|
|
1558
1564
|
): Promise<SanityDocument<R>[]>
|
|
@@ -1563,7 +1569,7 @@ export declare class SanityClient {
|
|
|
1563
1569
|
* @param document - Document to create
|
|
1564
1570
|
* @param options - Mutation options
|
|
1565
1571
|
*/
|
|
1566
|
-
create<R extends Record<string,
|
|
1572
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1567
1573
|
document: SanityDocumentStub<R>,
|
|
1568
1574
|
options: FirstDocumentIdMutationOptions
|
|
1569
1575
|
): Promise<SingleMutationResult>
|
|
@@ -1574,7 +1580,7 @@ export declare class SanityClient {
|
|
|
1574
1580
|
* @param document - Document to create
|
|
1575
1581
|
* @param options - Mutation options
|
|
1576
1582
|
*/
|
|
1577
|
-
create<R extends Record<string,
|
|
1583
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1578
1584
|
document: SanityDocumentStub<R>,
|
|
1579
1585
|
options: AllDocumentIdsMutationOptions
|
|
1580
1586
|
): Promise<MultipleMutationResult>
|
|
@@ -1585,7 +1591,7 @@ export declare class SanityClient {
|
|
|
1585
1591
|
* @param document - Document to create
|
|
1586
1592
|
* @param options - Mutation options
|
|
1587
1593
|
*/
|
|
1588
|
-
create<R extends Record<string,
|
|
1594
|
+
create<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1589
1595
|
document: SanityDocumentStub<R>,
|
|
1590
1596
|
options?: BaseMutationOptions
|
|
1591
1597
|
): Promise<SanityDocument<R>>
|
|
@@ -1596,7 +1602,7 @@ export declare class SanityClient {
|
|
|
1596
1602
|
* @param document - Document to create
|
|
1597
1603
|
* @param options - Mutation options
|
|
1598
1604
|
*/
|
|
1599
|
-
createIfNotExists<R extends Record<string,
|
|
1605
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1600
1606
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1601
1607
|
options: FirstDocumentMutationOptions
|
|
1602
1608
|
): Promise<SanityDocument<R>>
|
|
@@ -1607,7 +1613,7 @@ export declare class SanityClient {
|
|
|
1607
1613
|
* @param document - Document to create
|
|
1608
1614
|
* @param options - Mutation options
|
|
1609
1615
|
*/
|
|
1610
|
-
createIfNotExists<R extends Record<string,
|
|
1616
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1611
1617
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1612
1618
|
options: AllDocumentsMutationOptions
|
|
1613
1619
|
): Promise<SanityDocument<R>[]>
|
|
@@ -1618,7 +1624,7 @@ export declare class SanityClient {
|
|
|
1618
1624
|
* @param document - Document to create
|
|
1619
1625
|
* @param options - Mutation options
|
|
1620
1626
|
*/
|
|
1621
|
-
createIfNotExists<R extends Record<string,
|
|
1627
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1622
1628
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1623
1629
|
options: FirstDocumentIdMutationOptions
|
|
1624
1630
|
): Promise<SingleMutationResult>
|
|
@@ -1629,7 +1635,7 @@ export declare class SanityClient {
|
|
|
1629
1635
|
* @param document - Document to create
|
|
1630
1636
|
* @param options - Mutation options
|
|
1631
1637
|
*/
|
|
1632
|
-
createIfNotExists<R extends Record<string,
|
|
1638
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1633
1639
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1634
1640
|
options: AllDocumentIdsMutationOptions
|
|
1635
1641
|
): Promise<MultipleMutationResult>
|
|
@@ -1640,7 +1646,7 @@ export declare class SanityClient {
|
|
|
1640
1646
|
* @param document - Document to create
|
|
1641
1647
|
* @param options - Mutation options
|
|
1642
1648
|
*/
|
|
1643
|
-
createIfNotExists<R extends Record<string,
|
|
1649
|
+
createIfNotExists<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1644
1650
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1645
1651
|
options?: BaseMutationOptions
|
|
1646
1652
|
): Promise<SanityDocument<R>>
|
|
@@ -1651,7 +1657,7 @@ export declare class SanityClient {
|
|
|
1651
1657
|
* @param document - Document to either create or replace
|
|
1652
1658
|
* @param options - Mutation options
|
|
1653
1659
|
*/
|
|
1654
|
-
createOrReplace<R extends Record<string,
|
|
1660
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1655
1661
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1656
1662
|
options: FirstDocumentMutationOptions
|
|
1657
1663
|
): Promise<SanityDocument<R>>
|
|
@@ -1662,7 +1668,7 @@ export declare class SanityClient {
|
|
|
1662
1668
|
* @param document - Document to either create or replace
|
|
1663
1669
|
* @param options - Mutation options
|
|
1664
1670
|
*/
|
|
1665
|
-
createOrReplace<R extends Record<string,
|
|
1671
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1666
1672
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1667
1673
|
options: AllDocumentsMutationOptions
|
|
1668
1674
|
): Promise<SanityDocument<R>[]>
|
|
@@ -1673,7 +1679,7 @@ export declare class SanityClient {
|
|
|
1673
1679
|
* @param document - Document to either create or replace
|
|
1674
1680
|
* @param options - Mutation options
|
|
1675
1681
|
*/
|
|
1676
|
-
createOrReplace<R extends Record<string,
|
|
1682
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1677
1683
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1678
1684
|
options: FirstDocumentIdMutationOptions
|
|
1679
1685
|
): Promise<SingleMutationResult>
|
|
@@ -1684,7 +1690,7 @@ export declare class SanityClient {
|
|
|
1684
1690
|
* @param document - Document to either create or replace
|
|
1685
1691
|
* @param options - Mutation options
|
|
1686
1692
|
*/
|
|
1687
|
-
createOrReplace<R extends Record<string,
|
|
1693
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1688
1694
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1689
1695
|
options: AllDocumentIdsMutationOptions
|
|
1690
1696
|
): Promise<MultipleMutationResult>
|
|
@@ -1695,7 +1701,7 @@ export declare class SanityClient {
|
|
|
1695
1701
|
* @param document - Document to either create or replace
|
|
1696
1702
|
* @param options - Mutation options
|
|
1697
1703
|
*/
|
|
1698
|
-
createOrReplace<R extends Record<string,
|
|
1704
|
+
createOrReplace<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1699
1705
|
document: IdentifiedSanityDocumentStub<R>,
|
|
1700
1706
|
options?: BaseMutationOptions
|
|
1701
1707
|
): Promise<SanityDocument<R>>
|
|
@@ -1706,7 +1712,7 @@ export declare class SanityClient {
|
|
|
1706
1712
|
* @param id - Document ID to delete
|
|
1707
1713
|
* @param options - Options for the mutation
|
|
1708
1714
|
*/
|
|
1709
|
-
delete<R extends Record<string,
|
|
1715
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1710
1716
|
id: string,
|
|
1711
1717
|
options: FirstDocumentMutationOptions
|
|
1712
1718
|
): Promise<SanityDocument<R>>
|
|
@@ -1717,7 +1723,7 @@ export declare class SanityClient {
|
|
|
1717
1723
|
* @param id - Document ID to delete
|
|
1718
1724
|
* @param options - Options for the mutation
|
|
1719
1725
|
*/
|
|
1720
|
-
delete<R extends Record<string,
|
|
1726
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1721
1727
|
id: string,
|
|
1722
1728
|
options: AllDocumentsMutationOptions
|
|
1723
1729
|
): Promise<SanityDocument<R>[]>
|
|
@@ -1744,7 +1750,7 @@ export declare class SanityClient {
|
|
|
1744
1750
|
* @param id - Document ID to delete
|
|
1745
1751
|
* @param options - Options for the mutation
|
|
1746
1752
|
*/
|
|
1747
|
-
delete<R extends Record<string,
|
|
1753
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1748
1754
|
id: string,
|
|
1749
1755
|
options?: BaseMutationOptions
|
|
1750
1756
|
): Promise<SanityDocument<R>>
|
|
@@ -1755,7 +1761,7 @@ export declare class SanityClient {
|
|
|
1755
1761
|
* @param selection - An object with either an `id` or `query` key defining what to delete
|
|
1756
1762
|
* @param options - Options for the mutation
|
|
1757
1763
|
*/
|
|
1758
|
-
delete<R extends Record<string,
|
|
1764
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1759
1765
|
selection: MutationSelection,
|
|
1760
1766
|
options: FirstDocumentMutationOptions
|
|
1761
1767
|
): Promise<SanityDocument<R>>
|
|
@@ -1766,7 +1772,7 @@ export declare class SanityClient {
|
|
|
1766
1772
|
* @param selection - An object with either an `id` or `query` key defining what to delete
|
|
1767
1773
|
* @param options - Options for the mutation
|
|
1768
1774
|
*/
|
|
1769
|
-
delete<R extends Record<string,
|
|
1775
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1770
1776
|
selection: MutationSelection,
|
|
1771
1777
|
options: AllDocumentsMutationOptions
|
|
1772
1778
|
): Promise<SanityDocument<R>[]>
|
|
@@ -1799,7 +1805,7 @@ export declare class SanityClient {
|
|
|
1799
1805
|
* @param selection - An object with either an `id` or `query` key defining what to delete
|
|
1800
1806
|
* @param options - Options for the mutation
|
|
1801
1807
|
*/
|
|
1802
|
-
delete<R extends Record<string,
|
|
1808
|
+
delete<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1803
1809
|
selection: MutationSelection,
|
|
1804
1810
|
options?: BaseMutationOptions
|
|
1805
1811
|
): Promise<SanityDocument<R>>
|
|
@@ -1810,7 +1816,7 @@ export declare class SanityClient {
|
|
|
1810
1816
|
* @param operations - Mutation operations to execute
|
|
1811
1817
|
* @param options - Mutation options
|
|
1812
1818
|
*/
|
|
1813
|
-
mutate<R extends Record<string,
|
|
1819
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1814
1820
|
operations: Mutation<R>[] | Patch | Transaction,
|
|
1815
1821
|
options: FirstDocumentMutationOptions
|
|
1816
1822
|
): Promise<SanityDocument<R>>
|
|
@@ -1821,7 +1827,7 @@ export declare class SanityClient {
|
|
|
1821
1827
|
* @param operations - Mutation operations to execute
|
|
1822
1828
|
* @param options - Mutation options
|
|
1823
1829
|
*/
|
|
1824
|
-
mutate<R extends Record<string,
|
|
1830
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1825
1831
|
operations: Mutation<R>[] | Patch | Transaction,
|
|
1826
1832
|
options: AllDocumentsMutationOptions
|
|
1827
1833
|
): Promise<SanityDocument<R>[]>
|
|
@@ -1832,7 +1838,7 @@ export declare class SanityClient {
|
|
|
1832
1838
|
* @param operations - Mutation operations to execute
|
|
1833
1839
|
* @param options - Mutation options
|
|
1834
1840
|
*/
|
|
1835
|
-
mutate<R extends Record<string,
|
|
1841
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1836
1842
|
operations: Mutation<R>[] | Patch | Transaction,
|
|
1837
1843
|
options: FirstDocumentIdMutationOptions
|
|
1838
1844
|
): Promise<SingleMutationResult>
|
|
@@ -1843,7 +1849,7 @@ export declare class SanityClient {
|
|
|
1843
1849
|
* @param operations - Mutation operations to execute
|
|
1844
1850
|
* @param options - Mutation options
|
|
1845
1851
|
*/
|
|
1846
|
-
mutate<R extends Record<string,
|
|
1852
|
+
mutate<R extends Record<string, FIXME>>(
|
|
1847
1853
|
operations: Mutation<R>[] | Patch | Transaction,
|
|
1848
1854
|
options: AllDocumentIdsMutationOptions
|
|
1849
1855
|
): Promise<MultipleMutationResult>
|
|
@@ -1854,7 +1860,7 @@ export declare class SanityClient {
|
|
|
1854
1860
|
* @param operations - Mutation operations to execute
|
|
1855
1861
|
* @param options - Mutation options
|
|
1856
1862
|
*/
|
|
1857
|
-
mutate<R extends Record<string,
|
|
1863
|
+
mutate<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1858
1864
|
operations: Mutation<R>[] | Patch | Transaction,
|
|
1859
1865
|
options?: BaseMutationOptions
|
|
1860
1866
|
): Promise<SanityDocument<R>>
|
|
@@ -1870,7 +1876,7 @@ export declare class SanityClient {
|
|
|
1870
1876
|
*
|
|
1871
1877
|
* @param operations - Optional array of mutation operations to initialize the transaction instance with
|
|
1872
1878
|
*/
|
|
1873
|
-
transaction<R extends Record<string,
|
|
1879
|
+
transaction<R extends Record<string, FIXME> = Record<string, FIXME>>(
|
|
1874
1880
|
operations?: Mutation<R>[]
|
|
1875
1881
|
): Transaction
|
|
1876
1882
|
/**
|
|
@@ -1879,7 +1885,7 @@ export declare class SanityClient {
|
|
|
1879
1885
|
* @deprecated Use your own request library!
|
|
1880
1886
|
* @param options - Request options
|
|
1881
1887
|
*/
|
|
1882
|
-
request<R =
|
|
1888
|
+
request<R = FIXME>(options: RawRequestOptions): Promise<R>
|
|
1883
1889
|
/**
|
|
1884
1890
|
* DEPRECATED: Perform an HTTP request a `/data` sub-endpoint
|
|
1885
1891
|
*
|
|
@@ -1888,11 +1894,11 @@ export declare class SanityClient {
|
|
|
1888
1894
|
* @param body - Request body
|
|
1889
1895
|
* @param options - Request options
|
|
1890
1896
|
*/
|
|
1891
|
-
dataRequest(endpoint: string, body: unknown, options?: BaseMutationOptions): Promise<
|
|
1897
|
+
dataRequest(endpoint: string, body: unknown, options?: BaseMutationOptions): Promise<FIXME>
|
|
1892
1898
|
}
|
|
1893
1899
|
|
|
1894
1900
|
/** @internal */
|
|
1895
|
-
export declare type SanityDocument<T extends Record<string,
|
|
1901
|
+
export declare type SanityDocument<T extends Record<string, FIXME> = Record<string, FIXME>> = {
|
|
1896
1902
|
[P in keyof T]: T[P]
|
|
1897
1903
|
} & {
|
|
1898
1904
|
_id: string
|
|
@@ -1903,7 +1909,7 @@ export declare type SanityDocument<T extends Record<string, any> = Record<string
|
|
|
1903
1909
|
}
|
|
1904
1910
|
|
|
1905
1911
|
/** @public */
|
|
1906
|
-
export declare type SanityDocumentStub<T extends Record<string,
|
|
1912
|
+
export declare type SanityDocumentStub<T extends Record<string, FIXME> = Record<string, FIXME>> = {
|
|
1907
1913
|
[P in keyof T]: T[P]
|
|
1908
1914
|
} & {
|
|
1909
1915
|
_type: string
|
|
@@ -1935,11 +1941,11 @@ export declare interface SanityImageAssetDocument extends SanityAssetDocument {
|
|
|
1935
1941
|
}
|
|
1936
1942
|
image?: {
|
|
1937
1943
|
_type: 'sanity.imageExifTags'
|
|
1938
|
-
[key: string]:
|
|
1944
|
+
[key: string]: FIXME
|
|
1939
1945
|
}
|
|
1940
1946
|
exif?: {
|
|
1941
1947
|
_type: 'sanity.imageExifMetadata'
|
|
1942
|
-
[key: string]:
|
|
1948
|
+
[key: string]: FIXME
|
|
1943
1949
|
}
|
|
1944
1950
|
}
|
|
1945
1951
|
}
|
|
@@ -2004,7 +2010,7 @@ export declare class ServerError extends BaseError {
|
|
|
2004
2010
|
statusCode: ErrorProps['statusCode']
|
|
2005
2011
|
responseBody: ErrorProps['responseBody']
|
|
2006
2012
|
details: ErrorProps['details']
|
|
2007
|
-
constructor(res:
|
|
2013
|
+
constructor(res: FIXME)
|
|
2008
2014
|
}
|
|
2009
2015
|
|
|
2010
2016
|
/** @internal */
|
|
@@ -2030,7 +2036,7 @@ export declare class Transaction extends BaseTransaction {
|
|
|
2030
2036
|
*
|
|
2031
2037
|
* @param options - Options for the mutation operation
|
|
2032
2038
|
*/
|
|
2033
|
-
commit<R extends Record<string,
|
|
2039
|
+
commit<R extends Record<string, FIXME>>(
|
|
2034
2040
|
options: TransactionFirstDocumentMutationOptions
|
|
2035
2041
|
): Promise<SanityDocument<R>>
|
|
2036
2042
|
/**
|
|
@@ -2038,7 +2044,7 @@ export declare class Transaction extends BaseTransaction {
|
|
|
2038
2044
|
*
|
|
2039
2045
|
* @param options - Options for the mutation operation
|
|
2040
2046
|
*/
|
|
2041
|
-
commit<R extends Record<string,
|
|
2047
|
+
commit<R extends Record<string, FIXME>>(
|
|
2042
2048
|
options: TransactionAllDocumentsMutationOptions
|
|
2043
2049
|
): Promise<SanityDocument<R>[]>
|
|
2044
2050
|
/**
|