b23-lib 1.7.35 → 1.8.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.
- package/dist/Classes/Cart.mjs +1 -1
- package/dist/Classes/Inventory.d.mts +29 -0
- package/dist/Classes/Inventory.d.ts +29 -0
- package/dist/Classes/Inventory.js +2 -0
- package/dist/Classes/Inventory.js.map +1 -0
- package/dist/Classes/Inventory.mjs +2 -0
- package/dist/Classes/Inventory.mjs.map +1 -0
- package/dist/Classes/Order.mjs +1 -1
- package/dist/Classes/ShoppingContainer.mjs +1 -1
- package/package.json +11 -1
package/dist/Classes/Cart.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as CartState,c as DEFAULT_CART_CONFIG,b as LineItemNotFoundError,d as default}from'../chunk-AU6EJ42U.mjs';import'../chunk-UBZ7FGYE.mjs';import'../chunk-WU6FFDBS.mjs';import'../chunk-
|
|
1
|
+
export{a as CartState,c as DEFAULT_CART_CONFIG,b as LineItemNotFoundError,d as default}from'../chunk-AU6EJ42U.mjs';import'../chunk-UBZ7FGYE.mjs';import'../chunk-WU6FFDBS.mjs';import'../chunk-DKI6BDWK.mjs';import'../chunk-MHMEOIHK.mjs';import'../chunk-65X54TKF.mjs';import'../chunk-HTJJLLGW.mjs';import'../chunk-DM2BJMLJ.mjs';import'../chunk-ATUUYYQT.mjs';//# sourceMappingURL=Cart.mjs.map
|
|
2
2
|
//# sourceMappingURL=Cart.mjs.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import BaseModel, { BaseAttributes, BaseData } from './Base.mjs';
|
|
2
|
+
import { CountryCode } from './Common.mjs';
|
|
3
|
+
import '../Auth/index.mjs';
|
|
4
|
+
import './Enum.mjs';
|
|
5
|
+
|
|
6
|
+
type StockData = {
|
|
7
|
+
size: string;
|
|
8
|
+
available: number;
|
|
9
|
+
country: CountryCode;
|
|
10
|
+
};
|
|
11
|
+
type InventoryAttributes = BaseAttributes & {
|
|
12
|
+
productKey: string;
|
|
13
|
+
variantId: string;
|
|
14
|
+
stocks: StockData[];
|
|
15
|
+
};
|
|
16
|
+
type InventoryData = BaseData & InventoryAttributes;
|
|
17
|
+
declare class InventoryModel extends BaseModel {
|
|
18
|
+
private productKey;
|
|
19
|
+
private variantId;
|
|
20
|
+
private stocks;
|
|
21
|
+
constructor(data: InventoryAttributes);
|
|
22
|
+
getProductKey(): string;
|
|
23
|
+
getVariantId(): string;
|
|
24
|
+
getStockData(): StockData[];
|
|
25
|
+
getStockBySize(size: string, country: string): StockData | undefined;
|
|
26
|
+
getDetails(): InventoryData;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { type InventoryAttributes, type InventoryData, InventoryModel, type StockData };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import BaseModel, { BaseAttributes, BaseData } from './Base.js';
|
|
2
|
+
import { CountryCode } from './Common.js';
|
|
3
|
+
import '../Auth/index.js';
|
|
4
|
+
import './Enum.js';
|
|
5
|
+
|
|
6
|
+
type StockData = {
|
|
7
|
+
size: string;
|
|
8
|
+
available: number;
|
|
9
|
+
country: CountryCode;
|
|
10
|
+
};
|
|
11
|
+
type InventoryAttributes = BaseAttributes & {
|
|
12
|
+
productKey: string;
|
|
13
|
+
variantId: string;
|
|
14
|
+
stocks: StockData[];
|
|
15
|
+
};
|
|
16
|
+
type InventoryData = BaseData & InventoryAttributes;
|
|
17
|
+
declare class InventoryModel extends BaseModel {
|
|
18
|
+
private productKey;
|
|
19
|
+
private variantId;
|
|
20
|
+
private stocks;
|
|
21
|
+
constructor(data: InventoryAttributes);
|
|
22
|
+
getProductKey(): string;
|
|
23
|
+
getVariantId(): string;
|
|
24
|
+
getStockData(): StockData[];
|
|
25
|
+
getStockBySize(size: string, country: string): StockData | undefined;
|
|
26
|
+
getDetails(): InventoryData;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { type InventoryAttributes, type InventoryData, InventoryModel, type StockData };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var i=class{customFields;version;createdAt;modifiedAt;modifiedBy;constructor(t,e=new Date){this.customFields={...t.customFields},this.version=t.version??1,this.createdAt=t.createdAt&&!isNaN(Date.parse(t.createdAt))?new Date(t.createdAt).toISOString():e.toISOString(),this.modifiedAt=t.modifiedAt&&!isNaN(Date.parse(t.modifiedAt))?new Date(t.modifiedAt).toISOString():e.toISOString(),this.modifiedBy={...t.modifiedBy};}getDetails(){return {customFields:this.getAllCustomFields(),version:this.getVersion(),createdAt:this.getCreatedAt(),modifiedAt:this.getModifiedAt(),modifiedBy:this.getModifiedBy()}}getVersion(){return this.version}getCreatedAt(){return this.createdAt}getCreatedAtTime(){return new Date(this.createdAt).getTime()}getModifiedAt(){return this.modifiedAt}getModifiedAtTime(){return new Date(this.modifiedAt).getTime()}getModifiedBy(){return {...this.modifiedBy}}setModifiedBy(t,e,r,d){this.modifiedBy={id:t,authType:e,requestId:r,lambdaName:d};}getCustomField(t){return this.customFields[t]??null}setCustomField(t,e){this.customFields[t]=e;}getAllCustomFields(){return {...this.customFields}}};var s=class extends i{productKey;variantId;stocks;constructor(t){super(t),this.productKey=t.productKey,this.variantId=t.variantId,this.stocks=t.stocks.map(e=>({size:e.size,available:e.available,country:e.country}));}getProductKey(){return this.productKey}getVariantId(){return this.variantId}getStockData(){return [...this.stocks]}getStockBySize(t,e){return this.stocks.find(r=>r.size===t&&r.country===e)}getDetails(){return {...super.getDetails(),productKey:this.getProductKey(),variantId:this.getVariantId(),stocks:this.getStockData()}}};exports.InventoryModel=s;//# sourceMappingURL=Inventory.js.map
|
|
2
|
+
//# sourceMappingURL=Inventory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Classes/Base.ts","../../src/Classes/Inventory.ts"],"names":["BaseModel","data","date","id","authType","requestId","lambdaName","fieldName","value","InventoryModel","item","size","country"],"mappings":"aA4BA,IAAqBA,CAArB,CAAA,KAA+B,CACnB,YAAA,CACA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AA,CAAK,IAASC,GAAAA,CAAAA,EAAQD,EAAK,OAAYE,GAAAA,CAAO,CAChF,CAEA,YAA4B,CAC1B,OAAO,CACL,GAAG,MAAM,UAAW,EAAA,CACpB,UAAY,CAAA,IAAA,CAAK,eACjB,CAAA,SAAA,CAAW,IAAK,CAAA,YAAA,GAChB,MAAQ,CAAA,IAAA,CAAK,YAAa,EAC5B,CACF,CACF","file":"Inventory.js","sourcesContent":["import { AuthType } from \"../Auth\";\r\nimport { ISODateTime } from \"./Common\";\r\n\r\nexport interface CustomFields {\r\n [key: string]: any;\r\n}\r\n\r\nexport type ModifiedBy = {\r\n id?: string;\r\n authType?: string;\r\n requestId?: string;\r\n lambdaName?: string;\r\n}\r\n\r\nexport type BaseAttributes = {\r\n customFields?: CustomFields;\r\n version?: number;\r\n createdAt?: ISODateTime;\r\n modifiedAt?: ISODateTime;\r\n modifiedBy?: ModifiedBy;\r\n};\r\n\r\nexport type BaseData = Required<BaseAttributes>;\r\n\r\n/**\r\n * Provides common foundational properties and methods for other data models.\r\n * Handles tracking of custom fields, versioning, and timestamps.\r\n */\r\nexport default class BaseModel {\r\n protected customFields: CustomFields;\r\n protected version: number;\r\n protected createdAt: ISODateTime;\r\n protected modifiedAt: ISODateTime;\r\n protected modifiedBy: ModifiedBy;\r\n\r\n /**\r\n * Creates an instance of BaseModel.\r\n * Initializes common properties like timestamps, version, and custom fields.\r\n * @param data - Optional initial attributes for the base model.\r\n * @param date - Optional date object to use for default timestamps (defaults to current time).\r\n */\r\n constructor(data: BaseAttributes, date: Date = new Date()) {\r\n this.customFields = { ...data.customFields };\r\n this.version = data.version ?? 1;\r\n this.createdAt = data.createdAt && !isNaN(Date.parse(data.createdAt))\r\n ?\r\n new Date(data.createdAt).toISOString()\r\n :\r\n date.toISOString();\r\n this.modifiedAt = data.modifiedAt && !isNaN(Date.parse(data.modifiedAt))\r\n ? new Date(data.modifiedAt).toISOString()\r\n : date.toISOString();\r\n\r\n this.modifiedBy = { ...data.modifiedBy };\r\n }\r\n\r\n /**\r\n * Gets a plain data object representing the base model's current state.\r\n * @returns BaseData object containing common properties.\r\n */\r\n getDetails(): BaseData {\r\n return {\r\n customFields: this.getAllCustomFields(), // Use getter to return a copy\r\n version: this.getVersion(),\r\n createdAt: this.getCreatedAt(),\r\n modifiedAt: this.getModifiedAt(),\r\n modifiedBy: this.getModifiedBy(),\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current version number of the model instance.\r\n * @returns The version number.\r\n */\r\n getVersion(): number {\r\n return this.version;\r\n }\r\n\r\n /**\r\n * Gets the creation timestamp as an ISO 8601 string.\r\n * @returns The creation timestamp string.\r\n */\r\n getCreatedAt(): string {\r\n return this.createdAt;\r\n }\r\n\r\n /**\r\n * Gets the creation timestamp as a Unix epoch time (milliseconds).\r\n * @returns The creation time in milliseconds since the epoch.\r\n */\r\n getCreatedAtTime(): number {\r\n return new Date(this.createdAt).getTime();\r\n }\r\n\r\n\r\n /**\r\n * Gets the last modification timestamp as an ISO 8601 string.\r\n * @returns The last modification timestamp string.\r\n */\r\n getModifiedAt(): string {\r\n return this.modifiedAt;\r\n }\r\n\r\n /**\r\n * Gets the last modification timestamp as a Unix epoch time (milliseconds).\r\n * @returns The last modification time in milliseconds since the epoch.\r\n */\r\n getModifiedAtTime(): number {\r\n return new Date(this.modifiedAt).getTime();\r\n }\r\n\r\n /**\r\n * Gets the identifier of the user or process that last modified the instance.\r\n * @returns\r\n */\r\n getModifiedBy(): ModifiedBy {\r\n return { ...this.modifiedBy };\r\n }\r\n\r\n /**\r\n * Sets the identifier of the user or process that last modified the instance.\r\n * @param modifiedBy - The identifier string.\r\n */\r\n setModifiedBy(id?: string, authType?: AuthType, requestId?: string, lambdaName?: string): void {\r\n this.modifiedBy = {\r\n id,\r\n authType,\r\n requestId,\r\n lambdaName,\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves the value of a specific custom field.\r\n * @param fieldName - The name (key) of the custom field to retrieve.\r\n * @returns The value of the custom field, or null if the field does not exist.\r\n */\r\n getCustomField(fieldName: string): any {\r\n return this.customFields[fieldName] ?? null;\r\n }\r\n\r\n /**\r\n * Sets the value of a specific custom field.\r\n * Also updates the modification timestamp and increments the version.\r\n * @param fieldName - The name (key) of the custom field to set.\r\n * @param value - The value to assign to the custom field.\r\n */\r\n setCustomField(fieldName: string, value: any): void {\r\n this.customFields[fieldName] = value;\r\n }\r\n\r\n /**\r\n * Retrieves a shallow copy of all custom fields associated with the instance.\r\n * @returns An object containing all custom fields.\r\n */\r\n getAllCustomFields(): CustomFields {\r\n return { ...this.customFields };\r\n }\r\n}\r\n","import BaseModel, { BaseAttributes, BaseData } from \"./Base\";\r\nimport { CountryCode } from \"./Common\";\r\n\r\nexport type StockData = {\r\n size: string;\r\n available: number;\r\n country: CountryCode;\r\n}\r\n\r\nexport type InventoryAttributes = BaseAttributes & {\r\n productKey: string;\r\n variantId: string;\r\n stocks: StockData[];\r\n}\r\nexport type InventoryData = BaseData & InventoryAttributes;\r\n\r\nexport class InventoryModel extends BaseModel {\r\n private productKey: string;\r\n private variantId: string;\r\n private stocks: StockData[];\r\n\r\n constructor(data: InventoryAttributes) {\r\n super(data);\r\n this.productKey = data.productKey;\r\n this.variantId = data.variantId;\r\n this.stocks = data.stocks.map(item => ({\r\n size: item.size,\r\n available: item.available,\r\n country: item.country\r\n }));\r\n }\r\n\r\n getProductKey(): string {\r\n return this.productKey;\r\n }\r\n\r\n getVariantId(): string {\r\n return this.variantId;\r\n }\r\n\r\n getStockData(): StockData[] {\r\n return [...this.stocks];\r\n }\r\n\r\n getStockBySize(size: string, country: string): StockData | undefined {\r\n return this.stocks.find(item => item.size === size && item.country === country);\r\n }\r\n\r\n getDetails(): InventoryData {\r\n return {\r\n ...super.getDetails(),\r\n productKey: this.getProductKey(),\r\n variantId: this.getVariantId(),\r\n stocks: this.getStockData()\r\n };\r\n }\r\n}"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'../chunk-ATUUYYQT.mjs';var a=class extends a$1{productKey;variantId;stocks;constructor(t){super(t),this.productKey=t.productKey,this.variantId=t.variantId,this.stocks=t.stocks.map(r=>({size:r.size,available:r.available,country:r.country}));}getProductKey(){return this.productKey}getVariantId(){return this.variantId}getStockData(){return [...this.stocks]}getStockBySize(t,r){return this.stocks.find(e=>e.size===t&&e.country===r)}getDetails(){return {...super.getDetails(),productKey:this.getProductKey(),variantId:this.getVariantId(),stocks:this.getStockData()}}};export{a as InventoryModel};//# sourceMappingURL=Inventory.mjs.map
|
|
2
|
+
//# sourceMappingURL=Inventory.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Classes/Inventory.ts"],"names":["InventoryModel","BaseModel","data","item","size","country"],"mappings":"6CAgBaA,IAAAA,CAAAA,CAAN,cAA6BC,GAAU,CACpC,WACA,SACA,CAAA,MAAA,CAER,YAAYC,CAA2B,CAAA,CACrC,MAAMA,CAAI,CAAA,CACV,KAAK,UAAaA,CAAAA,CAAAA,CAAK,WACvB,IAAK,CAAA,SAAA,CAAYA,CAAK,CAAA,SAAA,CACtB,IAAK,CAAA,MAAA,CAASA,EAAK,MAAO,CAAA,GAAA,CAAIC,IAAS,CACrC,IAAA,CAAMA,EAAK,IACX,CAAA,SAAA,CAAWA,CAAK,CAAA,SAAA,CAChB,OAASA,CAAAA,CAAAA,CAAK,OAChB,CAAE,CAAA,EACJ,CAEA,aAAwB,EAAA,CACtB,OAAO,IAAK,CAAA,UACd,CAEA,YAAA,EAAuB,CACrB,OAAO,KAAK,SACd,CAEA,cAA4B,CAC1B,OAAO,CAAC,GAAG,IAAA,CAAK,MAAM,CACxB,CAEA,cAAA,CAAeC,EAAcC,CAAwC,CAAA,CACnE,OAAO,IAAK,CAAA,MAAA,CAAO,KAAKF,CAAQA,EAAAA,CAAAA,CAAK,IAASC,GAAAA,CAAAA,EAAQD,CAAK,CAAA,OAAA,GAAYE,CAAO,CAChF,CAEA,YAA4B,CAC1B,OAAO,CACL,GAAG,KAAA,CAAM,UAAW,EAAA,CACpB,UAAY,CAAA,IAAA,CAAK,eACjB,CAAA,SAAA,CAAW,KAAK,YAAa,EAAA,CAC7B,OAAQ,IAAK,CAAA,YAAA,EACf,CACF,CACF","file":"Inventory.mjs","sourcesContent":["import BaseModel, { BaseAttributes, BaseData } from \"./Base\";\r\nimport { CountryCode } from \"./Common\";\r\n\r\nexport type StockData = {\r\n size: string;\r\n available: number;\r\n country: CountryCode;\r\n}\r\n\r\nexport type InventoryAttributes = BaseAttributes & {\r\n productKey: string;\r\n variantId: string;\r\n stocks: StockData[];\r\n}\r\nexport type InventoryData = BaseData & InventoryAttributes;\r\n\r\nexport class InventoryModel extends BaseModel {\r\n private productKey: string;\r\n private variantId: string;\r\n private stocks: StockData[];\r\n\r\n constructor(data: InventoryAttributes) {\r\n super(data);\r\n this.productKey = data.productKey;\r\n this.variantId = data.variantId;\r\n this.stocks = data.stocks.map(item => ({\r\n size: item.size,\r\n available: item.available,\r\n country: item.country\r\n }));\r\n }\r\n\r\n getProductKey(): string {\r\n return this.productKey;\r\n }\r\n\r\n getVariantId(): string {\r\n return this.variantId;\r\n }\r\n\r\n getStockData(): StockData[] {\r\n return [...this.stocks];\r\n }\r\n\r\n getStockBySize(size: string, country: string): StockData | undefined {\r\n return this.stocks.find(item => item.size === size && item.country === country);\r\n }\r\n\r\n getDetails(): InventoryData {\r\n return {\r\n ...super.getDetails(),\r\n productKey: this.getProductKey(),\r\n variantId: this.getVariantId(),\r\n stocks: this.getStockData()\r\n };\r\n }\r\n}"]}
|
package/dist/Classes/Order.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'../chunk-AU6EJ42U.mjs';import {a}from'../chunk-UBZ7FGYE.mjs';import'../chunk-WU6FFDBS.mjs';import'../chunk-
|
|
1
|
+
import {b}from'../chunk-AU6EJ42U.mjs';import {a}from'../chunk-UBZ7FGYE.mjs';import'../chunk-WU6FFDBS.mjs';import'../chunk-DKI6BDWK.mjs';import'../chunk-MHMEOIHK.mjs';import'../chunk-65X54TKF.mjs';import'../chunk-HTJJLLGW.mjs';import'../chunk-DM2BJMLJ.mjs';import'../chunk-ATUUYYQT.mjs';var d=(e=>(e.PLACED="PLACED",e.PENDING_PAYMENT="PENDING_PAYMENT",e.PROCESSING="PROCESSING",e.SHIPPED="SHIPPED",e.DELIVERED="DELIVERED",e.CANCELLED="CANCELLED",e.RETURNED="RETURNED",e.REFUNDED="REFUNDED",e.COMPLETED="COMPLETED",e))(d||{}),u=(s=>(s.INITIAL="INITIAL",s.PROCESSING="PROCESSING",s.SHIPPED="SHIPPED",s.DELIVERED="DELIVERED",s.CANCELLED="CANCELLED",s))(u||{}),i=class extends a{orderNumber;cartId;paymentStatus;holdReason;state;lineItemStateMap;constructor(t,p=new Date){super(t,p),this.orderNumber=t.orderNumber,this.cartId=t.cartId,this.paymentStatus=t.paymentStatus,this.holdReason=t.holdReason||"",this.state=t.state,this.lineItemStateMap={},t.lineItems.forEach(a=>{let r=this.lineItemStateMap[a.id];this.lineItemStateMap[a.id]={state:r?.state||"INITIAL",reason:r?.reason||"",transitionAt:r?.transitionAt||this.createdAt};});}getCustomerId(){return this.customerId}getCustomerEmail(){return this.customerEmail}getShippingAddress(){return this.shippingAddress}getBillingAddress(){return this.billingAddress}getOrderNumber(){return this.orderNumber}getCartId(){return this.cartId}getPaymentStatus(){return this.paymentStatus}getHoldReason(){return this.holdReason}getState(){return this.state}getLineItemsStateMap(){return {...this.lineItemStateMap}}getLineItemState(t){if(!this.lineItemStateMap[t])throw new b(t);return this.lineItemStateMap[t].state}getDetails(){return {...super.getDetails(),orderNumber:this.getOrderNumber(),customerId:this.getCustomerId(),customerEmail:this.getCustomerEmail(),shippingAddress:this.getShippingAddress().getDetails(),billingAddress:this.getBillingAddress().getDetails(),cartId:this.getCartId(),paymentStatus:this.getPaymentStatus(),holdReason:this.getHoldReason(),state:this.getState(),lineItemStateMap:this.getLineItemsStateMap()}}};export{u as OrderLineItemState,d as OrderState,i as default};//# sourceMappingURL=Order.mjs.map
|
|
2
2
|
//# sourceMappingURL=Order.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as default}from'../chunk-UBZ7FGYE.mjs';import'../chunk-WU6FFDBS.mjs';import'../chunk-
|
|
1
|
+
export{a as default}from'../chunk-UBZ7FGYE.mjs';import'../chunk-WU6FFDBS.mjs';import'../chunk-DKI6BDWK.mjs';import'../chunk-MHMEOIHK.mjs';import'../chunk-65X54TKF.mjs';import'../chunk-HTJJLLGW.mjs';import'../chunk-DM2BJMLJ.mjs';import'../chunk-ATUUYYQT.mjs';//# sourceMappingURL=ShoppingContainer.mjs.map
|
|
2
2
|
//# sourceMappingURL=ShoppingContainer.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "b23-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "This repo hold common classes, type and util functiona",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -105,6 +105,16 @@
|
|
|
105
105
|
"types": "./dist/Classes/ImageInfo.d.ts",
|
|
106
106
|
"default": "./dist/Classes/ImageInfo.js"
|
|
107
107
|
}
|
|
108
|
+
},
|
|
109
|
+
"./inventory": {
|
|
110
|
+
"import": {
|
|
111
|
+
"types": "./dist/Classes/Inventory.d.mts",
|
|
112
|
+
"default": "./dist/Classes/Inventory.mjs"
|
|
113
|
+
},
|
|
114
|
+
"require": {
|
|
115
|
+
"types": "./dist/Classes/Inventory.d.ts",
|
|
116
|
+
"default": "./dist/Classes/Inventory.js"
|
|
117
|
+
}
|
|
108
118
|
},
|
|
109
119
|
"./line-item": {
|
|
110
120
|
"import": {
|