@medusajs/types 0.0.1 → 0.0.2-next-20230322094312
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 +3 -0
- package/dist/bundles.js +30 -0
- package/dist/bundles.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 +1 -0
- package/dist/common/index.js +18 -0
- package/dist/common/index.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 +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- 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 -1
package/dist/bundles.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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.EventBusTypes = exports.CommonTypes = void 0;
|
|
27
|
+
exports.CommonTypes = __importStar(require("./common"));
|
|
28
|
+
exports.EventBusTypes = __importStar(require("./event-bus"));
|
|
29
|
+
exports.TransactionBaseTypes = __importStar(require("./transaction-base"));
|
|
30
|
+
//# sourceMappingURL=bundles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAuC;AACvC,6DAA4C;AAC5C,2EAA0D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ExternalModuleDeclaration, InternalModuleDeclaration } from "@medusajs/modules-sdk";
|
|
2
|
+
import { LoggerOptions } from "typeorm";
|
|
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 @@
|
|
|
1
|
+
export * from "./config-module";
|
|
@@ -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("./config-module"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
|
|
@@ -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
package/dist/index.js
CHANGED
|
@@ -14,5 +14,9 @@ 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("./common"), exports);
|
|
19
|
+
__exportStar(require("./event-bus"), exports);
|
|
17
20
|
__exportStar(require("./shared-context"), exports);
|
|
21
|
+
__exportStar(require("./transaction-base"), exports);
|
|
18
22
|
//# 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,2CAAwB;AACxB,8CAA2B;AAC3B,mDAAgC;AAChC,qDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./transaction-base";
|
|
@@ -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("./transaction-base"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transaction-base/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-base.js","sourceRoot":"","sources":["../../src/transaction-base/transaction-base.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-next-20230322094312",
|
|
4
4
|
"description": "Medusa Types definition",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
],
|
|
17
17
|
"author": "Medusa",
|
|
18
18
|
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@medusajs/modules-sdk": "0.1.0-next-20230322094312"
|
|
21
|
+
},
|
|
19
22
|
"devDependencies": {
|
|
20
23
|
"cross-env": "^5.2.1",
|
|
21
24
|
"typeorm": "^0.3.11",
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
"scripts": {
|
|
25
28
|
"prepare": "cross-env NODE_ENV=production yarn run build",
|
|
26
29
|
"build": "tsc --build",
|
|
30
|
+
"watch": "tsc --build --watch",
|
|
27
31
|
"test": "exit 0"
|
|
28
32
|
}
|
|
29
33
|
}
|