@carlonicora/nestjs-neo4jsonapi 7.1.0 → 8.1.0
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/dist/bootstrap/app.module.factory.d.ts.map +1 -1
- package/dist/bootstrap/app.module.factory.js +1 -0
- package/dist/bootstrap/app.module.factory.js.map +1 -1
- package/dist/bootstrap/bootstrap.options.d.ts +23 -0
- package/dist/bootstrap/bootstrap.options.d.ts.map +1 -1
- package/dist/core/email/templates/en/cardExpiring.hbs +28 -0
- package/dist/core/email/templates/en/paymentFailure.hbs +4 -0
- package/dist/foundations/analytics/controllers/analytics.controller.d.ts +1 -0
- package/dist/foundations/analytics/controllers/analytics.controller.d.ts.map +1 -1
- package/dist/foundations/analytics/controllers/analytics.controller.js +1 -1
- package/dist/foundations/analytics/controllers/analytics.controller.js.map +1 -1
- package/dist/foundations/analytics/interfaces/analytics.config.interface.d.ts +19 -0
- package/dist/foundations/analytics/interfaces/analytics.config.interface.d.ts.map +1 -1
- package/dist/foundations/analytics/interfaces/analytics.config.interface.js +2 -0
- package/dist/foundations/analytics/interfaces/analytics.config.interface.js.map +1 -1
- package/dist/foundations/analytics/services/analytics.service.d.ts +10 -1
- package/dist/foundations/analytics/services/analytics.service.d.ts.map +1 -1
- package/dist/foundations/analytics/services/analytics.service.js +17 -1
- package/dist/foundations/analytics/services/analytics.service.js.map +1 -1
- package/dist/foundations/billing/billing.module.d.ts +26 -0
- package/dist/foundations/billing/billing.module.d.ts.map +1 -0
- package/dist/foundations/billing/billing.module.js +74 -0
- package/dist/foundations/billing/billing.module.js.map +1 -0
- package/dist/foundations/billing/cron/billing-lifecycle.cron.d.ts +16 -0
- package/dist/foundations/billing/cron/billing-lifecycle.cron.d.ts.map +1 -0
- package/dist/foundations/billing/cron/billing-lifecycle.cron.js +52 -0
- package/dist/foundations/billing/cron/billing-lifecycle.cron.js.map +1 -0
- package/dist/foundations/billing/index.d.ts +7 -0
- package/dist/foundations/billing/index.d.ts.map +1 -0
- package/dist/foundations/billing/index.js +28 -0
- package/dist/foundations/billing/index.js.map +1 -0
- package/dist/foundations/billing/interfaces/billing.config.interface.d.ts +71 -0
- package/dist/foundations/billing/interfaces/billing.config.interface.d.ts.map +1 -0
- package/dist/foundations/billing/interfaces/billing.config.interface.js +41 -0
- package/dist/foundations/billing/interfaces/billing.config.interface.js.map +1 -0
- package/dist/foundations/billing/processors/billing-email.jobs.d.ts +127 -0
- package/dist/foundations/billing/processors/billing-email.jobs.d.ts.map +1 -0
- package/dist/foundations/billing/processors/billing-email.jobs.js +196 -0
- package/dist/foundations/billing/processors/billing-email.jobs.js.map +1 -0
- package/dist/foundations/billing/processors/billing-email.processor.d.ts +33 -0
- package/dist/foundations/billing/processors/billing-email.processor.d.ts.map +1 -0
- package/dist/foundations/billing/processors/billing-email.processor.js +95 -0
- package/dist/foundations/billing/processors/billing-email.processor.js.map +1 -0
- package/dist/foundations/billing/services/card-expiry-warning.service.d.ts +58 -0
- package/dist/foundations/billing/services/card-expiry-warning.service.d.ts.map +1 -0
- package/dist/foundations/billing/services/card-expiry-warning.service.js +90 -0
- package/dist/foundations/billing/services/card-expiry-warning.service.js.map +1 -0
- package/dist/foundations/company/repositories/company.repository.d.ts +2 -0
- package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
- package/dist/foundations/company/repositories/company.repository.js +2 -2
- package/dist/foundations/company/repositories/company.repository.js.map +1 -1
- package/dist/foundations/foundations.modules.d.ts +3 -0
- package/dist/foundations/foundations.modules.d.ts.map +1 -1
- package/dist/foundations/foundations.modules.js +3 -1
- package/dist/foundations/foundations.modules.js.map +1 -1
- package/dist/foundations/index.d.ts +1 -0
- package/dist/foundations/index.d.ts.map +1 -1
- package/dist/foundations/index.js +1 -0
- package/dist/foundations/index.js.map +1 -1
- package/dist/foundations/stripe-customer/services/stripe-customer-api.service.d.ts +17 -0
- package/dist/foundations/stripe-customer/services/stripe-customer-api.service.d.ts.map +1 -1
- package/dist/foundations/stripe-customer/services/stripe-customer-api.service.js +40 -0
- package/dist/foundations/stripe-customer/services/stripe-customer-api.service.js.map +1 -1
- package/dist/foundations/stripe-invoice/entities/stripe-invoice.entity.d.ts +1 -1
- package/dist/foundations/stripe-invoice/entities/stripe-invoice.entity.d.ts.map +1 -1
- package/dist/foundations/stripe-invoice/serialisers/stripe-invoice.serialiser.js +2 -2
- package/dist/foundations/stripe-invoice/serialisers/stripe-invoice.serialiser.js.map +1 -1
- package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.d.ts +13 -0
- package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.d.ts.map +1 -1
- package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.js +21 -0
- package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.js.map +1 -1
- package/dist/foundations/stripe-subscription/controllers/stripe-subscription.controller.d.ts +1 -3
- package/dist/foundations/stripe-subscription/controllers/stripe-subscription.controller.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/controllers/stripe-subscription.controller.js +5 -38
- package/dist/foundations/stripe-subscription/controllers/stripe-subscription.controller.js.map +1 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.d.ts +60 -0
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.d.ts.map +1 -0
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.discount.d.ts +1 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.discount.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.js +61 -0
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.js.map +1 -0
- package/dist/foundations/stripe-subscription/index.d.ts +1 -4
- package/dist/foundations/stripe-subscription/index.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/index.js +4 -8
- package/dist/foundations/stripe-subscription/index.js.map +1 -1
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.d.ts +93 -165
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.js +206 -274
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.js.map +1 -1
- package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.d.ts +34 -36
- package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js +20 -72
- package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js.map +1 -1
- package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.d.ts +1 -29
- package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.js +1 -53
- package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.js.map +1 -1
- package/dist/foundations/stripe-subscription/stripe-subscription.module.d.ts +3 -3
- package/dist/foundations/stripe-subscription/stripe-subscription.module.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/stripe-subscription.module.js +8 -7
- package/dist/foundations/stripe-subscription/stripe-subscription.module.js.map +1 -1
- package/dist/foundations/stripe-usage/entities/stripe-usage-record.entity.d.ts +1 -1
- package/dist/foundations/stripe-usage/entities/stripe-usage-record.entity.d.ts.map +1 -1
- package/dist/foundations/stripe-usage/serialisers/stripe-usage-record.serialiser.js +2 -2
- package/dist/foundations/stripe-usage/serialisers/stripe-usage-record.serialiser.js.map +1 -1
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.d.ts +6 -1
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.d.ts.map +1 -1
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js +73 -15
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js.map +1 -1
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.d.ts +24 -2
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.d.ts.map +1 -1
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.js +88 -20
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.js.map +1 -1
- package/package.json +1 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.entity.d.ts +0 -27
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.entity.d.ts.map +0 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.entity.js +0 -3
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.entity.js.map +0 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.map.d.ts +0 -8
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.map.d.ts.map +0 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.map.js +0 -30
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.map.js.map +0 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.model.d.ts +0 -4
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.model.d.ts.map +0 -1
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.model.js +0 -17
- package/dist/foundations/stripe-subscription/entities/stripe-subscription.model.js.map +0 -1
- package/dist/foundations/stripe-subscription/serialisers/stripe-subscription.serialiser.d.ts +0 -9
- package/dist/foundations/stripe-subscription/serialisers/stripe-subscription.serialiser.d.ts.map +0 -1
- package/dist/foundations/stripe-subscription/serialisers/stripe-subscription.serialiser.js +0 -59
- package/dist/foundations/stripe-subscription/serialisers/stripe-subscription.serialiser.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.factory.d.ts","sourceRoot":"","sources":["../../src/bootstrap/app.module.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAwB7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"app.module.factory.d.ts","sourceRoot":"","sources":["../../src/bootstrap/app.module.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAwB7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAkKpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.factory.js","sourceRoot":"","sources":["../../src/bootstrap/app.module.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,
|
|
1
|
+
{"version":3,"file":"app.module.factory.js","sourceRoot":"","sources":["../../src/bootstrap/app.module.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,0CAkKC;AA7MD,2CAA6D;AAC7D,2CAA6D;AAC7D,uCAAyC;AACzC,yDAA2D;AAC3D,+CAAkD;AAClD,iDAAoD;AACpD,2CAA+C;AAC/C,mCAAsC;AACtC,2CAAuC;AACvC,6CAAgG;AAChG,2CAA6B;AAE7B,6DAAwD;AACxD,oFAA+E;AAC/E,sCAA8G;AAC9G,0EAAsE;AACtE,qEAAgE;AAEhE,qDAAiD;AACjD,4EAAuE;AACvE,kDAA8C;AAC9C,uFAAkF;AAClF,iEAAsE;AACtE,qEAAiE;AAGjE;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,eAAe,CAAC,OAAyB;;IAEvD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;QACtB,MAAM,CAAC,OAAO,CAAC,UAAyB;YACtC,6EAA6E;YAC7E,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,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undations/referral/interfaces/referra
|
|
|
8
8
|
import { HandbookModuleConfig } from "../foundations/handbook/interfaces/handbook.config.interface";
|
|
9
9
|
import { HowToModuleConfig } from "../foundations/how-to/interfaces/how-to.config.interface";
|
|
10
10
|
import { BlogModuleConfig } from "../foundations/blog/interfaces/blog.config.interface";
|
|
11
|
+
import { BillingModuleConfig } from "../foundations/billing/interfaces/billing.config.interface";
|
|
11
12
|
import { EmailAutomationModuleConfig } from "../foundations/email-automation/interfaces/email-automation.config.interface";
|
|
12
13
|
import { UserActivityModuleConfig } from "../foundations/user-activity/interfaces/user-activity.config.interface";
|
|
13
14
|
import { AnalyticsModuleConfig } from "../foundations/analytics/interfaces/analytics.config.interface";
|
|
@@ -159,6 +160,25 @@ export interface BootstrapOptions {
|
|
|
159
160
|
* ```
|
|
160
161
|
*/
|
|
161
162
|
emailAutomation?: EmailAutomationModuleConfig;
|
|
163
|
+
/**
|
|
164
|
+
* Configuration for the billing module.
|
|
165
|
+
* Forwarded to `FoundationsModule.forRoot({ billing })`, exactly like
|
|
166
|
+
* `emailAutomation` above. The module is always mounted; every key is optional.
|
|
167
|
+
*
|
|
168
|
+
* Omitted keeps the defaults: failed-card grace on, the library
|
|
169
|
+
* billing email sender off (apps that consume `QueueId.EMAIL` with their own
|
|
170
|
+
* processor keep it), every billing email on, deletion 30 days after a
|
|
171
|
+
* subscription ends.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* billing: {
|
|
176
|
+
* emailSender: { enabled: true },
|
|
177
|
+
* deletion: { afterSubscriptionEndedDays: 365 },
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
billing?: BillingModuleConfig;
|
|
162
182
|
/**
|
|
163
183
|
* Configuration for the first-party web analytics feature module.
|
|
164
184
|
* Forwarded to `FoundationsModule.forRoot({ analytics })`, exactly like
|
|
@@ -177,6 +197,9 @@ export interface BootstrapOptions {
|
|
|
177
197
|
* ```typescript
|
|
178
198
|
* // Force analytics off whatever ANALYTICS_ENABLED says
|
|
179
199
|
* analytics: { enabled: false }
|
|
200
|
+
*
|
|
201
|
+
* // Keep ANALYTICS_ENABLED in charge; never record these roles or users
|
|
202
|
+
* analytics: { excludedRoleIds: ["<role-id>"], excludedUserIds: ["<user-id>"] }
|
|
180
203
|
* ```
|
|
181
204
|
*/
|
|
182
205
|
analytics?: AnalyticsModuleConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.options.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+DAA+D,CAAC;AACvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAC3H,OAAO,EAAE,wBAAwB,EAAE,MAAM,wEAAwE,CAAC;AAClH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gEAAgE,CAAC;AAEvG;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM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AE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC;CAC9E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Your card expires before your next payment</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body style="margin: 0; padding: 0; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">
|
|
9
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="max-width: 600px; margin: 0 auto;">
|
|
10
|
+
<tr><td>{{> header}}</td></tr>
|
|
11
|
+
<tr>
|
|
12
|
+
<td style="padding: 32px;">
|
|
13
|
+
<h1 style="color: #1a1a1a; font-size: 24px; font-weight: 600; margin: 0 0 24px 0; line-height: 1.3;">Your card expires before your next payment</h1>
|
|
14
|
+
<p style="color: #333333; font-size: 16px; line-height: 1.6; margin: 0 0 16px 0;">Hi {{customerName}},</p>
|
|
15
|
+
<p style="color: #333333; font-size: 16px; line-height: 1.6; margin: 0 0 24px 0;">Your subscription renews on <strong>{{renewalDate}}</strong>, but the {{cardBrand}} card ending in <strong>{{cardLast4}}</strong> expires before then.</p>
|
|
16
|
+
<p style="color: #333333; font-size: 16px; line-height: 1.6; margin: 0 0 24px 0;">Add a new card before that date and the renewal goes through as usual.</p>
|
|
17
|
+
{{#if updatePaymentUrl}}
|
|
18
|
+
<div style="text-align: center; margin: 32px 0 16px 0;">
|
|
19
|
+
<a href="{{updatePaymentUrl}}" style="display: inline-block; background: #1a1a1a; color: #ffffff; padding: 14px 28px; text-decoration: none; border-radius: 4px; font-weight: 600; font-size: 16px;">Update your card</a>
|
|
20
|
+
</div>
|
|
21
|
+
{{/if}}
|
|
22
|
+
<p style="color: #999999; font-size: 14px; line-height: 1.5; margin: 24px 0 0 0;">Already updated it? Then you can ignore this email.</p>
|
|
23
|
+
</td>
|
|
24
|
+
</tr>
|
|
25
|
+
<tr><td>{{> footer}}</td></tr>
|
|
26
|
+
</table>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
@@ -20,12 +20,16 @@
|
|
|
20
20
|
{{#if errorMessage}}<p style="margin: 0; font-size: 14px; color: #ef4444;"><strong>Error:</strong> {{errorMessage}}</p>{{/if}}
|
|
21
21
|
</div>
|
|
22
22
|
{{/if}}
|
|
23
|
+
{{#if keepsAccess}}
|
|
24
|
+
<p style="color: #333333; font-size: 16px; line-height: 1.6; margin: 0 0 24px 0;">Nothing has stopped: everything keeps working while we retry. Update your card so it doesn't run out.</p>
|
|
25
|
+
{{else}}
|
|
23
26
|
<p style="color: #333333; font-size: 16px; line-height: 1.6; margin: 0 0 16px 0;"><strong>What you need to do:</strong></p>
|
|
24
27
|
<ul style="color: #333333; font-size: 16px; line-height: 1.8; margin: 0 0 24px 0; padding-left: 24px;">
|
|
25
28
|
<li>Verify your payment method is up to date</li>
|
|
26
29
|
<li>Ensure sufficient funds are available</li>
|
|
27
30
|
<li>Update your payment information if needed</li>
|
|
28
31
|
</ul>
|
|
32
|
+
{{/if}}
|
|
29
33
|
{{#if invoiceUrl}}
|
|
30
34
|
<div style="text-align: center; margin: 32px 0 16px 0;">
|
|
31
35
|
<a href="{{invoiceUrl}}" style="display: inline-block; background: #1a1a1a; color: #ffffff; padding: 14px 28px; text-decoration: none; border-radius: 4px; font-weight: 600; font-size: 16px;">View Invoice</a>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.controller.d.ts","sourceRoot":"","sources":["../../../../src/foundations/analytics/controllers/analytics.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE;;;;;;;;;GASG;AACH,qBAEa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAMzD,KAAK,CACF,OAAO,EAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,
|
|
1
|
+
{"version":3,"file":"analytics.controller.d.ts","sourceRoot":"","sources":["../../../../src/foundations/analytics/controllers/analytics.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE;;;;;;;;;GASG;AACH,qBAEa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAMzD,KAAK,CACF,OAAO,EAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAA;KAAE,EACzE,IAAI,EAAE,qBAAqB,GAClC,OAAO,CAAC,IAAI,CAAC;IAuBhB;;;OAGG;IACH,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,OAAO;CAGhB"}
|
|
@@ -53,7 +53,7 @@ let AnalyticsController = class AnalyticsController {
|
|
|
53
53
|
userId: request.user?.userId,
|
|
54
54
|
receivedAt: new Date().toISOString(),
|
|
55
55
|
};
|
|
56
|
-
await this.analyticsService.track(input);
|
|
56
|
+
await this.analyticsService.track(input, { roles: request.user?.roles });
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* First comma-separated hop of X-Forwarded-For, trimmed; request.ip otherwise.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.controller.js","sourceRoot":"","sources":["../../../../src/foundations/analytics/controllers/analytics.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8F;AAC9F,iDAA6C;AAE7C,4FAAsF;AACtF,+EAAyE;AACzE,2EAAsE;AAEtE,qEAAiE;AACjE,kFAAwE;AACxE,+EAAyE;AAEzE;;;;;;;;;GASG;AAGI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAM7D,AAAN,KAAK,CAAC,KAAK,CACF,
|
|
1
|
+
{"version":3,"file":"analytics.controller.js","sourceRoot":"","sources":["../../../../src/foundations/analytics/controllers/analytics.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8F;AAC9F,iDAA6C;AAE7C,4FAAsF;AACtF,+EAAyE;AACzE,2EAAsE;AAEtE,qEAAiE;AACjE,kFAAwE;AACxE,+EAAyE;AAEzE;;;;;;;;;GASG;AAGI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,gBAAkC;QAAlC,q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AAO,CAAC,EAAE,CAAC;IAChC,CAAC;IAEO,OAAO,CAAC,KAAoC;QAClD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACjD,CAAC;CACF,CAAA;AA9CY,kDAAmB;AAOxB;IAJL,IAAA,aAAI,EAAC,yCAAkB,CAAC,QAAQ,CAAC;IACjC,IAAA,kBAAS,EAAC,8CAAoB,CAAC;IAC/B,IAAA,oBAAQ,EAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;IAC/E,IAAA,iBAAQ,EAAC,mBAAU,CAAC,QAAQ,CAAC;IAE3B,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,gDAAqB;;gDAsBpC;8BA/BU,mBAAmB;IAF/B,IAAA,4BAAS,EAAC,EAAE,MAAM,EAAE,8BAAY,CAAC,SAAS,EAAE,CAAC;IAC7C,IAAA,mBAAU,GAAE;qCAEoC,oCAAgB;GADpD,mBAAmB,CA8C/B"}
|
|
@@ -59,6 +59,25 @@ export interface AnalyticsModuleConfig {
|
|
|
59
59
|
* @default "analytics:pageView"
|
|
60
60
|
*/
|
|
61
61
|
jobName?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Role ids whose page views are never recorded. A logged-in caller holding
|
|
64
|
+
* any one of these roles is dropped before the queue; the endpoint still
|
|
65
|
+
* answers 202. Anonymous page views are unaffected.
|
|
66
|
+
*
|
|
67
|
+
* Not read from env: set it through `bootstrap({ analytics })`.
|
|
68
|
+
*
|
|
69
|
+
* @default []
|
|
70
|
+
*/
|
|
71
|
+
excludedRoleIds?: string[];
|
|
72
|
+
/**
|
|
73
|
+
* User ids whose page views are never recorded. Dropped before the queue,
|
|
74
|
+
* exactly like `excludedRoleIds`.
|
|
75
|
+
*
|
|
76
|
+
* Not read from env: set it through `bootstrap({ analytics })`.
|
|
77
|
+
*
|
|
78
|
+
* @default []
|
|
79
|
+
*/
|
|
80
|
+
excludedUserIds?: string[];
|
|
62
81
|
}
|
|
63
82
|
/**
|
|
64
83
|
* Injection token for the resolved analytics configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.config.interface.d.ts","sourceRoot":"","sources":["../../../../src/foundations/analytics/interfaces/analytics.config.interface.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"analytics.config.interface.d.ts","sourceRoot":"","sources":["../../../../src/foundations/analytics/interfaces/analytics.config.interface.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,qBAAqB,CAQpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.config.interface.js","sourceRoot":"","sources":["../../../../src/foundations/analytics/interfaces/analytics.config.interface.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;
|
|
1
|
+
{"version":3,"file":"analytics.config.interface.js","sourceRoot":"","sources":["../../../../src/foundations/analytics/interfaces/analytics.config.interface.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AA0FzD;;;GAGG;AACU,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzD;;GAEG;AACU,QAAA,wBAAwB,GAAoC;IACvE,OAAO,EAAE,KAAK;IACd,eAAe,EAAE,EAAE;IACnB,qBAAqB,EAAE,EAAE;IACzB,OAAO,EAAE,kBAAO,CAAC,SAAS;IAC1B,OAAO,EAAE,oBAAoB;IAC7B,eAAe,EAAE,EAAE;IACnB,eAAe,EAAE,EAAE;CACpB,CAAC"}
|
|
@@ -21,11 +21,20 @@ export declare class AnalyticsService extends AbstractService<AnalyticsSession,
|
|
|
21
21
|
};
|
|
22
22
|
}>;
|
|
23
23
|
private readonly jobName;
|
|
24
|
+
private readonly excludedRoleIds;
|
|
25
|
+
private readonly excludedUserIds;
|
|
24
26
|
constructor(jsonApiService: JsonApiService, analyticsSessionRepository: AnalyticsSessionRepository, clsService: ClsService, queue: Queue, logger: AppLoggingService, config: Required<AnalyticsModuleConfig>);
|
|
25
27
|
/**
|
|
26
28
|
* Enqueue a page view for async write. Never throws — analytics must not
|
|
27
29
|
* break the caller's request path.
|
|
30
|
+
*
|
|
31
|
+
* A page view from an excluded user id, or from a caller holding any
|
|
32
|
+
* excluded role, is dropped before the queue. The roles only decide the
|
|
33
|
+
* drop; they are not added to the job.
|
|
28
34
|
*/
|
|
29
|
-
track(input: AnalyticsPageViewInput
|
|
35
|
+
track(input: AnalyticsPageViewInput, options?: {
|
|
36
|
+
roles?: string[];
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
private _isExcluded;
|
|
30
39
|
}
|
|
31
40
|
//# sourceMappingURL=analytics.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/analytics/services/analytics.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAqC,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACpH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAE1F,qBACa,gBAAiB,SAAQ,eAAe,CACnD,gBAAgB,EAChB,OAAO,0BAA0B,CAAC,aAAa,CAChD;
|
|
1
|
+
{"version":3,"file":"analytics.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/analytics/services/analytics.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM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_session_1.AnalyticsSessionDescriptor;
|
|
31
31
|
this.jobName = config.jobName;
|
|
32
|
+
this.excludedRoleIds = new Set(config.excludedRoleIds);
|
|
33
|
+
this.excludedUserIds = new Set(config.excludedUserIds);
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* Enqueue a page view for async write. Never throws — analytics must not
|
|
35
37
|
* break the caller's request path.
|
|
38
|
+
*
|
|
39
|
+
* A page view from an excluded user id, or from a caller holding any
|
|
40
|
+
* excluded role, is dropped before the queue. The roles only decide the
|
|
41
|
+
* drop; they are not added to the job.
|
|
36
42
|
*/
|
|
37
|
-
async track(input) {
|
|
43
|
+
async track(input, options) {
|
|
44
|
+
if (this._isExcluded(input.userId, options?.roles)) {
|
|
45
|
+
// Path only: raw IP and user agent must not reach the logs.
|
|
46
|
+
this.logger.debug(`analytics pageView dropped reason=excluded path=${input.path}`);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
38
49
|
try {
|
|
39
50
|
await this.queue.add(this.jobName, input);
|
|
40
51
|
}
|
|
@@ -42,6 +53,11 @@ let AnalyticsService = class AnalyticsService extends abstract_service_1.Abstrac
|
|
|
42
53
|
this.logger.error(`AnalyticsService.track enqueue failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
43
54
|
}
|
|
44
55
|
}
|
|
56
|
+
_isExcluded(userId, roles) {
|
|
57
|
+
if (userId && this.excludedUserIds.has(userId))
|
|
58
|
+
return true;
|
|
59
|
+
return (roles ?? []).some((roleId) => this.excludedRoleIds.has(roleId));
|
|
60
|
+
}
|
|
45
61
|
};
|
|
46
62
|
exports.AnalyticsService = AnalyticsService;
|
|
47
63
|
exports.AnalyticsService = AnalyticsService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.service.js","sourceRoot":"","sources":["../../../../src/foundations/analytics/services/analytics.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,mCAA+B;AAC/B,2CAAwC;AACxC,oFAAgF;AAChF,oFAAmF;AACnF,qFAAiF;AACjF,qEAA6F;AAC7F,yFAAoH;AAEpH,+FAA0F;AAGnF,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,kCAGrC;
|
|
1
|
+
{"version":3,"file":"analytics.service.js","sourceRoot":"","sources":["../../../../src/foundations/analytics/services/analytics.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,mCAA+B;AAC/B,2CAAwC;AACxC,oFAAgF;AAChF,oFAAmF;AACnF,qFAAiF;AACjF,qEAA6F;AAC7F,yFAAoH;AAEpH,+FAA0F;AAGnF,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,kCAGrC;IAMC,YACE,cAA8B,EAC9B,0BAAsD,EACtD,UAAsB,EACG,KAA6B,EACrC,MAAyB,EAChB,MAAuC;QAEjE,KAAK,CAAC,cAAc,EAAE,0BAA0B,EAAE,UAAU,EAAE,8CAA0B,CAAC,KAAK,CAAC,CAAC;QAJtD,UAAK,GAAL,KAAK,CAAO;QACrC,WAAM,GAAN,MAAM,CAAmB;QAVzB,eAAU,GAAG,8CAA0B,CAAC;QAczD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QACvD,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,CAAC,KAA6B,EAAE,OAA8B;QACvE,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;YACnD,4DAA4D;YAC5D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mDAAmD,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACnF,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClH,CAAC;IACH,CAAC;IAEO,WAAW,CAAC,MAA0B,EAAE,KAA2B;QACzE,IAAI,MAAM,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5D,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF,CAAA;AAjDY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAcR,WAAA,IAAA,eAAM,EAAC,4CAAe,CAAC,CAAA;IAEvB,WAAA,IAAA,eAAM,EAAC,6CAAgB,CAAC,CAAA;qCALT,gCAAc;QACF,yDAA0B;QAC1C,uBAAU;QAC2B,cAAK;QAC7B,mCAAiB;GAdjC,gBAAgB,CAiD5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DynamicModule } from "@nestjs/common";
|
|
2
|
+
import { BillingModuleConfig } from "./interfaces/billing.config.interface";
|
|
3
|
+
/**
|
|
4
|
+
* BillingModule — per-app billing settings and billing housekeeping.
|
|
5
|
+
*
|
|
6
|
+
* - `BILLING_CONFIG` (global): the resolved settings every billing service reads
|
|
7
|
+
* - `BillingLifecycleCron` (worker only): hourly card-expiry check
|
|
8
|
+
* - `BillingEmailProcessor` (worker only, opt-in): the library billing email sender on `QueueId.EMAIL`
|
|
9
|
+
*
|
|
10
|
+
* Always mounted by `FoundationsModule`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Through bootstrap, which forwards it to FoundationsModule
|
|
15
|
+
* bootstrap({ billing: { emailSender: { enabled: true } } })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class BillingModule {
|
|
19
|
+
/**
|
|
20
|
+
* Configure the BillingModule.
|
|
21
|
+
*
|
|
22
|
+
* @param config - Optional configuration merged key by key over DEFAULT_BILLING_CONFIG
|
|
23
|
+
*/
|
|
24
|
+
static forRoot(config?: BillingModuleConfig): DynamicModule;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=billing.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/billing/billing.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAoB,MAAM,gBAAgB,CAAC;AAQjE,OAAO,EAAkB,mBAAmB,EAAwB,MAAM,uCAAuC,CAAC;AAIlH;;;;;;;;;;;;;;GAcG;AACH,qBACa,aAAa;IACxB;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,aAAa;CA2B5D"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 BillingModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.BillingModule = void 0;
|
|
11
|
+
const bullmq_1 = require("@nestjs/bullmq");
|
|
12
|
+
const common_1 = require("@nestjs/common");
|
|
13
|
+
const conditional_service_decorator_1 = require("../../common/decorators/conditional-service.decorator");
|
|
14
|
+
const queue_id_1 = require("../../config/enums/queue.id");
|
|
15
|
+
const email_module_1 = require("../../core/email/email.module");
|
|
16
|
+
const stripe_customer_module_1 = require("../stripe-customer/stripe-customer.module");
|
|
17
|
+
const stripe_subscription_module_1 = require("../stripe-subscription/stripe-subscription.module");
|
|
18
|
+
const stripe_webhook_module_1 = require("../stripe-webhook/stripe-webhook.module");
|
|
19
|
+
const billing_lifecycle_cron_1 = require("./cron/billing-lifecycle.cron");
|
|
20
|
+
const billing_config_interface_1 = require("./interfaces/billing.config.interface");
|
|
21
|
+
const billing_email_processor_1 = require("./processors/billing-email.processor");
|
|
22
|
+
const card_expiry_warning_service_1 = require("./services/card-expiry-warning.service");
|
|
23
|
+
/**
|
|
24
|
+
* BillingModule — per-app billing settings and billing housekeeping.
|
|
25
|
+
*
|
|
26
|
+
* - `BILLING_CONFIG` (global): the resolved settings every billing service reads
|
|
27
|
+
* - `BillingLifecycleCron` (worker only): hourly card-expiry check
|
|
28
|
+
* - `BillingEmailProcessor` (worker only, opt-in): the library billing email sender on `QueueId.EMAIL`
|
|
29
|
+
*
|
|
30
|
+
* Always mounted by `FoundationsModule`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Through bootstrap, which forwards it to FoundationsModule
|
|
35
|
+
* bootstrap({ billing: { emailSender: { enabled: true } } })
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
let BillingModule = BillingModule_1 = class BillingModule {
|
|
39
|
+
/**
|
|
40
|
+
* Configure the BillingModule.
|
|
41
|
+
*
|
|
42
|
+
* @param config - Optional configuration merged key by key over DEFAULT_BILLING_CONFIG
|
|
43
|
+
*/
|
|
44
|
+
static forRoot(config) {
|
|
45
|
+
const resolved = (0, billing_config_interface_1.resolveBillingConfig)(config);
|
|
46
|
+
const configProvider = {
|
|
47
|
+
provide: billing_config_interface_1.BILLING_CONFIG,
|
|
48
|
+
useValue: resolved,
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
module: BillingModule_1,
|
|
52
|
+
global: true,
|
|
53
|
+
imports: [
|
|
54
|
+
bullmq_1.BullModule.registerQueue({ name: queue_id_1.QueueId.EMAIL }),
|
|
55
|
+
email_module_1.EmailModule,
|
|
56
|
+
stripe_subscription_module_1.StripeSubscriptionModule,
|
|
57
|
+
stripe_customer_module_1.StripeCustomerModule,
|
|
58
|
+
stripe_webhook_module_1.StripeWebhookModule,
|
|
59
|
+
],
|
|
60
|
+
providers: [
|
|
61
|
+
configProvider,
|
|
62
|
+
card_expiry_warning_service_1.CardExpiryWarningService,
|
|
63
|
+
(0, conditional_service_decorator_1.createWorkerProvider)(billing_lifecycle_cron_1.BillingLifecycleCron),
|
|
64
|
+
...(resolved.emailSender.enabled ? [(0, conditional_service_decorator_1.createWorkerProvider)(billing_email_processor_1.BillingEmailProcessor)] : []),
|
|
65
|
+
],
|
|
66
|
+
exports: [billing_config_interface_1.BILLING_CONFIG],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.BillingModule = BillingModule;
|
|
71
|
+
exports.BillingModule = BillingModule = BillingModule_1 = __decorate([
|
|
72
|
+
(0, common_1.Module)({})
|
|
73
|
+
], BillingModule);
|
|
74
|
+
//# sourceMappingURL=billing.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.module.js","sourceRoot":"","sources":["../../../src/foundations/billing/billing.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAAiE;AACjE,yGAA6F;AAC7F,0DAAsD;AACtD,gEAA4D;AAC5D,sFAAiF;AACjF,kGAA6F;AAC7F,mFAA8E;AAC9E,0EAAqE;AACrE,oFAAkH;AAClH,kFAA6E;AAC7E,wFAAkF;AAElF;;;;;;;;;;;;;;GAcG;AAEI,IAAM,aAAa,qBAAnB,MAAM,aAAa;IACxB;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,MAA4B;QACzC,MAAM,QAAQ,GAAG,IAAA,+CAAoB,EAAC,MAAM,CAAC,CAAC;QAE9C,MAAM,cAAc,GAAa;YAC/B,OAAO,EAAE,yCAAc;YACvB,QAAQ,EAAE,QAAQ;SACnB,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,eAAa;YACrB,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;gBACP,mBAAU,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,kBAAO,CAAC,KAAK,EAAE,CAAC;gBACjD,0BAAW;gBACX,qDAAwB;gBACxB,6CAAoB;gBACpB,2CAAmB;aACpB;YACD,SAAS,EAAE;gBACT,cAAc;gBACd,sDAAwB;gBACxB,IAAA,oDAAoB,EAAC,6CAAoB,CAAC;gBAC1C,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,oDAAoB,EAAC,+CAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aACvF;YACD,OAAO,EAAE,CAAC,yCAAc,CAAC;SAC1B,CAAC;IACJ,CAAC;CACF,CAAA;AAjCY,sCAAa;wBAAb,aAAa;IADzB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,aAAa,CAiCzB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AppLoggingService } from "../../../core/logging/services/logging.service";
|
|
2
|
+
import { CardExpiryWarningService } from "../services/card-expiry-warning.service";
|
|
3
|
+
/**
|
|
4
|
+
* BillingLifecycleCron — hourly billing housekeeping, registered on worker
|
|
5
|
+
* instances only (`createWorkerProvider`).
|
|
6
|
+
*
|
|
7
|
+
* Checks the cards that expire before their renewal. A failure is logged, never
|
|
8
|
+
* thrown, so the next hourly run tries again.
|
|
9
|
+
*/
|
|
10
|
+
export declare class BillingLifecycleCron {
|
|
11
|
+
private readonly cardExpiryWarningService;
|
|
12
|
+
private readonly logger;
|
|
13
|
+
constructor(cardExpiryWarningService: CardExpiryWarningService, logger: AppLoggingService);
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=billing-lifecycle.cron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-lifecycle.cron.d.ts","sourceRoot":"","sources":["../../../../src/foundations/billing/cron/billing-lifecycle.cron.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF;;;;;;GAMG;AACH,qBACa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,wBAAwB,EAAE,wBAAwB,EAClD,MAAM,EAAE,iBAAiB;IAItC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAU3B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.BillingLifecycleCron = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const schedule_1 = require("@nestjs/schedule");
|
|
15
|
+
const logging_service_1 = require("../../../core/logging/services/logging.service");
|
|
16
|
+
const card_expiry_warning_service_1 = require("../services/card-expiry-warning.service");
|
|
17
|
+
/**
|
|
18
|
+
* BillingLifecycleCron — hourly billing housekeeping, registered on worker
|
|
19
|
+
* instances only (`createWorkerProvider`).
|
|
20
|
+
*
|
|
21
|
+
* Checks the cards that expire before their renewal. A failure is logged, never
|
|
22
|
+
* thrown, so the next hourly run tries again.
|
|
23
|
+
*/
|
|
24
|
+
let BillingLifecycleCron = class BillingLifecycleCron {
|
|
25
|
+
constructor(cardExpiryWarningService, logger) {
|
|
26
|
+
this.cardExpiryWarningService = cardExpiryWarningService;
|
|
27
|
+
this.logger = logger;
|
|
28
|
+
}
|
|
29
|
+
async run() {
|
|
30
|
+
const now = new Date();
|
|
31
|
+
try {
|
|
32
|
+
const { checked, warned } = await this.cardExpiryWarningService.processDue({ now });
|
|
33
|
+
this.logger.log(`Billing lifecycle: ${checked} card(s) checked, ${warned} warned`, "BillingLifecycleCron");
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.logger.error(`Failed to check expiring cards: ${error.message}`, "BillingLifecycleCron");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.BillingLifecycleCron = BillingLifecycleCron;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, schedule_1.Cron)(schedule_1.CronExpression.EVERY_HOUR),
|
|
43
|
+
__metadata("design:type", Function),
|
|
44
|
+
__metadata("design:paramtypes", []),
|
|
45
|
+
__metadata("design:returntype", Promise)
|
|
46
|
+
], BillingLifecycleCron.prototype, "run", null);
|
|
47
|
+
exports.BillingLifecycleCron = BillingLifecycleCron = __decorate([
|
|
48
|
+
(0, common_1.Injectable)(),
|
|
49
|
+
__metadata("design:paramtypes", [card_expiry_warning_service_1.CardExpiryWarningService,
|
|
50
|
+
logging_service_1.AppLoggingService])
|
|
51
|
+
], BillingLifecycleCron);
|
|
52
|
+
//# sourceMappingURL=billing-lifecycle.cron.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-lifecycle.cron.js","sourceRoot":"","sources":["../../../../src/foundations/billing/cron/billing-lifecycle.cron.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAwD;AACxD,oFAAmF;AACnF,yFAAmF;AAEnF;;;;;;GAMG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACmB,wBAAkD,EAClD,MAAyB;QADzB,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,WAAM,GAAN,MAAM,CAAmB;IACzC,CAAC;IAGE,AAAN,KAAK,CAAC,GAAG;QACP,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QAEvB,IAAI,CAAC;YACH,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YACpF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,OAAO,qBAAqB,MAAM,SAAS,EAAE,sBAAsB,CAAC,CAAC;QAC7G,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAoC,KAAe,CAAC,OAAO,EAAE,EAAE,sBAAsB,CAAC,CAAC;QAC3G,CAAC;IACH,CAAC;CACF,CAAA;AAjBY,oDAAoB;AAOzB;IADL,IAAA,eAAI,EAAC,yBAAc,CAAC,UAAU,CAAC;;;;+CAU/B;+BAhBU,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAGkC,sDAAwB;QAC1C,mCAAiB;GAHjC,oBAAoB,CAiBhC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./billing.module";
|
|
2
|
+
export * from "./interfaces/billing.config.interface";
|
|
3
|
+
export * from "./processors/billing-email.jobs";
|
|
4
|
+
export * from "./processors/billing-email.processor";
|
|
5
|
+
export * from "./cron/billing-lifecycle.cron";
|
|
6
|
+
export * from "./services/card-expiry-warning.service";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/billing/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uCAAuC,CAAC;AAGtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,+BAA+B,CAAC;AAG9C,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
// Module
|
|
18
|
+
__exportStar(require("./billing.module"), exports);
|
|
19
|
+
// Config
|
|
20
|
+
__exportStar(require("./interfaces/billing.config.interface"), exports);
|
|
21
|
+
// Sender
|
|
22
|
+
__exportStar(require("./processors/billing-email.jobs"), exports);
|
|
23
|
+
__exportStar(require("./processors/billing-email.processor"), exports);
|
|
24
|
+
// Cron
|
|
25
|
+
__exportStar(require("./cron/billing-lifecycle.cron"), exports);
|
|
26
|
+
// Services
|
|
27
|
+
__exportStar(require("./services/card-expiry-warning.service"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/billing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,mDAAiC;AAEjC,SAAS;AACT,wEAAsD;AAEtD,SAAS;AACT,kEAAgD;AAChD,uEAAqD;AAErD,OAAO;AACP,gEAA8C;AAE9C,WAAW;AACX,yEAAuD"}
|