@prefabs.tech/fastify-firebase 0.88.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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/dist/prefabs-tech-fastify-firebase.js +464 -0
  4. package/dist/prefabs-tech-fastify-firebase.umd.cjs +68 -0
  5. package/dist/tsconfig.tsbuildinfo +1 -0
  6. package/dist/types/constants.d.ts +6 -0
  7. package/dist/types/constants.d.ts.map +1 -0
  8. package/dist/types/graphql/schema.d.ts +3 -0
  9. package/dist/types/graphql/schema.d.ts.map +1 -0
  10. package/dist/types/index.d.ts +67 -0
  11. package/dist/types/index.d.ts.map +1 -0
  12. package/dist/types/lib/index.d.ts +3 -0
  13. package/dist/types/lib/index.d.ts.map +1 -0
  14. package/dist/types/lib/initializeFirebase.d.ts +5 -0
  15. package/dist/types/lib/initializeFirebase.d.ts.map +1 -0
  16. package/dist/types/lib/sendPushNotification.d.ts +4 -0
  17. package/dist/types/lib/sendPushNotification.d.ts.map +1 -0
  18. package/dist/types/middlewares/isFirebaseEnabled.d.ts +4 -0
  19. package/dist/types/middlewares/isFirebaseEnabled.d.ts.map +1 -0
  20. package/dist/types/migrations/queryToCreateTable.d.ts +6 -0
  21. package/dist/types/migrations/queryToCreateTable.d.ts.map +1 -0
  22. package/dist/types/migrations/runMigrations.d.ts +5 -0
  23. package/dist/types/migrations/runMigrations.d.ts.map +1 -0
  24. package/dist/types/model/notification/controller.d.ts +4 -0
  25. package/dist/types/model/notification/controller.d.ts.map +1 -0
  26. package/dist/types/model/notification/graphql/resolver.d.ts +20 -0
  27. package/dist/types/model/notification/graphql/resolver.d.ts.map +1 -0
  28. package/dist/types/model/notification/graphql/schema.d.ts +3 -0
  29. package/dist/types/model/notification/graphql/schema.d.ts.map +1 -0
  30. package/dist/types/model/notification/handlers/index.d.ts +5 -0
  31. package/dist/types/model/notification/handlers/index.d.ts.map +1 -0
  32. package/dist/types/model/notification/handlers/sendNotification.d.ts +5 -0
  33. package/dist/types/model/notification/handlers/sendNotification.d.ts.map +1 -0
  34. package/dist/types/model/notification/schema.d.ts +75 -0
  35. package/dist/types/model/notification/schema.d.ts.map +1 -0
  36. package/dist/types/model/userDevice/controller.d.ts +4 -0
  37. package/dist/types/model/userDevice/controller.d.ts.map +1 -0
  38. package/dist/types/model/userDevice/graphql/resolver.d.ts +18 -0
  39. package/dist/types/model/userDevice/graphql/resolver.d.ts.map +1 -0
  40. package/dist/types/model/userDevice/graphql/schema.d.ts +3 -0
  41. package/dist/types/model/userDevice/graphql/schema.d.ts.map +1 -0
  42. package/dist/types/model/userDevice/handlers/addUserDevice.d.ts +5 -0
  43. package/dist/types/model/userDevice/handlers/addUserDevice.d.ts.map +1 -0
  44. package/dist/types/model/userDevice/handlers/index.d.ts +6 -0
  45. package/dist/types/model/userDevice/handlers/index.d.ts.map +1 -0
  46. package/dist/types/model/userDevice/handlers/removeUserDevice.d.ts +5 -0
  47. package/dist/types/model/userDevice/handlers/removeUserDevice.d.ts.map +1 -0
  48. package/dist/types/model/userDevice/schema.d.ts +153 -0
  49. package/dist/types/model/userDevice/schema.d.ts.map +1 -0
  50. package/dist/types/model/userDevice/service.d.ts +12 -0
  51. package/dist/types/model/userDevice/service.d.ts.map +1 -0
  52. package/dist/types/model/userDevice/sqlFactory.d.ts +10 -0
  53. package/dist/types/model/userDevice/sqlFactory.d.ts.map +1 -0
  54. package/dist/types/plugin.d.ts +4 -0
  55. package/dist/types/plugin.d.ts.map +1 -0
  56. package/dist/types/types.d.ts +21 -0
  57. package/dist/types/types.d.ts.map +1 -0
  58. package/package.json +80 -0
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@prefabs.tech/fastify-graphql").DocumentNode;
2
+ export default _default;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/graphql/schema.ts"],"names":[],"mappings":";AAKA,wBAIG"}
@@ -0,0 +1,67 @@
1
+ import { verifySession } from "supertokens-node/recipe/session/framework/fastify";
2
+ import notificationHandlers from "./model/notification/handlers";
3
+ import deviceHandlers from "./model/userDevice/handlers";
4
+ import type { User } from "./types";
5
+ declare module "fastify" {
6
+ interface FastifyInstance {
7
+ verifySession: typeof verifySession;
8
+ }
9
+ interface FastifyRequest {
10
+ user?: User;
11
+ }
12
+ }
13
+ declare module "mercurius" {
14
+ interface MercuriusContext {
15
+ user: User;
16
+ }
17
+ }
18
+ declare module "@prefabs.tech/fastify-config" {
19
+ interface ApiConfig {
20
+ firebase: {
21
+ enabled?: boolean;
22
+ credentials?: {
23
+ projectId: string;
24
+ privateKey: string;
25
+ clientEmail: string;
26
+ };
27
+ routes?: {
28
+ notifications?: {
29
+ disabled: boolean;
30
+ };
31
+ userDevices?: {
32
+ disabled: boolean;
33
+ };
34
+ };
35
+ routePrefix?: string;
36
+ table?: {
37
+ userDevices?: {
38
+ name: string;
39
+ };
40
+ };
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
+ };
57
+ }
58
+ }
59
+ export { default } from "./plugin";
60
+ export { default as notificationRoutes } from "./model/notification/controller";
61
+ export { default as notificationResolver } from "./model/notification/graphql/resolver";
62
+ export { default as userDeviceResolver } from "./model/userDevice/graphql/resolver";
63
+ export { default as userDeviceRoutes } from "./model/userDevice/controller";
64
+ export { default as UserDeviceService } from "./model/userDevice/service";
65
+ export { default as firebaseSchema } from "./graphql/schema";
66
+ export * from "./lib";
67
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,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,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,WAAW,CAAC,EAAE;gBACZ,SAAS,EAAE,MAAM,CAAC;gBAClB,UAAU,EAAE,MAAM,CAAC;gBACnB,WAAW,EAAE,MAAM,CAAC;aACrB,CAAC;YACF,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,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,KAAK,CAAC,EAAE;gBACN,WAAW,CAAC,EAAE;oBACZ,IAAI,EAAE,MAAM,CAAC;iBACd,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,QAAQ,CAAC,EAAE;gBACT,UAAU,CAAC,EAAE;oBACX,aAAa,CAAC,EAAE,OAAO,cAAc,CAAC,aAAa,CAAC;oBACpD,gBAAgB,CAAC,EAAE,OAAO,cAAc,CAAC,gBAAgB,CAAC;iBAC3D,CAAC;gBACF,YAAY,CAAC,EAAE;oBACb,gBAAgB,CAAC,EAAE,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;iBACjE,CAAC;aACH,CAAC;SACH,CAAC;KACH;CACF;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAExF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,cAAc,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as initializeFirebase } from "./initializeFirebase";
2
+ export { default as sendPushNotification } from "./sendPushNotification";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ApiConfig } from "@prefabs.tech/fastify-config";
2
+ import type { FastifyInstance } from "fastify";
3
+ declare const initializeFirebase: (config: ApiConfig, fastify: FastifyInstance) => void;
4
+ export default initializeFirebase;
5
+ //# sourceMappingURL=initializeFirebase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializeFirebase.d.ts","sourceRoot":"","sources":["../../../src/lib/initializeFirebase.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,kBAAkB,GAAI,QAAQ,SAAS,EAAE,SAAS,eAAe,SAyBtE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { MulticastMessage } from "firebase-admin/lib/messaging/messaging-api";
2
+ declare const sendPushNotification: (message: MulticastMessage) => Promise<void>;
3
+ export default sendPushNotification;
4
+ //# sourceMappingURL=sendPushNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendPushNotification.d.ts","sourceRoot":"","sources":["../../../src/lib/sendPushNotification.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAEnF,QAAA,MAAM,oBAAoB,GAAU,SAAS,gBAAgB,kBAE5D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ declare const isFirebaseEnabled: (fastify: FastifyInstance) => () => Promise<void>;
3
+ export default isFirebaseEnabled;
4
+ //# sourceMappingURL=isFirebaseEnabled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFirebaseEnabled.d.ts","sourceRoot":"","sources":["../../../src/middlewares/isFirebaseEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,iBAAiB,GACpB,SAAS,eAAe,WAAe,OAAO,CAAC,IAAI,CAInD,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ApiConfig } from "@prefabs.tech/fastify-config";
2
+ import type { QuerySqlToken } from "slonik";
3
+ import type { ZodTypeAny } from "zod";
4
+ declare const queryToCreateTable: (config: ApiConfig) => QuerySqlToken<ZodTypeAny>;
5
+ export default queryToCreateTable;
6
+ //# sourceMappingURL=queryToCreateTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryToCreateTable.d.ts","sourceRoot":"","sources":["../../../src/migrations/queryToCreateTable.ts"],"names":[],"mappings":"AAIA,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;AAEtC,QAAA,MAAM,kBAAkB,GAAI,QAAQ,SAAS,KAAG,aAAa,CAAC,UAAU,CAoBvE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ApiConfig } from "@prefabs.tech/fastify-config";
2
+ import type { Database } from "@prefabs.tech/fastify-slonik";
3
+ declare const runMigrations: (database: Database, config: ApiConfig) => Promise<void>;
4
+ export default runMigrations;
5
+ //# sourceMappingURL=runMigrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runMigrations.d.ts","sourceRoot":"","sources":["../../../src/migrations/runMigrations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,QAAA,MAAM,aAAa,GAAU,UAAU,QAAQ,EAAE,QAAQ,SAAS,kBAIjE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ declare const plugin: (fastify: FastifyInstance) => Promise<void>;
3
+ export default plugin;
4
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/model/notification/controller.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,MAAM,GAAU,SAAS,eAAe,kBAc7C,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { MercuriusContext } from "mercurius";
2
+ declare const _default: {
3
+ Mutation: {
4
+ sendNotification: (parent: unknown, arguments_: {
5
+ data: {
6
+ userId: string;
7
+ title: string;
8
+ body: string;
9
+ data: {
10
+ [key: string]: string;
11
+ };
12
+ };
13
+ }, context: MercuriusContext) => Promise<import("mercurius").ErrorWithProps | {
14
+ message: string;
15
+ }>;
16
+ };
17
+ Query: {};
18
+ };
19
+ export default _default;
20
+ //# sourceMappingURL=resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/graphql/resolver.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;;;mCAItC,OAAO,cACH;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,MAAM,CAAC;gBACf,KAAK,EAAE,MAAM,CAAC;gBACd,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE;oBACJ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;iBACvB,CAAC;aACH,CAAC;SACH,WACQ,gBAAgB;;;;;;AAiE7B,wBAAmC"}
@@ -0,0 +1,3 @@
1
+ declare const notificationSchema: import("@prefabs.tech/fastify-graphql").DocumentNode;
2
+ export default notificationSchema;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/graphql/schema.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB,sDAevB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ sendNotification: (request: import("supertokens-node/framework/fastify").SessionRequest, reply: import("fastify").FastifyReply) => Promise<undefined>;
3
+ };
4
+ export default _default;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/handlers/index.ts"],"names":[],"mappings":";;;AAEA,wBAEE"}
@@ -0,0 +1,5 @@
1
+ import type { FastifyReply } from "fastify";
2
+ import type { SessionRequest } from "supertokens-node/framework/fastify";
3
+ declare const testPushNotification: (request: SessionRequest, reply: FastifyReply) => Promise<undefined>;
4
+ export default testPushNotification;
5
+ //# sourceMappingURL=sendNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendNotification.d.ts","sourceRoot":"","sources":["../../../../../src/model/notification/handlers/sendNotification.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,QAAA,MAAM,oBAAoB,GACxB,SAAS,cAAc,EACvB,OAAO,YAAY,uBAsEpB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,75 @@
1
+ export declare const sendNotificationSchema: {
2
+ description: string;
3
+ operationId: string;
4
+ body: {
5
+ type: string;
6
+ properties: {
7
+ title: {
8
+ type: string;
9
+ };
10
+ message: {
11
+ type: string;
12
+ };
13
+ userId: {
14
+ type: string;
15
+ };
16
+ };
17
+ required: string[];
18
+ };
19
+ response: {
20
+ 200: {
21
+ type: string;
22
+ properties: {
23
+ success: {
24
+ type: string;
25
+ };
26
+ message: {
27
+ type: string;
28
+ };
29
+ };
30
+ };
31
+ 401: {
32
+ type: string;
33
+ properties: {
34
+ code: {
35
+ type: string;
36
+ };
37
+ error: {
38
+ type: string;
39
+ };
40
+ message: {
41
+ type: string;
42
+ };
43
+ statusCode: {
44
+ type: string;
45
+ };
46
+ status: {
47
+ type: string;
48
+ };
49
+ };
50
+ description: string;
51
+ };
52
+ 500: {
53
+ type: string;
54
+ properties: {
55
+ code: {
56
+ type: string;
57
+ };
58
+ error: {
59
+ type: string;
60
+ };
61
+ message: {
62
+ type: string;
63
+ };
64
+ statusCode: {
65
+ type: string;
66
+ };
67
+ status: {
68
+ type: string;
69
+ };
70
+ };
71
+ };
72
+ };
73
+ tags: string[];
74
+ };
75
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/model/notification/schema.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ declare const plugin: (fastify: FastifyInstance) => Promise<void>;
3
+ export default plugin;
4
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/controller.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,MAAM,GAAU,SAAS,eAAe,kBAoB7C,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { MercuriusContext } from "mercurius";
2
+ declare const _default: {
3
+ Mutation: {
4
+ addUserDevice: (parent: unknown, arguments_: {
5
+ data: {
6
+ deviceToken: string;
7
+ };
8
+ }, context: MercuriusContext) => Promise<import("../../../types").UserDevice | import("mercurius").ErrorWithProps | undefined>;
9
+ removeUserDevice: (parent: unknown, arguments_: {
10
+ data: {
11
+ deviceToken: string;
12
+ };
13
+ }, context: MercuriusContext) => Promise<import("../../../types").UserDevice | import("mercurius").ErrorWithProps | undefined>;
14
+ };
15
+ Query: {};
16
+ };
17
+ export default _default;
18
+ //# sourceMappingURL=resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/graphql/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,gBAAgB,EAAE,MAAM,WAAW,CAAC;;;gCAM5C,OAAO,cACH;YACV,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM,CAAC;aACrB,CAAC;SACH,WACQ,gBAAgB;mCA6BjB,OAAO,cACH;YACV,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM,CAAC;aACrB,CAAC;SACH,WACQ,gBAAgB;;;;AAsD7B,wBAAmC"}
@@ -0,0 +1,3 @@
1
+ declare const userDeviceSchema: import("@prefabs.tech/fastify-graphql").DocumentNode;
2
+ export default userDeviceSchema;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/graphql/schema.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB,sDA6BrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { FastifyReply } from "fastify";
2
+ import type { SessionRequest } from "supertokens-node/framework/fastify";
3
+ declare const addUserDevice: (request: SessionRequest, reply: FastifyReply) => Promise<undefined>;
4
+ export default addUserDevice;
5
+ //# sourceMappingURL=addUserDevice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addUserDevice.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/handlers/addUserDevice.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,QAAA,MAAM,aAAa,GAAU,SAAS,cAAc,EAAE,OAAO,YAAY,uBAsBxE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ addUserDevice: (request: import("supertokens-node/framework/fastify").SessionRequest, reply: import("fastify").FastifyReply) => Promise<undefined>;
3
+ removeUserDevice: (request: import("supertokens-node/framework/fastify").SessionRequest, reply: import("fastify").FastifyReply) => Promise<undefined>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/handlers/index.ts"],"names":[],"mappings":";;;;AAGA,wBAGE"}
@@ -0,0 +1,5 @@
1
+ import type { FastifyReply } from "fastify";
2
+ import type { SessionRequest } from "supertokens-node/framework/fastify";
3
+ declare const removeUserDevice: (request: SessionRequest, reply: FastifyReply) => Promise<undefined>;
4
+ export default removeUserDevice;
5
+ //# sourceMappingURL=removeUserDevice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeUserDevice.d.ts","sourceRoot":"","sources":["../../../../../src/model/userDevice/handlers/removeUserDevice.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,QAAA,MAAM,gBAAgB,GACpB,SAAS,cAAc,EACvB,OAAO,YAAY,uBAyCpB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,153 @@
1
+ export declare const deleteUserDeviceSchema: {
2
+ description: string;
3
+ operationId: string;
4
+ body: {
5
+ type: string;
6
+ properties: {
7
+ deviceToken: {
8
+ type: string;
9
+ };
10
+ };
11
+ required: string[];
12
+ };
13
+ response: {
14
+ 200: {
15
+ nullable: boolean;
16
+ type: string;
17
+ properties: {
18
+ userId: {
19
+ type: string;
20
+ };
21
+ deviceToken: {
22
+ type: string;
23
+ };
24
+ createdAt: {
25
+ type: string;
26
+ };
27
+ updatedAt: {
28
+ type: string;
29
+ };
30
+ };
31
+ required: string[];
32
+ };
33
+ 401: {
34
+ type: string;
35
+ properties: {
36
+ code: {
37
+ type: string;
38
+ };
39
+ error: {
40
+ type: string;
41
+ };
42
+ message: {
43
+ type: string;
44
+ };
45
+ statusCode: {
46
+ type: string;
47
+ };
48
+ status: {
49
+ type: string;
50
+ };
51
+ };
52
+ description: string;
53
+ };
54
+ 500: {
55
+ type: string;
56
+ properties: {
57
+ code: {
58
+ type: string;
59
+ };
60
+ error: {
61
+ type: string;
62
+ };
63
+ message: {
64
+ type: string;
65
+ };
66
+ statusCode: {
67
+ type: string;
68
+ };
69
+ status: {
70
+ type: string;
71
+ };
72
+ };
73
+ };
74
+ };
75
+ tags: string[];
76
+ };
77
+ export declare const postUserDeviceSchema: {
78
+ description: string;
79
+ operationId: string;
80
+ body: {
81
+ type: string;
82
+ properties: {
83
+ deviceToken: {
84
+ type: string;
85
+ };
86
+ };
87
+ required: string[];
88
+ };
89
+ response: {
90
+ 200: {
91
+ nullable: boolean;
92
+ type: string;
93
+ properties: {
94
+ userId: {
95
+ type: string;
96
+ };
97
+ deviceToken: {
98
+ type: string;
99
+ };
100
+ createdAt: {
101
+ type: string;
102
+ };
103
+ updatedAt: {
104
+ type: string;
105
+ };
106
+ };
107
+ required: string[];
108
+ };
109
+ 401: {
110
+ type: string;
111
+ properties: {
112
+ code: {
113
+ type: string;
114
+ };
115
+ error: {
116
+ type: string;
117
+ };
118
+ message: {
119
+ type: string;
120
+ };
121
+ statusCode: {
122
+ type: string;
123
+ };
124
+ status: {
125
+ type: string;
126
+ };
127
+ };
128
+ description: string;
129
+ };
130
+ 500: {
131
+ type: string;
132
+ properties: {
133
+ code: {
134
+ type: string;
135
+ };
136
+ error: {
137
+ type: string;
138
+ };
139
+ message: {
140
+ type: string;
141
+ };
142
+ statusCode: {
143
+ type: string;
144
+ };
145
+ status: {
146
+ type: string;
147
+ };
148
+ };
149
+ };
150
+ };
151
+ tags: string[];
152
+ };
153
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/model/userDevice/schema.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBlC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBhC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { BaseService } from "@prefabs.tech/fastify-slonik";
2
+ import UserDeviceSqlFactory from "./sqlFactory";
3
+ import { UserDevice, UserDeviceCreateInput, UserDeviceUpdateInput } from "../../types";
4
+ declare class UserDeviceService extends BaseService<UserDevice, UserDeviceCreateInput, UserDeviceUpdateInput> {
5
+ getByUserId(userId: string): Promise<UserDevice[] | undefined>;
6
+ removeByDeviceToken(deviceToken: string): Promise<UserDevice | undefined>;
7
+ get factory(): UserDeviceSqlFactory;
8
+ get sqlFactoryClass(): typeof UserDeviceSqlFactory;
9
+ protected preCreate(data: UserDeviceCreateInput): Promise<UserDeviceCreateInput>;
10
+ }
11
+ export default UserDeviceService;
12
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +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,oBAAoB,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB,cAAM,iBAAkB,SAAQ,WAAW,CACzC,UAAU,EACV,qBAAqB,EACrB,qBAAqB,CACtB;IACO,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;IAU9D,mBAAmB,CACvB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAUlC,IAAI,OAAO,IAAI,oBAAoB,CAElC;IAED,IAAI,eAAe,gCAElB;cAEe,SAAS,CACvB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;CAOlC;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { DefaultSqlFactory } from "@prefabs.tech/fastify-slonik";
2
+ import { QuerySqlToken } from "slonik";
3
+ declare class UserDeviceSqlFactory extends DefaultSqlFactory {
4
+ static readonly TABLE = "user_devices";
5
+ getDeleteExistingTokenSql(token: string): QuerySqlToken;
6
+ getFindByUserIdSql(userId: string): QuerySqlToken;
7
+ get table(): string;
8
+ }
9
+ export default UserDeviceSqlFactory;
10
+ //# sourceMappingURL=sqlFactory.d.ts.map
@@ -0,0 +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;IAQjD,IAAI,KAAK,WAER;CACF;AAED,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ declare const _default: (fastify: FastifyInstance) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;kCAEhB,eAAe;AAwB9C,wBAAqC"}
@@ -0,0 +1,21 @@
1
+ interface UserDevice {
2
+ userId: string;
3
+ deviceToken: string;
4
+ createdAt: number;
5
+ updatedAt: number;
6
+ }
7
+ interface User {
8
+ id: string;
9
+ }
10
+ interface TestNotificationInput {
11
+ userId: string;
12
+ title: string;
13
+ body: string;
14
+ data?: {
15
+ [key: string]: string;
16
+ };
17
+ }
18
+ type UserDeviceCreateInput = Partial<Omit<UserDevice, "createdAt" | "updatedAt">>;
19
+ type UserDeviceUpdateInput = Partial<Omit<UserDevice, "userId" | "createdAt" | "updatedAt">>;
20
+ export type { TestNotificationInput, User, UserDevice, UserDeviceCreateInput, UserDeviceUpdateInput, };
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH;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,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC,CACvD,CAAC;AAEF,YAAY,EACV,qBAAqB,EACrB,IAAI,EACJ,UAAU,EACV,qBAAqB,EACrB,qBAAqB,GACtB,CAAC"}