mongodb-dynamic-api 4.8.0 → 4.10.0
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/CHANGELOG.md +21 -0
- package/README.md +1 -0
- package/package.json +2 -1
- package/src/dynamic-api.module.d.ts +1 -1
- package/src/dynamic-api.module.js +14 -1
- package/src/dynamic-api.module.js.map +1 -1
- package/src/helpers/route-description.helper.js +2 -0
- package/src/helpers/route-description.helper.js.map +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/interfaces/dynamic-api-custom-route.interface.d.ts +34 -0
- package/src/interfaces/dynamic-api-custom-route.interface.js +3 -0
- package/src/interfaces/dynamic-api-custom-route.interface.js.map +1 -0
- package/src/interfaces/dynamic-api-options.interface.d.ts +2 -0
- package/src/interfaces/dynamic-api-options.interface.js.map +1 -1
- package/src/interfaces/dynamic-api-presence.interface.d.ts +22 -0
- package/src/interfaces/dynamic-api-presence.interface.js +6 -0
- package/src/interfaces/dynamic-api-presence.interface.js.map +1 -0
- package/src/interfaces/dynamic-api-route-type.type.d.ts +1 -1
- package/src/interfaces/index.d.ts +2 -0
- package/src/interfaces/index.js +2 -0
- package/src/interfaces/index.js.map +1 -1
- package/src/modules/presence/adapters/in-memory-presence.adapter.d.ts +10 -0
- package/src/modules/presence/adapters/in-memory-presence.adapter.js +64 -0
- package/src/modules/presence/adapters/in-memory-presence.adapter.js.map +1 -0
- package/src/modules/presence/adapters/redis-presence.adapter.d.ts +17 -0
- package/src/modules/presence/adapters/redis-presence.adapter.js +80 -0
- package/src/modules/presence/adapters/redis-presence.adapter.js.map +1 -0
- package/src/modules/presence/index.d.ts +5 -0
- package/src/modules/presence/index.js +22 -0
- package/src/modules/presence/index.js.map +1 -0
- package/src/modules/presence/presence.controller.d.ts +6 -0
- package/src/modules/presence/presence.controller.js +55 -0
- package/src/modules/presence/presence.controller.js.map +1 -0
- package/src/modules/presence/presence.gateway.d.ts +13 -0
- package/src/modules/presence/presence.gateway.js +79 -0
- package/src/modules/presence/presence.gateway.js.map +1 -0
- package/src/modules/presence/presence.module.d.ts +5 -0
- package/src/modules/presence/presence.module.js +50 -0
- package/src/modules/presence/presence.module.js.map +1 -0
- package/src/routes/custom/create-custom-route-controller.d.ts +7 -0
- package/src/routes/custom/create-custom-route-controller.js +133 -0
- package/src/routes/custom/create-custom-route-controller.js.map +1 -0
- package/src/routes/custom/create-custom-route-gateway.d.ts +6 -0
- package/src/routes/custom/create-custom-route-gateway.js +98 -0
- package/src/routes/custom/create-custom-route-gateway.js.map +1 -0
- package/src/routes/custom/index.d.ts +2 -0
- package/src/routes/custom/index.js +19 -0
- package/src/routes/custom/index.js.map +1 -0
- package/src/routes/index.d.ts +1 -0
- package/src/routes/index.js +1 -0
- package/src/routes/index.js.map +1 -1
- package/src/version.json +1 -1
- package/test/for-feature/custom-routes.e2e-spec.d.ts +1 -0
- package/test/for-feature/custom-routes.e2e-spec.js +275 -0
- package/test/for-feature/custom-routes.e2e-spec.js.map +1 -0
- package/test/for-feature/presence.e2e-spec.d.ts +1 -0
- package/test/for-feature/presence.e2e-spec.js +169 -0
- package/test/for-feature/presence.e2e-spec.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
|
|
3
|
+
## [4.10.0](https://github.com/MikeDev75015/mongodb-dynamic-api/compare/v4.9.0...v4.10.0) (2026-05-25)
|
|
4
|
+
|
|
5
|
+
### custom-route
|
|
6
|
+
|
|
7
|
+
* **custom-route:** add WebSocket gateway support ([f7b54a4](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/f7b54a4))
|
|
8
|
+
* **custom-route:** remove unnecessary type casts in controller factory ([8448e8e](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/8448e8ee16c3ada8fdcb08c3d3252a05ca82b90a))
|
|
9
|
+
* **custom-route:** rename DynamicApiCustomRouteConfig to CustomRouteConfig ([4b67e6b](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/4b67e6bffad70424d6898db3ffa47db0ac4e9a26))
|
|
10
|
+
|
|
11
|
+
### custom-routes
|
|
12
|
+
|
|
13
|
+
* **custom-routes:** add customRoutes option to forFeature() ([3a06adb](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/3a06adb032102233d9a13bab35f05a7e7fbcb19e))
|
|
14
|
+
|
|
15
|
+
## [4.9.0](https://github.com/MikeDev75015/mongodb-dynamic-api/compare/v4.8.0...v4.9.0) (2026-05-25)
|
|
16
|
+
|
|
17
|
+
### presence
|
|
18
|
+
|
|
19
|
+
* **presence:** add @Public() to PresenceController and fix e2e race conditions ([6245e6d](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/6245e6d265d6a086d3aa6813df3c1cd71fa7303d))
|
|
20
|
+
* **presence:** add DynamicApiPresenceModule with pluggable adapters ([5957c54](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/5957c54b62664f5861123468f50068861aff7b78))
|
|
21
|
+
* **presence:** break circular dependency by moving presence out of modules barrel ([51fad6a](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/51fad6a7fe8b7dd3472bbd27fd25ff6f70a80267))
|
|
22
|
+
* **presence:** replace String(err) with JSON.stringify in gateway error handler ([8dcaa04](https://github.com/MikeDev75015/mongodb-dynamic-api/commit/8dcaa04499ef0dbacb988b9a0acddbf463ac68be))
|
|
23
|
+
|
|
3
24
|
## [4.8.0](https://github.com/MikeDev75015/mongodb-dynamic-api/compare/v4.7.0...v4.8.0) (2026-05-24)
|
|
4
25
|
|
|
5
26
|
### cascade
|
package/README.md
CHANGED
|
@@ -895,6 +895,7 @@ Explore advanced features and configurations:
|
|
|
895
895
|
| 🔐 **Authentication** | JWT dual-token auth (8 endpoints) — access + refresh tokens, cookie mode, server-side revocation | [View Guide](https://github.com/MikeDev75015/mongodb-dynamic-api/blob/main/README/authentication.md) |
|
|
896
896
|
| 🛡️ **Authorization** | Role-based access control | [View Guide](https://github.com/MikeDev75015/mongodb-dynamic-api/blob/main/README/authorization.md) |
|
|
897
897
|
| 📡 **WebSockets** | Socket.IO integration for routes | [View Guide](https://github.com/MikeDev75015/mongodb-dynamic-api/blob/main/README/websockets.md) |
|
|
898
|
+
| 🟢 **Presence** | Real-time online/offline tracking for WebSocket users | [View Guide](https://github.com/MikeDev75015/mongodb-dynamic-api/blob/main/README/presence.md) |
|
|
898
899
|
| 🗂️ **Route Configuration** | All route options: DTOs, interceptors, etc. | [View Guide](https://github.com/MikeDev75015/mongodb-dynamic-api/blob/main/README/route-config.md) |
|
|
899
900
|
| 🔁 **Callbacks** | beforeSave / afterSave hooks, typed contexts, user access, audit trails | [View Guide](https://github.com/MikeDev75015/mongodb-dynamic-api/blob/main/README/callbacks.md) |
|
|
900
901
|
| 🎛️ **Controller Configuration** | All `controllerOptions` and `forFeature` options | [View Guide](https://github.com/MikeDev75015/mongodb-dynamic-api/blob/main/README/controller-config.md) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodb-dynamic-api",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "Auto generated CRUD API for MongoDB using NestJS",
|
|
5
5
|
"readmeFilename": "README.md",
|
|
6
6
|
"main": "index.js",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"class-validator": "^0.14.1",
|
|
58
58
|
"cookie-parser": "^1.4.7",
|
|
59
59
|
"dotenv": "^16.4.5",
|
|
60
|
+
"ioredis": "^5.10.1",
|
|
60
61
|
"mongodb-pipeline-builder": "^4.0.2",
|
|
61
62
|
"mongoose": "^8.9.5",
|
|
62
63
|
"passport": "^0.7.0",
|
|
@@ -5,7 +5,7 @@ import { DynamicApiGlobalStateService } from './services';
|
|
|
5
5
|
export declare class DynamicApiModule {
|
|
6
6
|
static readonly state: DynamicApiGlobalStateService;
|
|
7
7
|
static forRoot<Entity extends BaseEntity = any>(uri: string, { useGlobalCache, cacheOptions, useAuth, routesConfig, webSocket, broadcastGatewayOptions, }?: DynamicApiForRootOptions<Entity>): DynamicModule;
|
|
8
|
-
static forFeature<Entity extends BaseEntity>({ entity, controllerOptions, routes, webSocket: featureWebSocket, extraImports, extraProviders, extraControllers, }: DynamicApiForFeatureOptions<Entity>): Promise<DynamicModule>;
|
|
8
|
+
static forFeature<Entity extends BaseEntity>({ entity, controllerOptions, routes, webSocket: featureWebSocket, extraImports, extraProviders, extraControllers, customRoutes, }: DynamicApiForFeatureOptions<Entity>): Promise<DynamicModule>;
|
|
9
9
|
private static buildStateFromOptions;
|
|
10
10
|
private static setDefaultRoutes;
|
|
11
11
|
}
|
|
@@ -52,7 +52,7 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
52
52
|
exports: [modules_1.DynamicApiConfigModule],
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
static forFeature({ entity, controllerOptions, routes, webSocket: featureWebSocket, extraImports, extraProviders, extraControllers, }) {
|
|
55
|
+
static forFeature({ entity, controllerOptions, routes, webSocket: featureWebSocket, extraImports, extraProviders, extraControllers, customRoutes = [], }) {
|
|
56
56
|
const schema = (0, helpers_1.buildSchemaFromEntity)(entity);
|
|
57
57
|
const databaseModule = mongoose_1.MongooseModule.forFeature([{ name: entity.name, schema }], this.state.get('connectionName'));
|
|
58
58
|
services_1.DynamicApiGlobalStateService.addEntitySchema(entity, schema);
|
|
@@ -68,6 +68,16 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
68
68
|
clearTimeout(waitForState);
|
|
69
69
|
}
|
|
70
70
|
const { version: controllerVersion, validationPipeOptions: controllerValidationPipeOptions, routesConfig: controllerRoutesConfig, } = controllerOptions;
|
|
71
|
+
const customRouteControllers = customRoutes.map((customRoute) => (0, routes_1.createCustomRouteController)(entity, controllerOptions, customRoute, controllerVersion, controllerValidationPipeOptions));
|
|
72
|
+
const customRouteGateways = customRoutes
|
|
73
|
+
.filter((cr) => cr.webSocket)
|
|
74
|
+
.map((customRoute) => {
|
|
75
|
+
const wsOptions = customRoute.webSocket
|
|
76
|
+
? (0, helpers_1.initializeConfigFromOptions)(customRoute.webSocket)
|
|
77
|
+
: DynamicApiModule_1.state.get('gatewayOptions') ?? null;
|
|
78
|
+
return (0, routes_1.createCustomRouteGateway)(entity, controllerOptions, customRoute, controllerVersion, controllerValidationPipeOptions, wsOptions ?? {});
|
|
79
|
+
});
|
|
80
|
+
const needsDatabaseModule = customRouteControllers.length > 0 || customRouteGateways.length > 0;
|
|
71
81
|
const castType = (t) => t;
|
|
72
82
|
const castModule = (m) => m;
|
|
73
83
|
const moduleByRouteType = new Map([
|
|
@@ -89,6 +99,7 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
89
99
|
const apiModule = {
|
|
90
100
|
module: DynamicApiModule_1,
|
|
91
101
|
imports: [
|
|
102
|
+
...(needsDatabaseModule ? [databaseModule] : []),
|
|
92
103
|
...routes.map((routeConfig) => {
|
|
93
104
|
const { type, description: routeDescription, version: routeVersion, validationPipeOptions: routeValidationPipeOptions, webSocket: routeWebSocket, } = routeConfig;
|
|
94
105
|
const module = moduleByRouteType.get(type);
|
|
@@ -104,6 +115,7 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
104
115
|
}),
|
|
105
116
|
],
|
|
106
117
|
controllers: [
|
|
118
|
+
...customRouteControllers,
|
|
107
119
|
...(isCacheEnabledForFeature
|
|
108
120
|
? [(0, routes_1.createCachePurgeController)(entity, controllerOptions)]
|
|
109
121
|
: []),
|
|
@@ -122,6 +134,7 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
122
134
|
?? this.state.get('gatewayOptions')
|
|
123
135
|
?? {}),
|
|
124
136
|
] : []),
|
|
137
|
+
...customRouteGateways,
|
|
125
138
|
],
|
|
126
139
|
};
|
|
127
140
|
resolve(apiModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-api.module.js","sourceRoot":"","sources":["../../libs/dynamic-api/src/dynamic-api.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yDAAmE;AACnE,2CAAuD;AACvD,uCAAqE;AACrE,8EAAyE;AACzE,+CAAkD;AAElD,yCAA8D;AAC9D,qCAAkD;AAClD,uCAA2H;AAC3H,iDAA4D;AAC5D,6CAAuQ;AAEvQ,uCAAsF;AACtF,
|
|
1
|
+
{"version":3,"file":"dynamic-api.module.js","sourceRoot":"","sources":["../../libs/dynamic-api/src/dynamic-api.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yDAAmE;AACnE,2CAAuD;AACvD,uCAAqE;AACrE,8EAAyE;AACzE,+CAAkD;AAElD,yCAA8D;AAC9D,qCAAkD;AAClD,uCAA2H;AAC3H,iDAA4D;AAC5D,6CAAuQ;AAEvQ,uCAAsF;AACtF,qCAA+T;AAC/T,yCAAsF;AAQ/E,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAc3B,MAAM,CAAC,OAAO,CACZ,GAAW,EACX,EACE,cAAc,GAAG,IAAI,EACrB,YAAY,GAAG,EAAE,EACjB,OAAO,EACP,YAAY,EACZ,SAAS,EACT,uBAAuB,MACa,EAAE;QAExC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CACb,uFAAuF,CACxF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACb,SAAS;YACT,IAAI,CAAC,qBAAqB,CACxB,GAAG,EACH,cAAc,EACd,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,SAAS,EACT,uBAAuB,CACxB;SACF,CAAC,CAAC;QAEH,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE;gBACP,gCAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;gBACjD,2BAAW,CAAC,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IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAEtF,OAAO,eAAe,IAAI,EAAE,IAAI,EAAE,CAAC;QACrC,CAAC,CAAC,CAAC,CAAC;IACN,CAAC;;AA5VU,4CAAgB;AAKX,sBAAK,GAAG,IAAI,uCAA4B,EAAE,AAArC,CAAsC;2BALhD,gBAAgB;IAD5B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CA6V5B"}
|
|
@@ -29,6 +29,8 @@ function getDefaultRouteDescription(routeType, entityName) {
|
|
|
29
29
|
return `Update one ${contentName}`;
|
|
30
30
|
case 'Aggregate':
|
|
31
31
|
return `Get aggregated ${contentName}`;
|
|
32
|
+
case 'Custom':
|
|
33
|
+
return `Custom ${contentName} endpoint`;
|
|
32
34
|
default:
|
|
33
35
|
throw new Error(`Route type "${routeType}" is not supported`);
|
|
34
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-description.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/route-description.helper.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"route-description.helper.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/helpers/route-description.helper.ts"],"names":[],"mappings":";;AAuCS,gEAA0B;AAvCnC,mDAA4C;AAI5C,SAAS,0BAA0B,CAAC,SAAoB,EAAE,UAAkB;IAC1E,MAAM,WAAW,GAAG,IAAA,yBAAS,EAAC,UAAU,CAAC,CAAC;IAE1C,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,WAAW;YACd,OAAO,cAAc,WAAW,EAAE,CAAC;QACrC,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,WAAW;YACd,OAAO,cAAc,WAAW,EAAE,CAAC;QACrC,KAAK,eAAe;YAClB,OAAO,kBAAkB,WAAW,EAAE,CAAC;QACzC,KAAK,cAAc;YACjB,OAAO,iBAAiB,WAAW,EAAE,CAAC;QACxC,KAAK,SAAS;YACZ,OAAO,YAAY,WAAW,EAAE,CAAC;QACnC,KAAK,QAAQ;YACX,OAAO,WAAW,WAAW,QAAQ,CAAC;QACxC,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,YAAY;YACf,OAAO,eAAe,WAAW,EAAE,CAAC;QACtC,KAAK,WAAW;YACd,OAAO,cAAc,WAAW,EAAE,CAAC;QACrC,KAAK,WAAW;YACd,OAAO,kBAAkB,WAAW,EAAE,CAAC;QACzC,KAAK,QAAQ;YACX,OAAO,UAAU,WAAW,WAAW,CAAC;QAC1C;YACE,MAAM,IAAI,KAAK,CAAC,eAAe,SAAS,oBAAoB,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
package/src/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export * from './interfaces';
|
|
|
10
10
|
export * from './logger';
|
|
11
11
|
export * from './mixins';
|
|
12
12
|
export * from './models';
|
|
13
|
+
export * from './modules';
|
|
14
|
+
export * from './modules/presence';
|
|
13
15
|
export * from './routes';
|
|
14
16
|
export * from './services';
|
|
15
17
|
export * from './utils';
|
package/src/index.js
CHANGED
|
@@ -27,6 +27,8 @@ __exportStar(require("./interfaces"), exports);
|
|
|
27
27
|
__exportStar(require("./logger"), exports);
|
|
28
28
|
__exportStar(require("./mixins"), exports);
|
|
29
29
|
__exportStar(require("./models"), exports);
|
|
30
|
+
__exportStar(require("./modules"), exports);
|
|
31
|
+
__exportStar(require("./modules/presence"), exports);
|
|
30
32
|
__exportStar(require("./routes"), exports);
|
|
31
33
|
__exportStar(require("./services"), exports);
|
|
32
34
|
__exportStar(require("./utils"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../libs/dynamic-api/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,uDAAqC;AACrC,gFAAsG;AAAvE,iIAAA,uBAAuB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../libs/dynamic-api/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,qDAAmC;AACnC,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,uDAAqC;AACrC,gFAAsG;AAAvE,iIAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CanActivate, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
+
import { Model } from 'mongoose';
|
|
3
|
+
import { BaseEntity } from '../models';
|
|
4
|
+
import { AbilityPredicate, PredicateBehavior } from './dynamic-api-ability.interface';
|
|
5
|
+
import { Mappable } from './dynamic-api-route-dtos-bundle.type';
|
|
6
|
+
import { DynamicApiWebSocketOptions } from './dynamic-api-web-socket.interface';
|
|
7
|
+
type HttpMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
8
|
+
interface CustomRouteContext<Entity extends BaseEntity, Body = unknown, Query = unknown, Params extends Record<string, string> = Record<string, string>> {
|
|
9
|
+
model: Model<Entity>;
|
|
10
|
+
user: unknown;
|
|
11
|
+
params: Params;
|
|
12
|
+
body: Body;
|
|
13
|
+
query: Query;
|
|
14
|
+
}
|
|
15
|
+
interface CustomRouteConfig<Entity extends BaseEntity, Body = unknown, Query = unknown, Params extends Record<string, string> = Record<string, string>, Response = unknown> {
|
|
16
|
+
path: string;
|
|
17
|
+
method: HttpMethod;
|
|
18
|
+
handler: (ctx: CustomRouteContext<Entity, Body, Query, Params>) => Promise<Response>;
|
|
19
|
+
version?: string;
|
|
20
|
+
isPublic?: boolean;
|
|
21
|
+
description?: string;
|
|
22
|
+
guards?: Type<CanActivate>[];
|
|
23
|
+
abilityPredicate?: AbilityPredicate<Entity>;
|
|
24
|
+
predicateBehavior?: PredicateBehavior;
|
|
25
|
+
validationPipeOptions?: ValidationPipeOptions;
|
|
26
|
+
webSocket?: DynamicApiWebSocketOptions;
|
|
27
|
+
eventName?: string;
|
|
28
|
+
dTOs?: {
|
|
29
|
+
body?: Type;
|
|
30
|
+
query?: Type;
|
|
31
|
+
presenter?: Type & Partial<Mappable<Entity>>;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export type { HttpMethod, CustomRouteContext, CustomRouteConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-api-custom-route.interface.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/dynamic-api-custom-route.interface.ts"],"names":[],"mappings":""}
|
|
@@ -4,6 +4,7 @@ import { BaseEntity } from '../models';
|
|
|
4
4
|
import { DynamicApiAuthOptions } from '../modules';
|
|
5
5
|
import { DynamicApiControllerOptions } from './dynamic-api-controller-options.interface';
|
|
6
6
|
import { DynamicApiCacheOptions } from './dynamic-api-cache-options.interface';
|
|
7
|
+
import { CustomRouteConfig } from './dynamic-api-custom-route.interface';
|
|
7
8
|
import { RoutesConfig } from './dynamic-api-global-state.interface';
|
|
8
9
|
import { DynamicAPIRouteConfig } from './dynamic-api-route-config.interface';
|
|
9
10
|
import { DynamicApiWebSocketOptions } from './dynamic-api-web-socket.interface';
|
|
@@ -24,5 +25,6 @@ interface DynamicApiForFeatureOptions<Entity extends BaseEntity> {
|
|
|
24
25
|
extraImports?: ModuleMetadata['imports'];
|
|
25
26
|
extraProviders?: ModuleMetadata['providers'];
|
|
26
27
|
extraControllers?: ModuleMetadata['controllers'];
|
|
28
|
+
customRoutes?: CustomRouteConfig<Entity>[];
|
|
27
29
|
}
|
|
28
30
|
export { DynamicApiForFeatureOptions, DynamicApiForRootOptions, DYNAMIC_API_GLOBAL_STATE };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-api-options.interface.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/dynamic-api-options.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dynamic-api-options.interface.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/dynamic-api-options.interface.ts"],"names":[],"mappings":";;;AAYA,MAAM,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AA2BJ,4DAAwB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const DYNAMIC_API_PRESENCE_ADAPTER: unique symbol;
|
|
2
|
+
interface PresenceAdapter {
|
|
3
|
+
setOnline(userId: string, socketId: string, room?: string): Promise<void>;
|
|
4
|
+
setOffline(userId: string, socketId: string): Promise<void>;
|
|
5
|
+
isOnline(userId: string): Promise<boolean>;
|
|
6
|
+
getOnlineUserIds(room?: string): Promise<string[]>;
|
|
7
|
+
getSocketCount(userId: string): Promise<number>;
|
|
8
|
+
}
|
|
9
|
+
interface PresenceRegisterOptions {
|
|
10
|
+
adapter: 'memory' | 'redis';
|
|
11
|
+
redisUrl?: string;
|
|
12
|
+
redisTtlSeconds?: number;
|
|
13
|
+
enableController?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface PresenceEventPayload {
|
|
16
|
+
userId: string;
|
|
17
|
+
}
|
|
18
|
+
interface PresenceResponse {
|
|
19
|
+
onlineUserIds: string[];
|
|
20
|
+
}
|
|
21
|
+
export type { PresenceAdapter, PresenceRegisterOptions, PresenceEventPayload, PresenceResponse, };
|
|
22
|
+
export { DYNAMIC_API_PRESENCE_ADAPTER };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DYNAMIC_API_PRESENCE_ADAPTER = void 0;
|
|
4
|
+
const DYNAMIC_API_PRESENCE_ADAPTER = Symbol('DYNAMIC_API_PRESENCE_ADAPTER');
|
|
5
|
+
exports.DYNAMIC_API_PRESENCE_ADAPTER = DYNAMIC_API_PRESENCE_ADAPTER;
|
|
6
|
+
//# sourceMappingURL=dynamic-api-presence.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-api-presence.interface.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/dynamic-api-presence.interface.ts"],"names":[],"mappings":";;;AACA,MAAM,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AA4DnE,oEAA4B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
type RouteType = 'CreateMany' | 'CreateOne' | 'DeleteMany' | 'DeleteOne' | 'DuplicateMany' | 'DuplicateOne' | 'GetMany' | 'GetOne' | 'ReplaceOne' | 'UpdateMany' | 'UpdateOne' | 'Aggregate';
|
|
1
|
+
type RouteType = 'CreateMany' | 'CreateOne' | 'DeleteMany' | 'DeleteOne' | 'DuplicateMany' | 'DuplicateOne' | 'GetMany' | 'GetOne' | 'ReplaceOne' | 'UpdateMany' | 'UpdateOne' | 'Aggregate' | 'Custom';
|
|
2
2
|
export { RouteType };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './dynamic-api-controller-options.interface';
|
|
2
|
+
export * from './dynamic-api-custom-route.interface';
|
|
2
3
|
export * from './dynamic-api-request.interface';
|
|
3
4
|
export * from './dynamic-api-decorator-builder.interface';
|
|
4
5
|
export * from './dynamic-api-cache-options.interface';
|
|
@@ -20,3 +21,4 @@ export * from './dynamic-api-service-callback.interface';
|
|
|
20
21
|
export * from './dynamic-api-service-provider.interface';
|
|
21
22
|
export * from './dynamic-api-swagger-options.type';
|
|
22
23
|
export * from './dynamic-api-web-socket.interface';
|
|
24
|
+
export * from './dynamic-api-presence.interface';
|
package/src/interfaces/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./dynamic-api-controller-options.interface"), exports);
|
|
18
|
+
__exportStar(require("./dynamic-api-custom-route.interface"), exports);
|
|
18
19
|
__exportStar(require("./dynamic-api-request.interface"), exports);
|
|
19
20
|
__exportStar(require("./dynamic-api-decorator-builder.interface"), exports);
|
|
20
21
|
__exportStar(require("./dynamic-api-cache-options.interface"), exports);
|
|
@@ -36,4 +37,5 @@ __exportStar(require("./dynamic-api-service-callback.interface"), exports);
|
|
|
36
37
|
__exportStar(require("./dynamic-api-service-provider.interface"), exports);
|
|
37
38
|
__exportStar(require("./dynamic-api-swagger-options.type"), exports);
|
|
38
39
|
__exportStar(require("./dynamic-api-web-socket.interface"), exports);
|
|
40
|
+
__exportStar(require("./dynamic-api-presence.interface"), exports);
|
|
39
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6EAA2D;AAC3D,kEAAgD;AAChD,4EAA0D;AAC1D,wEAAsD;AACtD,kEAAgD;AAChD,2EAAyD;AACzD,yEAAuD;AACvD,yEAAuD;AACvD,uEAAqD;AACrD,kEAAgD;AAChD,yEAAuD;AACvD,uEAAqD;AACrD,uEAAqD;AACrD,kEAAgD;AAChD,oEAAkD;AAClD,gEAA8C;AAC9C,yEAAuD;AACvD,uFAAqE;AACrE,2EAAyD;AACzD,2EAAyD;AACzD,qEAAmD;AACnD,qEAAmD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/dynamic-api/src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6EAA2D;AAC3D,uEAAqD;AACrD,kEAAgD;AAChD,4EAA0D;AAC1D,wEAAsD;AACtD,kEAAgD;AAChD,2EAAyD;AACzD,yEAAuD;AACvD,yEAAuD;AACvD,uEAAqD;AACrD,kEAAgD;AAChD,yEAAuD;AACvD,uEAAqD;AACrD,uEAAqD;AACrD,kEAAgD;AAChD,oEAAkD;AAClD,gEAA8C;AAC9C,yEAAuD;AACvD,uFAAqE;AACrE,2EAAyD;AACzD,2EAAyD;AACzD,qEAAmD;AACnD,qEAAmD;AACnD,mEAAiD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PresenceAdapter } from '../../../interfaces';
|
|
2
|
+
export declare class InMemoryPresenceAdapter implements PresenceAdapter {
|
|
3
|
+
private readonly socketsByUser;
|
|
4
|
+
private readonly roomBySocket;
|
|
5
|
+
setOnline(userId: string, socketId: string, room?: string): Promise<void>;
|
|
6
|
+
setOffline(userId: string, socketId: string): Promise<void>;
|
|
7
|
+
isOnline(userId: string): Promise<boolean>;
|
|
8
|
+
getOnlineUserIds(room?: string): Promise<string[]>;
|
|
9
|
+
getSocketCount(userId: string): Promise<number>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.InMemoryPresenceAdapter = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let InMemoryPresenceAdapter = class InMemoryPresenceAdapter {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.socketsByUser = new Map();
|
|
14
|
+
this.roomBySocket = new Map();
|
|
15
|
+
}
|
|
16
|
+
async setOnline(userId, socketId, room) {
|
|
17
|
+
if (!this.socketsByUser.has(userId)) {
|
|
18
|
+
this.socketsByUser.set(userId, new Set());
|
|
19
|
+
}
|
|
20
|
+
const sockets = this.socketsByUser.get(userId) ?? new Set();
|
|
21
|
+
sockets.add(socketId);
|
|
22
|
+
this.socketsByUser.set(userId, sockets);
|
|
23
|
+
if (room) {
|
|
24
|
+
this.roomBySocket.set(socketId, room);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async setOffline(userId, socketId) {
|
|
28
|
+
const sockets = this.socketsByUser.get(userId);
|
|
29
|
+
if (sockets) {
|
|
30
|
+
sockets.delete(socketId);
|
|
31
|
+
if (sockets.size === 0) {
|
|
32
|
+
this.socketsByUser.delete(userId);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
this.roomBySocket.delete(socketId);
|
|
36
|
+
}
|
|
37
|
+
async isOnline(userId) {
|
|
38
|
+
const sockets = this.socketsByUser.get(userId);
|
|
39
|
+
return !!(sockets && sockets.size > 0);
|
|
40
|
+
}
|
|
41
|
+
async getOnlineUserIds(room) {
|
|
42
|
+
if (!room) {
|
|
43
|
+
return Array.from(this.socketsByUser.keys());
|
|
44
|
+
}
|
|
45
|
+
const result = [];
|
|
46
|
+
for (const [userId, sockets] of this.socketsByUser.entries()) {
|
|
47
|
+
for (const socketId of sockets) {
|
|
48
|
+
if (this.roomBySocket.get(socketId) === room) {
|
|
49
|
+
result.push(userId);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
async getSocketCount(userId) {
|
|
57
|
+
return this.socketsByUser.get(userId)?.size ?? 0;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.InMemoryPresenceAdapter = InMemoryPresenceAdapter;
|
|
61
|
+
exports.InMemoryPresenceAdapter = InMemoryPresenceAdapter = __decorate([
|
|
62
|
+
(0, common_1.Injectable)()
|
|
63
|
+
], InMemoryPresenceAdapter);
|
|
64
|
+
//# sourceMappingURL=in-memory-presence.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-presence.adapter.js","sourceRoot":"","sources":["../../../../../libs/dynamic-api/src/modules/presence/adapters/in-memory-presence.adapter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAarC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QAEY,kBAAa,GAAG,IAAI,GAAG,EAAuB,CAAC;QAE/C,iBAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IAwD5D,CAAC;IAtDC,KAAK,CAAC,SAAS,CAAC,MAAc,EAAE,QAAgB,EAAE,IAAa;QAC7D,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAU,CAAC;QACpE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAExC,IAAI,IAAI,EAAE,CAAC;YACT,IA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ACR,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAAc;QACjC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AA5DY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;GACA,uBAAuB,CA4DnC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OnModuleDestroy } from '@nestjs/common';
|
|
2
|
+
import Redis from 'ioredis';
|
|
3
|
+
import { PresenceAdapter } from '../../../interfaces';
|
|
4
|
+
export declare const DEFAULT_REDIS_PRESENCE_TTL = 60;
|
|
5
|
+
export declare class RedisPresenceAdapter implements PresenceAdapter, OnModuleDestroy {
|
|
6
|
+
private readonly redis;
|
|
7
|
+
private readonly ttl;
|
|
8
|
+
constructor(redisUrlOrClient: string | Redis, ttlSeconds?: number);
|
|
9
|
+
onModuleDestroy(): Promise<void>;
|
|
10
|
+
private socketsKey;
|
|
11
|
+
private roomKey;
|
|
12
|
+
setOnline(userId: string, socketId: string, room?: string): Promise<void>;
|
|
13
|
+
setOffline(userId: string, socketId: string): Promise<void>;
|
|
14
|
+
isOnline(userId: string): Promise<boolean>;
|
|
15
|
+
getOnlineUserIds(room?: string): Promise<string[]>;
|
|
16
|
+
getSocketCount(userId: string): Promise<number>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RedisPresenceAdapter = exports.DEFAULT_REDIS_PRESENCE_TTL = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const ioredis_1 = require("ioredis");
|
|
15
|
+
exports.DEFAULT_REDIS_PRESENCE_TTL = 60;
|
|
16
|
+
const LUA_SREM_DEL_IF_EMPTY = `
|
|
17
|
+
local removed = redis.call('SREM', KEYS[1], ARGV[1])
|
|
18
|
+
if redis.call('SCARD', KEYS[1]) == 0 then
|
|
19
|
+
redis.call('DEL', KEYS[1])
|
|
20
|
+
end
|
|
21
|
+
return removed
|
|
22
|
+
`;
|
|
23
|
+
let RedisPresenceAdapter = class RedisPresenceAdapter {
|
|
24
|
+
constructor(redisUrlOrClient, ttlSeconds = exports.DEFAULT_REDIS_PRESENCE_TTL) {
|
|
25
|
+
this.redis =
|
|
26
|
+
typeof redisUrlOrClient === 'string'
|
|
27
|
+
? new ioredis_1.default(redisUrlOrClient, { lazyConnect: true })
|
|
28
|
+
: redisUrlOrClient;
|
|
29
|
+
this.ttl = ttlSeconds;
|
|
30
|
+
}
|
|
31
|
+
async onModuleDestroy() {
|
|
32
|
+
await this.redis.quit();
|
|
33
|
+
}
|
|
34
|
+
socketsKey(userId) {
|
|
35
|
+
return `presence:sockets:${userId}`;
|
|
36
|
+
}
|
|
37
|
+
roomKey(roomId) {
|
|
38
|
+
return `presence:room:${roomId}`;
|
|
39
|
+
}
|
|
40
|
+
async setOnline(userId, socketId, room) {
|
|
41
|
+
const sockKey = this.socketsKey(userId);
|
|
42
|
+
await this.redis.sadd(sockKey, socketId);
|
|
43
|
+
await this.redis.expire(sockKey, this.ttl);
|
|
44
|
+
if (room) {
|
|
45
|
+
const rKey = this.roomKey(room);
|
|
46
|
+
await this.redis.sadd(rKey, userId);
|
|
47
|
+
await this.redis.expire(rKey, this.ttl);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async setOffline(userId, socketId) {
|
|
51
|
+
await this.redis.eval(LUA_SREM_DEL_IF_EMPTY, 1, this.socketsKey(userId), socketId);
|
|
52
|
+
const remaining = await this.redis.scard(this.socketsKey(userId));
|
|
53
|
+
if (remaining === 0) {
|
|
54
|
+
const roomKeys = await this.redis.keys('presence:room:*');
|
|
55
|
+
if (roomKeys.length > 0) {
|
|
56
|
+
await Promise.all(roomKeys.map((k) => this.redis.srem(k, userId)));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async isOnline(userId) {
|
|
61
|
+
const count = await this.redis.scard(this.socketsKey(userId));
|
|
62
|
+
return count > 0;
|
|
63
|
+
}
|
|
64
|
+
async getOnlineUserIds(room) {
|
|
65
|
+
if (!room) {
|
|
66
|
+
const keys = await this.redis.keys('presence:sockets:*');
|
|
67
|
+
return keys.map((k) => k.replace('presence:sockets:', ''));
|
|
68
|
+
}
|
|
69
|
+
return this.redis.smembers(this.roomKey(room));
|
|
70
|
+
}
|
|
71
|
+
async getSocketCount(userId) {
|
|
72
|
+
return this.redis.scard(this.socketsKey(userId));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.RedisPresenceAdapter = RedisPresenceAdapter;
|
|
76
|
+
exports.RedisPresenceAdapter = RedisPresenceAdapter = __decorate([
|
|
77
|
+
(0, common_1.Injectable)(),
|
|
78
|
+
__metadata("design:paramtypes", [Object, Number])
|
|
79
|
+
], RedisPresenceAdapter);
|
|
80
|
+
//# sourceMappingURL=redis-presence.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-presence.adapter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E,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAAc;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AAnFY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;;GACA,oBAAoB,CAmFhC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./adapters/in-memory-presence.adapter"), exports);
|
|
18
|
+
__exportStar(require("./adapters/redis-presence.adapter"), exports);
|
|
19
|
+
__exportStar(require("./presence.controller"), exports);
|
|
20
|
+
__exportStar(require("./presence.gateway"), exports);
|
|
21
|
+
__exportStar(require("./presence.module"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/dynamic-api/src/modules/presence/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD;AACtD,oEAAkD;AAClD,wDAAsC;AACtC,qDAAmC;AACnC,oDAAkC"}
|