@sanity/client 6.28.0 → 6.28.2

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.
@@ -333,9 +333,18 @@ export declare interface ClientConfig {
333
333
  /** @defaultValue true */
334
334
  useCdn?: boolean
335
335
  token?: string
336
- /** @defaultValue 'raw' */
336
+ /**
337
+ * What perspective to use for the client. See {@link https://www.sanity.io/docs/perspectives|perspective documentation}
338
+ * @remarks
339
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
340
+ * @defaultValue 'published'
341
+ */
337
342
  perspective?: ClientPerspective
338
343
  apiHost?: string
344
+ /**
345
+ @remarks
346
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
347
+ */
339
348
  apiVersion?: string
340
349
  proxy?: string
341
350
  /**
@@ -664,7 +673,7 @@ export declare type CreateAction = {
664
673
  */
665
674
  export declare const createClient: (config: ClientConfig_2) => SanityClient
666
675
 
667
- /** @internal */
676
+ /** @public */
668
677
  export declare interface CurrentSanityUser {
669
678
  id: string
670
679
  name: string
@@ -673,10 +682,10 @@ export declare interface CurrentSanityUser {
673
682
  role: string
674
683
  }
675
684
 
676
- /** @internal */
685
+ /** @public */
677
686
  export declare type DatasetAclMode = 'public' | 'private' | 'custom'
678
687
 
679
- /** @internal */
688
+ /** @public */
680
689
  export declare type DatasetResponse = {
681
690
  datasetName: string
682
691
  aclMode: DatasetAclMode
@@ -724,7 +733,7 @@ export declare class DatasetsClient {
724
733
  list(): Promise<DatasetsResponse>
725
734
  }
726
735
 
727
- /** @internal */
736
+ /** @public */
728
737
  export declare type DatasetsResponse = {
729
738
  name: string
730
739
  aclMode: DatasetAclMode
@@ -1124,7 +1133,12 @@ export declare interface ListenOptions {
1124
1133
  */
1125
1134
  includePreviousRevision?: boolean
1126
1135
  /**
1127
- * @internal
1136
+ * Whether to include events for drafts and versions. As of API Version >= v2025-02-19, only events
1137
+ * for published documents will be included by default (see {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog})
1138
+ * If you need events from drafts and versions, set this to `true`.
1139
+ * Note: Keep in mind that additional document variants may be introduced in the future, so it's
1140
+ * recommended to respond to events in a way that's tolerant of potential future variants, e.g. by
1141
+ * explicitly checking whether the event is for a draft or a version.
1128
1142
  * @defaultValue `false`
1129
1143
  */
1130
1144
  includeAllVersions?: boolean
@@ -3105,7 +3119,7 @@ export declare interface SanityImagePalette {
3105
3119
  title: string
3106
3120
  }
3107
3121
 
3108
- /** @internal */
3122
+ /** @public */
3109
3123
  export declare interface SanityProject {
3110
3124
  id: string
3111
3125
  displayName: string
@@ -3133,7 +3147,7 @@ export declare interface SanityProject {
3133
3147
  }
3134
3148
  }
3135
3149
 
3136
- /** @internal */
3150
+ /** @public */
3137
3151
  export declare interface SanityProjectMember {
3138
3152
  id: string
3139
3153
  role: string
@@ -3155,7 +3169,7 @@ export declare interface SanityReference {
3155
3169
  */
3156
3170
  export declare class SanityStegaClient extends SanityClient {}
3157
3171
 
3158
- /** @internal */
3172
+ /** @public */
3159
3173
  export declare interface SanityUser {
3160
3174
  id: string
3161
3175
  projectId: string
@@ -333,9 +333,18 @@ export declare interface ClientConfig {
333
333
  /** @defaultValue true */
334
334
  useCdn?: boolean
335
335
  token?: string
336
- /** @defaultValue 'raw' */
336
+ /**
337
+ * What perspective to use for the client. See {@link https://www.sanity.io/docs/perspectives|perspective documentation}
338
+ * @remarks
339
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
340
+ * @defaultValue 'published'
341
+ */
337
342
  perspective?: ClientPerspective
338
343
  apiHost?: string
344
+ /**
345
+ @remarks
346
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
347
+ */
339
348
  apiVersion?: string
340
349
  proxy?: string
341
350
  /**
@@ -664,7 +673,7 @@ export declare type CreateAction = {
664
673
  */
665
674
  export declare const createClient: (config: ClientConfig_2) => SanityClient
666
675
 
667
- /** @internal */
676
+ /** @public */
668
677
  export declare interface CurrentSanityUser {
669
678
  id: string
670
679
  name: string
@@ -673,10 +682,10 @@ export declare interface CurrentSanityUser {
673
682
  role: string
674
683
  }
675
684
 
676
- /** @internal */
685
+ /** @public */
677
686
  export declare type DatasetAclMode = 'public' | 'private' | 'custom'
678
687
 
679
- /** @internal */
688
+ /** @public */
680
689
  export declare type DatasetResponse = {
681
690
  datasetName: string
682
691
  aclMode: DatasetAclMode
@@ -724,7 +733,7 @@ export declare class DatasetsClient {
724
733
  list(): Promise<DatasetsResponse>
725
734
  }
726
735
 
727
- /** @internal */
736
+ /** @public */
728
737
  export declare type DatasetsResponse = {
729
738
  name: string
730
739
  aclMode: DatasetAclMode
@@ -1124,7 +1133,12 @@ export declare interface ListenOptions {
1124
1133
  */
1125
1134
  includePreviousRevision?: boolean
1126
1135
  /**
1127
- * @internal
1136
+ * Whether to include events for drafts and versions. As of API Version >= v2025-02-19, only events
1137
+ * for published documents will be included by default (see {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog})
1138
+ * If you need events from drafts and versions, set this to `true`.
1139
+ * Note: Keep in mind that additional document variants may be introduced in the future, so it's
1140
+ * recommended to respond to events in a way that's tolerant of potential future variants, e.g. by
1141
+ * explicitly checking whether the event is for a draft or a version.
1128
1142
  * @defaultValue `false`
1129
1143
  */
1130
1144
  includeAllVersions?: boolean
@@ -3105,7 +3119,7 @@ export declare interface SanityImagePalette {
3105
3119
  title: string
3106
3120
  }
3107
3121
 
3108
- /** @internal */
3122
+ /** @public */
3109
3123
  export declare interface SanityProject {
3110
3124
  id: string
3111
3125
  displayName: string
@@ -3133,7 +3147,7 @@ export declare interface SanityProject {
3133
3147
  }
3134
3148
  }
3135
3149
 
3136
- /** @internal */
3150
+ /** @public */
3137
3151
  export declare interface SanityProjectMember {
3138
3152
  id: string
3139
3153
  role: string
@@ -3155,7 +3169,7 @@ export declare interface SanityReference {
3155
3169
  */
3156
3170
  export declare class SanityStegaClient extends SanityClient {}
3157
3171
 
3158
- /** @internal */
3172
+ /** @public */
3159
3173
  export declare interface SanityUser {
3160
3174
  id: string
3161
3175
  projectId: string
package/dist/stega.d.cts CHANGED
@@ -333,9 +333,18 @@ export declare interface ClientConfig {
333
333
  /** @defaultValue true */
334
334
  useCdn?: boolean
335
335
  token?: string
336
- /** @defaultValue 'raw' */
336
+ /**
337
+ * What perspective to use for the client. See {@link https://www.sanity.io/docs/perspectives|perspective documentation}
338
+ * @remarks
339
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
340
+ * @defaultValue 'published'
341
+ */
337
342
  perspective?: ClientPerspective
338
343
  apiHost?: string
344
+ /**
345
+ @remarks
346
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
347
+ */
339
348
  apiVersion?: string
340
349
  proxy?: string
341
350
  /**
@@ -664,7 +673,7 @@ export declare type CreateAction = {
664
673
  */
665
674
  export declare const createClient: (config: ClientConfig_2) => SanityClient
666
675
 
667
- /** @internal */
676
+ /** @public */
668
677
  export declare interface CurrentSanityUser {
669
678
  id: string
670
679
  name: string
@@ -673,10 +682,10 @@ export declare interface CurrentSanityUser {
673
682
  role: string
674
683
  }
675
684
 
676
- /** @internal */
685
+ /** @public */
677
686
  export declare type DatasetAclMode = 'public' | 'private' | 'custom'
678
687
 
679
- /** @internal */
688
+ /** @public */
680
689
  export declare type DatasetResponse = {
681
690
  datasetName: string
682
691
  aclMode: DatasetAclMode
@@ -724,7 +733,7 @@ export declare class DatasetsClient {
724
733
  list(): Promise<DatasetsResponse>
725
734
  }
726
735
 
727
- /** @internal */
736
+ /** @public */
728
737
  export declare type DatasetsResponse = {
729
738
  name: string
730
739
  aclMode: DatasetAclMode
@@ -1124,7 +1133,12 @@ export declare interface ListenOptions {
1124
1133
  */
1125
1134
  includePreviousRevision?: boolean
1126
1135
  /**
1127
- * @internal
1136
+ * Whether to include events for drafts and versions. As of API Version >= v2025-02-19, only events
1137
+ * for published documents will be included by default (see {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog})
1138
+ * If you need events from drafts and versions, set this to `true`.
1139
+ * Note: Keep in mind that additional document variants may be introduced in the future, so it's
1140
+ * recommended to respond to events in a way that's tolerant of potential future variants, e.g. by
1141
+ * explicitly checking whether the event is for a draft or a version.
1128
1142
  * @defaultValue `false`
1129
1143
  */
1130
1144
  includeAllVersions?: boolean
@@ -3105,7 +3119,7 @@ export declare interface SanityImagePalette {
3105
3119
  title: string
3106
3120
  }
3107
3121
 
3108
- /** @internal */
3122
+ /** @public */
3109
3123
  export declare interface SanityProject {
3110
3124
  id: string
3111
3125
  displayName: string
@@ -3133,7 +3147,7 @@ export declare interface SanityProject {
3133
3147
  }
3134
3148
  }
3135
3149
 
3136
- /** @internal */
3150
+ /** @public */
3137
3151
  export declare interface SanityProjectMember {
3138
3152
  id: string
3139
3153
  role: string
@@ -3155,7 +3169,7 @@ export declare interface SanityReference {
3155
3169
  */
3156
3170
  export declare class SanityStegaClient extends SanityClient {}
3157
3171
 
3158
- /** @internal */
3172
+ /** @public */
3159
3173
  export declare interface SanityUser {
3160
3174
  id: string
3161
3175
  projectId: string
package/dist/stega.d.ts CHANGED
@@ -333,9 +333,18 @@ export declare interface ClientConfig {
333
333
  /** @defaultValue true */
334
334
  useCdn?: boolean
335
335
  token?: string
336
- /** @defaultValue 'raw' */
336
+ /**
337
+ * What perspective to use for the client. See {@link https://www.sanity.io/docs/perspectives|perspective documentation}
338
+ * @remarks
339
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
340
+ * @defaultValue 'published'
341
+ */
337
342
  perspective?: ClientPerspective
338
343
  apiHost?: string
344
+ /**
345
+ @remarks
346
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
347
+ */
339
348
  apiVersion?: string
340
349
  proxy?: string
341
350
  /**
@@ -664,7 +673,7 @@ export declare type CreateAction = {
664
673
  */
665
674
  export declare const createClient: (config: ClientConfig_2) => SanityClient
666
675
 
667
- /** @internal */
676
+ /** @public */
668
677
  export declare interface CurrentSanityUser {
669
678
  id: string
670
679
  name: string
@@ -673,10 +682,10 @@ export declare interface CurrentSanityUser {
673
682
  role: string
674
683
  }
675
684
 
676
- /** @internal */
685
+ /** @public */
677
686
  export declare type DatasetAclMode = 'public' | 'private' | 'custom'
678
687
 
679
- /** @internal */
688
+ /** @public */
680
689
  export declare type DatasetResponse = {
681
690
  datasetName: string
682
691
  aclMode: DatasetAclMode
@@ -724,7 +733,7 @@ export declare class DatasetsClient {
724
733
  list(): Promise<DatasetsResponse>
725
734
  }
726
735
 
727
- /** @internal */
736
+ /** @public */
728
737
  export declare type DatasetsResponse = {
729
738
  name: string
730
739
  aclMode: DatasetAclMode
@@ -1124,7 +1133,12 @@ export declare interface ListenOptions {
1124
1133
  */
1125
1134
  includePreviousRevision?: boolean
1126
1135
  /**
1127
- * @internal
1136
+ * Whether to include events for drafts and versions. As of API Version >= v2025-02-19, only events
1137
+ * for published documents will be included by default (see {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog})
1138
+ * If you need events from drafts and versions, set this to `true`.
1139
+ * Note: Keep in mind that additional document variants may be introduced in the future, so it's
1140
+ * recommended to respond to events in a way that's tolerant of potential future variants, e.g. by
1141
+ * explicitly checking whether the event is for a draft or a version.
1128
1142
  * @defaultValue `false`
1129
1143
  */
1130
1144
  includeAllVersions?: boolean
@@ -3105,7 +3119,7 @@ export declare interface SanityImagePalette {
3105
3119
  title: string
3106
3120
  }
3107
3121
 
3108
- /** @internal */
3122
+ /** @public */
3109
3123
  export declare interface SanityProject {
3110
3124
  id: string
3111
3125
  displayName: string
@@ -3133,7 +3147,7 @@ export declare interface SanityProject {
3133
3147
  }
3134
3148
  }
3135
3149
 
3136
- /** @internal */
3150
+ /** @public */
3137
3151
  export declare interface SanityProjectMember {
3138
3152
  id: string
3139
3153
  role: string
@@ -3155,7 +3169,7 @@ export declare interface SanityReference {
3155
3169
  */
3156
3170
  export declare class SanityStegaClient extends SanityClient {}
3157
3171
 
3158
- /** @internal */
3172
+ /** @public */
3159
3173
  export declare interface SanityUser {
3160
3174
  id: string
3161
3175
  projectId: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "6.28.0",
3
+ "version": "6.28.2",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",
package/src/index.ts CHANGED
@@ -9,7 +9,11 @@ const exp = defineCreateClientExports<SanityClient, ClientConfig>(envMiddleware,
9
9
  /** @public */
10
10
  export const requester = exp.requester
11
11
 
12
- /** @public */
12
+ /**
13
+ * @remarks
14
+ * As of API version `v2025-02-19`, the default perspective used by the client has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
15
+ * @public
16
+ */
13
17
  export const createClient = exp.createClient
14
18
 
15
19
  /**
package/src/types.ts CHANGED
@@ -60,9 +60,20 @@ export interface ClientConfig {
60
60
  /** @defaultValue true */
61
61
  useCdn?: boolean
62
62
  token?: string
63
- /** @defaultValue 'raw' */
63
+
64
+ /**
65
+ * What perspective to use for the client. See {@link https://www.sanity.io/docs/perspectives|perspective documentation}
66
+ * @remarks
67
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
68
+ * @defaultValue 'published'
69
+ */
64
70
  perspective?: ClientPerspective
65
71
  apiHost?: string
72
+
73
+ /**
74
+ @remarks
75
+ * As of API version `v2025-02-19`, the default perspective has changed from `raw` to `published`. {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog}
76
+ */
66
77
  apiVersion?: string
67
78
  proxy?: string
68
79
 
@@ -364,12 +375,12 @@ export interface AuthProvider {
364
375
  /** @internal */
365
376
  export type AuthProviderResponse = {providers: AuthProvider[]}
366
377
 
367
- /** @internal */
378
+ /** @public */
368
379
  export type DatasetAclMode = 'public' | 'private' | 'custom'
369
380
 
370
- /** @internal */
381
+ /** @public */
371
382
  export type DatasetResponse = {datasetName: string; aclMode: DatasetAclMode}
372
- /** @internal */
383
+ /** @public */
373
384
  export type DatasetsResponse = {
374
385
  name: string
375
386
  aclMode: DatasetAclMode
@@ -381,7 +392,7 @@ export type DatasetsResponse = {
381
392
  tags: string[]
382
393
  }[]
383
394
 
384
- /** @internal */
395
+ /** @public */
385
396
  export interface SanityProjectMember {
386
397
  id: string
387
398
  role: string
@@ -389,7 +400,7 @@ export interface SanityProjectMember {
389
400
  isCurrentUser: boolean
390
401
  }
391
402
 
392
- /** @internal */
403
+ /** @public */
393
404
  export interface SanityProject {
394
405
  id: string
395
406
  displayName: string
@@ -417,7 +428,7 @@ export interface SanityProject {
417
428
  }
418
429
  }
419
430
 
420
- /** @internal */
431
+ /** @public */
421
432
  export interface SanityUser {
422
433
  id: string
423
434
  projectId: string
@@ -431,7 +442,7 @@ export interface SanityUser {
431
442
  isCurrentUser: boolean
432
443
  }
433
444
 
434
- /** @internal */
445
+ /** @public */
435
446
  export interface CurrentSanityUser {
436
447
  id: string
437
448
  name: string
@@ -932,7 +943,12 @@ export interface ListenOptions {
932
943
  includePreviousRevision?: boolean
933
944
 
934
945
  /**
935
- * @internal
946
+ * Whether to include events for drafts and versions. As of API Version >= v2025-02-19, only events
947
+ * for published documents will be included by default (see {@link https://www.sanity.io/changelog/e93a2d5a-9cee-4801-829e-8d3394bfed85|Changelog})
948
+ * If you need events from drafts and versions, set this to `true`.
949
+ * Note: Keep in mind that additional document variants may be introduced in the future, so it's
950
+ * recommended to respond to events in a way that's tolerant of potential future variants, e.g. by
951
+ * explicitly checking whether the event is for a draft or a version.
936
952
  * @defaultValue `false`
937
953
  */
938
954
  includeAllVersions?: boolean