@rovela-ai/sdk 0.1.24 → 0.1.26
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/admin/components/ProductTable.d.ts.map +1 -1
- package/dist/admin/components/ProductTable.js +7 -2
- package/dist/admin/components/ProductTable.js.map +1 -1
- package/dist/admin/components/VariantManager.d.ts.map +1 -1
- package/dist/admin/components/VariantManager.js +4 -2
- package/dist/admin/components/VariantManager.js.map +1 -1
- package/dist/admin/server/admin-service.d.ts +3 -3
- package/dist/admin/server/admin-service.d.ts.map +1 -1
- package/dist/admin/server/admin-service.js +12 -22
- package/dist/admin/server/admin-service.js.map +1 -1
- package/dist/auth/server/customer-service.d.ts +2 -2
- package/dist/auth/server/customer-service.d.ts.map +1 -1
- package/dist/auth/server/customer-service.js +11 -20
- package/dist/auth/server/customer-service.js.map +1 -1
- package/dist/auth/server/password-reset-service.d.ts +1 -0
- package/dist/auth/server/password-reset-service.d.ts.map +1 -1
- package/dist/auth/server/password-reset-service.js +5 -7
- package/dist/auth/server/password-reset-service.js.map +1 -1
- package/dist/auth/server/verification-service.d.ts +1 -0
- package/dist/auth/server/verification-service.d.ts.map +1 -1
- package/dist/auth/server/verification-service.js +6 -9
- package/dist/auth/server/verification-service.js.map +1 -1
- package/dist/core/db/client.d.ts +2 -44
- package/dist/core/db/client.d.ts.map +1 -1
- package/dist/core/db/client.js +2 -106
- package/dist/core/db/client.js.map +1 -1
- package/dist/core/db/index.d.ts +1 -1
- package/dist/core/db/index.d.ts.map +1 -1
- package/dist/core/db/index.js +2 -2
- package/dist/core/db/index.js.map +1 -1
- package/dist/core/db/queries.d.ts +20 -37
- package/dist/core/db/queries.d.ts.map +1 -1
- package/dist/core/db/queries.js +69 -110
- package/dist/core/db/queries.js.map +1 -1
- package/dist/core/db/schema.d.ts +1 -137
- package/dist/core/db/schema.d.ts.map +1 -1
- package/dist/core/db/schema.js +6 -23
- package/dist/core/db/schema.js.map +1 -1
- package/dist/core/server/index.d.ts +1 -1
- package/dist/core/server/index.d.ts.map +1 -1
- package/dist/core/server/index.js +1 -3
- package/dist/core/server/index.js.map +1 -1
- package/dist/core/types.d.ts +0 -5
- package/dist/core/types.d.ts.map +1 -1
- package/dist/emails/config.d.ts.map +1 -1
- package/dist/emails/config.js +11 -17
- package/dist/emails/config.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-reset-service.js","sourceRoot":"","sources":["../../../src/auth/server/password-reset-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"password-reset-service.js","sourceRoot":"","sources":["../../../src/auth/server/password-reset-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAErE,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,eAAe,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEtC;;GAEG;AACH,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,KAAa;IAGtD,yBAAyB;IACzB,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAA;IAEjD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,uDAAuD;QACvD,OAAO,E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AAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,mDAAmD;SAC3D,CAAA;IACH,CAAC;IAED,iCAAiC;IACjC,MAAM,sBAAsB,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;IAEjE,4CAA4C;IAC5C,MAAM,EAAE;SACL,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC;SAC1C,KAAK,CACJ,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,CAC1E,CAAA;IAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,UAAkB;IAElB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAElB,MAAM,EAAE;SACL,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC;SAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAA;AACzE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB;IAC7C,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAElB,MAAM,MAAM,GAAG,MAAM,EAAE;SACpB,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC;SAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;SACjE,SAAS,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,2BAA2B,CAAC,EAAE,EAAE,CAAC,CAAA;IAE3D,OAAO,MAAM,CAAC,MAAM,CAAA;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-service.d.ts","sourceRoot":"","sources":["../../../src/auth/server/verification-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verification-service.d.ts","sourceRoot":"","sources":["../../../src/auth/server/verification-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2BH;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACxD,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC,CA6CD;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACpE,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC,CA+BD;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAU1E;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAS5D"}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Email verification token management.
|
|
5
5
|
* Handles creating, validating, and cleaning up verification tokens.
|
|
6
|
+
* Each store has its own database (via Neon branches) - no tenant isolation needed.
|
|
6
7
|
*/
|
|
7
|
-
import { eq,
|
|
8
|
+
import { eq, lt } from 'drizzle-orm';
|
|
8
9
|
import { nanoid } from 'nanoid';
|
|
9
|
-
import { getDb
|
|
10
|
+
import { getDb } from '../../core/db/client';
|
|
10
11
|
import * as schema from '../../core/db/schema';
|
|
11
12
|
import { findCustomerByEmail, markEmailVerified } from './customer-service';
|
|
12
13
|
import { sendVerificationEmail, sendWelcomeEmail, getStoreName } from './email-sender';
|
|
@@ -39,14 +40,12 @@ const TOKEN_LENGTH = 32;
|
|
|
39
40
|
*/
|
|
40
41
|
export async function createVerificationToken(customerId) {
|
|
41
42
|
const db = getDb();
|
|
42
|
-
const tenantId = getTenantId();
|
|
43
43
|
// Delete any existing tokens for this customer
|
|
44
44
|
await deleteVerificationTokens(customerId);
|
|
45
45
|
// Generate new token
|
|
46
46
|
const token = nanoid(TOKEN_LENGTH);
|
|
47
47
|
const expires = new Date(Date.now() + TOKEN_EXPIRY_MS);
|
|
48
48
|
await db.insert(schema.customerVerificationTokens).values({
|
|
49
|
-
tenantId,
|
|
50
49
|
customerId,
|
|
51
50
|
token,
|
|
52
51
|
expires,
|
|
@@ -72,7 +71,7 @@ export async function createVerificationToken(customerId) {
|
|
|
72
71
|
*/
|
|
73
72
|
export async function verifyEmail(token) {
|
|
74
73
|
const db = getDb();
|
|
75
|
-
// Find the token
|
|
74
|
+
// Find the token
|
|
76
75
|
const [tokenRecord] = await db
|
|
77
76
|
.select()
|
|
78
77
|
.from(schema.customerVerificationTokens)
|
|
@@ -120,10 +119,9 @@ export async function verifyEmail(token) {
|
|
|
120
119
|
*/
|
|
121
120
|
export async function deleteVerificationTokens(customerId) {
|
|
122
121
|
const db = getDb();
|
|
123
|
-
const tenantId = getTenantId();
|
|
124
122
|
await db
|
|
125
123
|
.delete(schema.customerVerificationTokens)
|
|
126
|
-
.where(
|
|
124
|
+
.where(eq(schema.customerVerificationTokens.customerId, customerId));
|
|
127
125
|
}
|
|
128
126
|
/**
|
|
129
127
|
* Resend verification email to a customer.
|
|
@@ -177,11 +175,10 @@ export async function resendVerificationEmail(email) {
|
|
|
177
175
|
*/
|
|
178
176
|
export async function isEmailVerified(customerId) {
|
|
179
177
|
const db = getDb();
|
|
180
|
-
const tenantId = getTenantId();
|
|
181
178
|
const [customer] = await db
|
|
182
179
|
.select({ emailVerified: schema.customers.emailVerified })
|
|
183
180
|
.from(schema.customers)
|
|
184
|
-
.where(
|
|
181
|
+
.where(eq(schema.customers.id, customerId))
|
|
185
182
|
.limit(1);
|
|
186
183
|
return !!customer?.emailVerified;
|
|
187
184
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-service.js","sourceRoot":"","sources":["../../../src/auth/server/verification-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verification-service.js","sourceRoot":"","sources":["../../../src/auth/server/verification-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEtF,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;GAEG;AACH,MAAM,eAAe,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAE3C;;GAEG;AACH,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,UAAkB;IAElB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAElB,+CAA+C;IAC/C,MAAM,wBAAwB,CAAC,UAAU,CAAC,CAAA;IAE1C,qBAAqB;IACrB,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;IAClC,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC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AAK,EAAE,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;aACtE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;aACtB,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;aAC1C,KAAK,CAAC,CAAC,CAAC,CAAA;QAEX,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,SAAS,GAAG,MAAM,YAAY,EAAE,CAAA;YACtC,MAAM,gBAAgB,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,sDAAsD;QACtD,OAAO,CAAC,KAAK,CAAC,mDAAmD,EAAE,KAAK,CAAC,CAAA;IAC3E,CAAC;AACH,CAAC"}
|
package/dist/core/db/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @rovela/sdk/core/db/client
|
|
3
3
|
*
|
|
4
4
|
* Neon serverless database client with Drizzle ORM
|
|
5
|
-
*
|
|
5
|
+
* Each store has its own database (via Neon branches) - no tenant isolation needed
|
|
6
6
|
*/
|
|
7
7
|
import { NeonQueryFunction } from '@neondatabase/serverless';
|
|
8
8
|
import { NeonHttpDatabase } from 'drizzle-orm/neon-http';
|
|
@@ -24,47 +24,6 @@ export declare function getDb(): NeonHttpDatabase<typeof schema>;
|
|
|
24
24
|
* Note: This is a lazy-loaded proxy to avoid connection at import time
|
|
25
25
|
*/
|
|
26
26
|
export declare const db: NeonHttpDatabase<typeof schema>;
|
|
27
|
-
/**
|
|
28
|
-
* Set the current tenant ID for the request
|
|
29
|
-
* All queries using withTenant() will be scoped to this tenant
|
|
30
|
-
*/
|
|
31
|
-
export declare function setTenantId(tenantId: string): void;
|
|
32
|
-
/**
|
|
33
|
-
* Get the current tenant ID
|
|
34
|
-
* Auto-initializes from TENANT_ID environment variable if not already set.
|
|
35
|
-
* @throws Error if tenant ID is not set and TENANT_ID env var is missing
|
|
36
|
-
*/
|
|
37
|
-
export declare function getTenantId(): string;
|
|
38
|
-
/**
|
|
39
|
-
* Clear the tenant context (call at end of request)
|
|
40
|
-
*/
|
|
41
|
-
export declare function clearTenantId(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Initialize tenant from environment variable
|
|
44
|
-
* Useful for single-tenant deployments
|
|
45
|
-
*/
|
|
46
|
-
export declare function initTenantFromEnv(): void;
|
|
47
|
-
/**
|
|
48
|
-
* Execute a function with a specific tenant context
|
|
49
|
-
* Sets tenant at both application and database level (for RLS)
|
|
50
|
-
* Automatically clears tenant after execution
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* const products = await withTenant(tenantId, async () => {
|
|
54
|
-
* return db.query.products.findMany()
|
|
55
|
-
* })
|
|
56
|
-
*/
|
|
57
|
-
export declare function withTenant<T>(tenantId: string, fn: () => Promise<T>): Promise<T>;
|
|
58
|
-
/**
|
|
59
|
-
* Execute raw SQL with tenant context for RLS
|
|
60
|
-
* Wraps query in a transaction with tenant set
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* const result = await withTenantSql(tenantId, async (sql) => {
|
|
64
|
-
* return sql`SELECT * FROM products WHERE status = 'active'`
|
|
65
|
-
* })
|
|
66
|
-
*/
|
|
67
|
-
export declare function withTenantSql<T>(tenantId: string, fn: (sql: NeonQueryFunction<false, false>) => Promise<T>): Promise<T>;
|
|
68
27
|
/**
|
|
69
28
|
* Check database connection health
|
|
70
29
|
* Returns true if connection is successful
|
|
@@ -75,7 +34,6 @@ export declare function checkConnection(): Promise<boolean>;
|
|
|
75
34
|
*/
|
|
76
35
|
export declare function getConnectionInfo(): {
|
|
77
36
|
hasUrl: boolean;
|
|
78
|
-
|
|
79
|
-
tenantId: string | null;
|
|
37
|
+
isConnected: boolean;
|
|
80
38
|
};
|
|
81
39
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/db/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAW,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAyBlC;;;GAGG;AACH,wBAAgB,MAAM,IAAI,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAKxD;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,gBAAgB,CAAC,OAAO,MAAM,CAAC,CAMvD;AAED;;;;;GAKG;AACH,eAAO,MAAM,EAAE,iCAMb,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/db/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAW,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAyBlC;;;GAGG;AACH,wBAAgB,MAAM,IAAI,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAKxD;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,gBAAgB,CAAC,OAAO,MAAM,CAAC,CAMvD;AAED;;;;;GAKG;AACH,eAAO,MAAM,EAAE,iCAMb,CAAA;AAMF;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAQxD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI;IACnC,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;CACrB,CAKA"}
|
package/dist/core/db/client.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @rovela/sdk/core/db/client
|
|
3
3
|
*
|
|
4
4
|
* Neon serverless database client with Drizzle ORM
|
|
5
|
-
*
|
|
5
|
+
* Each store has its own database (via Neon branches) - no tenant isolation needed
|
|
6
6
|
*/
|
|
7
7
|
import { neon } from '@neondatabase/serverless';
|
|
8
8
|
import { drizzle } from 'drizzle-orm/neon-http';
|
|
@@ -59,109 +59,6 @@ export const db = new Proxy({}, {
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
// =============================================================================
|
|
62
|
-
// Tenant Context
|
|
63
|
-
// =============================================================================
|
|
64
|
-
/**
|
|
65
|
-
* Tenant context for multi-tenant isolation
|
|
66
|
-
* Set this at the start of each request to ensure queries are scoped
|
|
67
|
-
*/
|
|
68
|
-
let currentTenantId = null;
|
|
69
|
-
/**
|
|
70
|
-
* Set the current tenant ID for the request
|
|
71
|
-
* All queries using withTenant() will be scoped to this tenant
|
|
72
|
-
*/
|
|
73
|
-
export function setTenantId(tenantId) {
|
|
74
|
-
currentTenantId = tenantId;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Get the current tenant ID
|
|
78
|
-
* Auto-initializes from TENANT_ID environment variable if not already set.
|
|
79
|
-
* @throws Error if tenant ID is not set and TENANT_ID env var is missing
|
|
80
|
-
*/
|
|
81
|
-
export function getTenantId() {
|
|
82
|
-
if (!currentTenantId) {
|
|
83
|
-
// Auto-initialize from environment variable (lazy initialization)
|
|
84
|
-
const envTenantId = process.env.TENANT_ID;
|
|
85
|
-
if (envTenantId) {
|
|
86
|
-
currentTenantId = envTenantId;
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
throw new Error('Tenant ID not set. Please set TENANT_ID environment variable.');
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return currentTenantId;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Clear the tenant context (call at end of request)
|
|
96
|
-
*/
|
|
97
|
-
export function clearTenantId() {
|
|
98
|
-
currentTenantId = null;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Initialize tenant from environment variable
|
|
102
|
-
* Useful for single-tenant deployments
|
|
103
|
-
*/
|
|
104
|
-
export function initTenantFromEnv() {
|
|
105
|
-
const envTenantId = process.env.TENANT_ID;
|
|
106
|
-
if (envTenantId) {
|
|
107
|
-
setTenantId(envTenantId);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
// =============================================================================
|
|
111
|
-
// Request Scoped Tenant (for middleware)
|
|
112
|
-
// =============================================================================
|
|
113
|
-
/**
|
|
114
|
-
* Set tenant ID at the database session level for RLS policies
|
|
115
|
-
* This must be called within a transaction for Neon HTTP driver
|
|
116
|
-
*/
|
|
117
|
-
async function setDbTenantId(tenantId) {
|
|
118
|
-
const sql = getSql();
|
|
119
|
-
await sql `SELECT set_config('app.tenant_id', ${tenantId}, true)`;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Execute a function with a specific tenant context
|
|
123
|
-
* Sets tenant at both application and database level (for RLS)
|
|
124
|
-
* Automatically clears tenant after execution
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* const products = await withTenant(tenantId, async () => {
|
|
128
|
-
* return db.query.products.findMany()
|
|
129
|
-
* })
|
|
130
|
-
*/
|
|
131
|
-
export async function withTenant(tenantId, fn) {
|
|
132
|
-
const previousTenantId = currentTenantId;
|
|
133
|
-
try {
|
|
134
|
-
// Set at application level
|
|
135
|
-
setTenantId(tenantId);
|
|
136
|
-
// Set at database level for RLS
|
|
137
|
-
await setDbTenantId(tenantId);
|
|
138
|
-
return await fn();
|
|
139
|
-
}
|
|
140
|
-
finally {
|
|
141
|
-
if (previousTenantId) {
|
|
142
|
-
setTenantId(previousTenantId);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
clearTenantId();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Execute raw SQL with tenant context for RLS
|
|
151
|
-
* Wraps query in a transaction with tenant set
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* const result = await withTenantSql(tenantId, async (sql) => {
|
|
155
|
-
* return sql`SELECT * FROM products WHERE status = 'active'`
|
|
156
|
-
* })
|
|
157
|
-
*/
|
|
158
|
-
export async function withTenantSql(tenantId, fn) {
|
|
159
|
-
const sql = getSql();
|
|
160
|
-
// Set tenant for this connection
|
|
161
|
-
await sql `SELECT set_config('app.tenant_id', ${tenantId}, false)`;
|
|
162
|
-
return await fn(sql);
|
|
163
|
-
}
|
|
164
|
-
// =============================================================================
|
|
165
62
|
// Connection Health
|
|
166
63
|
// =============================================================================
|
|
167
64
|
/**
|
|
@@ -184,8 +81,7 @@ export async function checkConnection() {
|
|
|
184
81
|
export function getConnectionInfo() {
|
|
185
82
|
return {
|
|
186
83
|
hasUrl: !!process.env.DATABASE_URL,
|
|
187
|
-
|
|
188
|
-
tenantId: currentTenantId,
|
|
84
|
+
isConnected: _db !== null,
|
|
189
85
|
};
|
|
190
86
|
}
|
|
191
87
|
//# sourceMappingURL=client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/core/db/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAqB,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,OAAO,EAAoB,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,oCAAoC;AACpC,SAAS,cAAc;IACrB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAA;IACpC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,gDAAgD;YAC9C,wDAAwD,CAC3D,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,IAAI,IAA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KAC1B,CAAA;AACH,CAAC"}
|
package/dist/core/db/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Database module exports
|
|
5
5
|
*/
|
|
6
|
-
export { db, getDb, getSql,
|
|
6
|
+
export { db, getDb, getSql, checkConnection, getConnectionInfo, } from './client';
|
|
7
7
|
export * as schema from './schema';
|
|
8
8
|
export type { Product, NewProduct, ProductVariant, NewProductVariant, Category, NewCategory, Order, NewOrder, OrderItem, NewOrderItem, Customer, NewCustomer, StoreAdmin, NewStoreAdmin, StoreSettings, NewStoreSettings, } from './schema';
|
|
9
9
|
export { findProducts, findProductBySlug, findProductById, findProductVariants, countProducts, createProduct, updateProduct, deleteProduct, hardDeleteProduct, createProductVariant, updateProductVariant, deleteProductVariant, updateVariantInventory, findVariantById, findCategories, findCategoryBySlug, findCategoryById, countCategories, createCategory, updateCategory, deleteCategory, findOrders, findOrderById, findOrderItems, findOrderByPaymentIntent, countOrders, getRevenueByPeriod, getOrdersByStatus, createOrder, createOrderItems, updateOrderStatus, findCustomerByEmail, findCustomerById, findCustomers, countCustomers, findCustomerOrders, findAdminByEmail, getStoreStats, getLowStockProducts, getRecentOrders, findSettings, upsertSettings, } from './queries';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/db/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,EAAE,EACF,KAAK,EACL,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/db/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,EAAE,EACF,KAAK,EACL,MAAM,EACN,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAA;AAGjB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAGlC,YAAY,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,KAAK,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,UAAU,CAAA;AAGjB,OAAO,EAEL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,aAAa,EAEb,aAAa,EACb,aAAa,EACb,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EAEf,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EAEf,cAAc,EACd,cAAc,EACd,cAAc,EAEd,UAAU,EACV,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EAEjB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EAEjB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,kBAAkB,EAElB,gBAAgB,EAEhB,aAAa,EACb,mBAAmB,EACnB,eAAe,EAEf,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/core/db/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Database module exports
|
|
5
5
|
*/
|
|
6
|
-
// Client
|
|
7
|
-
export { db, getDb, getSql,
|
|
6
|
+
// Client
|
|
7
|
+
export { db, getDb, getSql, checkConnection, getConnectionInfo, } from './client';
|
|
8
8
|
// Schema exports
|
|
9
9
|
export * as schema from './schema';
|
|
10
10
|
// Query helpers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/db/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/db/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS;AACT,OAAO,EACL,EAAE,EACF,KAAK,EACL,MAAM,EACN,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAA;AAEjB,iBAAiB;AACjB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAsBlC,gBAAgB;AAChB,OAAO;AACL,qBAAqB;AACrB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,aAAa;AACb,uBAAuB;AACvB,aAAa,EACb,aAAa,EACb,aAAa,EACb,iBAAiB;AACjB,+BAA+B;AAC/B,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe;AACf,uBAAuB;AACvB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,eAAe;AACf,yBAAyB;AACzB,cAAc,EACd,cAAc,EACd,cAAc;AACd,mBAAmB;AACnB,UAAU,EACV,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,WAAW,EACX,kBAAkB,EAClB,iBAAiB;AACjB,qBAAqB;AACrB,WAAW,EACX,gBAAgB,EAChB,iBAAiB;AACjB,sBAAsB;AACtB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,kBAAkB;AAClB,SAAS;AACT,gBAAgB;AAChB,QAAQ;AACR,aAAa,EACb,mBAAmB,EACnB,eAAe;AACf,WAAW;AACX,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @rovela/sdk/core/db/queries
|
|
3
3
|
*
|
|
4
|
-
* Type-safe query helpers
|
|
5
|
-
*
|
|
4
|
+
* Type-safe query helpers for e-commerce stores
|
|
5
|
+
* Each store has its own database (via Neon branches) - no tenant filtering needed
|
|
6
6
|
*/
|
|
7
7
|
import * as schema from './schema';
|
|
8
8
|
export interface FindProductsOptions {
|
|
@@ -15,11 +15,9 @@ export interface FindProductsOptions {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Find products with filtering, sorting, and pagination
|
|
18
|
-
* Automatically scoped to current tenant
|
|
19
18
|
*/
|
|
20
19
|
export declare function findProducts(options?: FindProductsOptions): Promise<{
|
|
21
20
|
id: string;
|
|
22
|
-
tenantId: string;
|
|
23
21
|
name: string;
|
|
24
22
|
slug: string;
|
|
25
23
|
description: string;
|
|
@@ -47,7 +45,6 @@ export declare function findProducts(options?: FindProductsOptions): Promise<{
|
|
|
47
45
|
*/
|
|
48
46
|
export declare function findProductBySlug(slug: string): Promise<{
|
|
49
47
|
id: string;
|
|
50
|
-
tenantId: string;
|
|
51
48
|
name: string;
|
|
52
49
|
slug: string;
|
|
53
50
|
description: string;
|
|
@@ -75,7 +72,6 @@ export declare function findProductBySlug(slug: string): Promise<{
|
|
|
75
72
|
*/
|
|
76
73
|
export declare function findProductById(id: string): Promise<{
|
|
77
74
|
id: string;
|
|
78
|
-
tenantId: string;
|
|
79
75
|
name: string;
|
|
80
76
|
slug: string;
|
|
81
77
|
description: string;
|
|
@@ -117,11 +113,10 @@ export declare function findProductVariants(productId: string): Promise<{
|
|
|
117
113
|
*/
|
|
118
114
|
export declare function countProducts(options?: Pick<FindProductsOptions, 'categoryId' | 'status' | 'search'>): Promise<number>;
|
|
119
115
|
/**
|
|
120
|
-
* Find all categories
|
|
116
|
+
* Find all categories
|
|
121
117
|
*/
|
|
122
118
|
export declare function findCategories(): Promise<{
|
|
123
119
|
id: string;
|
|
124
|
-
tenantId: string;
|
|
125
120
|
name: string;
|
|
126
121
|
slug: string;
|
|
127
122
|
description: string | null;
|
|
@@ -135,7 +130,6 @@ export declare function findCategories(): Promise<{
|
|
|
135
130
|
*/
|
|
136
131
|
export declare function findCategoryBySlug(slug: string): Promise<{
|
|
137
132
|
id: string;
|
|
138
|
-
tenantId: string;
|
|
139
133
|
name: string;
|
|
140
134
|
slug: string;
|
|
141
135
|
description: string | null;
|
|
@@ -155,7 +149,6 @@ export interface FindOrdersOptions {
|
|
|
155
149
|
*/
|
|
156
150
|
export declare function findOrders(options?: FindOrdersOptions): Promise<{
|
|
157
151
|
id: string;
|
|
158
|
-
tenantId: string;
|
|
159
152
|
customerId: string | null;
|
|
160
153
|
email: string;
|
|
161
154
|
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
@@ -205,7 +198,6 @@ export declare function findOrderById(id: string): Promise<{
|
|
|
205
198
|
createdAt: Date;
|
|
206
199
|
}[];
|
|
207
200
|
id: string;
|
|
208
|
-
tenantId: string;
|
|
209
201
|
customerId: string | null;
|
|
210
202
|
email: string;
|
|
211
203
|
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
@@ -258,7 +250,6 @@ export declare function findOrderItems(orderId: string): Promise<{
|
|
|
258
250
|
*/
|
|
259
251
|
export declare function findCustomerByEmail(email: string): Promise<{
|
|
260
252
|
id: string;
|
|
261
|
-
tenantId: string;
|
|
262
253
|
email: string;
|
|
263
254
|
name: string | null;
|
|
264
255
|
passwordHash: string;
|
|
@@ -271,7 +262,6 @@ export declare function findCustomerByEmail(email: string): Promise<{
|
|
|
271
262
|
*/
|
|
272
263
|
export declare function findCustomerById(id: string): Promise<{
|
|
273
264
|
id: string;
|
|
274
|
-
tenantId: string;
|
|
275
265
|
email: string;
|
|
276
266
|
name: string | null;
|
|
277
267
|
passwordHash: string;
|
|
@@ -288,7 +278,6 @@ export declare function findCustomers(options?: {
|
|
|
288
278
|
search?: string;
|
|
289
279
|
}): Promise<{
|
|
290
280
|
id: string;
|
|
291
|
-
tenantId: string;
|
|
292
281
|
email: string;
|
|
293
282
|
name: string | null;
|
|
294
283
|
passwordHash: string;
|
|
@@ -301,7 +290,6 @@ export declare function findCustomers(options?: {
|
|
|
301
290
|
*/
|
|
302
291
|
export declare function findAdminByEmail(email: string): Promise<{
|
|
303
292
|
id: string;
|
|
304
|
-
tenantId: string;
|
|
305
293
|
email: string;
|
|
306
294
|
name: string;
|
|
307
295
|
passwordHash: string;
|
|
@@ -323,7 +311,6 @@ export declare function getStoreStats(): Promise<{
|
|
|
323
311
|
export declare function getLowStockProducts(threshold?: number): Promise<{
|
|
324
312
|
product: {
|
|
325
313
|
id: string;
|
|
326
|
-
tenantId: string;
|
|
327
314
|
name: string;
|
|
328
315
|
slug: string;
|
|
329
316
|
description: string;
|
|
@@ -363,7 +350,6 @@ export declare function getLowStockProducts(threshold?: number): Promise<{
|
|
|
363
350
|
*/
|
|
364
351
|
export declare function getRecentOrders(limit?: number): Promise<{
|
|
365
352
|
id: string;
|
|
366
|
-
tenantId: string;
|
|
367
353
|
customerId: string | null;
|
|
368
354
|
email: string;
|
|
369
355
|
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
@@ -400,18 +386,17 @@ export declare function getRecentOrders(limit?: number): Promise<{
|
|
|
400
386
|
/**
|
|
401
387
|
* Create a new order
|
|
402
388
|
*/
|
|
403
|
-
export declare function createOrder(data:
|
|
404
|
-
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
405
|
-
email: string;
|
|
389
|
+
export declare function createOrder(data: schema.NewOrder): Promise<{
|
|
406
390
|
id: string;
|
|
407
|
-
|
|
408
|
-
tenantId: string;
|
|
391
|
+
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
409
392
|
createdAt: Date;
|
|
410
393
|
updatedAt: Date;
|
|
411
394
|
customerId: string | null;
|
|
395
|
+
email: string;
|
|
412
396
|
subtotal: string;
|
|
413
397
|
tax: string;
|
|
414
398
|
shipping: string;
|
|
399
|
+
total: string;
|
|
415
400
|
shippingAddress: {
|
|
416
401
|
firstName: string;
|
|
417
402
|
lastName: string;
|
|
@@ -440,22 +425,21 @@ export declare function createOrder(data: Omit<schema.NewOrder, 'tenantId'>): Pr
|
|
|
440
425
|
* Create order items for an order
|
|
441
426
|
*/
|
|
442
427
|
export declare function createOrderItems(items: schema.NewOrderItem[]): Promise<{
|
|
443
|
-
name: string;
|
|
444
428
|
id: string;
|
|
445
|
-
|
|
446
|
-
quantity: number;
|
|
429
|
+
name: string;
|
|
447
430
|
price: string;
|
|
448
431
|
createdAt: Date;
|
|
449
432
|
productId: string;
|
|
433
|
+
attributes: Record<string, string> | null;
|
|
450
434
|
orderId: string;
|
|
451
435
|
variantId: string | null;
|
|
436
|
+
quantity: number;
|
|
452
437
|
}[]>;
|
|
453
438
|
/**
|
|
454
439
|
* Update order status
|
|
455
440
|
*/
|
|
456
441
|
export declare function updateOrderStatus(orderId: string, status: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled' | 'refunded'): Promise<{
|
|
457
442
|
id: string;
|
|
458
|
-
tenantId: string;
|
|
459
443
|
customerId: string | null;
|
|
460
444
|
email: string;
|
|
461
445
|
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
@@ -495,7 +479,6 @@ export declare function updateOrderStatus(orderId: string, status: 'pending' | '
|
|
|
495
479
|
*/
|
|
496
480
|
export declare function findOrderByPaymentIntent(paymentIntentId: string): Promise<{
|
|
497
481
|
id: string;
|
|
498
|
-
tenantId: string;
|
|
499
482
|
customerId: string | null;
|
|
500
483
|
email: string;
|
|
501
484
|
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
@@ -532,11 +515,11 @@ export declare function findOrderByPaymentIntent(paymentIntentId: string): Promi
|
|
|
532
515
|
/**
|
|
533
516
|
* Create a new product
|
|
534
517
|
*/
|
|
535
|
-
export declare function createProduct(data:
|
|
518
|
+
export declare function createProduct(data: schema.NewProduct): Promise<schema.Product>;
|
|
536
519
|
/**
|
|
537
520
|
* Update a product by ID
|
|
538
521
|
*/
|
|
539
|
-
export declare function updateProduct(id: string, data: Partial<Omit<schema.NewProduct, '
|
|
522
|
+
export declare function updateProduct(id: string, data: Partial<Omit<schema.NewProduct, 'id'>>): Promise<schema.Product | null>;
|
|
540
523
|
/**
|
|
541
524
|
* Archive a product by ID (soft delete).
|
|
542
525
|
* Sets status to 'archived' instead of deleting to preserve order history.
|
|
@@ -576,21 +559,21 @@ export declare function findCategoryById(id: string): Promise<schema.Category |
|
|
|
576
559
|
/**
|
|
577
560
|
* Create a new category
|
|
578
561
|
*/
|
|
579
|
-
export declare function createCategory(data:
|
|
562
|
+
export declare function createCategory(data: schema.NewCategory): Promise<schema.Category>;
|
|
580
563
|
/**
|
|
581
564
|
* Update a category by ID
|
|
582
565
|
*/
|
|
583
|
-
export declare function updateCategory(id: string, data: Partial<Omit<schema.NewCategory, '
|
|
566
|
+
export declare function updateCategory(id: string, data: Partial<Omit<schema.NewCategory, 'id'>>): Promise<schema.Category | null>;
|
|
584
567
|
/**
|
|
585
568
|
* Delete a category by ID
|
|
586
569
|
*/
|
|
587
570
|
export declare function deleteCategory(id: string): Promise<boolean>;
|
|
588
571
|
/**
|
|
589
|
-
* Count categories
|
|
572
|
+
* Count categories
|
|
590
573
|
*/
|
|
591
574
|
export declare function countCategories(): Promise<number>;
|
|
592
575
|
/**
|
|
593
|
-
* Count customers
|
|
576
|
+
* Count customers with optional search
|
|
594
577
|
*/
|
|
595
578
|
export declare function countCustomers(options?: {
|
|
596
579
|
search?: string;
|
|
@@ -600,7 +583,6 @@ export declare function countCustomers(options?: {
|
|
|
600
583
|
*/
|
|
601
584
|
export declare function findCustomerOrders(customerId: string): Promise<{
|
|
602
585
|
id: string;
|
|
603
|
-
tenantId: string;
|
|
604
586
|
customerId: string | null;
|
|
605
587
|
email: string;
|
|
606
588
|
status: "pending" | "paid" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
@@ -684,13 +666,14 @@ export interface StoreSettingsData {
|
|
|
684
666
|
freeShippingThreshold: number | null;
|
|
685
667
|
}
|
|
686
668
|
/**
|
|
687
|
-
* Find store settings
|
|
669
|
+
* Find store settings.
|
|
688
670
|
* Returns null if no settings exist (first time access).
|
|
671
|
+
* Each store has only one settings row.
|
|
689
672
|
*/
|
|
690
673
|
export declare function findSettings(): Promise<StoreSettingsData | null>;
|
|
691
674
|
/**
|
|
692
|
-
* Upsert (create or update) store settings
|
|
693
|
-
*
|
|
675
|
+
* Upsert (create or update) store settings.
|
|
676
|
+
* Each store has only one settings row.
|
|
694
677
|
*/
|
|
695
678
|
export declare function upsertSettings(data: Partial<StoreSettingsData>): Promise<StoreSettingsData>;
|
|
696
679
|
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/core/db/queries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAMlC,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAA;IACxC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,CAAA;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/core/db/queries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAMlC,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAA;IACxC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,CAAA;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,wBAAsB,YAA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