@quiqflow-org/quiqflow-multi-tenants-utils 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/README.md +113 -0
- package/dist/TenantConnectionManager.d.ts +45 -1
- package/dist/TenantConnectionManager.d.ts.map +1 -1
- package/dist/TenantConnectionManager.js +140 -14
- package/dist/types.d.ts +17 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# quiqflow-multi-tenants-utils
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/quiqflow-multi-tenants-utils)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Quiqflow multi-tenant management utilities.
|
|
7
|
+
This package provides utility functions and helpers for developing, managing, and operating tenant-aware applications and services within the Quiqflow ecosystem.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Tenant isolation:** Utilities for handling multiple tenants with clear separation.
|
|
14
|
+
- **Configuration management:** Simplifies the loading and handling of tenant-specific configurations.
|
|
15
|
+
- **Helpers for onboarding/provisioning:** Facilitates new tenant setup and management flows.
|
|
16
|
+
- **Security and context management:** Assists in establishing secure context for tenant operations.
|
|
17
|
+
- **Extensible and framework-agnostic:** Easily integrates with Node.js/TypeScript backends and microservices.
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
|
|
21
|
+
- [Installation](#installation)
|
|
22
|
+
- [Usage](#usage)
|
|
23
|
+
- [API Reference](#api-reference)
|
|
24
|
+
- [Examples](#examples)
|
|
25
|
+
- [Contributing](#contributing)
|
|
26
|
+
- [License](#license)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install quiqflow-multi-tenants-utils
|
|
34
|
+
# or
|
|
35
|
+
yarn add quiqflow-multi-tenants-utils
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
Import the package in your TypeScript/Node.js project:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { getTenantContext, TenantConfigLoader } from 'quiqflow-multi-tenants-utils';
|
|
46
|
+
|
|
47
|
+
// Example: Retrieve tenant context from a request
|
|
48
|
+
const tenantId = req.headers['x-tenant-id'];
|
|
49
|
+
const tenantContext = getTenantContext(tenantId);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or in JavaScript:
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
const { getTenantContext, TenantConfigLoader } = require('quiqflow-multi-tenants-utils');
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## API Reference
|
|
61
|
+
|
|
62
|
+
> 📑 **NOTE:** Consult the inline TypeScript documentation or see [API details](#) if available.
|
|
63
|
+
|
|
64
|
+
### `getTenantContext(tenantId: string): TenantContext`
|
|
65
|
+
Retrieves or builds a tenant-specific context object using the provided tenant identifier.
|
|
66
|
+
|
|
67
|
+
### `TenantConfigLoader`
|
|
68
|
+
A utility to load and cache tenant-specific configuration files.
|
|
69
|
+
|
|
70
|
+
#### Example:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
const configLoader = new TenantConfigLoader('/path/to/configs');
|
|
74
|
+
const tenantConfig = configLoader.loadConfig(tenantId);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
> Additional helper functions may include:
|
|
78
|
+
> - Middleware for Express.js/Koa to inject tenant context
|
|
79
|
+
> - Utilities for tenant-aware logging
|
|
80
|
+
> - Helper types and guards for safe multi-tenant code
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Examples
|
|
85
|
+
|
|
86
|
+
See the `/examples` directory (if present) or review test files for usage patterns and integration scenarios.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Contributing
|
|
91
|
+
|
|
92
|
+
Contributions are welcome!
|
|
93
|
+
Please open issues or pull requests for bug fixes, new features, or improvements.
|
|
94
|
+
|
|
95
|
+
1. Fork the repository.
|
|
96
|
+
2. Create a new branch (`git checkout -b feature/my-feature`).
|
|
97
|
+
3. Commit your changes (`git commit -am 'Add new feature'`).
|
|
98
|
+
4. Push to the branch (`git push origin feature/my-feature`).
|
|
99
|
+
5. Create a pull request.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## About
|
|
110
|
+
|
|
111
|
+
**quiqflow-multi-tenants-utils** is maintained by the Quiqflow team.
|
|
112
|
+
|
|
113
|
+
For questions or support, please open an [issue](https://github.com/Quiqflow-2-0/quiqflow-multi-tenants-utils/issues).
|
|
@@ -7,12 +7,56 @@ export declare class TenantConnectionManager {
|
|
|
7
7
|
private constructor();
|
|
8
8
|
static init(opts: TenantConnectionManagerOptions): TenantConnectionManager;
|
|
9
9
|
static getInstance(): TenantConnectionManager;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Get a connection for a schema. Options:
|
|
12
|
+
* - forceNew: Close existing connection and create a fresh one (new DB pool)
|
|
13
|
+
* - skipCache: Don't use cached connection, always create new (but still cache result)
|
|
14
|
+
*/
|
|
15
|
+
getConnection(schemaName: string, options?: {
|
|
16
|
+
forceNew?: boolean;
|
|
17
|
+
skipCache?: boolean;
|
|
18
|
+
}): Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Force refresh a connection - closes the DB pool entirely and creates a new one
|
|
21
|
+
* This ensures the new connection has a fresh view of all schemas in the database
|
|
22
|
+
*/
|
|
23
|
+
refreshConnection(schemaName: string): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Refresh all cached connections - useful when schemas have been added/removed
|
|
26
|
+
* Closes all existing DB pools and creates new ones
|
|
27
|
+
*/
|
|
28
|
+
refreshAllConnections(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Validate that a cached connection's schema still exists in the database
|
|
31
|
+
* Uses a fresh query to pg_namespace to check current state
|
|
32
|
+
* Returns false if schema doesn't exist or connection is broken
|
|
33
|
+
*/
|
|
34
|
+
private validateConnection;
|
|
11
35
|
/**
|
|
12
36
|
* Efficiently ensure schema isolation for reused connections
|
|
13
37
|
* Fixes Sequelize model schema caching issues in multi-tenant environment
|
|
14
38
|
*/
|
|
15
39
|
private ensureSchemaIsolation;
|
|
40
|
+
/**
|
|
41
|
+
* Remove a specific connection from the cache and close its DB pool
|
|
42
|
+
* Use this when a schema is deleted or connection becomes stale
|
|
43
|
+
*/
|
|
44
|
+
removeConnection(schemaName: string): Promise<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Check if a connection is cached for the given schema
|
|
47
|
+
*/
|
|
48
|
+
hasConnection(schemaName: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Get all cached schema names
|
|
51
|
+
*/
|
|
52
|
+
getCachedSchemas(): string[];
|
|
53
|
+
/**
|
|
54
|
+
* Get count of cached connections
|
|
55
|
+
*/
|
|
56
|
+
getCacheSize(): number;
|
|
57
|
+
/**
|
|
58
|
+
* Close all connections and clear the cache
|
|
59
|
+
*/
|
|
16
60
|
closeAll(): Promise<void>;
|
|
17
61
|
}
|
|
18
62
|
//# sourceMappingURL=TenantConnectionManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantConnectionManager.d.ts","sourceRoot":"","sources":["../src/TenantConnectionManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"TenantConnectionManager.d.ts","sourceRoot":"","sources":["../src/TenantConnectionManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAIzD,qBAAa,uBAAuB;IAClC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAwC;IAChE,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,OAAO,CAA4C;IAC3D,OAAO,CAAC,YAAY,CAAC,CAAiD;IAEtE,OAAO;IAKP,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,8BAA8B,GAAG,uBAAuB;IAK1E,MAAM,CAAC,WAAW,IAAI,uBAAuB;IAM7C;;;;OAIG;IACG,aAAa,CACjB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GACpD,OAAO,CAAC,GAAG,CAAC;IA0Cf;;;OAGG;IACG,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAOzD;;;OAGG;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5C;;;;OAIG;YACW,kBAAkB;IAmChC;;;OAGG;YACW,qBAAqB;IAgBnC;;;OAGG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA4B5D;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAI1C;;OAEG;IACH,gBAAgB,IAAI,MAAM,EAAE;IAI5B;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAwBhC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TenantConnectionManager = void 0;
|
|
4
|
+
const LOG_PREFIX = "[TenantConnectionManager]";
|
|
4
5
|
class TenantConnectionManager {
|
|
5
6
|
constructor(opts) {
|
|
6
7
|
this.connections = new Map();
|
|
@@ -17,19 +18,90 @@ class TenantConnectionManager {
|
|
|
17
18
|
throw new Error("TenantConnectionManager not initialized");
|
|
18
19
|
return this._instance;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Get a connection for a schema. Options:
|
|
23
|
+
* - forceNew: Close existing connection and create a fresh one (new DB pool)
|
|
24
|
+
* - skipCache: Don't use cached connection, always create new (but still cache result)
|
|
25
|
+
*/
|
|
26
|
+
async getConnection(schemaName, options) {
|
|
27
|
+
const { forceNew = false, skipCache = false } = options || {};
|
|
28
|
+
// If forceNew, close existing connection first to get fresh DB pool
|
|
29
|
+
if (forceNew && this.connections.has(schemaName)) {
|
|
30
|
+
console.log(`${LOG_PREFIX} Force closing existing connection for "${schemaName}" to create fresh DB pool`);
|
|
31
|
+
await this.removeConnection(schemaName);
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
// Check if we have a cached connection
|
|
34
|
+
if (!skipCache && !forceNew && this.connections.has(schemaName)) {
|
|
35
|
+
const cachedOrm = this.connections.get(schemaName);
|
|
36
|
+
// Validate the cached connection - check if schema still exists
|
|
37
|
+
const isValid = await this.validateConnection(cachedOrm, schemaName);
|
|
38
|
+
if (!isValid) {
|
|
39
|
+
console.log(`${LOG_PREFIX} Cached connection for "${schemaName}" is stale, removing and creating new one`);
|
|
40
|
+
await this.removeConnection(schemaName);
|
|
41
|
+
// Fall through to create a new connection
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Cached connection is valid, ensure schema isolation and return
|
|
45
|
+
await this.ensureSchemaIsolation(cachedOrm, schemaName);
|
|
46
|
+
return cachedOrm;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Create a new connection with fresh DB pool
|
|
50
|
+
console.log(`${LOG_PREFIX} Creating new connection for "${schemaName}" (fresh DB pool)`);
|
|
51
|
+
const orm = await this.factory({ schemaName });
|
|
52
|
+
if (this.authenticate)
|
|
53
|
+
await this.authenticate(orm);
|
|
54
|
+
this.connections.set(schemaName, orm);
|
|
31
55
|
return orm;
|
|
32
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Force refresh a connection - closes the DB pool entirely and creates a new one
|
|
59
|
+
* This ensures the new connection has a fresh view of all schemas in the database
|
|
60
|
+
*/
|
|
61
|
+
async refreshConnection(schemaName) {
|
|
62
|
+
console.log(`${LOG_PREFIX} Refreshing connection for "${schemaName}" with fresh DB pool`);
|
|
63
|
+
return this.getConnection(schemaName, { forceNew: true });
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Refresh all cached connections - useful when schemas have been added/removed
|
|
67
|
+
* Closes all existing DB pools and creates new ones
|
|
68
|
+
*/
|
|
69
|
+
async refreshAllConnections() {
|
|
70
|
+
const schemas = this.getCachedSchemas();
|
|
71
|
+
console.log(`${LOG_PREFIX} Refreshing all ${schemas.length} cached connections`);
|
|
72
|
+
// Close all existing connections first
|
|
73
|
+
await this.closeAll();
|
|
74
|
+
// Note: Connections will be recreated on-demand when getConnection is called
|
|
75
|
+
console.log(`${LOG_PREFIX} All connections closed. New connections will be created on-demand.`);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Validate that a cached connection's schema still exists in the database
|
|
79
|
+
* Uses a fresh query to pg_namespace to check current state
|
|
80
|
+
* Returns false if schema doesn't exist or connection is broken
|
|
81
|
+
*/
|
|
82
|
+
async validateConnection(orm, schemaName) {
|
|
83
|
+
var _a;
|
|
84
|
+
try {
|
|
85
|
+
// Query pg_namespace directly - this always reflects current database state
|
|
86
|
+
const result = await orm.sequelize.query(`SELECT EXISTS(
|
|
87
|
+
SELECT 1 FROM pg_namespace
|
|
88
|
+
WHERE nspname = :schemaName
|
|
89
|
+
) as exists`, {
|
|
90
|
+
replacements: { schemaName },
|
|
91
|
+
type: "SELECT",
|
|
92
|
+
});
|
|
93
|
+
const exists = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.exists;
|
|
94
|
+
if (!exists) {
|
|
95
|
+
console.log(`${LOG_PREFIX} Schema "${schemaName}" no longer exists in database`);
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.warn(`${LOG_PREFIX} Error validating connection for "${schemaName}":`, error.message);
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
33
105
|
/**
|
|
34
106
|
* Efficiently ensure schema isolation for reused connections
|
|
35
107
|
* Fixes Sequelize model schema caching issues in multi-tenant environment
|
|
@@ -45,16 +117,70 @@ class TenantConnectionManager {
|
|
|
45
117
|
}
|
|
46
118
|
});
|
|
47
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Remove a specific connection from the cache and close its DB pool
|
|
122
|
+
* Use this when a schema is deleted or connection becomes stale
|
|
123
|
+
*/
|
|
124
|
+
async removeConnection(schemaName) {
|
|
125
|
+
const orm = this.connections.get(schemaName);
|
|
126
|
+
if (!orm)
|
|
127
|
+
return false;
|
|
128
|
+
try {
|
|
129
|
+
// Close the Sequelize connection pool entirely
|
|
130
|
+
if (orm.sequelize && typeof orm.sequelize.close === "function") {
|
|
131
|
+
await orm.sequelize.close();
|
|
132
|
+
console.log(`${LOG_PREFIX} Closed Sequelize pool for "${schemaName}"`);
|
|
133
|
+
}
|
|
134
|
+
else if (typeof orm.close === "function") {
|
|
135
|
+
await orm.close();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
console.warn(`${LOG_PREFIX} Error closing connection for "${schemaName}":`, error.message);
|
|
140
|
+
}
|
|
141
|
+
this.connections.delete(schemaName);
|
|
142
|
+
console.log(`${LOG_PREFIX} Removed cached connection for "${schemaName}"`);
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Check if a connection is cached for the given schema
|
|
147
|
+
*/
|
|
148
|
+
hasConnection(schemaName) {
|
|
149
|
+
return this.connections.has(schemaName);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get all cached schema names
|
|
153
|
+
*/
|
|
154
|
+
getCachedSchemas() {
|
|
155
|
+
return Array.from(this.connections.keys());
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get count of cached connections
|
|
159
|
+
*/
|
|
160
|
+
getCacheSize() {
|
|
161
|
+
return this.connections.size;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Close all connections and clear the cache
|
|
165
|
+
*/
|
|
48
166
|
async closeAll() {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
167
|
+
console.log(`${LOG_PREFIX} Closing all ${this.connections.size} cached connections`);
|
|
168
|
+
for (const [schemaName, orm] of this.connections) {
|
|
169
|
+
try {
|
|
170
|
+
if (orm.sequelize && typeof orm.sequelize.close === "function") {
|
|
171
|
+
await orm.sequelize.close();
|
|
172
|
+
}
|
|
173
|
+
else if (orm && typeof orm.close === "function") {
|
|
52
174
|
await orm.close();
|
|
53
175
|
}
|
|
54
|
-
|
|
176
|
+
console.log(`${LOG_PREFIX} Closed connection for "${schemaName}"`);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.warn(`${LOG_PREFIX} Error closing "${schemaName}":`, error.message);
|
|
55
180
|
}
|
|
56
181
|
}
|
|
57
182
|
this.connections.clear();
|
|
183
|
+
console.log(`${LOG_PREFIX} All connections closed and cache cleared`);
|
|
58
184
|
}
|
|
59
185
|
}
|
|
60
186
|
exports.TenantConnectionManager = TenantConnectionManager;
|
package/dist/types.d.ts
CHANGED
|
@@ -43,8 +43,24 @@ export interface CreateTenantMiddlewareOptions {
|
|
|
43
43
|
allowOptional?: boolean;
|
|
44
44
|
}
|
|
45
45
|
export type TenantMiddleware = (req: TenantContextAugmentedRequest, res: Response, next: NextFunction) => Promise<void>;
|
|
46
|
+
export interface GetConnectionOptions {
|
|
47
|
+
/** Close existing connection and create a fresh one with new DB pool */
|
|
48
|
+
forceNew?: boolean;
|
|
49
|
+
/** Don't use cached connection, always create new (but still cache result) */
|
|
50
|
+
skipCache?: boolean;
|
|
51
|
+
}
|
|
46
52
|
export interface TenantConnectionManagerLike {
|
|
47
|
-
getConnection(schemaName: string): Promise<any>;
|
|
53
|
+
getConnection(schemaName: string, options?: GetConnectionOptions): Promise<any>;
|
|
54
|
+
/** Force refresh a connection with fresh DB pool */
|
|
55
|
+
refreshConnection?(schemaName: string): Promise<any>;
|
|
56
|
+
/** Refresh all cached connections */
|
|
57
|
+
refreshAllConnections?(): Promise<void>;
|
|
58
|
+
/** Remove a specific connection from cache */
|
|
59
|
+
removeConnection?(schemaName: string): Promise<boolean>;
|
|
60
|
+
/** Check if a connection is cached */
|
|
61
|
+
hasConnection?(schemaName: string): boolean;
|
|
62
|
+
/** Get all cached schema names */
|
|
63
|
+
getCachedSchemas?(): string[];
|
|
48
64
|
}
|
|
49
65
|
export interface SchemaResolutionServiceLike {
|
|
50
66
|
resolveSchemaForTenant(tenantId: number): Promise<string>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;A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AAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrD,qCAAqC;IACrC,qBAAqB,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,8CAA8C;IAC9C,gBAAgB,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,sCAAsC;IACtC,aAAa,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5C,kCAAkC;IAClC,gBAAgB,CAAC,IAAI,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,2BAA2B;IAC1C,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiqflow-org/quiqflow-multi-tenants-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Shared multi-tenant helpers (schema resolution, connection management, middleware) for Quiqflow services.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|