@sanity/client 6.24.0 → 6.24.2-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/_chunks-cjs/resolveEditInfo.cjs +1 -2
  2. package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
  3. package/dist/_chunks-cjs/stegaClean.cjs +1 -2
  4. package/dist/_chunks-cjs/stegaClean.cjs.map +1 -1
  5. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +1 -2
  6. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
  7. package/dist/_chunks-es/resolveEditInfo.js +1 -2
  8. package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
  9. package/dist/_chunks-es/stegaClean.js +1 -2
  10. package/dist/_chunks-es/stegaClean.js.map +1 -1
  11. package/dist/_chunks-es/stegaEncodeSourceMap.js +1 -2
  12. package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
  13. package/dist/csm.cjs +1 -2
  14. package/dist/csm.cjs.map +1 -1
  15. package/dist/csm.d.cts +99 -34
  16. package/dist/csm.d.ts +99 -34
  17. package/dist/csm.js +1 -2
  18. package/dist/csm.js.map +1 -1
  19. package/dist/index.browser.cjs +4 -4
  20. package/dist/index.browser.cjs.map +1 -1
  21. package/dist/index.browser.d.cts +6 -5
  22. package/dist/index.browser.d.ts +6 -5
  23. package/dist/index.browser.js +4 -4
  24. package/dist/index.browser.js.map +1 -1
  25. package/dist/index.cjs +5 -5
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +6 -5
  28. package/dist/index.d.ts +6 -5
  29. package/dist/index.js +5 -5
  30. package/dist/index.js.map +1 -1
  31. package/dist/stega.browser.d.cts +3312 -98
  32. package/dist/stega.browser.d.ts +3312 -98
  33. package/dist/stega.d.cts +3312 -98
  34. package/dist/stega.d.ts +3312 -98
  35. package/package.json +16 -16
  36. package/src/config.ts +3 -1
  37. package/src/csm/types.ts +1 -1
  38. package/src/http/request.ts +1 -1
  39. package/src/index.browser.ts +1 -1
  40. package/src/index.ts +1 -1
  41. package/src/stega/stegaEncodeSourceMap.ts +5 -1
  42. package/src/util/pick.ts +1 -1
  43. package/src/warnings.ts +1 -1
  44. package/umd/sanityClient.js +102 -117
  45. package/umd/sanityClient.min.js +2 -2
package/dist/index.d.cts CHANGED
@@ -826,7 +826,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
826
826
  this: SanityClient | ObservableSanityClient,
827
827
  query: string,
828
828
  params?: ListenParams,
829
- ): Observable<MutationEvent_2<R>>
829
+ ): Observable<MutationEvent<R>>
830
830
 
831
831
  /**
832
832
  * Set up a listener that will be notified when mutations occur on documents matching the provided query/filter.
@@ -845,7 +845,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
845
845
 
846
846
  /** @public */
847
847
  export declare type ListenEvent<R extends Record<string, Any>> =
848
- | MutationEvent_2<R>
848
+ | MutationEvent<R>
849
849
  | ChannelErrorEvent
850
850
  | DisconnectEvent
851
851
  | ReconnectEvent
@@ -1031,7 +1031,7 @@ export declare interface MutationErrorItem {
1031
1031
  *
1032
1032
  * @public
1033
1033
  */
1034
- declare type MutationEvent_2<R extends Record<string, Any> = Record<string, Any>> = {
1034
+ export declare type MutationEvent<R extends Record<string, Any> = Record<string, Any>> = {
1035
1035
  type: 'mutation'
1036
1036
  /**
1037
1037
  * The ID of the document that was affected
@@ -1120,7 +1120,6 @@ declare type MutationEvent_2<R extends Record<string, Any> = Record<string, Any>
1120
1120
  */
1121
1121
  transactionCurrentEvent: number
1122
1122
  }
1123
- export {MutationEvent_2 as MutationEvent}
1124
1123
 
1125
1124
  /** @internal */
1126
1125
  export declare type MutationOperation = 'create' | 'delete' | 'update' | 'none'
@@ -3143,7 +3142,9 @@ export declare class UsersClient {
3143
3142
  /**
3144
3143
  * @internal - it may have breaking changes in any release
3145
3144
  */
3146
- export declare const validateApiPerspective: (perspective: unknown) => void
3145
+ export declare function validateApiPerspective(
3146
+ perspective: unknown,
3147
+ ): asserts perspective is ClientPerspective
3147
3148
 
3148
3149
  /**
3149
3150
  * The listener has been established, and will start receiving events.
package/dist/index.d.ts CHANGED
@@ -826,7 +826,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
826
826
  this: SanityClient | ObservableSanityClient,
827
827
  query: string,
828
828
  params?: ListenParams,
829
- ): Observable<MutationEvent_2<R>>
829
+ ): Observable<MutationEvent<R>>
830
830
 
831
831
  /**
832
832
  * Set up a listener that will be notified when mutations occur on documents matching the provided query/filter.
@@ -845,7 +845,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
845
845
 
846
846
  /** @public */
847
847
  export declare type ListenEvent<R extends Record<string, Any>> =
848
- | MutationEvent_2<R>
848
+ | MutationEvent<R>
849
849
  | ChannelErrorEvent
850
850
  | DisconnectEvent
851
851
  | ReconnectEvent
@@ -1031,7 +1031,7 @@ export declare interface MutationErrorItem {
1031
1031
  *
1032
1032
  * @public
1033
1033
  */
1034
- declare type MutationEvent_2<R extends Record<string, Any> = Record<string, Any>> = {
1034
+ export declare type MutationEvent<R extends Record<string, Any> = Record<string, Any>> = {
1035
1035
  type: 'mutation'
1036
1036
  /**
1037
1037
  * The ID of the document that was affected
@@ -1120,7 +1120,6 @@ declare type MutationEvent_2<R extends Record<string, Any> = Record<string, Any>
1120
1120
  */
1121
1121
  transactionCurrentEvent: number
1122
1122
  }
1123
- export {MutationEvent_2 as MutationEvent}
1124
1123
 
1125
1124
  /** @internal */
1126
1125
  export declare type MutationOperation = 'create' | 'delete' | 'update' | 'none'
@@ -3143,7 +3142,9 @@ export declare class UsersClient {
3143
3142
  /**
3144
3143
  * @internal - it may have breaking changes in any release
3145
3144
  */
3146
- export declare const validateApiPerspective: (perspective: unknown) => void
3145
+ export declare function validateApiPerspective(
3146
+ perspective: unknown,
3147
+ ): asserts perspective is ClientPerspective
3147
3148
 
3148
3149
  /**
3149
3150
  * The listener has been established, and will start receiving events.
package/dist/index.js CHANGED
@@ -100,8 +100,7 @@ function defineHttpRequest(envMiddleware) {
100
100
  ]);
101
101
  }
102
102
  function shouldRetry(err, attempt, options) {
103
- if (options.maxRetries === 0)
104
- return !1;
103
+ if (options.maxRetries === 0) return !1;
105
104
  const isSafe = options.method === "GET" || options.method === "HEAD", isQuery = (options.uri || options.url).startsWith("/data/query"), isRetriableResponse = err.response && (err.response.statusCode === 429 || err.response.statusCode === 502 || err.response.statusCode === 503);
106
105
  return (isSafe || isQuery) && isRetriableResponse ? !0 : retry.shouldRetry(err, attempt, options);
107
106
  }
@@ -191,7 +190,7 @@ function validateApiVersion(apiVersion) {
191
190
  if (!(/^\d{4}-\d{2}-\d{2}$/.test(apiVersion) && apiDate instanceof Date && apiDate.getTime() > 0))
192
191
  throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`");
193
192
  }
194
- const validateApiPerspective = function(perspective) {
193
+ function validateApiPerspective(perspective) {
195
194
  if (Array.isArray(perspective)) {
196
195
  for (const perspectiveValue of perspective)
197
196
  if (perspectiveValue !== "published" && perspectiveValue !== "drafts" && !(typeof perspectiveValue == "string" && perspectiveValue.startsWith("r") && perspectiveValue !== "raw"))
@@ -211,7 +210,8 @@ const validateApiPerspective = function(perspective) {
211
210
  "Invalid API perspective string, expected `published`, `previewDrafts` or `raw`"
212
211
  );
213
212
  }
214
- }, initConfig = (config, prevConfig) => {
213
+ }
214
+ const initConfig = (config, prevConfig) => {
215
215
  const specifiedConfig = {
216
216
  ...prevConfig,
217
217
  ...config,
@@ -1564,7 +1564,7 @@ function defineDeprecatedCreateClient(createClient2) {
1564
1564
  return printNoDefaultExport(), createClient2(config);
1565
1565
  };
1566
1566
  }
1567
- var name = "@sanity/client", version = "6.24.0";
1567
+ var name = "@sanity/client", version = "6.24.2-canary.0";
1568
1568
  const middleware = [
1569
1569
  debug({ verbose: !0, namespace: "sanity:client" }),
1570
1570
  headers({ "User-Agent": `${name} ${version}` }),