@medusajs/utils 1.9.0 → 1.9.1-beta-20230618193938

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.
@@ -0,0 +1 @@
1
+ export declare function clearProject(directory: string): void;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.clearProject = void 0;
16
+ var fs_1 = __importDefault(require("fs"));
17
+ var glob_1 = __importDefault(require("glob"));
18
+ var path_1 = __importDefault(require("path"));
19
+ function clearProject(directory) {
20
+ var adminFiles = glob_1.default.sync(path_1.default.join(directory, "src", "admin/**/*"));
21
+ var onboardingFiles = glob_1.default.sync(path_1.default.join(directory, "src", "**/onboarding/"));
22
+ var typeFiles = glob_1.default.sync(path_1.default.join(directory, "src", "types"));
23
+ var srcFiles = glob_1.default.sync(path_1.default.join(directory, "src", "**/*.{ts,tsx,js,jsx}"));
24
+ var files = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], adminFiles, true), onboardingFiles, true), typeFiles, true), srcFiles, true);
25
+ files.forEach(function (file) {
26
+ return fs_1.default.rmSync(file, {
27
+ recursive: true,
28
+ force: true,
29
+ });
30
+ });
31
+ // add empty typescript file to avoid build errors
32
+ fs_1.default.openSync(path_1.default.join(directory, "src", "index.ts"), "w");
33
+ }
34
+ exports.clearProject = clearProject;
35
+ //# sourceMappingURL=clear-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear-project.js","sourceRoot":"","sources":["../../src/cli/clear-project.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0CAAmB;AACnB,8CAAuB;AACvB,8CAAuB;AAEvB,SAAgB,YAAY,CAAC,SAAiB;IAC5C,IAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAA;IACvE,IAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAC/B,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAC9C,CAAA;IACD,IAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;IACjE,IAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAA;IAE/E,IAAM,KAAK,+DAAO,UAAU,SAAK,eAAe,SAAK,SAAS,SAAK,QAAQ,OAAC,CAAA;IAE5E,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI;QACjB,OAAA,YAAE,CAAC,MAAM,CAAC,IAAI,EAAE;YACd,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;SACZ,CAAC;IAHF,CAGE,CACH,CAAA;IACD,kDAAkD;IAClD,YAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,CAAA;AAC3D,CAAC;AAlBD,oCAkBC"}
@@ -0,0 +1 @@
1
+ export * from "./clear-project";
@@ -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("./clear-project"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B"}
@@ -1,10 +1,10 @@
1
- declare type Order = {
1
+ type Order = {
2
2
  [key: string]: "ASC" | "DESC" | Order;
3
3
  };
4
- declare type Selects = {
4
+ type Selects = {
5
5
  [key: string]: boolean | Selects;
6
6
  };
7
- declare type Relations = {
7
+ type Relations = {
8
8
  [key: string]: boolean | Relations;
9
9
  };
10
10
  export declare function buildSelects(selectCollection: string[]): Selects;
@@ -0,0 +1,8 @@
1
+ export declare const DatabaseErrorCode: {
2
+ databaseDoesNotExist: string;
3
+ connectionFailure: string;
4
+ wrongCredentials: string;
5
+ notFound: string;
6
+ migrationMissing: string;
7
+ };
8
+ export declare function handlePostgresDatabaseError(err: any): never;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handlePostgresDatabaseError = exports.DatabaseErrorCode = void 0;
4
+ var os_1 = require("os");
5
+ exports.DatabaseErrorCode = {
6
+ databaseDoesNotExist: "3D000",
7
+ connectionFailure: "ECONNREFUSED",
8
+ wrongCredentials: "28000",
9
+ notFound: "ENOTFOUND",
10
+ migrationMissing: "42P01",
11
+ };
12
+ function handlePostgresDatabaseError(err) {
13
+ if (exports.DatabaseErrorCode.databaseDoesNotExist === err.code) {
14
+ throw new Error("The specified PostgreSQL database does not exist. Please create it and try again.".concat(os_1.EOL).concat(err.message));
15
+ }
16
+ if (exports.DatabaseErrorCode.connectionFailure === err.code) {
17
+ throw new Error("Failed to establish a connection to PostgreSQL. Please ensure the following is true and try again:\n - You have a PostgreSQL database running\n - You have passed the correct credentials in medusa-config.js\n - You have formatted the database connection string correctly. See below:\n \"postgres://[username]:[password]@[host]:[post]/[db_name]\" - If there is no password, you can omit it from the connection string\n ".concat(os_1.EOL, "\n ").concat(err.message));
18
+ }
19
+ if (exports.DatabaseErrorCode.wrongCredentials === err.code) {
20
+ throw new Error("The specified credentials does not exists for the specified PostgreSQL database.".concat(os_1.EOL).concat(err.message));
21
+ }
22
+ if (exports.DatabaseErrorCode.notFound === err.code) {
23
+ throw new Error("The specified connection string for your PostgreSQL database might have illegal characters. Please check that it only contains allowed characters [a-zA-Z0-9]".concat(os_1.EOL).concat(err.message));
24
+ }
25
+ if (exports.DatabaseErrorCode.migrationMissing === err.code) {
26
+ throw new Error("Migrations missing. Please run 'medusa migrations run' and try again.");
27
+ }
28
+ throw err;
29
+ }
30
+ exports.handlePostgresDatabaseError = handlePostgresDatabaseError;
31
+ //# sourceMappingURL=handle-postgres-database-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-postgres-database-error.js","sourceRoot":"","sources":["../../src/common/handle-postgres-database-error.ts"],"names":[],"mappings":";;;AAAA,yBAAwB;AAEX,QAAA,iBAAiB,GAAG;IAC/B,oBAAoB,EAAE,OAAO;IAC7B,iBAAiB,EAAE,cAAc;IACjC,gBAAgB,EAAE,OAAO;IACzB,QAAQ,EAAE,WAAW;IACrB,gBAAgB,EAAE,OAAO;CAC1B,CAAA;AAED,SAAgB,2BAA2B,CAAC,GAAQ;IAClD,IAAI,yBAAiB,CAAC,oBAAoB,KAAK,GAAG,CAAC,IAAI,EAAE;QACvD,MAAM,IAAI,KAAK,CACb,2FAAoF,QAAG,SAAG,GAAG,CAAC,OAAO,CAAE,CACxG,CAAA;KACF;IAED,IAAI,yBAAiB,CAAC,iBAAiB,KAAK,GAAG,CAAC,IAAI,EAAE;QACpD,MAAM,IAAI,KAAK,CACb,ocAKE,QAAG,qBACH,GAAG,CAAC,OAAO,CAAE,CAChB,CAAA;KACF;IAED,IAAI,yBAAiB,CAAC,gBAAgB,KAAK,GAAG,CAAC,IAAI,EAAE;QACnD,MAAM,IAAI,KAAK,CACb,0FAAmF,QAAG,SAAG,GAAG,CAAC,OAAO,CAAE,CACvG,CAAA;KACF;IAED,IAAI,yBAAiB,CAAC,QAAQ,KAAK,GAAG,CAAC,IAAI,EAAE;QAC3C,MAAM,IAAI,KAAK,CACb,uKAAgK,QAAG,SAAG,GAAG,CAAC,OAAO,CAAE,CACpL,CAAA;KACF;IAED,IAAI,yBAAiB,CAAC,gBAAgB,KAAK,GAAG,CAAC,IAAI,EAAE;QACnD,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAA;KACF;IAED,MAAM,GAAG,CAAA;AACX,CAAC;AAtCD,kEAsCC"}
@@ -1,3 +1,4 @@
1
+ export * from "./build-query";
1
2
  export * from "./errors";
2
3
  export * from "./generate-entity-id";
3
4
  export * from "./get-config-file";
@@ -6,8 +7,13 @@ export * from "./is-defined";
6
7
  export * from "./is-email";
7
8
  export * from "./is-object";
8
9
  export * from "./is-string";
9
- export * from "./object-to-string-path";
10
+ export * from "./lower-case-first";
10
11
  export * from "./medusa-container";
12
+ export * from "./object-to-string-path";
11
13
  export * from "./set-metadata";
14
+ export * from "./simple-hash";
12
15
  export * from "./wrap-handler";
16
+ export * from "./to-kebab-case";
17
+ export * from "./stringify-circular";
13
18
  export * from "./build-query";
19
+ export * from "./handle-postgres-database-error";
@@ -14,6 +14,7 @@ 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("./build-query"), exports);
17
18
  __exportStar(require("./errors"), exports);
18
19
  __exportStar(require("./generate-entity-id"), exports);
19
20
  __exportStar(require("./get-config-file"), exports);
@@ -22,9 +23,14 @@ __exportStar(require("./is-defined"), exports);
22
23
  __exportStar(require("./is-email"), exports);
23
24
  __exportStar(require("./is-object"), exports);
24
25
  __exportStar(require("./is-string"), exports);
25
- __exportStar(require("./object-to-string-path"), exports);
26
+ __exportStar(require("./lower-case-first"), exports);
26
27
  __exportStar(require("./medusa-container"), exports);
28
+ __exportStar(require("./object-to-string-path"), exports);
27
29
  __exportStar(require("./set-metadata"), exports);
30
+ __exportStar(require("./simple-hash"), exports);
28
31
  __exportStar(require("./wrap-handler"), exports);
32
+ __exportStar(require("./to-kebab-case"), exports);
33
+ __exportStar(require("./stringify-circular"), exports);
29
34
  __exportStar(require("./build-query"), exports);
35
+ __exportStar(require("./handle-postgres-database-error"), exports);
30
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,uDAAoC;AACpC,oDAAiC;AACjC,4CAAyB;AACzB,+CAA4B;AAC5B,6CAA0B;AAC1B,8CAA2B;AAC3B,8CAA2B;AAC3B,0DAAuC;AACvC,qDAAkC;AAClC,iDAA8B;AAC9B,iDAA8B;AAC9B,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,2CAAwB;AACxB,uDAAoC;AACpC,oDAAiC;AACjC,4CAAyB;AACzB,+CAA4B;AAC5B,6CAA0B;AAC1B,8CAA2B;AAC3B,8CAA2B;AAC3B,qDAAkC;AAClC,qDAAkC;AAClC,0DAAuC;AACvC,iDAA8B;AAC9B,gDAA6B;AAC7B,iDAA8B;AAC9B,kDAA+B;AAC/B,uDAAoC;AACpC,gDAA6B;AAC7B,mEAAgD"}
@@ -0,0 +1 @@
1
+ export declare function simpleHash(text: string): string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.simpleHash = void 0;
4
+ // DJB2 hash function
5
+ function simpleHash(text) {
6
+ var hash = 5381;
7
+ for (var i = 0; i < text.length; i++) {
8
+ hash = (hash << 5) + hash + text.charCodeAt(i);
9
+ }
10
+ return hash.toString(16);
11
+ }
12
+ exports.simpleHash = simpleHash;
13
+ //# sourceMappingURL=simple-hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-hash.js","sourceRoot":"","sources":["../../src/common/simple-hash.ts"],"names":[],"mappings":";;;AAAA,qBAAqB;AACrB,SAAgB,UAAU,CAAC,IAAY;IACrC,IAAI,IAAI,GAAG,IAAI,CAAA;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;KAC/C;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AAC1B,CAAC;AAND,gCAMC"}
@@ -0,0 +1 @@
1
+ export declare function stringifyCircular(object: any, replacer?: Function | null, space?: number): string;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stringifyCircular = void 0;
4
+ var isObject = function (value) {
5
+ return typeof value === "object" &&
6
+ value != null &&
7
+ !(value instanceof Boolean) &&
8
+ !(value instanceof Date) &&
9
+ !(value instanceof Number) &&
10
+ !(value instanceof RegExp) &&
11
+ !(value instanceof String);
12
+ };
13
+ var isPrimitive = function (val) {
14
+ return val !== Object(val);
15
+ };
16
+ function decycle(object, replacer) {
17
+ var objects = new WeakMap();
18
+ function deepCopy(value, path) {
19
+ var oldPath;
20
+ var newObj;
21
+ if (replacer != null) {
22
+ value = replacer(value);
23
+ }
24
+ if (isObject(value)) {
25
+ oldPath = objects.get(value);
26
+ if (oldPath !== undefined) {
27
+ return { $ref: oldPath };
28
+ }
29
+ objects.set(value, path);
30
+ if (Array.isArray(value)) {
31
+ newObj = [];
32
+ value.forEach(function (el, idx) {
33
+ newObj[idx] = deepCopy(el, path + "[" + idx + "]");
34
+ });
35
+ }
36
+ else {
37
+ newObj = {};
38
+ Object.keys(value).forEach(function (name) {
39
+ newObj[name] = deepCopy(value[name], path + "[" + JSON.stringify(name) + "]");
40
+ });
41
+ }
42
+ return newObj;
43
+ }
44
+ return !isPrimitive(value) ? value + "" : value;
45
+ }
46
+ return deepCopy(object, "$");
47
+ }
48
+ function stringifyCircular(object, replacer, space) {
49
+ return JSON.stringify(decycle(object, replacer), null, space);
50
+ }
51
+ exports.stringifyCircular = stringifyCircular;
52
+ //# sourceMappingURL=stringify-circular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify-circular.js","sourceRoot":"","sources":["../../src/common/stringify-circular.ts"],"names":[],"mappings":";;;AAAA,IAAM,QAAQ,GAAG,UAAC,KAAU;IAC1B,OAAA,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,IAAI,IAAI;QACb,CAAC,CAAC,KAAK,YAAY,OAAO,CAAC;QAC3B,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC;QACxB,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC;QAC1B,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC;QAC1B,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC;AAN1B,CAM0B,CAAA;AAE5B,IAAM,WAAW,GAAG,UAAC,GAAG;IACtB,OAAO,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED,SAAS,OAAO,CAAC,MAAW,EAAE,QAA0B;IACtD,IAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;IAE7B,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI;QAC3B,IAAI,OAAO,CAAA;QACX,IAAI,MAAM,CAAA;QAEV,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;SACxB;QAED,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;YACnB,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAC5B,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;aACzB;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAExB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACxB,MAAM,GAAG,EAAE,CAAA;gBACX,KAAK,CAAC,OAAO,CAAC,UAAC,EAAE,EAAE,GAAG;oBACpB,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,EAAE,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAA;gBACpD,CAAC,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,GAAG,EAAE,CAAA;gBACX,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI;oBAC9B,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CACrB,KAAK,CAAC,IAAI,CAAC,EACX,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,GAAG,CACxC,CAAA;gBACH,CAAC,CAAC,CAAA;aACH;YACD,OAAO,MAAM,CAAA;SACd;QAED,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;IACjD,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC9B,CAAC;AAED,SAAgB,iBAAiB,CAC/B,MAAW,EACX,QAA0B,EAC1B,KAAc;IAEd,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;AAC/D,CAAC;AAND,8CAMC"}
@@ -0,0 +1 @@
1
+ export declare const kebabCase: (string: any) => any;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.kebabCase = void 0;
4
+ var kebabCase = function (string) {
5
+ return string
6
+ .replace(/([a-z])([A-Z])/g, "$1-$2")
7
+ .replace(/[\s_]+/g, "-")
8
+ .toLowerCase();
9
+ };
10
+ exports.kebabCase = kebabCase;
11
+ //# sourceMappingURL=to-kebab-case.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-kebab-case.js","sourceRoot":"","sources":["../../src/common/to-kebab-case.ts"],"names":[],"mappings":";;;AAAO,IAAM,SAAS,GAAG,UAAC,MAAM;IAC9B,OAAA,MAAM;SACH,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;SACnC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,WAAW,EAAE;AAHhB,CAGgB,CAAA;AAJL,QAAA,SAAS,aAIJ"}
@@ -1,5 +1,5 @@
1
1
  import { Request, RequestHandler, Response } from "express";
2
- declare type handler = (req: Request, res: Response) => Promise<void>;
2
+ type handler = (req: Request, res: Response) => Promise<void>;
3
3
  export declare const wrapHandler: (fn: handler) => RequestHandler;
4
4
  export {};
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-handler.js","sourceRoot":"","sources":["../../src/common/wrap-handler.ts"],"names":[],"mappings":";;;AAIO,IAAM,WAAW,GAAG,UAAC,EAAW;IACrC,OAAO,UACL,GAAmC,EACnC,GAAa,EACb,IAAkB;;QAElB,IAAI,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,0CAAE,MAAM,EAAE;YACvB,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,OAAO,EACL,oFAAoF;aACvF,CAAC,CAAA;SACH;QAED,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,WAAW,eAgBvB;AAED;;;;;;;;;;;;;GAaG"}
1
+ {"version":3,"file":"wrap-handler.js","sourceRoot":"","sources":["../../src/common/wrap-handler.ts"],"names":[],"mappings":";;;AAIO,IAAM,WAAW,GAAG,UAAC,EAAW;IACvC,OAAO,UACH,GAAmC,EACnC,GAAa,EACb,IAAkB;;QAElB,IAAI,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,0CAAE,MAAM,EAAE;YACvB,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,OAAO,EACL,oFAAoF;aACvF,CAAC,CAAA;SACH;QAED,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,WAAW,eAgBvB;AAED;;;;;;;;;;;;;GAaG"}
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./bundles";
2
+ export * from "./cli";
2
3
  export * from "./common";
3
4
  export * from "./decorators";
4
5
  export * from "./event-bus";
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./bundles"), exports);
18
+ __exportStar(require("./cli"), exports);
18
19
  __exportStar(require("./common"), exports);
19
20
  __exportStar(require("./decorators"), exports);
20
21
  __exportStar(require("./event-bus"), 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,2CAAwB;AACxB,+CAA4B;AAC5B,8CAA2B;AAC3B,2CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,wCAAqB;AACrB,2CAAwB;AACxB,+CAA4B;AAC5B,8CAA2B;AAC3B,2CAAwB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/utils",
3
- "version": "1.9.0",
3
+ "version": "1.9.1-beta-20230618193938",
4
4
  "description": "Medusa utilities functions shared by Medusa core and Modules",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -17,15 +17,17 @@
17
17
  "author": "Medusa",
18
18
  "license": "MIT",
19
19
  "devDependencies": {
20
- "@medusajs/types": "1.8.7",
20
+ "@medusajs/types": "1.8.8-beta-20230618193938",
21
21
  "@types/express": "^4.17.17",
22
22
  "cross-env": "^5.2.1",
23
+ "express": "^4.18.2",
23
24
  "jest": "^25.5.4",
24
25
  "ts-jest": "^25.5.1",
25
26
  "typescript": "^4.4.4"
26
27
  },
27
28
  "dependencies": {
28
- "awilix": "^8.0.0",
29
+ "awilix": "^8.0.1",
30
+ "glob": "^7.1.6",
29
31
  "ulid": "^2.3.0"
30
32
  },
31
33
  "scripts": {