@flink-app/generic-auth-plugin 0.11.10 → 0.11.13
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/.flink/generatedHandlers.ts +1 -1
- package/.flink/generatedJobs.ts +1 -1
- package/.flink/generatedRepos.ts +1 -1
- package/.flink/schemas/schemas.json +16 -0
- package/.flink/schemas/schemas.ts +1 -1
- package/.flink/start.ts +1 -1
- package/dist/.flink/generatedHandlers.js +1 -1
- package/dist/.flink/generatedJobs.js +1 -1
- package/dist/.flink/generatedRepos.js +1 -1
- package/dist/.flink/schemas/schemas.json +16 -0
- package/dist/.flink/start.js +1 -1
- package/dist/src/handlers/UserPushRegisterToken.js +14 -2
- package/dist/src/handlers/UserPushRemoveToken.js +1 -1
- package/dist/src/schemas/PushNotificationToken.d.ts +5 -0
- package/package.json +2 -2
- package/src/handlers/UserPushRegisterToken.ts +2 -1
- package/src/schemas/PushNotificationToken.ts +6 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated
|
|
1
|
+
// Generated Fri Feb 14 2025 00:00:05 GMT+0100 (Central European Standard 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";
|
package/.flink/generatedJobs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated
|
|
1
|
+
// Generated Fri Feb 14 2025 00:00:05 GMT+0100 (Central European Standard Time)
|
|
2
2
|
import { autoRegisteredJobs } from "@flink-app/flink";
|
|
3
3
|
export const jobs = [];
|
|
4
4
|
autoRegisteredJobs.push(...jobs);
|
package/.flink/generatedRepos.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated
|
|
1
|
+
// Generated Fri Feb 14 2025 00:00:05 GMT+0100 (Central European Standard Time)
|
|
2
2
|
import { autoRegisteredRepos } from "@flink-app/flink";
|
|
3
3
|
export const repos = [];
|
|
4
4
|
autoRegisteredRepos.push(...repos);
|
|
@@ -345,6 +345,14 @@
|
|
|
345
345
|
"android",
|
|
346
346
|
"web"
|
|
347
347
|
]
|
|
348
|
+
},
|
|
349
|
+
"type": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"enum": [
|
|
352
|
+
"firebase",
|
|
353
|
+
"apn-voip"
|
|
354
|
+
],
|
|
355
|
+
"description": "The type of the token. This is used to determine which push notification service to use. Default is \"firebase\""
|
|
348
356
|
}
|
|
349
357
|
},
|
|
350
358
|
"required": [
|
|
@@ -389,6 +397,14 @@
|
|
|
389
397
|
"android",
|
|
390
398
|
"web"
|
|
391
399
|
]
|
|
400
|
+
},
|
|
401
|
+
"type": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"enum": [
|
|
404
|
+
"firebase",
|
|
405
|
+
"apn-voip"
|
|
406
|
+
],
|
|
407
|
+
"description": "The type of the token. This is used to determine which push notification service to use. Default is \"firebase\""
|
|
392
408
|
}
|
|
393
409
|
},
|
|
394
410
|
"required": [
|
|
@@ -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
|
|
32
|
+
// Generated Fri Feb 14 2025 00:00:06 GMT+0100 (Central European Standard 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,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handlers = void 0;
|
|
4
|
-
// Generated
|
|
4
|
+
// Generated Fri Feb 14 2025 00:00:05 GMT+0100 (Central European Standard 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
|
|
4
|
+
// Generated Fri Feb 14 2025 00:00:05 GMT+0100 (Central European Standard 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
|
|
4
|
+
// Generated Fri Feb 14 2025 00:00:05 GMT+0100 (Central European Standard 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);
|
|
@@ -345,6 +345,14 @@
|
|
|
345
345
|
"android",
|
|
346
346
|
"web"
|
|
347
347
|
]
|
|
348
|
+
},
|
|
349
|
+
"type": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"enum": [
|
|
352
|
+
"firebase",
|
|
353
|
+
"apn-voip"
|
|
354
|
+
],
|
|
355
|
+
"description": "The type of the token. This is used to determine which push notification service to use. Default is \"firebase\""
|
|
348
356
|
}
|
|
349
357
|
},
|
|
350
358
|
"required": [
|
|
@@ -389,6 +397,14 @@
|
|
|
389
397
|
"android",
|
|
390
398
|
"web"
|
|
391
399
|
]
|
|
400
|
+
},
|
|
401
|
+
"type": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"enum": [
|
|
404
|
+
"firebase",
|
|
405
|
+
"apn-voip"
|
|
406
|
+
],
|
|
407
|
+
"description": "The type of the token. This is used to determine which push notification service to use. Default is \"firebase\""
|
|
392
408
|
}
|
|
393
409
|
},
|
|
394
410
|
"required": [
|
package/dist/.flink/start.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// Generated
|
|
3
|
+
// Generated Fri Feb 14 2025 00:00:05 GMT+0100 (Central European Standard Time)
|
|
4
4
|
require("./generatedHandlers");
|
|
5
5
|
require("./generatedRepos");
|
|
6
6
|
require("./generatedJobs");
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -60,9 +71,10 @@ var postUserPushRegisterTokenHandler = function (_a) {
|
|
|
60
71
|
exToken = user.pushNotificationTokens.find(function (t) { return t.deviceId == req.body.deviceId; });
|
|
61
72
|
if (exToken != null) {
|
|
62
73
|
exToken.token = req.body.token;
|
|
74
|
+
exToken.type = req.body.type || "firebase";
|
|
63
75
|
}
|
|
64
76
|
else {
|
|
65
|
-
user.pushNotificationTokens.push(req.body);
|
|
77
|
+
user.pushNotificationTokens.push(__assign(__assign({}, req.body), { type: req.body.type || "firebase" }));
|
|
66
78
|
}
|
|
67
79
|
if (!allowMultipleDevices) {
|
|
68
80
|
// Filter out all other devices except the newly registered one
|
|
@@ -112,4 +124,4 @@ var postUserPushRegisterTokenHandler = function (_a) {
|
|
|
112
124
|
};
|
|
113
125
|
exports.default = postUserPushRegisterTokenHandler;
|
|
114
126
|
exports.__assumedHttpMethod = "", exports.__file = "UserPushRegisterToken.ts", exports.__query = [], exports.__params = [];
|
|
115
|
-
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" }, "platform": { "type": "string", "enum": ["ios", "android", "web"] } }, "required": ["deviceId", "token"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed"] } }, "required": ["status"], "definitions": {} } };
|
|
127
|
+
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" }, "platform": { "type": "string", "enum": ["ios", "android", "web"] }, "type": { "type": "string", "enum": ["firebase", "apn-voip"], "description": "The type of the token. This is used to determine which push notification service to use. Default is \"firebase\"" } }, "required": ["deviceId", "token"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed"] } }, "required": ["status"], "definitions": {} } };
|
|
@@ -66,4 +66,4 @@ var postUserRemoveTokenHandler = function (_a) {
|
|
|
66
66
|
};
|
|
67
67
|
exports.default = postUserRemoveTokenHandler;
|
|
68
68
|
exports.__assumedHttpMethod = "", exports.__file = "UserPushRemoveToken.ts", exports.__query = [], exports.__params = [];
|
|
69
|
-
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" }, "platform": { "type": "string", "enum": ["ios", "android", "web"] } }, "required": ["deviceId", "token"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed"] } }, "required": ["status"], "definitions": {} } };
|
|
69
|
+
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" }, "platform": { "type": "string", "enum": ["ios", "android", "web"] }, "type": { "type": "string", "enum": ["firebase", "apn-voip"], "description": "The type of the token. This is used to determine which push notification service to use. Default is \"firebase\"" } }, "required": ["deviceId", "token"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed"] } }, "required": ["status"], "definitions": {} } };
|
|
@@ -2,4 +2,9 @@ export interface PushNotificationToken {
|
|
|
2
2
|
deviceId: string;
|
|
3
3
|
token: string;
|
|
4
4
|
platform?: "ios" | "android" | "web";
|
|
5
|
+
/**
|
|
6
|
+
* The type of the token. This is used to determine which push notification service to use.
|
|
7
|
+
* Default is "firebase"
|
|
8
|
+
*/
|
|
9
|
+
type?: "firebase" | "apn-voip";
|
|
5
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/generic-auth-plugin",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.13",
|
|
4
4
|
"description": "Flink plugin that provides a generic user authentification solution.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\"",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"ts-node": "^9.1.1",
|
|
31
31
|
"typescript": "^4.2.4"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "1ba9f79226d36349df3cc38ed5e688e2529eca76"
|
|
34
34
|
}
|
|
@@ -26,8 +26,9 @@ const postUserPushRegisterTokenHandler: Handler<FlinkContext<genericAuthContext>
|
|
|
26
26
|
|
|
27
27
|
if (exToken != null) {
|
|
28
28
|
exToken.token = req.body.token;
|
|
29
|
+
exToken.type = req.body.type || "firebase";
|
|
29
30
|
} else {
|
|
30
|
-
user.pushNotificationTokens.push(req.body);
|
|
31
|
+
user.pushNotificationTokens.push({ ...req.body, type: req.body.type || "firebase" });
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
if (!allowMultipleDevices) {
|
|
@@ -2,4 +2,10 @@ export interface PushNotificationToken {
|
|
|
2
2
|
deviceId: string;
|
|
3
3
|
token: string;
|
|
4
4
|
platform?: "ios" | "android" | "web";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The type of the token. This is used to determine which push notification service to use.
|
|
8
|
+
* Default is "firebase"
|
|
9
|
+
*/
|
|
10
|
+
type?: "firebase" | "apn-voip";
|
|
5
11
|
}
|