@saasicat/adapter-drizzle 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 +2 -2
- 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 +8 -8
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ import { drizzlePersistence } from '@saasicat/adapter-drizzle';
|
|
|
15
15
|
|
|
16
16
|
const db = drizzle(new Pool({ connectionString: process.env.DATABASE_URL }));
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
SaaSiCatModule.forRoot({
|
|
19
19
|
planCatalog: loadPlanCatalogFromFile({ path: 'config/saas.yaml' }),
|
|
20
20
|
controller: { guards: [JwtAuthGuard] },
|
|
21
21
|
imports: [AuthModule],
|
|
@@ -26,7 +26,7 @@ SaasPlatformModule.forRoot({
|
|
|
26
26
|
|
|
27
27
|
`drizzlePersistence({ db })` accepts a ready Drizzle database (any pg
|
|
28
28
|
driver — node-postgres, postgres.js) or an injection token, and returns the
|
|
29
|
-
same `
|
|
29
|
+
same `SaaSiCatPersistenceAdapter` bundle shape as `prismaPersistence()`.
|
|
30
30
|
Options: `passwordHasher` (enables `core.superAdminProvisioning`) and
|
|
31
31
|
`rlsIntegration` (declares the `rowLevelSecurity` capability once your db
|
|
32
32
|
layer applies the bypass).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6f4798c30619ad25cdb9589cc07964be17170c6fe31ef5c97816e26eff18a34c
|
package/dist/index.cjs
CHANGED
|
@@ -531,7 +531,7 @@ DrizzleMfaAdapter = _ts_decorate5([
|
|
|
531
531
|
])
|
|
532
532
|
], DrizzleMfaAdapter);
|
|
533
533
|
|
|
534
|
-
// src/drizzle-plan-catalog-import-sink.ts
|
|
534
|
+
// src/drizzle-plan-catalog-import-sink.adapter.ts
|
|
535
535
|
var import_node_crypto2 = require("node:crypto");
|
|
536
536
|
var import_common6 = require("@nestjs/common");
|
|
537
537
|
var import_drizzle_orm4 = require("drizzle-orm");
|
|
@@ -646,7 +646,7 @@ DrizzlePlanCatalogImportSink = _ts_decorate6([
|
|
|
646
646
|
])
|
|
647
647
|
], DrizzlePlanCatalogImportSink);
|
|
648
648
|
|
|
649
|
-
// src/drizzle-plan-catalog-read-sink.ts
|
|
649
|
+
// src/drizzle-plan-catalog-read-sink.adapter.ts
|
|
650
650
|
var import_common7 = require("@nestjs/common");
|
|
651
651
|
var import_drizzle_orm5 = require("drizzle-orm");
|
|
652
652
|
function _ts_decorate7(decorators, target, key, desc4) {
|
|
@@ -1150,7 +1150,7 @@ DrizzlePromoCodeValidationLogRepository = _ts_decorate11([
|
|
|
1150
1150
|
])
|
|
1151
1151
|
], DrizzlePromoCodeValidationLogRepository);
|
|
1152
1152
|
|
|
1153
|
-
// src/drizzle-promo-subscription-lookup.ts
|
|
1153
|
+
// src/drizzle-promo-subscription-lookup.adapter.ts
|
|
1154
1154
|
var import_common12 = require("@nestjs/common");
|
|
1155
1155
|
var import_drizzle_orm10 = require("drizzle-orm");
|
|
1156
1156
|
function _ts_decorate12(decorators, target, key, desc4) {
|
|
@@ -1382,7 +1382,7 @@ DrizzleSuperAdminBootstrapAdapter = _ts_decorate14([
|
|
|
1382
1382
|
])
|
|
1383
1383
|
], DrizzleSuperAdminBootstrapAdapter);
|
|
1384
1384
|
|
|
1385
|
-
// src/drizzle-transaction-runner.ts
|
|
1385
|
+
// src/drizzle-transaction-runner.adapter.ts
|
|
1386
1386
|
var import_common15 = require("@nestjs/common");
|
|
1387
1387
|
function _ts_decorate15(decorators, target, key, desc4) {
|
|
1388
1388
|
var c = arguments.length, r = c < 3 ? target : desc4 === null ? desc4 = Object.getOwnPropertyDescriptor(target, key) : desc4, d;
|
|
@@ -1422,7 +1422,7 @@ DrizzleTransactionRunner = _ts_decorate15([
|
|
|
1422
1422
|
])
|
|
1423
1423
|
], DrizzleTransactionRunner);
|
|
1424
1424
|
|
|
1425
|
-
// src/zero-promo-revenue-aggregator.ts
|
|
1425
|
+
// src/zero-promo-revenue-aggregator.adapter.ts
|
|
1426
1426
|
var import_common16 = require("@nestjs/common");
|
|
1427
1427
|
function _ts_decorate16(decorators, target, key, desc4) {
|
|
1428
1428
|
var c = arguments.length, r = c < 3 ? target : desc4 === null ? desc4 = Object.getOwnPropertyDescriptor(target, key) : desc4, d;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
2
|
import { PgDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
3
|
-
import { PersistenceInjectionToken, PasswordHasher,
|
|
3
|
+
import { PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, TransactionContext, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditEntry, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, 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 } from '@saasicat/types';
|
|
4
4
|
import * as drizzle_orm from 'drizzle-orm';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -46,13 +46,13 @@ interface DrizzlePersistenceOptions {
|
|
|
46
46
|
rlsIntegration?: boolean;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Builds the `
|
|
49
|
+
* Builds the `SaaSiCatPersistenceAdapter` bundle for Drizzle + PostgreSQL on
|
|
50
50
|
* the canonical schema (`@saasicat/spec` reference SQL):
|
|
51
51
|
*
|
|
52
52
|
* ```ts
|
|
53
53
|
* const db = drizzle(new Pool({ connectionString: process.env.DATABASE_URL }));
|
|
54
54
|
*
|
|
55
|
-
*
|
|
55
|
+
* SaaSiCatModule.forRoot({
|
|
56
56
|
* persistence: drizzlePersistence({ db }),
|
|
57
57
|
* // ...
|
|
58
58
|
* });
|
|
@@ -63,7 +63,7 @@ interface DrizzlePersistenceOptions {
|
|
|
63
63
|
* modules for those areas until the Drizzle bundle gains matching adapters.
|
|
64
64
|
* Both adapters still pass the shared core persistence contract.
|
|
65
65
|
*/
|
|
66
|
-
declare function drizzlePersistence(options: DrizzlePersistenceOptions):
|
|
66
|
+
declare function drizzlePersistence(options: DrizzlePersistenceOptions): SaaSiCatPersistenceAdapter;
|
|
67
67
|
|
|
68
68
|
declare const subscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
69
69
|
name: "subscriptions";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
2
|
import { PgDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
3
|
-
import { PersistenceInjectionToken, PasswordHasher,
|
|
3
|
+
import { PersistenceInjectionToken, PasswordHasher, SaaSiCatPersistenceAdapter, TransactionRunner, TransactionContext, MfaPort, AuditPort, AdminActor, AuditQueryPort, AuditQuery, AuditEntry, AuditStatsPort, RlsBypassPort, SubscriptionRepository, SubscriptionRecord, 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 } from '@saasicat/types';
|
|
4
4
|
import * as drizzle_orm from 'drizzle-orm';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -46,13 +46,13 @@ interface DrizzlePersistenceOptions {
|
|
|
46
46
|
rlsIntegration?: boolean;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Builds the `
|
|
49
|
+
* Builds the `SaaSiCatPersistenceAdapter` bundle for Drizzle + PostgreSQL on
|
|
50
50
|
* the canonical schema (`@saasicat/spec` reference SQL):
|
|
51
51
|
*
|
|
52
52
|
* ```ts
|
|
53
53
|
* const db = drizzle(new Pool({ connectionString: process.env.DATABASE_URL }));
|
|
54
54
|
*
|
|
55
|
-
*
|
|
55
|
+
* SaaSiCatModule.forRoot({
|
|
56
56
|
* persistence: drizzlePersistence({ db }),
|
|
57
57
|
* // ...
|
|
58
58
|
* });
|
|
@@ -63,7 +63,7 @@ interface DrizzlePersistenceOptions {
|
|
|
63
63
|
* modules for those areas until the Drizzle bundle gains matching adapters.
|
|
64
64
|
* Both adapters still pass the shared core persistence contract.
|
|
65
65
|
*/
|
|
66
|
-
declare function drizzlePersistence(options: DrizzlePersistenceOptions):
|
|
66
|
+
declare function drizzlePersistence(options: DrizzlePersistenceOptions): SaaSiCatPersistenceAdapter;
|
|
67
67
|
|
|
68
68
|
declare const subscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
69
69
|
name: "subscriptions";
|
package/dist/index.js
CHANGED
|
@@ -491,7 +491,7 @@ DrizzleMfaAdapter = _ts_decorate5([
|
|
|
491
491
|
])
|
|
492
492
|
], DrizzleMfaAdapter);
|
|
493
493
|
|
|
494
|
-
// src/drizzle-plan-catalog-import-sink.ts
|
|
494
|
+
// src/drizzle-plan-catalog-import-sink.adapter.ts
|
|
495
495
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
496
496
|
import { Inject as Inject5, Injectable as Injectable6 } from "@nestjs/common";
|
|
497
497
|
import { and as and2, eq as eq3, isNotNull, isNull, lt } from "drizzle-orm";
|
|
@@ -606,7 +606,7 @@ DrizzlePlanCatalogImportSink = _ts_decorate6([
|
|
|
606
606
|
])
|
|
607
607
|
], DrizzlePlanCatalogImportSink);
|
|
608
608
|
|
|
609
|
-
// src/drizzle-plan-catalog-read-sink.ts
|
|
609
|
+
// src/drizzle-plan-catalog-read-sink.adapter.ts
|
|
610
610
|
import { Inject as Inject6, Injectable as Injectable7 } from "@nestjs/common";
|
|
611
611
|
import { and as and3, asc, eq as eq4, inArray, isNotNull as isNotNull2, isNull as isNull2 } from "drizzle-orm";
|
|
612
612
|
function _ts_decorate7(decorators, target, key, desc4) {
|
|
@@ -1110,7 +1110,7 @@ DrizzlePromoCodeValidationLogRepository = _ts_decorate11([
|
|
|
1110
1110
|
])
|
|
1111
1111
|
], DrizzlePromoCodeValidationLogRepository);
|
|
1112
1112
|
|
|
1113
|
-
// src/drizzle-promo-subscription-lookup.ts
|
|
1113
|
+
// src/drizzle-promo-subscription-lookup.adapter.ts
|
|
1114
1114
|
import { Inject as Inject11, Injectable as Injectable12 } from "@nestjs/common";
|
|
1115
1115
|
import { eq as eq9 } from "drizzle-orm";
|
|
1116
1116
|
function _ts_decorate12(decorators, target, key, desc4) {
|
|
@@ -1342,7 +1342,7 @@ DrizzleSuperAdminBootstrapAdapter = _ts_decorate14([
|
|
|
1342
1342
|
])
|
|
1343
1343
|
], DrizzleSuperAdminBootstrapAdapter);
|
|
1344
1344
|
|
|
1345
|
-
// src/drizzle-transaction-runner.ts
|
|
1345
|
+
// src/drizzle-transaction-runner.adapter.ts
|
|
1346
1346
|
import { Inject as Inject14, Injectable as Injectable15 } from "@nestjs/common";
|
|
1347
1347
|
function _ts_decorate15(decorators, target, key, desc4) {
|
|
1348
1348
|
var c = arguments.length, r = c < 3 ? target : desc4 === null ? desc4 = Object.getOwnPropertyDescriptor(target, key) : desc4, d;
|
|
@@ -1382,7 +1382,7 @@ DrizzleTransactionRunner = _ts_decorate15([
|
|
|
1382
1382
|
])
|
|
1383
1383
|
], DrizzleTransactionRunner);
|
|
1384
1384
|
|
|
1385
|
-
// src/zero-promo-revenue-aggregator.ts
|
|
1385
|
+
// src/zero-promo-revenue-aggregator.adapter.ts
|
|
1386
1386
|
import { Injectable as Injectable16 } from "@nestjs/common";
|
|
1387
1387
|
function _ts_decorate16(decorators, target, key, desc4) {
|
|
1388
1388
|
var c = arguments.length, r = c < 3 ? target : desc4 === null ? desc4 = Object.getOwnPropertyDescriptor(target, key) : desc4, d;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasicat/adapter-drizzle",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Drizzle + PostgreSQL persistence adapter for
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
|
+
"description": "Drizzle + PostgreSQL persistence adapter for SaaSiCat: drizzlePersistence() bundle plus the individual adapters (MFA, audit, RLS bypass, transaction runner, subscription/plan-version/promo repositories, SuperAdmin bootstrap, plan-catalog sinks). Targets the canonical schema from @saasicat/spec and passes the same executable persistence contract as @saasicat/adapter-prisma.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -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",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"pg": "^8.22.0",
|
|
37
37
|
"tsup": "^8.0.0",
|
|
38
38
|
"typescript": "^6.0.0",
|
|
39
|
-
"@saasicat/persistence-testing": "^0.
|
|
40
|
-
"@saasicat/spec": "^0.
|
|
39
|
+
"@saasicat/persistence-testing": "^1.0.0-rc.0",
|
|
40
|
+
"@saasicat/spec": "^1.0.0-rc.0"
|
|
41
41
|
},
|
|
42
42
|
"license": "PolyForm-Shield-1.0.0",
|
|
43
43
|
"author": "Taci Uelker",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
47
|
"url": "https://github.com/uelker70/saasicat.git",
|
|
48
|
-
"directory": "packages/
|
|
48
|
+
"directory": "packages/adapter-drizzle"
|
|
49
49
|
},
|
|
50
50
|
"bugs": {
|
|
51
51
|
"url": "https://github.com/uelker70/saasicat/issues"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "node ../../scripts/build-and-prune.mjs tsup",
|
|
58
58
|
"pretest": "pnpm run build",
|
|
59
|
-
"test": "node --test tests
|
|
60
|
-
"test:integration": "node --test tests
|
|
59
|
+
"test": "node --test 'tests/*.test.js'",
|
|
60
|
+
"test:integration": "node --test 'tests/integration/*.test.js'"
|
|
61
61
|
}
|
|
62
62
|
}
|