@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
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright (c) 2025-present - AntelopeJS Team
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @antelopejs/interface-dms-saas
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-blue?style=for-the-badge&labelColor=000000"></a>
|
|
5
|
+
<a href="https://discord.gg/sjK28QHrA7"><img src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000" alt="Discord"></a>
|
|
6
|
+
<a href="https://antelopejs.com"><img src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000" alt="Documentation"></a>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
Public interfaces of the AntelopeJS DMS SaaS module.
|
|
10
|
+
|
|
11
|
+
A module that extends `@antelopejs/dms-saas` depends on this package rather than
|
|
12
|
+
on the runtime, and imports the extension points from it:
|
|
13
|
+
|
|
14
|
+
| Subpath | Surface |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `@antelopejs/interface-dms-saas` | every extension point except `db`: billing, data API, pages, plans, provisioning and registration flat, plus the `invoiceLineItems` and `workspaceLifecycle` namespaces |
|
|
17
|
+
| `@antelopejs/interface-dms-saas/billing` | customer balance and complimentary subscription state |
|
|
18
|
+
| `@antelopejs/interface-dms-saas/data-api` | hidden-value data API filters |
|
|
19
|
+
| `@antelopejs/interface-dms-saas/db` | canonical SaaS tables and data models |
|
|
20
|
+
| `@antelopejs/interface-dms-saas/hidden-filter` | the `HiddenStringFilter` decorator on its own |
|
|
21
|
+
| `@antelopejs/interface-dms-saas/invoice-line-items` | provider registration, line item types, line key helpers |
|
|
22
|
+
| `@antelopejs/interface-dms-saas/page-definitions` | page and module ids, slugs and descriptors |
|
|
23
|
+
| `@antelopejs/interface-dms-saas/pages` | workspace settings category and tenant billing page extensions |
|
|
24
|
+
| `@antelopejs/interface-dms-saas/plans` | plan projections, catalog builder, and price normalization |
|
|
25
|
+
| `@antelopejs/interface-dms-saas/provisioning` | provisioning hook payload |
|
|
26
|
+
| `@antelopejs/interface-dms-saas/registration` | public registration capture limits |
|
|
27
|
+
| `@antelopejs/interface-dms-saas/workspace-lifecycle` | workspace lifecycle events and operator actions |
|
|
28
|
+
|
|
29
|
+
Two of those surfaces reach the root entry as namespaces rather than flat
|
|
30
|
+
re-exports, because each exposes an `internal` proxy namespace and two
|
|
31
|
+
`internal` names cannot coexist in one barrel:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { invoiceLineItems, workspaceLifecycle } from "@antelopejs/interface-dms-saas";
|
|
35
|
+
|
|
36
|
+
invoiceLineItems.RegisterInvoiceLineItemsProvider(/* … */);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Their own subpaths stay the direct route to the same symbols. `./db` is the one
|
|
40
|
+
surface the root entry leaves out: importing it registers the SaaS tables, and a
|
|
41
|
+
consumer that only wants types should not pay for that.
|
|
42
|
+
|
|
43
|
+
The `exports` map also carries a types-only `./dist/...` twin of every subpath.
|
|
44
|
+
Nothing should import those: they exist because TypeScript's declaration emit
|
|
45
|
+
rewrites `<pkg>/db/tables/plans.table` into the `dist` path it resolved through
|
|
46
|
+
`typesVersions`, and an exports-aware consumer of the emitted `.d.ts` has to be
|
|
47
|
+
able to resolve that path back.
|
|
48
|
+
|
|
49
|
+
This package is released on its own workflow and must be published before the
|
|
50
|
+
runtime module: `@antelopejs/dms-saas` depends on it with `workspace:*`, which
|
|
51
|
+
pnpm rewrites to the released version on publish.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ComplimentarySubscriptionState {
|
|
2
|
+
isComplimentary?: boolean | null;
|
|
3
|
+
stripeCustomerId?: string | null;
|
|
4
|
+
stripeSubscriptionId?: string | null;
|
|
5
|
+
status?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function isComplimentarySubscription(subscription: ComplimentarySubscriptionState | null | undefined): boolean;
|
|
8
|
+
export interface TenantCustomerBalanceScope {
|
|
9
|
+
tenantId: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AvailableTenantCustomerBalance {
|
|
13
|
+
status: "available";
|
|
14
|
+
balanceMinorUnits: number;
|
|
15
|
+
currency: string;
|
|
16
|
+
}
|
|
17
|
+
export type TenantCustomerBalanceAbsenceReason = "complimentary" | "customer_not_configured" | "customer_deleted" | "currency_unavailable";
|
|
18
|
+
export interface AbsentTenantCustomerBalance {
|
|
19
|
+
status: "absent";
|
|
20
|
+
reason: TenantCustomerBalanceAbsenceReason;
|
|
21
|
+
balanceMinorUnits: null;
|
|
22
|
+
currency: null;
|
|
23
|
+
}
|
|
24
|
+
export type TenantCustomerBalance = AvailableTenantCustomerBalance | AbsentTenantCustomerBalance;
|
|
25
|
+
export declare const GetTenantCustomerBalance: (scope: TenantCustomerBalanceScope) => Promise<TenantCustomerBalance>;
|
package/dist/billing.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetTenantCustomerBalance = void 0;
|
|
4
|
+
exports.isComplimentarySubscription = isComplimentarySubscription;
|
|
5
|
+
const interface_core_1 = require("@antelopejs/interface-core");
|
|
6
|
+
function isComplimentarySubscription(subscription) {
|
|
7
|
+
if (!subscription)
|
|
8
|
+
return false;
|
|
9
|
+
return (subscription.isComplimentary ??
|
|
10
|
+
(subscription.status !== "pending_payment" &&
|
|
11
|
+
!subscription.stripeCustomerId &&
|
|
12
|
+
!subscription.stripeSubscriptionId));
|
|
13
|
+
}
|
|
14
|
+
exports.GetTenantCustomerBalance = (0, interface_core_1.InterfaceFunction)();
|
|
15
|
+
//# sourceMappingURL=billing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../src/billing.ts"],"names":[],"mappings":";;;AAWA,kEAUC;AArBD,+DAA+D;AAW/D,SAAgB,2BAA2B,CACzC,YAA+D;IAE/D,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IAChC,OAAO,CACL,YAAY,CAAC,eAAe;QAC5B,CAAC,YAAY,CAAC,MAAM,KAAK,iBAAiB;YACxC,CAAC,YAAY,CAAC,gBAAgB;YAC9B,CAAC,YAAY,CAAC,oBAAoB,CAAC,CACtC,CAAC;AACJ,CAAC;AAwCY,QAAA,wBAAwB,GACnC,IAAA,kCAAiB,GAEd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HiddenStringFilter } from "./hidden-filter";
|
package/dist/data-api.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HiddenStringFilter = void 0;
|
|
4
|
+
var hidden_filter_1 = require("./hidden-filter");
|
|
5
|
+
Object.defineProperty(exports, "HiddenStringFilter", { enumerable: true, get: function () { return hidden_filter_1.HiddenStringFilter; } });
|
|
6
|
+
//# sourceMappingURL=data-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-api.js","sourceRoot":"","sources":["../src/data-api.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA"}
|
package/dist/db/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./tables"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BillingSettings } from "../tables/billingSettings.table";
|
|
2
|
+
declare const BillingSettingsModel_base: {
|
|
3
|
+
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
4
|
+
readonly table: import("@antelopejs/interface-database").Table<BillingSettings>;
|
|
5
|
+
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
6
|
+
get(id: string): PromiseLike<BillingSettings | undefined>;
|
|
7
|
+
getBy(index: keyof BillingSettings, ...keys: any[]): PromiseLike<BillingSettings[]>;
|
|
8
|
+
getAll(): PromiseLike<BillingSettings[]>;
|
|
9
|
+
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<BillingSettings> | import("@antelopejs/interface-database-decorators").DeepPartial<BillingSettings>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
10
|
+
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<BillingSettings>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
11
|
+
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<BillingSettings>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
12
|
+
delete(id: string): Promise<number>;
|
|
13
|
+
};
|
|
14
|
+
readonly schemaName: string;
|
|
15
|
+
fromPlainData(obj: any): BillingSettings;
|
|
16
|
+
fromDatabase(obj: any): BillingSettings | undefined;
|
|
17
|
+
toDatabase(obj: any): Record<string, any>;
|
|
18
|
+
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
19
|
+
};
|
|
20
|
+
export declare class BillingSettingsModel extends BillingSettingsModel_base {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingSettingsModel = void 0;
|
|
4
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
|
+
const billingSettings_table_1 = require("../tables/billingSettings.table");
|
|
6
|
+
class BillingSettingsModel extends (0, interface_database_decorators_1.BasicDataModel)(billingSettings_table_1.BillingSettings, billingSettings_table_1.billingSettingsTableName) {
|
|
7
|
+
}
|
|
8
|
+
exports.BillingSettingsModel = BillingSettingsModel;
|
|
9
|
+
//# sourceMappingURL=billingSettings.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billingSettings.model.js","sourceRoot":"","sources":["../../../src/db/models/billingSettings.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,2EAGyC;AAGzC,MAAa,oBAAqB,SAAQ,IAAA,8CAAc,EACtD,uCAAe,EACf,gDAAwB,CACzB;CAAG;AAHJ,oDAGI"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DeepPartial } from "@antelopejs/interface-database/common";
|
|
2
|
+
import { CreditNote } from "../tables/creditNotes.table";
|
|
3
|
+
declare const CreditNoteModel_base: {
|
|
4
|
+
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
5
|
+
readonly table: import("@antelopejs/interface-database").Table<CreditNote>;
|
|
6
|
+
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
7
|
+
get(id: string): PromiseLike<CreditNote | undefined>;
|
|
8
|
+
getBy(index: keyof CreditNote, ...keys: any[]): PromiseLike<CreditNote[]>;
|
|
9
|
+
getAll(): PromiseLike<CreditNote[]>;
|
|
10
|
+
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<CreditNote> | import("@antelopejs/interface-database-decorators").DeepPartial<CreditNote>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
11
|
+
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<CreditNote>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
12
|
+
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<CreditNote>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
13
|
+
delete(id: string): Promise<number>;
|
|
14
|
+
};
|
|
15
|
+
readonly schemaName: string;
|
|
16
|
+
fromPlainData(obj: any): CreditNote;
|
|
17
|
+
fromDatabase(obj: any): CreditNote | undefined;
|
|
18
|
+
toDatabase(obj: any): Record<string, any>;
|
|
19
|
+
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
20
|
+
};
|
|
21
|
+
export declare class CreditNoteModel extends CreditNoteModel_base {
|
|
22
|
+
updateUnlessVoided(id: string, patch: DeepPartial<CreditNote>): Promise<boolean>;
|
|
23
|
+
findOneByStripeCreditNote(stripeCreditNoteId: string): Promise<CreditNote | undefined>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreditNoteModel = void 0;
|
|
4
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
|
+
const creditNotes_table_1 = require("../tables/creditNotes.table");
|
|
6
|
+
const update_result_1 = require("./update-result");
|
|
7
|
+
class CreditNoteModel extends (0, interface_database_decorators_1.BasicDataModel)(creditNotes_table_1.CreditNote, creditNotes_table_1.creditNotesTableName) {
|
|
8
|
+
async updateUnlessVoided(id, patch) {
|
|
9
|
+
const result = await this.table
|
|
10
|
+
.getAll(id)
|
|
11
|
+
.filter((row) => row.key("status").ne("void"))
|
|
12
|
+
.update(patch)
|
|
13
|
+
.run();
|
|
14
|
+
return (0, update_result_1.hasSelectedRow)(result);
|
|
15
|
+
}
|
|
16
|
+
async findOneByStripeCreditNote(stripeCreditNoteId) {
|
|
17
|
+
const row = await this.table
|
|
18
|
+
.getAll(stripeCreditNoteId, "stripeCreditNoteId")
|
|
19
|
+
.nth(0)
|
|
20
|
+
.default(undefined)
|
|
21
|
+
.run();
|
|
22
|
+
return row ? CreditNoteModel.fromDatabase(row) : undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.CreditNoteModel = CreditNoteModel;
|
|
26
|
+
//# sourceMappingURL=creditNotes.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creditNotes.model.js","sourceRoot":"","sources":["../../../src/db/models/creditNotes.model.ts"],"names":[],"mappings":";;;AACA,6FAA2E;AAC3E,mEAA+E;AAC/E,mDAAiD;AAGjD,MAAa,eAAgB,SAAQ,IAAA,8CAAc,EACjD,8BAAU,EACV,wCAAoB,CACrB;IAEC,KAAK,CAAC,kBAAkB,CACtB,EAAU,EACV,KAA8B;QAE9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK;aAC5B,MAAM,CAAC,EAAE,CAAC;aACV,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;aAC7C,MAAM,CAAC,KAAK,CAAC;aACb,GAAG,EAAE,CAAC;QACT,OAAO,IAAA,8BAAc,EAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,yBAAyB,CAC7B,kBAA0B;QAE1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK;aACzB,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;aAChD,GAAG,CAAC,CAAC,CAAC;aACN,OAAO,CAAC,SAAS,CAAC;aAClB,GAAG,EAAE,CAAC;QACT,OAAO,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,CAAC;CACF;AA3BD,0CA2BC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Feature } from "../tables/features.table";
|
|
2
|
+
declare const FeatureModel_base: {
|
|
3
|
+
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
4
|
+
readonly table: import("@antelopejs/interface-database").Table<Feature>;
|
|
5
|
+
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
6
|
+
get(id: string): PromiseLike<Feature | undefined>;
|
|
7
|
+
getBy(index: keyof Feature, ...keys: any[]): PromiseLike<Feature[]>;
|
|
8
|
+
getAll(): PromiseLike<Feature[]>;
|
|
9
|
+
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Feature> | import("@antelopejs/interface-database-decorators").DeepPartial<Feature>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
10
|
+
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<Feature>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
11
|
+
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Feature>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
12
|
+
delete(id: string): Promise<number>;
|
|
13
|
+
};
|
|
14
|
+
readonly schemaName: string;
|
|
15
|
+
fromPlainData(obj: any): Feature;
|
|
16
|
+
fromDatabase(obj: any): Feature | undefined;
|
|
17
|
+
toDatabase(obj: any): Record<string, any>;
|
|
18
|
+
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
19
|
+
};
|
|
20
|
+
export declare class FeatureModel extends FeatureModel_base {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeatureModel = void 0;
|
|
4
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
|
+
const features_table_1 = require("../tables/features.table");
|
|
6
|
+
class FeatureModel extends (0, interface_database_decorators_1.BasicDataModel)(features_table_1.Feature, features_table_1.featuresTableName) {
|
|
7
|
+
}
|
|
8
|
+
exports.FeatureModel = FeatureModel;
|
|
9
|
+
//# sourceMappingURL=features.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.model.js","sourceRoot":"","sources":["../../../src/db/models/features.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,6DAAsE;AAGtE,MAAa,YAAa,SAAQ,IAAA,8CAAc,EAAC,wBAAO,EAAE,kCAAiB,CAAC;CAAG;AAA/E,oCAA+E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./billingSettings.model";
|
|
2
|
+
export * from "./creditNotes.model";
|
|
3
|
+
export * from "./features.model";
|
|
4
|
+
export * from "./invoices.model";
|
|
5
|
+
export * from "./legalDocuments.model";
|
|
6
|
+
export * from "./planMigrations.model";
|
|
7
|
+
export * from "./plans.model";
|
|
8
|
+
export * from "./platformNotes.model";
|
|
9
|
+
export * from "./refunds.model";
|
|
10
|
+
export * from "./segments.model";
|
|
11
|
+
export * from "./stripeWebhookEvents.model";
|
|
12
|
+
export * from "./supportMessages.model";
|
|
13
|
+
export * from "./supportTicketEvents.model";
|
|
14
|
+
export * from "./supportTickets.model";
|
|
15
|
+
export * from "./tenantBillingInfo.model";
|
|
16
|
+
export * from "./tenantBillingState.model";
|
|
17
|
+
export * from "./tenantSubscriptions.model";
|
|
18
|
+
export * from "./trialConsumptions.model";
|
|
19
|
+
export * from "./userSegments.model";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./billingSettings.model"), exports);
|
|
18
|
+
__exportStar(require("./creditNotes.model"), exports);
|
|
19
|
+
__exportStar(require("./features.model"), exports);
|
|
20
|
+
__exportStar(require("./invoices.model"), exports);
|
|
21
|
+
__exportStar(require("./legalDocuments.model"), exports);
|
|
22
|
+
__exportStar(require("./planMigrations.model"), exports);
|
|
23
|
+
__exportStar(require("./plans.model"), exports);
|
|
24
|
+
__exportStar(require("./platformNotes.model"), exports);
|
|
25
|
+
__exportStar(require("./refunds.model"), exports);
|
|
26
|
+
__exportStar(require("./segments.model"), exports);
|
|
27
|
+
__exportStar(require("./stripeWebhookEvents.model"), exports);
|
|
28
|
+
__exportStar(require("./supportMessages.model"), exports);
|
|
29
|
+
__exportStar(require("./supportTicketEvents.model"), exports);
|
|
30
|
+
__exportStar(require("./supportTickets.model"), exports);
|
|
31
|
+
__exportStar(require("./tenantBillingInfo.model"), exports);
|
|
32
|
+
__exportStar(require("./tenantBillingState.model"), exports);
|
|
33
|
+
__exportStar(require("./tenantSubscriptions.model"), exports);
|
|
34
|
+
__exportStar(require("./trialConsumptions.model"), exports);
|
|
35
|
+
__exportStar(require("./userSegments.model"), exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,sDAAoC;AACpC,mDAAiC;AACjC,mDAAiC;AACjC,yDAAuC;AACvC,yDAAuC;AACvC,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAgC;AAChC,mDAAiC;AACjC,8DAA4C;AAC5C,0DAAwC;AACxC,8DAA4C;AAC5C,yDAAuC;AACvC,4DAA0C;AAC1C,6DAA2C;AAC3C,8DAA4C;AAC5C,4DAA0C;AAC1C,uDAAqC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DeepPartial } from "@antelopejs/interface-database/common";
|
|
2
|
+
import { Invoice } from "../tables/invoices.table";
|
|
3
|
+
declare const InvoiceModel_base: {
|
|
4
|
+
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
5
|
+
readonly table: import("@antelopejs/interface-database").Table<Invoice>;
|
|
6
|
+
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
7
|
+
get(id: string): PromiseLike<Invoice | undefined>;
|
|
8
|
+
getBy(index: keyof Invoice, ...keys: any[]): PromiseLike<Invoice[]>;
|
|
9
|
+
getAll(): PromiseLike<Invoice[]>;
|
|
10
|
+
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Invoice> | import("@antelopejs/interface-database-decorators").DeepPartial<Invoice>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
11
|
+
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<Invoice>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
12
|
+
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Invoice>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
13
|
+
delete(id: string): Promise<number>;
|
|
14
|
+
};
|
|
15
|
+
readonly schemaName: string;
|
|
16
|
+
fromPlainData(obj: any): Invoice;
|
|
17
|
+
fromDatabase(obj: any): Invoice | undefined;
|
|
18
|
+
toDatabase(obj: any): Record<string, any>;
|
|
19
|
+
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
20
|
+
};
|
|
21
|
+
export declare class InvoiceModel extends InvoiceModel_base {
|
|
22
|
+
getAllInvoices(): Promise<Invoice[]>;
|
|
23
|
+
updateUnlessVoided(id: string, patch: DeepPartial<Invoice>): Promise<boolean>;
|
|
24
|
+
findOneByStripeInvoice(stripeInvoiceId: string): Promise<Invoice | undefined>;
|
|
25
|
+
findOneByStripeCreditNote(stripeCreditNoteId: string): Promise<Invoice | undefined>;
|
|
26
|
+
findLatestOpen(): Promise<Invoice | undefined>;
|
|
27
|
+
findOpenIssuedBefore(cutoff: Date): Promise<Invoice[]>;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoiceModel = void 0;
|
|
4
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
|
+
const invoices_table_1 = require("../tables/invoices.table");
|
|
6
|
+
const update_result_1 = require("./update-result");
|
|
7
|
+
const STATUS_OPEN = "open";
|
|
8
|
+
class InvoiceModel extends (0, interface_database_decorators_1.BasicDataModel)(invoices_table_1.Invoice, invoices_table_1.invoicesTableName) {
|
|
9
|
+
async getAllInvoices() {
|
|
10
|
+
const rows = await this.table
|
|
11
|
+
.filter((invoice) => invoice.key("documentType").ne("credit_note"))
|
|
12
|
+
.run();
|
|
13
|
+
return rows
|
|
14
|
+
.map((row) => InvoiceModel.fromDatabase(row))
|
|
15
|
+
.filter((row) => row !== undefined);
|
|
16
|
+
}
|
|
17
|
+
async updateUnlessVoided(id, patch) {
|
|
18
|
+
const result = await this.table
|
|
19
|
+
.getAll(id)
|
|
20
|
+
.filter((row) => row.key("status").ne("void"))
|
|
21
|
+
.update(patch)
|
|
22
|
+
.run();
|
|
23
|
+
return (0, update_result_1.hasSelectedRow)(result);
|
|
24
|
+
}
|
|
25
|
+
async findOneByStripeInvoice(stripeInvoiceId) {
|
|
26
|
+
const rows = await this.table
|
|
27
|
+
.getAll(stripeInvoiceId, "stripeInvoiceId")
|
|
28
|
+
.run();
|
|
29
|
+
const row = rows.find((candidate) => !candidate.stripeCreditNoteId);
|
|
30
|
+
return row ? InvoiceModel.fromDatabase(row) : undefined;
|
|
31
|
+
}
|
|
32
|
+
async findOneByStripeCreditNote(stripeCreditNoteId) {
|
|
33
|
+
const row = await this.table
|
|
34
|
+
.getAll(stripeCreditNoteId, "stripeCreditNoteId")
|
|
35
|
+
.nth(0)
|
|
36
|
+
.default(undefined)
|
|
37
|
+
.run();
|
|
38
|
+
return row ? InvoiceModel.fromDatabase(row) : undefined;
|
|
39
|
+
}
|
|
40
|
+
async findLatestOpen() {
|
|
41
|
+
const rows = await this.table
|
|
42
|
+
.getAll(STATUS_OPEN, "status")
|
|
43
|
+
.orderBy("issuedAt", "desc")
|
|
44
|
+
.slice(0, 1)
|
|
45
|
+
.run();
|
|
46
|
+
const row = rows[0];
|
|
47
|
+
return row ? InvoiceModel.fromDatabase(row) : undefined;
|
|
48
|
+
}
|
|
49
|
+
async findOpenIssuedBefore(cutoff) {
|
|
50
|
+
const rows = await this.table
|
|
51
|
+
.getAll(STATUS_OPEN, "status")
|
|
52
|
+
.filter((row) => row.key("issuedAt").le(cutoff))
|
|
53
|
+
.run();
|
|
54
|
+
return rows
|
|
55
|
+
.map((row) => InvoiceModel.fromDatabase(row))
|
|
56
|
+
.filter((row) => row !== undefined);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.InvoiceModel = InvoiceModel;
|
|
60
|
+
//# sourceMappingURL=invoices.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.model.js","sourceRoot":"","sources":["../../../src/db/models/invoices.model.ts"],"names":[],"mappings":"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"}
|