@saasicat/adapter-prisma 0.27.0 → 1.0.0-rc.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 +4 -4
- package/dist/.build-stamp +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ transaction rollback and atomic promo claims are verified, not asserted.
|
|
|
15
15
|
import { prismaPersistence } from '@saasicat/adapter-prisma';
|
|
16
16
|
import { PrismaService } from './prisma/prisma.service';
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
SaaSiCatModule.forRoot({
|
|
19
19
|
planCatalog: loadPlanCatalogFromFile({ path: 'config/saas.yaml' }),
|
|
20
20
|
controller: { guards: [JwtAuthGuard] },
|
|
21
21
|
imports: [AuthModule],
|
|
@@ -26,8 +26,8 @@ SaasPlatformModule.forRoot({
|
|
|
26
26
|
|
|
27
27
|
`prismaPersistence({ client })` accepts your `PrismaService` class token (or
|
|
28
28
|
a ready `PrismaLike` instance in tests) and returns a
|
|
29
|
-
`
|
|
30
|
-
for every shipped port. `
|
|
29
|
+
`SaaSiCatPersistenceAdapter` bundle: declared capabilities + provider specs
|
|
30
|
+
for every shipped port. `SaaSiCatModule.forRoot` validates the
|
|
31
31
|
capabilities fail-fast (entitlement requires transactions + row locks) and
|
|
32
32
|
wires the slices; individual `adapters` entries still override field by field.
|
|
33
33
|
|
|
@@ -42,7 +42,7 @@ Options:
|
|
|
42
42
|
|
|
43
43
|
The bundle also ships `planCatalogReadSink` for DB hydration. To use it,
|
|
44
44
|
omit `planCatalog` and pass the identity the database cannot provide:
|
|
45
|
-
`
|
|
45
|
+
`SaaSiCatModule.forRoot({ persistence, dbCatalog: { projectKey,
|
|
46
46
|
currency, vatRate } })` — without `dbCatalog` the module refuses to boot
|
|
47
47
|
(the sink would otherwise load an empty catalog for project key `''`).
|
|
48
48
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1ad49927d8203770b48475b7bd5497dd99dd355e48c11cff4eed67dce3d64ed5
|
package/dist/index.cjs
CHANGED
|
@@ -2131,7 +2131,7 @@ PrismaMfaAdapter = _ts_decorate9([
|
|
|
2131
2131
|
])
|
|
2132
2132
|
], PrismaMfaAdapter);
|
|
2133
2133
|
|
|
2134
|
-
// src/prisma-plan-catalog-import-sink.ts
|
|
2134
|
+
// src/prisma-plan-catalog-import-sink.adapter.ts
|
|
2135
2135
|
var import_common10 = require("@nestjs/common");
|
|
2136
2136
|
function _ts_decorate10(decorators, target, key, desc) {
|
|
2137
2137
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2285,7 +2285,7 @@ PrismaPlanCatalogImportSink = _ts_decorate10([
|
|
|
2285
2285
|
])
|
|
2286
2286
|
], PrismaPlanCatalogImportSink);
|
|
2287
2287
|
|
|
2288
|
-
// src/prisma-plan-catalog-read-sink.ts
|
|
2288
|
+
// src/prisma-plan-catalog-read-sink.adapter.ts
|
|
2289
2289
|
var import_common11 = require("@nestjs/common");
|
|
2290
2290
|
function _ts_decorate11(decorators, target, key, desc) {
|
|
2291
2291
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3715,7 +3715,7 @@ PrismaPromoCodeValidationLogRepository = _ts_decorate17([
|
|
|
3715
3715
|
])
|
|
3716
3716
|
], PrismaPromoCodeValidationLogRepository);
|
|
3717
3717
|
|
|
3718
|
-
// src/prisma-promo-subscription-lookup.ts
|
|
3718
|
+
// src/prisma-promo-subscription-lookup.adapter.ts
|
|
3719
3719
|
var import_common18 = require("@nestjs/common");
|
|
3720
3720
|
function _ts_decorate18(decorators, target, key, desc) {
|
|
3721
3721
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4913,7 +4913,7 @@ function clearedPendingVersionData() {
|
|
|
4913
4913
|
}
|
|
4914
4914
|
__name(clearedPendingVersionData, "clearedPendingVersionData");
|
|
4915
4915
|
|
|
4916
|
-
// src/prisma-transaction-runner.ts
|
|
4916
|
+
// src/prisma-transaction-runner.adapter.ts
|
|
4917
4917
|
var import_common25 = require("@nestjs/common");
|
|
4918
4918
|
function _ts_decorate25(decorators, target, key, desc) {
|
|
4919
4919
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4954,7 +4954,7 @@ PrismaTransactionRunner = _ts_decorate25([
|
|
|
4954
4954
|
])
|
|
4955
4955
|
], PrismaTransactionRunner);
|
|
4956
4956
|
|
|
4957
|
-
// src/zero-promo-revenue-aggregator.ts
|
|
4957
|
+
// src/zero-promo-revenue-aggregator.adapter.ts
|
|
4958
4958
|
var import_common26 = require("@nestjs/common");
|
|
4959
4959
|
function _ts_decorate26(decorators, target, key, desc) {
|
|
4960
4960
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, VersionChange, PersistenceInjectionToken, PasswordHasher,
|
|
1
|
+
import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, VersionChange, PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, SubscriptionUsagePort, SubscriptionUsageRecord, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, TenantSubscriptionWritePort, ApplyOnboardingSelectionInput, RedeemPromoInTransactionCallback, ApplyOnboardingSelectionResult, ImmediatePlanChangeInput, ScheduledPlanChangeInput, PlanVersionRepository, PlanVersionRecord, PromoCodeRepository, PromoCodeRecord, PromoCodeFilter, CreatePromoCodeData, UpdatePromoCodeData, PromoCodeRedemptionRepository, PromoCodeRedemptionRecord, PromoCodeRedemptionStatus, PromoCodeRedemptionListItem, PromoCodeValidationLogRepository, PromoSubscriptionLookup, BillingCycle, PromoRevenueDeductionAggregator, SuperAdminProvisioningPort, CreateSuperAdminCliInput, PlatformUserDto, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, UpsertPlanInput, UpsertResult, UpsertPlanVersionInput, UpsertFeatureCatalogEntryInput, PlanRepository, PlanListFilter, PlanRow, CreatePlanData, UpdatePlanData, PlanVersionRow, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, CatalogEntryRepository, CatalogEntryFilter, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, UpsertCapabilityEntryData, UpsertFeatureEntryData, UpsertQuotaEntryData, SetCatalogEntryReviewData, CatalogEntryI18n, UpdateCatalogEntryBaseData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PromotionRepository, PromotionFilter, PromotionRow, CreatePromotionData, UpdatePromotionData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, CreateSubscriptionContractData, TerminateSubscriptionContractData } from '@saasicat/types';
|
|
2
2
|
|
|
3
3
|
declare const PRISMA_CLIENT_TOKEN: unique symbol;
|
|
4
4
|
/** Prisma `Decimal` values arrive as objects with `toString()`; tests may use plain values. */
|
|
@@ -954,11 +954,11 @@ interface PrismaPersistenceOptions {
|
|
|
954
954
|
bundle?: PrismaBundleRepositoryOptions;
|
|
955
955
|
}
|
|
956
956
|
/**
|
|
957
|
-
* Builds the `
|
|
957
|
+
* Builds the `SaaSiCatPersistenceAdapter` bundle for Prisma + PostgreSQL on
|
|
958
958
|
* the canonical schema (`@saasicat/spec` prisma-fragments):
|
|
959
959
|
*
|
|
960
960
|
* ```ts
|
|
961
|
-
*
|
|
961
|
+
* SaaSiCatModule.forRoot({
|
|
962
962
|
* persistence: prismaPersistence({ client: PrismaService }),
|
|
963
963
|
* // ...
|
|
964
964
|
* });
|
|
@@ -968,7 +968,7 @@ interface PrismaPersistenceOptions {
|
|
|
968
968
|
* tenant-billing, promo and plan-catalog persistence. App-specific behavior
|
|
969
969
|
* such as quota counters and authentication remains in the consumer.
|
|
970
970
|
*/
|
|
971
|
-
declare function prismaPersistence(options: PrismaPersistenceOptions):
|
|
971
|
+
declare function prismaPersistence(options: PrismaPersistenceOptions): SaaSiCatPersistenceAdapter;
|
|
972
972
|
|
|
973
973
|
/**
|
|
974
974
|
* `TransactionRunner` over `prisma.$transaction`. The interactive transaction
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, VersionChange, PersistenceInjectionToken, PasswordHasher,
|
|
1
|
+
import { AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminTenantStateResult, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, BundleRepository, TransactionContext, BundleVersionRow, BundleListFilter, BundleRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, VersionChange, PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, SubscriptionUsagePort, SubscriptionUsageRecord, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, TenantSubscriptionWritePort, ApplyOnboardingSelectionInput, RedeemPromoInTransactionCallback, ApplyOnboardingSelectionResult, ImmediatePlanChangeInput, ScheduledPlanChangeInput, PlanVersionRepository, PlanVersionRecord, PromoCodeRepository, PromoCodeRecord, PromoCodeFilter, CreatePromoCodeData, UpdatePromoCodeData, PromoCodeRedemptionRepository, PromoCodeRedemptionRecord, PromoCodeRedemptionStatus, PromoCodeRedemptionListItem, PromoCodeValidationLogRepository, PromoSubscriptionLookup, BillingCycle, PromoRevenueDeductionAggregator, SuperAdminProvisioningPort, CreateSuperAdminCliInput, PlatformUserDto, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, UpsertPlanInput, UpsertResult, UpsertPlanVersionInput, UpsertFeatureCatalogEntryInput, PlanRepository, PlanListFilter, PlanRow, CreatePlanData, UpdatePlanData, PlanVersionRow, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, CatalogEntryRepository, CatalogEntryFilter, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, UpsertCapabilityEntryData, UpsertFeatureEntryData, UpsertQuotaEntryData, SetCatalogEntryReviewData, CatalogEntryI18n, UpdateCatalogEntryBaseData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PromotionRepository, PromotionFilter, PromotionRow, CreatePromotionData, UpdatePromotionData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, CreateSubscriptionContractData, TerminateSubscriptionContractData } from '@saasicat/types';
|
|
2
2
|
|
|
3
3
|
declare const PRISMA_CLIENT_TOKEN: unique symbol;
|
|
4
4
|
/** Prisma `Decimal` values arrive as objects with `toString()`; tests may use plain values. */
|
|
@@ -954,11 +954,11 @@ interface PrismaPersistenceOptions {
|
|
|
954
954
|
bundle?: PrismaBundleRepositoryOptions;
|
|
955
955
|
}
|
|
956
956
|
/**
|
|
957
|
-
* Builds the `
|
|
957
|
+
* Builds the `SaaSiCatPersistenceAdapter` bundle for Prisma + PostgreSQL on
|
|
958
958
|
* the canonical schema (`@saasicat/spec` prisma-fragments):
|
|
959
959
|
*
|
|
960
960
|
* ```ts
|
|
961
|
-
*
|
|
961
|
+
* SaaSiCatModule.forRoot({
|
|
962
962
|
* persistence: prismaPersistence({ client: PrismaService }),
|
|
963
963
|
* // ...
|
|
964
964
|
* });
|
|
@@ -968,7 +968,7 @@ interface PrismaPersistenceOptions {
|
|
|
968
968
|
* tenant-billing, promo and plan-catalog persistence. App-specific behavior
|
|
969
969
|
* such as quota counters and authentication remains in the consumer.
|
|
970
970
|
*/
|
|
971
|
-
declare function prismaPersistence(options: PrismaPersistenceOptions):
|
|
971
|
+
declare function prismaPersistence(options: PrismaPersistenceOptions): SaaSiCatPersistenceAdapter;
|
|
972
972
|
|
|
973
973
|
/**
|
|
974
974
|
* `TransactionRunner` over `prisma.$transaction`. The interactive transaction
|
package/dist/index.js
CHANGED
|
@@ -2070,7 +2070,7 @@ PrismaMfaAdapter = _ts_decorate9([
|
|
|
2070
2070
|
])
|
|
2071
2071
|
], PrismaMfaAdapter);
|
|
2072
2072
|
|
|
2073
|
-
// src/prisma-plan-catalog-import-sink.ts
|
|
2073
|
+
// src/prisma-plan-catalog-import-sink.adapter.ts
|
|
2074
2074
|
import { Inject as Inject9, Injectable as Injectable10, Optional as Optional2 } from "@nestjs/common";
|
|
2075
2075
|
function _ts_decorate10(decorators, target, key, desc) {
|
|
2076
2076
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2224,7 +2224,7 @@ PrismaPlanCatalogImportSink = _ts_decorate10([
|
|
|
2224
2224
|
])
|
|
2225
2225
|
], PrismaPlanCatalogImportSink);
|
|
2226
2226
|
|
|
2227
|
-
// src/prisma-plan-catalog-read-sink.ts
|
|
2227
|
+
// src/prisma-plan-catalog-read-sink.adapter.ts
|
|
2228
2228
|
import { Inject as Inject10, Injectable as Injectable11, Optional as Optional3 } from "@nestjs/common";
|
|
2229
2229
|
function _ts_decorate11(decorators, target, key, desc) {
|
|
2230
2230
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3654,7 +3654,7 @@ PrismaPromoCodeValidationLogRepository = _ts_decorate17([
|
|
|
3654
3654
|
])
|
|
3655
3655
|
], PrismaPromoCodeValidationLogRepository);
|
|
3656
3656
|
|
|
3657
|
-
// src/prisma-promo-subscription-lookup.ts
|
|
3657
|
+
// src/prisma-promo-subscription-lookup.adapter.ts
|
|
3658
3658
|
import { Inject as Inject17, Injectable as Injectable18 } from "@nestjs/common";
|
|
3659
3659
|
function _ts_decorate18(decorators, target, key, desc) {
|
|
3660
3660
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4852,7 +4852,7 @@ function clearedPendingVersionData() {
|
|
|
4852
4852
|
}
|
|
4853
4853
|
__name(clearedPendingVersionData, "clearedPendingVersionData");
|
|
4854
4854
|
|
|
4855
|
-
// src/prisma-transaction-runner.ts
|
|
4855
|
+
// src/prisma-transaction-runner.adapter.ts
|
|
4856
4856
|
import { Inject as Inject24, Injectable as Injectable25 } from "@nestjs/common";
|
|
4857
4857
|
function _ts_decorate25(decorators, target, key, desc) {
|
|
4858
4858
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4893,7 +4893,7 @@ PrismaTransactionRunner = _ts_decorate25([
|
|
|
4893
4893
|
])
|
|
4894
4894
|
], PrismaTransactionRunner);
|
|
4895
4895
|
|
|
4896
|
-
// src/zero-promo-revenue-aggregator.ts
|
|
4896
|
+
// src/zero-promo-revenue-aggregator.adapter.ts
|
|
4897
4897
|
import { Injectable as Injectable26 } from "@nestjs/common";
|
|
4898
4898
|
function _ts_decorate26(decorators, target, key, desc) {
|
|
4899
4899
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasicat/adapter-prisma",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
4
|
"description": "Prisma + PostgreSQL persistence for SaaSiCat: one standard bundle for core, catalog, entitlement, tenant billing, Admin resources and promo, plus individual adapters for custom compositions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@saasicat/types": "^0.
|
|
25
|
+
"@saasicat/types": "^1.0.0-rc.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@nestjs/common": "^11.0.0"
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@prisma/client": "^6.19.0",
|
|
35
35
|
"tsup": "^8.0.0",
|
|
36
36
|
"typescript": "^6.0.0",
|
|
37
|
-
"@saasicat/persistence-testing": "^0.
|
|
38
|
-
"@saasicat/spec": "^0.
|
|
37
|
+
"@saasicat/persistence-testing": "^1.0.0-rc.0",
|
|
38
|
+
"@saasicat/spec": "^1.0.0-rc.0"
|
|
39
39
|
},
|
|
40
40
|
"license": "PolyForm-Shield-1.0.0",
|
|
41
41
|
"author": "Taci Uelker",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "https://github.com/uelker70/saasicat.git",
|
|
46
|
-
"directory": "packages/
|
|
46
|
+
"directory": "packages/adapter-prisma"
|
|
47
47
|
},
|
|
48
48
|
"bugs": {
|
|
49
49
|
"url": "https://github.com/uelker70/saasicat/issues"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "node ../../scripts/build-and-prune.mjs \"tsup src/index.ts --format esm,cjs --dts --external @saasicat/types --external @nestjs/common\"",
|
|
56
56
|
"pretest": "pnpm run build",
|
|
57
|
-
"test": "node --test tests
|
|
58
|
-
"test:integration": "node --test tests
|
|
57
|
+
"test": "node --test 'tests/*.test.js'",
|
|
58
|
+
"test:integration": "node --test 'tests/integration/*.test.js'"
|
|
59
59
|
}
|
|
60
60
|
}
|