@01.software/sdk 0.35.0 → 0.37.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 (80) hide show
  1. package/README.md +71 -6
  2. package/dist/analytics/react.cjs +33 -9
  3. package/dist/analytics/react.cjs.map +1 -1
  4. package/dist/analytics/react.d.cts +1 -1
  5. package/dist/analytics/react.d.ts +1 -1
  6. package/dist/analytics/react.js +33 -9
  7. package/dist/analytics/react.js.map +1 -1
  8. package/dist/analytics.cjs +30 -8
  9. package/dist/analytics.cjs.map +1 -1
  10. package/dist/analytics.d.cts +6 -0
  11. package/dist/analytics.d.ts +6 -0
  12. package/dist/analytics.js +30 -8
  13. package/dist/analytics.js.map +1 -1
  14. package/dist/client.cjs +94 -114
  15. package/dist/client.cjs.map +1 -1
  16. package/dist/client.d.cts +6 -6
  17. package/dist/client.d.ts +6 -6
  18. package/dist/client.js +94 -114
  19. package/dist/client.js.map +1 -1
  20. package/dist/{collection-client-DkREjhQ9.d.ts → collection-client-DyELGUcL.d.ts} +3 -3
  21. package/dist/{collection-client-CR2B8c1v.d.cts → collection-client-zOmnxwdA.d.cts} +3 -3
  22. package/dist/{const-CdqCauHQ.d.ts → const-CK_FPaIn.d.cts} +3 -3
  23. package/dist/{const-BTvdrXtY.d.cts → const-Dqz05oaG.d.ts} +3 -3
  24. package/dist/{image-BDz2-AaO.d.cts → image-BDjHp03R.d.cts} +13 -9
  25. package/dist/{image-BDz2-AaO.d.ts → image-BDjHp03R.d.ts} +13 -9
  26. package/dist/{index-DK8_NXkh.d.ts → index-DRJs7QIh.d.cts} +9 -6
  27. package/dist/{index-CjA3U6X3.d.cts → index-DTqoUZk_.d.ts} +9 -6
  28. package/dist/index.cjs +229 -136
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +10 -9
  31. package/dist/index.d.ts +10 -9
  32. package/dist/index.js +229 -136
  33. package/dist/index.js.map +1 -1
  34. package/dist/metadata.cjs +5 -3
  35. package/dist/metadata.cjs.map +1 -1
  36. package/dist/metadata.js +5 -3
  37. package/dist/metadata.js.map +1 -1
  38. package/dist/{payload-types-C7tb7Xbs.d.cts → payload-types-CREOjFNT.d.cts} +281 -128
  39. package/dist/{payload-types-C7tb7Xbs.d.ts → payload-types-CREOjFNT.d.ts} +281 -128
  40. package/dist/query.cjs +5 -3
  41. package/dist/query.cjs.map +1 -1
  42. package/dist/query.d.cts +5 -5
  43. package/dist/query.d.ts +5 -5
  44. package/dist/query.js +5 -3
  45. package/dist/query.js.map +1 -1
  46. package/dist/realtime.d.cts +2 -2
  47. package/dist/realtime.d.ts +2 -2
  48. package/dist/server.cjs +99 -69
  49. package/dist/server.cjs.map +1 -1
  50. package/dist/server.d.cts +7 -7
  51. package/dist/server.d.ts +7 -7
  52. package/dist/server.js +99 -69
  53. package/dist/server.js.map +1 -1
  54. package/dist/{types-DDhtZI6E.d.cts → types-BWMUr3Zw.d.cts} +274 -84
  55. package/dist/{types-Bx558PU6.d.cts → types-BkZNhuBh.d.cts} +1 -1
  56. package/dist/{types-1ylMrCuW.d.ts → types-CxzWHspI.d.ts} +1 -1
  57. package/dist/{types-Byo_Rty4.d.ts → types-DMvVHdb1.d.ts} +274 -84
  58. package/dist/ui/canvas.cjs +15 -5
  59. package/dist/ui/canvas.cjs.map +1 -1
  60. package/dist/ui/canvas.d.cts +1 -1
  61. package/dist/ui/canvas.d.ts +1 -1
  62. package/dist/ui/canvas.js +15 -5
  63. package/dist/ui/canvas.js.map +1 -1
  64. package/dist/ui/form.d.cts +1 -1
  65. package/dist/ui/form.d.ts +1 -1
  66. package/dist/ui/image.cjs +15 -5
  67. package/dist/ui/image.cjs.map +1 -1
  68. package/dist/ui/image.d.cts +1 -1
  69. package/dist/ui/image.d.ts +1 -1
  70. package/dist/ui/image.js +15 -5
  71. package/dist/ui/image.js.map +1 -1
  72. package/dist/ui/video.d.cts +1 -1
  73. package/dist/ui/video.d.ts +1 -1
  74. package/dist/webhook.cjs +5 -1
  75. package/dist/webhook.cjs.map +1 -1
  76. package/dist/webhook.d.cts +4 -4
  77. package/dist/webhook.d.ts +4 -4
  78. package/dist/webhook.js +5 -1
  79. package/dist/webhook.js.map +1 -1
  80. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
- import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, h as PayloadMutationResponse } from './types-Byo_Rty4.js';
1
+ import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, h as PayloadMutationResponse } from './types-DMvVHdb1.js';
2
2
  import { GenerateMetadataOptions, Metadata } from './metadata.js';
3
- import { S as ServerCollection, P as PublicCollection } from './const-CdqCauHQ.js';
4
- import { C as CollectionType } from './types-1ylMrCuW.js';
3
+ import { S as ServerCollection, P as PublicCollection } from './const-Dqz05oaG.js';
4
+ import { C as CollectionType } from './types-CxzWHspI.js';
5
5
 
6
6
  interface FetchOptions extends RequestInit {
7
7
  apiUrl?: string;
@@ -1,7 +1,7 @@
1
- import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, h as PayloadMutationResponse } from './types-DDhtZI6E.cjs';
1
+ import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, h as PayloadMutationResponse } from './types-BWMUr3Zw.cjs';
2
2
  import { GenerateMetadataOptions, Metadata } from './metadata.cjs';
3
- import { S as ServerCollection, P as PublicCollection } from './const-BTvdrXtY.cjs';
4
- import { C as CollectionType } from './types-Bx558PU6.cjs';
3
+ import { S as ServerCollection, P as PublicCollection } from './const-CK_FPaIn.cjs';
4
+ import { C as CollectionType } from './types-BkZNhuBh.cjs';
5
5
 
6
6
  interface FetchOptions extends RequestInit {
7
7
  apiUrl?: string;
@@ -1,4 +1,4 @@
1
- import { e as Config } from './payload-types-C7tb7Xbs.js';
1
+ import { e as Config } from './payload-types-CREOjFNT.cjs';
2
2
 
3
3
  /**
4
4
  * Collection type derived from Payload Config.
@@ -14,7 +14,7 @@ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-lo
14
14
  * Array of all public collection names for runtime use (e.g., Zod enum validation).
15
15
  * This is the single source of truth for which collections are publicly accessible via SDK.
16
16
  */
17
- declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
17
+ declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillment-orders", "fulfillment-order-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
18
18
  /**
19
19
  * Server-auth collection names for runtime use. These collections are safe for
20
20
  * secret-key/PAT SDK and MCP server tools, but must not appear in browser or
@@ -26,7 +26,7 @@ declare const SERVER_ONLY_COLLECTIONS: readonly ["customer-groups", "reports", "
26
26
  * Derived from the COLLECTIONS array (single source of truth).
27
27
  */
28
28
  type PublicCollection = (typeof COLLECTIONS)[number];
29
- declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
29
+ declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillment-orders", "fulfillment-order-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
30
30
  type ServerCollection = (typeof SERVER_COLLECTIONS)[number];
31
31
 
32
32
  export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, type ServerCollection as S, COLLECTIONS as a, SERVER_COLLECTIONS as b, SERVER_ONLY_COLLECTIONS as c };
@@ -1,4 +1,4 @@
1
- import { e as Config } from './payload-types-C7tb7Xbs.cjs';
1
+ import { e as Config } from './payload-types-CREOjFNT.js';
2
2
 
3
3
  /**
4
4
  * Collection type derived from Payload Config.
@@ -14,7 +14,7 @@ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-lo
14
14
  * Array of all public collection names for runtime use (e.g., Zod enum validation).
15
15
  * This is the single source of truth for which collections are publicly accessible via SDK.
16
16
  */
17
- declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
17
+ declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillment-orders", "fulfillment-order-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
18
18
  /**
19
19
  * Server-auth collection names for runtime use. These collections are safe for
20
20
  * secret-key/PAT SDK and MCP server tools, but must not appear in browser or
@@ -26,7 +26,7 @@ declare const SERVER_ONLY_COLLECTIONS: readonly ["customer-groups", "reports", "
26
26
  * Derived from the COLLECTIONS array (single source of truth).
27
27
  */
28
28
  type PublicCollection = (typeof COLLECTIONS)[number];
29
- declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
29
+ declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillment-orders", "fulfillment-order-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
30
30
  type ServerCollection = (typeof SERVER_COLLECTIONS)[number];
31
31
 
32
32
  export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, type ServerCollection as S, COLLECTIONS as a, SERVER_COLLECTIONS as b, SERVER_ONLY_COLLECTIONS as c };
@@ -7,6 +7,14 @@ interface ImagePalette {
7
7
  lightVibrant?: string | null;
8
8
  lightMuted?: string | null;
9
9
  }
10
+ /** Structural image size entry accepted by public image helpers. */
11
+ interface ImageDataSizeEntry {
12
+ url?: string | null;
13
+ width?: number | null;
14
+ height?: number | null;
15
+ }
16
+ /** Structural image sizes accepted from Payload upload-like collections. */
17
+ type ImageDataSizes = Partial<Record<string, ImageDataSizeEntry | null | undefined>>;
10
18
  /** Common image data shape from Payload CMS upload collections */
11
19
  interface ImageData {
12
20
  url?: string | null;
@@ -15,14 +23,10 @@ interface ImageData {
15
23
  alt?: string | null;
16
24
  lqip?: string | null;
17
25
  palette?: ImagePalette | null;
18
- sizes?: Record<string, {
19
- url?: string | null;
20
- width?: number | null;
21
- height?: number | null;
22
- } | undefined>;
26
+ sizes?: ImageDataSizes;
23
27
  }
24
- /** Pre-generated image size breakpoints (px) */
25
- declare const IMAGE_SIZES: readonly [384, 768, 1536];
28
+ /** Pre-generated image size breakpoints (px), aligned with Payload Image.sizes. */
29
+ declare const IMAGE_SIZES: readonly [200, 400, 800, 1200, 1600];
26
30
  /**
27
31
  * Returns the optimal image URL for a given display width.
28
32
  *
@@ -39,7 +43,7 @@ declare function getImageUrl(image: ImageData, displayWidth: number, dpr?: numbe
39
43
  * Generates an HTML `srcset` attribute string from pre-generated sizes.
40
44
  *
41
45
  * Includes all available sizes plus the original image.
42
- * Example output: `"url-384 384w, url-768 768w, url-1536 1536w, url-original 2000w"`
46
+ * Example output: `"url-200 200w, url-400 400w, url-800 800w, url-1200 1200w, url-1600 1600w, url-original 2000w"`
43
47
  *
44
48
  * @param image - Payload image document
45
49
  * @returns srcset string, or empty string if no URLs are available
@@ -79,4 +83,4 @@ interface ImagePlaceholderOptions {
79
83
  */
80
84
  declare function getImagePlaceholderStyle(image: ImageData, options?: ImagePlaceholderOptions): Record<string, string>;
81
85
 
82
- export { type ImageData as I, IMAGE_SIZES as a, type ImagePalette as b, type ImagePlaceholderOptions as c, getImagePalette as d, getImagePlaceholderStyle as e, getImageSrcSet as f, getImageLqip as g, getImageUrl as h };
86
+ export { type ImageData as I, IMAGE_SIZES as a, type ImageDataSizeEntry as b, type ImageDataSizes as c, type ImagePalette as d, type ImagePlaceholderOptions as e, getImagePalette as f, getImageLqip as g, getImagePlaceholderStyle as h, getImageSrcSet as i, getImageUrl as j };
@@ -7,6 +7,14 @@ interface ImagePalette {
7
7
  lightVibrant?: string | null;
8
8
  lightMuted?: string | null;
9
9
  }
10
+ /** Structural image size entry accepted by public image helpers. */
11
+ interface ImageDataSizeEntry {
12
+ url?: string | null;
13
+ width?: number | null;
14
+ height?: number | null;
15
+ }
16
+ /** Structural image sizes accepted from Payload upload-like collections. */
17
+ type ImageDataSizes = Partial<Record<string, ImageDataSizeEntry | null | undefined>>;
10
18
  /** Common image data shape from Payload CMS upload collections */
11
19
  interface ImageData {
12
20
  url?: string | null;
@@ -15,14 +23,10 @@ interface ImageData {
15
23
  alt?: string | null;
16
24
  lqip?: string | null;
17
25
  palette?: ImagePalette | null;
18
- sizes?: Record<string, {
19
- url?: string | null;
20
- width?: number | null;
21
- height?: number | null;
22
- } | undefined>;
26
+ sizes?: ImageDataSizes;
23
27
  }
24
- /** Pre-generated image size breakpoints (px) */
25
- declare const IMAGE_SIZES: readonly [384, 768, 1536];
28
+ /** Pre-generated image size breakpoints (px), aligned with Payload Image.sizes. */
29
+ declare const IMAGE_SIZES: readonly [200, 400, 800, 1200, 1600];
26
30
  /**
27
31
  * Returns the optimal image URL for a given display width.
28
32
  *
@@ -39,7 +43,7 @@ declare function getImageUrl(image: ImageData, displayWidth: number, dpr?: numbe
39
43
  * Generates an HTML `srcset` attribute string from pre-generated sizes.
40
44
  *
41
45
  * Includes all available sizes plus the original image.
42
- * Example output: `"url-384 384w, url-768 768w, url-1536 1536w, url-original 2000w"`
46
+ * Example output: `"url-200 200w, url-400 400w, url-800 800w, url-1200 1200w, url-1600 1600w, url-original 2000w"`
43
47
  *
44
48
  * @param image - Payload image document
45
49
  * @returns srcset string, or empty string if no URLs are available
@@ -79,4 +83,4 @@ interface ImagePlaceholderOptions {
79
83
  */
80
84
  declare function getImagePlaceholderStyle(image: ImageData, options?: ImagePlaceholderOptions): Record<string, string>;
81
85
 
82
- export { type ImageData as I, IMAGE_SIZES as a, type ImagePalette as b, type ImagePlaceholderOptions as c, getImagePalette as d, getImagePlaceholderStyle as e, getImageSrcSet as f, getImageLqip as g, getImageUrl as h };
86
+ export { type ImageData as I, IMAGE_SIZES as a, type ImageDataSizeEntry as b, type ImageDataSizes as c, type ImagePalette as d, type ImagePlaceholderOptions as e, getImagePalette as f, getImageLqip as g, getImagePlaceholderStyle as h, getImageSrcSet as i, getImageUrl as j };
@@ -1,6 +1,6 @@
1
- import { C as Collection } from './const-CdqCauHQ.js';
2
- import { C as CollectionType } from './types-1ylMrCuW.js';
3
- import './payload-types-C7tb7Xbs.js';
1
+ import { C as Collection } from './const-CK_FPaIn.cjs';
2
+ import { C as CollectionType } from './types-BkZNhuBh.cjs';
3
+ import './payload-types-CREOjFNT.cjs';
4
4
 
5
5
  type WebhookOperation = string;
6
6
  /**
@@ -128,14 +128,16 @@ type CommerceEmailConfig = {
128
128
  version: 1;
129
129
  commerceNotifications: Partial<Record<CommerceNotificationEventName, CommerceEmailEventConfig>>;
130
130
  };
131
- type CommerceEmailHandlerContext = {
131
+ type CommerceNotificationHandlerContext = {
132
132
  event: CommerceNotificationWebhookEvent;
133
133
  idempotencyKey: string;
134
134
  };
135
135
  type MaybePromise<T> = T | Promise<T>;
136
- type CommerceEmailEventHandlers = Partial<Record<CommerceNotificationEventName, (context: CommerceEmailHandlerContext) => MaybePromise<void>>> & {
136
+ type CommerceNotificationEventHandlers = Partial<Record<CommerceNotificationEventName, (context: CommerceNotificationHandlerContext) => MaybePromise<void>>> & {
137
137
  unhandled?: (event: WebhookEvent<string, unknown>) => MaybePromise<void>;
138
138
  };
139
+ type CommerceEmailHandlerContext = CommerceNotificationHandlerContext;
140
+ type CommerceEmailEventHandlers = CommerceNotificationEventHandlers;
139
141
  /**
140
142
  * Returns true for semantic order-change webhooks emitted as update events.
141
143
  *
@@ -154,6 +156,7 @@ declare function isOrderChangedWebhookEvent(event: unknown): event is OrderChang
154
156
  declare function isCommerceNotificationWebhookEvent(event: unknown): event is CommerceNotificationWebhookEvent;
155
157
  declare function getCommerceNotificationIdempotencyKey(event: Pick<CommerceNotificationWebhookEvent, 'notification'>): string;
156
158
  declare function defineCommerceEmailConfig<TConfig extends CommerceEmailConfig>(config: TConfig): TConfig;
159
+ declare function createCommerceNotificationWebhookHandler(handlers: CommerceNotificationEventHandlers): WebhookHandler<string, unknown>;
157
160
  declare function createCommerceEmailWebhookHandler(handlers: CommerceEmailEventHandlers): WebhookHandler<string, unknown>;
158
161
  /** Narrows a webhook event to a specific collection. */
159
162
  declare function isWebhookCollection<TCollection extends string>(event: unknown, collection: TCollection): event is WebhookEvent<TCollection, unknown>;
@@ -183,4 +186,4 @@ declare function createCustomerAuthWebhookHandler(handlers: CustomerAuthWebhookH
183
186
  declare function handleWebhook<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>>(request: Request, handler: WebhookHandler<T, TData>, options?: WebhookOptions): Promise<Response>;
184
187
  declare function createTypedWebhookHandler<T extends Collection>(collection: T, handler: (event: WebhookEvent<T>) => Promise<void> | void): WebhookHandler<T>;
185
188
 
186
- export { type WebhookOrderChange as A, type WebhookOrderMoved as B, COMMERCE_NOTIFICATION_EVENTS as C, type WebhookOrderScope as D, createCommerceEmailWebhookHandler as E, createCustomerAuthWebhookHandler as F, createTypedWebhookHandler as G, defineCommerceEmailConfig as H, getCommerceNotificationIdempotencyKey as I, handleWebhook as J, isCommerceNotificationWebhookEvent as K, isCustomerPasswordResetWebhookEvent as L, isOrderChangedWebhookEvent as M, isValidWebhookEvent as N, ORDER_CHANGED_EVENT_TYPE as O, isWebhookCollection as P, isWebhookOperation as Q, type WebhookChange as W, COMMERCE_NOTIFICATION_EVENT_TYPE as a, COMMERCE_NOTIFICATION_OPERATION as b, CUSTOMER_PASSWORD_RESET_OPERATION as c, type CollectionWebhookOperation as d, type CommerceEmailChannel as e, type CommerceEmailConfig as f, type CommerceEmailEventConfig as g, type CommerceEmailEventHandlers as h, type CommerceEmailHandlerContext as i, type CommerceNotification as j, type CommerceNotificationData as k, type CommerceNotificationEventName as l, type CommerceNotificationSource as m, type CommerceNotificationSourceCollection as n, type CommerceNotificationWebhookEvent as o, type CustomerAuthWebhookEvent as p, type CustomerAuthWebhookHandlers as q, type CustomerPasswordResetWebhookData as r, type CustomerPasswordResetWebhookEvent as s, type OrderChangedWebhookEvent as t, type WebhookCommerceNotificationChange as u, type WebhookEvent as v, type WebhookHandler as w, type WebhookKnownOperation as x, type WebhookOperation as y, type WebhookOptions as z };
189
+ export { type WebhookOperation as A, type WebhookOptions as B, COMMERCE_NOTIFICATION_EVENTS as C, type WebhookOrderChange as D, type WebhookOrderMoved as E, type WebhookOrderScope as F, createCommerceEmailWebhookHandler as G, createCommerceNotificationWebhookHandler as H, createCustomerAuthWebhookHandler as I, createTypedWebhookHandler as J, defineCommerceEmailConfig as K, getCommerceNotificationIdempotencyKey as L, handleWebhook as M, isCommerceNotificationWebhookEvent as N, ORDER_CHANGED_EVENT_TYPE as O, isCustomerPasswordResetWebhookEvent as P, isOrderChangedWebhookEvent as Q, isValidWebhookEvent as R, isWebhookCollection as S, isWebhookOperation as T, type WebhookChange as W, COMMERCE_NOTIFICATION_EVENT_TYPE as a, COMMERCE_NOTIFICATION_OPERATION as b, CUSTOMER_PASSWORD_RESET_OPERATION as c, type CollectionWebhookOperation as d, type CommerceEmailChannel as e, type CommerceEmailConfig as f, type CommerceEmailEventConfig as g, type CommerceEmailEventHandlers as h, type CommerceEmailHandlerContext as i, type CommerceNotification as j, type CommerceNotificationData as k, type CommerceNotificationEventHandlers as l, type CommerceNotificationEventName as m, type CommerceNotificationHandlerContext as n, type CommerceNotificationSource as o, type CommerceNotificationSourceCollection as p, type CommerceNotificationWebhookEvent as q, type CustomerAuthWebhookEvent as r, type CustomerAuthWebhookHandlers as s, type CustomerPasswordResetWebhookData as t, type CustomerPasswordResetWebhookEvent as u, type OrderChangedWebhookEvent as v, type WebhookCommerceNotificationChange as w, type WebhookEvent as x, type WebhookHandler as y, type WebhookKnownOperation as z };
@@ -1,6 +1,6 @@
1
- import { C as Collection } from './const-BTvdrXtY.cjs';
2
- import { C as CollectionType } from './types-Bx558PU6.cjs';
3
- import './payload-types-C7tb7Xbs.cjs';
1
+ import { C as Collection } from './const-Dqz05oaG.js';
2
+ import { C as CollectionType } from './types-CxzWHspI.js';
3
+ import './payload-types-CREOjFNT.js';
4
4
 
5
5
  type WebhookOperation = string;
6
6
  /**
@@ -128,14 +128,16 @@ type CommerceEmailConfig = {
128
128
  version: 1;
129
129
  commerceNotifications: Partial<Record<CommerceNotificationEventName, CommerceEmailEventConfig>>;
130
130
  };
131
- type CommerceEmailHandlerContext = {
131
+ type CommerceNotificationHandlerContext = {
132
132
  event: CommerceNotificationWebhookEvent;
133
133
  idempotencyKey: string;
134
134
  };
135
135
  type MaybePromise<T> = T | Promise<T>;
136
- type CommerceEmailEventHandlers = Partial<Record<CommerceNotificationEventName, (context: CommerceEmailHandlerContext) => MaybePromise<void>>> & {
136
+ type CommerceNotificationEventHandlers = Partial<Record<CommerceNotificationEventName, (context: CommerceNotificationHandlerContext) => MaybePromise<void>>> & {
137
137
  unhandled?: (event: WebhookEvent<string, unknown>) => MaybePromise<void>;
138
138
  };
139
+ type CommerceEmailHandlerContext = CommerceNotificationHandlerContext;
140
+ type CommerceEmailEventHandlers = CommerceNotificationEventHandlers;
139
141
  /**
140
142
  * Returns true for semantic order-change webhooks emitted as update events.
141
143
  *
@@ -154,6 +156,7 @@ declare function isOrderChangedWebhookEvent(event: unknown): event is OrderChang
154
156
  declare function isCommerceNotificationWebhookEvent(event: unknown): event is CommerceNotificationWebhookEvent;
155
157
  declare function getCommerceNotificationIdempotencyKey(event: Pick<CommerceNotificationWebhookEvent, 'notification'>): string;
156
158
  declare function defineCommerceEmailConfig<TConfig extends CommerceEmailConfig>(config: TConfig): TConfig;
159
+ declare function createCommerceNotificationWebhookHandler(handlers: CommerceNotificationEventHandlers): WebhookHandler<string, unknown>;
157
160
  declare function createCommerceEmailWebhookHandler(handlers: CommerceEmailEventHandlers): WebhookHandler<string, unknown>;
158
161
  /** Narrows a webhook event to a specific collection. */
159
162
  declare function isWebhookCollection<TCollection extends string>(event: unknown, collection: TCollection): event is WebhookEvent<TCollection, unknown>;
@@ -183,4 +186,4 @@ declare function createCustomerAuthWebhookHandler(handlers: CustomerAuthWebhookH
183
186
  declare function handleWebhook<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>>(request: Request, handler: WebhookHandler<T, TData>, options?: WebhookOptions): Promise<Response>;
184
187
  declare function createTypedWebhookHandler<T extends Collection>(collection: T, handler: (event: WebhookEvent<T>) => Promise<void> | void): WebhookHandler<T>;
185
188
 
186
- export { type WebhookOrderChange as A, type WebhookOrderMoved as B, COMMERCE_NOTIFICATION_EVENTS as C, type WebhookOrderScope as D, createCommerceEmailWebhookHandler as E, createCustomerAuthWebhookHandler as F, createTypedWebhookHandler as G, defineCommerceEmailConfig as H, getCommerceNotificationIdempotencyKey as I, handleWebhook as J, isCommerceNotificationWebhookEvent as K, isCustomerPasswordResetWebhookEvent as L, isOrderChangedWebhookEvent as M, isValidWebhookEvent as N, ORDER_CHANGED_EVENT_TYPE as O, isWebhookCollection as P, isWebhookOperation as Q, type WebhookChange as W, COMMERCE_NOTIFICATION_EVENT_TYPE as a, COMMERCE_NOTIFICATION_OPERATION as b, CUSTOMER_PASSWORD_RESET_OPERATION as c, type CollectionWebhookOperation as d, type CommerceEmailChannel as e, type CommerceEmailConfig as f, type CommerceEmailEventConfig as g, type CommerceEmailEventHandlers as h, type CommerceEmailHandlerContext as i, type CommerceNotification as j, type CommerceNotificationData as k, type CommerceNotificationEventName as l, type CommerceNotificationSource as m, type CommerceNotificationSourceCollection as n, type CommerceNotificationWebhookEvent as o, type CustomerAuthWebhookEvent as p, type CustomerAuthWebhookHandlers as q, type CustomerPasswordResetWebhookData as r, type CustomerPasswordResetWebhookEvent as s, type OrderChangedWebhookEvent as t, type WebhookCommerceNotificationChange as u, type WebhookEvent as v, type WebhookHandler as w, type WebhookKnownOperation as x, type WebhookOperation as y, type WebhookOptions as z };
189
+ export { type WebhookOperation as A, type WebhookOptions as B, COMMERCE_NOTIFICATION_EVENTS as C, type WebhookOrderChange as D, type WebhookOrderMoved as E, type WebhookOrderScope as F, createCommerceEmailWebhookHandler as G, createCommerceNotificationWebhookHandler as H, createCustomerAuthWebhookHandler as I, createTypedWebhookHandler as J, defineCommerceEmailConfig as K, getCommerceNotificationIdempotencyKey as L, handleWebhook as M, isCommerceNotificationWebhookEvent as N, ORDER_CHANGED_EVENT_TYPE as O, isCustomerPasswordResetWebhookEvent as P, isOrderChangedWebhookEvent as Q, isValidWebhookEvent as R, isWebhookCollection as S, isWebhookOperation as T, type WebhookChange as W, COMMERCE_NOTIFICATION_EVENT_TYPE as a, COMMERCE_NOTIFICATION_OPERATION as b, CUSTOMER_PASSWORD_RESET_OPERATION as c, type CollectionWebhookOperation as d, type CommerceEmailChannel as e, type CommerceEmailConfig as f, type CommerceEmailEventConfig as g, type CommerceEmailEventHandlers as h, type CommerceEmailHandlerContext as i, type CommerceNotification as j, type CommerceNotificationData as k, type CommerceNotificationEventHandlers as l, type CommerceNotificationEventName as m, type CommerceNotificationHandlerContext as n, type CommerceNotificationSource as o, type CommerceNotificationSourceCollection as p, type CommerceNotificationWebhookEvent as q, type CustomerAuthWebhookEvent as r, type CustomerAuthWebhookHandlers as s, type CustomerPasswordResetWebhookData as t, type CustomerPasswordResetWebhookEvent as u, type OrderChangedWebhookEvent as v, type WebhookCommerceNotificationChange as w, type WebhookEvent as x, type WebhookHandler as y, type WebhookKnownOperation as z };