@sanity/client 0.0.0-dev.7 → 0.0.0-dev.8
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/dist/index.cjs +1 -1
- package/dist/index.d.ts +45 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/types.ts +46 -0
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var getIt = require('get-it');
|
|
|
8
8
|
var rxjs = require('rxjs');
|
|
9
9
|
var operators = require('rxjs/operators');
|
|
10
10
|
var name = "@sanity/client";
|
|
11
|
-
var version = "0.0.0-dev.
|
|
11
|
+
var version = "0.0.0-dev.8";
|
|
12
12
|
const middleware = [middleware$1.debug({
|
|
13
13
|
verbose: true,
|
|
14
14
|
namespace: "sanity:client"
|
package/dist/index.d.ts
CHANGED
|
@@ -309,6 +309,13 @@ export declare class ClientError extends Error {
|
|
|
309
309
|
constructor(res: Any)
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
/** @internal */
|
|
313
|
+
export declare type ContentSourceMapping = {
|
|
314
|
+
mappings: Record<string, Mapping>
|
|
315
|
+
documents: Array<SanityDocument>
|
|
316
|
+
paths: Array<string>
|
|
317
|
+
}
|
|
318
|
+
|
|
312
319
|
/** @public */
|
|
313
320
|
export declare const createClient: (config: ClientConfig) => SanityClient
|
|
314
321
|
|
|
@@ -391,6 +398,15 @@ export declare type DisconnectEvent = {
|
|
|
391
398
|
reason: string
|
|
392
399
|
}
|
|
393
400
|
|
|
401
|
+
/**
|
|
402
|
+
* @internal
|
|
403
|
+
*/
|
|
404
|
+
export declare type DocumentValueSource = {
|
|
405
|
+
type: 'documentValue'
|
|
406
|
+
document: number
|
|
407
|
+
path: number
|
|
408
|
+
}
|
|
409
|
+
|
|
394
410
|
/** @public */
|
|
395
411
|
export declare interface ErrorProps {
|
|
396
412
|
message: string
|
|
@@ -520,6 +536,16 @@ export declare interface ListenOptions {
|
|
|
520
536
|
tag?: string
|
|
521
537
|
}
|
|
522
538
|
|
|
539
|
+
/**
|
|
540
|
+
* @internal
|
|
541
|
+
*/
|
|
542
|
+
export declare type LiteralSource = {
|
|
543
|
+
type: 'literal'
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/** @internal */
|
|
547
|
+
export declare type Mapping = ValueMapping
|
|
548
|
+
|
|
523
549
|
/** @internal */
|
|
524
550
|
export declare interface MultipleMutationResult {
|
|
525
551
|
transactionId: string
|
|
@@ -1409,6 +1435,7 @@ export declare interface RawQueryResponse<R> {
|
|
|
1409
1435
|
q: string
|
|
1410
1436
|
ms: number
|
|
1411
1437
|
result: R
|
|
1438
|
+
resultSourceMap: ContentSourceMapping
|
|
1412
1439
|
}
|
|
1413
1440
|
|
|
1414
1441
|
/** @internal */
|
|
@@ -2080,6 +2107,9 @@ export declare interface SingleMutationResult {
|
|
|
2080
2107
|
}[]
|
|
2081
2108
|
}
|
|
2082
2109
|
|
|
2110
|
+
/** @internal */
|
|
2111
|
+
export declare type Source = DocumentValueSource | LiteralSource | UnknownSource
|
|
2112
|
+
|
|
2083
2113
|
/** @public */
|
|
2084
2114
|
export declare class Transaction extends BaseTransaction {
|
|
2085
2115
|
#private
|
|
@@ -2175,6 +2205,13 @@ export declare type UnfilteredResponseQueryOptions = RequestOptions & {
|
|
|
2175
2205
|
filterResponse: false
|
|
2176
2206
|
}
|
|
2177
2207
|
|
|
2208
|
+
/**
|
|
2209
|
+
* @internal
|
|
2210
|
+
*/
|
|
2211
|
+
export declare type UnknownSource = {
|
|
2212
|
+
type: 'unknown'
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2178
2215
|
export {unstable__adapter}
|
|
2179
2216
|
|
|
2180
2217
|
export {unstable__environment}
|
|
@@ -2255,6 +2292,14 @@ export declare class UsersClient {
|
|
|
2255
2292
|
getById<T extends 'me' | string>(id: T): Promise<T extends 'me' ? CurrentSanityUser : SanityUser>
|
|
2256
2293
|
}
|
|
2257
2294
|
|
|
2295
|
+
/**
|
|
2296
|
+
* @internal
|
|
2297
|
+
*/
|
|
2298
|
+
export declare type ValueMapping = {
|
|
2299
|
+
type: 'value'
|
|
2300
|
+
source: Source
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2258
2303
|
/** @public */
|
|
2259
2304
|
export declare type WelcomeEvent = {
|
|
2260
2305
|
type: 'welcome'
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { adapter as unstable__adapter, environment as unstable__environment } fr
|
|
|
4
4
|
import { Observable, lastValueFrom } from 'rxjs';
|
|
5
5
|
import { map, filter } from 'rxjs/operators';
|
|
6
6
|
var name = "@sanity/client";
|
|
7
|
-
var version = "0.0.0-dev.
|
|
7
|
+
var version = "0.0.0-dev.8";
|
|
8
8
|
const middleware = [debug({
|
|
9
9
|
verbose: true,
|
|
10
10
|
namespace: "sanity:client"
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -463,16 +463,62 @@ export type FilteredResponseQueryOptions = RequestOptions & {
|
|
|
463
463
|
filterResponse?: true
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
/**
|
|
467
|
+
* @internal
|
|
468
|
+
*/
|
|
469
|
+
export type DocumentValueSource = {
|
|
470
|
+
type: 'documentValue'
|
|
471
|
+
|
|
472
|
+
// index location of the document
|
|
473
|
+
document: number
|
|
474
|
+
// index location of the path
|
|
475
|
+
path: number
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* @internal
|
|
479
|
+
*/
|
|
480
|
+
export type LiteralSource = {
|
|
481
|
+
type: 'literal'
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* @internal
|
|
485
|
+
*/
|
|
486
|
+
export type UnknownSource = {
|
|
487
|
+
type: 'unknown'
|
|
488
|
+
}
|
|
489
|
+
/** @internal */
|
|
490
|
+
export type Source = DocumentValueSource | LiteralSource | UnknownSource
|
|
491
|
+
/**
|
|
492
|
+
* @internal
|
|
493
|
+
*/
|
|
494
|
+
export type ValueMapping = {
|
|
495
|
+
type: 'value'
|
|
496
|
+
|
|
497
|
+
// source of the value
|
|
498
|
+
source: Source
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/** @internal */
|
|
502
|
+
export type Mapping = ValueMapping
|
|
503
|
+
|
|
466
504
|
/** @internal */
|
|
467
505
|
export type UnfilteredResponseQueryOptions = RequestOptions & {
|
|
468
506
|
filterResponse: false
|
|
469
507
|
}
|
|
470
508
|
|
|
509
|
+
/** @internal */
|
|
510
|
+
export type ContentSourceMapping = {
|
|
511
|
+
mappings: Record<string, Mapping>
|
|
512
|
+
documents: Array<SanityDocument>
|
|
513
|
+
paths: Array<string>
|
|
514
|
+
}
|
|
515
|
+
|
|
471
516
|
/** @internal */
|
|
472
517
|
export interface RawQueryResponse<R> {
|
|
473
518
|
q: string
|
|
474
519
|
ms: number
|
|
475
520
|
result: R
|
|
521
|
+
resultSourceMap: ContentSourceMapping
|
|
476
522
|
}
|
|
477
523
|
|
|
478
524
|
/** @internal */
|