@prefabs.tech/fastify-firebase 0.93.4 → 0.94.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/README.md +38 -14
- package/dist/prefabs-tech-fastify-firebase.cjs +26 -26
- package/dist/prefabs-tech-fastify-firebase.js +205 -205
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +26 -26
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/initializeFirebase.d.ts.map +1 -1
- package/dist/types/lib/sendPushNotification.d.ts.map +1 -1
- package/dist/types/migrations/queries.d.ts.map +1 -1
- package/dist/types/migrations/runMigrations.d.ts.map +1 -1
- package/dist/types/model/notification/controller.d.ts +4 -0
- package/dist/types/model/notification/controller.d.ts.map +1 -1
- package/dist/types/model/notification/graphql/resolver.d.ts +2 -2
- package/dist/types/model/notification/graphql/resolver.d.ts.map +1 -1
- package/dist/types/model/notification/handlers/sendNotification.d.ts.map +1 -1
- package/dist/types/model/notification/schema.d.ts +9 -9
- package/dist/types/model/userDevice/controller.d.ts.map +1 -1
- package/dist/types/model/userDevice/handlers/addUserDevice.d.ts.map +1 -1
- package/dist/types/model/userDevice/handlers/removeUserDevice.d.ts.map +1 -1
- package/dist/types/model/userDevice/schema.d.ts +16 -16
- package/dist/types/model/userDevice/service.d.ts +3 -3
- package/dist/types/model/userDevice/service.d.ts.map +1 -1
- package/dist/types/model/userDevice/sqlFactory.d.ts +1 -1
- package/dist/types/model/userDevice/sqlFactory.d.ts.map +1 -1
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/types.d.ts +11 -11
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +22 -31
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { verifySession } from "supertokens-node/recipe/session/framework/fastify";
|
|
2
|
+
import type { User } from "./types";
|
|
2
3
|
import notificationHandlers from "./model/notification/handlers";
|
|
3
4
|
import deviceHandlers from "./model/userDevice/handlers";
|
|
4
|
-
import type { User } from "./types";
|
|
5
5
|
declare module "fastify" {
|
|
6
6
|
interface FastifyInstance {
|
|
7
7
|
verifySession: typeof verifySession;
|
|
@@ -18,12 +18,28 @@ declare module "mercurius" {
|
|
|
18
18
|
declare module "@prefabs.tech/fastify-config" {
|
|
19
19
|
interface ApiConfig {
|
|
20
20
|
firebase: {
|
|
21
|
-
enabled?: boolean;
|
|
22
21
|
credentials?: {
|
|
23
|
-
projectId: string;
|
|
24
|
-
privateKey: string;
|
|
25
22
|
clientEmail: string;
|
|
23
|
+
privateKey: string;
|
|
24
|
+
projectId: string;
|
|
25
|
+
};
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
handlers?: {
|
|
28
|
+
notification?: {
|
|
29
|
+
sendNotification?: typeof notificationHandlers.sendNotification;
|
|
30
|
+
};
|
|
31
|
+
userDevice?: {
|
|
32
|
+
addUserDevice?: typeof deviceHandlers.addUserDevice;
|
|
33
|
+
removeUserDevice?: typeof deviceHandlers.removeUserDevice;
|
|
34
|
+
};
|
|
26
35
|
};
|
|
36
|
+
notification?: {
|
|
37
|
+
test?: {
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
path: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
routePrefix?: string;
|
|
27
43
|
routes?: {
|
|
28
44
|
notifications?: {
|
|
29
45
|
disabled: boolean;
|
|
@@ -32,38 +48,22 @@ declare module "@prefabs.tech/fastify-config" {
|
|
|
32
48
|
disabled: boolean;
|
|
33
49
|
};
|
|
34
50
|
};
|
|
35
|
-
routePrefix?: string;
|
|
36
51
|
table?: {
|
|
37
52
|
userDevices?: {
|
|
38
53
|
name: string;
|
|
39
54
|
};
|
|
40
55
|
};
|
|
41
|
-
notification?: {
|
|
42
|
-
test?: {
|
|
43
|
-
enabled: boolean;
|
|
44
|
-
path: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
handlers?: {
|
|
48
|
-
userDevice?: {
|
|
49
|
-
addUserDevice?: typeof deviceHandlers.addUserDevice;
|
|
50
|
-
removeUserDevice?: typeof deviceHandlers.removeUserDevice;
|
|
51
|
-
};
|
|
52
|
-
notification?: {
|
|
53
|
-
sendNotification?: typeof notificationHandlers.sendNotification;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
export
|
|
59
|
+
export * from "./constants";
|
|
60
|
+
export { default as firebaseSchema } from "./graphql/schema";
|
|
61
|
+
export * from "./lib";
|
|
62
|
+
export * from "./migrations/queries";
|
|
60
63
|
export { default as notificationRoutes } from "./model/notification/controller";
|
|
61
64
|
export { default as notificationResolver } from "./model/notification/graphql/resolver";
|
|
62
|
-
export { default as userDeviceResolver } from "./model/userDevice/graphql/resolver";
|
|
63
65
|
export { default as userDeviceRoutes } from "./model/userDevice/controller";
|
|
66
|
+
export { default as userDeviceResolver } from "./model/userDevice/graphql/resolver";
|
|
64
67
|
export { default as UserDeviceService } from "./model/userDevice/service";
|
|
65
|
-
export { default
|
|
66
|
-
export * from "./constants";
|
|
67
|
-
export * from "./lib";
|
|
68
|
-
export * from "./migrations/queries";
|
|
68
|
+
export { default } from "./plugin";
|
|
69
69
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAElF,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAEzD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAElF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAEzD,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,eAAe;QACvB,aAAa,EAAE,OAAO,aAAa,CAAC;KACrC;IAED,UAAU,cAAc;QACtB,IAAI,CAAC,EAAE,IAAI,CAAC;KACb;CACF;AAED,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,gBAAgB;QACxB,IAAI,EAAE,IAAI,CAAC;KACZ;CACF;AAED,OAAO,QAAQ,8BAA8B,CAAC;IAC5C,UAAU,SAAS;QACjB,QAAQ,EAAE;YACR,WAAW,CAAC,EAAE;gBACZ,WAAW,EAAE,MAAM,CAAC;gBACpB,UAAU,EAAE,MAAM,CAAC;gBACnB,SAAS,EAAE,MAAM,CAAC;aACnB,CAAC;YACF,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,QAAQ,CAAC,EAAE;gBACT,YAAY,CAAC,EAAE;oBACb,gBAAgB,CAAC,EAAE,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;iBACjE,CAAC;gBACF,UAAU,CAAC,EAAE;oBACX,aAAa,CAAC,EAAE,OAAO,cAAc,CAAC,aAAa,CAAC;oBACpD,gBAAgB,CAAC,EAAE,OAAO,cAAc,CAAC,gBAAgB,CAAC;iBAC3D,CAAC;aACH,CAAC;YACF,YAAY,CAAC,EAAE;gBACb,IAAI,CAAC,EAAE;oBACL,OAAO,EAAE,OAAO,CAAC;oBACjB,IAAI,EAAE,MAAM,CAAC;iBACd,CAAC;aACH,CAAC;YACF,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,MAAM,CAAC,EAAE;gBACP,aAAa,CAAC,EAAE;oBACd,QAAQ,EAAE,OAAO,CAAC;iBACnB,CAAC;gBACF,WAAW,CAAC,EAAE;oBACZ,QAAQ,EAAE,OAAO,CAAC;iBACnB,CAAC;aACH,CAAC;YACF,KAAK,CAAC,EAAE;gBACN,WAAW,CAAC,EAAE;oBACZ,IAAI,EAAE,MAAM,CAAC;iBACd,CAAC;aACH,CAAC;SACH,CAAC;KACH;CACF;AAED,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,OAAO,CAAC;AAEtB,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeFirebase.d.ts","sourceRoot":"","sources":["../../../src/lib/initializeFirebase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initializeFirebase.d.ts","sourceRoot":"","sources":["../../../src/lib/initializeFirebase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI/C,QAAA,MAAM,kBAAkB,GAAI,QAAQ,SAAS,EAAE,SAAS,eAAe,SAyBtE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendPushNotification.d.ts","sourceRoot":"","sources":["../../../src/lib/sendPushNotification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendPushNotification.d.ts","sourceRoot":"","sources":["../../../src/lib/sendPushNotification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAInF,QAAA,MAAM,oBAAoB,GAAU,SAAS,gBAAgB,kBAE5D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/migrations/queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/migrations/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMtC,QAAA,MAAM,2BAA2B,GAC/B,QAAQ,SAAS,KAChB,aAAa,CAAC,UAAU,CAoB1B,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runMigrations.d.ts","sourceRoot":"","sources":["../../../src/migrations/runMigrations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runMigrations.d.ts","sourceRoot":"","sources":["../../../src/migrations/runMigrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAI7D,QAAA,MAAM,aAAa,GAAU,UAAU,QAAQ,EAAE,QAAQ,SAAS,kBAIjE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { FastifyInstance } from "fastify";
|
|
2
|
+
/**
|
|
3
|
+
* Registers an authenticated test endpoint to send a push notification to a user’s
|
|
4
|
+
* registered device tokens (enabled via `config.firebase.notification.test`).
|
|
5
|
+
*/
|
|
2
6
|
declare const plugin: (fastify: FastifyInstance) => Promise<void>;
|
|
3
7
|
export default plugin;
|
|
4
8
|
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/model/notification/controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/model/notification/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C;;;GAGG;AACH,QAAA,MAAM,MAAM,GAAU,SAAS,eAAe,kBAc7C,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -3,12 +3,12 @@ declare const _default: {
|
|
|
3
3
|
Mutation: {
|
|
4
4
|
sendNotification: (parent: unknown, arguments_: {
|
|
5
5
|
data: {
|
|
6
|
-
userId: string;
|
|
7
|
-
title: string;
|
|
8
6
|
body: string;
|
|
9
7
|
data: {
|
|
10
8
|
[key: string]: string;
|
|
11
9
|
};
|
|
10
|
+
title: string;
|
|
11
|
+
userId: string;
|
|
12
12
|
};
|
|
13
13
|
}, context: MercuriusContext) => Promise<import("mercurius").ErrorWithProps | {
|
|
14
14
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/graphql/resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/graphql/resolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;;;mCAStC,OAAO,cACH;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE;oBACJ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;iBACvB,CAAC;gBACF,KAAK,EAAE,MAAM,CAAC;gBACd,MAAM,EAAE,MAAM,CAAC;aAChB,CAAC;SACH,WACQ,gBAAgB;;;;;;AAiE7B,wBAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendNotification.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/handlers/sendNotification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendNotification.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/handlers/sendNotification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAOzE,QAAA,MAAM,oBAAoB,GACxB,SAAS,cAAc,EACvB,OAAO,YAAY,kBA4DpB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export declare const sendNotificationSchema: {
|
|
2
|
-
description: string;
|
|
3
|
-
operationId: string;
|
|
4
2
|
body: {
|
|
5
|
-
type: string;
|
|
6
3
|
properties: {
|
|
7
|
-
|
|
4
|
+
message: {
|
|
8
5
|
type: string;
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
title: {
|
|
11
8
|
type: string;
|
|
12
9
|
};
|
|
13
10
|
userId: {
|
|
@@ -15,22 +12,25 @@ export declare const sendNotificationSchema: {
|
|
|
15
12
|
};
|
|
16
13
|
};
|
|
17
14
|
required: string[];
|
|
15
|
+
type: string;
|
|
18
16
|
};
|
|
17
|
+
description: string;
|
|
18
|
+
operationId: string;
|
|
19
19
|
response: {
|
|
20
20
|
200: {
|
|
21
|
-
type: string;
|
|
22
21
|
properties: {
|
|
23
|
-
|
|
22
|
+
message: {
|
|
24
23
|
type: string;
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
success: {
|
|
27
26
|
type: string;
|
|
28
27
|
};
|
|
29
28
|
};
|
|
29
|
+
type: string;
|
|
30
30
|
};
|
|
31
31
|
401: {
|
|
32
|
-
description: string;
|
|
33
32
|
$ref: string;
|
|
33
|
+
description: string;
|
|
34
34
|
};
|
|
35
35
|
500: {
|
|
36
36
|
$ref: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAU/C,QAAA,MAAM,MAAM,GAAU,SAAS,eAAe,kBAoB7C,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addUserDevice.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/handlers/addUserDevice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addUserDevice.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/handlers/addUserDevice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAMzE,QAAA,MAAM,aAAa,GAAU,SAAS,cAAc,EAAE,OAAO,YAAY,kBAYxE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeUserDevice.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/handlers/removeUserDevice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"removeUserDevice.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/handlers/removeUserDevice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIzE,QAAA,MAAM,gBAAgB,GACpB,SAAS,cAAc,EACvB,OAAO,YAAY,kBA6BpB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
export declare const deleteUserDeviceSchema: {
|
|
2
|
-
description: string;
|
|
3
|
-
operationId: string;
|
|
4
2
|
body: {
|
|
5
|
-
type: string;
|
|
6
3
|
properties: {
|
|
7
4
|
deviceToken: {
|
|
8
5
|
type: string;
|
|
9
6
|
};
|
|
10
7
|
};
|
|
11
8
|
required: string[];
|
|
9
|
+
type: string;
|
|
12
10
|
};
|
|
11
|
+
description: string;
|
|
12
|
+
operationId: string;
|
|
13
13
|
response: {
|
|
14
14
|
200: {
|
|
15
15
|
nullable: boolean;
|
|
16
|
-
type: string;
|
|
17
16
|
properties: {
|
|
18
|
-
|
|
17
|
+
createdAt: {
|
|
19
18
|
type: string;
|
|
20
19
|
};
|
|
21
20
|
deviceToken: {
|
|
22
21
|
type: string;
|
|
23
22
|
};
|
|
24
|
-
|
|
23
|
+
updatedAt: {
|
|
25
24
|
type: string;
|
|
26
25
|
};
|
|
27
|
-
|
|
26
|
+
userId: {
|
|
28
27
|
type: string;
|
|
29
28
|
};
|
|
30
29
|
};
|
|
31
30
|
required: string[];
|
|
31
|
+
type: string;
|
|
32
32
|
};
|
|
33
33
|
401: {
|
|
34
|
-
description: string;
|
|
35
34
|
$ref: string;
|
|
35
|
+
description: string;
|
|
36
36
|
};
|
|
37
37
|
500: {
|
|
38
38
|
$ref: string;
|
|
@@ -41,40 +41,40 @@ export declare const deleteUserDeviceSchema: {
|
|
|
41
41
|
tags: string[];
|
|
42
42
|
};
|
|
43
43
|
export declare const postUserDeviceSchema: {
|
|
44
|
-
description: string;
|
|
45
|
-
operationId: string;
|
|
46
44
|
body: {
|
|
47
|
-
type: string;
|
|
48
45
|
properties: {
|
|
49
46
|
deviceToken: {
|
|
50
47
|
type: string;
|
|
51
48
|
};
|
|
52
49
|
};
|
|
53
50
|
required: string[];
|
|
51
|
+
type: string;
|
|
54
52
|
};
|
|
53
|
+
description: string;
|
|
54
|
+
operationId: string;
|
|
55
55
|
response: {
|
|
56
56
|
200: {
|
|
57
57
|
nullable: boolean;
|
|
58
|
-
type: string;
|
|
59
58
|
properties: {
|
|
60
|
-
|
|
59
|
+
createdAt: {
|
|
61
60
|
type: string;
|
|
62
61
|
};
|
|
63
62
|
deviceToken: {
|
|
64
63
|
type: string;
|
|
65
64
|
};
|
|
66
|
-
|
|
65
|
+
updatedAt: {
|
|
67
66
|
type: string;
|
|
68
67
|
};
|
|
69
|
-
|
|
68
|
+
userId: {
|
|
70
69
|
type: string;
|
|
71
70
|
};
|
|
72
71
|
};
|
|
73
72
|
required: string[];
|
|
73
|
+
type: string;
|
|
74
74
|
};
|
|
75
75
|
401: {
|
|
76
|
-
description: string;
|
|
77
76
|
$ref: string;
|
|
77
|
+
description: string;
|
|
78
78
|
};
|
|
79
79
|
500: {
|
|
80
80
|
$ref: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaseService } from "@prefabs.tech/fastify-slonik";
|
|
2
|
-
import UserDeviceSqlFactory from "./sqlFactory";
|
|
3
2
|
import { UserDevice, UserDeviceCreateInput, UserDeviceUpdateInput } from "../../types";
|
|
3
|
+
import UserDeviceSqlFactory from "./sqlFactory";
|
|
4
4
|
declare class UserDeviceService extends BaseService<UserDevice, UserDeviceCreateInput, UserDeviceUpdateInput> {
|
|
5
|
-
getByUserId(userId: string): Promise<UserDevice[] | undefined>;
|
|
6
|
-
removeByDeviceToken(deviceToken: string): Promise<UserDevice | undefined>;
|
|
7
5
|
get factory(): UserDeviceSqlFactory;
|
|
8
6
|
get sqlFactoryClass(): typeof UserDeviceSqlFactory;
|
|
7
|
+
getByUserId(userId: string): Promise<undefined | UserDevice[]>;
|
|
8
|
+
removeByDeviceToken(deviceToken: string): Promise<undefined | UserDevice>;
|
|
9
9
|
protected preCreate(data: UserDeviceCreateInput): Promise<UserDeviceCreateInput>;
|
|
10
10
|
}
|
|
11
11
|
export default UserDeviceService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,oBAAoB,MAAM,cAAc,CAAC;AAEhD,cAAM,iBAAkB,SAAQ,WAAW,CACzC,UAAU,EACV,qBAAqB,EACrB,qBAAqB,CACtB;IACC,IAAI,OAAO,IAAI,oBAAoB,CAElC;IAED,IAAI,eAAe,gCAElB;IAEK,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,UAAU,EAAE,CAAC;IAU9D,mBAAmB,CACvB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,GAAG,UAAU,CAAC;cAUlB,SAAS,CACvB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;CAOlC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,9 +2,9 @@ import { DefaultSqlFactory } from "@prefabs.tech/fastify-slonik";
|
|
|
2
2
|
import { QuerySqlToken } from "slonik";
|
|
3
3
|
declare class UserDeviceSqlFactory extends DefaultSqlFactory {
|
|
4
4
|
static readonly TABLE = "user_devices";
|
|
5
|
+
get table(): string;
|
|
5
6
|
getDeleteExistingTokenSql(token: string): QuerySqlToken;
|
|
6
7
|
getFindByUserIdSql(userId: string): QuerySqlToken;
|
|
7
|
-
get table(): string;
|
|
8
8
|
}
|
|
9
9
|
export default UserDeviceSqlFactory;
|
|
10
10
|
//# sourceMappingURL=sqlFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlFactory.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/sqlFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAO,MAAM,QAAQ,CAAC;AAI5C,cAAM,oBAAqB,SAAQ,iBAAiB;IAClD,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAsB;IAE3C,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa;IASvD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa;
|
|
1
|
+
{"version":3,"file":"sqlFactory.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/sqlFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAO,MAAM,QAAQ,CAAC;AAI5C,cAAM,oBAAqB,SAAQ,iBAAiB;IAClD,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAsB;IAE3C,IAAI,KAAK,WAER;IAED,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa;IASvD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa;CAOlD;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;kCAShB,eAAe;AAwB9C,wBAAqC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import "@prefabs.tech/fastify-error-handler";
|
|
2
|
-
interface
|
|
2
|
+
interface TestNotificationInput {
|
|
3
|
+
body: string;
|
|
4
|
+
data?: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
title: string;
|
|
3
8
|
userId: string;
|
|
4
|
-
deviceToken: string;
|
|
5
|
-
createdAt: number;
|
|
6
|
-
updatedAt: number;
|
|
7
9
|
}
|
|
8
10
|
interface User {
|
|
9
11
|
id: string;
|
|
10
12
|
}
|
|
11
|
-
interface
|
|
13
|
+
interface UserDevice {
|
|
14
|
+
createdAt: number;
|
|
15
|
+
deviceToken: string;
|
|
16
|
+
updatedAt: number;
|
|
12
17
|
userId: string;
|
|
13
|
-
title: string;
|
|
14
|
-
body: string;
|
|
15
|
-
data?: {
|
|
16
|
-
[key: string]: string;
|
|
17
|
-
};
|
|
18
18
|
}
|
|
19
19
|
type UserDeviceCreateInput = Partial<Omit<UserDevice, "createdAt" | "updatedAt">>;
|
|
20
|
-
type UserDeviceUpdateInput = Partial<Omit<UserDevice, "
|
|
20
|
+
type UserDeviceUpdateInput = Partial<Omit<UserDevice, "createdAt" | "updatedAt" | "userId">>;
|
|
21
21
|
export type { TestNotificationInput, User, UserDevice, UserDeviceCreateInput, UserDeviceUpdateInput, };
|
|
22
22
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAE7C,UAAU,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAE7C,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,qBAAqB,GAAG,OAAO,CAClC,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW,CAAC,CAC5C,CAAC;AAEF,KAAK,qBAAqB,GAAG,OAAO,CAClC,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC,CACvD,CAAC;AAEF,YAAY,EACV,qBAAqB,EACrB,IAAI,EACJ,UAAU,EACV,qBAAqB,EACrB,qBAAqB,GACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prefabs.tech/fastify-firebase",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"description": "Fastify firebase plugin",
|
|
5
5
|
"homepage": "https://github.com/prefabs-tech/fastify/tree/main/packages/firebase#readme",
|
|
6
6
|
"repository": {
|
|
@@ -23,50 +23,41 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"firebase-admin": "13.
|
|
26
|
+
"firebase-admin": "13.8.0",
|
|
27
27
|
"zod": "3.25.76"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@prefabs.tech/eslint-config": "0.
|
|
31
|
-
"@prefabs.tech/fastify-config": "0.
|
|
32
|
-
"@prefabs.tech/fastify-error-handler": "0.
|
|
33
|
-
"@prefabs.tech/fastify-graphql": "0.
|
|
34
|
-
"@prefabs.tech/fastify-slonik": "0.
|
|
35
|
-
"@prefabs.tech/tsconfig": "0.
|
|
36
|
-
"@types/node": "24.10.
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "8.46.2",
|
|
38
|
-
"@typescript-eslint/parser": "8.46.2",
|
|
30
|
+
"@prefabs.tech/eslint-config": "0.7.0",
|
|
31
|
+
"@prefabs.tech/fastify-config": "0.94.0",
|
|
32
|
+
"@prefabs.tech/fastify-error-handler": "0.94.0",
|
|
33
|
+
"@prefabs.tech/fastify-graphql": "0.94.0",
|
|
34
|
+
"@prefabs.tech/fastify-slonik": "0.94.0",
|
|
35
|
+
"@prefabs.tech/tsconfig": "0.7.0",
|
|
36
|
+
"@types/node": "24.10.15",
|
|
39
37
|
"@vitest/coverage-istanbul": "3.2.4",
|
|
40
|
-
"eslint": "
|
|
41
|
-
"
|
|
42
|
-
"eslint-import-resolver-alias": "1.1.2",
|
|
43
|
-
"eslint-import-resolver-typescript": "3.10.1",
|
|
44
|
-
"eslint-plugin-import": "2.32.0",
|
|
45
|
-
"eslint-plugin-n": "14.0.0",
|
|
46
|
-
"eslint-plugin-prettier": "5.5.4",
|
|
47
|
-
"eslint-plugin-promise": "7.2.1",
|
|
48
|
-
"eslint-plugin-unicorn": "56.0.1",
|
|
49
|
-
"fastify": "5.6.1",
|
|
38
|
+
"eslint": "9.39.4",
|
|
39
|
+
"fastify": "5.8.5",
|
|
50
40
|
"fastify-plugin": "5.1.0",
|
|
51
|
-
"graphql": "16.
|
|
52
|
-
"mercurius": "16.
|
|
53
|
-
"
|
|
41
|
+
"graphql": "16.13.2",
|
|
42
|
+
"mercurius": "16.9.0",
|
|
43
|
+
"pg-mem": "3.0.14",
|
|
44
|
+
"prettier": "3.8.3",
|
|
54
45
|
"slonik": "46.8.0",
|
|
55
46
|
"supertokens-node": "14.1.4",
|
|
56
47
|
"typescript": "5.9.3",
|
|
57
|
-
"vite": "6.4.
|
|
48
|
+
"vite": "6.4.2",
|
|
58
49
|
"vitest": "3.2.4"
|
|
59
50
|
},
|
|
60
51
|
"peerDependencies": {
|
|
61
|
-
"@prefabs.tech/fastify-config": "0.
|
|
62
|
-
"@prefabs.tech/fastify-error-handler": "0.
|
|
63
|
-
"@prefabs.tech/fastify-graphql": "0.
|
|
64
|
-
"@prefabs.tech/fastify-slonik": "0.
|
|
65
|
-
"fastify": ">=5.2.
|
|
52
|
+
"@prefabs.tech/fastify-config": "0.94.0",
|
|
53
|
+
"@prefabs.tech/fastify-error-handler": "0.94.0",
|
|
54
|
+
"@prefabs.tech/fastify-graphql": "0.94.0",
|
|
55
|
+
"@prefabs.tech/fastify-slonik": "0.94.0",
|
|
56
|
+
"fastify": ">=5.2.2",
|
|
66
57
|
"fastify-plugin": ">=5.0.1",
|
|
67
58
|
"mercurius": ">=16.1.0",
|
|
68
59
|
"slonik": ">=46.1.0",
|
|
69
|
-
"supertokens-node": ">=14.1.
|
|
60
|
+
"supertokens-node": ">=14.1.4"
|
|
70
61
|
},
|
|
71
62
|
"engines": {
|
|
72
63
|
"node": ">=20"
|