@withvlibe/base-sdk 1.0.0 → 1.0.1
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/{VlibeBaseAuth-ChuzgzDl.d.mts → VlibeBaseAuth-BxS9T0vB.d.mts} +6 -1
- package/dist/{VlibeBaseAuth-ChuzgzDl.d.ts → VlibeBaseAuth-BxS9T0vB.d.ts} +6 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -1
- package/dist/index.mjs +16 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* App category for Vlibe Base apps
|
|
6
6
|
*/
|
|
7
|
-
type AppCategory = 'website' | 'saas' | 'ecommerce';
|
|
7
|
+
type AppCategory = 'website' | 'saas' | 'ecommerce' | 'other';
|
|
8
8
|
/**
|
|
9
9
|
* Vlibe Base plan type
|
|
10
10
|
*/
|
|
@@ -395,6 +395,11 @@ declare class VlibeBaseDatabase {
|
|
|
395
395
|
* @throws Error if projectId or databaseToken is missing
|
|
396
396
|
*/
|
|
397
397
|
constructor(config: DatabaseConfig);
|
|
398
|
+
/**
|
|
399
|
+
* Get the full table name with unique project prefix
|
|
400
|
+
* Uses the unique timestamp portion of the project ID to avoid collisions
|
|
401
|
+
*/
|
|
402
|
+
private getFullTableName;
|
|
398
403
|
/**
|
|
399
404
|
* Initialize Supabase client for real-time subscriptions
|
|
400
405
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* App category for Vlibe Base apps
|
|
6
6
|
*/
|
|
7
|
-
type AppCategory = 'website' | 'saas' | 'ecommerce';
|
|
7
|
+
type AppCategory = 'website' | 'saas' | 'ecommerce' | 'other';
|
|
8
8
|
/**
|
|
9
9
|
* Vlibe Base plan type
|
|
10
10
|
*/
|
|
@@ -395,6 +395,11 @@ declare class VlibeBaseDatabase {
|
|
|
395
395
|
* @throws Error if projectId or databaseToken is missing
|
|
396
396
|
*/
|
|
397
397
|
constructor(config: DatabaseConfig);
|
|
398
|
+
/**
|
|
399
|
+
* Get the full table name with unique project prefix
|
|
400
|
+
* Uses the unique timestamp portion of the project ID to avoid collisions
|
|
401
|
+
*/
|
|
402
|
+
private getFullTableName;
|
|
398
403
|
/**
|
|
399
404
|
* Initialize Supabase client for real-time subscriptions
|
|
400
405
|
*/
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PaymentsConfig, C as ConnectStatus, a as CheckoutOptions, b as CheckoutSession, T as Transaction, R as RefundOptions } from './VlibeBaseAuth-
|
|
2
|
-
export { r as Address, t as ApiResponse, A as AppCategory, e as AuthConfig, n as AuthSession, B as BasePlan, j as BaseRecord, s as CartItem, f as ColumnType, D as DatabaseConfig, F as FeatureFlag, M as Media, O as Order, q as OrderItem, o as Page, u as PaginatedResponse, p as Product, Q as QueryOptions, k as RealtimePayload, S as Subscription, g as TableColumn, i as TableInfo, h as TableSchema, U as UsageMetric, y as UseAuthReturn, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, z as UsePaymentsReturn, m as VerifyResponse, c as VlibeBaseAuth, d as VlibeBaseConfig, V as VlibeBaseDatabase, l as VlibeUser } from './VlibeBaseAuth-
|
|
1
|
+
import { P as PaymentsConfig, C as ConnectStatus, a as CheckoutOptions, b as CheckoutSession, T as Transaction, R as RefundOptions } from './VlibeBaseAuth-BxS9T0vB.mjs';
|
|
2
|
+
export { r as Address, t as ApiResponse, A as AppCategory, e as AuthConfig, n as AuthSession, B as BasePlan, j as BaseRecord, s as CartItem, f as ColumnType, D as DatabaseConfig, F as FeatureFlag, M as Media, O as Order, q as OrderItem, o as Page, u as PaginatedResponse, p as Product, Q as QueryOptions, k as RealtimePayload, S as Subscription, g as TableColumn, i as TableInfo, h as TableSchema, U as UsageMetric, y as UseAuthReturn, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, z as UsePaymentsReturn, m as VerifyResponse, c as VlibeBaseAuth, d as VlibeBaseConfig, V as VlibeBaseDatabase, l as VlibeUser } from './VlibeBaseAuth-BxS9T0vB.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* VlibeBasePayments - Payment processing for Vlibe Base Apps
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PaymentsConfig, C as ConnectStatus, a as CheckoutOptions, b as CheckoutSession, T as Transaction, R as RefundOptions } from './VlibeBaseAuth-
|
|
2
|
-
export { r as Address, t as ApiResponse, A as AppCategory, e as AuthConfig, n as AuthSession, B as BasePlan, j as BaseRecord, s as CartItem, f as ColumnType, D as DatabaseConfig, F as FeatureFlag, M as Media, O as Order, q as OrderItem, o as Page, u as PaginatedResponse, p as Product, Q as QueryOptions, k as RealtimePayload, S as Subscription, g as TableColumn, i as TableInfo, h as TableSchema, U as UsageMetric, y as UseAuthReturn, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, z as UsePaymentsReturn, m as VerifyResponse, c as VlibeBaseAuth, d as VlibeBaseConfig, V as VlibeBaseDatabase, l as VlibeUser } from './VlibeBaseAuth-
|
|
1
|
+
import { P as PaymentsConfig, C as ConnectStatus, a as CheckoutOptions, b as CheckoutSession, T as Transaction, R as RefundOptions } from './VlibeBaseAuth-BxS9T0vB.js';
|
|
2
|
+
export { r as Address, t as ApiResponse, A as AppCategory, e as AuthConfig, n as AuthSession, B as BasePlan, j as BaseRecord, s as CartItem, f as ColumnType, D as DatabaseConfig, F as FeatureFlag, M as Media, O as Order, q as OrderItem, o as Page, u as PaginatedResponse, p as Product, Q as QueryOptions, k as RealtimePayload, S as Subscription, g as TableColumn, i as TableInfo, h as TableSchema, U as UsageMetric, y as UseAuthReturn, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, z as UsePaymentsReturn, m as VerifyResponse, c as VlibeBaseAuth, d as VlibeBaseConfig, V as VlibeBaseDatabase, l as VlibeUser } from './VlibeBaseAuth-BxS9T0vB.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* VlibeBasePayments - Payment processing for Vlibe Base Apps
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,21 @@ var VlibeBaseDatabase = class {
|
|
|
59
59
|
this.baseUrl = resolveBaseUrl(config.baseUrl);
|
|
60
60
|
this.supabaseUrl = config.supabaseUrl || DEFAULT_SUPABASE_URL;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the full table name with unique project prefix
|
|
64
|
+
* Uses the unique timestamp portion of the project ID to avoid collisions
|
|
65
|
+
*/
|
|
66
|
+
getFullTableName(tableName) {
|
|
67
|
+
const parts = this.projectId.split("-");
|
|
68
|
+
const lastPart = parts[parts.length - 1];
|
|
69
|
+
let prefix;
|
|
70
|
+
if (/^\d+$/.test(lastPart) && lastPart.length >= 8) {
|
|
71
|
+
prefix = lastPart.slice(0, 8);
|
|
72
|
+
} else {
|
|
73
|
+
prefix = this.projectId.replace(/^(vlibe-brief-|proj-|project-)/, "").slice(0, 8).toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
74
|
+
}
|
|
75
|
+
return `proj_${prefix}_${tableName.toLowerCase().replace(/[^a-z0-9_]/g, "")}`;
|
|
76
|
+
}
|
|
62
77
|
/**
|
|
63
78
|
* Initialize Supabase client for real-time subscriptions
|
|
64
79
|
*/
|
|
@@ -256,7 +271,7 @@ var VlibeBaseDatabase = class {
|
|
|
256
271
|
subscribe(collection, callback) {
|
|
257
272
|
this.initSupabase();
|
|
258
273
|
const channelName = `base:${this.projectId}:${collection}`;
|
|
259
|
-
const tableName =
|
|
274
|
+
const tableName = this.getFullTableName(collection);
|
|
260
275
|
const channel = this.supabase.channel(channelName).on(
|
|
261
276
|
"postgres_changes",
|
|
262
277
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -31,6 +31,21 @@ var VlibeBaseDatabase = class {
|
|
|
31
31
|
this.baseUrl = resolveBaseUrl(config.baseUrl);
|
|
32
32
|
this.supabaseUrl = config.supabaseUrl || DEFAULT_SUPABASE_URL;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the full table name with unique project prefix
|
|
36
|
+
* Uses the unique timestamp portion of the project ID to avoid collisions
|
|
37
|
+
*/
|
|
38
|
+
getFullTableName(tableName) {
|
|
39
|
+
const parts = this.projectId.split("-");
|
|
40
|
+
const lastPart = parts[parts.length - 1];
|
|
41
|
+
let prefix;
|
|
42
|
+
if (/^\d+$/.test(lastPart) && lastPart.length >= 8) {
|
|
43
|
+
prefix = lastPart.slice(0, 8);
|
|
44
|
+
} else {
|
|
45
|
+
prefix = this.projectId.replace(/^(vlibe-brief-|proj-|project-)/, "").slice(0, 8).toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
46
|
+
}
|
|
47
|
+
return `proj_${prefix}_${tableName.toLowerCase().replace(/[^a-z0-9_]/g, "")}`;
|
|
48
|
+
}
|
|
34
49
|
/**
|
|
35
50
|
* Initialize Supabase client for real-time subscriptions
|
|
36
51
|
*/
|
|
@@ -228,7 +243,7 @@ var VlibeBaseDatabase = class {
|
|
|
228
243
|
subscribe(collection, callback) {
|
|
229
244
|
this.initSupabase();
|
|
230
245
|
const channelName = `base:${this.projectId}:${collection}`;
|
|
231
|
-
const tableName =
|
|
246
|
+
const tableName = this.getFullTableName(collection);
|
|
232
247
|
const channel = this.supabase.channel(channelName).on(
|
|
233
248
|
"postgres_changes",
|
|
234
249
|
{
|
package/dist/react.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as BaseRecord, V as VlibeBaseDatabase, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, c as VlibeBaseAuth, y as UseAuthReturn } from './VlibeBaseAuth-
|
|
2
|
-
export { z as UsePaymentsReturn, l as VlibeUser } from './VlibeBaseAuth-
|
|
1
|
+
import { j as BaseRecord, V as VlibeBaseDatabase, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, c as VlibeBaseAuth, y as UseAuthReturn } from './VlibeBaseAuth-BxS9T0vB.mjs';
|
|
2
|
+
export { z as UsePaymentsReturn, l as VlibeUser } from './VlibeBaseAuth-BxS9T0vB.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* React hook for working with a database collection
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as BaseRecord, V as VlibeBaseDatabase, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, c as VlibeBaseAuth, y as UseAuthReturn } from './VlibeBaseAuth-
|
|
2
|
-
export { z as UsePaymentsReturn, l as VlibeUser } from './VlibeBaseAuth-
|
|
1
|
+
import { j as BaseRecord, V as VlibeBaseDatabase, w as UseCollectionOptions, v as UseCollectionReturn, x as UseKVReturn, c as VlibeBaseAuth, y as UseAuthReturn } from './VlibeBaseAuth-BxS9T0vB.js';
|
|
2
|
+
export { z as UsePaymentsReturn, l as VlibeUser } from './VlibeBaseAuth-BxS9T0vB.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* React hook for working with a database collection
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withvlibe/base-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "SDK for Vlibe Base Apps - includes authentication, database, payments with transaction fees, and category-specific helpers for websites, SaaS, and e-commerce",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|