@medusajs/types 0.0.1 → 0.0.2-ci-issue-20230322190222
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 +8 -0
- package/dist/bundles.js +35 -0
- package/dist/bundles.js.map +1 -0
- package/dist/cache/index.d.ts +1 -0
- package/dist/cache/index.js +18 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/service.d.ts +5 -0
- package/dist/cache/service.js +3 -0
- package/dist/cache/service.js.map +1 -0
- package/dist/common/common.d.ts +138 -0
- package/dist/common/common.js +3 -0
- package/dist/common/common.js.map +1 -0
- package/dist/common/config-module.d.ts +37 -0
- package/dist/common/config-module.js +3 -0
- package/dist/common/config-module.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.js +20 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/medusa-container.d.ts +5 -0
- package/dist/common/medusa-container.js +3 -0
- package/dist/common/medusa-container.js.map +1 -0
- package/dist/event-bus/common.d.ts +14 -0
- package/dist/event-bus/common.js +3 -0
- package/dist/event-bus/common.js.map +1 -0
- package/dist/event-bus/event-bus-module.d.ts +7 -0
- package/dist/event-bus/event-bus-module.js +3 -0
- package/dist/event-bus/event-bus-module.js.map +1 -0
- package/dist/event-bus/event-bus.d.ts +7 -0
- package/dist/event-bus/event-bus.js +3 -0
- package/dist/event-bus/event-bus.js.map +1 -0
- package/dist/event-bus/index.d.ts +3 -0
- package/dist/event-bus/index.js +20 -0
- package/dist/event-bus/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/event-bus.d.ts +11 -0
- package/dist/interfaces/event-bus.js +3 -0
- package/dist/interfaces/event-bus.js.map +1 -0
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/interfaces/index.js +29 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/services/event-bus.d.ts +11 -0
- package/dist/interfaces/services/event-bus.js +3 -0
- package/dist/interfaces/services/event-bus.js.map +1 -0
- package/dist/interfaces/services/transaction-base.d.ts +20 -0
- package/dist/interfaces/services/transaction-base.js +3 -0
- package/dist/interfaces/services/transaction-base.js.map +1 -0
- package/dist/interfaces/transaction-base.d.ts +0 -0
- package/dist/interfaces/transaction-base.js +1 -0
- package/dist/interfaces/transaction-base.js.map +1 -0
- package/dist/inventory/common.d.ts +238 -0
- package/dist/inventory/common.js +3 -0
- package/dist/inventory/common.js.map +1 -0
- package/dist/inventory/index.d.ts +2 -0
- package/dist/inventory/index.js +19 -0
- package/dist/inventory/index.js.map +1 -0
- package/dist/inventory/inventory.d.ts +27 -0
- package/dist/inventory/inventory.js +3 -0
- package/dist/inventory/inventory.js.map +1 -0
- package/dist/modules-sdk/index.d.ts +69 -0
- package/dist/modules-sdk/index.js +29 -0
- package/dist/modules-sdk/index.js.map +1 -0
- package/dist/search/index-types.d.ts +3 -0
- package/dist/search/index-types.js +7 -0
- package/dist/search/index-types.js.map +1 -0
- package/dist/search/index.d.ts +18 -0
- package/dist/search/index.js +21 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/indexes.d.ts +3 -0
- package/dist/search/indexes.js +7 -0
- package/dist/search/indexes.js.map +1 -0
- package/dist/search/interface.d.ts +62 -0
- package/dist/search/interface.js +3 -0
- package/dist/search/interface.js.map +1 -0
- package/dist/search/settings.d.ts +14 -0
- package/dist/search/settings.js +3 -0
- package/dist/search/settings.js.map +1 -0
- package/dist/search/variant-keys.d.ts +1 -0
- package/dist/search/variant-keys.js +13 -0
- package/dist/search/variant-keys.js.map +1 -0
- package/dist/stock-location/common.d.ts +262 -0
- package/dist/stock-location/common.js +3 -0
- package/dist/stock-location/common.js.map +1 -0
- package/dist/stock-location/index.d.ts +2 -0
- package/dist/stock-location/index.js +19 -0
- package/dist/stock-location/index.js.map +1 -0
- package/dist/stock-location/stock-location.d.ts +10 -0
- package/dist/stock-location/stock-location.js +3 -0
- package/dist/stock-location/stock-location.js.map +1 -0
- package/dist/transaction-base/index.d.ts +1 -0
- package/dist/transaction-base/index.js +18 -0
- package/dist/transaction-base/index.js.map +1 -0
- package/dist/transaction-base/transaction-base.d.ts +4 -0
- package/dist/transaction-base/transaction-base.js +3 -0
- package/dist/transaction-base/transaction-base.js.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as CacheTypes from "./cache";
|
|
2
|
+
export * as CommonTypes from "./common";
|
|
3
|
+
export * as EventBusTypes from "./event-bus";
|
|
4
|
+
export * as InventoryTypes from "./inventory";
|
|
5
|
+
export * as ModulesSdkTypes from "./modules-sdk";
|
|
6
|
+
export * as SearchTypes from "./search";
|
|
7
|
+
export * as StockLocationTypes from "./stock-location";
|
|
8
|
+
export * as TransactionBaseTypes from "./transaction-base";
|
package/dist/bundles.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TransactionBaseTypes = exports.StockLocationTypes = exports.SearchTypes = exports.ModulesSdkTypes = exports.InventoryTypes = exports.EventBusTypes = exports.CommonTypes = exports.CacheTypes = void 0;
|
|
27
|
+
exports.CacheTypes = __importStar(require("./cache"));
|
|
28
|
+
exports.CommonTypes = __importStar(require("./common"));
|
|
29
|
+
exports.EventBusTypes = __importStar(require("./event-bus"));
|
|
30
|
+
exports.InventoryTypes = __importStar(require("./inventory"));
|
|
31
|
+
exports.ModulesSdkTypes = __importStar(require("./modules-sdk"));
|
|
32
|
+
exports.SearchTypes = __importStar(require("./search"));
|
|
33
|
+
exports.StockLocationTypes = __importStar(require("./stock-location"));
|
|
34
|
+
exports.TransactionBaseTypes = __importStar(require("./transaction-base"));
|
|
35
|
+
//# sourceMappingURL=bundles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAqC;AACrC,wDAAuC;AACvC,6DAA4C;AAC5C,8DAA6C;AAC7C,iEAAgD;AAChD,wDAAuC;AACvC,uEAAsD;AACtD,2EAA0D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./service";
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/cache/service.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { FindManyOptions, FindOneOptions, FindOperator, FindOptionsSelect, FindOptionsWhere, OrderByCondition } from "typeorm";
|
|
2
|
+
import { FindOptionsOrder } from "typeorm/find-options/FindOptionsOrder";
|
|
3
|
+
import { FindOptionsRelations } from "typeorm/find-options/FindOptionsRelations";
|
|
4
|
+
/**
|
|
5
|
+
* Utility type used to remove some optional attributes (coming from K) from a type T
|
|
6
|
+
*/
|
|
7
|
+
export declare type WithRequiredProperty<T, K extends keyof T> = T & {
|
|
8
|
+
[Property in K]-?: T[Property];
|
|
9
|
+
};
|
|
10
|
+
export declare type PartialPick<T, K extends keyof T> = {
|
|
11
|
+
[P in K]?: T[P];
|
|
12
|
+
};
|
|
13
|
+
export interface BaseEntity {
|
|
14
|
+
id: string;
|
|
15
|
+
created_at: Date;
|
|
16
|
+
updated_at: Date;
|
|
17
|
+
}
|
|
18
|
+
export interface SoftDeletableEntity extends BaseEntity {
|
|
19
|
+
deleted_at: Date | null;
|
|
20
|
+
}
|
|
21
|
+
export declare type Writable<T> = {
|
|
22
|
+
-readonly [key in keyof T]: T[key] | FindOperator<T[key]> | FindOperator<T[key][]> | FindOperator<string[]>;
|
|
23
|
+
};
|
|
24
|
+
export interface FindConfig<Entity> {
|
|
25
|
+
select?: (keyof Entity)[];
|
|
26
|
+
skip?: number;
|
|
27
|
+
take?: number;
|
|
28
|
+
relations?: string[];
|
|
29
|
+
order?: {
|
|
30
|
+
[K: string]: "ASC" | "DESC";
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare type ExtendedFindConfig<TEntity> = (Omit<FindOneOptions<TEntity>, "where" | "relations" | "select"> | Omit<FindManyOptions<TEntity>, "where" | "relations" | "select">) & {
|
|
34
|
+
select?: FindOptionsSelect<TEntity>;
|
|
35
|
+
relations?: FindOptionsRelations<TEntity>;
|
|
36
|
+
where: FindOptionsWhere<TEntity> | FindOptionsWhere<TEntity>[];
|
|
37
|
+
order?: FindOptionsOrder<TEntity>;
|
|
38
|
+
skip?: number;
|
|
39
|
+
take?: number;
|
|
40
|
+
};
|
|
41
|
+
export declare type QuerySelector<TEntity> = Selector<TEntity> & {
|
|
42
|
+
q?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare type TreeQuerySelector<TEntity> = QuerySelector<TEntity> & {
|
|
45
|
+
include_descendants_tree?: boolean;
|
|
46
|
+
};
|
|
47
|
+
export declare type Selector<TEntity> = {
|
|
48
|
+
[key in keyof TEntity]?: TEntity[key] | TEntity[key][] | DateComparisonOperator | StringComparisonOperator | NumericalComparisonOperator | FindOperator<TEntity[key][] | string | string[]>;
|
|
49
|
+
};
|
|
50
|
+
export declare type TotalField = "shipping_total" | "discount_total" | "tax_total" | "refunded_total" | "total" | "subtotal" | "refundable_amount" | "gift_card_total" | "gift_card_tax_total";
|
|
51
|
+
export interface CustomFindOptions<TModel, InKeys extends keyof TModel> {
|
|
52
|
+
select?: FindManyOptions<TModel>["select"];
|
|
53
|
+
where?: FindManyOptions<TModel>["where"] & {
|
|
54
|
+
[P in InKeys]?: TModel[P][];
|
|
55
|
+
};
|
|
56
|
+
order?: OrderByCondition;
|
|
57
|
+
skip?: number;
|
|
58
|
+
take?: number;
|
|
59
|
+
}
|
|
60
|
+
export declare type QueryConfig<TEntity extends BaseEntity> = {
|
|
61
|
+
defaultFields?: (keyof TEntity | string)[];
|
|
62
|
+
defaultRelations?: string[];
|
|
63
|
+
allowedFields?: string[];
|
|
64
|
+
allowedRelations?: string[];
|
|
65
|
+
defaultLimit?: number;
|
|
66
|
+
isList?: boolean;
|
|
67
|
+
};
|
|
68
|
+
export declare type RequestQueryFields = {
|
|
69
|
+
expand?: string;
|
|
70
|
+
fields?: string;
|
|
71
|
+
offset?: number;
|
|
72
|
+
limit?: number;
|
|
73
|
+
order?: string;
|
|
74
|
+
};
|
|
75
|
+
export declare type PaginatedResponse = {
|
|
76
|
+
limit: number;
|
|
77
|
+
offset: number;
|
|
78
|
+
count: number;
|
|
79
|
+
};
|
|
80
|
+
export declare type DeleteResponse = {
|
|
81
|
+
id: string;
|
|
82
|
+
object: string;
|
|
83
|
+
deleted: boolean;
|
|
84
|
+
};
|
|
85
|
+
export interface EmptyQueryParams {
|
|
86
|
+
}
|
|
87
|
+
export interface DateComparisonOperator {
|
|
88
|
+
lt?: Date;
|
|
89
|
+
gt?: Date;
|
|
90
|
+
gte?: Date;
|
|
91
|
+
lte?: Date;
|
|
92
|
+
}
|
|
93
|
+
export interface StringComparisonOperator {
|
|
94
|
+
lt?: string;
|
|
95
|
+
gt?: string;
|
|
96
|
+
gte?: string;
|
|
97
|
+
lte?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface NumericalComparisonOperator {
|
|
100
|
+
lt?: number;
|
|
101
|
+
gt?: number;
|
|
102
|
+
gte?: number;
|
|
103
|
+
lte?: number;
|
|
104
|
+
}
|
|
105
|
+
export interface AddressPayload {
|
|
106
|
+
first_name?: string;
|
|
107
|
+
last_name?: string;
|
|
108
|
+
phone?: string;
|
|
109
|
+
metadata?: Record<string, unknown>;
|
|
110
|
+
company?: string;
|
|
111
|
+
address_1?: string;
|
|
112
|
+
address_2?: string;
|
|
113
|
+
city?: string;
|
|
114
|
+
country_code?: string;
|
|
115
|
+
province?: string;
|
|
116
|
+
postal_code?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface AddressCreatePayload {
|
|
119
|
+
first_name: string;
|
|
120
|
+
last_name: string;
|
|
121
|
+
phone: string;
|
|
122
|
+
metadata: object;
|
|
123
|
+
company: string;
|
|
124
|
+
address_1: string;
|
|
125
|
+
address_2: string;
|
|
126
|
+
city: string;
|
|
127
|
+
country_code: string;
|
|
128
|
+
province: string;
|
|
129
|
+
postal_code: string;
|
|
130
|
+
}
|
|
131
|
+
export interface FindParams {
|
|
132
|
+
expand?: string;
|
|
133
|
+
fields?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface FindPaginationParams {
|
|
136
|
+
offset?: number;
|
|
137
|
+
limit?: number;
|
|
138
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LoggerOptions } from "typeorm";
|
|
2
|
+
import { ExternalModuleDeclaration, InternalModuleDeclaration } from "../modules-sdk";
|
|
3
|
+
declare type SessionOptions = {
|
|
4
|
+
name?: string;
|
|
5
|
+
resave?: boolean;
|
|
6
|
+
rolling?: boolean;
|
|
7
|
+
saveUninitialized?: boolean;
|
|
8
|
+
secret?: string;
|
|
9
|
+
ttl?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare type ConfigModule = {
|
|
12
|
+
projectConfig: {
|
|
13
|
+
redis_url?: string;
|
|
14
|
+
session_options?: SessionOptions;
|
|
15
|
+
jwt_secret?: string;
|
|
16
|
+
cookie_secret?: string;
|
|
17
|
+
database_url?: string;
|
|
18
|
+
database_type: string;
|
|
19
|
+
database_database?: string;
|
|
20
|
+
database_schema?: string;
|
|
21
|
+
database_logging: LoggerOptions;
|
|
22
|
+
database_extra?: Record<string, unknown> & {
|
|
23
|
+
ssl: {
|
|
24
|
+
rejectUnauthorized: false;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
store_cors?: string;
|
|
28
|
+
admin_cors?: string;
|
|
29
|
+
};
|
|
30
|
+
featureFlags: Record<string, boolean | string>;
|
|
31
|
+
modules?: Record<string, false | string | Partial<InternalModuleDeclaration | ExternalModuleDeclaration>>;
|
|
32
|
+
plugins: ({
|
|
33
|
+
resolve: string;
|
|
34
|
+
options: Record<string, unknown>;
|
|
35
|
+
} | string)[];
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-module.js","sourceRoot":"","sources":["../../src/common/config-module.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./config-module"), exports);
|
|
19
|
+
__exportStar(require("./medusa-container"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,kDAA+B;AAC/B,qDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"medusa-container.js","sourceRoot":"","sources":["../../src/common/medusa-container.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare type Subscriber<T = unknown> = (data: T, eventName: string) => Promise<void>;
|
|
2
|
+
export declare type SubscriberContext = {
|
|
3
|
+
subscriberId: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type SubscriberDescriptor = {
|
|
6
|
+
id: string;
|
|
7
|
+
subscriber: Subscriber;
|
|
8
|
+
};
|
|
9
|
+
export declare type EventHandler<T = unknown> = (data: T, eventName: string) => Promise<void>;
|
|
10
|
+
export declare type EmitData<T = unknown> = {
|
|
11
|
+
eventName: string;
|
|
12
|
+
data: T;
|
|
13
|
+
options?: Record<string, unknown>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/event-bus/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EmitData, Subscriber, SubscriberContext } from "./common";
|
|
2
|
+
export interface IEventBusModuleService {
|
|
3
|
+
emit<T>(eventName: string, data: T, options: Record<string, unknown>): Promise<void>;
|
|
4
|
+
emit<T>(data: EmitData<T>[]): Promise<void>;
|
|
5
|
+
subscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
6
|
+
unsubscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus-module.js","sourceRoot":"","sources":["../../src/event-bus/event-bus-module.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Subscriber, SubscriberContext } from ".";
|
|
2
|
+
import { ITransactionBaseService } from "../transaction-base/transaction-base";
|
|
3
|
+
export interface IEventBusService extends ITransactionBaseService {
|
|
4
|
+
subscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
5
|
+
unsubscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
6
|
+
emit<T>(event: string, data: T, options?: unknown): Promise<unknown | void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/event-bus/event-bus.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./event-bus"), exports);
|
|
19
|
+
__exportStar(require("./event-bus-module"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/event-bus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,8CAA2B;AAC3B,qDAAkC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
+
export * from "./bundles";
|
|
2
|
+
export * from "./cache";
|
|
3
|
+
export * from "./common";
|
|
4
|
+
export * from "./event-bus";
|
|
5
|
+
export * from "./inventory";
|
|
6
|
+
export * from "./modules-sdk";
|
|
7
|
+
export * from "./search";
|
|
1
8
|
export * from "./shared-context";
|
|
9
|
+
export * from "./stock-location";
|
|
10
|
+
export * from "./transaction-base";
|
package/dist/index.js
CHANGED
|
@@ -14,5 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bundles"), exports);
|
|
18
|
+
__exportStar(require("./cache"), exports);
|
|
19
|
+
__exportStar(require("./common"), exports);
|
|
20
|
+
__exportStar(require("./event-bus"), exports);
|
|
21
|
+
__exportStar(require("./inventory"), exports);
|
|
22
|
+
__exportStar(require("./modules-sdk"), exports);
|
|
23
|
+
__exportStar(require("./search"), exports);
|
|
17
24
|
__exportStar(require("./shared-context"), exports);
|
|
25
|
+
__exportStar(require("./stock-location"), exports);
|
|
26
|
+
__exportStar(require("./transaction-base"), exports);
|
|
18
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,0CAAuB;AACvB,2CAAwB;AACxB,8CAA2B;AAC3B,8CAA2B;AAC3B,gDAA6B;AAC7B,2CAAwB;AACxB,mDAAgC;AAChC,mDAAgC;AAChC,qDAAkC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransactionBaseService } from "@medusajs/medusa";
|
|
2
|
+
import { EmitData, Subscriber, SubscriberContext } from "../event-bus";
|
|
3
|
+
export interface IEventBusService extends TransactionBaseService {
|
|
4
|
+
emit<T>(event: string, data: T, options?: unknown): Promise<unknown | void>;
|
|
5
|
+
}
|
|
6
|
+
export interface IEventBusModuleService {
|
|
7
|
+
emit<T>(eventName: string, data: T, options: Record<string, unknown>): Promise<void>;
|
|
8
|
+
emit<T>(data: EmitData<T>[]): Promise<void>;
|
|
9
|
+
subscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
10
|
+
unsubscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/interfaces/event-bus.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ITransactionBaseService = exports.EventBus = void 0;
|
|
27
|
+
exports.EventBus = __importStar(require("../event-bus/event-bus"));
|
|
28
|
+
exports.ITransactionBaseService = __importStar(require("../transaction-base/transaction-base"));
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmD;AACnD,gGAAgF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EmitData, Subscriber, SubscriberContext } from "../../event-bus";
|
|
2
|
+
import { ITransactionBaseService } from "./transaction-base";
|
|
3
|
+
export interface IEventBusService extends ITransactionBaseService {
|
|
4
|
+
emit<T>(event: string, data: T, options?: unknown): Promise<unknown | void>;
|
|
5
|
+
}
|
|
6
|
+
export interface IEventBusModuleService {
|
|
7
|
+
emit<T>(eventName: string, data: T, options: Record<string, unknown>): Promise<void>;
|
|
8
|
+
emit<T>(data: EmitData<T>[]): Promise<void>;
|
|
9
|
+
subscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
10
|
+
unsubscribe(eventName: string | symbol, subscriber: Subscriber, context?: SubscriberContext): this;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../../src/interfaces/services/event-bus.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EntityManager } from "typeorm";
|
|
2
|
+
import { IsolationLevel } from "typeorm/driver/types/IsolationLevel";
|
|
3
|
+
export interface ITransactionBaseService {
|
|
4
|
+
manager_: EntityManager;
|
|
5
|
+
transactionManager_: EntityManager | undefined;
|
|
6
|
+
withTransaction(transactionManager?: EntityManager): this;
|
|
7
|
+
shouldRetryTransaction_(err: {
|
|
8
|
+
code: string;
|
|
9
|
+
} | Record<string, unknown>): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Wraps some work within a transactional block. If the service already has
|
|
12
|
+
* a transaction manager attached this will be reused, otherwise a new
|
|
13
|
+
* transaction manager is created.
|
|
14
|
+
* @param work - the transactional work to be done
|
|
15
|
+
* @param isolationOrErrorHandler - the isolation level to be used for the work.
|
|
16
|
+
* @param maybeErrorHandlerOrDontFail Potential error handler
|
|
17
|
+
* @return the result of the transactional work
|
|
18
|
+
*/
|
|
19
|
+
atomicPhase_<TResult, TError>(work: (transactionManager: EntityManager) => Promise<TResult | never>, isolationOrErrorHandler?: IsolationLevel | ((error: TError) => Promise<never | TResult | void>), maybeErrorHandlerOrDontFail?: (error: TError) => Promise<never | TResult | void>): Promise<never | TResult>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-base.js","sourceRoot":"","sources":["../../../src/interfaces/services/transaction-base.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=transaction-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-base.js","sourceRoot":"","sources":["../../src/interfaces/transaction-base.ts"],"names":[],"mappings":""}
|