@medusajs/region 0.1.2-snapshot-20240718073308 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/dist/index.d.ts +4 -36
  2. package/dist/index.js +19 -9
  3. package/dist/initialize/index.d.ts +4 -0
  4. package/dist/initialize/index.js +17 -0
  5. package/dist/joiner-config.d.ts +8 -0
  6. package/dist/joiner-config.js +33 -0
  7. package/dist/loaders/connection.d.ts +4 -0
  8. package/dist/loaders/connection.js +41 -0
  9. package/dist/loaders/container.d.ts +2 -0
  10. package/dist/loaders/container.js +34 -0
  11. package/dist/loaders/defaults.d.ts +0 -1
  12. package/dist/loaders/defaults.js +3 -2
  13. package/dist/loaders/index.d.ts +2 -1
  14. package/dist/loaders/index.js +2 -0
  15. package/dist/migrations/{Migration20240205173216.d.ts → RegionModuleSetup20240205173216.d.ts} +0 -1
  16. package/dist/migrations/{Migration20240205173216.js → RegionModuleSetup20240205173216.js} +1 -1
  17. package/dist/models/country.d.ts +10 -166
  18. package/dist/models/country.js +62 -20
  19. package/dist/models/index.d.ts +0 -1
  20. package/dist/models/region.d.ts +19 -111
  21. package/dist/models/region.js +89 -8
  22. package/dist/module-definition.d.ts +4 -0
  23. package/dist/module-definition.js +51 -0
  24. package/dist/repositories/index.d.ts +1 -0
  25. package/dist/repositories/index.js +5 -0
  26. package/dist/scripts/bin/run-seed.d.ts +3 -0
  27. package/dist/scripts/bin/run-seed.js +50 -0
  28. package/dist/scripts/seed-utils.d.ts +4 -0
  29. package/dist/scripts/seed-utils.js +12 -0
  30. package/dist/services/index.d.ts +0 -1
  31. package/dist/services/region-module.d.ts +17 -22
  32. package/dist/services/region-module.js +20 -35
  33. package/dist/types/index.d.ts +0 -1
  34. package/package.json +14 -8
  35. package/dist/index.d.ts.map +0 -1
  36. package/dist/loaders/defaults.d.ts.map +0 -1
  37. package/dist/loaders/index.d.ts.map +0 -1
  38. package/dist/migrations/Migration20240205173216.d.ts.map +0 -1
  39. package/dist/migrations/Migration20240624200006.d.ts +0 -6
  40. package/dist/migrations/Migration20240624200006.d.ts.map +0 -1
  41. package/dist/migrations/Migration20240624200006.js +0 -19
  42. package/dist/models/country.d.ts.map +0 -1
  43. package/dist/models/index.d.ts.map +0 -1
  44. package/dist/models/region.d.ts.map +0 -1
  45. package/dist/services/index.d.ts.map +0 -1
  46. package/dist/services/region-module.d.ts.map +0 -1
  47. package/dist/types/index.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/region",
3
- "version": "0.1.2-snapshot-20240718073308",
3
+ "version": "0.1.2",
4
4
  "description": "Medusa Region module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,10 @@
8
8
  "dist"
9
9
  ],
10
10
  "engines": {
11
- "node": ">=20"
11
+ "node": ">=16"
12
+ },
13
+ "bin": {
14
+ "medusa-region-seed": "dist/scripts/bin/run-seed.js"
12
15
  },
13
16
  "repository": {
14
17
  "type": "git",
@@ -34,22 +37,25 @@
34
37
  "orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
35
38
  },
36
39
  "devDependencies": {
37
- "@medusajs/modules-sdk": "1.13.0-snapshot-20240718073308",
38
- "@medusajs/types": "1.12.0-snapshot-20240718073308",
39
40
  "@mikro-orm/cli": "5.9.7",
40
41
  "cross-env": "^5.2.1",
41
- "jest": "^29.7.0",
42
- "medusa-test-utils": "1.1.45-snapshot-20240718073308",
42
+ "jest": "^29.6.3",
43
+ "medusa-test-utils": "workspace:^",
43
44
  "rimraf": "^3.0.2",
45
+ "ts-jest": "^29.1.1",
44
46
  "ts-node": "^10.9.1",
45
47
  "tsc-alias": "^1.8.6",
46
48
  "typescript": "^5.1.6"
47
49
  },
48
50
  "dependencies": {
49
- "@medusajs/utils": "1.12.0-snapshot-20240718073308",
51
+ "@medusajs/modules-sdk": "^1.12.12",
52
+ "@medusajs/types": "^1.11.17",
53
+ "@medusajs/utils": "^1.11.10",
50
54
  "@mikro-orm/core": "5.9.7",
51
55
  "@mikro-orm/migrations": "5.9.7",
52
56
  "@mikro-orm/postgresql": "5.9.7",
53
- "awilix": "^8.0.0"
57
+ "awilix": "^8.0.0",
58
+ "dotenv": "^16.4.5",
59
+ "knex": "2.4.2"
54
60
  }
55
61
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAU,OAAO,EAAE,MAAM,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjD,wBAGE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/loaders/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAA;wCAInC,aAAa,KAAG,QAAQ,IAAI,CAAC;AAAlE,wBAwBC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20240205173216.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240205173216.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,+BAAgC,SAAQ,SAAS;IACtD,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAuC1B"}
@@ -1,6 +0,0 @@
1
- import { Migration } from "@mikro-orm/migrations";
2
- export declare class Migration20240624200006 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
6
- //# sourceMappingURL=Migration20240624200006.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20240624200006.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240624200006.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAanB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAqB5B"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20240624200006 = void 0;
4
- const utils_1 = require("@medusajs/utils");
5
- const migrations_1 = require("@mikro-orm/migrations");
6
- class Migration20240624200006 extends migrations_1.Migration {
7
- async up() {
8
- this.addSql('ALTER TABLE IF EXISTS "region_country" ADD COLUMN IF NOT EXISTS "metadata" jsonb null, ADD COLUMN "created_at" timestamptz NOT NULL DEFAULT NOW(), ADD COLUMN "updated_at" timestamptz NOT NULL DEFAULT NOW(), ADD COLUMN "deleted_at" timestamptz NULL;');
9
- this.addSql((0, utils_1.generatePostgresAlterColummnIfExistStatement)("region_country", ["region_id"], `DROP NOT NULL`));
10
- }
11
- async down() {
12
- this.addSql('ALTER TABLE IF EXISTS "region_country" DROP COLUMN IF EXISTS "metadata";');
13
- this.addSql('ALTER TABLE IF EXISTS "region_country" DROP COLUMN IF EXISTS "created_at";');
14
- this.addSql('ALTER TABLE IF EXISTS "region_country" DROP COLUMN IF EXISTS "updated_at";');
15
- this.addSql('ALTER TABLE IF EXISTS "region_country" DROP COLUMN IF EXISTS "deleted_at";');
16
- this.addSql((0, utils_1.generatePostgresAlterColummnIfExistStatement)("region_country", ["region_id"], `SET NOT NULL`));
17
- }
18
- }
19
- exports.Migration20240624200006 = Migration20240624200006;
@@ -1 +0,0 @@
1
- {"version":3,"file":"country.d.ts","sourceRoot":"","sources":["../../src/models/country.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAsBI"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"region.d.ts","sourceRoot":"","sources":["../../src/models/region.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAOE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"region-module.d.ts","sourceRoot":"","sources":["../../src/services/region-module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,eAAe,EACf,GAAG,EACH,qBAAqB,EACrB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAA;AAaxB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAE1C,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,GAAG,CAAC,iBAAiB,CAAA;IACrC,aAAa,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAC1D,cAAc,EAAE,eAAe,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