@flink-app/generic-auth-plugin 0.11.5 → 0.11.7
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 +18 -2
- package/.flink/schemas/schemas.ts +3 -3
- 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.d.ts +2 -2
- package/dist/.flink/schemas/schemas.json +18 -2
- package/dist/.flink/start.js +1 -1
- package/dist/src/genericAuthPluginOptions.d.ts +8 -0
- package/dist/src/handlers/UserPushRegisterToken.js +35 -4
- package/dist/src/handlers/UserPushRemoveToken.js +1 -1
- package/dist/src/schemas/PushNotificationToken.d.ts +1 -0
- package/package.json +2 -2
- package/src/genericAuthPluginOptions.ts +9 -1
- package/src/handlers/UserPushRegisterToken.ts +48 -28
- package/src/schemas/PushNotificationToken.ts +5 -4
- package/src/schemas/UserTokenRes.ts +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated
|
|
1
|
+
// Generated Tue Feb 04 2025 11:59:42 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 Tue Feb 04 2025 11:59:43 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 Tue Feb 04 2025 11:59:42 GMT+0100 (Central European Standard Time)
|
|
2
2
|
import { autoRegisteredRepos } from "@flink-app/flink";
|
|
3
3
|
export const repos = [];
|
|
4
4
|
autoRegisteredRepos.push(...repos);
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
"properties": {},
|
|
328
328
|
"definitions": {}
|
|
329
329
|
},
|
|
330
|
-
"
|
|
330
|
+
"UserPushRegisterToken_8_ReqSchema": {
|
|
331
331
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
332
332
|
"type": "object",
|
|
333
333
|
"additionalProperties": false,
|
|
@@ -337,6 +337,14 @@
|
|
|
337
337
|
},
|
|
338
338
|
"token": {
|
|
339
339
|
"type": "string"
|
|
340
|
+
},
|
|
341
|
+
"platform": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"enum": [
|
|
344
|
+
"ios",
|
|
345
|
+
"android",
|
|
346
|
+
"web"
|
|
347
|
+
]
|
|
340
348
|
}
|
|
341
349
|
},
|
|
342
350
|
"required": [
|
|
@@ -345,7 +353,7 @@
|
|
|
345
353
|
],
|
|
346
354
|
"definitions": {}
|
|
347
355
|
},
|
|
348
|
-
"
|
|
356
|
+
"UserPushRegisterToken_8_ResSchema": {
|
|
349
357
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
350
358
|
"type": "object",
|
|
351
359
|
"additionalProperties": false,
|
|
@@ -373,6 +381,14 @@
|
|
|
373
381
|
},
|
|
374
382
|
"token": {
|
|
375
383
|
"type": "string"
|
|
384
|
+
},
|
|
385
|
+
"platform": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"enum": [
|
|
388
|
+
"ios",
|
|
389
|
+
"android",
|
|
390
|
+
"web"
|
|
391
|
+
]
|
|
376
392
|
}
|
|
377
393
|
},
|
|
378
394
|
"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 Tue Feb 04 2025 11:59:43 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 {}
|
|
@@ -60,9 +60,9 @@ export interface UserProfilePut_5_ReqSchema extends UserProfile {}
|
|
|
60
60
|
|
|
61
61
|
export interface UserProfilePut_5_ResSchema extends UserProfile {}
|
|
62
62
|
|
|
63
|
-
export interface
|
|
63
|
+
export interface UserPushRegisterToken_8_ReqSchema extends PushNotificationToken {}
|
|
64
64
|
|
|
65
|
-
export interface
|
|
65
|
+
export interface UserPushRegisterToken_8_ResSchema extends PushNotificatioNTokenRes {}
|
|
66
66
|
|
|
67
67
|
export interface UserPushRemoveToken_7_ReqSchema extends PushNotificationToken {}
|
|
68
68
|
|
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 Tue Feb 04 2025 11:59:42 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 Tue Feb 04 2025 11:59:43 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 Tue Feb 04 2025 11:59:42 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);
|
|
@@ -58,9 +58,9 @@ export interface UserProfilePut_5_ReqSchema extends UserProfile {
|
|
|
58
58
|
}
|
|
59
59
|
export interface UserProfilePut_5_ResSchema extends UserProfile {
|
|
60
60
|
}
|
|
61
|
-
export interface
|
|
61
|
+
export interface UserPushRegisterToken_8_ReqSchema extends PushNotificationToken {
|
|
62
62
|
}
|
|
63
|
-
export interface
|
|
63
|
+
export interface UserPushRegisterToken_8_ResSchema extends PushNotificatioNTokenRes {
|
|
64
64
|
}
|
|
65
65
|
export interface UserPushRemoveToken_7_ReqSchema extends PushNotificationToken {
|
|
66
66
|
}
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
"properties": {},
|
|
328
328
|
"definitions": {}
|
|
329
329
|
},
|
|
330
|
-
"
|
|
330
|
+
"UserPushRegisterToken_8_ReqSchema": {
|
|
331
331
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
332
332
|
"type": "object",
|
|
333
333
|
"additionalProperties": false,
|
|
@@ -337,6 +337,14 @@
|
|
|
337
337
|
},
|
|
338
338
|
"token": {
|
|
339
339
|
"type": "string"
|
|
340
|
+
},
|
|
341
|
+
"platform": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"enum": [
|
|
344
|
+
"ios",
|
|
345
|
+
"android",
|
|
346
|
+
"web"
|
|
347
|
+
]
|
|
340
348
|
}
|
|
341
349
|
},
|
|
342
350
|
"required": [
|
|
@@ -345,7 +353,7 @@
|
|
|
345
353
|
],
|
|
346
354
|
"definitions": {}
|
|
347
355
|
},
|
|
348
|
-
"
|
|
356
|
+
"UserPushRegisterToken_8_ResSchema": {
|
|
349
357
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
350
358
|
"type": "object",
|
|
351
359
|
"additionalProperties": false,
|
|
@@ -373,6 +381,14 @@
|
|
|
373
381
|
},
|
|
374
382
|
"token": {
|
|
375
383
|
"type": "string"
|
|
384
|
+
},
|
|
385
|
+
"platform": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"enum": [
|
|
388
|
+
"ios",
|
|
389
|
+
"android",
|
|
390
|
+
"web"
|
|
391
|
+
]
|
|
376
392
|
}
|
|
377
393
|
},
|
|
378
394
|
"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 Tue Feb 04 2025 11:59:43 GMT+0100 (Central European Standard Time)
|
|
4
4
|
require("./generatedHandlers");
|
|
5
5
|
require("./generatedRepos");
|
|
6
6
|
require("./generatedJobs");
|
|
@@ -27,6 +27,14 @@ export interface GenericAuthPluginOptions {
|
|
|
27
27
|
onSuccessfulLogin?: {
|
|
28
28
|
(user: User): Promise<void>;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* If true, when a new device is registered, all other devices identified by `deviceId`
|
|
32
|
+
* will be deregistered to avoid duplicate notifications.
|
|
33
|
+
*
|
|
34
|
+
* Also as safety measure, any usage of the same firebase token on other users will be
|
|
35
|
+
* deregistered.
|
|
36
|
+
*/
|
|
37
|
+
deregisterOtherDevices?: boolean;
|
|
30
38
|
}
|
|
31
39
|
export interface GenericAuthsmsOptions {
|
|
32
40
|
smsClient: smsClient;
|
|
@@ -41,12 +41,14 @@ var flink_1 = require("@flink-app/flink");
|
|
|
41
41
|
var postUserPushRegisterTokenHandler = function (_a) {
|
|
42
42
|
var ctx = _a.ctx, req = _a.req, origin = _a.origin;
|
|
43
43
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
-
var pluginName, repo, user, exToken;
|
|
44
|
+
var pluginName, pluginOptions, repo, deregisterOtherDevices, user, exToken, otherRegistrations, _i, otherRegistrations_1, other, e_1;
|
|
45
45
|
return __generator(this, function (_b) {
|
|
46
46
|
switch (_b.label) {
|
|
47
47
|
case 0:
|
|
48
48
|
pluginName = origin || "genericAuthPlugin";
|
|
49
|
-
|
|
49
|
+
pluginOptions = ctx.plugins[pluginName];
|
|
50
|
+
repo = ctx.repos[pluginOptions.repoName];
|
|
51
|
+
deregisterOtherDevices = pluginOptions.deregisterOtherDevices || false;
|
|
50
52
|
return [4 /*yield*/, repo.getById(req.user._id)];
|
|
51
53
|
case 1:
|
|
52
54
|
user = _b.sent();
|
|
@@ -65,11 +67,40 @@ var postUserPushRegisterTokenHandler = function (_a) {
|
|
|
65
67
|
})];
|
|
66
68
|
case 2:
|
|
67
69
|
_b.sent();
|
|
68
|
-
return [
|
|
70
|
+
if (!deregisterOtherDevices) return [3 /*break*/, 9];
|
|
71
|
+
return [4 /*yield*/, repo.findAll({
|
|
72
|
+
$or: [{ "pushNotificationTokens.deviceId": req.body.deviceId }, { "pushNotificationTokens.token": req.body.token }],
|
|
73
|
+
_id: { $ne: user._id },
|
|
74
|
+
})];
|
|
75
|
+
case 3:
|
|
76
|
+
otherRegistrations = _b.sent();
|
|
77
|
+
_i = 0, otherRegistrations_1 = otherRegistrations;
|
|
78
|
+
_b.label = 4;
|
|
79
|
+
case 4:
|
|
80
|
+
if (!(_i < otherRegistrations_1.length)) return [3 /*break*/, 9];
|
|
81
|
+
other = otherRegistrations_1[_i];
|
|
82
|
+
_b.label = 5;
|
|
83
|
+
case 5:
|
|
84
|
+
_b.trys.push([5, 7, , 8]);
|
|
85
|
+
other.pushNotificationTokens = other.pushNotificationTokens.filter(function (t) { return t.deviceId !== req.body.deviceId && t.token !== req.body.token; });
|
|
86
|
+
return [4 /*yield*/, repo.updateOne(other._id, {
|
|
87
|
+
pushNotificationTokens: other.pushNotificationTokens,
|
|
88
|
+
})];
|
|
89
|
+
case 6:
|
|
90
|
+
_b.sent();
|
|
91
|
+
return [3 /*break*/, 8];
|
|
92
|
+
case 7:
|
|
93
|
+
e_1 = _b.sent();
|
|
94
|
+
console.error("Error deregistering other devices", e_1);
|
|
95
|
+
return [3 /*break*/, 8];
|
|
96
|
+
case 8:
|
|
97
|
+
_i++;
|
|
98
|
+
return [3 /*break*/, 4];
|
|
99
|
+
case 9: return [2 /*return*/, { data: { status: "success" } }];
|
|
69
100
|
}
|
|
70
101
|
});
|
|
71
102
|
});
|
|
72
103
|
};
|
|
73
104
|
exports.default = postUserPushRegisterTokenHandler;
|
|
74
105
|
exports.__assumedHttpMethod = "", exports.__file = "UserPushRegisterToken.ts", exports.__query = [], exports.__params = [];
|
|
75
|
-
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" } }, "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": {} } };
|
|
106
|
+
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": {} } };
|
|
@@ -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" } }, "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"] } }, "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": {} } };
|
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.7",
|
|
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": "8df87dd973d5d16d21967ac8269c952a0577446e"
|
|
34
34
|
}
|
|
@@ -22,8 +22,16 @@ export interface GenericAuthPluginOptions {
|
|
|
22
22
|
usernameFormat?: RegExp;
|
|
23
23
|
sms?: GenericAuthsmsOptions;
|
|
24
24
|
onSuccessfulLogin?: {
|
|
25
|
-
(user:User): Promise<void
|
|
25
|
+
(user: User): Promise<void>;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* If true, when a new device is registered, all other devices identified by `deviceId`
|
|
29
|
+
* will be deregistered to avoid duplicate notifications.
|
|
30
|
+
*
|
|
31
|
+
* Also as safety measure, any usage of the same firebase token on other users will be
|
|
32
|
+
* deregistered.
|
|
33
|
+
*/
|
|
34
|
+
deregisterOtherDevices?: boolean;
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
export interface GenericAuthsmsOptions {
|
|
@@ -3,35 +3,55 @@ import { genericAuthContext } from "../genericAuthContext";
|
|
|
3
3
|
import { PushNotificationToken } from "../schemas/PushNotificationToken";
|
|
4
4
|
import { PushNotificatioNTokenRes } from "../schemas/PushNotificationTokenRes";
|
|
5
5
|
import { User } from "../schemas/User";
|
|
6
|
+
import { GenericAuthPluginOptions } from "../genericAuthPluginOptions";
|
|
6
7
|
|
|
7
|
-
const postUserPushRegisterTokenHandler: Handler<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exToken
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
const postUserPushRegisterTokenHandler: Handler<FlinkContext<genericAuthContext>, PushNotificationToken, PushNotificatioNTokenRes> = async ({
|
|
9
|
+
ctx,
|
|
10
|
+
req,
|
|
11
|
+
origin,
|
|
12
|
+
}) => {
|
|
13
|
+
const pluginName = origin || "genericAuthPlugin";
|
|
14
|
+
const pluginOptions: GenericAuthPluginOptions = (ctx.plugins as any)[pluginName];
|
|
15
|
+
const repo = ctx.repos[pluginOptions.repoName];
|
|
16
|
+
const deregisterOtherDevices = pluginOptions.deregisterOtherDevices || false;
|
|
17
|
+
|
|
18
|
+
const user = <User>await repo.getById(req.user._id);
|
|
19
|
+
|
|
20
|
+
if (user == null) {
|
|
21
|
+
return notFound("User not found");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let exToken = user.pushNotificationTokens.find((t) => t.deviceId == req.body.deviceId);
|
|
25
|
+
|
|
26
|
+
if (exToken != null) {
|
|
27
|
+
exToken.token = req.body.token;
|
|
28
|
+
} else {
|
|
29
|
+
user.pushNotificationTokens.push(req.body);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
await repo.updateOne(user._id, {
|
|
33
|
+
pushNotificationTokens: user.pushNotificationTokens,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (deregisterOtherDevices) {
|
|
37
|
+
const otherRegistrations = <User[]>await repo.findAll({
|
|
38
|
+
$or: [{ "pushNotificationTokens.deviceId": req.body.deviceId }, { "pushNotificationTokens.token": req.body.token }],
|
|
39
|
+
_id: { $ne: user._id },
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
for (let other of otherRegistrations) {
|
|
43
|
+
try {
|
|
44
|
+
other.pushNotificationTokens = other.pushNotificationTokens.filter((t) => t.deviceId !== req.body.deviceId && t.token !== req.body.token);
|
|
45
|
+
await repo.updateOne(other._id, {
|
|
46
|
+
pushNotificationTokens: other.pushNotificationTokens,
|
|
47
|
+
});
|
|
48
|
+
} catch (e) {
|
|
49
|
+
console.error("Error deregistering other devices", e);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return { data: { status: "success" } };
|
|
35
55
|
};
|
|
36
56
|
|
|
37
57
|
export default postUserPushRegisterTokenHandler;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export interface PushNotificationToken{
|
|
2
|
-
deviceId
|
|
3
|
-
token
|
|
4
|
-
|
|
1
|
+
export interface PushNotificationToken {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
token: string;
|
|
4
|
+
platform?: "ios" | "android" | "web";
|
|
5
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface UserTokenRes{
|
|
2
|
-
token
|
|
3
|
-
}
|
|
1
|
+
export interface UserTokenRes {
|
|
2
|
+
token: string;
|
|
3
|
+
}
|