@antelopejs/interface-dms-saas 0.0.1
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/LICENSE +190 -0
- package/README.md +51 -0
- package/dist/billing.d.ts +25 -0
- package/dist/billing.js +15 -0
- package/dist/billing.js.map +1 -0
- package/dist/data-api.d.ts +1 -0
- package/dist/data-api.js +6 -0
- package/dist/data-api.js.map +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.js +19 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/models/billingSettings.model.d.ts +22 -0
- package/dist/db/models/billingSettings.model.js +9 -0
- package/dist/db/models/billingSettings.model.js.map +1 -0
- package/dist/db/models/creditNotes.model.d.ts +25 -0
- package/dist/db/models/creditNotes.model.js +26 -0
- package/dist/db/models/creditNotes.model.js.map +1 -0
- package/dist/db/models/features.model.d.ts +22 -0
- package/dist/db/models/features.model.js +9 -0
- package/dist/db/models/features.model.js.map +1 -0
- package/dist/db/models/index.d.ts +19 -0
- package/dist/db/models/index.js +36 -0
- package/dist/db/models/index.js.map +1 -0
- package/dist/db/models/invoices.model.d.ts +29 -0
- package/dist/db/models/invoices.model.js +60 -0
- package/dist/db/models/invoices.model.js.map +1 -0
- package/dist/db/models/legalDocuments.model.d.ts +22 -0
- package/dist/db/models/legalDocuments.model.js +9 -0
- package/dist/db/models/legalDocuments.model.js.map +1 -0
- package/dist/db/models/planMigrations.model.d.ts +29 -0
- package/dist/db/models/planMigrations.model.js +70 -0
- package/dist/db/models/planMigrations.model.js.map +1 -0
- package/dist/db/models/plans.model.d.ts +31 -0
- package/dist/db/models/plans.model.js +74 -0
- package/dist/db/models/plans.model.js.map +1 -0
- package/dist/db/models/platformNotes.model.d.ts +33 -0
- package/dist/db/models/platformNotes.model.js +27 -0
- package/dist/db/models/platformNotes.model.js.map +1 -0
- package/dist/db/models/refunds.model.d.ts +23 -0
- package/dist/db/models/refunds.model.js +17 -0
- package/dist/db/models/refunds.model.js.map +1 -0
- package/dist/db/models/revision.d.ts +1 -0
- package/dist/db/models/revision.js +14 -0
- package/dist/db/models/revision.js.map +1 -0
- package/dist/db/models/segments.model.d.ts +29 -0
- package/dist/db/models/segments.model.js +81 -0
- package/dist/db/models/segments.model.js.map +1 -0
- package/dist/db/models/stripeWebhookEvents.model.d.ts +26 -0
- package/dist/db/models/stripeWebhookEvents.model.js +70 -0
- package/dist/db/models/stripeWebhookEvents.model.js.map +1 -0
- package/dist/db/models/supportMessages.model.d.ts +23 -0
- package/dist/db/models/supportMessages.model.js +17 -0
- package/dist/db/models/supportMessages.model.js.map +1 -0
- package/dist/db/models/supportTicketEvents.model.d.ts +22 -0
- package/dist/db/models/supportTicketEvents.model.js +9 -0
- package/dist/db/models/supportTicketEvents.model.js.map +1 -0
- package/dist/db/models/supportTickets.model.d.ts +25 -0
- package/dist/db/models/supportTickets.model.js +32 -0
- package/dist/db/models/supportTickets.model.js.map +1 -0
- package/dist/db/models/tenantBillingInfo.model.d.ts +24 -0
- package/dist/db/models/tenantBillingInfo.model.js +20 -0
- package/dist/db/models/tenantBillingInfo.model.js.map +1 -0
- package/dist/db/models/tenantBillingState.model.d.ts +28 -0
- package/dist/db/models/tenantBillingState.model.js +72 -0
- package/dist/db/models/tenantBillingState.model.js.map +1 -0
- package/dist/db/models/tenantSubscriptions.model.d.ts +51 -0
- package/dist/db/models/tenantSubscriptions.model.js +305 -0
- package/dist/db/models/tenantSubscriptions.model.js.map +1 -0
- package/dist/db/models/trialConsumptions.model.d.ts +24 -0
- package/dist/db/models/trialConsumptions.model.js +30 -0
- package/dist/db/models/trialConsumptions.model.js.map +1 -0
- package/dist/db/models/update-result.d.ts +1 -0
- package/dist/db/models/update-result.js +13 -0
- package/dist/db/models/update-result.js.map +1 -0
- package/dist/db/models/userSegments.model.d.ts +30 -0
- package/dist/db/models/userSegments.model.js +97 -0
- package/dist/db/models/userSegments.model.js.map +1 -0
- package/dist/db/tables/billingSettings.table.d.ts +22 -0
- package/dist/db/tables/billingSettings.table.js +73 -0
- package/dist/db/tables/billingSettings.table.js.map +1 -0
- package/dist/db/tables/creditNotes.table.d.ts +26 -0
- package/dist/db/tables/creditNotes.table.js +110 -0
- package/dist/db/tables/creditNotes.table.js.map +1 -0
- package/dist/db/tables/features.table.d.ts +18 -0
- package/dist/db/tables/features.table.js +70 -0
- package/dist/db/tables/features.table.js.map +1 -0
- package/dist/db/tables/index.d.ts +19 -0
- package/dist/db/tables/index.js +36 -0
- package/dist/db/tables/index.js.map +1 -0
- package/dist/db/tables/invoices.table.d.ts +47 -0
- package/dist/db/tables/invoices.table.js +140 -0
- package/dist/db/tables/invoices.table.js.map +1 -0
- package/dist/db/tables/legalDocuments.table.d.ts +10 -0
- package/dist/db/tables/legalDocuments.table.js +44 -0
- package/dist/db/tables/legalDocuments.table.js.map +1 -0
- package/dist/db/tables/planMigrations.table.d.ts +61 -0
- package/dist/db/tables/planMigrations.table.js +114 -0
- package/dist/db/tables/planMigrations.table.js.map +1 -0
- package/dist/db/tables/plans.table.d.ts +41 -0
- package/dist/db/tables/plans.table.js +125 -0
- package/dist/db/tables/plans.table.js.map +1 -0
- package/dist/db/tables/platformNotes.table.d.ts +13 -0
- package/dist/db/tables/platformNotes.table.js +58 -0
- package/dist/db/tables/platformNotes.table.js.map +1 -0
- package/dist/db/tables/refunds.table.d.ts +15 -0
- package/dist/db/tables/refunds.table.js +70 -0
- package/dist/db/tables/refunds.table.js.map +1 -0
- package/dist/db/tables/segments.table.d.ts +37 -0
- package/dist/db/tables/segments.table.js +79 -0
- package/dist/db/tables/segments.table.js.map +1 -0
- package/dist/db/tables/stripeWebhookEvents.table.d.ts +12 -0
- package/dist/db/tables/stripeWebhookEvents.table.js +54 -0
- package/dist/db/tables/stripeWebhookEvents.table.js.map +1 -0
- package/dist/db/tables/supportMessages.table.d.ts +14 -0
- package/dist/db/tables/supportMessages.table.js +62 -0
- package/dist/db/tables/supportMessages.table.js.map +1 -0
- package/dist/db/tables/supportTicketEvents.table.d.ts +14 -0
- package/dist/db/tables/supportTicketEvents.table.js +61 -0
- package/dist/db/tables/supportTicketEvents.table.js.map +1 -0
- package/dist/db/tables/supportTickets.table.d.ts +25 -0
- package/dist/db/tables/supportTickets.table.js +109 -0
- package/dist/db/tables/supportTickets.table.js.map +1 -0
- package/dist/db/tables/tenantBillingInfo.table.d.ts +24 -0
- package/dist/db/tables/tenantBillingInfo.table.js +62 -0
- package/dist/db/tables/tenantBillingInfo.table.js.map +1 -0
- package/dist/db/tables/tenantBillingState.table.d.ts +12 -0
- package/dist/db/tables/tenantBillingState.table.js +59 -0
- package/dist/db/tables/tenantBillingState.table.js.map +1 -0
- package/dist/db/tables/tenantSubscriptions.table.d.ts +46 -0
- package/dist/db/tables/tenantSubscriptions.table.js +157 -0
- package/dist/db/tables/tenantSubscriptions.table.js.map +1 -0
- package/dist/db/tables/trialConsumptions.table.d.ts +10 -0
- package/dist/db/tables/trialConsumptions.table.js +55 -0
- package/dist/db/tables/trialConsumptions.table.js.map +1 -0
- package/dist/db/tables/userSegments.table.d.ts +11 -0
- package/dist/db/tables/userSegments.table.js +56 -0
- package/dist/db/tables/userSegments.table.js.map +1 -0
- package/dist/hidden-filter.d.ts +1 -0
- package/dist/hidden-filter.js +10 -0
- package/dist/hidden-filter.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/invoice-line-items.d.ts +42 -0
- package/dist/invoice-line-items.js +83 -0
- package/dist/invoice-line-items.js.map +1 -0
- package/dist/page-definitions.d.ts +17 -0
- package/dist/page-definitions.js +60 -0
- package/dist/page-definitions.js.map +1 -0
- package/dist/pages.d.ts +59 -0
- package/dist/pages.js +88 -0
- package/dist/pages.js.map +1 -0
- package/dist/plans.d.ts +27 -0
- package/dist/plans.js +60 -0
- package/dist/plans.js.map +1 -0
- package/dist/provisioning.d.ts +5 -0
- package/dist/provisioning.js +3 -0
- package/dist/provisioning.js.map +1 -0
- package/dist/registration.d.ts +6 -0
- package/dist/registration.js +9 -0
- package/dist/registration.js.map +1 -0
- package/dist/workspace-lifecycle.d.ts +27 -0
- package/dist/workspace-lifecycle.js +30 -0
- package/dist/workspace-lifecycle.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PlanMigration = exports.PLAN_MIGRATION_STATUSES = exports.planMigrationsTableName = void 0;
|
|
13
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
+
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
15
|
+
const tenants_table_1 = require("@antelopejs/interface-dms/db/tables/tenants.table");
|
|
16
|
+
const users_table_1 = require("@antelopejs/interface-dms/auth/db/tables/users.table");
|
|
17
|
+
const plans_table_1 = require("./plans.table");
|
|
18
|
+
exports.planMigrationsTableName = "plan_migrations";
|
|
19
|
+
exports.PLAN_MIGRATION_STATUSES = [
|
|
20
|
+
"pending",
|
|
21
|
+
"running",
|
|
22
|
+
"completed",
|
|
23
|
+
"failed",
|
|
24
|
+
"partially_failed",
|
|
25
|
+
"reconciliation_required",
|
|
26
|
+
];
|
|
27
|
+
let PlanMigration = class PlanMigration extends interface_database_decorators_1.Table {
|
|
28
|
+
};
|
|
29
|
+
exports.PlanMigration = PlanMigration;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], PlanMigration.prototype, "_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], PlanMigration.prototype, "revision", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], PlanMigration.prototype, "snapshot", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], PlanMigration.prototype, "tenantOutcomes", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, interface_database_decorators_1.Index)(),
|
|
48
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
49
|
+
(0, interface_database_decorators_1.Relation)({ to: () => plans_table_1.Plan }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], PlanMigration.prototype, "fromPlanId", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, interface_database_decorators_1.Index)(),
|
|
54
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
55
|
+
(0, interface_database_decorators_1.Relation)({ to: () => plans_table_1.Plan }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], PlanMigration.prototype, "toPlanId", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, interface_database_decorators_1.Field)("boolean"),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], PlanMigration.prototype, "notifyMembers", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, interface_database_decorators_1.Index)(),
|
|
64
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], PlanMigration.prototype, "status", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], PlanMigration.prototype, "totalWorkspaces", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
73
|
+
__metadata("design:type", Number)
|
|
74
|
+
], PlanMigration.prototype, "processedWorkspaces", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, interface_database_decorators_1.Field)(["string"]),
|
|
77
|
+
(0, interface_database_decorators_1.Relation)({ to: () => tenants_table_1.Tenant, many: true }),
|
|
78
|
+
__metadata("design:type", Array)
|
|
79
|
+
], PlanMigration.prototype, "processedTenantIds", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
82
|
+
__metadata("design:type", Array)
|
|
83
|
+
], PlanMigration.prototype, "failedWorkspaces", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
86
|
+
(0, interface_database_decorators_1.Relation)({ to: () => users_table_1.User }),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], PlanMigration.prototype, "initiatedBy", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], PlanMigration.prototype, "permissionDiff", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], PlanMigration.prototype, "featureDiff", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, interface_database_decorators_1.Index)(),
|
|
99
|
+
(0, interface_database_decorators_1.CreationTime)(),
|
|
100
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
101
|
+
__metadata("design:type", Date)
|
|
102
|
+
], PlanMigration.prototype, "createdAt", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], PlanMigration.prototype, "startedAt", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], PlanMigration.prototype, "completedAt", void 0);
|
|
111
|
+
exports.PlanMigration = PlanMigration = __decorate([
|
|
112
|
+
(0, interface_database_decorators_1.RegisterTable)(exports.planMigrationsTableName, constants_1.CORE_SCHEMA_NAME)
|
|
113
|
+
], PlanMigration);
|
|
114
|
+
//# sourceMappingURL=planMigrations.table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planMigrations.table.js","sourceRoot":"","sources":["../../../src/db/tables/planMigrations.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAOmD;AACnD,mEAAuE;AACvE,qFAA2E;AAC3E,sFAA4E;AAC5E,+CAA2D;AAE9C,QAAA,uBAAuB,GAAG,iBAAiB,CAAC;AAE5C,QAAA,uBAAuB,GAAG;IACrC,SAAS;IACT,SAAS;IACT,WAAW;IACX,QAAQ;IACR,kBAAkB;IAClB,yBAAyB;CACjB,CAAC;AAgDJ,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,qCAAK;CA+DvC,CAAA;AA/DY,sCAAa;AAEhB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;0CACI;AAGZ;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;+CACU;AAGlB;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;+CACkC;AAGvC;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;qDACwC;AAK7C;IAHP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC;;iDACF;AAKnB;IAHP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC;;+CACJ;AAGjB;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;oDACc;AAIvB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;6CACoB;AAG5B;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sDACgB;AAGxB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;0DACoB;AAI5B;IAFP,IAAA,qCAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;IACjB,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,sBAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;yDACN;AAG7B;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;uDAC4C;AAIjD;IAFP,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC;;kDACD;AAGpB;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;qDACuC;AAG5C;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;kDACiC;AAKtC;IAHP,IAAA,qCAAK,GAAE;IACP,IAAA,4CAAY,GAAE;IACd,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;gDAAC;AAGhB;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;gDACiB;AAGvB;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;kDACmB;wBA9DtB,aAAa;IADzB,IAAA,6CAAa,EAAC,+BAAuB,EAAE,4BAAgB,CAAC;GAC5C,aAAa,CA+DzB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Table } from "@antelopejs/interface-database-decorators";
|
|
2
|
+
export declare const plansTableName = "plans";
|
|
3
|
+
export declare const PLAN_AUDIENCES: readonly ["any", "individual", "business"];
|
|
4
|
+
export type PlanAudience = (typeof PLAN_AUDIENCES)[number];
|
|
5
|
+
export declare const PLAN_INTERVALS: readonly ["month", "year"];
|
|
6
|
+
export type PlanInterval = (typeof PLAN_INTERVALS)[number];
|
|
7
|
+
export declare const PLAN_BILLING_MODES: readonly ["flat", "seat"];
|
|
8
|
+
export type PlanBillingMode = (typeof PLAN_BILLING_MODES)[number];
|
|
9
|
+
export interface PlanFeatureValue {
|
|
10
|
+
featureId: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface PlanProviderRefs {
|
|
14
|
+
stripeProductId?: string;
|
|
15
|
+
stripePriceId?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class Plan extends Table {
|
|
18
|
+
_id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
slug: string;
|
|
21
|
+
description: string;
|
|
22
|
+
audience: PlanAudience;
|
|
23
|
+
price: number;
|
|
24
|
+
currency: string;
|
|
25
|
+
interval: PlanInterval;
|
|
26
|
+
billingMode: PlanBillingMode;
|
|
27
|
+
features: PlanFeatureValue[];
|
|
28
|
+
permissions: string[];
|
|
29
|
+
inheritsFromPlanId: string | null;
|
|
30
|
+
trialDays: number;
|
|
31
|
+
maxMembers: number;
|
|
32
|
+
isPublic: boolean;
|
|
33
|
+
paymentProviderRefs: PlanProviderRefs;
|
|
34
|
+
borderColor: string | null;
|
|
35
|
+
borderLabel: string | null;
|
|
36
|
+
order: number;
|
|
37
|
+
isActive: boolean;
|
|
38
|
+
isDeleted: boolean;
|
|
39
|
+
createdAt: Date;
|
|
40
|
+
updatedAt: Date;
|
|
41
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Plan = exports.PLAN_BILLING_MODES = exports.PLAN_INTERVALS = exports.PLAN_AUDIENCES = exports.plansTableName = void 0;
|
|
13
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
+
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
15
|
+
exports.plansTableName = "plans";
|
|
16
|
+
exports.PLAN_AUDIENCES = ["any", "individual", "business"];
|
|
17
|
+
exports.PLAN_INTERVALS = ["month", "year"];
|
|
18
|
+
exports.PLAN_BILLING_MODES = ["flat", "seat"];
|
|
19
|
+
let Plan = class Plan extends interface_database_decorators_1.Table {
|
|
20
|
+
};
|
|
21
|
+
exports.Plan = Plan;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], Plan.prototype, "_id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], Plan.prototype, "name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, interface_database_decorators_1.Index)(),
|
|
32
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Plan.prototype, "slug", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Plan.prototype, "description", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, interface_database_decorators_1.Index)(),
|
|
41
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Plan.prototype, "audience", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], Plan.prototype, "price", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], Plan.prototype, "currency", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], Plan.prototype, "interval", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], Plan.prototype, "billingMode", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], Plan.prototype, "features", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, interface_database_decorators_1.Field)(["string"]),
|
|
66
|
+
__metadata("design:type", Array)
|
|
67
|
+
], Plan.prototype, "permissions", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
70
|
+
(0, interface_database_decorators_1.Relation)({ to: () => Plan }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], Plan.prototype, "inheritsFromPlanId", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], Plan.prototype, "trialDays", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
79
|
+
__metadata("design:type", Number)
|
|
80
|
+
], Plan.prototype, "maxMembers", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, interface_database_decorators_1.Index)(),
|
|
83
|
+
(0, interface_database_decorators_1.Field)("boolean"),
|
|
84
|
+
__metadata("design:type", Boolean)
|
|
85
|
+
], Plan.prototype, "isPublic", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
88
|
+
__metadata("design:type", Object)
|
|
89
|
+
], Plan.prototype, "paymentProviderRefs", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
92
|
+
__metadata("design:type", Object)
|
|
93
|
+
], Plan.prototype, "borderColor", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], Plan.prototype, "borderLabel", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, interface_database_decorators_1.Index)(),
|
|
100
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
101
|
+
__metadata("design:type", Number)
|
|
102
|
+
], Plan.prototype, "order", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, interface_database_decorators_1.Index)(),
|
|
105
|
+
(0, interface_database_decorators_1.Field)("boolean"),
|
|
106
|
+
__metadata("design:type", Boolean)
|
|
107
|
+
], Plan.prototype, "isActive", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, interface_database_decorators_1.Field)("boolean"),
|
|
110
|
+
__metadata("design:type", Boolean)
|
|
111
|
+
], Plan.prototype, "isDeleted", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, interface_database_decorators_1.CreationTime)(),
|
|
114
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
115
|
+
__metadata("design:type", Date)
|
|
116
|
+
], Plan.prototype, "createdAt", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, interface_database_decorators_1.UpdateTime)(),
|
|
119
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
120
|
+
__metadata("design:type", Date)
|
|
121
|
+
], Plan.prototype, "updatedAt", void 0);
|
|
122
|
+
exports.Plan = Plan = __decorate([
|
|
123
|
+
(0, interface_database_decorators_1.RegisterTable)(exports.plansTableName, constants_1.CORE_SCHEMA_NAME)
|
|
124
|
+
], Plan);
|
|
125
|
+
//# sourceMappingURL=plans.table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.table.js","sourceRoot":"","sources":["../../../src/db/tables/plans.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAQmD;AACnD,mEAAuE;AAE1D,QAAA,cAAc,GAAG,OAAO,CAAC;AAEzB,QAAA,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;AAG5D,QAAA,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAG5C,QAAA,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAerD,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qCAAK;CA8E9B,CAAA;AA9EY,oBAAI;AAEP;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iCACI;AAGZ;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;kCACK;AAIb;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;kCACK;AAGb;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACY;AAIpB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACe;AAGvB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mCACM;AAGd;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACS;AAGjB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACe;AAGvB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACqB;AAG7B;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;sCACwB;AAG7B;IADP,IAAA,qCAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;;yCACY;AAItB;IAFP,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;;gDACa;AAGlC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;uCACU;AAIlB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;wCACW;AAInB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,SAAS,CAAC;;sCACS;AAGlB;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;iDACiC;AAGtC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACmB;AAG3B;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACmB;AAI3B;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mCACM;AAId;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,SAAS,CAAC;;sCACS;AAGlB;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;uCACU;AAInB;IAFP,IAAA,4CAAY,GAAE;IACd,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;uCAAC;AAIhB;IAFP,IAAA,0CAAU,GAAE;IACZ,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;uCAAC;eA7Eb,IAAI;IADhB,IAAA,6CAAa,EAAC,sBAAc,EAAE,4BAAgB,CAAC;GACnC,IAAI,CA8EhB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Table } from "@antelopejs/interface-database-decorators";
|
|
2
|
+
export declare const platformNotesTableName = "platform_notes";
|
|
3
|
+
export declare const PLATFORM_NOTE_TARGET_TYPES: readonly ["user", "workspace"];
|
|
4
|
+
export type PlatformNoteTargetType = (typeof PLATFORM_NOTE_TARGET_TYPES)[number];
|
|
5
|
+
export declare class PlatformNote extends Table {
|
|
6
|
+
_id: string;
|
|
7
|
+
targetType: PlatformNoteTargetType;
|
|
8
|
+
targetId: string;
|
|
9
|
+
authorId: string;
|
|
10
|
+
content: string;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PlatformNote = exports.PLATFORM_NOTE_TARGET_TYPES = exports.platformNotesTableName = void 0;
|
|
13
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
+
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
15
|
+
const users_table_1 = require("@antelopejs/interface-dms/auth/db/tables/users.table");
|
|
16
|
+
exports.platformNotesTableName = "platform_notes";
|
|
17
|
+
exports.PLATFORM_NOTE_TARGET_TYPES = ["user", "workspace"];
|
|
18
|
+
let PlatformNote = class PlatformNote extends interface_database_decorators_1.Table {
|
|
19
|
+
};
|
|
20
|
+
exports.PlatformNote = PlatformNote;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], PlatformNote.prototype, "_id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, interface_database_decorators_1.Index)(),
|
|
27
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], PlatformNote.prototype, "targetType", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, interface_database_decorators_1.Index)(),
|
|
32
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], PlatformNote.prototype, "targetId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, interface_database_decorators_1.Index)(),
|
|
37
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
38
|
+
(0, interface_database_decorators_1.Relation)({ to: () => users_table_1.User }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], PlatformNote.prototype, "authorId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], PlatformNote.prototype, "content", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, interface_database_decorators_1.CreationTime)(),
|
|
47
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
48
|
+
__metadata("design:type", Date)
|
|
49
|
+
], PlatformNote.prototype, "createdAt", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, interface_database_decorators_1.UpdateTime)(),
|
|
52
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], PlatformNote.prototype, "updatedAt", void 0);
|
|
55
|
+
exports.PlatformNote = PlatformNote = __decorate([
|
|
56
|
+
(0, interface_database_decorators_1.RegisterTable)(exports.platformNotesTableName, constants_1.CORE_SCHEMA_NAME)
|
|
57
|
+
], PlatformNote);
|
|
58
|
+
//# sourceMappingURL=platformNotes.table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformNotes.table.js","sourceRoot":"","sources":["../../../src/db/tables/platformNotes.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAQmD;AACnD,mEAAuE;AACvE,sFAA4E;AAE/D,QAAA,sBAAsB,GAAG,gBAAgB,CAAC;AAE1C,QAAA,0BAA0B,GAAG,CAAC,MAAM,EAAE,WAAW,CAAU,CAAC;AAMlE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,qCAAK;CA2BtC,CAAA;AA3BY,oCAAY;AAEf;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACI;AAIZ;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;gDAC2B;AAInC;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;8CACS;AAKjB;IAHP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC;;8CACJ;AAGjB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;6CACQ;AAIhB;IAFP,IAAA,4CAAY,GAAE;IACd,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;+CAAC;AAIhB;IAFP,IAAA,0CAAU,GAAE;IACZ,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;+CAAC;uBA1Bb,YAAY;IADxB,IAAA,6CAAa,EAAC,8BAAsB,EAAE,4BAAgB,CAAC;GAC3C,YAAY,CA2BxB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Table } from "@antelopejs/interface-database-decorators";
|
|
2
|
+
export declare const refundsTableName = "refunds";
|
|
3
|
+
export declare const REFUND_STATUSES: readonly ["pending", "succeeded", "failed", "canceled"];
|
|
4
|
+
export type RefundStatus = (typeof REFUND_STATUSES)[number];
|
|
5
|
+
export declare class Refund extends Table {
|
|
6
|
+
_id: string;
|
|
7
|
+
creditNoteId: string;
|
|
8
|
+
stripeRefundId: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
status: RefundStatus;
|
|
12
|
+
failureReason: string | null;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Refund = exports.REFUND_STATUSES = exports.refundsTableName = void 0;
|
|
13
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
+
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
15
|
+
const creditNotes_table_1 = require("./creditNotes.table");
|
|
16
|
+
exports.refundsTableName = "refunds";
|
|
17
|
+
exports.REFUND_STATUSES = [
|
|
18
|
+
"pending",
|
|
19
|
+
"succeeded",
|
|
20
|
+
"failed",
|
|
21
|
+
"canceled",
|
|
22
|
+
];
|
|
23
|
+
let Refund = class Refund extends interface_database_decorators_1.Table {
|
|
24
|
+
};
|
|
25
|
+
exports.Refund = Refund;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], Refund.prototype, "_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, interface_database_decorators_1.Index)(),
|
|
32
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
33
|
+
(0, interface_database_decorators_1.Relation)({ to: () => creditNotes_table_1.CreditNote }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Refund.prototype, "creditNoteId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, interface_database_decorators_1.Index)(),
|
|
38
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], Refund.prototype, "stripeRefundId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], Refund.prototype, "amount", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], Refund.prototype, "currency", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], Refund.prototype, "status", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], Refund.prototype, "failureReason", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, interface_database_decorators_1.CreationTime)(),
|
|
59
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], Refund.prototype, "createdAt", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, interface_database_decorators_1.UpdateTime)(),
|
|
64
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
65
|
+
__metadata("design:type", Date)
|
|
66
|
+
], Refund.prototype, "updatedAt", void 0);
|
|
67
|
+
exports.Refund = Refund = __decorate([
|
|
68
|
+
(0, interface_database_decorators_1.RegisterTable)(exports.refundsTableName, constants_1.TENANT_SCHEMA_NAME)
|
|
69
|
+
], Refund);
|
|
70
|
+
//# sourceMappingURL=refunds.table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refunds.table.js","sourceRoot":"","sources":["../../../src/db/tables/refunds.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAQmD;AACnD,mEAAyE;AAKzE,2DAAiD;AAEpC,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAE7B,QAAA,eAAe,GAAG;IAC7B,SAAS;IACT,WAAW;IACX,QAAQ;IACR,UAAU;CACF,CAAC;AAKJ,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,qCAAK;CAgChC,CAAA;AAhCY,wBAAM;AAET;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mCACI;AAKZ;IAHP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,8BAAU,EAAE,CAAC;;4CACN;AAIrB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;8CACe;AAGvB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACO;AAGf;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;wCACS;AAGjB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACa;AAGrB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;6CACqB;AAI7B;IAFP,IAAA,4CAAY,GAAE;IACd,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;yCAAC;AAIhB;IAFP,IAAA,0CAAU,GAAE;IACZ,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;yCAAC;iBA/Bb,MAAM;IADlB,IAAA,6CAAa,EAAC,wBAAgB,EAAE,8BAAkB,CAAC;GACvC,MAAM,CAgClB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Table } from "@antelopejs/interface-database-decorators";
|
|
2
|
+
export declare const segmentsTableName = "segments";
|
|
3
|
+
export declare const SEGMENT_OPERATORS: readonly ["eq", "neq", "gt", "gte", "lt", "lte", "in", "nin", "contains"];
|
|
4
|
+
export type SegmentOperator = (typeof SEGMENT_OPERATORS)[number];
|
|
5
|
+
export declare const SEGMENT_LOGICAL: readonly ["and", "or"];
|
|
6
|
+
export type SegmentLogical = (typeof SEGMENT_LOGICAL)[number];
|
|
7
|
+
export declare const SEGMENT_QUANTIFIERS: readonly ["any", "all"];
|
|
8
|
+
export type SegmentQuantifier = (typeof SEGMENT_QUANTIFIERS)[number];
|
|
9
|
+
export declare const SEGMENT_MEMBER_ROLES: readonly ["member", "owner"];
|
|
10
|
+
export type SegmentMemberRole = (typeof SEGMENT_MEMBER_ROLES)[number];
|
|
11
|
+
export interface SegmentCondition {
|
|
12
|
+
field: string;
|
|
13
|
+
operator: SegmentOperator;
|
|
14
|
+
value: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface SegmentWorkspaceRef {
|
|
17
|
+
kind: "workspaceRef";
|
|
18
|
+
quantifier: SegmentQuantifier;
|
|
19
|
+
role?: SegmentMemberRole;
|
|
20
|
+
conditions: SegmentConditionGroup;
|
|
21
|
+
}
|
|
22
|
+
export interface SegmentConditionGroup {
|
|
23
|
+
logical: SegmentLogical;
|
|
24
|
+
conditions: (SegmentCondition | SegmentConditionGroup | SegmentWorkspaceRef)[];
|
|
25
|
+
}
|
|
26
|
+
export declare class Segment extends Table {
|
|
27
|
+
_id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
conditions: SegmentConditionGroup;
|
|
31
|
+
estimatedCount: number;
|
|
32
|
+
revision?: string;
|
|
33
|
+
membershipGeneration?: string;
|
|
34
|
+
lastEvaluatedAt: Date | null;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Segment = exports.SEGMENT_MEMBER_ROLES = exports.SEGMENT_QUANTIFIERS = exports.SEGMENT_LOGICAL = exports.SEGMENT_OPERATORS = exports.segmentsTableName = void 0;
|
|
13
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
+
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
15
|
+
exports.segmentsTableName = "segments";
|
|
16
|
+
exports.SEGMENT_OPERATORS = [
|
|
17
|
+
"eq",
|
|
18
|
+
"neq",
|
|
19
|
+
"gt",
|
|
20
|
+
"gte",
|
|
21
|
+
"lt",
|
|
22
|
+
"lte",
|
|
23
|
+
"in",
|
|
24
|
+
"nin",
|
|
25
|
+
"contains",
|
|
26
|
+
];
|
|
27
|
+
exports.SEGMENT_LOGICAL = ["and", "or"];
|
|
28
|
+
exports.SEGMENT_QUANTIFIERS = ["any", "all"];
|
|
29
|
+
exports.SEGMENT_MEMBER_ROLES = ["member", "owner"];
|
|
30
|
+
let Segment = class Segment extends interface_database_decorators_1.Table {
|
|
31
|
+
};
|
|
32
|
+
exports.Segment = Segment;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], Segment.prototype, "_id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], Segment.prototype, "name", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], Segment.prototype, "description", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, interface_database_decorators_1.Field)("any"),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], Segment.prototype, "conditions", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], Segment.prototype, "estimatedCount", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], Segment.prototype, "revision", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], Segment.prototype, "membershipGeneration", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, interface_database_decorators_1.Index)(),
|
|
63
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], Segment.prototype, "lastEvaluatedAt", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, interface_database_decorators_1.CreationTime)(),
|
|
68
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
69
|
+
__metadata("design:type", Date)
|
|
70
|
+
], Segment.prototype, "createdAt", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, interface_database_decorators_1.UpdateTime)(),
|
|
73
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
74
|
+
__metadata("design:type", Date)
|
|
75
|
+
], Segment.prototype, "updatedAt", void 0);
|
|
76
|
+
exports.Segment = Segment = __decorate([
|
|
77
|
+
(0, interface_database_decorators_1.RegisterTable)(exports.segmentsTableName, constants_1.CORE_SCHEMA_NAME)
|
|
78
|
+
], Segment);
|
|
79
|
+
//# sourceMappingURL=segments.table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.table.js","sourceRoot":"","sources":["../../../src/db/tables/segments.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAOmD;AACnD,mEAAuE;AAE1D,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAE/B,QAAA,iBAAiB,GAAG;IAC/B,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,UAAU;CACF,CAAC;AAGE,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,IAAI,CAAU,CAAC;AAGzC,QAAA,mBAAmB,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC;AAG9C,QAAA,oBAAoB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAiC1D,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,qCAAK;CAkCjC,CAAA;AAlCY,0BAAO;AAEV;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;oCACI;AAGZ;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;qCACK;AAGb;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;4CACY;AAGpB;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;2CAC6B;AAGlC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;+CACe;AAGvB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACU;AAIlB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;qDACsB;AAI9B;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,MAAM,CAAC;;gDACuB;AAI7B;IAFP,IAAA,4CAAY,GAAE;IACd,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;0CAAC;AAIhB;IAFP,IAAA,0CAAU,GAAE;IACZ,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;0CAAC;kBAjCb,OAAO;IADnB,IAAA,6CAAa,EAAC,yBAAiB,EAAE,4BAAgB,CAAC;GACtC,OAAO,CAkCnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Table } from "@antelopejs/interface-database-decorators";
|
|
2
|
+
export declare const stripeWebhookEventsTableName = "stripe_webhook_events";
|
|
3
|
+
export declare const WEBHOOK_RESULTS: readonly ["pending", "success", "failed", "skipped", "reconciliation_required"];
|
|
4
|
+
export type WebhookResult = (typeof WEBHOOK_RESULTS)[number];
|
|
5
|
+
export declare class StripeWebhookEvent extends Table {
|
|
6
|
+
_id: string;
|
|
7
|
+
type: string;
|
|
8
|
+
processedAt: Date;
|
|
9
|
+
result: WebhookResult;
|
|
10
|
+
errorMessage: string | null;
|
|
11
|
+
revision?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StripeWebhookEvent = exports.WEBHOOK_RESULTS = exports.stripeWebhookEventsTableName = void 0;
|
|
13
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
+
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
15
|
+
exports.stripeWebhookEventsTableName = "stripe_webhook_events";
|
|
16
|
+
exports.WEBHOOK_RESULTS = [
|
|
17
|
+
"pending",
|
|
18
|
+
"success",
|
|
19
|
+
"failed",
|
|
20
|
+
"skipped",
|
|
21
|
+
"reconciliation_required",
|
|
22
|
+
];
|
|
23
|
+
let StripeWebhookEvent = class StripeWebhookEvent extends interface_database_decorators_1.Table {
|
|
24
|
+
};
|
|
25
|
+
exports.StripeWebhookEvent = StripeWebhookEvent;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], StripeWebhookEvent.prototype, "_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], StripeWebhookEvent.prototype, "type", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, interface_database_decorators_1.Index)(),
|
|
36
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
37
|
+
__metadata("design:type", Date)
|
|
38
|
+
], StripeWebhookEvent.prototype, "processedAt", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], StripeWebhookEvent.prototype, "result", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], StripeWebhookEvent.prototype, "errorMessage", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], StripeWebhookEvent.prototype, "revision", void 0);
|
|
51
|
+
exports.StripeWebhookEvent = StripeWebhookEvent = __decorate([
|
|
52
|
+
(0, interface_database_decorators_1.RegisterTable)(exports.stripeWebhookEventsTableName, constants_1.CORE_SCHEMA_NAME)
|
|
53
|
+
], StripeWebhookEvent);
|
|
54
|
+
//# sourceMappingURL=stripeWebhookEvents.table.js.map
|