@aurispec/core-backend 1.0.35 → 1.0.36

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.
@@ -102,7 +102,6 @@ export declare const CONFIGS: {
102
102
  };
103
103
  };
104
104
  export * from "./cloudinary";
105
- export * from "./cors";
106
105
  export * from "./logger";
107
106
  export * from "./mailing";
108
107
  export * from "./plans";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/configs/index.ts"],"names":[],"mappings":"AAMA,aAAK,eAAe;IAChB,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,IAAI,SAAO;IACX,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,cAAc,mBAAiB;IAC/B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,qBAAqB,0BAA0B;IAC/C,qBAAqB,0BAA0B;IAC/C,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,iBAAiB,sBAAsB;IACvC,qBAAqB,0BAA0B;IAC/C,qBAAqB,0BAA0B;IAC/C,kBAAkB,uBAAuB;IACzC,qBAAqB,0BAA0B;CAClD;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAQnD;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgCwC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DjE,CAAA;AA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AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
@@ -161,7 +161,6 @@ exports.CONFIGS = {
161
161
  },
162
162
  };
163
163
  __exportStar(require("./cloudinary"), exports);
164
- __exportStar(require("./cors"), exports);
165
164
  __exportStar(require("./logger"), exports);
166
165
  __exportStar(require("./mailing"), exports);
167
166
  __exportStar(require("./plans"), exports);
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class ModifiedSubscriptionsTable1775485199278 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1775485199278-modified_subscriptions_table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1775485199278-modified_subscriptions_table.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1775485199278-modified_subscriptions_table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,uCAAwC,YAAW,kBAAkB;IAC9E,IAAI,SAA4C;IAEnC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7D"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModifiedSubscriptionsTable1775485199278 = void 0;
4
+ class ModifiedSubscriptionsTable1775485199278 {
5
+ name = 'ModifiedSubscriptionsTable1775485199278';
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "subscription_histories" ADD CONSTRAINT "FK_7053f51c2b4a69f80781e5370de" FOREIGN KEY ("plan_id") REFERENCES "plans"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
8
+ }
9
+ async down(queryRunner) {
10
+ await queryRunner.query(`ALTER TABLE "subscription_histories" DROP CONSTRAINT "FK_7053f51c2b4a69f80781e5370de"`);
11
+ }
12
+ }
13
+ exports.ModifiedSubscriptionsTable1775485199278 = ModifiedSubscriptionsTable1775485199278;
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureModel.d.ts","sourceRoot":"","sources":["../../src/models/FeatureModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,qBACa,YAAa,SAAQ,SAAS;IAEzC,IAAI,EAAG,MAAM,CAAC;IAGd,IAAI,EAAG,MAAM,CAAC;IAOd,MAAM,EAAG,MAAM,CAAC;IAShB,WAAW,EAAG,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"FeatureModel.d.ts","sourceRoot":"","sources":["../../src/models/FeatureModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,qBACa,YAAa,SAAQ,SAAS;IAEzC,IAAI,EAAG,MAAM,CAAC;IAGd,IAAI,EAAG,MAAM,CAAC;IAOd,MAAM,EAAG,MAAM,CAAC;IAGhB,WAAW,EAAG,MAAM,CAAC;CACtB"}
@@ -17,11 +17,6 @@ let FeatureModel = class FeatureModel extends BaseModel_1.BaseModel {
17
17
  name;
18
18
  code;
19
19
  status;
20
- // @Column({
21
- // type: "enum",
22
- // enum: FEATURE_TYPE,
23
- // })
24
- // type!: FEATURE_TYPE;
25
20
  description;
26
21
  };
27
22
  exports.FeatureModel = FeatureModel;
@@ -2,6 +2,7 @@ import { UserModel } from "./UserModel";
2
2
  import { PlanFeatureModel } from "./PlanFeatureModel";
3
3
  import { BaseModel } from "./BaseModel";
4
4
  import { STATUS } from "../common/enums";
5
+ import { SubscriptionHistoryModel } from "./SubscriptionHistoryModel";
5
6
  export declare class PlanModel extends BaseModel {
6
7
  name: string;
7
8
  monthly: string;
@@ -14,5 +15,6 @@ export declare class PlanModel extends BaseModel {
14
15
  stripe_yearly_plan_code?: string;
15
16
  users: UserModel[];
16
17
  planFeatures: PlanFeatureModel[];
18
+ subscription_history?: SubscriptionHistoryModel[];
17
19
  }
18
20
  //# sourceMappingURL=PlanModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlanModel.d.ts","sourceRoot":"","sources":["../../src/models/PlanModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAO,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,qBAEa,SAAU,SAAQ,SAAS;IAEtC,IAAI,EAAG,MAAM,CAAC;IAGd,OAAO,EAAG,MAAM,CAAC;IAGjB,MAAM,EAAG,MAAM,CAAC;IAGhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,QAAQ,EAAG,MAAM,CAAC;IAOlB,MAAM,EAAG,MAAM,CAAC;IAGhB,WAAW,EAAG,MAAM,CAAC;IAGrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAGlC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAGjC,KAAK,EAAG,SAAS,EAAE,CAAC;IAGpB,YAAY,EAAG,gBAAgB,EAAE,CAAC;CACnC"}
1
+ {"version":3,"file":"PlanModel.d.ts","sourceRoot":"","sources":["../../src/models/PlanModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAO,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,qBAEa,SAAU,SAAQ,SAAS;IAEtC,IAAI,EAAG,MAAM,CAAC;IAGd,OAAO,EAAG,MAAM,CAAC;IAGjB,MAAM,EAAG,MAAM,CAAC;IAGhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,QAAQ,EAAG,MAAM,CAAC;IAOlB,MAAM,EAAG,MAAM,CAAC;IAGhB,WAAW,EAAG,MAAM,CAAC;IAGrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAGlC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAGjC,KAAK,EAAG,SAAS,EAAE,CAAC;IAGpB,YAAY,EAAG,gBAAgB,EAAE,CAAC;IAUhC,oBAAoB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACrD"}
@@ -15,6 +15,7 @@ const UserModel_1 = require("./UserModel");
15
15
  const PlanFeatureModel_1 = require("./PlanFeatureModel");
16
16
  const BaseModel_1 = require("./BaseModel");
17
17
  const enums_1 = require("../common/enums");
18
+ const SubscriptionHistoryModel_1 = require("./SubscriptionHistoryModel");
18
19
  let PlanModel = class PlanModel extends BaseModel_1.BaseModel {
19
20
  name;
20
21
  monthly;
@@ -27,6 +28,7 @@ let PlanModel = class PlanModel extends BaseModel_1.BaseModel {
27
28
  stripe_yearly_plan_code;
28
29
  users;
29
30
  planFeatures;
31
+ subscription_history;
30
32
  };
31
33
  exports.PlanModel = PlanModel;
32
34
  __decorate([
@@ -77,6 +79,13 @@ __decorate([
77
79
  (0, typeorm_1.OneToMany)(() => PlanFeatureModel_1.PlanFeatureModel, (pf) => pf.plan, { eager: true }),
78
80
  __metadata("design:type", Array)
79
81
  ], PlanModel.prototype, "planFeatures", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.OneToMany)(() => SubscriptionHistoryModel_1.SubscriptionHistoryModel, (subscription) => subscription.user, {
84
+ onDelete: "SET NULL",
85
+ onUpdate: "CASCADE",
86
+ }),
87
+ __metadata("design:type", Array)
88
+ ], PlanModel.prototype, "subscription_history", void 0);
80
89
  exports.PlanModel = PlanModel = __decorate([
81
90
  (0, typeorm_1.Entity)({ name: "plans" }),
82
91
  (0, typeorm_1.Index)(["stripe_monthly_plan_code", "stripe_yearly_plan_code"])
@@ -1,6 +1,7 @@
1
1
  import { BaseModel } from "./BaseModel";
2
2
  import { PAYMENT_PROVIDER, RENEWAL_FREQUENCY, SUBSCRIPTION_STATUS } from "../common/enums";
3
3
  import { UserModel } from "./UserModel";
4
+ import { PlanModel } from "./PlanModel";
4
5
  export declare class SubscriptionHistoryModel extends BaseModel {
5
6
  amount: number;
6
7
  plan_id: number;
@@ -15,5 +16,6 @@ export declare class SubscriptionHistoryModel extends BaseModel {
15
16
  payment_provider: PAYMENT_PROVIDER;
16
17
  metadata?: any;
17
18
  user: UserModel;
19
+ plan: PlanModel;
18
20
  }
19
21
  //# sourceMappingURL=SubscriptionHistoryModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionHistoryModel.d.ts","sourceRoot":"","sources":["../../src/models/SubscriptionHistoryModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAEa,wBAAyB,SAAQ,SAAS;IAErD,MAAM,EAAG,MAAM,CAAC;IAGhB,OAAO,EAAG,MAAM,CAAC;IAGjB,OAAO,EAAG,MAAM,CAAC;IAGjB,WAAW,EAAG,MAAM,CAAC;IAGrB,uBAAuB,EAAG,MAAM,CAAC;IAMjC,MAAM,EAAG,mBAAmB,CAAC;IAM7B,aAAa,EAAG,iBAAiB,CAAC;IAGlC,iBAAiB,EAAG,MAAM,CAAC;IAG3B,UAAU,EAAG,IAAI,CAAC;IAGlB,SAAS,EAAG,IAAI,CAAC;IAMjB,gBAAgB,EAAG,gBAAgB,CAAC;IAGpC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAIf,IAAI,EAAG,SAAS,CAAC;CAClB"}
1
+ {"version":3,"file":"SubscriptionHistoryModel.d.ts","sourceRoot":"","sources":["../../src/models/SubscriptionHistoryModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAEa,wBAAyB,SAAQ,SAAS;IAErD,MAAM,EAAG,MAAM,CAAC;IAGhB,OAAO,EAAG,MAAM,CAAC;IAGjB,OAAO,EAAG,MAAM,CAAC;IAGjB,WAAW,EAAG,MAAM,CAAC;IAGrB,uBAAuB,EAAG,MAAM,CAAC;IAMjC,MAAM,EAAG,mBAAmB,CAAC;IAM7B,aAAa,EAAG,iBAAiB,CAAC;IAGlC,iBAAiB,EAAG,MAAM,CAAC;IAG3B,UAAU,EAAG,IAAI,CAAC;IAGlB,SAAS,EAAG,IAAI,CAAC;IAMjB,gBAAgB,EAAG,gBAAgB,CAAC;IAGpC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAIf,IAAI,EAAG,SAAS,CAAC;IAIjB,IAAI,EAAG,SAAS,CAAC;CAClB"}
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
15
  const enums_1 = require("../common/enums");
16
16
  const UserModel_1 = require("./UserModel");
17
+ const PlanModel_1 = require("./PlanModel");
17
18
  let SubscriptionHistoryModel = class SubscriptionHistoryModel extends BaseModel_1.BaseModel {
18
19
  amount;
19
20
  plan_id;
@@ -28,6 +29,7 @@ let SubscriptionHistoryModel = class SubscriptionHistoryModel extends BaseModel_
28
29
  payment_provider;
29
30
  metadata;
30
31
  user;
32
+ plan;
31
33
  };
32
34
  exports.SubscriptionHistoryModel = SubscriptionHistoryModel;
33
35
  __decorate([
@@ -92,6 +94,11 @@ __decorate([
92
94
  (0, typeorm_1.JoinColumn)({ name: "user_id" }),
93
95
  __metadata("design:type", UserModel_1.UserModel)
94
96
  ], SubscriptionHistoryModel.prototype, "user", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.ManyToOne)(() => PlanModel_1.PlanModel, (plan) => plan.subscription_history),
99
+ (0, typeorm_1.JoinColumn)({ name: "plan_id" }),
100
+ __metadata("design:type", PlanModel_1.PlanModel)
101
+ ], SubscriptionHistoryModel.prototype, "plan", void 0);
95
102
  exports.SubscriptionHistoryModel = SubscriptionHistoryModel = __decorate([
96
103
  (0, typeorm_1.Entity)({ name: "subscription_histories" }),
97
104
  (0, typeorm_1.Index)(["user_id", "plan_id", "subscription_payment_id"])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurispec/core-backend",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "description": "Auri spectrum's backend core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",