@medusajs/types 1.8.7 → 1.8.8-next-20230606075730

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 (44) hide show
  1. package/dist/inventory/inventory.d.ts +1 -1
  2. package/package.json +1 -1
  3. package/dist/admin/application.d.ts +0 -6
  4. package/dist/admin/application.js +0 -3
  5. package/dist/admin/application.js.map +0 -1
  6. package/dist/admin/common.d.ts +0 -14
  7. package/dist/admin/common.js +0 -3
  8. package/dist/admin/common.js.map +0 -1
  9. package/dist/admin/config.d.ts +0 -17
  10. package/dist/admin/config.js +0 -3
  11. package/dist/admin/config.js.map +0 -1
  12. package/dist/admin/helpers.d.ts +0 -14
  13. package/dist/admin/helpers.js +0 -3
  14. package/dist/admin/helpers.js.map +0 -1
  15. package/dist/admin/index.d.ts +0 -4
  16. package/dist/admin/index.js +0 -21
  17. package/dist/admin/index.js.map +0 -1
  18. package/dist/admin/widget.d.ts +0 -20
  19. package/dist/admin/widget.js +0 -3
  20. package/dist/admin/widget.js.map +0 -1
  21. package/dist/dal/index.d.ts +0 -69
  22. package/dist/dal/index.js +0 -18
  23. package/dist/dal/index.js.map +0 -1
  24. package/dist/dal/repository-service.d.ts +0 -10
  25. package/dist/dal/repository-service.js +0 -3
  26. package/dist/dal/repository-service.js.map +0 -1
  27. package/dist/product/common.d.ts +0 -115
  28. package/dist/product/common.js +0 -11
  29. package/dist/product/common.js.map +0 -1
  30. package/dist/product/index.d.ts +0 -2
  31. package/dist/product/index.js +0 -19
  32. package/dist/product/index.js.map +0 -1
  33. package/dist/product/service.d.ts +0 -10
  34. package/dist/product/service.js +0 -3
  35. package/dist/product/service.js.map +0 -1
  36. package/dist/tax/common.d.ts +0 -20
  37. package/dist/tax/common.js +0 -3
  38. package/dist/tax/common.js.map +0 -1
  39. package/dist/tax/index.d.ts +0 -2
  40. package/dist/tax/index.js +0 -19
  41. package/dist/tax/index.js.map +0 -1
  42. package/dist/tax/tax-calculation-strategy.d.ts +0 -23
  43. package/dist/tax/tax-calculation-strategy.js +0 -10
  44. package/dist/tax/tax-calculation-strategy.js.map +0 -1
@@ -14,7 +14,7 @@ export interface IInventoryService {
14
14
  updateInventoryLevel(inventoryItemId: string, locationId: string, update: UpdateInventoryLevelInput, context?: SharedContext): Promise<InventoryLevelDTO>;
15
15
  updateInventoryItem(inventoryItemId: string, input: CreateInventoryItemInput, context?: SharedContext): Promise<InventoryItemDTO>;
16
16
  updateReservationItem(reservationItemId: string, input: UpdateReservationItemInput, context?: SharedContext): Promise<ReservationItemDTO>;
17
- deleteReservationItemsByLineItem(lineItemId: string, context?: SharedContext): Promise<void>;
17
+ deleteReservationItemsByLineItem(lineItemId: string | string[], context?: SharedContext): Promise<void>;
18
18
  deleteReservationItem(reservationItemId: string | string[], context?: SharedContext): Promise<void>;
19
19
  deleteInventoryItem(inventoryItemId: string, context?: SharedContext): Promise<void>;
20
20
  deleteInventoryItemLevelByLocationId(locationId: string, context?: SharedContext): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/types",
3
- "version": "1.8.7",
3
+ "version": "1.8.8-next-20230606075730",
4
4
  "description": "Medusa Types definition",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -1,6 +0,0 @@
1
- import { DomainKey, HookPointKey, LoadedWidget, WidgetsConfig } from "./widget";
2
- export declare type InjectionZone = `${DomainKey}.${HookPointKey}`;
3
- export declare type InjectionZones = Map<InjectionZone, LoadedWidget[]>;
4
- export interface Application {
5
- registerWidgets(identifier: string, config: WidgetsConfig): void;
6
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=application.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"application.js","sourceRoot":"","sources":["../../src/admin/application.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- export interface IBaseExtension {
3
- /**
4
- * The name of the extension, used to identify it in the admin panel and improve debugging.
5
- */
6
- name: string;
7
- /**
8
- * The component to render in the admin panel.
9
- */
10
- Component: React.ComponentType<any>;
11
- }
12
- export interface IBaseLoadedExtension extends IBaseExtension {
13
- origin: string;
14
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/admin/common.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- import { Application } from "./application";
2
- import { WidgetsConfig } from "./widget";
3
- export declare type ExtensionConfig = {
4
- /**
5
- * A unique identifier for the customization configuration, used to differentiate it from other customization sources.
6
- * It is recommended to use the name of the package where the customization configuration is defined, for example, `my-medusa-plugin`.
7
- */
8
- identifier: string;
9
- /**
10
- * The configuration for custom widgets in the admin panel.
11
- * Define your own widgets here to use in the admin panel.
12
- */
13
- widgets?: WidgetsConfig;
14
- };
15
- export declare type Extension = {
16
- setup(app: Application): void;
17
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/admin/config.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- import type { NavigateFunction } from "react-router-dom";
2
- declare type NotificationFunction = (title: string, message: string) => void;
3
- export declare type Notify = {
4
- error: NotificationFunction;
5
- success: NotificationFunction;
6
- info: NotificationFunction;
7
- warning: NotificationFunction;
8
- };
9
- export declare type Navigate = NavigateFunction;
10
- export declare type FeatureFlagHelpers = {
11
- isFeatureEnabled: (flag: string) => boolean;
12
- featureToggleList: Record<string, boolean>;
13
- };
14
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/admin/helpers.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export * from "./application";
2
- export * from "./common";
3
- export * from "./config";
4
- export * from "./widget";
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./application"), exports);
18
- __exportStar(require("./common"), exports);
19
- __exportStar(require("./config"), exports);
20
- __exportStar(require("./widget"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,2CAAwB;AACxB,2CAAwB;AACxB,2CAAwB"}
@@ -1,20 +0,0 @@
1
- import { IBaseExtension, IBaseLoadedExtension } from "./common";
2
- import { FeatureFlagHelpers, Navigate, Notify } from "./helpers";
3
- export interface Widget extends IBaseExtension {
4
- }
5
- export declare type DomainKey = "product" | "product_collection" | "order" | "customer";
6
- export declare type HookPointKey = "details";
7
- declare type HookPoint = {
8
- [key in HookPointKey]?: Widget[];
9
- };
10
- export declare type WidgetsConfig = {
11
- [key in DomainKey]?: HookPoint;
12
- };
13
- export interface LoadedWidget extends Widget, IBaseLoadedExtension {
14
- }
15
- export interface WidgetProps {
16
- notify: Notify;
17
- navigate: Navigate;
18
- featureFlags: FeatureFlagHelpers;
19
- }
20
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=widget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget.js","sourceRoot":"","sources":["../../src/admin/widget.ts"],"names":[],"mappings":""}
@@ -1,69 +0,0 @@
1
- /// <reference types="node" />
2
- declare type Dictionary<T = any> = {
3
- [k: string]: T;
4
- };
5
- declare type Query<T> = T extends object ? T extends Scalar ? never : FilterQuery<T> : FilterValue<T>;
6
- declare type EntityProps<T> = {
7
- -readonly [K in keyof T as ExcludeFunctions<T, K>]?: T[K];
8
- };
9
- declare type ExpandScalar<T> = null | (T extends string ? string | RegExp : T extends Date ? Date | string : T);
10
- declare type Scalar = boolean | number | string | bigint | symbol | Date | RegExp | Buffer | {
11
- toHexString(): string;
12
- };
13
- declare type ExcludeFunctions<T, K extends keyof T> = T[K] extends Function ? never : K extends symbol ? never : K;
14
- declare type ReadonlyPrimary<T> = T extends any[] ? Readonly<T> : T;
15
- declare const PrimaryKeyType: unique symbol;
16
- declare type Primary<T> = T extends {
17
- [PrimaryKeyType]?: infer PK;
18
- } ? ReadonlyPrimary<PK> : T extends {
19
- _id?: infer PK;
20
- } ? ReadonlyPrimary<PK> | string : T extends {
21
- uuid?: infer PK;
22
- } ? ReadonlyPrimary<PK> : T extends {
23
- id?: infer PK;
24
- } ? ReadonlyPrimary<PK> : never;
25
- export declare type OperatorMap<T> = {
26
- $and?: Query<T>[];
27
- $or?: Query<T>[];
28
- $eq?: ExpandScalar<T> | ExpandScalar<T>[];
29
- $ne?: ExpandScalar<T>;
30
- $in?: ExpandScalar<T>[];
31
- $nin?: ExpandScalar<T>[];
32
- $not?: Query<T>;
33
- $gt?: ExpandScalar<T>;
34
- $gte?: ExpandScalar<T>;
35
- $lt?: ExpandScalar<T>;
36
- $lte?: ExpandScalar<T>;
37
- $like?: string;
38
- $re?: string;
39
- $ilike?: string;
40
- $fulltext?: string;
41
- $overlap?: string[];
42
- $contains?: string[];
43
- $contained?: string[];
44
- $exists?: boolean;
45
- };
46
- declare type FilterValue2<T> = T | ExpandScalar<T> | Primary<T>;
47
- declare type FilterValue<T> = OperatorMap<FilterValue2<T>> | FilterValue2<T> | FilterValue2<T>[] | null;
48
- declare type ExpandObject<T> = T extends object ? T extends Scalar ? never : {
49
- -readonly [K in keyof T as ExcludeFunctions<T, K>]?: Query<any> | FilterValue<any> | null;
50
- } : never;
51
- declare type ObjectQuery<T> = ExpandObject<T> & OperatorMap<T>;
52
- export declare type FilterQuery<T> = ObjectQuery<T> | NonNullable<ExpandScalar<Primary<T>>> | NonNullable<EntityProps<T> & OperatorMap<T>> | FilterQuery<T>[];
53
- declare type Order<T> = {
54
- [key in keyof T]?: "ASC" | "DESC" | Order<T[key] extends Array<any> ? T[key][0] : T[key]>;
55
- };
56
- export interface OptionsQuery<T, P extends string = never> {
57
- populate?: string[];
58
- orderBy?: Order<T> | Order<T>[];
59
- limit?: number;
60
- offset?: number;
61
- fields?: string[];
62
- groupBy?: string | string[];
63
- filters?: Dictionary<boolean | Dictionary> | string[] | boolean;
64
- }
65
- export declare type FindOptions<T> = {
66
- where: FilterQuery<T>;
67
- options?: OptionsQuery<T, any>;
68
- };
69
- export * from "./repository-service";
package/dist/dal/index.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./repository-service"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+IA,uDAAoC"}
@@ -1,10 +0,0 @@
1
- import { FindOptions } from "./index";
2
- /**
3
- * Data access layer (DAL) interface to implements for any repository service.
4
- * This layer helps to separate the business logic (service layer) from accessing the
5
- * ORM directly and allows to switch to another ORM without changing the business logic.
6
- */
7
- export interface RepositoryService<S = any> {
8
- find<T = S>(options?: FindOptions<T>): Promise<T[]>;
9
- findAndCount<T = S>(options?: FindOptions<T>): Promise<[T[], number]>;
10
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=repository-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repository-service.js","sourceRoot":"","sources":["../../src/dal/repository-service.ts"],"names":[],"mappings":""}
@@ -1,115 +0,0 @@
1
- import { OperatorMap } from "../dal";
2
- export declare enum ProductStatus {
3
- DRAFT = "draft",
4
- PROPOSED = "proposed",
5
- PUBLISHED = "published",
6
- REJECTED = "rejected"
7
- }
8
- /**
9
- * DTO in and out of the module (module API)
10
- */
11
- export interface ProductDTO {
12
- id: string;
13
- title: string;
14
- handle?: string | null;
15
- subtitle?: string | null;
16
- description?: string | null;
17
- is_giftcard: boolean;
18
- status: ProductStatus;
19
- thumbnail?: string | null;
20
- weight?: number | null;
21
- length?: number | null;
22
- height?: number | null;
23
- origin_country?: string | null;
24
- hs_code?: string | null;
25
- mid_code?: string | null;
26
- material?: string | null;
27
- collection?: any;
28
- categories?: any;
29
- type: any;
30
- tags: any;
31
- options: ProductOptionDTO[];
32
- discountable?: boolean;
33
- external_id?: string | null;
34
- created_at?: string | Date;
35
- updated_at?: string | Date;
36
- deleted_at?: string | Date;
37
- }
38
- export interface ProductVariantDTO {
39
- id: string;
40
- title: string;
41
- sku?: string | null;
42
- barcode?: string | null;
43
- ean?: string | null;
44
- upc?: string | null;
45
- inventory_quantity: number;
46
- allow_backorder?: boolean;
47
- manage_inventory?: boolean;
48
- hs_code?: string | null;
49
- origin_country?: string | null;
50
- mid_code?: string | null;
51
- material?: string | null;
52
- weight?: number | null;
53
- length?: number | null;
54
- height?: number | null;
55
- width?: number | null;
56
- options: ProductOptionValueDTO;
57
- metadata?: Record<string, unknown> | null;
58
- product: ProductDTO;
59
- variant_rank?: number | null;
60
- created_at: string | Date;
61
- updated_at: string | Date;
62
- deleted_at: string | Date;
63
- }
64
- export interface ProductTagDTO {
65
- id: string;
66
- }
67
- export interface ProductVariantDTO {
68
- id: string;
69
- }
70
- export interface ProductCollectionDTO {
71
- id: string;
72
- }
73
- export interface ProductOptionDTO {
74
- id: string;
75
- title: string;
76
- product: ProductDTO;
77
- values: ProductOptionValueDTO;
78
- metadata?: Record<string, unknown> | null;
79
- }
80
- export interface ProductOptionValueDTO {
81
- id: string;
82
- value: string;
83
- option: ProductOptionDTO;
84
- variant: ProductVariantDTO;
85
- metadata?: Record<string, unknown> | null;
86
- }
87
- /**
88
- * Filters/Config (module API input filters and config)
89
- */
90
- export interface FilterableProductProps {
91
- id?: string | string[];
92
- tags?: {
93
- value?: string[];
94
- };
95
- categories?: {
96
- id?: {
97
- [Operator in keyof OperatorMap<any>]: string[];
98
- } | string[];
99
- };
100
- }
101
- export interface FilterableProductTagProps {
102
- id?: string | string[];
103
- value?: string;
104
- }
105
- export interface FilterableProductCollectionProps {
106
- id?: string | string[];
107
- title?: string;
108
- }
109
- export interface FilterableProductVariantProps {
110
- id?: string | string[];
111
- sku?: string;
112
- options?: {
113
- id?: string[];
114
- };
115
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProductStatus = void 0;
4
- var ProductStatus;
5
- (function (ProductStatus) {
6
- ProductStatus["DRAFT"] = "draft";
7
- ProductStatus["PROPOSED"] = "proposed";
8
- ProductStatus["PUBLISHED"] = "published";
9
- ProductStatus["REJECTED"] = "rejected";
10
- })(ProductStatus = exports.ProductStatus || (exports.ProductStatus = {}));
11
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/product/common.ts"],"names":[],"mappings":";;;AAEA,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;AACvB,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB"}
@@ -1,2 +0,0 @@
1
- export * from "./service";
2
- export * from "./common";
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./service"), exports);
18
- __exportStar(require("./common"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,2CAAwB"}
@@ -1,10 +0,0 @@
1
- import { FilterableProductCollectionProps, FilterableProductProps, FilterableProductTagProps, FilterableProductVariantProps, ProductCollectionDTO, ProductDTO, ProductTagDTO, ProductVariantDTO } from "./common";
2
- import { FindConfig } from "../common";
3
- import { SharedContext } from "../shared-context";
4
- export interface IProductService {
5
- list<T = unknown>(filter: FilterableProductProps, config?: FindConfig<ProductDTO>, context?: SharedContext): Promise<T[]>;
6
- listAndCount<T = unknown>(filter: FilterableProductProps, config?: FindConfig<ProductDTO>, context?: SharedContext): Promise<[T[], number]>;
7
- listTags<T = unknown>(filter: FilterableProductTagProps, config?: FindConfig<ProductVariantDTO>, context?: SharedContext): Promise<T[]>;
8
- listVariants<T = unknown>(filter: FilterableProductVariantProps, config?: FindConfig<ProductTagDTO>, context?: SharedContext): Promise<T[]>;
9
- listCollections<T = unknown>(filter: FilterableProductCollectionProps, config?: FindConfig<ProductCollectionDTO>, context?: SharedContext): Promise<T[]>;
10
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/product/service.ts"],"names":[],"mappings":""}
@@ -1,20 +0,0 @@
1
- /** The amount of a gift card allocated to a line item */
2
- export declare type GiftCardAllocation = {
3
- amount: number;
4
- unit_amount: number;
5
- };
6
- /** The amount of a discount allocated to a line item */
7
- export declare type DiscountAllocation = {
8
- amount: number;
9
- unit_amount: number;
10
- };
11
- /**
12
- * A map of line item ids and its corresponding gift card and discount
13
- * allocations
14
- */
15
- export declare type LineAllocationsMap = {
16
- [K: string]: {
17
- gift_card?: GiftCardAllocation;
18
- discount?: DiscountAllocation;
19
- };
20
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/tax/common.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from "./common";
2
- export * from "./tax-calculation-strategy";
package/dist/tax/index.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./common"), exports);
18
- __exportStar(require("./tax-calculation-strategy"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tax/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,6DAA0C"}
@@ -1,23 +0,0 @@
1
- import { LineAllocationsMap } from "./common";
2
- export declare type TaxCalculationContext = {
3
- shipping_address: any;
4
- customer: any;
5
- region: any;
6
- is_return: boolean;
7
- shipping_methods: any;
8
- allocation_map: LineAllocationsMap;
9
- tax_calculation_strategy: ITaxCalculationStrategy;
10
- };
11
- export interface ITaxCalculationStrategy {
12
- /**
13
- * Calculates the tax amount for a given set of line items under applicable
14
- * tax conditions and calculation contexts.
15
- * @param items - the line items to calculate the tax total for
16
- * @param taxLines - the tax lines that applies to the calculation
17
- * @param calculationContext - other details relevant for the calculation
18
- * @return the tax total
19
- */
20
- calculate(items: any, // LineItem[],
21
- taxLines: any[], calculationContext: TaxCalculationContext): Promise<number>;
22
- }
23
- export declare function isTaxCalculationStrategy(object: any): object is ITaxCalculationStrategy;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTaxCalculationStrategy = void 0;
4
- function isTaxCalculationStrategy(
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
- object) {
7
- return typeof object.calculate === "function";
8
- }
9
- exports.isTaxCalculationStrategy = isTaxCalculationStrategy;
10
- //# sourceMappingURL=tax-calculation-strategy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tax-calculation-strategy.js","sourceRoot":"","sources":["../../src/tax/tax-calculation-strategy.ts"],"names":[],"mappings":";;;AAsCA,SAAgB,wBAAwB;AACtC,8DAA8D;AAC9D,MAAW;IAEX,OAAO,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU,CAAA;AAC/C,CAAC;AALD,4DAKC"}