@flink-app/generic-auth-plugin 0.12.1-alpha.2 → 0.12.1-alpha.20

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.
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
1
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredHandlers, HttpMethod } from "@flink-app/flink";
3
3
  import * as UserCreate_0 from "../src/handlers/UserCreate";
4
4
  import * as UserLogin_0 from "../src/handlers/UserLogin";
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
1
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredJobs } from "@flink-app/flink";
3
3
  export const jobs = [];
4
4
  autoRegisteredJobs.push(...jobs);
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
1
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredRepos } from "@flink-app/flink";
3
3
  export const repos = [];
4
4
  autoRegisteredRepos.push(...repos);
@@ -29,7 +29,7 @@ import { PutManagementUserRolesByUseridRes } from "../../src/schemas/Management/
29
29
  import { PutManagementUserUsernameByUseridReq } from "../../src/schemas/Management/PutUserUsernameByUseridReq";
30
30
  import { PutManagementUserUsernameByUseridRes } from "../../src/schemas/Management/PutUserUsernameByUseridRes";
31
31
 
32
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
32
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
33
33
  export interface UserCreate_7_ReqSchema extends UserCreateReq {}
34
34
 
35
35
  export interface UserCreate_7_ResSchema extends UserCreateRes {}
package/.flink/start.ts CHANGED
@@ -1,5 +1,6 @@
1
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
1
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
2
2
  import "./generatedHandlers";
3
3
  import "./generatedRepos";
4
4
  import "./generatedJobs";
5
5
  import "../src/index";
6
+ export default {}; // Export an empty object to make it a module
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handlers = void 0;
4
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
4
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.handlers = [];
7
7
  flink_1.autoRegisteredHandlers.push.apply(flink_1.autoRegisteredHandlers, exports.handlers);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jobs = void 0;
4
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
4
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.jobs = [];
7
7
  flink_1.autoRegisteredJobs.push.apply(flink_1.autoRegisteredJobs, exports.jobs);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.repos = void 0;
4
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
4
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.repos = [];
7
7
  flink_1.autoRegisteredRepos.push.apply(flink_1.autoRegisteredRepos, exports.repos);
@@ -2,3 +2,5 @@ import "./generatedHandlers";
2
2
  import "./generatedRepos";
3
3
  import "./generatedJobs";
4
4
  import "../src/index";
5
+ declare const _default: {};
6
+ export default _default;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // Generated Wed Mar 19 2025 23:07:08 GMT+0100 (Central European Standard Time)
3
+ // Generated Tue Aug 05 2025 10:03:13 GMT+0200 (Central European Summer Time)
4
4
  require("./generatedHandlers");
5
5
  require("./generatedRepos");
6
6
  require("./generatedJobs");
7
7
  require("../src/index");
8
+ exports.default = {}; // Export an empty object to make it a module
@@ -87,7 +87,7 @@ var postUserPushRegisterTokenHandler = function (_a) { return __awaiter(void 0,
87
87
  if (!deregisterOtherDevices) return [3 /*break*/, 9];
88
88
  return [4 /*yield*/, repo.findAll({
89
89
  $or: [{ "pushNotificationTokens.deviceId": req.body.deviceId }, { "pushNotificationTokens.token": req.body.token }],
90
- _id: { $ne: user._id },
90
+ _id: { $ne: repo.buildId(user._id) },
91
91
  })];
92
92
  case 3:
93
93
  otherRegistrations = _d.sent();
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@flink-app/generic-auth-plugin",
3
- "version": "0.12.1-alpha.2",
3
+ "version": "0.12.1-alpha.20",
4
4
  "description": "Flink plugin that provides a generic user authentification solution.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\"",
7
7
  "build": "flink build",
8
- "prepublish": "npm run build",
8
+ "prepare": "npm run build",
9
9
  "watch": "nodemon --exec \"flink build\""
10
10
  },
11
11
  "author": "johan@frost.se",
@@ -16,19 +16,19 @@
16
16
  "types": "dist/src/index.d.ts",
17
17
  "main": "dist/src/index.js",
18
18
  "dependencies": {
19
- "@flink-app/email-plugin": "^0.12.1-alpha.2",
20
- "@flink-app/jwt-auth-plugin": "^0.12.1-alpha.2",
21
- "@flink-app/management-api-plugin": "^0.12.1-alpha.2",
22
- "@flink-app/sms-plugin": "^0.12.1-alpha.2",
19
+ "@flink-app/email-plugin": "^0.12.1-alpha.20",
20
+ "@flink-app/jwt-auth-plugin": "^0.12.1-alpha.20",
21
+ "@flink-app/management-api-plugin": "^0.12.1-alpha.20",
22
+ "@flink-app/sms-plugin": "^0.12.1-alpha.20",
23
23
  "handlebars": "^4.7.7",
24
24
  "jsonwebtoken": "^8.5.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@flink-app/flink": "^0.12.1-alpha.2",
27
+ "@flink-app/flink": "^0.12.1-alpha.20",
28
28
  "@types/jsonwebtoken": "^8.5.2",
29
29
  "@types/node": "22.13.10",
30
30
  "ts-node": "^9.1.1",
31
31
  "typescript": "5.4.5"
32
32
  },
33
- "gitHead": "b5be77c75e10067c81e0ecab8716b30f99833b83"
33
+ "gitHead": "133c6f50b3119f8264f6350e2043c171781b583f"
34
34
  }
@@ -43,7 +43,7 @@ const postUserPushRegisterTokenHandler: Handler<FlinkContext<genericAuthContext>
43
43
  if (deregisterOtherDevices) {
44
44
  const otherRegistrations = <User[]>await repo.findAll({
45
45
  $or: [{ "pushNotificationTokens.deviceId": req.body.deviceId }, { "pushNotificationTokens.token": req.body.token }],
46
- _id: { $ne: user._id },
46
+ _id: { $ne: repo.buildId(user._id) },
47
47
  });
48
48
 
49
49
  log.debug(`Found ${otherRegistrations.length} other registrations for device ${req.body.deviceId} or token ${req.body.token}`);
package/CLAUDE.md DELETED
@@ -1,32 +0,0 @@
1
- # CLAUDE.md - Guidelines for Generic Auth Plugin
2
-
3
- ## Build Commands
4
- - Build: `npm run build` (runs `flink build`)
5
- - Watch mode: `npm run watch` (uses nodemon to watch files and trigger builds)
6
- - Publish: `npm run prepublish` (runs build before publishing)
7
-
8
- ## Code Style
9
-
10
- ### TypeScript
11
- - Target: ES5, CommonJS modules, strict typing enabled
12
- - Keep type definitions in separate schema files in the `/schemas` directory
13
- - Use explicit return types on all functions (eg: `Promise<UserLoginRes>`)
14
- - Always handle optionality with `?` and `undefined`/`null` checks
15
-
16
- ### Naming Conventions
17
- - camelCase for variables, functions, and methods
18
- - PascalCase for interfaces and types
19
- - Request types use `Req` suffix (UserLoginReq)
20
- - Response types use `Res` suffix (UserLoginRes)
21
- - Handler files match their function name (UserLogin.ts)
22
-
23
- ### Error Handling
24
- - Use structured error responses with status fields and messages
25
- - Return typed response objects rather than throwing exceptions
26
- - Use try/catch blocks for operations that might fail (JWT verification)
27
-
28
- ### Code Structure
29
- - Group imports: framework first, then local, then third-party
30
- - Separate authentication methods and utility functions
31
- - Use standard 4-space indentation with semicolons
32
- - Maintain consistent function parameter ordering