@medusajs/utils 1.11.5 → 1.11.6-next-20240209091945

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 CHANGED
@@ -3,6 +3,7 @@ export * as DecoratorUtils from "./decorators";
3
3
  export * as DefaultsUtils from "./defaults";
4
4
  export * as EventBusUtils from "./event-bus";
5
5
  export * as FeatureFlagUtils from "./feature-flags";
6
+ export * as FulfillmentUtils from "./fulfillment";
6
7
  export * as ModulesSdkUtils from "./modules-sdk";
7
8
  export * as OrchestrationUtils from "./orchestration";
8
9
  export * as ProductUtils from "./product";
package/dist/bundles.js CHANGED
@@ -23,12 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ShippingProfileUtils = exports.SearchUtils = exports.PromotionUtils = exports.ProductUtils = exports.OrchestrationUtils = exports.ModulesSdkUtils = exports.FeatureFlagUtils = exports.EventBusUtils = exports.DefaultsUtils = exports.DecoratorUtils = exports.DALUtils = void 0;
26
+ exports.ShippingProfileUtils = exports.SearchUtils = exports.PromotionUtils = exports.ProductUtils = exports.OrchestrationUtils = exports.ModulesSdkUtils = exports.FulfillmentUtils = exports.FeatureFlagUtils = exports.EventBusUtils = exports.DefaultsUtils = exports.DecoratorUtils = exports.DALUtils = void 0;
27
27
  exports.DALUtils = __importStar(require("./dal"));
28
28
  exports.DecoratorUtils = __importStar(require("./decorators"));
29
29
  exports.DefaultsUtils = __importStar(require("./defaults"));
30
30
  exports.EventBusUtils = __importStar(require("./event-bus"));
31
31
  exports.FeatureFlagUtils = __importStar(require("./feature-flags"));
32
+ exports.FulfillmentUtils = __importStar(require("./fulfillment"));
32
33
  exports.ModulesSdkUtils = __importStar(require("./modules-sdk"));
33
34
  exports.OrchestrationUtils = __importStar(require("./orchestration"));
34
35
  exports.ProductUtils = __importStar(require("./product"));
@@ -1 +1 @@
1
- {"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAiC;AACjC,+DAA8C;AAC9C,4DAA2C;AAC3C,6DAA4C;AAC5C,oEAAmD;AACnD,iEAAgD;AAChD,sEAAqD;AACrD,0DAAyC;AACzC,8DAA6C;AAC7C,wDAAuC;AACvC,mEAAkD"}
1
+ {"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAiC;AACjC,+DAA8C;AAC9C,4DAA2C;AAC3C,6DAA4C;AAC5C,oEAAmD;AACnD,kEAAiD;AACjD,iEAAgD;AAChD,sEAAqD;AACrD,0DAAyC;AACzC,8DAA6C;AAC7C,wDAAuC;AACvC,mEAAkD"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Create a PSQL index statement
3
+ * @param name The name of the index
4
+ * @param tableName The name of the table
5
+ * @param columns The columns to index
6
+ * @param type The type of index (e.g GIN, GIST, BTREE, etc)
7
+ * @param where The where clause
8
+ *
9
+ * @example
10
+ * createPsqlIndexStatementHelper({
11
+ * name: "idx_user_email",
12
+ * tableName: "user",
13
+ * columns: "email",
14
+ * type: "btree",
15
+ * where: "email IS NOT NULL"
16
+ * });
17
+ *
18
+ * // CREATE INDEX IF NOT EXISTS idx_user_email ON user USING btree (email) WHERE email IS NOT NULL;
19
+ *
20
+ * createPsqlIndexStatementHelper({
21
+ * name: "idx_user_email",
22
+ * tableName: "user",
23
+ * columns: "email"
24
+ * });
25
+ *
26
+ * // CREATE INDEX IF NOT EXISTS idx_user_email ON user (email);
27
+ *
28
+ */
29
+ export declare function createPsqlIndexStatementHelper({ name, tableName, columns, type, where, }: {
30
+ name: string;
31
+ tableName: string;
32
+ columns: string | string[];
33
+ type?: string;
34
+ where?: string;
35
+ }): string;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPsqlIndexStatementHelper = void 0;
4
+ /**
5
+ * Create a PSQL index statement
6
+ * @param name The name of the index
7
+ * @param tableName The name of the table
8
+ * @param columns The columns to index
9
+ * @param type The type of index (e.g GIN, GIST, BTREE, etc)
10
+ * @param where The where clause
11
+ *
12
+ * @example
13
+ * createPsqlIndexStatementHelper({
14
+ * name: "idx_user_email",
15
+ * tableName: "user",
16
+ * columns: "email",
17
+ * type: "btree",
18
+ * where: "email IS NOT NULL"
19
+ * });
20
+ *
21
+ * // CREATE INDEX IF NOT EXISTS idx_user_email ON user USING btree (email) WHERE email IS NOT NULL;
22
+ *
23
+ * createPsqlIndexStatementHelper({
24
+ * name: "idx_user_email",
25
+ * tableName: "user",
26
+ * columns: "email"
27
+ * });
28
+ *
29
+ * // CREATE INDEX IF NOT EXISTS idx_user_email ON user (email);
30
+ *
31
+ */
32
+ function createPsqlIndexStatementHelper(_a) {
33
+ var name = _a.name, tableName = _a.tableName, columns = _a.columns, type = _a.type, where = _a.where;
34
+ columns = Array.isArray(columns) ? columns.join(", ") : columns;
35
+ var typeStr = type ? " USING ".concat(type) : "";
36
+ var optionsStr = where ? " WHERE ".concat(where) : "";
37
+ return "CREATE INDEX IF NOT EXISTS ".concat(name, " ON ").concat(tableName).concat(typeStr, " (").concat(columns, ")").concat(optionsStr);
38
+ }
39
+ exports.createPsqlIndexStatementHelper = createPsqlIndexStatementHelper;
40
+ //# sourceMappingURL=create-psql-index-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-psql-index-helper.js","sourceRoot":"","sources":["../../src/common/create-psql-index-helper.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,8BAA8B,CAAC,EAY9C;QAXC,IAAI,UAAA,EACJ,SAAS,eAAA,EACT,OAAO,aAAA,EACP,IAAI,UAAA,EACJ,KAAK,WAAA;IAQL,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAC/D,IAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,iBAAU,IAAI,CAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC5C,IAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,iBAAU,KAAK,CAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAEjD,OAAO,qCAA8B,IAAI,iBAAO,SAAS,SAAG,OAAO,eAAK,OAAO,cAAI,UAAU,CAAE,CAAA;AACjG,CAAC;AAlBD,wEAkBC"}
@@ -3,6 +3,7 @@ export * from "./build-query";
3
3
  export * from "./camel-to-snake-case";
4
4
  export * from "./container";
5
5
  export * from "./create-container-like";
6
+ export * from "./create-psql-index-helper";
6
7
  export * from "./deduplicate";
7
8
  export * from "./deep-equal-obj";
8
9
  export * from "./errors";
@@ -19,6 +19,7 @@ __exportStar(require("./build-query"), exports);
19
19
  __exportStar(require("./camel-to-snake-case"), exports);
20
20
  __exportStar(require("./container"), exports);
21
21
  __exportStar(require("./create-container-like"), exports);
22
+ __exportStar(require("./create-psql-index-helper"), exports);
22
23
  __exportStar(require("./deduplicate"), exports);
23
24
  __exportStar(require("./deep-equal-obj"), exports);
24
25
  __exportStar(require("./errors"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,gDAA6B;AAC7B,wDAAqC;AACrC,8CAA2B;AAC3B,0DAAuC;AACvC,gDAA6B;AAC7B,mDAAgC;AAChC,2CAAwB;AACxB,uDAAoC;AACpC,+DAA4C;AAC5C,oDAAiC;AACjC,6DAA0C;AAC1C,gFAA6D;AAC7D,6CAA0B;AAC1B,mEAAgD;AAChD,4CAAyB;AACzB,+CAA4B;AAC5B,6CAA0B;AAC1B,8CAA2B;AAC3B,+CAA4B;AAC5B,8CAA2B;AAC3B,qDAAkC;AAClC,kDAA+B;AAC/B,qDAAkC;AAClC,4DAAyC;AACzC,0DAAuC;AACvC,gEAA6C;AAC7C,2DAAwC;AACxC,8CAA2B;AAC3B,gDAA6B;AAC7B,oEAAiD;AACjD,kEAA+C;AAC/C,oDAAiC;AACjC,mEAAgD;AAChD,iDAA8B;AAC9B,gDAA6B;AAC7B,2DAAwC;AACxC,qEAAkD;AAClD,uDAAoC;AACpC,kDAA+B;AAC/B,kDAA+B;AAC/B,mDAAgC;AAChC,gDAA6B;AAC7B,qDAAkC;AAClC,iDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,gDAA6B;AAC7B,wDAAqC;AACrC,8CAA2B;AAC3B,0DAAuC;AACvC,6DAA0C;AAC1C,gDAA6B;AAC7B,mDAAgC;AAChC,2CAAwB;AACxB,uDAAoC;AACpC,+DAA4C;AAC5C,oDAAiC;AACjC,6DAA0C;AAC1C,gFAA6D;AAC7D,6CAA0B;AAC1B,mEAAgD;AAChD,4CAAyB;AACzB,+CAA4B;AAC5B,6CAA0B;AAC1B,8CAA2B;AAC3B,+CAA4B;AAC5B,8CAA2B;AAC3B,qDAAkC;AAClC,kDAA+B;AAC/B,qDAAkC;AAClC,4DAAyC;AACzC,0DAAuC;AACvC,gEAA6C;AAC7C,2DAAwC;AACxC,8CAA2B;AAC3B,gDAA6B;AAC7B,oEAAiD;AACjD,kEAA+C;AAC/C,oDAAiC;AACjC,mEAAgD;AAChD,iDAA8B;AAC9B,gDAA6B;AAC7B,2DAAwC;AACxC,qEAAkD;AAClD,uDAAoC;AACpC,kDAA+B;AAC/B,kDAA+B;AAC/B,mDAAgC;AAChC,gDAA6B;AAC7B,qDAAkC;AAClC,iDAA8B"}
@@ -1,4 +1,6 @@
1
1
  import { ModuleServiceInitializeOptions } from "@medusajs/types";
2
+ import { TSMigrationGenerator } from "@mikro-orm/migrations";
3
+ export { TSMigrationGenerator };
2
4
  export declare function mikroOrmCreateConnection(database: ModuleServiceInitializeOptions["database"] & {
3
5
  connection?: any;
4
6
  }, entities: any[], pathToMigrations: string): Promise<import("@mikro-orm/core").MikroORM<import("@mikro-orm/postgresql").PostgreSqlDriver>>;
@@ -59,7 +59,55 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
59
59
  }
60
60
  };
61
61
  Object.defineProperty(exports, "__esModule", { value: true });
62
- exports.mikroOrmCreateConnection = void 0;
62
+ exports.mikroOrmCreateConnection = exports.TSMigrationGenerator = void 0;
63
+ var migrations_1 = require("@mikro-orm/migrations");
64
+ Object.defineProperty(exports, "TSMigrationGenerator", { enumerable: true, get: function () { return migrations_1.TSMigrationGenerator; } });
65
+ var common_1 = require("../../common");
66
+ // Monkey patch due to the compilation version issue which prevents us from creating a proper class that extends the TSMigrationGenerator
67
+ var originalCreateStatement = migrations_1.TSMigrationGenerator.prototype.createStatement;
68
+ /**
69
+ * Safe migration generation for MikroORM
70
+ *
71
+ * @param sql The sql statement
72
+ * @param padLeft The padding
73
+ *
74
+ * @example see test file
75
+ */
76
+ migrations_1.TSMigrationGenerator.prototype.createStatement = function (sql, padLeft) {
77
+ if ((0, common_1.isString)(sql)) {
78
+ if (!sql.includes("create table if not exists")) {
79
+ sql = sql.replace("create table", "create table if not exists");
80
+ }
81
+ if (!sql.includes("alter table if exists")) {
82
+ sql = sql.replace("alter table", "alter table if exists");
83
+ }
84
+ if (!sql.includes("create index if not exists")) {
85
+ sql = sql.replace("create index", "create index if not exists");
86
+ }
87
+ if (!sql.includes("drop index if exists")) {
88
+ sql = sql.replace("drop index", "drop index if exists");
89
+ }
90
+ if (!sql.includes("create unique index if not exists")) {
91
+ sql = sql.replace("create unique index", "create unique index if not exists");
92
+ }
93
+ if (!sql.includes("drop unique index if exists")) {
94
+ sql = sql.replace("drop unique index", "drop unique index if exists");
95
+ }
96
+ if (!sql.includes("add column if not exists")) {
97
+ sql = sql.replace("add column", "add column if not exists");
98
+ }
99
+ if (!sql.includes("alter column if exists exists")) {
100
+ sql = sql.replace("alter column", "alter column if exists");
101
+ }
102
+ if (!sql.includes("drop column if exists")) {
103
+ sql = sql.replace("drop column", "drop column if exists");
104
+ }
105
+ if (!sql.includes("drop constraint if exists")) {
106
+ sql = sql.replace("drop constraint", "drop constraint if exists");
107
+ }
108
+ }
109
+ return originalCreateStatement(sql, padLeft);
110
+ };
63
111
  function mikroOrmCreateConnection(database, entities, pathToMigrations) {
64
112
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
65
113
  return __awaiter(this, void 0, void 0, function () {
@@ -95,6 +143,7 @@ function mikroOrmCreateConnection(database, entities, pathToMigrations) {
95
143
  type: "postgresql",
96
144
  migrations: {
97
145
  path: pathToMigrations,
146
+ generator: migrations_1.TSMigrationGenerator,
98
147
  },
99
148
  pool: database.pool,
100
149
  })];
@@ -1 +1 @@
1
- {"version":3,"file":"mikro-orm-create-connection.js","sourceRoot":"","sources":["../../../src/dal/mikro-orm/mikro-orm-create-connection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAsB,wBAAwB,CAC5C,QAA2E,EAC3E,QAAe,EACf,gBAAwB;;;;;;;oBAEpB,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAA;oBAEpC,aAAa,GAAG,MAAA,QAAQ,CAAC,aAAa,mCAAI;wBAC5C,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;qBAC1B,CAAA;oBAEG,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAA;oBAElC,IAAI,QAAQ,CAAC,UAAU,EAAE;wBACvB,oCAAoC;wBACpC,qGAAqG;wBACrG,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAA;wBACnC,SAAS;4BACP,MAAA,MAAA,MAAA,MAAA,QAAQ,CAAC,UAAU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C7C,QAAQ,UAAA;4BACR,KAAK,EAAE,MAAA,MAAA,QAAQ,CAAC,KAAK,mCAAI,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,0CAAE,UAAU,CAAC,KAAK,CAAC,mCAAI,KAAK;4BACzE,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;4BACtB,SAAS,WAAA;4BACT,MAAM,QAAA;4BACN,aAAa,eAAA;4BACb,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,aAAa;4BAC7C,IAAI,EAAE,YAAY;4BAClB,UAAU,EAAE;gCACV,IAAI,EAAE,gBAAgB;gCACtB,SAAS,EAAE,iCAAoB;6BAChC;4BACD,IAAI,EAAE,QAAQ,CAAC,IAAW;yBAC3B,CAAC,EAAA;wBAfF,sBAAO,SAeL,EAAA;;;;CACH;AAvCD,4DAuCC"}
@@ -0,0 +1,6 @@
1
+ export declare enum GeoZoneType {
2
+ COUNTRY = "country",
3
+ PROVINCE = "province",
4
+ CITY = "city",
5
+ ZIP = "zip"
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeoZoneType = void 0;
4
+ var GeoZoneType;
5
+ (function (GeoZoneType) {
6
+ GeoZoneType["COUNTRY"] = "country";
7
+ GeoZoneType["PROVINCE"] = "province";
8
+ GeoZoneType["CITY"] = "city";
9
+ GeoZoneType["ZIP"] = "zip";
10
+ })(GeoZoneType || (exports.GeoZoneType = GeoZoneType = {}));
11
+ //# sourceMappingURL=geo-zone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-zone.js","sourceRoot":"","sources":["../../src/fulfillment/geo-zone.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,0BAAW,CAAA;AACb,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB"}
@@ -0,0 +1,2 @@
1
+ export * from "./geo-zone";
2
+ export * from "./shipping-options";
@@ -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("./geo-zone"), exports);
18
+ __exportStar(require("./shipping-options"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fulfillment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,qDAAkC"}
@@ -0,0 +1,4 @@
1
+ export declare enum ShippingOptionPriceType {
2
+ CALCULATED = "calculated",
3
+ FLAT = "flat"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShippingOptionPriceType = void 0;
4
+ var ShippingOptionPriceType;
5
+ (function (ShippingOptionPriceType) {
6
+ ShippingOptionPriceType["CALCULATED"] = "calculated";
7
+ ShippingOptionPriceType["FLAT"] = "flat";
8
+ })(ShippingOptionPriceType || (exports.ShippingOptionPriceType = ShippingOptionPriceType = {}));
9
+ //# sourceMappingURL=shipping-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-options.js","sourceRoot":"","sources":["../../src/fulfillment/shipping-options.ts"],"names":[],"mappings":";;;AAAA,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,oDAAyB,CAAA;IACzB,wCAAa,CAAA;AACf,CAAC,EAHW,uBAAuB,uCAAvB,uBAAuB,QAGlC"}
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./defaults";
7
7
  export * from "./event-bus";
8
8
  export * from "./exceptions";
9
9
  export * from "./feature-flags";
10
+ export * from "./fulfillment";
10
11
  export * from "./modules-sdk";
11
12
  export * from "./orchestration";
12
13
  export * from "./payment";
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __exportStar(require("./defaults"), exports);
24
24
  __exportStar(require("./event-bus"), exports);
25
25
  __exportStar(require("./exceptions"), exports);
26
26
  __exportStar(require("./feature-flags"), exports);
27
+ __exportStar(require("./fulfillment"), exports);
27
28
  __exportStar(require("./modules-sdk"), exports);
28
29
  __exportStar(require("./orchestration"), exports);
29
30
  __exportStar(require("./payment"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,4CAAyB;AACzB,2CAAwB;AACxB,wCAAqB;AACrB,+CAA4B;AAC5B,6CAA0B;AAC1B,8CAA2B;AAC3B,+CAA4B;AAC5B,kDAA+B;AAC/B,gDAA6B;AAC7B,kDAA+B;AAC/B,4CAAyB;AACzB,4CAAyB;AACzB,4CAAyB;AACzB,8CAA2B;AAC3B,2CAAwB;AACxB,6CAA0B;AAEb,QAAA,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,4CAAyB;AACzB,2CAAwB;AACxB,wCAAqB;AACrB,+CAA4B;AAC5B,6CAA0B;AAC1B,8CAA2B;AAC3B,+CAA4B;AAC5B,kDAA+B;AAC/B,gDAA6B;AAC7B,gDAA6B;AAC7B,kDAA+B;AAC/B,4CAAyB;AACzB,4CAAyB;AACzB,4CAAyB;AACzB,8CAA2B;AAC3B,2CAAwB;AACxB,6CAA0B;AAEb,QAAA,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/utils",
3
- "version": "1.11.5",
3
+ "version": "1.11.6-next-20240209091945",
4
4
  "description": "Medusa utilities functions shared by Medusa core and Modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "typescript": "^5.1.6"
31
31
  },
32
32
  "dependencies": {
33
- "@medusajs/types": "^1.11.12",
33
+ "@medusajs/types": "1.11.13-next-20240209091945",
34
34
  "@mikro-orm/core": "5.9.7",
35
35
  "@mikro-orm/migrations": "5.9.7",
36
36
  "@mikro-orm/postgresql": "5.9.7",