@lilaquadrat/interfaces 1.22.0 → 1.24.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 (41) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/cjs/Cart.d.ts +14 -0
  3. package/lib/cjs/CartItem.d.ts +5 -0
  4. package/lib/cjs/ListCategory.d.ts +3 -1
  5. package/lib/cjs/ListItem.d.ts +2 -1
  6. package/lib/cjs/Payment.d.ts +1 -0
  7. package/lib/cjs/PaymentProvider.d.ts +1 -1
  8. package/lib/cjs/PaymentProviderStripe.d.ts +6 -0
  9. package/lib/cjs/WithStructures.d.ts +10 -8
  10. package/lib/cjs/index.d.ts +4 -1
  11. package/lib/esm/Cart.d.ts +14 -0
  12. package/lib/esm/Cart.js +2 -0
  13. package/lib/esm/Cart.js.map +1 -0
  14. package/lib/esm/CartItem.d.ts +5 -0
  15. package/lib/esm/CartItem.js +2 -0
  16. package/lib/esm/CartItem.js.map +1 -0
  17. package/lib/esm/ListCategory.d.ts +3 -1
  18. package/lib/esm/ListItem.d.ts +2 -1
  19. package/lib/esm/Payment.d.ts +1 -0
  20. package/lib/esm/PaymentProvider.d.ts +1 -1
  21. package/lib/esm/PaymentProviderShopify.js +2 -0
  22. package/lib/esm/PaymentProviderShopify.js.map +1 -0
  23. package/lib/esm/PaymentProviderStripe.d.ts +6 -0
  24. package/lib/esm/PaymentProviderStripe.js +2 -0
  25. package/lib/esm/PaymentProviderStripe.js.map +1 -0
  26. package/lib/esm/WithStructures.d.ts +10 -8
  27. package/lib/esm/index.d.ts +4 -1
  28. package/package.json +1 -1
  29. package/src/Cart.ts +23 -0
  30. package/src/CartItem.ts +8 -0
  31. package/src/ListCategory.ts +3 -1
  32. package/src/ListItem.ts +2 -1
  33. package/src/Payment.ts +1 -0
  34. package/src/PaymentProvider.ts +1 -1
  35. package/src/PaymentProviderStripe.ts +10 -0
  36. package/src/WithStructures.ts +10 -8
  37. package/lib/esm/PaymentProviderShopify .js +0 -2
  38. package/lib/esm/PaymentProviderShopify .js.map +0 -1
  39. /package/lib/cjs/{PaymentProviderShopify .d.ts → PaymentProviderShopify.d.ts} +0 -0
  40. /package/lib/esm/{PaymentProviderShopify .d.ts → PaymentProviderShopify.d.ts} +0 -0
  41. /package/src/{PaymentProviderShopify .ts → PaymentProviderShopify.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.24.0](https://github.com/lilaquadrat/interfaces/compare/v1.23.0...v1.24.0) (2025-04-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * **cart:** add payment property to Cart ([6ef3251](https://github.com/lilaquadrat/interfaces/commit/6ef325144d08515d65abdc1a1c993d80d462283b))
11
+
12
+ ## [1.23.0](https://github.com/lilaquadrat/interfaces/compare/v1.22.0...v1.23.0) (2025-04-01)
13
+
14
+
15
+ ### Features
16
+
17
+ * **cart:** add Cart and CartItem interfaces; update ListCategory and ListItem structures ([bb17d2e](https://github.com/lilaquadrat/interfaces/commit/bb17d2e9ffc841ea12faddc87f86b8646cafe07b))
18
+
5
19
  ## [1.22.0](https://github.com/lilaquadrat/interfaces/compare/v1.21.1...v1.22.0) (2025-03-27)
6
20
 
7
21
 
@@ -0,0 +1,14 @@
1
+ import { CartItem } from "./CartItem";
2
+ import { ObjectIdString } from "./ObjectIdString";
3
+ export interface Cart {
4
+ items?: CartItem[];
5
+ state: 'open' | 'closed' | 'checkout';
6
+ company: string;
7
+ project: string;
8
+ attributes?: {
9
+ [key: string]: string;
10
+ };
11
+ modified?: Date;
12
+ checkoutUrl?: string;
13
+ payment: ObjectIdString;
14
+ }
@@ -0,0 +1,5 @@
1
+ import { ListCategory } from "./ListCategory";
2
+ export interface CartItem extends ListCategory {
3
+ id: string;
4
+ quantity: number;
5
+ }
@@ -1,8 +1,10 @@
1
+ import { ObjectId } from "mongodb";
1
2
  import Price from "./Price";
2
3
  export interface ListCategory {
3
- id: string;
4
+ _id: ObjectId;
4
5
  name: string;
5
6
  description?: string;
7
+ externalId?: string;
6
8
  amount?: number;
7
9
  disabled?: boolean;
8
10
  price?: Price;
@@ -1,5 +1,6 @@
1
1
  export interface ListItem {
2
- id: string;
2
+ id?: string;
3
+ _id?: string;
3
4
  name: string;
4
5
  price?: number;
5
6
  currency?: string;
@@ -12,4 +12,5 @@ export interface Payment {
12
12
  customer: ObjectId;
13
13
  webhook?: ObjectId;
14
14
  items?: ListItem[];
15
+ additionalData?: Record<string, string>;
15
16
  }
@@ -1,5 +1,5 @@
1
1
  export interface PaymentProvider {
2
- type: 'shopify';
2
+ type: 'shopify' | 'stripe';
3
3
  active: boolean;
4
4
  label: string;
5
5
  }
@@ -0,0 +1,6 @@
1
+ import { PaymentProvider } from "./PaymentProvider";
2
+ export interface PaymentProviderStripe extends PaymentProvider {
3
+ type: 'stripe';
4
+ token: string;
5
+ validationKey: string;
6
+ }
@@ -1,19 +1,21 @@
1
1
  import { Structure } from "./Structure";
2
+ /**
3
+ * Base interface containing only the standard properties
4
+ */
5
+ interface BaseWithStructures {
6
+ structures?: Structure[];
7
+ }
2
8
  /**
3
9
  * A utility type that can be extended by any interface to support
4
10
  * dynamic properties with keys prefixed with 's-'
5
11
  *
6
12
  * @example
7
- * interface MyInterface extends WithDynamicProperties {
13
+ * interface MyInterface extends WithStructures {
8
14
  * name: string;
9
15
  * // MyInterface now supports s- prefixed dynamic properties
10
16
  * }
11
17
  */
12
- export interface WithStructures {
13
- /**
14
- * Dynamic properties with s- prefix
15
- * Allows for custom properties like s-color, s-count, s-items, etc.
16
- */
18
+ export type WithStructures = BaseWithStructures & Partial<{
17
19
  [key: `s-${string}`]: string | boolean | number | Array<string>;
18
- structures?: Structure[];
19
- }
20
+ }>;
21
+ export {};
@@ -18,6 +18,8 @@ export * from './BaseFilterOptions';
18
18
  export * from './BasicData';
19
19
  export * from './BasicDataDatabase';
20
20
  export * from './CallResponse';
21
+ export * from './Cart';
22
+ export * from './CartItem';
21
23
  export * from './CategoryStructure';
22
24
  export * from './CategoryStructureWithRequired';
23
25
  export * from './Certificate';
@@ -108,7 +110,8 @@ export * from './Options';
108
110
  export * from './Partner';
109
111
  export * from './Payment';
110
112
  export * from './PaymentProvider';
111
- export * from './PaymentProviderShopify ';
113
+ export * from './PaymentProviderShopify';
114
+ export * from './PaymentProviderStripe';
112
115
  export * from './PaymentWithCustomer';
113
116
  export * from './Permissions';
114
117
  export * from './PermissionsWithScope';
@@ -0,0 +1,14 @@
1
+ import { CartItem } from "./CartItem";
2
+ import { ObjectIdString } from "./ObjectIdString";
3
+ export interface Cart {
4
+ items?: CartItem[];
5
+ state: 'open' | 'closed' | 'checkout';
6
+ company: string;
7
+ project: string;
8
+ attributes?: {
9
+ [key: string]: string;
10
+ };
11
+ modified?: Date;
12
+ checkoutUrl?: string;
13
+ payment: ObjectIdString;
14
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Cart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cart.js","sourceRoot":"","sources":["../../src/Cart.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { ListCategory } from "./ListCategory";
2
+ export interface CartItem extends ListCategory {
3
+ id: string;
4
+ quantity: number;
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CartItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CartItem.js","sourceRoot":"","sources":["../../src/CartItem.ts"],"names":[],"mappings":""}
@@ -1,8 +1,10 @@
1
+ import { ObjectId } from "mongodb";
1
2
  import Price from "./Price";
2
3
  export interface ListCategory {
3
- id: string;
4
+ _id: ObjectId;
4
5
  name: string;
5
6
  description?: string;
7
+ externalId?: string;
6
8
  amount?: number;
7
9
  disabled?: boolean;
8
10
  price?: Price;
@@ -1,5 +1,6 @@
1
1
  export interface ListItem {
2
- id: string;
2
+ id?: string;
3
+ _id?: string;
3
4
  name: string;
4
5
  price?: number;
5
6
  currency?: string;
@@ -12,4 +12,5 @@ export interface Payment {
12
12
  customer: ObjectId;
13
13
  webhook?: ObjectId;
14
14
  items?: ListItem[];
15
+ additionalData?: Record<string, string>;
15
16
  }
@@ -1,5 +1,5 @@
1
1
  export interface PaymentProvider {
2
- type: 'shopify';
2
+ type: 'shopify' | 'stripe';
3
3
  active: boolean;
4
4
  label: string;
5
5
  }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PaymentProviderShopify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentProviderShopify.js","sourceRoot":"","sources":["../../src/PaymentProviderShopify.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { PaymentProvider } from "./PaymentProvider";
2
+ export interface PaymentProviderStripe extends PaymentProvider {
3
+ type: 'stripe';
4
+ token: string;
5
+ validationKey: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PaymentProviderStripe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentProviderStripe.js","sourceRoot":"","sources":["../../src/PaymentProviderStripe.ts"],"names":[],"mappings":""}
@@ -1,19 +1,21 @@
1
1
  import { Structure } from "./Structure";
2
+ /**
3
+ * Base interface containing only the standard properties
4
+ */
5
+ interface BaseWithStructures {
6
+ structures?: Structure[];
7
+ }
2
8
  /**
3
9
  * A utility type that can be extended by any interface to support
4
10
  * dynamic properties with keys prefixed with 's-'
5
11
  *
6
12
  * @example
7
- * interface MyInterface extends WithDynamicProperties {
13
+ * interface MyInterface extends WithStructures {
8
14
  * name: string;
9
15
  * // MyInterface now supports s- prefixed dynamic properties
10
16
  * }
11
17
  */
12
- export interface WithStructures {
13
- /**
14
- * Dynamic properties with s- prefix
15
- * Allows for custom properties like s-color, s-count, s-items, etc.
16
- */
18
+ export type WithStructures = BaseWithStructures & Partial<{
17
19
  [key: `s-${string}`]: string | boolean | number | Array<string>;
18
- structures?: Structure[];
19
- }
20
+ }>;
21
+ export {};
@@ -18,6 +18,8 @@ export * from './BaseFilterOptions';
18
18
  export * from './BasicData';
19
19
  export * from './BasicDataDatabase';
20
20
  export * from './CallResponse';
21
+ export * from './Cart';
22
+ export * from './CartItem';
21
23
  export * from './CategoryStructure';
22
24
  export * from './CategoryStructureWithRequired';
23
25
  export * from './Certificate';
@@ -108,7 +110,8 @@ export * from './Options';
108
110
  export * from './Partner';
109
111
  export * from './Payment';
110
112
  export * from './PaymentProvider';
111
- export * from './PaymentProviderShopify ';
113
+ export * from './PaymentProviderShopify';
114
+ export * from './PaymentProviderStripe';
112
115
  export * from './PaymentWithCustomer';
113
116
  export * from './Permissions';
114
117
  export * from './PermissionsWithScope';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lilaquadrat/interfaces",
3
- "version": "1.22.0",
3
+ "version": "1.24.0",
4
4
  "description": "interfaces in context of lilaquadrat STUDIO",
5
5
  "author": {
6
6
  "email": "m.schuebel@lila2.de",
package/src/Cart.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { CartItem } from "./CartItem"
2
+ import { ObjectIdString } from "./ObjectIdString"
3
+
4
+ export interface Cart {
5
+
6
+ items?: CartItem[]
7
+
8
+ state: 'open' | 'closed' | 'checkout'
9
+
10
+ company: string
11
+ project: string
12
+
13
+ attributes?: {
14
+ [key: string]: string
15
+ }
16
+
17
+ modified?: Date
18
+
19
+ checkoutUrl?: string
20
+
21
+ payment: ObjectIdString
22
+
23
+ }
@@ -0,0 +1,8 @@
1
+ import { ListCategory } from "./ListCategory"
2
+
3
+ export interface CartItem extends ListCategory {
4
+
5
+ id: string
6
+ quantity: number
7
+
8
+ }
@@ -1,10 +1,12 @@
1
+ import { ObjectId } from "mongodb";
1
2
  import Price from "./Price";
2
3
 
3
4
  export interface ListCategory {
4
5
 
5
- id: string;
6
+ _id: ObjectId;
6
7
  name: string
7
8
  description?: string
9
+ externalId?: string
8
10
  amount?: number
9
11
  disabled?: boolean
10
12
  price?: Price
package/src/ListItem.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export interface ListItem {
2
2
 
3
- id: string
3
+ id?: string
4
+ _id?: string
4
5
  name: string
5
6
  price?: number
6
7
  currency?: string
package/src/Payment.ts CHANGED
@@ -13,4 +13,5 @@ export interface Payment {
13
13
  customer: ObjectId
14
14
  webhook?: ObjectId
15
15
  items?: ListItem[]
16
+ additionalData?: Record<string, string>
16
17
  }
@@ -1,7 +1,7 @@
1
1
 
2
2
  export interface PaymentProvider {
3
3
 
4
- type: 'shopify'
4
+ type: 'shopify' | 'stripe'
5
5
 
6
6
  active: boolean
7
7
 
@@ -0,0 +1,10 @@
1
+ import { PaymentProvider } from "./PaymentProvider";
2
+
3
+ export interface PaymentProviderStripe extends PaymentProvider {
4
+
5
+ type: 'stripe'
6
+
7
+ token: string
8
+ validationKey: string
9
+
10
+ }
@@ -1,20 +1,22 @@
1
1
  import { Structure } from "./Structure";
2
2
 
3
+ /**
4
+ * Base interface containing only the standard properties
5
+ */
6
+ interface BaseWithStructures {
7
+ structures?: Structure[]
8
+ }
9
+
3
10
  /**
4
11
  * A utility type that can be extended by any interface to support
5
12
  * dynamic properties with keys prefixed with 's-'
6
13
  *
7
14
  * @example
8
- * interface MyInterface extends WithDynamicProperties {
15
+ * interface MyInterface extends WithStructures {
9
16
  * name: string;
10
17
  * // MyInterface now supports s- prefixed dynamic properties
11
18
  * }
12
19
  */
13
- export interface WithStructures {
14
- /**
15
- * Dynamic properties with s- prefix
16
- * Allows for custom properties like s-color, s-count, s-items, etc.
17
- */
20
+ export type WithStructures = BaseWithStructures & Partial<{
18
21
  [key: `s-${string}`]: string | boolean | number | Array<string>;
19
- structures?: Structure[]
20
- }
22
+ }>
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PaymentProviderShopify%20.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaymentProviderShopify .js","sourceRoot":"","sources":["../../src/PaymentProviderShopify .ts"],"names":[],"mappings":""}