@lyxa.ai/core 1.3.264 → 1.3.265
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/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NotificationAccountType } from './enum';
|
|
2
2
|
import { UpdateFcmTokenInputDTO } from './validation';
|
|
3
3
|
export declare function removeAppInstance(fcmToken: string): Promise<void>;
|
|
4
|
-
export declare function addAppInstance(entityId: string, entityType:
|
|
4
|
+
export declare function addAppInstance(entityId: string, entityType: NotificationAccountType, data: UpdateFcmTokenInputDTO): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-instance.js","sourceRoot":"/","sources":["utilities/app-instance.ts"],"names":[],"mappings":";;AAQA,8CAIC;AAKD,wCAoBC;AArCD,sDAA0E;AAQnE,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IACvD,MAAM,KAAK,GAAG,yBAA0E,CAAC;IAEzF,MAAM,KAAK,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAKM,KAAK,UAAU,cAAc,CACnC,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"app-instance.js","sourceRoot":"/","sources":["utilities/app-instance.ts"],"names":[],"mappings":";;AAQA,8CAIC;AAKD,wCAoBC;AArCD,sDAA0E;AAQnE,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IACvD,MAAM,KAAK,GAAG,yBAA0E,CAAC;IAEzF,MAAM,KAAK,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAKM,KAAK,UAAU,cAAc,CACnC,QAAgB,EAChB,UAAmC,EACnC,IAA4B;IAE5B,MAAM,KAAK,GAAG,yBAA0E,CAAC;IAEzF,MAAM,KAAK,CAAC,SAAS,CACpB,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,EAC3B;QACC,IAAI,EAAE;YACL,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,UAAU;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACvB;KACD,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CAChB,CAAC;AACH,CAAC","sourcesContent":["import { AppInstance, AppInstanceModel } from '../libraries/mongo/models';\nimport { SoftDeleteModel } from '../libraries/mongo/plugins/soft-delete-plugin';\nimport { NotificationAccountType } from './enum';\nimport { UpdateFcmTokenInputDTO } from './validation';\n\n/**\n * A helper to remove record of an app instance using an fcm token\n */\nexport async function removeAppInstance(fcmToken: string) {\n\tconst model = AppInstanceModel as typeof AppInstanceModel & SoftDeleteModel<AppInstance>;\n\n\tawait model.deleteRecord({ fcmToken: fcmToken }, true);\n}\n\n/**\n * A helper to add record of an app instance\n */\nexport async function addAppInstance(\n\tentityId: string,\n\tentityType: NotificationAccountType,\n\tdata: UpdateFcmTokenInputDTO\n) {\n\tconst model = AppInstanceModel as typeof AppInstanceModel & SoftDeleteModel<AppInstance>;\n\n\tawait model.updateOne(\n\t\t{ fcmToken: data.fcmToken },\n\t\t{\n\t\t\t$set: {\n\t\t\t\tentityId: entityId,\n\t\t\t\tentityType: entityType,\n\t\t\t\tplatform: data.platform,\n\t\t\t\tappVersion: data.appVersion,\n\t\t\t\tfcmToken: data.fcmToken,\n\t\t\t},\n\t\t},\n\t\t{ upsert: true }\n\t);\n}\n"]}
|