@medusajs/link-modules 0.2.12-snapshot-20240703074611 → 0.2.12-snapshot-20240704061641

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ import { ModuleJoinerConfig } from "@medusajs/types";
2
+ export declare const OrderClaimPaymentCollection: ModuleJoinerConfig;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderClaimPaymentCollection = void 0;
4
+ const utils_1 = require("@medusajs/utils");
5
+ exports.OrderClaimPaymentCollection = {
6
+ serviceName: utils_1.LINKS.OrderClaimPaymentCollection,
7
+ isLink: true,
8
+ databaseConfig: {
9
+ tableName: "order_claim_payment_collection",
10
+ idPrefix: "claimpay",
11
+ },
12
+ alias: [
13
+ {
14
+ name: [
15
+ "order_claim_payment_collection",
16
+ "order_claim_payment_collections",
17
+ ],
18
+ args: {
19
+ entity: "LinkOrderClaimPaymentCollection",
20
+ },
21
+ },
22
+ ],
23
+ primaryKeys: ["id", "claim_id", "payment_collection_id"],
24
+ relationships: [
25
+ {
26
+ serviceName: utils_1.Modules.ORDER,
27
+ primaryKey: "id",
28
+ foreignKey: "claim_id",
29
+ alias: "order",
30
+ args: {
31
+ methodSuffix: "OrderClaims",
32
+ },
33
+ },
34
+ {
35
+ serviceName: utils_1.Modules.PAYMENT,
36
+ primaryKey: "id",
37
+ foreignKey: "payment_collection_id",
38
+ alias: "payment_collection",
39
+ args: {
40
+ methodSuffix: "PaymentCollections",
41
+ },
42
+ },
43
+ ],
44
+ extends: [
45
+ {
46
+ serviceName: utils_1.Modules.ORDER,
47
+ fieldAlias: {
48
+ claim_payment_collections: {
49
+ path: "claim_payment_collections_link.payment_collection",
50
+ isList: true,
51
+ },
52
+ },
53
+ relationship: {
54
+ serviceName: utils_1.LINKS.OrderClaimPaymentCollection,
55
+ primaryKey: "claim_id",
56
+ foreignKey: "id",
57
+ alias: "claim_payment_collections_link",
58
+ },
59
+ },
60
+ {
61
+ serviceName: utils_1.Modules.PAYMENT,
62
+ fieldAlias: {
63
+ claim: "order_claim_link.order",
64
+ },
65
+ relationship: {
66
+ serviceName: utils_1.LINKS.OrderClaimPaymentCollection,
67
+ primaryKey: "payment_collection_id",
68
+ foreignKey: "id",
69
+ alias: "order_claim_link",
70
+ },
71
+ },
72
+ ],
73
+ };
@@ -0,0 +1,2 @@
1
+ import { ModuleJoinerConfig } from "@medusajs/types";
2
+ export declare const OrderExchangePaymentCollection: ModuleJoinerConfig;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderExchangePaymentCollection = void 0;
4
+ const utils_1 = require("@medusajs/utils");
5
+ exports.OrderExchangePaymentCollection = {
6
+ serviceName: utils_1.LINKS.OrderExchangePaymentCollection,
7
+ isLink: true,
8
+ databaseConfig: {
9
+ tableName: "order_exchange_payment_collection",
10
+ idPrefix: "excpay",
11
+ },
12
+ alias: [
13
+ {
14
+ name: [
15
+ "order_exchange_payment_collection",
16
+ "order_exchange_payment_collections",
17
+ ],
18
+ args: {
19
+ entity: "LinkOrderExchangePaymentCollection",
20
+ },
21
+ },
22
+ ],
23
+ primaryKeys: ["id", "exchange_id", "payment_collection_id"],
24
+ relationships: [
25
+ {
26
+ serviceName: utils_1.Modules.ORDER,
27
+ primaryKey: "id",
28
+ foreignKey: "exchange_id",
29
+ alias: "order",
30
+ args: {
31
+ methodSuffix: "OrderExchanges",
32
+ },
33
+ },
34
+ {
35
+ serviceName: utils_1.Modules.PAYMENT,
36
+ primaryKey: "id",
37
+ foreignKey: "payment_collection_id",
38
+ alias: "payment_collection",
39
+ args: {
40
+ methodSuffix: "PaymentCollections",
41
+ },
42
+ },
43
+ ],
44
+ extends: [
45
+ {
46
+ serviceName: utils_1.Modules.ORDER,
47
+ fieldAlias: {
48
+ exchange_payment_collections: {
49
+ path: "exchange_payment_collections_link.payment_collection",
50
+ isList: true,
51
+ },
52
+ },
53
+ relationship: {
54
+ serviceName: utils_1.LINKS.OrderExchangePaymentCollection,
55
+ primaryKey: "exchange_id",
56
+ foreignKey: "id",
57
+ alias: "exchange_payment_collections_link",
58
+ },
59
+ },
60
+ {
61
+ serviceName: utils_1.Modules.PAYMENT,
62
+ fieldAlias: {
63
+ exchange: "order_exchange_link.order",
64
+ },
65
+ relationship: {
66
+ serviceName: utils_1.LINKS.OrderExchangePaymentCollection,
67
+ primaryKey: "payment_collection_id",
68
+ foreignKey: "id",
69
+ alias: "order_exchange_link",
70
+ },
71
+ },
72
+ ],
73
+ };
@@ -7,7 +7,7 @@ exports.OrderPaymentCollection = {
7
7
  isLink: true,
8
8
  databaseConfig: {
9
9
  tableName: "order_payment_collection",
10
- idPrefix: "capaycol",
10
+ idPrefix: "ordpay",
11
11
  },
12
12
  alias: [
13
13
  {
@@ -97,7 +97,7 @@ const initialize = async (options, modulesDefinition, injectedDependencies) => {
97
97
  key: serviceKey,
98
98
  registrationName: serviceKey,
99
99
  label: serviceKey,
100
- dependencies: [modules_sdk_1.ModuleRegistrationName.EVENT_BUS],
100
+ dependencies: [utils_1.ModuleRegistrationName.EVENT_BUS],
101
101
  defaultModuleDeclaration: {
102
102
  scope: modules_sdk_1.MODULE_SCOPE.INTERNAL,
103
103
  resources: injectedDependencies?.[utils_1.ContainerRegistrationKeys.PG_CONNECTION]
@@ -33,21 +33,24 @@ function getMigration(joinerConfig, serviceName, primary, foreign) {
33
33
  logger.info(`Link module "${serviceName}" migration executed`)
34
34
  } catch (error) {
35
35
  logger.error(
36
- `Link module "${serviceName}" migration failed to run - Error: ${error}`
36
+ `Link module "${serviceName}" migration failed to run - Error: ${error.errros ?? error}`
37
37
  )
38
38
  }
39
39
  } else {
40
40
  logger.info(`Skipping "${tableName}" migration.`)
41
41
  }*/
42
- logger.info(`Link module "${serviceName}" table update skipped because the table already exists. Please write your own migration if needed.`);
42
+ // Note: Temporarily skipping this for handling no logs on the CI. Bring this back if necessary.
43
+ // logger.info(
44
+ // `Link module('${serviceName}'): Table already exists. Write your own migration if needed.`
45
+ // )
43
46
  }
44
47
  else {
45
48
  try {
46
49
  await generator.createSchema();
47
- logger.info(`Link module "${serviceName}" migration executed`);
50
+ logger.info(`Link module('${serviceName}'): Migration executed`);
48
51
  }
49
52
  catch (error) {
50
- logger.error(`Link module "${serviceName}" migration failed to run - Error: ${error}`);
53
+ logger.error(`Link module('${serviceName}'): Migration failed - Error: ${error.errros ?? error}`);
51
54
  }
52
55
  }
53
56
  await orm.close();
@@ -67,7 +70,7 @@ function getRevertMigration(joinerConfig, serviceName, primary, foreign) {
67
70
  logger.info(`Link module "${serviceName}" migration executed`);
68
71
  }
69
72
  catch (error) {
70
- logger.error(`Link module "${serviceName}" migration failed to run - Error: ${error}`);
73
+ logger.error(`Link module "${serviceName}" migration failed to run - Error: ${error.errros ?? error}`);
71
74
  }
72
75
  await orm.close();
73
76
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/link-modules",
3
- "version": "0.2.12-snapshot-20240703074611",
3
+ "version": "0.2.12-snapshot-20240704061641",
4
4
  "description": "Medusa Default Link Modules Package and Definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "test:integration": "jest --passWithNoTests"
30
30
  },
31
31
  "devDependencies": {
32
- "@medusajs/types": "1.12.0-snapshot-20240703074611",
32
+ "@medusajs/types": "1.12.0-snapshot-20240704061641",
33
33
  "cross-env": "^5.2.1",
34
34
  "jest": "^29.7.0",
35
35
  "pg-god": "^1.0.12",
@@ -39,8 +39,8 @@
39
39
  "typescript": "^5.1.6"
40
40
  },
41
41
  "dependencies": {
42
- "@medusajs/modules-sdk": "1.13.0-snapshot-20240703074611",
43
- "@medusajs/utils": "1.12.0-snapshot-20240703074611",
42
+ "@medusajs/modules-sdk": "1.13.0-snapshot-20240704061641",
43
+ "@medusajs/utils": "1.12.0-snapshot-20240704061641",
44
44
  "@mikro-orm/core": "5.9.7",
45
45
  "@mikro-orm/postgresql": "5.9.7",
46
46
  "awilix": "^8.0.0"