@darraghor/nest-backend-libs 5.7.4 → 6.0.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/README.md +87 -36
- package/dist/cli/commands/WriteApiClientCommand.js +1 -2
- package/dist/cli/commands/WriteApiClientCommand.js.map +1 -1
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js +5 -4
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/exports/authorization.d.ts +14 -0
- package/dist/exports/authorization.js +12 -0
- package/dist/exports/authorization.js.map +1 -0
- package/dist/exports/core.d.ts +11 -0
- package/dist/exports/core.js +10 -0
- package/dist/exports/core.js.map +1 -0
- package/dist/exports/database.d.ts +5 -0
- package/dist/exports/database.js +6 -0
- package/dist/exports/database.js.map +1 -0
- package/dist/exports/email.d.ts +4 -0
- package/dist/exports/email.js +4 -0
- package/dist/exports/email.js.map +1 -0
- package/dist/exports/invitations.d.ts +6 -0
- package/dist/exports/invitations.js +6 -0
- package/dist/exports/invitations.js.map +1 -0
- package/dist/exports/organisations.d.ts +11 -0
- package/dist/exports/organisations.js +12 -0
- package/dist/exports/organisations.js.map +1 -0
- package/dist/exports/stripe-legacy.d.ts +6 -0
- package/dist/exports/stripe-legacy.js +7 -0
- package/dist/exports/stripe-legacy.js.map +1 -0
- package/dist/exports/stripe.d.ts +11 -0
- package/dist/exports/stripe.js +9 -0
- package/dist/exports/stripe.js.map +1 -0
- package/dist/exports/twitter.d.ts +5 -0
- package/dist/exports/twitter.js +5 -0
- package/dist/exports/twitter.js.map +1 -0
- package/dist/exports/users.d.ts +10 -0
- package/dist/exports/users.js +11 -0
- package/dist/exports/users.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js +2 -1
- package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js.map +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.js +1 -0
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/StripeClientProvider.js +1 -1
- package/dist/stripe-client/StripeClientProvider.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-checkout-controller.d.ts +1 -0
- package/dist/stripe-client/controllers/stripe-checkout-controller.js +1 -0
- package/dist/stripe-client/controllers/stripe-checkout-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-events-controller.js +1 -0
- package/dist/stripe-client/controllers/stripe-events-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.js +1 -0
- package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-webhook-controller.js +1 -4
- package/dist/stripe-client/controllers/stripe-webhook-controller.js.map +1 -1
- package/dist/stripe-client/services/auth-stripe-checkout.service.js +1 -0
- package/dist/stripe-client/services/auth-stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/services/queued-payment-event.handler.d.ts +1 -0
- package/dist/stripe-client/services/queued-payment-event.handler.js +2 -0
- package/dist/stripe-client/services/queued-payment-event.handler.js.map +1 -1
- package/dist/stripe-client/services/stripe-checkout.service.d.ts +1 -0
- package/dist/stripe-client/services/stripe-checkout.service.js +2 -0
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.d.ts +1 -0
- package/dist/stripe-client/stripe-account.module.js +2 -0
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-account.options.d.ts +2 -0
- package/dist/stripe-client/stripe-account.options.js.map +1 -1
- package/dist/stripe-payments/controllers/secure-stripe-checkout.controller.d.ts +10 -0
- package/dist/stripe-payments/controllers/secure-stripe-checkout.controller.js +65 -0
- package/dist/stripe-payments/controllers/secure-stripe-checkout.controller.js.map +1 -0
- package/dist/stripe-payments/controllers/secure-stripe-events.controller.d.ts +9 -0
- package/dist/stripe-payments/controllers/secure-stripe-events.controller.js +65 -0
- package/dist/stripe-payments/controllers/secure-stripe-events.controller.js.map +1 -0
- package/dist/stripe-payments/controllers/secure-stripe-webhook.controller.d.ts +14 -0
- package/dist/stripe-payments/controllers/secure-stripe-webhook.controller.js +112 -0
- package/dist/stripe-payments/controllers/secure-stripe-webhook.controller.js.map +1 -0
- package/dist/stripe-payments/entities/stripe-checkout-attempt.entity.d.ts +15 -0
- package/dist/stripe-payments/entities/stripe-checkout-attempt.entity.js +88 -0
- package/dist/stripe-payments/entities/stripe-checkout-attempt.entity.js.map +1 -0
- package/dist/stripe-payments/entities/stripe-payment-event.entity.d.ts +16 -0
- package/dist/stripe-payments/entities/stripe-payment-event.entity.js +101 -0
- package/dist/stripe-payments/entities/stripe-payment-event.entity.js.map +1 -0
- package/dist/stripe-payments/entities/stripe-payment-state.entity.d.ts +9 -0
- package/dist/stripe-payments/entities/stripe-payment-state.entity.js +53 -0
- package/dist/stripe-payments/entities/stripe-payment-state.entity.js.map +1 -0
- package/dist/stripe-payments/models/secure-checkout.dto.d.ts +14 -0
- package/dist/stripe-payments/models/secure-checkout.dto.js +105 -0
- package/dist/stripe-payments/models/secure-checkout.dto.js.map +1 -0
- package/dist/stripe-payments/models/secure-payment-response.dto.d.ts +7 -0
- package/dist/stripe-payments/models/secure-payment-response.dto.js +30 -0
- package/dist/stripe-payments/models/secure-payment-response.dto.js.map +1 -0
- package/dist/stripe-payments/services/default-stripe-payments-entitlement-store.d.ts +12 -0
- package/dist/stripe-payments/services/default-stripe-payments-entitlement-store.js +49 -0
- package/dist/stripe-payments/services/default-stripe-payments-entitlement-store.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-checkout.service.d.ts +24 -0
- package/dist/stripe-payments/services/secure-stripe-checkout.service.js +213 -0
- package/dist/stripe-payments/services/secure-stripe-checkout.service.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-client.provider.d.ts +2 -0
- package/dist/stripe-payments/services/secure-stripe-client.provider.js +15 -0
- package/dist/stripe-payments/services/secure-stripe-client.provider.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-product.service.d.ts +9 -0
- package/dist/stripe-payments/services/secure-stripe-product.service.js +54 -0
- package/dist/stripe-payments/services/secure-stripe-product.service.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-webhook.service.d.ts +14 -0
- package/dist/stripe-payments/services/secure-stripe-webhook.service.js +58 -0
- package/dist/stripe-payments/services/secure-stripe-webhook.service.js.map +1 -0
- package/dist/stripe-payments/services/secure-subscription.service.d.ts +18 -0
- package/dist/stripe-payments/services/secure-subscription.service.js +217 -0
- package/dist/stripe-payments/services/secure-subscription.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payment-event.processor.d.ts +15 -0
- package/dist/stripe-payments/services/stripe-payment-event.processor.js +78 -0
- package/dist/stripe-payments/services/stripe-payment-event.processor.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payment-event.service.d.ts +20 -0
- package/dist/stripe-payments/services/stripe-payment-event.service.js +178 -0
- package/dist/stripe-payments/services/stripe-payment-event.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payment-fulfillment.service.d.ts +31 -0
- package/dist/stripe-payments/services/stripe-payment-fulfillment.service.js +331 -0
- package/dist/stripe-payments/services/stripe-payment-fulfillment.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payments-operations.service.d.ts +25 -0
- package/dist/stripe-payments/services/stripe-payments-operations.service.js +59 -0
- package/dist/stripe-payments/services/stripe-payments-operations.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payments-telemetry.service.d.ts +7 -0
- package/dist/stripe-payments/services/stripe-payments-telemetry.service.js +40 -0
- package/dist/stripe-payments/services/stripe-payments-telemetry.service.js.map +1 -0
- package/dist/stripe-payments/stripe-payment.config.d.ts +19 -0
- package/dist/stripe-payments/stripe-payment.config.js +98 -0
- package/dist/stripe-payments/stripe-payment.config.js.map +1 -0
- package/dist/stripe-payments/stripe-payment.config.test.d.ts +1 -0
- package/dist/stripe-payments/stripe-payment.config.test.js +59 -0
- package/dist/stripe-payments/stripe-payment.config.test.js.map +1 -0
- package/dist/stripe-payments/stripe-payments.extensions.d.ts +69 -0
- package/dist/stripe-payments/stripe-payments.extensions.js +30 -0
- package/dist/stripe-payments/stripe-payments.extensions.js.map +1 -0
- package/dist/stripe-payments/stripe-payments.module.d.ts +12 -0
- package/dist/stripe-payments/stripe-payments.module.js +118 -0
- package/dist/stripe-payments/stripe-payments.module.js.map +1 -0
- package/dist/stripe-payments/stripe-payments.options.d.ts +21 -0
- package/dist/stripe-payments/stripe-payments.options.js +2 -0
- package/dist/stripe-payments/stripe-payments.options.js.map +1 -0
- package/dist/typeorm/entities.d.ts +15 -0
- package/dist/typeorm/entities.js +32 -0
- package/dist/typeorm/entities.js.map +1 -0
- package/package.json +85 -38
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { createSecureStripeConfiguration, parseStripeProductCatalog, } from "./stripe-payment.config.js";
|
|
3
|
+
import { SecureStripeProductService } from "./services/secure-stripe-product.service.js";
|
|
4
|
+
describe("secure Stripe payment configuration", () => {
|
|
5
|
+
it("parses the server-side catalog and normalizes the redirect origin", () => {
|
|
6
|
+
const result = createSecureStripeConfiguration({
|
|
7
|
+
accessToken: "sk_test_secret",
|
|
8
|
+
webhookVerificationKey: "whsec_secret",
|
|
9
|
+
redirectsBaseUrl: "https://app.example.com/",
|
|
10
|
+
products: parseStripeProductCatalog(JSON.stringify({
|
|
11
|
+
starter: {
|
|
12
|
+
priceId: "price_starter",
|
|
13
|
+
mode: "subscription",
|
|
14
|
+
internalSku: "starter",
|
|
15
|
+
displayName: "Starter",
|
|
16
|
+
},
|
|
17
|
+
})),
|
|
18
|
+
});
|
|
19
|
+
expect(result.redirectsBaseUrl).toBe("https://app.example.com");
|
|
20
|
+
expect(result.products.get("starter")).toEqual({
|
|
21
|
+
key: "starter",
|
|
22
|
+
priceId: "price_starter",
|
|
23
|
+
mode: "subscription",
|
|
24
|
+
internalSku: "starter",
|
|
25
|
+
displayName: "Starter",
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
it("rejects duplicate price IDs so one price cannot map to two products", () => {
|
|
29
|
+
expect(() => createSecureStripeConfiguration({
|
|
30
|
+
accessToken: "sk_test_secret",
|
|
31
|
+
webhookVerificationKey: "whsec_secret",
|
|
32
|
+
redirectsBaseUrl: "https://app.example.com",
|
|
33
|
+
products: parseStripeProductCatalog(JSON.stringify({
|
|
34
|
+
first: { priceId: "price_same", mode: "payment" },
|
|
35
|
+
second: { priceId: "price_same", mode: "payment" },
|
|
36
|
+
})),
|
|
37
|
+
})).toThrow("Duplicate Stripe price ID");
|
|
38
|
+
});
|
|
39
|
+
it("requires a non-empty server-side catalog", () => {
|
|
40
|
+
expect(() => createSecureStripeConfiguration({
|
|
41
|
+
accessToken: "sk_test_secret",
|
|
42
|
+
webhookVerificationKey: "whsec_secret",
|
|
43
|
+
redirectsBaseUrl: "https://app.example.com",
|
|
44
|
+
products: [],
|
|
45
|
+
})).toThrow("at least one product");
|
|
46
|
+
});
|
|
47
|
+
it("only builds redirects on the configured origin", () => {
|
|
48
|
+
const service = new SecureStripeProductService({
|
|
49
|
+
accessToken: "sk_test_secret",
|
|
50
|
+
webhookVerificationKey: "whsec_secret",
|
|
51
|
+
redirectsBaseUrl: "https://app.example.com",
|
|
52
|
+
products: new Map(),
|
|
53
|
+
});
|
|
54
|
+
expect(service.buildRedirectUrl("/dashboard")).toBe("https://app.example.com/dashboard");
|
|
55
|
+
expect(() => service.buildRedirectUrl("https://evil.example/steal")).toThrow("Redirect path");
|
|
56
|
+
expect(() => service.buildRedirectUrl("//evil.example/steal")).toThrow("Redirect path");
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=stripe-payment.config.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-payment.config.test.js","sourceRoot":"","sources":["../../src/stripe-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2
|
+
export declare const STRIPE_PAYMENTS_ACCESS_POLICY: unique symbol;
|
|
3
|
+
export declare const STRIPE_PAYMENTS_TELEMETRY: unique symbol;
|
|
4
|
+
export declare const STRIPE_PAYMENTS_ENTITLEMENT_STORE: unique symbol;
|
|
5
|
+
export interface StripePaymentsAccessContext {
|
|
6
|
+
organisationUuid: string;
|
|
7
|
+
user: RequestUser;
|
|
8
|
+
operation: "checkout" | "customer-portal";
|
|
9
|
+
}
|
|
10
|
+
export interface StripePaymentsAccessPolicy {
|
|
11
|
+
assertCanManageOrganisation(context: StripePaymentsAccessContext): void | Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface StripePaymentsEntitlement {
|
|
14
|
+
uuid: string;
|
|
15
|
+
organisationUuid: string;
|
|
16
|
+
paymentSystemTransactionId: string;
|
|
17
|
+
paymentSystemCustomerId: string;
|
|
18
|
+
paymentSystemMode: string;
|
|
19
|
+
}
|
|
20
|
+
export interface StripePaymentsEntitlementInput {
|
|
21
|
+
paymentSystemTransactionId: string;
|
|
22
|
+
paymentSystemProductId: string;
|
|
23
|
+
paymentSystemCustomerId: string;
|
|
24
|
+
paymentSystemCustomerEmail: string;
|
|
25
|
+
paymentSystemMode: "subscription" | "payment";
|
|
26
|
+
paymentSystemName: "stripe";
|
|
27
|
+
validUntil: Date;
|
|
28
|
+
internalSku: string;
|
|
29
|
+
productDisplayName: string;
|
|
30
|
+
organisationUuid?: string;
|
|
31
|
+
stripeEventId: string;
|
|
32
|
+
stripeEventCreatedAt: Date;
|
|
33
|
+
stripeStatus: string;
|
|
34
|
+
}
|
|
35
|
+
export type StripePaymentsRevocationInput = Pick<StripePaymentsEntitlementInput, "stripeEventId" | "stripeEventCreatedAt" | "stripeStatus">;
|
|
36
|
+
export interface StripePaymentsEntitlementStore {
|
|
37
|
+
findByUuid(uuid: string): Promise<StripePaymentsEntitlement>;
|
|
38
|
+
findByTransactionId(paymentSystemTransactionId: string): Promise<StripePaymentsEntitlement | null>;
|
|
39
|
+
save(input: StripePaymentsEntitlementInput): Promise<void>;
|
|
40
|
+
revokeCustomerPayments(customerId: string, input: StripePaymentsRevocationInput): Promise<void>;
|
|
41
|
+
revokePayment(paymentSystemTransactionId: string, input: StripePaymentsRevocationInput): Promise<boolean>;
|
|
42
|
+
}
|
|
43
|
+
export type StripePaymentsTelemetryEvent = {
|
|
44
|
+
name: "checkout.created";
|
|
45
|
+
attemptId: number;
|
|
46
|
+
organisationUuid: string;
|
|
47
|
+
productKey: string;
|
|
48
|
+
stripeSessionId: string;
|
|
49
|
+
} | {
|
|
50
|
+
name: "checkout.failed";
|
|
51
|
+
attemptId: number;
|
|
52
|
+
organisationUuid: string;
|
|
53
|
+
productKey: string;
|
|
54
|
+
error: string;
|
|
55
|
+
} | {
|
|
56
|
+
name: "webhook.received" | "webhook.processed" | "webhook.failed";
|
|
57
|
+
stripeEventId: string;
|
|
58
|
+
eventType: string;
|
|
59
|
+
error?: string;
|
|
60
|
+
};
|
|
61
|
+
export interface StripePaymentsTelemetry {
|
|
62
|
+
record(event: StripePaymentsTelemetryEvent): void | Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
export declare class DefaultStripePaymentsAccessPolicy implements StripePaymentsAccessPolicy {
|
|
65
|
+
assertCanManageOrganisation(context: StripePaymentsAccessContext): void;
|
|
66
|
+
}
|
|
67
|
+
export declare class NoopStripePaymentsTelemetry implements StripePaymentsTelemetry {
|
|
68
|
+
record(): void;
|
|
69
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { ForbiddenException, Injectable } from "@nestjs/common";
|
|
8
|
+
export const STRIPE_PAYMENTS_ACCESS_POLICY = Symbol("STRIPE_PAYMENTS_ACCESS_POLICY");
|
|
9
|
+
export const STRIPE_PAYMENTS_TELEMETRY = Symbol("STRIPE_PAYMENTS_TELEMETRY");
|
|
10
|
+
export const STRIPE_PAYMENTS_ENTITLEMENT_STORE = Symbol("STRIPE_PAYMENTS_ENTITLEMENT_STORE");
|
|
11
|
+
let DefaultStripePaymentsAccessPolicy = class DefaultStripePaymentsAccessPolicy {
|
|
12
|
+
assertCanManageOrganisation(context) {
|
|
13
|
+
const isOwner = context.user.memberships
|
|
14
|
+
?.filter((membership) => membership.roles?.some((role) => role.name === "owner"))
|
|
15
|
+
.some((membership) => membership.organisation.uuid === context.organisationUuid);
|
|
16
|
+
if (!isOwner) {
|
|
17
|
+
throw new ForbiddenException("You are not the owner of this organisation");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
DefaultStripePaymentsAccessPolicy = __decorate([
|
|
22
|
+
Injectable()
|
|
23
|
+
], DefaultStripePaymentsAccessPolicy);
|
|
24
|
+
export { DefaultStripePaymentsAccessPolicy };
|
|
25
|
+
export class NoopStripePaymentsTelemetry {
|
|
26
|
+
record() {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=stripe-payments.extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-payments.extensions.js","sourceRoot":"","sources":["../../src/stripe-payments/stripe-payments.extensions.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAG9D,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAC/C,+BAA+B,CAClC,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CACnD,mCAAmC,CACtC,CAAC;AAsFK,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC1C,2BAA2B,CAAC,OAAoC;QAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW;YACpC,EAAE,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CACpB,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAC1D;aACA,IAAI,CACD,CAAC,UAAU,EAAE,EAAE,CACX,UAAU,CAAC,YAAY,CAAC,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAChE,CAAC;QACN,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,MAAM,IAAI,kBAAkB,CACxB,4CAA4C,CAC/C,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAA;AAhBY,iCAAiC;IAD7C,UAAU,EAAE;GACA,iCAAiC,CAgB7C;;AAED,MAAM,OAAO,2BAA2B;IACpC,MAAM;QACF,OAAO;IACX,CAAC;CACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DynamicModule } from "@nestjs/common";
|
|
2
|
+
import { StripePaymentsModuleAsyncOptions } from "./stripe-payments.options.js";
|
|
3
|
+
/**
|
|
4
|
+
* Opinionated Stripe payments for organisation-based applications.
|
|
5
|
+
*
|
|
6
|
+
* The module owns the Stripe boundary, product catalog, idempotency records,
|
|
7
|
+
* durable webhook inbox, retries, replay, and subscription state updates.
|
|
8
|
+
* Applications provide only their server-side Stripe configuration and catalog.
|
|
9
|
+
*/
|
|
10
|
+
export declare class StripePaymentsModule {
|
|
11
|
+
static forRootAsync(options: StripePaymentsModuleAsyncOptions): DynamicModule;
|
|
12
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var StripePaymentsModule_1;
|
|
8
|
+
import { BullModule } from "@nestjs/bullmq";
|
|
9
|
+
import { Module } from "@nestjs/common";
|
|
10
|
+
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
11
|
+
import { Organisation } from "../organisation/entities/organisation.entity.js";
|
|
12
|
+
import { OrganisationSubscriptionsModule } from "../organisation-subscriptions/organisation-subscriptions.module.js";
|
|
13
|
+
import { OrganisationSubscriptionRecord } from "../organisation-subscriptions/entities/organisation-subscription.entity.js";
|
|
14
|
+
import { SubActivationQueueModule } from "../organisation-subscriptions/sub-activation-queue.module.js";
|
|
15
|
+
import { PaymentSessionModule } from "../payment-sessions/payment-session.module.js";
|
|
16
|
+
import { StripeCheckoutAttempt } from "./entities/stripe-checkout-attempt.entity.js";
|
|
17
|
+
import { StripeCheckoutEvent } from "./entities/stripe-payment-event.entity.js";
|
|
18
|
+
import { StripePaymentState } from "./entities/stripe-payment-state.entity.js";
|
|
19
|
+
import { SecureStripeCheckoutController } from "./controllers/secure-stripe-checkout.controller.js";
|
|
20
|
+
import { SecureStripeEventsController } from "./controllers/secure-stripe-events.controller.js";
|
|
21
|
+
import { SecureStripeWebhookController } from "./controllers/secure-stripe-webhook.controller.js";
|
|
22
|
+
import { secureStripeConfigurationProvider } from "./stripe-payment.config.js";
|
|
23
|
+
import { STRIPE_PAYMENTS_OPTIONS, } from "./stripe-payments.options.js";
|
|
24
|
+
import { secureStripeClientProvider } from "./services/secure-stripe-client.provider.js";
|
|
25
|
+
import { SecureStripeCheckoutService } from "./services/secure-stripe-checkout.service.js";
|
|
26
|
+
import { SecureStripeProductService } from "./services/secure-stripe-product.service.js";
|
|
27
|
+
import { SecureStripeWebhookService } from "./services/secure-stripe-webhook.service.js";
|
|
28
|
+
import { SecureSubscriptionService } from "./services/secure-subscription.service.js";
|
|
29
|
+
import { StripePaymentEventProcessor } from "./services/stripe-payment-event.processor.js";
|
|
30
|
+
import { StripePaymentEventService } from "./services/stripe-payment-event.service.js";
|
|
31
|
+
import { StripePaymentFulfillmentService } from "./services/stripe-payment-fulfillment.service.js";
|
|
32
|
+
import { DefaultStripePaymentsAccessPolicy, NoopStripePaymentsTelemetry, STRIPE_PAYMENTS_ACCESS_POLICY, STRIPE_PAYMENTS_ENTITLEMENT_STORE, STRIPE_PAYMENTS_TELEMETRY, } from "./stripe-payments.extensions.js";
|
|
33
|
+
import { StripePaymentsTelemetryService } from "./services/stripe-payments-telemetry.service.js";
|
|
34
|
+
import { StripePaymentsOperationsService } from "./services/stripe-payments-operations.service.js";
|
|
35
|
+
import { DefaultStripePaymentsEntitlementStore } from "./services/default-stripe-payments-entitlement-store.js";
|
|
36
|
+
/**
|
|
37
|
+
* Opinionated Stripe payments for organisation-based applications.
|
|
38
|
+
*
|
|
39
|
+
* The module owns the Stripe boundary, product catalog, idempotency records,
|
|
40
|
+
* durable webhook inbox, retries, replay, and subscription state updates.
|
|
41
|
+
* Applications provide only their server-side Stripe configuration and catalog.
|
|
42
|
+
*/
|
|
43
|
+
let StripePaymentsModule = StripePaymentsModule_1 = class StripePaymentsModule {
|
|
44
|
+
static forRootAsync(options) {
|
|
45
|
+
return {
|
|
46
|
+
module: StripePaymentsModule_1,
|
|
47
|
+
global: options.isGlobal ?? false,
|
|
48
|
+
imports: [
|
|
49
|
+
...(options.imports ?? []),
|
|
50
|
+
BullModule.registerQueue({ name: "stripe-events" }),
|
|
51
|
+
OrganisationSubscriptionsModule,
|
|
52
|
+
SubActivationQueueModule,
|
|
53
|
+
PaymentSessionModule,
|
|
54
|
+
TypeOrmModule.forFeature([
|
|
55
|
+
Organisation,
|
|
56
|
+
OrganisationSubscriptionRecord,
|
|
57
|
+
StripeCheckoutAttempt,
|
|
58
|
+
StripeCheckoutEvent,
|
|
59
|
+
StripePaymentState,
|
|
60
|
+
]),
|
|
61
|
+
],
|
|
62
|
+
providers: [
|
|
63
|
+
{
|
|
64
|
+
provide: STRIPE_PAYMENTS_OPTIONS,
|
|
65
|
+
useFactory: options.useFactory,
|
|
66
|
+
inject: options.inject ?? [],
|
|
67
|
+
},
|
|
68
|
+
secureStripeConfigurationProvider,
|
|
69
|
+
secureStripeClientProvider,
|
|
70
|
+
SecureStripeProductService,
|
|
71
|
+
SecureStripeCheckoutService,
|
|
72
|
+
SecureSubscriptionService,
|
|
73
|
+
DefaultStripePaymentsEntitlementStore,
|
|
74
|
+
StripePaymentEventService,
|
|
75
|
+
SecureStripeWebhookService,
|
|
76
|
+
StripePaymentFulfillmentService,
|
|
77
|
+
StripePaymentEventProcessor,
|
|
78
|
+
StripePaymentsTelemetryService,
|
|
79
|
+
StripePaymentsOperationsService,
|
|
80
|
+
{
|
|
81
|
+
provide: STRIPE_PAYMENTS_ACCESS_POLICY,
|
|
82
|
+
useClass: DefaultStripePaymentsAccessPolicy,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
provide: STRIPE_PAYMENTS_TELEMETRY,
|
|
86
|
+
useClass: NoopStripePaymentsTelemetry,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
provide: STRIPE_PAYMENTS_ENTITLEMENT_STORE,
|
|
90
|
+
useExisting: DefaultStripePaymentsEntitlementStore,
|
|
91
|
+
},
|
|
92
|
+
...(options.providers ?? []),
|
|
93
|
+
],
|
|
94
|
+
controllers: [
|
|
95
|
+
SecureStripeCheckoutController,
|
|
96
|
+
SecureStripeEventsController,
|
|
97
|
+
SecureStripeWebhookController,
|
|
98
|
+
],
|
|
99
|
+
exports: [
|
|
100
|
+
BullModule,
|
|
101
|
+
SecureStripeProductService,
|
|
102
|
+
SecureStripeCheckoutService,
|
|
103
|
+
SecureSubscriptionService,
|
|
104
|
+
StripePaymentEventService,
|
|
105
|
+
StripePaymentsOperationsService,
|
|
106
|
+
StripePaymentsTelemetryService,
|
|
107
|
+
STRIPE_PAYMENTS_ACCESS_POLICY,
|
|
108
|
+
STRIPE_PAYMENTS_ENTITLEMENT_STORE,
|
|
109
|
+
STRIPE_PAYMENTS_TELEMETRY,
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
StripePaymentsModule = StripePaymentsModule_1 = __decorate([
|
|
115
|
+
Module({})
|
|
116
|
+
], StripePaymentsModule);
|
|
117
|
+
export { StripePaymentsModule };
|
|
118
|
+
//# sourceMappingURL=stripe-payments.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-payments.module.js","sourceRoot":"","sources":["../../src/stripe-payments/stripe-payments.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAgB,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAC,+BAA+B,EAAC,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAC,8BAA8B,EAAC,MAAM,4EAA4E,CAAC;AAC1H,OAAO,EAAC,wBAAwB,EAAC,MAAM,8DAA8D,CAAC;AACtG,OAAO,EAAC,oBAAoB,EAAC,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAC,qBAAqB,EAAC,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2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EAAE,CAAC;GACE,oBAAoB,CAwEhC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ModuleMetadata } from "@nestjs/common";
|
|
2
|
+
export declare const STRIPE_PAYMENTS_OPTIONS = "StripePaymentsOptions";
|
|
3
|
+
export type StripePaymentsMode = "subscription" | "payment";
|
|
4
|
+
export interface StripePaymentsProduct {
|
|
5
|
+
key: string;
|
|
6
|
+
priceId: string;
|
|
7
|
+
mode: StripePaymentsMode;
|
|
8
|
+
internalSku?: string;
|
|
9
|
+
displayName?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface StripePaymentsModuleOptions {
|
|
12
|
+
accessToken: string;
|
|
13
|
+
webhookVerificationKey: string;
|
|
14
|
+
redirectsBaseUrl: string;
|
|
15
|
+
products: readonly StripePaymentsProduct[];
|
|
16
|
+
}
|
|
17
|
+
export interface StripePaymentsModuleAsyncOptions extends Pick<ModuleMetadata, "imports" | "providers"> {
|
|
18
|
+
useFactory: (...arguments_: any[]) => Promise<StripePaymentsModuleOptions> | StripePaymentsModuleOptions;
|
|
19
|
+
inject?: any[];
|
|
20
|
+
isGlobal?: boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-payments.options.js","sourceRoot":"","sources":["../../src/stripe-payments/stripe-payments.options.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Invitation } from "../invitations/entities/invitation.entity.js";
|
|
2
|
+
import { OrganisationMembership } from "../organisation-memberships/entities/organisation-membership.entity.js";
|
|
3
|
+
import { OrganisationSubscriptionRecord } from "../organisation-subscriptions/entities/organisation-subscription.entity.js";
|
|
4
|
+
import { MembershipRole } from "../organisation/entities/member-role.entity.js";
|
|
5
|
+
import { Organisation } from "../organisation/entities/organisation.entity.js";
|
|
6
|
+
import { PaymentSessionReference } from "../payment-sessions/payment-session.entity.js";
|
|
7
|
+
import { Email } from "../smtp-email-client/email.entity.js";
|
|
8
|
+
import { StripeCheckoutEvent as LegacyStripeCheckoutEvent } from "../stripe-client/entities/stripe-checkout-event.entity.js";
|
|
9
|
+
import { StripeCheckoutAttempt } from "../stripe-payments/entities/stripe-checkout-attempt.entity.js";
|
|
10
|
+
import { StripeCheckoutEvent } from "../stripe-payments/entities/stripe-payment-event.entity.js";
|
|
11
|
+
import { StripePaymentState } from "../stripe-payments/entities/stripe-payment-state.entity.js";
|
|
12
|
+
import { UserApiKey } from "../user-api-key/userApiKey.entity.js";
|
|
13
|
+
import { User } from "../user/entities/user.entity.js";
|
|
14
|
+
export declare const STRIPE_PAYMENTS_ENTITIES: readonly [typeof StripeCheckoutAttempt, typeof StripeCheckoutEvent, typeof StripePaymentState];
|
|
15
|
+
export declare const NEST_BACKEND_LIB_ENTITIES: readonly [typeof Invitation, typeof OrganisationMembership, typeof OrganisationSubscriptionRecord, typeof MembershipRole, typeof Organisation, typeof PaymentSessionReference, typeof Email, typeof LegacyStripeCheckoutEvent, typeof StripeCheckoutAttempt, typeof StripeCheckoutEvent, typeof StripePaymentState, typeof UserApiKey, typeof User];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Invitation } from "../invitations/entities/invitation.entity.js";
|
|
2
|
+
import { OrganisationMembership } from "../organisation-memberships/entities/organisation-membership.entity.js";
|
|
3
|
+
import { OrganisationSubscriptionRecord } from "../organisation-subscriptions/entities/organisation-subscription.entity.js";
|
|
4
|
+
import { MembershipRole } from "../organisation/entities/member-role.entity.js";
|
|
5
|
+
import { Organisation } from "../organisation/entities/organisation.entity.js";
|
|
6
|
+
import { PaymentSessionReference } from "../payment-sessions/payment-session.entity.js";
|
|
7
|
+
import { Email } from "../smtp-email-client/email.entity.js";
|
|
8
|
+
import { StripeCheckoutEvent as LegacyStripeCheckoutEvent } from "../stripe-client/entities/stripe-checkout-event.entity.js";
|
|
9
|
+
import { StripeCheckoutAttempt } from "../stripe-payments/entities/stripe-checkout-attempt.entity.js";
|
|
10
|
+
import { StripeCheckoutEvent } from "../stripe-payments/entities/stripe-payment-event.entity.js";
|
|
11
|
+
import { StripePaymentState } from "../stripe-payments/entities/stripe-payment-state.entity.js";
|
|
12
|
+
import { UserApiKey } from "../user-api-key/userApiKey.entity.js";
|
|
13
|
+
import { User } from "../user/entities/user.entity.js";
|
|
14
|
+
export const STRIPE_PAYMENTS_ENTITIES = [
|
|
15
|
+
StripeCheckoutAttempt,
|
|
16
|
+
StripeCheckoutEvent,
|
|
17
|
+
StripePaymentState,
|
|
18
|
+
];
|
|
19
|
+
export const NEST_BACKEND_LIB_ENTITIES = [
|
|
20
|
+
Invitation,
|
|
21
|
+
OrganisationMembership,
|
|
22
|
+
OrganisationSubscriptionRecord,
|
|
23
|
+
MembershipRole,
|
|
24
|
+
Organisation,
|
|
25
|
+
PaymentSessionReference,
|
|
26
|
+
Email,
|
|
27
|
+
LegacyStripeCheckoutEvent,
|
|
28
|
+
...STRIPE_PAYMENTS_ENTITIES,
|
|
29
|
+
UserApiKey,
|
|
30
|
+
User,
|
|
31
|
+
];
|
|
32
|
+
//# sourceMappingURL=entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/typeorm/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,8CAA8C,CAAC;AACxE,OAAO,EAAC,sBAAsB,EAAC,MAAM,wEAAwE,CAAC;AAC9G,OAAO,EAAC,8BAA8B,EAAC,MAAM,4EAA4E,CAAC;AAC1H,OAAO,EAAC,cAAc,EAAC,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAC,uBAAuB,EAAC,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAC,KAAK,EAAC,MAAM,sCAAsC,CAAC;AAC3D,OAAO,EAAC,mBAAmB,IAAI,yBAAyB,EAAC,MAAM,2DAA2D,CAAC;AAC3H,OAAO,EAAC,qBAAqB,EAAC,MAAM,+DAA+D,CAAC;AACpG,OAAO,EAAC,mBAAmB,EAAC,MAAM,4DAA4D,CAAC;AAC/F,OAAO,EAAC,kBAAkB,EAAC,MAAM,4DAA4D,CAAC;AAC9F,OAAO,EAAC,UAAU,EAAC,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,qBAAqB;IACrB,mBAAmB;IACnB,kBAAkB;CACZ,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,UAAU;IACV,sBAAsB;IACtB,8BAA8B;IAC9B,cAAc;IACd,YAAY;IACZ,uBAAuB;IACvB,KAAK;IACL,yBAAyB;IACzB,GAAG,wBAAwB;IAC3B,UAAU;IACV,IAAI;CACE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darraghor/nest-backend-libs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"description": "Some helpers for personal projects in nestjs",
|
|
6
6
|
"homepage": "https://github.com/darraghoriordan/nest-backend-libs",
|
|
@@ -28,6 +28,46 @@
|
|
|
28
28
|
".": {
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./authorization": {
|
|
33
|
+
"types": "./dist/exports/authorization.d.ts",
|
|
34
|
+
"import": "./dist/exports/authorization.js"
|
|
35
|
+
},
|
|
36
|
+
"./core": {
|
|
37
|
+
"types": "./dist/exports/core.d.ts",
|
|
38
|
+
"import": "./dist/exports/core.js"
|
|
39
|
+
},
|
|
40
|
+
"./database": {
|
|
41
|
+
"types": "./dist/exports/database.d.ts",
|
|
42
|
+
"import": "./dist/exports/database.js"
|
|
43
|
+
},
|
|
44
|
+
"./email": {
|
|
45
|
+
"types": "./dist/exports/email.d.ts",
|
|
46
|
+
"import": "./dist/exports/email.js"
|
|
47
|
+
},
|
|
48
|
+
"./invitations": {
|
|
49
|
+
"types": "./dist/exports/invitations.d.ts",
|
|
50
|
+
"import": "./dist/exports/invitations.js"
|
|
51
|
+
},
|
|
52
|
+
"./organisations": {
|
|
53
|
+
"types": "./dist/exports/organisations.d.ts",
|
|
54
|
+
"import": "./dist/exports/organisations.js"
|
|
55
|
+
},
|
|
56
|
+
"./stripe": {
|
|
57
|
+
"types": "./dist/exports/stripe.d.ts",
|
|
58
|
+
"import": "./dist/exports/stripe.js"
|
|
59
|
+
},
|
|
60
|
+
"./stripe-legacy": {
|
|
61
|
+
"types": "./dist/exports/stripe-legacy.d.ts",
|
|
62
|
+
"import": "./dist/exports/stripe-legacy.js"
|
|
63
|
+
},
|
|
64
|
+
"./twitter": {
|
|
65
|
+
"types": "./dist/exports/twitter.d.ts",
|
|
66
|
+
"import": "./dist/exports/twitter.js"
|
|
67
|
+
},
|
|
68
|
+
"./users": {
|
|
69
|
+
"types": "./dist/exports/users.d.ts",
|
|
70
|
+
"import": "./dist/exports/users.js"
|
|
31
71
|
}
|
|
32
72
|
},
|
|
33
73
|
"keywords": [
|
|
@@ -37,6 +77,11 @@
|
|
|
37
77
|
"access": "public",
|
|
38
78
|
"provenance": true
|
|
39
79
|
},
|
|
80
|
+
"pnpm": {
|
|
81
|
+
"overrides": {
|
|
82
|
+
"conventional-changelog-conventionalcommits": "7.0.2"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
40
85
|
"bin": {
|
|
41
86
|
"miller": "dist/cli/cli.js",
|
|
42
87
|
"generate-client": "dist/open-api-generation/generate.sh"
|
|
@@ -77,30 +122,32 @@
|
|
|
77
122
|
"dependencies": {
|
|
78
123
|
"@keyv/redis": "5.1.6",
|
|
79
124
|
"@nestjs/axios": "4.0.1",
|
|
80
|
-
"@nestjs/
|
|
81
|
-
"@nestjs/
|
|
125
|
+
"@nestjs/bullmq": "11.0.4",
|
|
126
|
+
"@nestjs/cache-manager": "3.1.3",
|
|
127
|
+
"@nestjs/common": "11.1.28",
|
|
82
128
|
"@nestjs/config": "4.0.4",
|
|
83
|
-
"@nestjs/core": "11.1.
|
|
84
|
-
"@nestjs/microservices": "11.1.
|
|
129
|
+
"@nestjs/core": "11.1.28",
|
|
130
|
+
"@nestjs/microservices": "11.1.28",
|
|
85
131
|
"@nestjs/passport": "11.0.5",
|
|
86
|
-
"@nestjs/platform-express": "11.1.
|
|
87
|
-
"@nestjs/swagger": "11.4.
|
|
132
|
+
"@nestjs/platform-express": "11.1.28",
|
|
133
|
+
"@nestjs/swagger": "11.4.6",
|
|
88
134
|
"@nestjs/terminus": "11.1.1",
|
|
89
|
-
"@nestjs/typeorm": "11.0.
|
|
135
|
+
"@nestjs/typeorm": "11.0.3",
|
|
90
136
|
"add": "2.0.6",
|
|
91
|
-
"auth0": "
|
|
92
|
-
"axios": "1.
|
|
93
|
-
"
|
|
137
|
+
"auth0": "6.0.0",
|
|
138
|
+
"axios": "1.18.1",
|
|
139
|
+
"bullmq": "5.80.8",
|
|
140
|
+
"cache-manager": "7.2.9",
|
|
94
141
|
"chalk": "5.6.2",
|
|
95
142
|
"class-transformer": "0.5.1",
|
|
96
|
-
"class-validator": "0.
|
|
97
|
-
"date-fns": "4.
|
|
143
|
+
"class-validator": "0.15.1",
|
|
144
|
+
"date-fns": "4.4.0",
|
|
98
145
|
"dotenv": "17.4.2",
|
|
99
|
-
"helmet": "8.
|
|
100
|
-
"jwks-rsa": "4.0
|
|
146
|
+
"helmet": "8.3.0",
|
|
147
|
+
"jwks-rsa": "4.1.0",
|
|
101
148
|
"nanoid": "6.0.0",
|
|
102
149
|
"nestjs-pino": "4.6.1",
|
|
103
|
-
"nodemailer": "
|
|
150
|
+
"nodemailer": "9.0.3",
|
|
104
151
|
"passport": "0.7.0",
|
|
105
152
|
"passport-headerapikey": "1.2.2",
|
|
106
153
|
"passport-jwt": "4.0.1",
|
|
@@ -110,47 +157,47 @@
|
|
|
110
157
|
"reflect-metadata": "0.2.2",
|
|
111
158
|
"rimraf": "6.1.3",
|
|
112
159
|
"rxjs": "7.8.2",
|
|
113
|
-
"stripe": "22.
|
|
160
|
+
"stripe": "22.3.2",
|
|
114
161
|
"swagger-ui-express": "5.0.1",
|
|
115
162
|
"twitter-api-v2": "1.29.0",
|
|
116
|
-
"typeorm": "0.3.
|
|
163
|
+
"typeorm": "0.3.27"
|
|
117
164
|
},
|
|
118
165
|
"devDependencies": {
|
|
119
|
-
"@commitlint/cli": "21.
|
|
120
|
-
"@commitlint/config-conventional": "21.0
|
|
121
|
-
"@darraghor/eslint-plugin-nestjs-typed": "7.
|
|
166
|
+
"@commitlint/cli": "21.2.1",
|
|
167
|
+
"@commitlint/config-conventional": "21.2.0",
|
|
168
|
+
"@darraghor/eslint-plugin-nestjs-typed": "7.2.5",
|
|
122
169
|
"@eslint/js": "10.0.1",
|
|
123
|
-
"@nestjs/cli": "11.0.
|
|
170
|
+
"@nestjs/cli": "11.0.24",
|
|
124
171
|
"@nestjs/schematics": "^11.1.0",
|
|
125
|
-
"@nestjs/testing": "11.1.
|
|
172
|
+
"@nestjs/testing": "11.1.28",
|
|
126
173
|
"@semantic-release/changelog": "6.0.3",
|
|
127
174
|
"@semantic-release/exec": "7.1.0",
|
|
128
175
|
"@types/auth0": "3.3.11",
|
|
129
176
|
"@types/express": "5.0.6",
|
|
130
|
-
"@types/node": "
|
|
131
|
-
"@types/nodemailer": "8.0.
|
|
177
|
+
"@types/node": "26.1.1",
|
|
178
|
+
"@types/nodemailer": "8.0.1",
|
|
132
179
|
"@types/passport-jwt": "4.0.1",
|
|
133
|
-
"@types/supertest": "7.2.
|
|
180
|
+
"@types/supertest": "7.2.1",
|
|
134
181
|
"@types/yargs": "17.0.35",
|
|
135
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
136
|
-
"@typescript-eslint/parser": "8.
|
|
182
|
+
"@typescript-eslint/eslint-plugin": "8.64.0",
|
|
183
|
+
"@typescript-eslint/parser": "8.64.0",
|
|
137
184
|
"copyfiles": "2.4.1",
|
|
138
185
|
"eslint": "10.7.0",
|
|
139
186
|
"eslint-config-prettier": "10.1.8",
|
|
140
|
-
"eslint-plugin-sonarjs": "4.0
|
|
187
|
+
"eslint-plugin-sonarjs": "4.2.0",
|
|
141
188
|
"eslint-plugin-unicorn": "72.0.0",
|
|
142
|
-
"globals": "17.
|
|
189
|
+
"globals": "17.7.0",
|
|
143
190
|
"husky": "9.1.7",
|
|
144
|
-
"knip": "6.
|
|
145
|
-
"lint-staged": "17.0.
|
|
146
|
-
"prettier": "3.
|
|
147
|
-
"semantic-release": "25.0.
|
|
148
|
-
"ts-loader": "9.
|
|
191
|
+
"knip": "6.27.0",
|
|
192
|
+
"lint-staged": "17.0.8",
|
|
193
|
+
"prettier": "3.9.5",
|
|
194
|
+
"semantic-release": "25.0.8",
|
|
195
|
+
"ts-loader": "9.6.2",
|
|
149
196
|
"ts-node": "10.9.2",
|
|
150
197
|
"tsconfig-paths": "4.2.0",
|
|
151
|
-
"typescript": "
|
|
152
|
-
"typescript-eslint": "8.
|
|
153
|
-
"vitest": "4.1.
|
|
198
|
+
"typescript": "5.9.3",
|
|
199
|
+
"typescript-eslint": "8.64.0",
|
|
200
|
+
"vitest": "4.1.10",
|
|
154
201
|
"yargs": "18.0.0"
|
|
155
202
|
},
|
|
156
203
|
"lint-staged": {
|