@medusajs/types 1.10.3 → 1.11.0-next-20230906161158
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/bundles.d.ts +6 -5
- package/dist/bundles.js +7 -6
- package/dist/bundles.js.map +1 -1
- package/dist/dal/repository-service.d.ts +8 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/inventory/service.d.ts +3 -3
- package/dist/joiner/index.d.ts +12 -2
- package/dist/link-modules/index.d.ts +14 -0
- package/dist/link-modules/index.js +3 -0
- package/dist/link-modules/index.js.map +1 -0
- package/dist/modules-sdk/index.d.ts +56 -3
- package/dist/modules-sdk/index.js +2 -2
- package/dist/modules-sdk/index.js.map +1 -1
- package/dist/pricing/common/currency.d.ts +22 -0
- package/dist/pricing/common/currency.js +3 -0
- package/dist/pricing/common/currency.js.map +1 -0
- package/dist/pricing/common/index.d.ts +2 -0
- package/dist/pricing/common/index.js +19 -0
- package/dist/pricing/common/index.js.map +1 -0
- package/dist/pricing/common/money-amount.d.ts +28 -0
- package/dist/pricing/common/money-amount.js +3 -0
- package/dist/pricing/common/money-amount.js.map +1 -0
- package/dist/pricing/index.d.ts +2 -0
- package/dist/pricing/index.js +19 -0
- package/dist/pricing/index.js.map +1 -0
- package/dist/pricing/service.d.ts +19 -0
- package/dist/pricing/service.js +3 -0
- package/dist/pricing/service.js.map +1 -0
- package/dist/product/common.js +1 -1
- package/dist/product/common.js.map +1 -1
- package/dist/product/service.d.ts +6 -7
- package/dist/stock-location/service.d.ts +3 -3
- package/package.json +2 -2
package/dist/bundles.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export * as CacheTypes from "./cache";
|
|
2
2
|
export * as CommonTypes from "./common";
|
|
3
|
+
export * as DAL from "./dal";
|
|
3
4
|
export * as EventBusTypes from "./event-bus";
|
|
5
|
+
export * as FeatureFlagTypes from "./feature-flag";
|
|
4
6
|
export * as InventoryTypes from "./inventory";
|
|
5
|
-
export * as
|
|
7
|
+
export * as LoggerTypes from "./logger";
|
|
6
8
|
export * as ModulesSdkTypes from "./modules-sdk";
|
|
9
|
+
export * as PricingTypes from "./pricing";
|
|
10
|
+
export * as ProductTypes from "./product";
|
|
11
|
+
export * as SalesChannelTypes from "./sales-channel";
|
|
7
12
|
export * as SearchTypes from "./search";
|
|
8
13
|
export * as StockLocationTypes from "./stock-location";
|
|
9
14
|
export * as TransactionBaseTypes from "./transaction-base";
|
|
10
|
-
export * as DAL from "./dal";
|
|
11
|
-
export * as LoggerTypes from "./logger";
|
|
12
|
-
export * as FeatureFlagTypes from "./feature-flag";
|
|
13
|
-
export * as SalesChannelTypes from "./sales-channel";
|
|
14
15
|
export * as WorkflowTypes from "./workflow";
|
package/dist/bundles.js
CHANGED
|
@@ -23,19 +23,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.WorkflowTypes = exports.
|
|
26
|
+
exports.WorkflowTypes = exports.TransactionBaseTypes = exports.StockLocationTypes = exports.SearchTypes = exports.SalesChannelTypes = exports.ProductTypes = exports.PricingTypes = exports.ModulesSdkTypes = exports.LoggerTypes = exports.InventoryTypes = exports.FeatureFlagTypes = exports.EventBusTypes = exports.DAL = exports.CommonTypes = exports.CacheTypes = void 0;
|
|
27
27
|
exports.CacheTypes = __importStar(require("./cache"));
|
|
28
28
|
exports.CommonTypes = __importStar(require("./common"));
|
|
29
|
+
exports.DAL = __importStar(require("./dal"));
|
|
29
30
|
exports.EventBusTypes = __importStar(require("./event-bus"));
|
|
31
|
+
exports.FeatureFlagTypes = __importStar(require("./feature-flag"));
|
|
30
32
|
exports.InventoryTypes = __importStar(require("./inventory"));
|
|
31
|
-
exports.
|
|
33
|
+
exports.LoggerTypes = __importStar(require("./logger"));
|
|
32
34
|
exports.ModulesSdkTypes = __importStar(require("./modules-sdk"));
|
|
35
|
+
exports.PricingTypes = __importStar(require("./pricing"));
|
|
36
|
+
exports.ProductTypes = __importStar(require("./product"));
|
|
37
|
+
exports.SalesChannelTypes = __importStar(require("./sales-channel"));
|
|
33
38
|
exports.SearchTypes = __importStar(require("./search"));
|
|
34
39
|
exports.StockLocationTypes = __importStar(require("./stock-location"));
|
|
35
40
|
exports.TransactionBaseTypes = __importStar(require("./transaction-base"));
|
|
36
|
-
exports.DAL = __importStar(require("./dal"));
|
|
37
|
-
exports.LoggerTypes = __importStar(require("./logger"));
|
|
38
|
-
exports.FeatureFlagTypes = __importStar(require("./feature-flag"));
|
|
39
|
-
exports.SalesChannelTypes = __importStar(require("./sales-channel"));
|
|
40
41
|
exports.WorkflowTypes = __importStar(require("./workflow"));
|
|
41
42
|
//# sourceMappingURL=bundles.js.map
|
package/dist/bundles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAqC;AACrC,wDAAuC;AACvC,6DAA4C;AAC5C,8DAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAqC;AACrC,wDAAuC;AACvC,6CAA4B;AAC5B,6DAA4C;AAC5C,mEAAkD;AAClD,8DAA6C;AAC7C,wDAAuC;AACvC,iEAAgD;AAChD,0DAAyC;AACzC,0DAAyC;AACzC,qEAAoD;AACpD,wDAAuC;AACvC,uEAAsD;AACtD,2EAA0D;AAC1D,4DAA2C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FindOptions } from "./index";
|
|
2
1
|
import { RepositoryTransformOptions } from "../common";
|
|
3
2
|
import { Context } from "../shared-context";
|
|
3
|
+
import { FindOptions } from "./index";
|
|
4
4
|
/**
|
|
5
5
|
* Data access layer (DAL) interface to implements for any repository service.
|
|
6
6
|
* This layer helps to separate the business logic (service layer) from accessing the
|
|
@@ -31,7 +31,7 @@ export interface RepositoryService<T = any> extends BaseRepositoryService<T> {
|
|
|
31
31
|
* @returns [T[], Record<string, string[]>] the second value being the map of the entity names and ids that were soft deleted
|
|
32
32
|
*/
|
|
33
33
|
softDelete(ids: string[], context?: Context): Promise<[T[], Record<string, unknown[]>]>;
|
|
34
|
-
restore(ids: string[], context?: Context): Promise<T[]>;
|
|
34
|
+
restore(ids: string[], context?: Context): Promise<[T[], Record<string, unknown[]>]>;
|
|
35
35
|
}
|
|
36
36
|
export interface TreeRepositoryService<T = any> extends BaseRepositoryService<T> {
|
|
37
37
|
find(options?: FindOptions<T>, transformOptions?: RepositoryTransformOptions, context?: Context): Promise<T[]>;
|
|
@@ -39,4 +39,10 @@ export interface TreeRepositoryService<T = any> extends BaseRepositoryService<T>
|
|
|
39
39
|
create(data: unknown, context?: Context): Promise<T>;
|
|
40
40
|
delete(id: string, context?: Context): Promise<void>;
|
|
41
41
|
}
|
|
42
|
+
export type SoftDeleteReturn<TReturnableLinkableKeys = string> = {
|
|
43
|
+
returnLinkableKeys?: TReturnableLinkableKeys[];
|
|
44
|
+
};
|
|
45
|
+
export type RestoreReturn<TReturnableLinkableKeys = string> = {
|
|
46
|
+
returnLinkableKeys?: TReturnableLinkableKeys[];
|
|
47
|
+
};
|
|
42
48
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,10 @@ export * from "./feature-flag";
|
|
|
9
9
|
export * from "./file-service";
|
|
10
10
|
export * from "./inventory";
|
|
11
11
|
export * from "./joiner";
|
|
12
|
+
export * from "./link-modules";
|
|
12
13
|
export * from "./logger";
|
|
13
14
|
export * from "./modules-sdk";
|
|
15
|
+
export * from "./pricing";
|
|
14
16
|
export * from "./product";
|
|
15
17
|
export * from "./product-category";
|
|
16
18
|
export * from "./sales-channel";
|
package/dist/index.js
CHANGED
|
@@ -25,8 +25,10 @@ __exportStar(require("./feature-flag"), exports);
|
|
|
25
25
|
__exportStar(require("./file-service"), exports);
|
|
26
26
|
__exportStar(require("./inventory"), exports);
|
|
27
27
|
__exportStar(require("./joiner"), exports);
|
|
28
|
+
__exportStar(require("./link-modules"), exports);
|
|
28
29
|
__exportStar(require("./logger"), exports);
|
|
29
30
|
__exportStar(require("./modules-sdk"), exports);
|
|
31
|
+
__exportStar(require("./pricing"), exports);
|
|
30
32
|
__exportStar(require("./product"), exports);
|
|
31
33
|
__exportStar(require("./product-category"), exports);
|
|
32
34
|
__exportStar(require("./sales-channel"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,2CAAwB;AACxB,wCAAqB;AACrB,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,8CAA2B;AAC3B,2CAAwB;AACxB,2CAAwB;AACxB,gDAA6B;AAC7B,4CAAyB;AACzB,qDAAkC;AAClC,kDAA+B;AAC/B,2CAAwB;AACxB,mDAAgC;AAChC,mDAAgC;AAChC,qDAAkC;AAClC,6CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,2CAAwB;AACxB,wCAAqB;AACrB,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,8CAA2B;AAC3B,2CAAwB;AACxB,iDAA8B;AAC9B,2CAAwB;AACxB,gDAA6B;AAC7B,4CAAyB;AACzB,4CAAyB;AACzB,qDAAkC;AAClC,kDAA+B;AAC/B,2CAAwB;AACxB,mDAAgC;AAChC,mDAAgC;AAChC,qDAAkC;AAClC,6CAA0B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CreateInventoryItemInput, CreateInventoryLevelInput, CreateReservationItemInput, FilterableInventoryItemProps, FilterableInventoryLevelProps, FilterableReservationItemProps, InventoryItemDTO, InventoryLevelDTO, ReservationItemDTO, UpdateInventoryLevelInput, UpdateReservationItemInput } from "./common";
|
|
2
2
|
import { FindConfig } from "../common";
|
|
3
|
-
import {
|
|
4
|
-
import { SharedContext } from "
|
|
3
|
+
import { ModuleJoinerConfig } from "../modules-sdk";
|
|
4
|
+
import { SharedContext } from "../shared-context";
|
|
5
5
|
export interface IInventoryService {
|
|
6
|
-
__joinerConfig():
|
|
6
|
+
__joinerConfig(): ModuleJoinerConfig;
|
|
7
7
|
listInventoryItems(selector: FilterableInventoryItemProps, config?: FindConfig<InventoryItemDTO>, context?: SharedContext): Promise<[InventoryItemDTO[], number]>;
|
|
8
8
|
listReservationItems(selector: FilterableReservationItemProps, config?: FindConfig<ReservationItemDTO>, context?: SharedContext): Promise<[ReservationItemDTO[], number]>;
|
|
9
9
|
listInventoryLevels(selector: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevelDTO>, context?: SharedContext): Promise<[InventoryLevelDTO[], number]>;
|
package/dist/joiner/index.d.ts
CHANGED
|
@@ -25,7 +25,10 @@ export interface JoinerServiceConfig {
|
|
|
25
25
|
export interface JoinerArgument {
|
|
26
26
|
name: string;
|
|
27
27
|
value?: any;
|
|
28
|
-
|
|
28
|
+
}
|
|
29
|
+
export interface JoinerDirective {
|
|
30
|
+
name: string;
|
|
31
|
+
value?: any;
|
|
29
32
|
}
|
|
30
33
|
export interface RemoteJoinerQuery {
|
|
31
34
|
service?: string;
|
|
@@ -34,10 +37,15 @@ export interface RemoteJoinerQuery {
|
|
|
34
37
|
property: string;
|
|
35
38
|
fields: string[];
|
|
36
39
|
args?: JoinerArgument[];
|
|
37
|
-
|
|
40
|
+
directives?: {
|
|
41
|
+
[field: string]: JoinerDirective[];
|
|
42
|
+
};
|
|
38
43
|
}>;
|
|
39
44
|
fields: string[];
|
|
40
45
|
args?: JoinerArgument[];
|
|
46
|
+
directives?: {
|
|
47
|
+
[field: string]: JoinerDirective[];
|
|
48
|
+
};
|
|
41
49
|
}
|
|
42
50
|
export interface RemoteNestedExpands {
|
|
43
51
|
[key: string]: {
|
|
@@ -48,6 +56,8 @@ export interface RemoteNestedExpands {
|
|
|
48
56
|
}
|
|
49
57
|
export interface RemoteExpandProperty {
|
|
50
58
|
property: string;
|
|
59
|
+
parent: string;
|
|
60
|
+
parentConfig?: JoinerServiceConfig;
|
|
51
61
|
serviceConfig: JoinerServiceConfig;
|
|
52
62
|
fields: string[];
|
|
53
63
|
args?: JoinerArgument[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FindConfig } from "../common";
|
|
2
|
+
import { RestoreReturn, SoftDeleteReturn } from "../dal";
|
|
3
|
+
import { ModuleJoinerConfig } from "../modules-sdk";
|
|
4
|
+
import { Context } from "../shared-context";
|
|
5
|
+
export interface ILinkModule {
|
|
6
|
+
__joinerConfig(): ModuleJoinerConfig;
|
|
7
|
+
list(filters?: Record<string, unknown>, config?: FindConfig<unknown>, sharedContext?: Context): Promise<unknown[]>;
|
|
8
|
+
listAndCount(filters?: Record<string, unknown>, config?: FindConfig<unknown>, sharedContext?: Context): Promise<[unknown[], number]>;
|
|
9
|
+
create(primaryKeyOrBulkData: string | string[] | [string | string[], string, Record<string, unknown>?][], foreignKeyData?: string, sharedContext?: Context): Promise<unknown[]>;
|
|
10
|
+
dismiss(primaryKeyOrBulkData: string | string[] | [string | string[], string][], foreignKeyData?: string, sharedContext?: Context): Promise<unknown[]>;
|
|
11
|
+
delete(data: unknown | unknown[], sharedContext?: Context): Promise<void>;
|
|
12
|
+
softDelete(data: unknown | unknown[], config?: SoftDeleteReturn, sharedContext?: Context): Promise<Record<string, unknown[]> | void>;
|
|
13
|
+
restore(data: unknown | unknown[], config?: RestoreReturn, sharedContext?: Context): Promise<Record<string, unknown[]> | void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link-modules/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JoinerServiceConfig } from "../joiner";
|
|
2
|
-
import { Logger } from "../logger";
|
|
1
|
+
import { JoinerRelationship, JoinerServiceConfig } from "../joiner";
|
|
3
2
|
import { MedusaContainer } from "../common";
|
|
4
3
|
import { RepositoryService } from "../dal";
|
|
4
|
+
import { Logger } from "../logger";
|
|
5
5
|
export type Constructor<T> = new (...args: any[]) => T;
|
|
6
6
|
export * from "../common/medusa-container";
|
|
7
7
|
export type LogLevel = "query" | "schema" | "error" | "warn" | "info" | "log" | "migration";
|
|
@@ -18,6 +18,9 @@ export type InternalModuleDeclaration = {
|
|
|
18
18
|
scope: MODULE_SCOPE.INTERNAL;
|
|
19
19
|
resources: MODULE_RESOURCE_TYPE;
|
|
20
20
|
dependencies?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated The property should not be used.
|
|
23
|
+
*/
|
|
21
24
|
resolve?: string;
|
|
22
25
|
options?: Record<string, unknown>;
|
|
23
26
|
alias?: string;
|
|
@@ -30,6 +33,7 @@ export type ExternalModuleDeclaration = {
|
|
|
30
33
|
url: string;
|
|
31
34
|
keepAlive: boolean;
|
|
32
35
|
};
|
|
36
|
+
options?: Record<string, unknown>;
|
|
33
37
|
alias?: string;
|
|
34
38
|
main?: boolean;
|
|
35
39
|
};
|
|
@@ -46,14 +50,33 @@ export type ModuleDefinition = {
|
|
|
46
50
|
registrationName: string;
|
|
47
51
|
defaultPackage: string | false;
|
|
48
52
|
label: string;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated property will be removed in future versions
|
|
55
|
+
*/
|
|
49
56
|
canOverride?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated property will be removed in future versions
|
|
59
|
+
*/
|
|
50
60
|
isRequired?: boolean;
|
|
51
61
|
isQueryable?: boolean;
|
|
52
62
|
dependencies?: string[];
|
|
53
63
|
defaultModuleDeclaration: InternalModuleDeclaration | ExternalModuleDeclaration;
|
|
54
64
|
};
|
|
65
|
+
export type LinkModuleDefinition = {
|
|
66
|
+
key: string;
|
|
67
|
+
registrationName: string;
|
|
68
|
+
label: string;
|
|
69
|
+
dependencies?: string[];
|
|
70
|
+
defaultModuleDeclaration: InternalModuleDeclaration;
|
|
71
|
+
};
|
|
72
|
+
type ModuleDeclaration = ExternalModuleDeclaration | InternalModuleDeclaration;
|
|
73
|
+
export type ModuleConfig = ModuleDeclaration & {
|
|
74
|
+
module: string;
|
|
75
|
+
path: string;
|
|
76
|
+
definition: ModuleDefinition;
|
|
77
|
+
};
|
|
55
78
|
export type LoadedModule = unknown & {
|
|
56
|
-
__joinerConfig:
|
|
79
|
+
__joinerConfig: ModuleJoinerConfig;
|
|
57
80
|
__definition: ModuleDefinition;
|
|
58
81
|
};
|
|
59
82
|
export type LoaderOptions<TOptions = Record<string, unknown>> = {
|
|
@@ -66,6 +89,31 @@ export type ModulesResponse = {
|
|
|
66
89
|
module: string;
|
|
67
90
|
resolution: string | false;
|
|
68
91
|
}[];
|
|
92
|
+
export type ModuleJoinerConfig = Omit<JoinerServiceConfig, "serviceName" | "primaryKeys" | "relationships" | "extends"> & {
|
|
93
|
+
relationships?: ModuleJoinerRelationship[];
|
|
94
|
+
extends?: {
|
|
95
|
+
serviceName: string;
|
|
96
|
+
relationship: ModuleJoinerRelationship;
|
|
97
|
+
}[];
|
|
98
|
+
serviceName?: string;
|
|
99
|
+
primaryKeys?: string[];
|
|
100
|
+
isLink?: boolean;
|
|
101
|
+
linkableKeys?: string[];
|
|
102
|
+
isReadOnlyLink?: boolean;
|
|
103
|
+
databaseConfig?: {
|
|
104
|
+
tableName?: string;
|
|
105
|
+
idPrefix?: string;
|
|
106
|
+
extraFields?: Record<string, {
|
|
107
|
+
type: "date" | "time" | "datetime" | "bigint" | "blob" | "uint8array" | "array" | "enumArray" | "enum" | "json" | "integer" | "smallint" | "tinyint" | "mediumint" | "float" | "double" | "boolean" | "decimal" | "string" | "uuid" | "text";
|
|
108
|
+
defaultValue?: string;
|
|
109
|
+
nullable?: boolean;
|
|
110
|
+
options?: Record<string, unknown>;
|
|
111
|
+
}>;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export declare type ModuleJoinerRelationship = JoinerRelationship & {
|
|
115
|
+
deleteCascade?: boolean;
|
|
116
|
+
};
|
|
69
117
|
export type ModuleExports = {
|
|
70
118
|
service: Constructor<any>;
|
|
71
119
|
loaders?: ModuleLoaderFunction[];
|
|
@@ -82,6 +130,11 @@ export interface ModuleServiceInitializeOptions {
|
|
|
82
130
|
connection?: any;
|
|
83
131
|
clientUrl?: string;
|
|
84
132
|
schema?: string;
|
|
133
|
+
host?: string;
|
|
134
|
+
port?: number;
|
|
135
|
+
user?: string;
|
|
136
|
+
password?: string;
|
|
137
|
+
database?: string;
|
|
85
138
|
driverOptions?: Record<string, unknown>;
|
|
86
139
|
debug?: boolean;
|
|
87
140
|
};
|
|
@@ -20,10 +20,10 @@ var MODULE_SCOPE;
|
|
|
20
20
|
(function (MODULE_SCOPE) {
|
|
21
21
|
MODULE_SCOPE["INTERNAL"] = "internal";
|
|
22
22
|
MODULE_SCOPE["EXTERNAL"] = "external";
|
|
23
|
-
})(MODULE_SCOPE
|
|
23
|
+
})(MODULE_SCOPE || (exports.MODULE_SCOPE = MODULE_SCOPE = {}));
|
|
24
24
|
var MODULE_RESOURCE_TYPE;
|
|
25
25
|
(function (MODULE_RESOURCE_TYPE) {
|
|
26
26
|
MODULE_RESOURCE_TYPE["SHARED"] = "shared";
|
|
27
27
|
MODULE_RESOURCE_TYPE["ISOLATED"] = "isolated";
|
|
28
|
-
})(MODULE_RESOURCE_TYPE
|
|
28
|
+
})(MODULE_RESOURCE_TYPE || (exports.MODULE_RESOURCE_TYPE = MODULE_RESOURCE_TYPE = {}));
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules-sdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules-sdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAOA,6DAA0C;AAY1C,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,6CAAqB,CAAA;AACvB,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseFilterable } from "../../dal";
|
|
2
|
+
export interface CurrencyDTO {
|
|
3
|
+
code: string;
|
|
4
|
+
symbol?: string;
|
|
5
|
+
symbol_native?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateCurrencyDTO {
|
|
9
|
+
code: string;
|
|
10
|
+
symbol: string;
|
|
11
|
+
symbol_native: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UpdateCurrencyDTO {
|
|
15
|
+
code: string;
|
|
16
|
+
symbol?: string;
|
|
17
|
+
symbol_native?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FilterableCurrencyProps extends BaseFilterable<FilterableCurrencyProps> {
|
|
21
|
+
code?: string[];
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../src/pricing/common/currency.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./currency"), exports);
|
|
18
|
+
__exportStar(require("./money-amount"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pricing/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,iDAA8B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseFilterable } from "../../dal";
|
|
2
|
+
import { CreateCurrencyDTO, CurrencyDTO } from "./currency";
|
|
3
|
+
export interface MoneyAmountDTO {
|
|
4
|
+
id: string;
|
|
5
|
+
currency_code?: string;
|
|
6
|
+
currency?: CurrencyDTO;
|
|
7
|
+
amount?: number;
|
|
8
|
+
min_quantity?: number;
|
|
9
|
+
max_quantity?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CreateMoneyAmountDTO {
|
|
12
|
+
id: string;
|
|
13
|
+
currency_code: string;
|
|
14
|
+
currency?: CreateCurrencyDTO;
|
|
15
|
+
amount?: number;
|
|
16
|
+
min_quantity?: number;
|
|
17
|
+
max_quantity?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface UpdateMoneyAmountDTO {
|
|
20
|
+
id: string;
|
|
21
|
+
currency_code?: string;
|
|
22
|
+
amount?: number;
|
|
23
|
+
min_quantity?: number;
|
|
24
|
+
max_quantity?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface FilterableMoneyAmountProps extends BaseFilterable<FilterableMoneyAmountProps> {
|
|
27
|
+
id?: string[];
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money-amount.js","sourceRoot":"","sources":["../../../src/pricing/common/money-amount.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./service"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pricing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FindConfig } from "../common";
|
|
2
|
+
import { ModuleJoinerConfig } from "../modules-sdk";
|
|
3
|
+
import { Context } from "../shared-context";
|
|
4
|
+
import { CreateCurrencyDTO, CreateMoneyAmountDTO, CurrencyDTO, FilterableCurrencyProps, FilterableMoneyAmountProps, MoneyAmountDTO, UpdateCurrencyDTO, UpdateMoneyAmountDTO } from "./common";
|
|
5
|
+
export interface IPricingModuleService {
|
|
6
|
+
__joinerConfig(): ModuleJoinerConfig;
|
|
7
|
+
retrieve(id: string, config?: FindConfig<MoneyAmountDTO>, sharedContext?: Context): Promise<MoneyAmountDTO>;
|
|
8
|
+
list(filters?: FilterableMoneyAmountProps, config?: FindConfig<MoneyAmountDTO>, sharedContext?: Context): Promise<MoneyAmountDTO[]>;
|
|
9
|
+
listAndCount(filters?: FilterableMoneyAmountProps, config?: FindConfig<MoneyAmountDTO>, sharedContext?: Context): Promise<[MoneyAmountDTO[], number]>;
|
|
10
|
+
create(data: CreateMoneyAmountDTO[], sharedContext?: Context): Promise<MoneyAmountDTO[]>;
|
|
11
|
+
update(data: UpdateMoneyAmountDTO[], sharedContext?: Context): Promise<MoneyAmountDTO[]>;
|
|
12
|
+
delete(ids: string[], sharedContext?: Context): Promise<void>;
|
|
13
|
+
retrieveCurrency(code: string, config?: FindConfig<CurrencyDTO>, sharedContext?: Context): Promise<CurrencyDTO>;
|
|
14
|
+
listCurrencies(filters?: FilterableCurrencyProps, config?: FindConfig<CurrencyDTO>, sharedContext?: Context): Promise<CurrencyDTO[]>;
|
|
15
|
+
listAndCountCurrencies(filters?: FilterableCurrencyProps, config?: FindConfig<CurrencyDTO>, sharedContext?: Context): Promise<[CurrencyDTO[], number]>;
|
|
16
|
+
createCurrencies(data: CreateCurrencyDTO[], sharedContext?: Context): Promise<CurrencyDTO[]>;
|
|
17
|
+
updateCurrencies(data: UpdateCurrencyDTO[], sharedContext?: Context): Promise<CurrencyDTO[]>;
|
|
18
|
+
deleteCurrencies(currencyCodes: string[], sharedContext?: Context): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/pricing/service.ts"],"names":[],"mappings":""}
|
package/dist/product/common.js
CHANGED
|
@@ -7,5 +7,5 @@ var ProductStatus;
|
|
|
7
7
|
ProductStatus["PROPOSED"] = "proposed";
|
|
8
8
|
ProductStatus["PUBLISHED"] = "published";
|
|
9
9
|
ProductStatus["REJECTED"] = "rejected";
|
|
10
|
-
})(ProductStatus
|
|
10
|
+
})(ProductStatus || (exports.ProductStatus = ProductStatus = {}));
|
|
11
11
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/product/common.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;AACvB,CAAC,EALW,aAAa,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/product/common.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;AACvB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CreateProductCategoryDTO, CreateProductCollectionDTO, CreateProductDTO, CreateProductOptionDTO, CreateProductTagDTO, CreateProductTypeDTO, FilterableProductCategoryProps, FilterableProductCollectionProps, FilterableProductOptionProps, FilterableProductProps, FilterableProductTagProps, FilterableProductTypeProps, FilterableProductVariantProps, ProductCategoryDTO, ProductCollectionDTO, ProductDTO, ProductOptionDTO, ProductTagDTO, ProductTypeDTO, ProductVariantDTO, UpdateProductCategoryDTO, UpdateProductCollectionDTO, UpdateProductDTO, UpdateProductOptionDTO, UpdateProductTagDTO, UpdateProductTypeDTO } from "./common";
|
|
2
|
-
import { Context } from "../shared-context";
|
|
3
2
|
import { FindConfig } from "../common";
|
|
4
|
-
import {
|
|
3
|
+
import { RestoreReturn, SoftDeleteReturn } from "../dal";
|
|
4
|
+
import { ModuleJoinerConfig } from "../modules-sdk";
|
|
5
|
+
import { Context } from "../shared-context";
|
|
5
6
|
export interface IProductModuleService {
|
|
6
|
-
__joinerConfig():
|
|
7
|
+
__joinerConfig(): ModuleJoinerConfig;
|
|
7
8
|
retrieve(productId: string, config?: FindConfig<ProductDTO>, sharedContext?: Context): Promise<ProductDTO>;
|
|
8
9
|
list(filters?: FilterableProductProps, config?: FindConfig<ProductDTO>, sharedContext?: Context): Promise<ProductDTO[]>;
|
|
9
10
|
listAndCount(filters?: FilterableProductProps, config?: FindConfig<ProductDTO>, sharedContext?: Context): Promise<[ProductDTO[], number]>;
|
|
@@ -43,8 +44,6 @@ export interface IProductModuleService {
|
|
|
43
44
|
create(data: CreateProductDTO[], sharedContext?: Context): Promise<ProductDTO[]>;
|
|
44
45
|
update(data: UpdateProductDTO[], sharedContext?: Context): Promise<ProductDTO[]>;
|
|
45
46
|
delete(productIds: string[], sharedContext?: Context): Promise<void>;
|
|
46
|
-
softDelete<TReturnableLinkableKeys extends string = string>(productIds: string[], config?:
|
|
47
|
-
|
|
48
|
-
}, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
49
|
-
restore(productIds: string[], sharedContext?: Context): Promise<ProductDTO[]>;
|
|
47
|
+
softDelete<TReturnableLinkableKeys extends string = string>(productIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
48
|
+
restore<TReturnableLinkableKeys extends string = string>(productIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
50
49
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { CreateStockLocationInput, FilterableStockLocationProps, StockLocationDTO, UpdateStockLocationInput } from "./common";
|
|
1
2
|
import { FindConfig } from "../common/common";
|
|
2
|
-
import {
|
|
3
|
+
import { ModuleJoinerConfig } from "../modules-sdk";
|
|
3
4
|
import { SharedContext } from "../shared-context";
|
|
4
|
-
import { CreateStockLocationInput, FilterableStockLocationProps, StockLocationDTO, UpdateStockLocationInput } from "./common";
|
|
5
5
|
export interface IStockLocationService {
|
|
6
|
-
__joinerConfig():
|
|
6
|
+
__joinerConfig(): ModuleJoinerConfig;
|
|
7
7
|
list(selector: FilterableStockLocationProps, config?: FindConfig<StockLocationDTO>, context?: SharedContext): Promise<StockLocationDTO[]>;
|
|
8
8
|
listAndCount(selector: FilterableStockLocationProps, config?: FindConfig<StockLocationDTO>, context?: SharedContext): Promise<[StockLocationDTO[], number]>;
|
|
9
9
|
retrieve(id: string, config?: FindConfig<StockLocationDTO>, context?: SharedContext): Promise<StockLocationDTO>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0-next-20230906161158",
|
|
4
4
|
"description": "Medusa Types definition",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"ioredis": "^5.2.5",
|
|
24
24
|
"rimraf": "^5.0.1",
|
|
25
25
|
"typeorm": "^0.3.16",
|
|
26
|
-
"typescript": "^
|
|
26
|
+
"typescript": "^5.1.6",
|
|
27
27
|
"winston": "^3.8.2"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|