@payloadcms/plugin-ecommerce 3.71.0-internal-debug.dea9d74 → 3.71.0-internal-debug.e053082

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.
@@ -20,8 +20,18 @@ type AddressesUntyped = {
20
20
  [key: string]: any;
21
21
  id: DefaultDocumentIDType;
22
22
  };
23
- type ResolveEcommerceType<T> = 'ecommerce' extends keyof T ? T['ecommerce'] : T['ecommerceUntyped'];
24
- export type TypedEcommerce = ResolveEcommerceType<GeneratedTypes>;
23
+ type EcommerceBase = {
24
+ collections: {
25
+ addresses: AddressesUntyped;
26
+ carts: CartsUntyped;
27
+ };
28
+ };
29
+ type ResolveEcommerceType<T> = T extends {
30
+ ecommerce: infer E;
31
+ } ? E : T extends {
32
+ ecommerceUntyped: infer E;
33
+ } ? E : EcommerceBase;
34
+ export type TypedEcommerce = EcommerceBase & ResolveEcommerceType<GeneratedTypes>;
25
35
  declare module 'payload' {
26
36
  interface GeneratedTypes {
27
37
  ecommerceUntyped: {
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/types/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEpE;;;;;;;;;;GAUG;AAEH,KAAK,YAAY,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,EAAE,EAAE,qBAAqB,CAAA;IACzB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,EAAE,EAAE,qBAAqB,CAAA;CAC1B,CAAA;AAED,KAAK,oBAAoB,CAAC,CAAC,IAAI,WAAW,SAAS,MAAM,CAAC,GACtD,CAAC,CAAC,WAAW,CAAC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BAAgB,EAAE;YAChB,WAAW,EAAE;gBACX,SAAS,EAAE,gBAAgB,CAAA;gBAC3B,KAAK,EAAE,YAAY,CAAA;aACpB,CAAA;SACF,CAAA;KACF;CACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/utilities.ts"],"sourcesContent":["import type { DefaultDocumentIDType, GeneratedTypes } from 'payload'\n\n/**\n * THIS FILE IS EXTREMELY SENSITIVE PLEASE BE CAREFUL AS THERE IS EVIL AT PLAY\n *\n * This file is used to extract the types for the ecommerce plugin\n * from the user's generated types. It must be kept as a .ts file\n * and not a .tsx file, and it must not import any other files\n * that are not strictly types. This is to prevent circular\n * dependencies and to ensure that the types are always available.\n *\n * Do not add any runtime code to this file.\n */\n\ntype CartsUntyped = {\n [key: string]: any\n id: DefaultDocumentIDType\n items?: any[]\n subtotal?: number\n}\n\ntype AddressesUntyped = {\n [key: string]: any\n id: DefaultDocumentIDType\n}\n\ntype ResolveEcommerceType<T> = 'ecommerce' extends keyof T\n ? T['ecommerce']\n : // @ts-expect-error - typescript doesnt play nice here\n T['ecommerceUntyped']\n\nexport type TypedEcommerce = ResolveEcommerceType<GeneratedTypes>\n\ndeclare module 'payload' {\n export interface GeneratedTypes {\n ecommerceUntyped: {\n collections: {\n addresses: AddressesUntyped\n carts: CartsUntyped\n }\n }\n }\n}\n"],"names":[],"mappings":"AA+BA,WAAiE"}
1
+ {"version":3,"sources":["../../src/types/utilities.ts"],"sourcesContent":["import type { DefaultDocumentIDType, GeneratedTypes } from 'payload'\n\n/**\n * THIS FILE IS EXTREMELY SENSITIVE PLEASE BE CAREFUL AS THERE IS EVIL AT PLAY\n *\n * This file is used to extract the types for the ecommerce plugin\n * from the user's generated types. It must be kept as a .ts file\n * and not a .tsx file, and it must not import any other files\n * that are not strictly types. This is to prevent circular\n * dependencies and to ensure that the types are always available.\n *\n * Do not add any runtime code to this file.\n */\n\ntype CartsUntyped = {\n [key: string]: any\n id: DefaultDocumentIDType\n items?: any[]\n subtotal?: number\n}\n\ntype AddressesUntyped = {\n [key: string]: any\n id: DefaultDocumentIDType\n}\n\ntype EcommerceBase = {\n collections: {\n addresses: AddressesUntyped\n carts: CartsUntyped\n }\n}\n\ntype ResolveEcommerceType<T> = T extends { ecommerce: infer E }\n ? E\n : T extends { ecommerceUntyped: infer E }\n ? E\n : EcommerceBase\n\nexport type TypedEcommerce = EcommerceBase & ResolveEcommerceType<GeneratedTypes>\n\ndeclare module 'payload' {\n export interface GeneratedTypes {\n ecommerceUntyped: {\n collections: {\n addresses: AddressesUntyped\n carts: CartsUntyped\n }\n }\n }\n}\n"],"names":[],"mappings":"AAuCA,WAAiF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-ecommerce",
3
- "version": "3.71.0-internal-debug.dea9d74",
3
+ "version": "3.71.0-internal-debug.e053082",
4
4
  "description": "Ecommerce plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -69,22 +69,22 @@
69
69
  ],
70
70
  "dependencies": {
71
71
  "qs-esm": "7.0.2",
72
- "@payloadcms/translations": "3.71.0-internal-debug.dea9d74",
73
- "@payloadcms/ui": "3.71.0-internal-debug.dea9d74"
72
+ "@payloadcms/translations": "3.71.0-internal-debug.e053082",
73
+ "@payloadcms/ui": "3.71.0-internal-debug.e053082"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/json-schema": "7.0.15",
77
77
  "@types/react": "19.2.1",
78
78
  "@types/react-dom": "19.2.1",
79
79
  "stripe": "18.3.0",
80
- "@payloadcms/next": "3.71.0-internal-debug.dea9d74",
81
- "payload": "3.71.0-internal-debug.dea9d74",
82
- "@payloadcms/eslint-config": "3.28.0"
80
+ "@payloadcms/eslint-config": "3.28.0",
81
+ "@payloadcms/next": "3.71.0-internal-debug.e053082",
82
+ "payload": "3.71.0-internal-debug.e053082"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
86
86
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
87
- "payload": "3.71.0-internal-debug.dea9d74"
87
+ "payload": "3.71.0-internal-debug.e053082"
88
88
  },
89
89
  "publishConfig": {
90
90
  "registry": "https://registry.npmjs.org/"