@sgftech/medusa-plugin-marketplace-v2 0.1.26

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.
Files changed (222) hide show
  1. package/.babelrc.js +12 -0
  2. package/.eslintrc.js +68 -0
  3. package/.vscode/settings.json +2 -0
  4. package/.yarnrc.yml +1 -0
  5. package/README.md +70 -0
  6. package/SECURITY.md +21 -0
  7. package/data/seed-onboarding.json +141 -0
  8. package/data/seed.json +1006 -0
  9. package/dist/api/middlewares/authenticate-user.d.ts +15 -0
  10. package/dist/api/middlewares/authenticate-user.js +212 -0
  11. package/dist/api/middlewares/authenticate-user.js.map +1 -0
  12. package/dist/api/middlewares/logged-in-user-v2.d.ts +3 -0
  13. package/dist/api/middlewares/logged-in-user-v2.js +69 -0
  14. package/dist/api/middlewares/logged-in-user-v2.js.map +1 -0
  15. package/dist/api/middlewares/logged-in-user.d.ts +1 -0
  16. package/dist/api/middlewares/logged-in-user.js +18 -0
  17. package/dist/api/middlewares/logged-in-user.js.map +1 -0
  18. package/dist/api/routes/admin/create-product.d.ts +1 -0
  19. package/dist/api/routes/admin/create-product.js +19 -0
  20. package/dist/api/routes/admin/create-product.js.map +1 -0
  21. package/dist/api/routes/admin/create-store.d.ts +1 -0
  22. package/dist/api/routes/admin/create-store.js +19 -0
  23. package/dist/api/routes/admin/create-store.js.map +1 -0
  24. package/dist/api/routes/admin/create-user.d.ts +1 -0
  25. package/dist/api/routes/admin/create-user.js +19 -0
  26. package/dist/api/routes/admin/create-user.js.map +1 -0
  27. package/dist/index.d.ts +0 -0
  28. package/dist/index.js +1 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/migrations/1629000000000-create-workflow-table.d.ts +5 -0
  31. package/dist/migrations/1629000000000-create-workflow-table.js +29 -0
  32. package/dist/migrations/1629000000000-create-workflow-table.js.map +1 -0
  33. package/dist/migrations/1629000000001-workflow-table-stage.d.ts +5 -0
  34. package/dist/migrations/1629000000001-workflow-table-stage.js +48 -0
  35. package/dist/migrations/1629000000001-workflow-table-stage.js.map +1 -0
  36. package/dist/migrations/1632467997443-workflow-requests.d.ts +5 -0
  37. package/dist/migrations/1632467997443-workflow-requests.js +48 -0
  38. package/dist/migrations/1632467997443-workflow-requests.js.map +1 -0
  39. package/dist/migrations/1632468000000-update-workflow-keys-table.d.ts +5 -0
  40. package/dist/migrations/1632468000000-update-workflow-keys-table.js +31 -0
  41. package/dist/migrations/1632468000000-update-workflow-keys-table.js.map +1 -0
  42. package/dist/migrations/1632470000000-add-approvers-to-workflow-stage.d.ts +5 -0
  43. package/dist/migrations/1632470000000-add-approvers-to-workflow-stage.js +52 -0
  44. package/dist/migrations/1632470000000-add-approvers-to-workflow-stage.js.map +1 -0
  45. package/dist/migrations/1632471000000-update-user-table-for-approvers.d.ts +5 -0
  46. package/dist/migrations/1632471000000-update-user-table-for-approvers.js +43 -0
  47. package/dist/migrations/1632471000000-update-user-table-for-approvers.js.map +1 -0
  48. package/dist/migrations/1632472000000-update-workflow-request-table-for-approvals.d.ts +5 -0
  49. package/dist/migrations/1632472000000-update-workflow-request-table-for-approvals.js +43 -0
  50. package/dist/migrations/1632472000000-update-workflow-request-table-for-approvals.js.map +1 -0
  51. package/dist/migrations/1632473000000-create-approval-table.d.ts +5 -0
  52. package/dist/migrations/1632473000000-create-approval-table.js +54 -0
  53. package/dist/migrations/1632473000000-create-approval-table.js.map +1 -0
  54. package/dist/migrations/1652101349791-order.migration.d.ts +6 -0
  55. package/dist/migrations/1652101349791-order.migration.js +26 -0
  56. package/dist/migrations/1652101349791-order.migration.js.map +1 -0
  57. package/dist/migrations/1655123458263-invite.migration.d.ts +6 -0
  58. package/dist/migrations/1655123458263-invite.migration.js +23 -0
  59. package/dist/migrations/1655123458263-invite.migration.js.map +1 -0
  60. package/dist/migrations/1655131148363-role.migration.d.ts +6 -0
  61. package/dist/migrations/1655131148363-role.migration.js +32 -0
  62. package/dist/migrations/1655131148363-role.migration.js.map +1 -0
  63. package/dist/migrations/1655131601491-permission.migration.d.ts +6 -0
  64. package/dist/migrations/1655131601491-permission.migration.js +47 -0
  65. package/dist/migrations/1655131601491-permission.migration.js.map +1 -0
  66. package/dist/migrations/1655132360987-user.migration.d.ts +6 -0
  67. package/dist/migrations/1655132360987-user.migration.js +29 -0
  68. package/dist/migrations/1655132360987-user.migration.js.map +1 -0
  69. package/dist/migrations/1666588571522-user.migration.d.ts +6 -0
  70. package/dist/migrations/1666588571522-user.migration.js +27 -0
  71. package/dist/migrations/1666588571522-user.migration.js.map +1 -0
  72. package/dist/migrations/1666588577183-store.migration.d.ts +6 -0
  73. package/dist/migrations/1666588577183-store.migration.js +26 -0
  74. package/dist/migrations/1666588577183-store.migration.js.map +1 -0
  75. package/dist/migrations/1667045765051-customer.migration.d.ts +6 -0
  76. package/dist/migrations/1667045765051-customer.migration.js +33 -0
  77. package/dist/migrations/1667045765051-customer.migration.js.map +1 -0
  78. package/dist/migrations/1683175918497-add-user-stores.migration.d.ts +6 -0
  79. package/dist/migrations/1683175918497-add-user-stores.migration.js +60 -0
  80. package/dist/migrations/1683175918497-add-user-stores.migration.js.map +1 -0
  81. package/dist/migrations/1683177500538-add-product-store-id.migration.d.ts +6 -0
  82. package/dist/migrations/1683177500538-add-product-store-id.migration.js +53 -0
  83. package/dist/migrations/1683177500538-add-product-store-id.migration.js.map +1 -0
  84. package/dist/migrations/address.migration.d.ts +6 -0
  85. package/dist/migrations/address.migration.js +25 -0
  86. package/dist/migrations/address.migration.js.map +1 -0
  87. package/dist/migrations/product.migration.d.ts +6 -0
  88. package/dist/migrations/product.migration.js +21 -0
  89. package/dist/migrations/product.migration.js.map +1 -0
  90. package/dist/migrations/stage-status.d.ts +5 -0
  91. package/dist/migrations/stage-status.js +22 -0
  92. package/dist/migrations/stage-status.js.map +1 -0
  93. package/dist/migrations/user.migration.d.ts +6 -0
  94. package/dist/migrations/user.migration.js +21 -0
  95. package/dist/migrations/user.migration.js.map +1 -0
  96. package/dist/models/address.d.ts +3 -0
  97. package/dist/models/address.js +18 -0
  98. package/dist/models/address.js.map +1 -0
  99. package/dist/models/customer.d.ts +9 -0
  100. package/dist/models/customer.js +49 -0
  101. package/dist/models/customer.js.map +1 -0
  102. package/dist/models/invite.d.ts +6 -0
  103. package/dist/models/invite.js +32 -0
  104. package/dist/models/invite.js.map +1 -0
  105. package/dist/models/order.d.ts +9 -0
  106. package/dist/models/order.js +48 -0
  107. package/dist/models/order.js.map +1 -0
  108. package/dist/models/permission.d.ts +8 -0
  109. package/dist/models/permission.js +56 -0
  110. package/dist/models/permission.js.map +1 -0
  111. package/dist/models/product.d.ts +5 -0
  112. package/dist/models/product.js +43 -0
  113. package/dist/models/product.js.map +1 -0
  114. package/dist/models/role.d.ts +12 -0
  115. package/dist/models/role.js +68 -0
  116. package/dist/models/role.js.map +1 -0
  117. package/dist/models/setting.d.ts +69 -0
  118. package/dist/models/setting.js +46 -0
  119. package/dist/models/setting.js.map +1 -0
  120. package/dist/models/store.d.ts +15 -0
  121. package/dist/models/store.js +85 -0
  122. package/dist/models/store.js.map +1 -0
  123. package/dist/models/user.d.ts +15 -0
  124. package/dist/models/user.js +76 -0
  125. package/dist/models/user.js.map +1 -0
  126. package/dist/models/workflow-approval.d.ts +8 -0
  127. package/dist/models/workflow-approval.js +37 -0
  128. package/dist/models/workflow-approval.js.map +1 -0
  129. package/dist/models/workflow-requests.d.ts +9 -0
  130. package/dist/models/workflow-requests.js +42 -0
  131. package/dist/models/workflow-requests.js.map +1 -0
  132. package/dist/models/workflow-stage.d.ts +8 -0
  133. package/dist/models/workflow-stage.js +38 -0
  134. package/dist/models/workflow-stage.js.map +1 -0
  135. package/dist/models/workflow.d.ts +8 -0
  136. package/dist/models/workflow.js +37 -0
  137. package/dist/models/workflow.js.map +1 -0
  138. package/dist/repositories/address.d.ts +7 -0
  139. package/dist/repositories/address.js +11 -0
  140. package/dist/repositories/address.js.map +1 -0
  141. package/dist/repositories/currency.d.ts +7 -0
  142. package/dist/repositories/currency.js +11 -0
  143. package/dist/repositories/currency.js.map +1 -0
  144. package/dist/repositories/customer.d.ts +12 -0
  145. package/dist/repositories/customer.js +11 -0
  146. package/dist/repositories/customer.js.map +1 -0
  147. package/dist/repositories/invite.d.ts +7 -0
  148. package/dist/repositories/invite.js +11 -0
  149. package/dist/repositories/invite.js.map +1 -0
  150. package/dist/repositories/order.d.ts +9 -0
  151. package/dist/repositories/order.js +11 -0
  152. package/dist/repositories/order.js.map +1 -0
  153. package/dist/repositories/permission.d.ts +3 -0
  154. package/dist/repositories/permission.js +8 -0
  155. package/dist/repositories/permission.js.map +1 -0
  156. package/dist/repositories/product.d.ts +43 -0
  157. package/dist/repositories/product.js +11 -0
  158. package/dist/repositories/product.js.map +1 -0
  159. package/dist/repositories/role.d.ts +3 -0
  160. package/dist/repositories/role.js +8 -0
  161. package/dist/repositories/role.js.map +1 -0
  162. package/dist/repositories/store.d.ts +7 -0
  163. package/dist/repositories/store.js +11 -0
  164. package/dist/repositories/store.js.map +1 -0
  165. package/dist/repositories/user.d.ts +7 -0
  166. package/dist/repositories/user.js +11 -0
  167. package/dist/repositories/user.js.map +1 -0
  168. package/dist/services/currency.d.ts +24 -0
  169. package/dist/services/currency.js +49 -0
  170. package/dist/services/currency.js.map +1 -0
  171. package/dist/services/customer.d.ts +34 -0
  172. package/dist/services/customer.js +137 -0
  173. package/dist/services/customer.js.map +1 -0
  174. package/dist/services/process-constant.d.ts +17 -0
  175. package/dist/services/process-constant.js +27 -0
  176. package/dist/services/process-constant.js.map +1 -0
  177. package/dist/services/product.d.ts +121 -0
  178. package/dist/services/product.js +382 -0
  179. package/dist/services/product.js.map +1 -0
  180. package/dist/services/region.d.ts +42 -0
  181. package/dist/services/region.js +190 -0
  182. package/dist/services/region.js.map +1 -0
  183. package/dist/services/store.d.ts +98 -0
  184. package/dist/services/store.js +607 -0
  185. package/dist/services/store.js.map +1 -0
  186. package/dist/services/user.d.ts +74 -0
  187. package/dist/services/user.js +356 -0
  188. package/dist/services/user.js.map +1 -0
  189. package/dist/services/workflow-request.d.ts +14 -0
  190. package/dist/services/workflow-request.js +100 -0
  191. package/dist/services/workflow-request.js.map +1 -0
  192. package/dist/services/workflow-stage.d.ts +19 -0
  193. package/dist/services/workflow-stage.js +46 -0
  194. package/dist/services/workflow-stage.js.map +1 -0
  195. package/dist/services/workflow.d.ts +22 -0
  196. package/dist/services/workflow.js +108 -0
  197. package/dist/services/workflow.js.map +1 -0
  198. package/dist/subscribers/customer.d.ts +5 -0
  199. package/dist/subscribers/customer.js +20 -0
  200. package/dist/subscribers/customer.js.map +1 -0
  201. package/dist/subscribers/product.d.ts +11 -0
  202. package/dist/subscribers/product.js +30 -0
  203. package/dist/subscribers/product.js.map +1 -0
  204. package/dist/subscribers/store.d.ts +25 -0
  205. package/dist/subscribers/store.js +54 -0
  206. package/dist/subscribers/store.js.map +1 -0
  207. package/dist/subscribers/user.d.ts +16 -0
  208. package/dist/subscribers/user.js +62 -0
  209. package/dist/subscribers/user.js.map +1 -0
  210. package/dist/types/global.d.ts +1 -0
  211. package/dist/types/global.js +3 -0
  212. package/dist/types/global.js.map +1 -0
  213. package/dist/types/oidc-types.d.ts +13 -0
  214. package/dist/types/oidc-types.js +3 -0
  215. package/dist/types/oidc-types.js.map +1 -0
  216. package/index.js +50 -0
  217. package/package.json +105 -0
  218. package/tsconfig.admin.json +8 -0
  219. package/tsconfig.json +33 -0
  220. package/tsconfig.server.json +8 -0
  221. package/tsconfig.spec.json +5 -0
  222. package/yarn-error.log +12869 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1632468000000-update-workflow-keys-table.js","sourceRoot":"","sources":["../../src/migrations/1632468000000-update-workflow-keys-table.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,qCAKiB;AAEjB,MAAa,gCAAgC;IAClC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,yDAAyD;QACzD,MAAM,WAAW,CAAC,SAAS,CACvB,UAAU,EACV,IAAI,qBAAW,CAAC;YACZ,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,IAAI;SACnB,CAAC,CACL,CAAC;QAEF,wEAAwE;QACxE,MAAM,WAAW,CAAC,gBAAgB,CAC9B,UAAU,EACV,IAAI,yBAAe,CAAC;YAChB,WAAW,EAAE,CAAC,mBAAmB,CAAC;YAClC,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,kBAAkB;YACvC,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,SAAS,CAAC,6CAA6C;SACpE,CAAC,CACL,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,kCAAkC;QAClC,MAAM,WAAW,CAAC,cAAc,CAC5B,UAAU,EACV,6BAA6B,CAChC,CAAC;QAEF,8DAA8D;QAC9D,MAAM,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;IAClE,CAAC;CACJ;AAnCD,4EAmCC"}
@@ -0,0 +1,5 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class AddApproversToWorkflowStage1632470000000 implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddApproversToWorkflowStage1632470000000 = void 0;
4
+ /* eslint-disable require-jsdoc */
5
+ const typeorm_1 = require("typeorm");
6
+ class AddApproversToWorkflowStage1632470000000 {
7
+ async up(queryRunner) {
8
+ // Add the 'approvers' column to the workflow_stage table
9
+ await queryRunner.addColumn("workflow_stage", new typeorm_1.TableColumn({
10
+ name: "approvers",
11
+ type: "uuid",
12
+ isArray: true,
13
+ default: "ARRAY[]::uuid[]" // Initialize as an empty array
14
+ }));
15
+ // Create a junction table for the Many-to-Many relationship between WorkflowStage and User
16
+ await queryRunner.createTable(new typeorm_1.Table({
17
+ name: "workflow_stage_approvers_user",
18
+ columns: [
19
+ {
20
+ name: "workflow_stage_id",
21
+ type: "varchar"
22
+ },
23
+ {
24
+ name: "user_id",
25
+ type: "varchar"
26
+ }
27
+ ],
28
+ foreignKeys: [
29
+ {
30
+ columnNames: ["workflow_stage_id"],
31
+ referencedColumnNames: ["id"],
32
+ referencedTableName: "workflow_stage",
33
+ onDelete: "CASCADE"
34
+ },
35
+ {
36
+ columnNames: ["user_id"],
37
+ referencedColumnNames: ["id"],
38
+ referencedTableName: "user",
39
+ onDelete: "CASCADE"
40
+ }
41
+ ]
42
+ }), true);
43
+ }
44
+ async down(queryRunner) {
45
+ // Drop the 'approvers' column from the workflow_stage table
46
+ await queryRunner.dropColumn("workflow_stage", "approvers");
47
+ // Drop the junction table
48
+ await queryRunner.dropTable("workflow_stage_approvers_user");
49
+ }
50
+ }
51
+ exports.AddApproversToWorkflowStage1632470000000 = AddApproversToWorkflowStage1632470000000;
52
+ //# sourceMappingURL=1632470000000-add-approvers-to-workflow-stage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1632470000000-add-approvers-to-workflow-stage.js","sourceRoot":"","sources":["../../src/migrations/1632470000000-add-approvers-to-workflow-stage.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,qCAA8E;AAE9E,MAAa,wCAAwC;IAG1C,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,yDAAyD;QACzD,MAAM,WAAW,CAAC,SAAS,CACvB,gBAAgB,EAChB,IAAI,qBAAW,CAAC;YACZ,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,iBAAiB,CAAC,+BAA+B;SAC7D,CAAC,CACL,CAAC;QAEF,2FAA2F;QAC3F,MAAM,WAAW,CAAC,WAAW,CACzB,IAAI,eAAK,CAAC;YACN,IAAI,EAAE,+BAA+B;YACrC,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,mBAAmB;oBACzB,IAAI,EAAE,SAAS;iBAClB;gBACD;oBACI,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,SAAS;iBAClB;aACJ;YACD,WAAW,EAAE;gBACT;oBACI,WAAW,EAAE,CAAC,mBAAmB,CAAC;oBAClC,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,mBAAmB,EAAE,gBAAgB;oBACrC,QAAQ,EAAE,SAAS;iBACtB;gBACD;oBACI,WAAW,EAAE,CAAC,SAAS,CAAC;oBACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,mBAAmB,EAAE,MAAM;oBAC3B,QAAQ,EAAE,SAAS;iBACtB;aACJ;SACJ,CAAC,EACF,IAAI,CACP,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,4DAA4D;QAC5D,MAAM,WAAW,CAAC,UAAU,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;QAE5D,0BAA0B;QAC1B,MAAM,WAAW,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;IACjE,CAAC;CACJ;AAvDD,4FAuDC"}
@@ -0,0 +1,5 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class UpdateUserTableForApprovers1632471000000 implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateUserTableForApprovers1632471000000 = void 0;
4
+ /* eslint-disable require-jsdoc */
5
+ const typeorm_1 = require("typeorm");
6
+ class UpdateUserTableForApprovers1632471000000 {
7
+ async up(queryRunner) {
8
+ // Create a junction table for the Many-to-Many relationship between User and WorkflowStage (approvers)
9
+ await queryRunner.createTable(new typeorm_1.Table({
10
+ name: "user_approvers_workflow_stage",
11
+ columns: [
12
+ {
13
+ name: "user_id",
14
+ type: "varchar"
15
+ },
16
+ {
17
+ name: "workflow_stage_id",
18
+ type: "varchar"
19
+ }
20
+ ],
21
+ foreignKeys: [
22
+ {
23
+ columnNames: ["user_id"],
24
+ referencedColumnNames: ["id"],
25
+ referencedTableName: "user",
26
+ onDelete: "CASCADE"
27
+ },
28
+ {
29
+ columnNames: ["workflow_stage_id"],
30
+ referencedColumnNames: ["id"],
31
+ referencedTableName: "workflow_stage",
32
+ onDelete: "CASCADE"
33
+ }
34
+ ]
35
+ }), true);
36
+ }
37
+ async down(queryRunner) {
38
+ // Drop the junction table for the Many-to-Many relationship
39
+ await queryRunner.dropTable("user_approvers_workflow_stage");
40
+ }
41
+ }
42
+ exports.UpdateUserTableForApprovers1632471000000 = UpdateUserTableForApprovers1632471000000;
43
+ //# sourceMappingURL=1632471000000-update-user-table-for-approvers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1632471000000-update-user-table-for-approvers.js","sourceRoot":"","sources":["../../src/migrations/1632471000000-update-user-table-for-approvers.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,qCAAiE;AAEjE,MAAa,wCAAwC;IAG1C,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,uGAAuG;QACvG,MAAM,WAAW,CAAC,WAAW,CACzB,IAAI,eAAK,CAAC;YACN,IAAI,EAAE,+BAA+B;YACrC,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,SAAS;iBAClB;gBACD;oBACI,IAAI,EAAE,mBAAmB;oBACzB,IAAI,EAAE,SAAS;iBAClB;aACJ;YACD,WAAW,EAAE;gBACT;oBACI,WAAW,EAAE,CAAC,SAAS,CAAC;oBACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,mBAAmB,EAAE,MAAM;oBAC3B,QAAQ,EAAE,SAAS;iBACtB;gBACD;oBACI,WAAW,EAAE,CAAC,mBAAmB,CAAC;oBAClC,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,mBAAmB,EAAE,gBAAgB;oBACrC,QAAQ,EAAE,SAAS;iBACtB;aACJ;SACJ,CAAC,EACF,IAAI,CACP,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,4DAA4D;QAC5D,MAAM,WAAW,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;IACjE,CAAC;CACJ;AAzCD,4FAyCC"}
@@ -0,0 +1,5 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class UpdateWorkflowRequestTableForApprovals1632472000000 implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateWorkflowRequestTableForApprovals1632472000000 = void 0;
4
+ /* eslint-disable require-jsdoc */
5
+ const typeorm_1 = require("typeorm");
6
+ class UpdateWorkflowRequestTableForApprovals1632472000000 {
7
+ async up(queryRunner) {
8
+ // Create a junction table for the Many-to-Many relationship between WorkflowRequest and User (approvals)
9
+ await queryRunner.createTable(new typeorm_1.Table({
10
+ name: "workflow_request_approvals_user",
11
+ columns: [
12
+ {
13
+ name: "workflow_request_id",
14
+ type: "varchar"
15
+ },
16
+ {
17
+ name: "user_id",
18
+ type: "varchar"
19
+ }
20
+ ],
21
+ foreignKeys: [
22
+ {
23
+ columnNames: ["workflow_request_id"],
24
+ referencedColumnNames: ["id"],
25
+ referencedTableName: "workflow_request",
26
+ onDelete: "CASCADE"
27
+ },
28
+ {
29
+ columnNames: ["user_id"],
30
+ referencedColumnNames: ["id"],
31
+ referencedTableName: "user",
32
+ onDelete: "CASCADE"
33
+ }
34
+ ]
35
+ }), true);
36
+ }
37
+ async down(queryRunner) {
38
+ // Drop the junction table for the Many-to-Many relationship
39
+ await queryRunner.dropTable("workflow_request_approvals_user");
40
+ }
41
+ }
42
+ exports.UpdateWorkflowRequestTableForApprovals1632472000000 = UpdateWorkflowRequestTableForApprovals1632472000000;
43
+ //# sourceMappingURL=1632472000000-update-workflow-request-table-for-approvals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1632472000000-update-workflow-request-table-for-approvals.js","sourceRoot":"","sources":["../../src/migrations/1632472000000-update-workflow-request-table-for-approvals.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,qCAAiE;AAEjE,MAAa,mDAAmD;IAGrD,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,yGAAyG;QACzG,MAAM,WAAW,CAAC,WAAW,CACzB,IAAI,eAAK,CAAC;YACN,IAAI,EAAE,iCAAiC;YACvC,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,qBAAqB;oBAC3B,IAAI,EAAE,SAAS;iBAClB;gBACD;oBACI,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,SAAS;iBAClB;aACJ;YACD,WAAW,EAAE;gBACT;oBACI,WAAW,EAAE,CAAC,qBAAqB,CAAC;oBACpC,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,mBAAmB,EAAE,kBAAkB;oBACvC,QAAQ,EAAE,SAAS;iBACtB;gBACD;oBACI,WAAW,EAAE,CAAC,SAAS,CAAC;oBACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,mBAAmB,EAAE,MAAM;oBAC3B,QAAQ,EAAE,SAAS;iBACtB;aACJ;SACJ,CAAC,EACF,IAAI,CACP,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,4DAA4D;QAC5D,MAAM,WAAW,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;IACnE,CAAC;CACJ;AAzCD,kHAyCC"}
@@ -0,0 +1,5 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class CreateApprovalTable1632473000000 implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateApprovalTable1632473000000 = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ /* eslint-disable require-jsdoc */
6
+ class CreateApprovalTable1632473000000 {
7
+ async up(queryRunner) {
8
+ // Create the approval table
9
+ await queryRunner.createTable(new typeorm_1.Table({
10
+ name: "approval",
11
+ columns: [
12
+ {
13
+ name: "id",
14
+ type: "varchar",
15
+ isPrimary: true
16
+ },
17
+ {
18
+ name: "comment",
19
+ type: "text"
20
+ },
21
+ {
22
+ name: "requestId",
23
+ type: "varchar"
24
+ },
25
+ {
26
+ name: "userId",
27
+ type: "varchar"
28
+ }
29
+ ]
30
+ }), true);
31
+ // Create foreign key constraints
32
+ await queryRunner.createForeignKey("approval", new typeorm_1.TableForeignKey({
33
+ columnNames: ["requestId"],
34
+ referencedColumnNames: ["id"],
35
+ referencedTableName: "workflow_request",
36
+ onDelete: "CASCADE"
37
+ }));
38
+ await queryRunner.createForeignKey("approval", new typeorm_1.TableForeignKey({
39
+ columnNames: ["userId"],
40
+ referencedColumnNames: ["id"],
41
+ referencedTableName: "user",
42
+ onDelete: "CASCADE"
43
+ }));
44
+ }
45
+ async down(queryRunner) {
46
+ // Drop foreign key constraints
47
+ await queryRunner.dropForeignKey("approval", "FK_Approval_Request");
48
+ await queryRunner.dropForeignKey("approval", "FK_Approval_User");
49
+ // Drop the approval table
50
+ await queryRunner.dropTable("approval");
51
+ }
52
+ }
53
+ exports.CreateApprovalTable1632473000000 = CreateApprovalTable1632473000000;
54
+ //# sourceMappingURL=1632473000000-create-approval-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1632473000000-create-approval-table.js","sourceRoot":"","sources":["../../src/migrations/1632473000000-create-approval-table.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AACjB,kCAAkC;AAClC,MAAa,gCAAgC;IAClC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,4BAA4B;QAC5B,MAAM,WAAW,CAAC,WAAW,CACzB,IAAI,eAAK,CAAC;YACN,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,SAAS;oBACf,SAAS,EAAE,IAAI;iBAClB;gBACD;oBACI,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,MAAM;iBACf;gBACD;oBACI,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;iBAClB;gBACD;oBACI,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,SAAS;iBAClB;aACJ;SACJ,CAAC,EACF,IAAI,CACP,CAAC;QAEF,iCAAiC;QACjC,MAAM,WAAW,CAAC,gBAAgB,CAC9B,UAAU,EACV,IAAI,yBAAe,CAAC;YAChB,WAAW,EAAE,CAAC,WAAW,CAAC;YAC1B,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,kBAAkB;YACvC,QAAQ,EAAE,SAAS;SACtB,CAAC,CACL,CAAC;QAEF,MAAM,WAAW,CAAC,gBAAgB,CAC9B,UAAU,EACV,IAAI,yBAAe,CAAC;YAChB,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,MAAM;YAC3B,QAAQ,EAAE,SAAS;SACtB,CAAC,CACL,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,+BAA+B;QAC/B,MAAM,WAAW,CAAC,cAAc,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC;QACpE,MAAM,WAAW,CAAC,cAAc,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;QAEjE,0BAA0B;QAC1B,MAAM,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;CACJ;AA3DD,4EA2DC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class OrderMigration1652101349791 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderMigration1652101349791 = void 0;
4
+ class OrderMigration1652101349791 {
5
+ constructor() {
6
+ this.name = "OrderMigration1652101349791";
7
+ }
8
+ async up(queryRunner) {
9
+ const query = `
10
+ ALTER TABLE public."order" ADD COLUMN IF NOT EXISTS "store_id" text;
11
+ ALTER TABLE public."order" ADD COLUMN IF NOT EXISTS "order_parent_id" text;
12
+ ALTER TABLE public."order" ADD CONSTRAINT "FK_8a96dde86e3cad9d2fcc6cb171f87" FOREIGN KEY ("order_parent_id") REFERENCES "order"("id") ON DELETE CASCADE ON UPDATE CASCADE;
13
+ `;
14
+ await queryRunner.query(query);
15
+ }
16
+ async down(queryRunner) {
17
+ const query = `
18
+ ALTER TABLE public."order" DROP COLUMN "store_id";
19
+ ALTER TABLE public."order" DROP COLUMN "order_parent_id";
20
+ ALTER TABLE public."order" DROP FOREIGN KEY "FK_8a96dde86e3cad9d2fcc6cb171f87cb2";
21
+ `;
22
+ await queryRunner.query(query);
23
+ }
24
+ }
25
+ exports.OrderMigration1652101349791 = OrderMigration1652101349791;
26
+ //# sourceMappingURL=1652101349791-order.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1652101349791-order.migration.js","sourceRoot":"","sources":["../../src/migrations/1652101349791-order.migration.ts"],"names":[],"mappings":";;;AAGA,MAAa,2BAA2B;IAAxC;QACI,SAAI,GAAG,6BAA6B,CAAC;IAmBzC,CAAC;IAjBU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,KAAK,GAAG;;;;SAIb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,KAAK,GAAG;;;;SAIb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ;AApBD,kEAoBC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class InviteMigration1655123458263 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InviteMigration1655123458263 = void 0;
4
+ /* eslint-disable require-jsdoc */
5
+ class InviteMigration1655123458263 {
6
+ constructor() {
7
+ this.name = "InviteMigration1655123458263";
8
+ }
9
+ async up(queryRunner) {
10
+ const query = `
11
+ ALTER TABLE public."invite" ADD COLUMN IF NOT EXISTS "store_id" text;
12
+ `;
13
+ await queryRunner.query(query);
14
+ }
15
+ async down(queryRunner) {
16
+ const query = `
17
+ ALTER TABLE public."invite" DROP COLUMN "store_id";
18
+ `;
19
+ await queryRunner.query(query);
20
+ }
21
+ }
22
+ exports.InviteMigration1655123458263 = InviteMigration1655123458263;
23
+ //# sourceMappingURL=1655123458263-invite.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1655123458263-invite.migration.js","sourceRoot":"","sources":["../../src/migrations/1655123458263-invite.migration.ts"],"names":[],"mappings":";;;AAEA,kCAAkC;AAClC,MAAa,4BAA4B;IAAzC;QACI,SAAI,GAAG,8BAA8B,CAAC;IAe1C,CAAC;IAbU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,KAAK,GAAG;;SAEb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,KAAK,GAAG;;SAEb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ;AAhBD,oEAgBC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class RoleMigration1655131148363 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoleMigration1655131148363 = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ //
6
+ //
7
+ class RoleMigration1655131148363 {
8
+ constructor() {
9
+ this.name = "RoleMigration1655131148363";
10
+ }
11
+ async up(queryRunner) {
12
+ const query = `
13
+ CREATE TABLE "role" ("id" character varying NOT NULL,
14
+ "name" character varying NOT NULL, "store_id" character varying NOT NULL,
15
+ "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now())
16
+ `;
17
+ await queryRunner.query(query);
18
+ await queryRunner.createPrimaryKey("role", ["id"]);
19
+ await queryRunner.createForeignKey("role", new typeorm_1.TableForeignKey({
20
+ columnNames: ["store_id"],
21
+ referencedColumnNames: ["id"],
22
+ referencedTableName: "store",
23
+ onDelete: "CASCADE",
24
+ onUpdate: "CASCADE"
25
+ }));
26
+ }
27
+ async down(queryRunner) {
28
+ await queryRunner.dropTable("role", true);
29
+ }
30
+ }
31
+ exports.RoleMigration1655131148363 = RoleMigration1655131148363;
32
+ //# sourceMappingURL=1655131148363-role.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1655131148363-role.migration.js","sourceRoot":"","sources":["../../src/migrations/1655131148363-role.migration.ts"],"names":[],"mappings":";;;AAAA,qCAA2E;AAE3E,EAAE;AAEF,EAAE;AACF,MAAa,0BAA0B;IAAvC;QACI,SAAI,GAAG,4BAA4B,CAAC;IA0BxC,CAAC;IAxBU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,KAAK,GAAG;;;;SAIb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE/B,MAAM,WAAW,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QACnD,MAAM,WAAW,CAAC,gBAAgB,CAC9B,MAAM,EACN,IAAI,yBAAe,CAAC;YAChB,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,OAAO;YAC5B,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,SAAS;SACtB,CAAC,CACL,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;CACJ;AA3BD,gEA2BC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class PermissionMigration1655131601491 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PermissionMigration1655131601491 = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ //
6
+ //
7
+ class PermissionMigration1655131601491 {
8
+ constructor() {
9
+ this.name = "PermissionMigration1655131601491";
10
+ }
11
+ async up(queryRunner) {
12
+ let query = `
13
+ CREATE TABLE "permission" ("id" character varying NOT NULL,
14
+ "name" character varying NOT NULL, "metadata" jsonb,
15
+ "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now())`;
16
+ await queryRunner.query(query);
17
+ await queryRunner.createPrimaryKey("permission", ["id"]);
18
+ query = `
19
+ CREATE TABLE "role_permissions" ("role_id" character varying NOT NULL, "permission_id" character varying NOT NULL,
20
+ "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now())`;
21
+ await queryRunner.query(query);
22
+ await queryRunner.createPrimaryKey("role_permissions", [
23
+ "role_id",
24
+ "permission_id"
25
+ ]);
26
+ await queryRunner.createForeignKey("role_permissions", new typeorm_1.TableForeignKey({
27
+ columnNames: ["role_id"],
28
+ referencedColumnNames: ["id"],
29
+ referencedTableName: "role",
30
+ onDelete: "CASCADE",
31
+ onUpdate: "CASCADE"
32
+ }));
33
+ await queryRunner.createForeignKey("role_permissions", new typeorm_1.TableForeignKey({
34
+ columnNames: ["permission_id"],
35
+ referencedColumnNames: ["id"],
36
+ referencedTableName: "permission",
37
+ onDelete: "CASCADE",
38
+ onUpdate: "CASCADE"
39
+ }));
40
+ }
41
+ async down(queryRunner) {
42
+ await queryRunner.dropTable("role_permissions", true);
43
+ await queryRunner.dropTable("permission", true);
44
+ }
45
+ }
46
+ exports.PermissionMigration1655131601491 = PermissionMigration1655131601491;
47
+ //# sourceMappingURL=1655131601491-permission.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1655131601491-permission.migration.js","sourceRoot":"","sources":["../../src/migrations/1655131601491-permission.migration.ts"],"names":[],"mappings":";;;AAAA,qCAA2E;AAE3E,EAAE;AAEF,EAAE;AACF,MAAa,gCAAgC;IAA7C;QACI,SAAI,GAAG,kCAAkC,CAAC;IAiD9C,CAAC;IA/CU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,IAAI,KAAK,GAAG;;;oIAGgH,CAAC;QAC7H,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE/B,MAAM,WAAW,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAEzD,KAAK,GAAG;;oIAEoH,CAAC;QAE7H,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE/B,MAAM,WAAW,CAAC,gBAAgB,CAAC,kBAAkB,EAAE;YACnD,SAAS;YACT,eAAe;SAClB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,gBAAgB,CAC9B,kBAAkB,EAClB,IAAI,yBAAe,CAAC;YAChB,WAAW,EAAE,CAAC,SAAS,CAAC;YACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,MAAM;YAC3B,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,SAAS;SACtB,CAAC,CACL,CAAC;QAEF,MAAM,WAAW,CAAC,gBAAgB,CAC9B,kBAAkB,EAClB,IAAI,yBAAe,CAAC;YAChB,WAAW,EAAE,CAAC,eAAe,CAAC;YAC9B,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,YAAY;YACjC,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,SAAS;SACtB,CAAC,CACL,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QACtD,MAAM,WAAW,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACJ;AAlDD,4EAkDC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class UserMigration1655132360987 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserMigration1655132360987 = void 0;
4
+ /* eslint-disable require-jsdoc */
5
+ const typeorm_1 = require("typeorm");
6
+ //
7
+ class UserMigration1655132360987 {
8
+ constructor() {
9
+ this.name = "UserMigration1655132360987";
10
+ }
11
+ async up(queryRunner) {
12
+ const query = 'ALTER TABLE public."user" ADD COLUMN IF NOT EXISTS "role_id" text;';
13
+ await queryRunner.query(query);
14
+ await queryRunner.createForeignKey("user", new typeorm_1.TableForeignKey({
15
+ columnNames: ["role_id"],
16
+ referencedColumnNames: ["id"],
17
+ referencedTableName: "role",
18
+ onDelete: "CASCADE",
19
+ onUpdate: "CASCADE"
20
+ }));
21
+ }
22
+ // eslint-disable-next-line require-jsdoc
23
+ async down(queryRunner) {
24
+ const query = 'ALTER TABLE public."user" DROP COLUMN "role_id";';
25
+ await queryRunner.query(query);
26
+ }
27
+ }
28
+ exports.UserMigration1655132360987 = UserMigration1655132360987;
29
+ //# sourceMappingURL=1655132360987-user.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1655132360987-user.migration.js","sourceRoot":"","sources":["../../src/migrations/1655132360987-user.migration.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,qCAA2E;AAE3E,EAAE;AAEF,MAAa,0BAA0B;IAAvC;QACI,SAAI,GAAG,4BAA4B,CAAC;IAwBxC,CAAC;IAtBU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,KAAK,GACP,oEAAoE,CAAC;QACzE,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE/B,MAAM,WAAW,CAAC,gBAAgB,CAC9B,MAAM,EACN,IAAI,yBAAe,CAAC;YAChB,WAAW,EAAE,CAAC,SAAS,CAAC;YACxB,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,MAAM;YAC3B,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,SAAS;SACtB,CAAC,CACL,CAAC;IACN,CAAC;IAED,yCAAyC;IAClC,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,KAAK,GAAG,kDAAkD,CAAC;QACjE,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ;AAzBD,gEAyBC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class UserMigration1666588571522 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserMigration1666588571522 = void 0;
4
+ //
5
+ //
6
+ class UserMigration1666588571522 {
7
+ constructor() {
8
+ this.name = "UserMigration1666588571522";
9
+ }
10
+ async up(queryRunner) {
11
+ const query = `ALTER TABLE public."user" ADD COLUMN IF NOT EXISTS "external_provider_id" text;
12
+ ALTER TABLE public."user" ADD COLUMN IF NOT EXISTS "external_user_id" text;
13
+ ALTER TABLE public."user" ADD COLUMN IF NOT EXISTS "external_account_id" text;
14
+ ALTER TABLE public."user" ADD CONSTRAINT unique_emails UNIQUE (email)
15
+ `;
16
+ await queryRunner.query(query);
17
+ }
18
+ async down(queryRunner) {
19
+ const query = `ALTER TABLE public."user" DROP CONSTRAINT unique_emails;
20
+ ALTER TABLE public."user" DROP COLUMN "external_provider_id";
21
+ ALTER TABLE public."user" DROP COLUMN "external_user_id";
22
+ ALTER TABLE public."user" DROP COLUMN "external_account_id";`;
23
+ await queryRunner.query(query);
24
+ }
25
+ }
26
+ exports.UserMigration1666588571522 = UserMigration1666588571522;
27
+ //# sourceMappingURL=1666588571522-user.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1666588571522-user.migration.js","sourceRoot":"","sources":["../../src/migrations/1666588571522-user.migration.ts"],"names":[],"mappings":";;;AACA,EAAE;AAEF,EAAE;AACF,MAAa,0BAA0B;IAAvC;QACI,SAAI,GAAG,4BAA4B,CAAC;IAoBxC,CAAC;IAlBU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,KAAK,GAAG;;;;SAIb,CAAC;QAEF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,KAAK,GAAG;;;qEAG+C,CAAC;QAE9D,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ;AArBD,gEAqBC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class StoreMigration1666588577183 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StoreMigration1666588577183 = void 0;
4
+ //
5
+ //
6
+ class StoreMigration1666588577183 {
7
+ constructor() {
8
+ this.name = "StoreMigration1666588577183";
9
+ }
10
+ async up(queryRunner) {
11
+ const query = `ALTER TABLE public."store" ADD COLUMN IF NOT EXISTS "external_provider_id" text;
12
+ ALTER TABLE public."store" ADD COLUMN IF NOT EXISTS "external_user_id" text;
13
+ ALTER TABLE public."store" ADD COLUMN IF NOT EXISTS "external_account_id" text;
14
+ ALTER TABLE public."store" ADD CONSTRAINT unique_external_store_account UNIQUE (id,external_account_id,external_provider_id);
15
+ `;
16
+ await queryRunner.query(query);
17
+ }
18
+ async down(queryRunner) {
19
+ const query = `ALTER TABLE public."store" DROP CONSTRAINT unique_external_store_account;
20
+ ALTER TABLE public."store" DROP COLUMN "external_user_id";
21
+ ALTER TABLE public."store" DROP COLUMN "external_account_id";`;
22
+ await queryRunner.query(query);
23
+ }
24
+ }
25
+ exports.StoreMigration1666588577183 = StoreMigration1666588577183;
26
+ //# sourceMappingURL=1666588577183-store.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1666588577183-store.migration.js","sourceRoot":"","sources":["../../src/migrations/1666588577183-store.migration.ts"],"names":[],"mappings":";;;AACA,EAAE;AAEF,EAAE;AACF,MAAa,2BAA2B;IAAxC;QACI,SAAI,GAAG,6BAA6B,CAAC;IAkBzC,CAAC;IAhBU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,KAAK,GAAG;;;;SAIb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,KAAK,GAAG;;sEAEgD,CAAC;QAE/D,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ;AAnBD,kEAmBC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class CustomerMigration1667045765051 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerMigration1667045765051 = void 0;
4
+ //
5
+ //
6
+ class CustomerMigration1667045765051 {
7
+ constructor() {
8
+ this.name = "CustomerMigration1667045765051";
9
+ }
10
+ async up(queryRunner) {
11
+ const query = `ALTER TABLE public."customer" ADD COLUMN IF NOT EXISTS "external_provider_id" text;
12
+ ALTER TABLE public."customer" ADD COLUMN IF NOT EXISTS "external_customer_id" text;
13
+ ALTER TABLE public."customer" ADD COLUMN IF NOT EXISTS "external_account_id" text;
14
+ ALTER TABLE public."customer" ADD CONSTRAINT unique_external_customer_account UNIQUE (external_customer_id,external_account_id,external_provider_id);
15
+ ALTER TABLE public."customer" ADD COLUMN IF NOT EXISTS "crm_id" text;
16
+ ALTER TABLE public."customer" ADD COLUMN IF NOT EXISTS "otp" text;
17
+ ALTER TABLE public."customer" ADD COLUMN IF NOT EXISTS "otpExpiry" text;`;
18
+ await queryRunner.query(query);
19
+ }
20
+ async down(queryRunner) {
21
+ const query = `ALTER TABLE public."store" DROP CONSTRAINT unique_external_customer_account;
22
+ ALTER TABLE public."customer" DROP COLUMN "external_customer_id";
23
+ ALTER TABLE public."customer" DROP COLUMN "external_account_id";
24
+ ALTER TABLE public."customer" DROP COLUMN "external_provider_id";
25
+ ALTER TABLE public."customer" DROP COLUMN "crm_id";
26
+ ALTER TABLE public."customer" DROP COLUMN "otp";
27
+ ALTER TABLE public."customer" DROP COLUMN IF NOT EXISTS "otpExpiry" text;
28
+ `;
29
+ await queryRunner.query(query);
30
+ }
31
+ }
32
+ exports.CustomerMigration1667045765051 = CustomerMigration1667045765051;
33
+ //# sourceMappingURL=1667045765051-customer.migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1667045765051-customer.migration.js","sourceRoot":"","sources":["../../src/migrations/1667045765051-customer.migration.ts"],"names":[],"mappings":";;;AACA,EAAE;AAEF,EAAE;AACF,MAAa,8BAA8B;IAA3C;QACI,SAAI,GAAG,gCAAgC,CAAC;IAwB5C,CAAC;IAtBU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,KAAK,GAAG;;;;;;iFAM2D,CAAC;QAC1E,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,KAAK,GAAG;;;;;;;SAOb,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ;AAzBD,wEAyBC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class AddUserStores1683175918500 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }