@pisell/pisellos 0.0.5

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 (138) hide show
  1. package/README.md +180 -0
  2. package/dist/core/index.d.ts +30 -0
  3. package/dist/core/index.js +360 -0
  4. package/dist/effects/index.d.ts +17 -0
  5. package/dist/effects/index.js +162 -0
  6. package/dist/index.d.ts +11 -0
  7. package/dist/index.js +17 -0
  8. package/dist/modules/Account/index.d.ts +21 -0
  9. package/dist/modules/Account/index.js +212 -0
  10. package/dist/modules/Account/types.d.ts +41 -0
  11. package/dist/modules/Account/types.js +19 -0
  12. package/dist/modules/BaseModule.d.ts +11 -0
  13. package/dist/modules/BaseModule.js +27 -0
  14. package/dist/modules/Cart/index.d.ts +33 -0
  15. package/dist/modules/Cart/index.js +242 -0
  16. package/dist/modules/Cart/types.d.ts +35 -0
  17. package/dist/modules/Cart/types.js +19 -0
  18. package/dist/modules/Date/index.d.ts +17 -0
  19. package/dist/modules/Date/index.js +133 -0
  20. package/dist/modules/Date/types.d.ts +32 -0
  21. package/dist/modules/Date/types.js +17 -0
  22. package/dist/modules/Guests/index.d.ts +17 -0
  23. package/dist/modules/Guests/index.js +259 -0
  24. package/dist/modules/Guests/types.d.ts +43 -0
  25. package/dist/modules/Guests/types.js +23 -0
  26. package/dist/modules/Order/index.d.ts +17 -0
  27. package/dist/modules/Order/index.js +228 -0
  28. package/dist/modules/Order/types.d.ts +57 -0
  29. package/dist/modules/Order/types.js +29 -0
  30. package/dist/modules/Payment/index.d.ts +18 -0
  31. package/dist/modules/Payment/index.js +243 -0
  32. package/dist/modules/Payment/types.d.ts +49 -0
  33. package/dist/modules/Payment/types.js +31 -0
  34. package/dist/modules/Product/index.d.ts +39 -0
  35. package/dist/modules/Product/index.js +118 -0
  36. package/dist/modules/Product/types.d.ts +387 -0
  37. package/dist/modules/Product/types.js +1 -0
  38. package/dist/modules/ProductList/index.d.ts +16 -0
  39. package/dist/modules/ProductList/index.js +158 -0
  40. package/dist/modules/ProductList/types.d.ts +9 -0
  41. package/dist/modules/ProductList/types.js +5 -0
  42. package/dist/modules/Resource/index.d.ts +15 -0
  43. package/dist/modules/Resource/index.js +219 -0
  44. package/dist/modules/Resource/types.d.ts +44 -0
  45. package/dist/modules/Resource/types.js +22 -0
  46. package/dist/modules/index.d.ts +3 -0
  47. package/dist/modules/index.js +3 -0
  48. package/dist/plugins/index.d.ts +2 -0
  49. package/dist/plugins/index.js +2 -0
  50. package/dist/plugins/request.d.ts +127 -0
  51. package/dist/plugins/request.js +592 -0
  52. package/dist/plugins/window.d.ts +115 -0
  53. package/dist/plugins/window.js +328 -0
  54. package/dist/solution/BookingByStep/index.d.ts +12 -0
  55. package/dist/solution/BookingByStep/index.js +77 -0
  56. package/dist/solution/BookingByStep/types.d.ts +27 -0
  57. package/dist/solution/BookingByStep/types.js +10 -0
  58. package/dist/solution/BuyTickets/index.d.ts +26 -0
  59. package/dist/solution/BuyTickets/index.js +339 -0
  60. package/dist/solution/BuyTickets/types.d.ts +24 -0
  61. package/dist/solution/BuyTickets/types.js +19 -0
  62. package/dist/solution/PlaceOrder/index.d.ts +0 -0
  63. package/dist/solution/PlaceOrder/index.js +54 -0
  64. package/dist/solution/index.d.ts +1 -0
  65. package/dist/solution/index.js +1 -0
  66. package/dist/store/createStore.d.ts +3 -0
  67. package/dist/store/createStore.js +43 -0
  68. package/dist/types/index.d.ts +85 -0
  69. package/dist/types/index.js +1 -0
  70. package/lib/core/index.d.ts +30 -0
  71. package/lib/core/index.js +212 -0
  72. package/lib/effects/index.d.ts +17 -0
  73. package/lib/effects/index.js +78 -0
  74. package/lib/index.d.ts +11 -0
  75. package/lib/index.js +51 -0
  76. package/lib/modules/Account/index.d.ts +21 -0
  77. package/lib/modules/Account/index.js +93 -0
  78. package/lib/modules/Account/types.d.ts +41 -0
  79. package/lib/modules/Account/types.js +35 -0
  80. package/lib/modules/BaseModule.d.ts +11 -0
  81. package/lib/modules/BaseModule.js +40 -0
  82. package/lib/modules/Cart/index.d.ts +33 -0
  83. package/lib/modules/Cart/index.js +104 -0
  84. package/lib/modules/Cart/types.d.ts +35 -0
  85. package/lib/modules/Cart/types.js +35 -0
  86. package/lib/modules/Date/index.d.ts +17 -0
  87. package/lib/modules/Date/index.js +75 -0
  88. package/lib/modules/Date/types.d.ts +32 -0
  89. package/lib/modules/Date/types.js +33 -0
  90. package/lib/modules/Guests/index.d.ts +17 -0
  91. package/lib/modules/Guests/index.js +95 -0
  92. package/lib/modules/Guests/types.d.ts +43 -0
  93. package/lib/modules/Guests/types.js +35 -0
  94. package/lib/modules/Order/index.d.ts +17 -0
  95. package/lib/modules/Order/index.js +95 -0
  96. package/lib/modules/Order/types.d.ts +57 -0
  97. package/lib/modules/Order/types.js +35 -0
  98. package/lib/modules/Payment/index.d.ts +18 -0
  99. package/lib/modules/Payment/index.js +103 -0
  100. package/lib/modules/Payment/types.d.ts +49 -0
  101. package/lib/modules/Payment/types.js +35 -0
  102. package/lib/modules/Product/index.d.ts +39 -0
  103. package/lib/modules/Product/index.js +87 -0
  104. package/lib/modules/Product/types.d.ts +387 -0
  105. package/lib/modules/Product/types.js +17 -0
  106. package/lib/modules/ProductList/index.d.ts +16 -0
  107. package/lib/modules/ProductList/index.js +71 -0
  108. package/lib/modules/ProductList/types.d.ts +9 -0
  109. package/lib/modules/ProductList/types.js +33 -0
  110. package/lib/modules/Resource/index.d.ts +15 -0
  111. package/lib/modules/Resource/index.js +91 -0
  112. package/lib/modules/Resource/types.d.ts +44 -0
  113. package/lib/modules/Resource/types.js +34 -0
  114. package/lib/modules/index.d.ts +3 -0
  115. package/lib/modules/index.js +27 -0
  116. package/lib/plugins/index.d.ts +2 -0
  117. package/lib/plugins/index.js +25 -0
  118. package/lib/plugins/request.d.ts +127 -0
  119. package/lib/plugins/request.js +297 -0
  120. package/lib/plugins/window.d.ts +115 -0
  121. package/lib/plugins/window.js +252 -0
  122. package/lib/solution/BookingByStep/index.d.ts +12 -0
  123. package/lib/solution/BookingByStep/index.js +53 -0
  124. package/lib/solution/BookingByStep/types.d.ts +27 -0
  125. package/lib/solution/BookingByStep/types.js +38 -0
  126. package/lib/solution/BuyTickets/index.d.ts +26 -0
  127. package/lib/solution/BuyTickets/index.js +122 -0
  128. package/lib/solution/BuyTickets/types.d.ts +24 -0
  129. package/lib/solution/BuyTickets/types.js +40 -0
  130. package/lib/solution/PlaceOrder/index.d.ts +0 -0
  131. package/lib/solution/PlaceOrder/index.js +0 -0
  132. package/lib/solution/index.d.ts +1 -0
  133. package/lib/solution/index.js +23 -0
  134. package/lib/store/createStore.d.ts +3 -0
  135. package/lib/store/createStore.js +46 -0
  136. package/lib/types/index.d.ts +85 -0
  137. package/lib/types/index.js +17 -0
  138. package/package.json +65 -0
@@ -0,0 +1,57 @@
1
+ import { Guest } from '../Guests/types';
2
+ import { Resource } from '../Resource/types';
3
+ import { TimeSlot } from '../Date/types';
4
+ export declare enum OrderHooks {
5
+ OnOrderCreate = "order:onOrderCreate",
6
+ OnOrderUpdate = "order:onOrderUpdate",
7
+ OnOrderCancel = "order:onOrderCancel",
8
+ OnOrderStatusChange = "order:onOrderStatusChange"
9
+ }
10
+ /**
11
+ * 订单状态
12
+ */
13
+ export type OrderStatus = 'pending' | 'paid' | 'confirmed' | 'completed' | 'cancelled' | 'refunded';
14
+ /**
15
+ * 订单项
16
+ */
17
+ export interface OrderItem {
18
+ id: string;
19
+ productId: string;
20
+ quantity: number;
21
+ price: number;
22
+ guest: Guest;
23
+ resource: Resource;
24
+ timeSlot: TimeSlot;
25
+ }
26
+ /**
27
+ * 订单信息
28
+ */
29
+ export interface Order {
30
+ id: string;
31
+ orderNumber: string;
32
+ status: OrderStatus;
33
+ items: OrderItem[];
34
+ totalAmount: number;
35
+ createdAt: Date;
36
+ updatedAt: Date;
37
+ metadata?: Record<string, any>;
38
+ }
39
+ /**
40
+ * 订单模块状态
41
+ */
42
+ export interface OrderState {
43
+ currentOrder: Order | null;
44
+ orderHistory: Order[];
45
+ }
46
+ /**
47
+ * 订单模块 API
48
+ */
49
+ export interface OrderModuleAPI {
50
+ createOrder: (items: OrderItem[]) => Promise<Order>;
51
+ getOrder: (orderId: string) => Promise<Order>;
52
+ updateOrderStatus: (orderId: string, status: OrderStatus) => Promise<void>;
53
+ cancelOrder: (orderId: string) => Promise<void>;
54
+ getOrderHistory: () => Promise<Order[]>;
55
+ getCurrentOrder: () => Order | null;
56
+ calculateTotalAmount: (items: OrderItem[]) => number;
57
+ }
@@ -0,0 +1,35 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/modules/Order/types.ts
20
+ var types_exports = {};
21
+ __export(types_exports, {
22
+ OrderHooks: () => OrderHooks
23
+ });
24
+ module.exports = __toCommonJS(types_exports);
25
+ var OrderHooks = /* @__PURE__ */ ((OrderHooks2) => {
26
+ OrderHooks2["OnOrderCreate"] = "order:onOrderCreate";
27
+ OrderHooks2["OnOrderUpdate"] = "order:onOrderUpdate";
28
+ OrderHooks2["OnOrderCancel"] = "order:onOrderCancel";
29
+ OrderHooks2["OnOrderStatusChange"] = "order:onOrderStatusChange";
30
+ return OrderHooks2;
31
+ })(OrderHooks || {});
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ OrderHooks
35
+ });
@@ -0,0 +1,18 @@
1
+ import { Module, PisellCore, ModuleOptions } from '../../types';
2
+ import { BaseModule } from '../BaseModule';
3
+ import { Payment, PaymentModuleAPI, PaymentMethod, PaymentStatus } from './types';
4
+ import { Order } from '../Order/types';
5
+ export declare class PaymentModule extends BaseModule implements Module, PaymentModuleAPI {
6
+ protected defaultName: string;
7
+ protected defaultVersion: string;
8
+ private state;
9
+ constructor(name?: string, version?: string);
10
+ initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
11
+ initPayment(order: Order, method: PaymentMethod): Promise<Payment>;
12
+ processPayment(paymentId: string): Promise<void>;
13
+ getPayment(paymentId: string): Promise<Payment>;
14
+ getPaymentHistory(): Promise<Payment[]>;
15
+ refund(paymentId: string): Promise<void>;
16
+ getAvailablePaymentMethods(): PaymentMethod[];
17
+ checkPaymentStatus(paymentId: string): Promise<PaymentStatus>;
18
+ }
@@ -0,0 +1,103 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/modules/Payment/index.ts
20
+ var Payment_exports = {};
21
+ __export(Payment_exports, {
22
+ PaymentModule: () => PaymentModule
23
+ });
24
+ module.exports = __toCommonJS(Payment_exports);
25
+ var import_BaseModule = require("../BaseModule");
26
+ var import_types = require("./types");
27
+ var PaymentModule = class extends import_BaseModule.BaseModule {
28
+ constructor(name, version) {
29
+ super(name, version);
30
+ this.defaultName = "bookingByStep";
31
+ this.defaultVersion = "1.0.0";
32
+ this.state = {
33
+ currentPayment: null,
34
+ paymentHistory: []
35
+ };
36
+ }
37
+ async initialize(core, options) {
38
+ this.core = core;
39
+ if (options == null ? void 0 : options.initialState) {
40
+ this.state = { ...this.state, ...options.initialState };
41
+ }
42
+ }
43
+ async initPayment(order, method) {
44
+ const payment = {
45
+ id: Date.now().toString(),
46
+ // 实际应该使用更可靠的 ID 生成方式
47
+ orderId: order.id,
48
+ amount: order.totalAmount,
49
+ currency: "CNY",
50
+ // 默认货币
51
+ method,
52
+ status: "pending",
53
+ createdAt: /* @__PURE__ */ new Date(),
54
+ updatedAt: /* @__PURE__ */ new Date()
55
+ };
56
+ this.state.currentPayment = payment;
57
+ await this.core.effects.emit(import_types.PaymentHooks.OnPaymentInit, payment);
58
+ return payment;
59
+ }
60
+ async processPayment(paymentId) {
61
+ const payment = this.state.paymentHistory.find((p) => p.id === paymentId);
62
+ if (!payment)
63
+ return;
64
+ payment.status = "processing";
65
+ payment.updatedAt = /* @__PURE__ */ new Date();
66
+ await this.core.effects.emit(import_types.PaymentHooks.OnPaymentSuccess, payment);
67
+ }
68
+ async getPayment(paymentId) {
69
+ const payment = this.state.paymentHistory.find((p) => p.id === paymentId);
70
+ if (!payment)
71
+ throw new Error("Payment not found");
72
+ return payment;
73
+ }
74
+ async getPaymentHistory() {
75
+ return this.state.paymentHistory;
76
+ }
77
+ async refund(paymentId) {
78
+ const payment = this.state.paymentHistory.find((p) => p.id === paymentId);
79
+ if (!payment)
80
+ return;
81
+ payment.status = "refunded";
82
+ payment.updatedAt = /* @__PURE__ */ new Date();
83
+ await this.core.effects.emit(import_types.PaymentHooks.OnPaymentRefund, payment);
84
+ }
85
+ getAvailablePaymentMethods() {
86
+ return [
87
+ "credit_card",
88
+ "debit_card",
89
+ "alipay",
90
+ "wechat_pay"
91
+ ];
92
+ }
93
+ async checkPaymentStatus(paymentId) {
94
+ const payment = this.state.paymentHistory.find((p) => p.id === paymentId);
95
+ if (!payment)
96
+ throw new Error("Payment not found");
97
+ return payment.status;
98
+ }
99
+ };
100
+ // Annotate the CommonJS export names for ESM import in node:
101
+ 0 && (module.exports = {
102
+ PaymentModule
103
+ });
@@ -0,0 +1,49 @@
1
+ import { Order } from '../Order/types';
2
+ export declare enum PaymentHooks {
3
+ OnPaymentInit = "payment:onPaymentInit",
4
+ OnPaymentSuccess = "payment:onPaymentSuccess",
5
+ OnPaymentFailure = "payment:onPaymentFailure",
6
+ OnPaymentRefund = "payment:onPaymentRefund"
7
+ }
8
+ /**
9
+ * 支付方式
10
+ */
11
+ export type PaymentMethod = 'credit_card' | 'debit_card' | 'paypal' | 'alipay' | 'wechat_pay' | 'bank_transfer';
12
+ /**
13
+ * 支付状态
14
+ */
15
+ export type PaymentStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'refunded';
16
+ /**
17
+ * 支付信息
18
+ */
19
+ export interface Payment {
20
+ id: string;
21
+ orderId: string;
22
+ amount: number;
23
+ currency: string;
24
+ method: PaymentMethod;
25
+ status: PaymentStatus;
26
+ transactionId?: string;
27
+ createdAt: Date;
28
+ updatedAt: Date;
29
+ metadata?: Record<string, any>;
30
+ }
31
+ /**
32
+ * 支付模块状态
33
+ */
34
+ export interface PaymentState {
35
+ currentPayment: Payment | null;
36
+ paymentHistory: Payment[];
37
+ }
38
+ /**
39
+ * 支付模块 API
40
+ */
41
+ export interface PaymentModuleAPI {
42
+ initPayment: (order: Order, method: PaymentMethod) => Promise<Payment>;
43
+ processPayment: (paymentId: string) => Promise<void>;
44
+ getPayment: (paymentId: string) => Promise<Payment>;
45
+ getPaymentHistory: () => Promise<Payment[]>;
46
+ refund: (paymentId: string) => Promise<void>;
47
+ getAvailablePaymentMethods: () => PaymentMethod[];
48
+ checkPaymentStatus: (paymentId: string) => Promise<PaymentStatus>;
49
+ }
@@ -0,0 +1,35 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/modules/Payment/types.ts
20
+ var types_exports = {};
21
+ __export(types_exports, {
22
+ PaymentHooks: () => PaymentHooks
23
+ });
24
+ module.exports = __toCommonJS(types_exports);
25
+ var PaymentHooks = /* @__PURE__ */ ((PaymentHooks2) => {
26
+ PaymentHooks2["OnPaymentInit"] = "payment:onPaymentInit";
27
+ PaymentHooks2["OnPaymentSuccess"] = "payment:onPaymentSuccess";
28
+ PaymentHooks2["OnPaymentFailure"] = "payment:onPaymentFailure";
29
+ PaymentHooks2["OnPaymentRefund"] = "payment:onPaymentRefund";
30
+ return PaymentHooks2;
31
+ })(PaymentHooks || {});
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ PaymentHooks
35
+ });
@@ -0,0 +1,39 @@
1
+ import { Module, PisellCore } from '../../types';
2
+ import { BaseModule } from '../BaseModule';
3
+ import { ProductData, ProductMedia, ProductTag, ProductCategory, ProductBundleGroup } from './types';
4
+ export * from './types';
5
+ export declare class Product extends BaseModule implements Module {
6
+ protected defaultName: string;
7
+ protected defaultVersion: string;
8
+ private store;
9
+ constructor(name?: string, version?: string);
10
+ initialize(core: PisellCore, options: any): Promise<void>;
11
+ /**
12
+ * 获取商品数据
13
+ */
14
+ getData(): ProductData | null;
15
+ /**
16
+ * 获取商品ID
17
+ */
18
+ getId(): number | null;
19
+ /**
20
+ * 获取商品标题
21
+ */
22
+ getTitle(): string | null;
23
+ /**
24
+ * 获取商品捆绑组
25
+ */
26
+ getBundleGroups(): ProductBundleGroup[];
27
+ /**
28
+ * 获取商品媒体
29
+ */
30
+ getMedia(): ProductMedia[];
31
+ /**
32
+ * 获取商品标签
33
+ */
34
+ getTags(): ProductTag[];
35
+ /**
36
+ * 获取商品分类
37
+ */
38
+ getCategories(): ProductCategory[];
39
+ }
@@ -0,0 +1,87 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/modules/Product/index.ts
21
+ var Product_exports = {};
22
+ __export(Product_exports, {
23
+ Product: () => Product
24
+ });
25
+ module.exports = __toCommonJS(Product_exports);
26
+ var import_BaseModule = require("../BaseModule");
27
+ __reExport(Product_exports, require("./types"), module.exports);
28
+ var Product = class extends import_BaseModule.BaseModule {
29
+ constructor(name, version) {
30
+ super(name, version);
31
+ this.defaultName = "product";
32
+ this.defaultVersion = "1.0.0";
33
+ }
34
+ async initialize(core, options) {
35
+ this.core = core;
36
+ this.store = options.store || {};
37
+ }
38
+ /**
39
+ * 获取商品数据
40
+ */
41
+ getData() {
42
+ return this.store;
43
+ }
44
+ /**
45
+ * 获取商品ID
46
+ */
47
+ getId() {
48
+ var _a;
49
+ return ((_a = this.store) == null ? void 0 : _a.id) ?? null;
50
+ }
51
+ /**
52
+ * 获取商品标题
53
+ */
54
+ getTitle() {
55
+ var _a;
56
+ return ((_a = this.store) == null ? void 0 : _a.title) ?? null;
57
+ }
58
+ /**
59
+ * 获取商品捆绑组
60
+ */
61
+ getBundleGroups() {
62
+ return this.store.bundle_groups;
63
+ }
64
+ /**
65
+ * 获取商品媒体
66
+ */
67
+ getMedia() {
68
+ return this.store.media;
69
+ }
70
+ /**
71
+ * 获取商品标签
72
+ */
73
+ getTags() {
74
+ return this.store.tags;
75
+ }
76
+ /**
77
+ * 获取商品分类
78
+ */
79
+ getCategories() {
80
+ return this.store.categories;
81
+ }
82
+ };
83
+ // Annotate the CommonJS export names for ESM import in node:
84
+ 0 && (module.exports = {
85
+ Product,
86
+ ...require("./types")
87
+ });