@plyaz/types 1.14.2 → 1.14.4
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/api/index.cjs +0 -13
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +1 -13
- package/dist/api/index.js.map +1 -1
- package/dist/api/utils/types.d.ts +0 -19
- package/dist/common/enums.d.ts +25 -0
- package/dist/common/index.cjs +27 -0
- package/dist/common/index.cjs.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +26 -0
- package/dist/common/index.js.map +1 -1
- package/dist/db/index.cjs.map +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/errors/enums.d.ts +28 -0
- package/dist/errors/index.cjs +26 -0
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.js +26 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/index.cjs +122 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +118 -13
- package/dist/index.js.map +1 -1
- package/dist/logger/enums.d.ts +36 -0
- package/dist/logger/types.d.ts +43 -6
- package/dist/notifications/types.d.ts +8 -7
- package/dist/utils/enums.d.ts +69 -0
- package/dist/utils/types.d.ts +24 -0
- package/package.json +11 -1
- package/dist/api/utils/enums.d.ts +0 -23
- package/dist/logger/index.d.ts +0 -1
|
@@ -87,25 +87,6 @@ export interface TimeUnit {
|
|
|
87
87
|
value: number;
|
|
88
88
|
label: string;
|
|
89
89
|
}
|
|
90
|
-
/**
|
|
91
|
-
* ID generation options
|
|
92
|
-
*/
|
|
93
|
-
export interface IdGenerationOptions {
|
|
94
|
-
/** Prefix for the ID */
|
|
95
|
-
prefix?: string;
|
|
96
|
-
/** Suffix for the ID */
|
|
97
|
-
suffix?: string;
|
|
98
|
-
/** Use timestamp-based ID instead of UUID */
|
|
99
|
-
useTimestamp?: boolean;
|
|
100
|
-
/** Separator for components */
|
|
101
|
-
separator?: string;
|
|
102
|
-
/** Include random component for timestamp IDs */
|
|
103
|
-
includeRandom?: boolean;
|
|
104
|
-
/** Radix for number conversion (2-36) */
|
|
105
|
-
radix?: number;
|
|
106
|
-
/** Length of random component */
|
|
107
|
-
randomLength?: number;
|
|
108
|
-
}
|
|
109
90
|
/**
|
|
110
91
|
* Range mapping configuration
|
|
111
92
|
*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Namespaces for categorizing error exceptions classes in different packages
|
|
3
|
+
*/
|
|
4
|
+
export declare const PACKAGE_NAME_NAMESPACES: {
|
|
5
|
+
API: string;
|
|
6
|
+
AUTH: string;
|
|
7
|
+
NOTIFICATIONS: string;
|
|
8
|
+
DB: string;
|
|
9
|
+
PAYMENTS: string;
|
|
10
|
+
ERRORS: string;
|
|
11
|
+
LOGGER: string;
|
|
12
|
+
TYPES: string;
|
|
13
|
+
CONFIG: string;
|
|
14
|
+
UTILS: string;
|
|
15
|
+
EVENTS: string;
|
|
16
|
+
TRANSLATIONS: string;
|
|
17
|
+
UI: string;
|
|
18
|
+
TESTING: string;
|
|
19
|
+
CORE: string;
|
|
20
|
+
STORE: string;
|
|
21
|
+
WEB3: string;
|
|
22
|
+
MONITORING: string;
|
|
23
|
+
HOOKS: string;
|
|
24
|
+
COMMON: string;
|
|
25
|
+
};
|
package/dist/common/index.cjs
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// @plyaz package - Built with tsup
|
|
4
|
+
|
|
5
|
+
// src/common/enums.ts
|
|
6
|
+
var PACKAGE_NAME_NAMESPACES = {
|
|
7
|
+
API: "api",
|
|
8
|
+
AUTH: "auth",
|
|
9
|
+
NOTIFICATIONS: "notifications",
|
|
10
|
+
DB: "db",
|
|
11
|
+
PAYMENTS: "payments",
|
|
12
|
+
ERRORS: "errors",
|
|
13
|
+
LOGGER: "logger",
|
|
14
|
+
TYPES: "types",
|
|
15
|
+
CONFIG: "config",
|
|
16
|
+
UTILS: "utils",
|
|
17
|
+
EVENTS: "events",
|
|
18
|
+
TRANSLATIONS: "translations",
|
|
19
|
+
UI: "ui",
|
|
20
|
+
TESTING: "testing",
|
|
21
|
+
CORE: "core",
|
|
22
|
+
STORE: "store",
|
|
23
|
+
WEB3: "web3",
|
|
24
|
+
MONITORING: "monitoring",
|
|
25
|
+
HOOKS: "hooks",
|
|
26
|
+
COMMON: "common"
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.PACKAGE_NAME_NAMESPACES = PACKAGE_NAME_NAMESPACES;
|
|
3
30
|
//# sourceMappingURL=index.cjs.map
|
|
4
31
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/common/enums.ts"],"names":[],"mappings":";;;;;AAGO,IAAM,uBAAA,GAA0B;AAAA,EACrC,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,aAAA,EAAe,eAAA;AAAA,EACf,EAAA,EAAI,IAAA;AAAA,EACJ,QAAA,EAAU,UAAA;AAAA,EACV,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,YAAA,EAAc,cAAA;AAAA,EACd,EAAA,EAAI,IAAA;AAAA,EACJ,OAAA,EAAS,SAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM,MAAA;AAAA,EACN,UAAA,EAAY,YAAA;AAAA,EACZ,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ;AACV","file":"index.cjs","sourcesContent":["/**\n * Namespaces for categorizing error exceptions classes in different packages\n */\nexport const PACKAGE_NAME_NAMESPACES = {\n API: 'api',\n AUTH: 'auth',\n NOTIFICATIONS: 'notifications',\n DB: 'db',\n PAYMENTS: 'payments',\n ERRORS: 'errors',\n LOGGER: 'logger',\n TYPES: 'types',\n CONFIG: 'config',\n UTILS: 'utils',\n EVENTS: 'events',\n TRANSLATIONS: 'translations',\n UI: 'ui',\n TESTING: 'testing',\n CORE: 'core',\n STORE: 'store',\n WEB3: 'web3',\n MONITORING: 'monitoring',\n HOOKS: 'hooks',\n COMMON: 'common',\n};\n"]}
|
package/dist/common/index.d.ts
CHANGED
package/dist/common/index.js
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
// @plyaz package - Built with tsup
|
|
1
2
|
|
|
3
|
+
// src/common/enums.ts
|
|
4
|
+
var PACKAGE_NAME_NAMESPACES = {
|
|
5
|
+
API: "api",
|
|
6
|
+
AUTH: "auth",
|
|
7
|
+
NOTIFICATIONS: "notifications",
|
|
8
|
+
DB: "db",
|
|
9
|
+
PAYMENTS: "payments",
|
|
10
|
+
ERRORS: "errors",
|
|
11
|
+
LOGGER: "logger",
|
|
12
|
+
TYPES: "types",
|
|
13
|
+
CONFIG: "config",
|
|
14
|
+
UTILS: "utils",
|
|
15
|
+
EVENTS: "events",
|
|
16
|
+
TRANSLATIONS: "translations",
|
|
17
|
+
UI: "ui",
|
|
18
|
+
TESTING: "testing",
|
|
19
|
+
CORE: "core",
|
|
20
|
+
STORE: "store",
|
|
21
|
+
WEB3: "web3",
|
|
22
|
+
MONITORING: "monitoring",
|
|
23
|
+
HOOKS: "hooks",
|
|
24
|
+
COMMON: "common"
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { PACKAGE_NAME_NAMESPACES };
|
|
2
28
|
//# sourceMappingURL=index.js.map
|
|
3
29
|
//# sourceMappingURL=index.js.map
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/common/enums.ts"],"names":[],"mappings":";;;AAGO,IAAM,uBAAA,GAA0B;AAAA,EACrC,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,aAAA,EAAe,eAAA;AAAA,EACf,EAAA,EAAI,IAAA;AAAA,EACJ,QAAA,EAAU,UAAA;AAAA,EACV,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,YAAA,EAAc,cAAA;AAAA,EACd,EAAA,EAAI,IAAA;AAAA,EACJ,OAAA,EAAS,SAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM,MAAA;AAAA,EACN,UAAA,EAAY,YAAA;AAAA,EACZ,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ;AACV","file":"index.js","sourcesContent":["/**\n * Namespaces for categorizing error exceptions classes in different packages\n */\nexport const PACKAGE_NAME_NAMESPACES = {\n API: 'api',\n AUTH: 'auth',\n NOTIFICATIONS: 'notifications',\n DB: 'db',\n PAYMENTS: 'payments',\n ERRORS: 'errors',\n LOGGER: 'logger',\n TYPES: 'types',\n CONFIG: 'config',\n UTILS: 'utils',\n EVENTS: 'events',\n TRANSLATIONS: 'translations',\n UI: 'ui',\n TESTING: 'testing',\n CORE: 'core',\n STORE: 'store',\n WEB3: 'web3',\n MONITORING: 'monitoring',\n HOOKS: 'hooks',\n COMMON: 'common',\n};\n"]}
|
package/dist/db/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/db/adapter.ts","../../src/db/replicaStrategy.ts","../../src/db/databaseEventsType.ts"],"names":["ADAPTERS","REPLICA_STRATEGY","DATABASE_EVENT_TYPE"],"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;;;AC9EL,IAAK,gBAAA,qBAAAC,iBAAAA,KAAL;AAEL,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AARA,EAAA,OAAAA,iBAAAA;AAAA,CAAA,EAAA,gBAAA,IAAA,EAAA;;;ACFL,IAAK,mBAAA,qBAAAC,oBAAAA,KAAL;AACL,EAAAA,qBAAA,aAAA,CAAA,GAAc,aAAA;AACd,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,mBAAA,CAAA,GAAoB,mBAAA;AACpB,EAAAA,qBAAA,kBAAA,CAAA,GAAmB,kBAAA;AACnB,EAAAA,qBAAA,qBAAA,CAAA,GAAsB,qBAAA;AACtB,EAAAA,qBAAA,cAAA,CAAA,GAAe,cAAA;AAPL,EAAA,OAAAA,oBAAAA;AAAA,CAAA,EAAA,mBAAA,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","/**\n * Strategy options for replica selection.\n */\nexport enum REPLICA_STRATEGY {\n /** Always use primary database */\n PRIMARY = 'primary',\n /** Use any available replica */\n REPLICA = 'replica',\n /** Use geographically closest replica */\n CLOSEST = 'closest',\n /** Use fastest responding replica */\n FASTEST = 'fastest',\n}\n","// Event type enum\nexport enum DATABASE_EVENT_TYPE {\n BeforeQuery = 'beforeQuery',\n AfterQuery = 'afterQuery',\n QueryError = 'queryError',\n BeforeTransaction = 'beforeTransaction',\n AfterTransaction = 'afterTransaction',\n TransactionRollback = 'transactionRollback',\n HealthChange = 'healthChange'\n
|
|
1
|
+
{"version":3,"sources":["../../src/db/adapter.ts","../../src/db/replicaStrategy.ts","../../src/db/databaseEventsType.ts"],"names":["ADAPTERS","REPLICA_STRATEGY","DATABASE_EVENT_TYPE"],"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;;;AC9EL,IAAK,gBAAA,qBAAAC,iBAAAA,KAAL;AAEL,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AARA,EAAA,OAAAA,iBAAAA;AAAA,CAAA,EAAA,gBAAA,IAAA,EAAA;;;ACFL,IAAK,mBAAA,qBAAAC,oBAAAA,KAAL;AACL,EAAAA,qBAAA,aAAA,CAAA,GAAc,aAAA;AACd,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,mBAAA,CAAA,GAAoB,mBAAA;AACpB,EAAAA,qBAAA,kBAAA,CAAA,GAAmB,kBAAA;AACnB,EAAAA,qBAAA,qBAAA,CAAA,GAAsB,qBAAA;AACtB,EAAAA,qBAAA,cAAA,CAAA,GAAe,cAAA;AAPL,EAAA,OAAAA,oBAAAA;AAAA,CAAA,EAAA,mBAAA,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","/**\n * Strategy options for replica selection.\n */\nexport enum REPLICA_STRATEGY {\n /** Always use primary database */\n PRIMARY = 'primary',\n /** Use any available replica */\n REPLICA = 'replica',\n /** Use geographically closest replica */\n CLOSEST = 'closest',\n /** Use fastest responding replica */\n FASTEST = 'fastest',\n}\n","// Event type enum\nexport enum DATABASE_EVENT_TYPE {\n BeforeQuery = 'beforeQuery',\n AfterQuery = 'afterQuery',\n QueryError = 'queryError',\n BeforeTransaction = 'beforeTransaction',\n AfterTransaction = 'afterTransaction',\n TransactionRollback = 'transactionRollback',\n HealthChange = 'healthChange',\n}\n"]}
|
package/dist/db/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/db/adapter.ts","../../src/db/replicaStrategy.ts","../../src/db/databaseEventsType.ts"],"names":["ADAPTERS","REPLICA_STRATEGY","DATABASE_EVENT_TYPE"],"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;;;AC9EL,IAAK,gBAAA,qBAAAC,iBAAAA,KAAL;AAEL,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AARA,EAAA,OAAAA,iBAAAA;AAAA,CAAA,EAAA,gBAAA,IAAA,EAAA;;;ACFL,IAAK,mBAAA,qBAAAC,oBAAAA,KAAL;AACL,EAAAA,qBAAA,aAAA,CAAA,GAAc,aAAA;AACd,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,mBAAA,CAAA,GAAoB,mBAAA;AACpB,EAAAA,qBAAA,kBAAA,CAAA,GAAmB,kBAAA;AACnB,EAAAA,qBAAA,qBAAA,CAAA,GAAsB,qBAAA;AACtB,EAAAA,qBAAA,cAAA,CAAA,GAAe,cAAA;AAPL,EAAA,OAAAA,oBAAAA;AAAA,CAAA,EAAA,mBAAA,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","/**\n * Strategy options for replica selection.\n */\nexport enum REPLICA_STRATEGY {\n /** Always use primary database */\n PRIMARY = 'primary',\n /** Use any available replica */\n REPLICA = 'replica',\n /** Use geographically closest replica */\n CLOSEST = 'closest',\n /** Use fastest responding replica */\n FASTEST = 'fastest',\n}\n","// Event type enum\nexport enum DATABASE_EVENT_TYPE {\n BeforeQuery = 'beforeQuery',\n AfterQuery = 'afterQuery',\n QueryError = 'queryError',\n BeforeTransaction = 'beforeTransaction',\n AfterTransaction = 'afterTransaction',\n TransactionRollback = 'transactionRollback',\n HealthChange = 'healthChange'\n
|
|
1
|
+
{"version":3,"sources":["../../src/db/adapter.ts","../../src/db/replicaStrategy.ts","../../src/db/databaseEventsType.ts"],"names":["ADAPTERS","REPLICA_STRATEGY","DATABASE_EVENT_TYPE"],"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;;;AC9EL,IAAK,gBAAA,qBAAAC,iBAAAA,KAAL;AAEL,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AAEV,EAAAA,kBAAA,SAAA,CAAA,GAAU,SAAA;AARA,EAAA,OAAAA,iBAAAA;AAAA,CAAA,EAAA,gBAAA,IAAA,EAAA;;;ACFL,IAAK,mBAAA,qBAAAC,oBAAAA,KAAL;AACL,EAAAA,qBAAA,aAAA,CAAA,GAAc,aAAA;AACd,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,qBAAA,mBAAA,CAAA,GAAoB,mBAAA;AACpB,EAAAA,qBAAA,kBAAA,CAAA,GAAmB,kBAAA;AACnB,EAAAA,qBAAA,qBAAA,CAAA,GAAsB,qBAAA;AACtB,EAAAA,qBAAA,cAAA,CAAA,GAAe,cAAA;AAPL,EAAA,OAAAA,oBAAAA;AAAA,CAAA,EAAA,mBAAA,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","/**\n * Strategy options for replica selection.\n */\nexport enum REPLICA_STRATEGY {\n /** Always use primary database */\n PRIMARY = 'primary',\n /** Use any available replica */\n REPLICA = 'replica',\n /** Use geographically closest replica */\n CLOSEST = 'closest',\n /** Use fastest responding replica */\n FASTEST = 'fastest',\n}\n","// Event type enum\nexport enum DATABASE_EVENT_TYPE {\n BeforeQuery = 'beforeQuery',\n AfterQuery = 'afterQuery',\n QueryError = 'queryError',\n BeforeTransaction = 'beforeTransaction',\n AfterTransaction = 'afterTransaction',\n TransactionRollback = 'transactionRollback',\n HealthChange = 'healthChange',\n}\n"]}
|
package/dist/errors/enums.d.ts
CHANGED
|
@@ -299,3 +299,31 @@ export declare const COMMON_STORAGE_TYPES: {
|
|
|
299
299
|
readonly REDIS: "redis";
|
|
300
300
|
readonly DATABASE: "database";
|
|
301
301
|
};
|
|
302
|
+
/**
|
|
303
|
+
* Namespaces for categorizing error exceptions classes in different packages and category based exceptions
|
|
304
|
+
*/
|
|
305
|
+
export declare const ERROR_EXCEPTIONS_NAMESPACES: {
|
|
306
|
+
BASE: string;
|
|
307
|
+
API: string;
|
|
308
|
+
AUTH: string;
|
|
309
|
+
NOTIFICATIONS: string;
|
|
310
|
+
DB: string;
|
|
311
|
+
VALIDATION: string;
|
|
312
|
+
GENERIC: string;
|
|
313
|
+
PAYMENTS: string;
|
|
314
|
+
ERRORS: string;
|
|
315
|
+
LOGGER: string;
|
|
316
|
+
TYPES: string;
|
|
317
|
+
CONFIG: string;
|
|
318
|
+
UTILS: string;
|
|
319
|
+
EVENTS: string;
|
|
320
|
+
TRANSLATIONS: string;
|
|
321
|
+
UI: string;
|
|
322
|
+
TESTING: string;
|
|
323
|
+
CORE: string;
|
|
324
|
+
STORE: string;
|
|
325
|
+
WEB3: string;
|
|
326
|
+
MONITORING: string;
|
|
327
|
+
HOOKS: string;
|
|
328
|
+
COMMON: string;
|
|
329
|
+
};
|
package/dist/errors/index.cjs
CHANGED
|
@@ -220,6 +220,31 @@ var COMMON_STORAGE_TYPES = {
|
|
|
220
220
|
REDIS: "redis",
|
|
221
221
|
DATABASE: "database"
|
|
222
222
|
};
|
|
223
|
+
var ERROR_EXCEPTIONS_NAMESPACES = {
|
|
224
|
+
BASE: "base",
|
|
225
|
+
API: "api",
|
|
226
|
+
AUTH: "auth",
|
|
227
|
+
NOTIFICATIONS: "notifications",
|
|
228
|
+
DB: "db",
|
|
229
|
+
VALIDATION: "validation",
|
|
230
|
+
GENERIC: "generic",
|
|
231
|
+
PAYMENTS: "payments",
|
|
232
|
+
ERRORS: "errors",
|
|
233
|
+
LOGGER: "logger",
|
|
234
|
+
TYPES: "types",
|
|
235
|
+
CONFIG: "config",
|
|
236
|
+
UTILS: "utils",
|
|
237
|
+
EVENTS: "events",
|
|
238
|
+
TRANSLATIONS: "translations",
|
|
239
|
+
UI: "ui",
|
|
240
|
+
TESTING: "testing",
|
|
241
|
+
CORE: "core",
|
|
242
|
+
STORE: "store",
|
|
243
|
+
WEB3: "web3",
|
|
244
|
+
MONITORING: "monitoring",
|
|
245
|
+
HOOKS: "hooks",
|
|
246
|
+
COMMON: "common"
|
|
247
|
+
};
|
|
223
248
|
|
|
224
249
|
// src/http/constants.ts
|
|
225
250
|
var HTTP_STATUS = {
|
|
@@ -1424,6 +1449,7 @@ exports.ERROR_CATEGORY = ERROR_CATEGORY;
|
|
|
1424
1449
|
exports.ERROR_CATEGORY_TO_EMITTER_KEY = ERROR_CATEGORY_TO_EMITTER_KEY;
|
|
1425
1450
|
exports.ERROR_CODES = ERROR_CODES;
|
|
1426
1451
|
exports.ERROR_DEFINITIONS = ERROR_DEFINITIONS;
|
|
1452
|
+
exports.ERROR_EXCEPTIONS_NAMESPACES = ERROR_EXCEPTIONS_NAMESPACES;
|
|
1427
1453
|
exports.ERROR_SEVERITY = ERROR_SEVERITY;
|
|
1428
1454
|
exports.ERROR_TYPE = ERROR_TYPE;
|
|
1429
1455
|
exports.INTERNAL_STATUS_CODES = INTERNAL_STATUS_CODES;
|