@plyaz/types 1.13.0 → 1.13.2
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/db/DatabaseAdapter.d.ts +182 -0
- package/dist/db/DatabaseService.d.ts +268 -0
- package/dist/db/EventEmitter.d.ts +68 -0
- package/dist/db/Transaction.d.ts +49 -0
- package/dist/db/adapter.d.ts +91 -0
- package/dist/db/config.types.d.ts +57 -0
- package/dist/db/database.types.d.ts +162 -0
- package/dist/db/enhanced-config.types.d.ts +311 -0
- package/dist/db/event.types.d.ts +158 -0
- package/dist/db/index.cjs +16 -0
- package/dist/db/index.cjs.map +1 -0
- package/dist/db/index.d.ts +9 -0
- package/dist/db/index.js +14 -0
- package/dist/db/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/db/adapter.ts"],"names":["ADAPTERS"],"mappings":";;;;;AAiFO,IAAK,QAAA,qBAAAA,SAAAA,KAAL;AAEL,EAAAA,UAAA,UAAA,CAAA,GAAW,UAAA;AAGX,EAAAA,UAAA,SAAA,CAAA,GAAU,SAAA;AAGV,EAAAA,UAAA,UAAA,CAAA,GAAW,UAAA;AAGX,EAAAA,UAAA,KAAA,CAAA,GAAM,KAAA;AAXI,EAAA,OAAAA,SAAAA;AAAA,CAAA,EAAA,QAAA,IAAA,EAAA","file":"index.cjs","sourcesContent":["/**\n * @fileoverview Database adapter type definitions\n * \n * Defines the enumeration of supported database adapter types used throughout\n * the database package. This enum provides type-safe identification of different\n * database integrations and is used in configuration, factory methods, and\n * adapter selection logic.\n * \n * **Application Flow Context:**\n * ```\n * Configuration → ADAPTERS Enum → AdapterFactory → Concrete Adapter\n * ↓ ↓ ↓ ↓\n * User Config → Type Safety → Adapter Creation → Database Connection\n * ```\n * \n * **Adapter Types:**\n * - **DRIZZLE**: Type-safe ORM with excellent TypeScript support\n * - **SUPABASE**: Hosted PostgreSQL with real-time capabilities\n * - **SQL**: Raw SQL execution for maximum control\n * - **DATABASE**: Generic fallback adapter\n * \n * @example\n * ```typescript\n * // Adapter selection in configuration\n * const config = {\n * adapter: ADAPTERS.DRIZZLE,\n * connectionString: process.env.DATABASE_URL\n * };\n * \n * // Type-safe adapter factory usage\n * const adapter = AdapterFactory.create(ADAPTERS.SUPABASE, supabaseConfig);\n * \n * // Switch statement with exhaustive checking\n * switch (config.adapter) {\n * case ADAPTERS.DRIZZLE:\n * // Handle Drizzle-specific logic\n * break;\n * case ADAPTERS.SUPABASE:\n * // Handle Supabase-specific logic\n * break;\n * case ADAPTERS.SQL:\n * // Handle SQL-specific logic\n * break;\n * default:\n * // TypeScript ensures all cases are handled\n * throw new Error(`Unsupported adapter: ${config.adapter}`);\n * }\n * ```\n * \n */\n/**\n * @enum ADAPTERS\n * @description\n * Enumeration of supported database adapter types.\n * \n * This enum provides type-safe identification of different database integrations\n * and is used throughout the package for configuration, factory methods, and\n * adapter selection. Each adapter type represents a different approach to\n * database connectivity and operations.\n * \n * **Adapter Characteristics:**\n * - **DATABASE**: Generic fallback, minimal functionality\n * - **DRIZZLE**: Full ORM with type safety and query building\n * - **SUPABASE**: Hosted solution with real-time and auth features\n * - **SQL**: Raw SQL for performance-critical applications\n * \n * @example\n * ```typescript\n * // Configuration with adapter selection\n * const configs = {\n * development: { adapter: ADAPTERS.DRIZZLE },\n * production: { adapter: ADAPTERS.SUPABASE },\n * performance: { adapter: ADAPTERS.SQL }\n * };\n * \n * // Type-safe adapter validation\n * function validateAdapter(adapter: ADAPTERS): boolean {\n * return Object.values(ADAPTERS).includes(adapter);\n * }\n * ```\n */\nexport enum ADAPTERS {\n /** Generic database adapter (default when no specific integration is set) */\n DATABASE = 'database',\n\n /** Drizzle ORM adapter (PostgreSQL, MySQL, SQLite, etc.) */\n DRIZZLE = 'drizzle',\n\n /** Supabase adapter (PostgreSQL backend with REST + Realtime APIs) */\n SUPABASE = 'supabase',\n\n /** Raw SQL adapter (direct database queries without ORM) */\n SQL = 'sql',\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type * from './DatabaseService';
|
|
2
|
+
export type * from './EventEmitter';
|
|
3
|
+
export type * from './config.types';
|
|
4
|
+
export type * from './DatabaseAdapter';
|
|
5
|
+
export type * from './enhanced-config.types';
|
|
6
|
+
export type * from './database.types';
|
|
7
|
+
export * from './adapter';
|
|
8
|
+
export type * from './Transaction';
|
|
9
|
+
export type * from './event.types';
|
package/dist/db/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @plyaz package - Built with tsup
|
|
2
|
+
|
|
3
|
+
// src/db/adapter.ts
|
|
4
|
+
var ADAPTERS = /* @__PURE__ */ ((ADAPTERS2) => {
|
|
5
|
+
ADAPTERS2["DATABASE"] = "database";
|
|
6
|
+
ADAPTERS2["DRIZZLE"] = "drizzle";
|
|
7
|
+
ADAPTERS2["SUPABASE"] = "supabase";
|
|
8
|
+
ADAPTERS2["SQL"] = "sql";
|
|
9
|
+
return ADAPTERS2;
|
|
10
|
+
})(ADAPTERS || {});
|
|
11
|
+
|
|
12
|
+
export { ADAPTERS };
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/db/adapter.ts"],"names":["ADAPTERS"],"mappings":";;;AAiFO,IAAK,QAAA,qBAAAA,SAAAA,KAAL;AAEL,EAAAA,UAAA,UAAA,CAAA,GAAW,UAAA;AAGX,EAAAA,UAAA,SAAA,CAAA,GAAU,SAAA;AAGV,EAAAA,UAAA,UAAA,CAAA,GAAW,UAAA;AAGX,EAAAA,UAAA,KAAA,CAAA,GAAM,KAAA;AAXI,EAAA,OAAAA,SAAAA;AAAA,CAAA,EAAA,QAAA,IAAA,EAAA","file":"index.js","sourcesContent":["/**\n * @fileoverview Database adapter type definitions\n * \n * Defines the enumeration of supported database adapter types used throughout\n * the database package. This enum provides type-safe identification of different\n * database integrations and is used in configuration, factory methods, and\n * adapter selection logic.\n * \n * **Application Flow Context:**\n * ```\n * Configuration → ADAPTERS Enum → AdapterFactory → Concrete Adapter\n * ↓ ↓ ↓ ↓\n * User Config → Type Safety → Adapter Creation → Database Connection\n * ```\n * \n * **Adapter Types:**\n * - **DRIZZLE**: Type-safe ORM with excellent TypeScript support\n * - **SUPABASE**: Hosted PostgreSQL with real-time capabilities\n * - **SQL**: Raw SQL execution for maximum control\n * - **DATABASE**: Generic fallback adapter\n * \n * @example\n * ```typescript\n * // Adapter selection in configuration\n * const config = {\n * adapter: ADAPTERS.DRIZZLE,\n * connectionString: process.env.DATABASE_URL\n * };\n * \n * // Type-safe adapter factory usage\n * const adapter = AdapterFactory.create(ADAPTERS.SUPABASE, supabaseConfig);\n * \n * // Switch statement with exhaustive checking\n * switch (config.adapter) {\n * case ADAPTERS.DRIZZLE:\n * // Handle Drizzle-specific logic\n * break;\n * case ADAPTERS.SUPABASE:\n * // Handle Supabase-specific logic\n * break;\n * case ADAPTERS.SQL:\n * // Handle SQL-specific logic\n * break;\n * default:\n * // TypeScript ensures all cases are handled\n * throw new Error(`Unsupported adapter: ${config.adapter}`);\n * }\n * ```\n * \n */\n/**\n * @enum ADAPTERS\n * @description\n * Enumeration of supported database adapter types.\n * \n * This enum provides type-safe identification of different database integrations\n * and is used throughout the package for configuration, factory methods, and\n * adapter selection. Each adapter type represents a different approach to\n * database connectivity and operations.\n * \n * **Adapter Characteristics:**\n * - **DATABASE**: Generic fallback, minimal functionality\n * - **DRIZZLE**: Full ORM with type safety and query building\n * - **SUPABASE**: Hosted solution with real-time and auth features\n * - **SQL**: Raw SQL for performance-critical applications\n * \n * @example\n * ```typescript\n * // Configuration with adapter selection\n * const configs = {\n * development: { adapter: ADAPTERS.DRIZZLE },\n * production: { adapter: ADAPTERS.SUPABASE },\n * performance: { adapter: ADAPTERS.SQL }\n * };\n * \n * // Type-safe adapter validation\n * function validateAdapter(adapter: ADAPTERS): boolean {\n * return Object.values(ADAPTERS).includes(adapter);\n * }\n * ```\n */\nexport enum ADAPTERS {\n /** Generic database adapter (default when no specific integration is set) */\n DATABASE = 'database',\n\n /** Drizzle ORM adapter (PostgreSQL, MySQL, SQLite, etc.) */\n DRIZZLE = 'drizzle',\n\n /** Supabase adapter (PostgreSQL backend with REST + Realtime APIs) */\n SUPABASE = 'supabase',\n\n /** Raw SQL adapter (direct database queries without ORM) */\n SQL = 'sql',\n}\n"]}
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/types",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"author": "Redeemer Pace",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Provides shared TypeScript types and schema utilities for validation and parsing in the @playz ecosystem.",
|
|
@@ -170,6 +170,11 @@
|
|
|
170
170
|
"import": "./dist/payments/index.js",
|
|
171
171
|
"require": "./dist/payments/index.cjs"
|
|
172
172
|
},
|
|
173
|
+
"./db": {
|
|
174
|
+
"types": "./dist/db/index.d.ts",
|
|
175
|
+
"import": "./dist/db/index.js",
|
|
176
|
+
"require": "./dist/db/index.cjs"
|
|
177
|
+
},
|
|
173
178
|
"./package.json": "./package.json"
|
|
174
179
|
},
|
|
175
180
|
"files": [
|