@sanity/client 6.4.10 → 6.4.12
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 +0 -7
- package/dist/index.browser.cjs +7 -6
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +7 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +8 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +192 -17
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/package.json +12 -17
- package/src/SanityClient.ts +61 -6
- package/src/data/listen.ts +5 -5
- package/src/types.ts +169 -7
- package/umd/sanityClient.js +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/client",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.12",
|
|
4
4
|
"description": "Client for retrieving, creating and patching data from Sanity.io",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"test": "vitest",
|
|
73
73
|
"type-check": "tsc --noEmit",
|
|
74
74
|
"test:browser": "npm test -- --config ./vitest.browser.config.ts",
|
|
75
|
-
"test:bun": "
|
|
75
|
+
"test:bun": "bun test runtimes/bun",
|
|
76
76
|
"test:deno": "deno test --allow-read --allow-net --allow-env --fail-fast --import-map=runtimes/deno/import_map.json runtimes/deno",
|
|
77
77
|
"test:deno:update_import_map": "deno run --allow-read --allow-write runtimes/deno/update_import_map.ts",
|
|
78
78
|
"posttest:deno:update_import_map": "npx prettier --write runtimes/deno/import_map.json",
|
|
@@ -95,39 +95,34 @@
|
|
|
95
95
|
"rxjs": "^7.0.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@edge-runtime/types": "^2.2.
|
|
99
|
-
"@edge-runtime/vm": "^3.1.
|
|
98
|
+
"@edge-runtime/types": "^2.2.3",
|
|
99
|
+
"@edge-runtime/vm": "^3.1.3",
|
|
100
100
|
"@rollup/plugin-commonjs": "^25.0.4",
|
|
101
101
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
102
102
|
"@sanity/pkg-utils": "^2.4.8",
|
|
103
|
-
"@
|
|
104
|
-
"@
|
|
105
|
-
"@typescript-eslint/
|
|
106
|
-
"@
|
|
107
|
-
"
|
|
108
|
-
"eslint": "^8.48.0",
|
|
103
|
+
"@types/node": "^20.6.0",
|
|
104
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
105
|
+
"@typescript-eslint/parser": "^6.7.0",
|
|
106
|
+
"@vitest/coverage-v8": "^0.34.4",
|
|
107
|
+
"eslint": "^8.49.0",
|
|
109
108
|
"eslint-config-prettier": "^9.0.0",
|
|
110
109
|
"eslint-plugin-prettier": "^5.0.0",
|
|
111
110
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
112
111
|
"faucet": "^0.0.4",
|
|
113
|
-
"happy-dom": "^
|
|
112
|
+
"happy-dom": "^11.0.5",
|
|
114
113
|
"ls-engines": "^0.9.0",
|
|
115
114
|
"nock": "^13.3.3",
|
|
116
115
|
"prettier": "^3.0.3",
|
|
117
116
|
"prettier-plugin-packagejson": "^2.4.5",
|
|
118
117
|
"rimraf": "^5.0.1",
|
|
119
|
-
"rollup": "^3.
|
|
118
|
+
"rollup": "^3.29.1",
|
|
120
119
|
"sse-channel": "^4.0.0",
|
|
121
120
|
"terser": "^5.19.4",
|
|
122
121
|
"typescript": "^5.2.2",
|
|
123
|
-
"vitest": "^0.34.
|
|
122
|
+
"vitest": "^0.34.4",
|
|
124
123
|
"vitest-github-actions-reporter": "^0.10.0"
|
|
125
124
|
},
|
|
126
125
|
"engines": {
|
|
127
126
|
"node": ">=14.18"
|
|
128
|
-
},
|
|
129
|
-
"publishConfig": {
|
|
130
|
-
"access": "public",
|
|
131
|
-
"provenance": true
|
|
132
127
|
}
|
|
133
128
|
}
|
package/src/SanityClient.ts
CHANGED
|
@@ -586,11 +586,39 @@ export class ObservableSanityClient {
|
|
|
586
586
|
/**
|
|
587
587
|
* Create a new buildable patch of operations to perform
|
|
588
588
|
*
|
|
589
|
-
* @param documentId - Document ID
|
|
589
|
+
* @param documentId - Document ID to patch
|
|
590
590
|
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
591
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
591
592
|
*/
|
|
592
|
-
patch(documentId:
|
|
593
|
-
|
|
593
|
+
patch(documentId: string, operations?: PatchOperations): ObservablePatch
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Create a new buildable patch of operations to perform
|
|
597
|
+
*
|
|
598
|
+
* @param documentIds - Array of document IDs to patch
|
|
599
|
+
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
600
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
601
|
+
*/
|
|
602
|
+
patch(documentIds: string[], operations?: PatchOperations): ObservablePatch
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Create a new buildable patch of operations to perform
|
|
606
|
+
*
|
|
607
|
+
* @param selection - An object with `query` and optional `params`, defining which document(s) to patch
|
|
608
|
+
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
609
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
610
|
+
*/
|
|
611
|
+
patch(selection: MutationSelection, operations?: PatchOperations): ObservablePatch
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Create a new buildable patch of operations to perform
|
|
615
|
+
*
|
|
616
|
+
* @param selection - Document ID, an array of document IDs, or an object with `query` and optional `params`, defining which document(s) to patch
|
|
617
|
+
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
618
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
619
|
+
*/
|
|
620
|
+
patch(selection: PatchSelection, operations?: PatchOperations): ObservablePatch {
|
|
621
|
+
return new ObservablePatch(selection, operations, this)
|
|
594
622
|
}
|
|
595
623
|
|
|
596
624
|
/**
|
|
@@ -605,9 +633,8 @@ export class ObservableSanityClient {
|
|
|
605
633
|
}
|
|
606
634
|
|
|
607
635
|
/**
|
|
608
|
-
*
|
|
636
|
+
* Perform an HTTP request against the Sanity API
|
|
609
637
|
*
|
|
610
|
-
* @deprecated Use your own request library!
|
|
611
638
|
* @param options - Request options
|
|
612
639
|
*/
|
|
613
640
|
request<R = Any>(options: RawRequestOptions): Observable<R> {
|
|
@@ -1191,8 +1218,36 @@ export class SanityClient {
|
|
|
1191
1218
|
/**
|
|
1192
1219
|
* Create a new buildable patch of operations to perform
|
|
1193
1220
|
*
|
|
1194
|
-
* @param documentId - Document ID
|
|
1221
|
+
* @param documentId - Document ID to patch
|
|
1222
|
+
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
1223
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
1224
|
+
*/
|
|
1225
|
+
patch(documentId: string, operations?: PatchOperations): Patch
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Create a new buildable patch of operations to perform
|
|
1229
|
+
*
|
|
1230
|
+
* @param documentIds - Array of document IDs to patch
|
|
1231
|
+
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
1232
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
1233
|
+
*/
|
|
1234
|
+
patch(documentIds: string[], operations?: PatchOperations): Patch
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* Create a new buildable patch of operations to perform
|
|
1238
|
+
*
|
|
1239
|
+
* @param selection - An object with `query` and optional `params`, defining which document(s) to patch
|
|
1240
|
+
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
1241
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
1242
|
+
*/
|
|
1243
|
+
patch(selection: MutationSelection, operations?: PatchOperations): Patch
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Create a new buildable patch of operations to perform
|
|
1247
|
+
*
|
|
1248
|
+
* @param selection - Document ID, an array of document IDs, or an object with `query` and optional `params`, defining which document(s) to patch
|
|
1195
1249
|
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
1250
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
1196
1251
|
*/
|
|
1197
1252
|
patch(documentId: PatchSelection, operations?: PatchOperations): Patch {
|
|
1198
1253
|
return new Patch(documentId, operations, this)
|
package/src/data/listen.ts
CHANGED
|
@@ -29,8 +29,8 @@ const defaultOptions = {
|
|
|
29
29
|
*
|
|
30
30
|
* @param query - GROQ-filter to listen to changes for
|
|
31
31
|
* @param params - Optional query parameters
|
|
32
|
-
* @param options -
|
|
33
|
-
* @
|
|
32
|
+
* @param options - Optional listener options
|
|
33
|
+
* @public
|
|
34
34
|
*/
|
|
35
35
|
export function _listen<R extends Record<string, Any> = Record<string, Any>>(
|
|
36
36
|
this: SanityClient | ObservableSanityClient,
|
|
@@ -42,8 +42,8 @@ export function _listen<R extends Record<string, Any> = Record<string, Any>>(
|
|
|
42
42
|
*
|
|
43
43
|
* @param query - GROQ-filter to listen to changes for
|
|
44
44
|
* @param params - Optional query parameters
|
|
45
|
-
* @param options -
|
|
46
|
-
* @
|
|
45
|
+
* @param options - Optional listener options
|
|
46
|
+
* @public
|
|
47
47
|
*/
|
|
48
48
|
export function _listen<R extends Record<string, Any> = Record<string, Any>>(
|
|
49
49
|
this: SanityClient | ObservableSanityClient,
|
|
@@ -51,7 +51,7 @@ export function _listen<R extends Record<string, Any> = Record<string, Any>>(
|
|
|
51
51
|
params?: QueryParams,
|
|
52
52
|
options?: ListenOptions,
|
|
53
53
|
): Observable<ListenEvent<R>>
|
|
54
|
-
/** @
|
|
54
|
+
/** @public */
|
|
55
55
|
export function _listen<R extends Record<string, Any> = Record<string, Any>>(
|
|
56
56
|
this: SanityClient | ObservableSanityClient,
|
|
57
57
|
query: string,
|
package/src/types.ts
CHANGED
|
@@ -439,42 +439,154 @@ export type Mutation<R extends Record<string, Any> = Record<string, Any>> =
|
|
|
439
439
|
| {delete: MutationSelection}
|
|
440
440
|
| {patch: PatchMutationOperation}
|
|
441
441
|
|
|
442
|
-
/**
|
|
442
|
+
/**
|
|
443
|
+
* A mutation was performed. Note that when updating multiple documents in a transaction,
|
|
444
|
+
* each document affected will get a separate mutation event.
|
|
445
|
+
*
|
|
446
|
+
* @public
|
|
447
|
+
*/
|
|
443
448
|
export type MutationEvent<R extends Record<string, Any> = Record<string, Any>> = {
|
|
444
449
|
type: 'mutation'
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* The ID of the document that was affected
|
|
453
|
+
*/
|
|
445
454
|
documentId: string
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* A unique ID for this event
|
|
458
|
+
*/
|
|
446
459
|
eventId: string
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* The user ID of the user that performed the mutation
|
|
463
|
+
*/
|
|
447
464
|
identity: string
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* An array of mutations that were performed. Note that this can differ slightly from the
|
|
468
|
+
* mutations sent to the server, as the server may perform some mutations automatically.
|
|
469
|
+
*/
|
|
448
470
|
mutations: Mutation[]
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* The revision ID of the document before the mutation was performed
|
|
474
|
+
*/
|
|
449
475
|
previousRev?: string
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* The revision ID of the document after the mutation was performed
|
|
479
|
+
*/
|
|
450
480
|
resultRev?: string
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* The document as it looked after the mutation was performed. This is only included if
|
|
484
|
+
* the listener was configured with `includeResult: true`.
|
|
485
|
+
*/
|
|
451
486
|
result?: SanityDocument<R>
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* The document as it looked before the mutation was performed. This is only included if
|
|
490
|
+
* the listener was configured with `includePreviousRevision: true`.
|
|
491
|
+
*/
|
|
452
492
|
previous?: SanityDocument<R> | null
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* The effects of the mutation, if the listener was configured with `effectFormat: 'mendoza'`.
|
|
496
|
+
* Object with `apply` and `revert` arrays, see {@link https://github.com/sanity-io/mendoza}.
|
|
497
|
+
*/
|
|
453
498
|
effects?: {apply: unknown[]; revert: unknown[]}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* A timestamp for when the mutation was performed
|
|
502
|
+
*/
|
|
454
503
|
timestamp: string
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* The transaction ID for the mutation
|
|
507
|
+
*/
|
|
455
508
|
transactionId: string
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* The type of transition the document went through.
|
|
512
|
+
*
|
|
513
|
+
* - `update` means the document was previously part of the subscribed set of documents,
|
|
514
|
+
* and still is.
|
|
515
|
+
* - `appear` means the document was not previously part of the subscribed set of documents,
|
|
516
|
+
* but is now. This can happen both on create or if updating to a state where it now matches
|
|
517
|
+
* the filter provided to the listener.
|
|
518
|
+
* - `disappear` means the document was previously part of the subscribed set of documents,
|
|
519
|
+
* but is no longer. This can happen both on delete or if updating to a state where it no
|
|
520
|
+
* longer matches the filter provided to the listener.
|
|
521
|
+
*/
|
|
456
522
|
transition: 'update' | 'appear' | 'disappear'
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Whether the change that triggered this event is visible to queries (query) or only to
|
|
526
|
+
* subsequent transactions (transaction). The listener client can specify a preferred visibility
|
|
527
|
+
* through the `visibility` parameter on the listener, but this is only on a best-effort basis,
|
|
528
|
+
* and may yet not be accurate.
|
|
529
|
+
*/
|
|
457
530
|
visibility: 'query' | 'transaction'
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* The total number of events that will be sent for this transaction.
|
|
534
|
+
* Note that this may differ from the amount of _documents_ affected by the transaction, as this
|
|
535
|
+
* number only includes the documents that matches the given filter.
|
|
536
|
+
*
|
|
537
|
+
* This can be useful if you need to perform changes to all matched documents atomically,
|
|
538
|
+
* eg you would wait for `transactionTotalEvents` events with the same `transactionId` before
|
|
539
|
+
* applying the changes locally.
|
|
540
|
+
*/
|
|
541
|
+
transactionTotalEvents: number
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The index of this event within the transaction. Note that events may be delivered out of order,
|
|
545
|
+
* and that the index is zero-based.
|
|
546
|
+
*/
|
|
547
|
+
transactionCurrentEvent: number
|
|
458
548
|
}
|
|
459
549
|
|
|
460
|
-
/**
|
|
550
|
+
/**
|
|
551
|
+
* An error occurred. This is different from a network-level error (which will be emitted as 'error').
|
|
552
|
+
* Possible causes are things such as malformed filters, non-existant datasets or similar.
|
|
553
|
+
*
|
|
554
|
+
* @public
|
|
555
|
+
*/
|
|
461
556
|
export type ChannelErrorEvent = {
|
|
462
557
|
type: 'channelError'
|
|
463
558
|
message: string
|
|
464
559
|
}
|
|
465
560
|
|
|
466
|
-
/**
|
|
561
|
+
/**
|
|
562
|
+
* The listener has been told to explicitly disconnect and not reconnect.
|
|
563
|
+
* This is a rare situation, but may occur if the API knows reconnect attempts will fail,
|
|
564
|
+
* eg in the case of a deleted dataset, a blocked project or similar events.
|
|
565
|
+
*
|
|
566
|
+
* Note that this is not treated as an error on the observable, but will complete the observable.
|
|
567
|
+
*
|
|
568
|
+
* @public
|
|
569
|
+
*/
|
|
467
570
|
export type DisconnectEvent = {
|
|
468
571
|
type: 'disconnect'
|
|
469
572
|
reason: string
|
|
470
573
|
}
|
|
471
574
|
|
|
472
|
-
/**
|
|
575
|
+
/**
|
|
576
|
+
* The listener has been disconnected, and a reconnect attempt is scheduled.
|
|
577
|
+
*
|
|
578
|
+
* @public
|
|
579
|
+
*/
|
|
473
580
|
export type ReconnectEvent = {
|
|
474
581
|
type: 'reconnect'
|
|
475
582
|
}
|
|
476
583
|
|
|
477
|
-
/**
|
|
584
|
+
/**
|
|
585
|
+
* The listener has been established, and will start receiving events.
|
|
586
|
+
* Note that this is also emitted upon _reconnection_.
|
|
587
|
+
*
|
|
588
|
+
* @public
|
|
589
|
+
*/
|
|
478
590
|
export type WelcomeEvent = {
|
|
479
591
|
type: 'welcome'
|
|
480
592
|
}
|
|
@@ -488,15 +600,65 @@ export type ListenEvent<R extends Record<string, Any>> =
|
|
|
488
600
|
| WelcomeEvent
|
|
489
601
|
|
|
490
602
|
/** @public */
|
|
491
|
-
export type ListenEventName =
|
|
603
|
+
export type ListenEventName =
|
|
604
|
+
/** A mutation was performed */
|
|
605
|
+
| 'mutation'
|
|
606
|
+
/** The listener has been (re)established */
|
|
607
|
+
| 'welcome'
|
|
608
|
+
/** The listener has been disconnected, and a reconnect attempt is scheduled */
|
|
609
|
+
| 'reconnect'
|
|
492
610
|
|
|
493
611
|
/** @public */
|
|
494
612
|
export interface ListenOptions {
|
|
613
|
+
/**
|
|
614
|
+
* Whether or not to include the resulting document in addition to the mutations performed.
|
|
615
|
+
* If you do not need the actual document, set this to `false` to reduce bandwidth usage.
|
|
616
|
+
* The result will be available on the `.result` property of the events.
|
|
617
|
+
* @defaultValue `true`
|
|
618
|
+
*/
|
|
495
619
|
includeResult?: boolean
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Whether or not to include the document as it looked before the mutation event.
|
|
623
|
+
* The previous revision will be available on the `.previous` property of the events,
|
|
624
|
+
* and may be `null` in the case of a new document.
|
|
625
|
+
* @defaultValue `false`
|
|
626
|
+
*/
|
|
496
627
|
includePreviousRevision?: boolean
|
|
497
|
-
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Whether events should be sent as soon as a transaction has been committed (`transaction`, default),
|
|
631
|
+
* or only after they are available for queries (query). Note that this is on a best-effort basis,
|
|
632
|
+
* and listeners with `query` may in certain cases (notably with deferred transactions) receive events
|
|
633
|
+
* that are not yet visible to queries.
|
|
634
|
+
*
|
|
635
|
+
* @defaultValue `'transaction'`
|
|
636
|
+
*/
|
|
637
|
+
visibility?: 'transaction' | 'query'
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
641
|
+
*
|
|
642
|
+
* @defaultValue `['mutation']`
|
|
643
|
+
*/
|
|
498
644
|
events?: ListenEventName[]
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Format of "effects", eg the resulting changes of a mutation.
|
|
648
|
+
* Currently only `mendoza` is supported, and (if set) will include `apply` and `revert` arrays
|
|
649
|
+
* in the mutation events under the `effects` property.
|
|
650
|
+
*
|
|
651
|
+
* See {@link https://github.com/sanity-io/mendoza | The mendoza docs} for more info
|
|
652
|
+
*
|
|
653
|
+
* @defaultValue `undefined`
|
|
654
|
+
*/
|
|
499
655
|
effectFormat?: 'mendoza'
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Optional request tag for the listener. Use to identify the request in logs.
|
|
659
|
+
*
|
|
660
|
+
* @defaultValue `undefined`
|
|
661
|
+
*/
|
|
500
662
|
tag?: string
|
|
501
663
|
}
|
|
502
664
|
|
package/umd/sanityClient.js
CHANGED
|
@@ -3842,11 +3842,12 @@
|
|
|
3842
3842
|
/**
|
|
3843
3843
|
* Create a new buildable patch of operations to perform
|
|
3844
3844
|
*
|
|
3845
|
-
* @param
|
|
3845
|
+
* @param selection - Document ID, an array of document IDs, or an object with `query` and optional `params`, defining which document(s) to patch
|
|
3846
3846
|
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
3847
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
3847
3848
|
*/
|
|
3848
|
-
patch(
|
|
3849
|
-
return new ObservablePatch(
|
|
3849
|
+
patch(selection, operations) {
|
|
3850
|
+
return new ObservablePatch(selection, operations, this);
|
|
3850
3851
|
}
|
|
3851
3852
|
/**
|
|
3852
3853
|
* Create a new transaction of mutations
|
|
@@ -3857,9 +3858,8 @@
|
|
|
3857
3858
|
return new ObservableTransaction(operations, this);
|
|
3858
3859
|
}
|
|
3859
3860
|
/**
|
|
3860
|
-
*
|
|
3861
|
+
* Perform an HTTP request against the Sanity API
|
|
3861
3862
|
*
|
|
3862
|
-
* @deprecated Use your own request library!
|
|
3863
3863
|
* @param options - Request options
|
|
3864
3864
|
*/
|
|
3865
3865
|
request(options) {
|
|
@@ -3990,8 +3990,9 @@
|
|
|
3990
3990
|
/**
|
|
3991
3991
|
* Create a new buildable patch of operations to perform
|
|
3992
3992
|
*
|
|
3993
|
-
* @param
|
|
3993
|
+
* @param selection - Document ID, an array of document IDs, or an object with `query` and optional `params`, defining which document(s) to patch
|
|
3994
3994
|
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
3995
|
+
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
3995
3996
|
*/
|
|
3996
3997
|
patch(documentId, operations) {
|
|
3997
3998
|
return new Patch(documentId, operations, this);
|