@messenger-box/platform-server 0.0.1-alpha.269 → 0.0.1-alpha.270

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.
@@ -1,4 +1,4 @@
1
- import {ContainerModule}from'inversify';import {ChannelService}from'../services/channel-service.js';import {PostService}from'../services/post-service.js';import'../services/post-thread-service.js';import'../services/reaction-service.js';import'../services/messenger-notification-service.js';import'../constants/query.constants.js';import {TYPES}from'@messenger-box/core/lib/server';import {ChannelRepository}from'../store/repositories/channel-repository.js';import {PostRepository}from'../store/repositories/post-repository.js';import'../store/repositories/post-thread-repository.js';import'../store/repositories/reaction-repository.js';// import { MessageNotificationTemplateMigration } from '../migrations';
1
+ import {ContainerModule}from'inversify';import {ChannelService}from'../services/channel-service.js';import {PostService}from'../services/post-service.js';import'../services/post-thread-service.js';import'../services/reaction-service.js';import'../services/messenger-notification-service.js';import'../services/extended-token-account-service.js';import'../constants/query.constants.js';import {TYPES}from'@messenger-box/core/lib/server';import {ChannelRepository}from'../store/repositories/channel-repository.js';import {PostRepository}from'../store/repositories/post-repository.js';import'../store/repositories/post-thread-repository.js';import'../store/repositories/reaction-repository.js';// import { MessageNotificationTemplateMigration } from '../migrations';
2
2
  // import {
3
3
  // ChannelProxyService,
4
4
  // PostProxyService,
@@ -1 +1 @@
1
- {"version":3,"file":"containers.js","sources":["../../src/containers/containers.ts"],"sourcesContent":[null],"names":[],"mappings":"6nBAuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;AAKG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;;;;;AAKG;AACI,MAAM,sBAAsB,GAA6C,CAAC,QAAQ,KACrF,IAAI,eAAe,CAAC,CAAC,IAAqB,KAAI;;;;;AAK1C,IAAA,IAAI,CAAqB,KAAK,CAAC,iBAAiB,CAAC;SAC5C,EAAE,CAAC,iBAAiB,CAAC;AACrB,SAAA,gBAAgB,EAAE;AAClB,SAAA,mBAAmB,EAAE,CAAC;AAC3B,IAAA,IAAI,CAAkB,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,CAAC;;;;;;;;;AAYxG,IAAA,IAAI,CAAkB,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,CAAC;AAExG,IAAA,IAAI,CAAe,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,CAAC;;;;;;;;;;AAYnG,CAAC"}
1
+ {"version":3,"file":"containers.js","sources":["../../src/containers/containers.ts"],"sourcesContent":[null],"names":[],"mappings":"mrBAuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;AAKG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;;;;;AAKG;AACI,MAAM,sBAAsB,GAA6C,CAAC,QAAQ,KACrF,IAAI,eAAe,CAAC,CAAC,IAAqB,KAAI;;;;;AAK1C,IAAA,IAAI,CAAqB,KAAK,CAAC,iBAAiB,CAAC;SAC5C,EAAE,CAAC,iBAAiB,CAAC;AACrB,SAAA,gBAAgB,EAAE;AAClB,SAAA,mBAAmB,EAAE,CAAC;AAC3B,IAAA,IAAI,CAAkB,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,CAAC;;;;;;;;;AAYxG,IAAA,IAAI,CAAkB,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,CAAC;AAExG,IAAA,IAAI,CAAe,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,CAAC;;;;;;;;;;AAYnG,CAAC"}
@@ -0,0 +1,42 @@
1
+ import {__decorate,__param}from'tslib';import {TYPES}from'@adminide-stack/account-api-core';import {injectable,inject}from'inversify';let ExtendedTokenAccountService = class ExtendedTokenAccountService {
2
+ constructor(accountRepository) {
3
+ this.accountRepository = accountRepository;
4
+ }
5
+ /**
6
+ *
7
+ * @param deviceToken
8
+ * @param accountId
9
+ *
10
+ * tokens: [{
11
+ * type: 'MOBILE_DEVICE_PUSH',
12
+ * token: 'deviceName:xdfjdljfdljfllk',
13
+ * }]
14
+ */
15
+ async setDeviceToken(deviceToken, accountId) {
16
+ const userAccount = await this.accountRepository.get({ id: accountId });
17
+ const updatedTokens = userAccount.tokens || [];
18
+ updatedTokens.push();
19
+ const mobileToken = {
20
+ type: "EXPO_NOTIFICATION_TOKEN" /* ITokenTypesEnum.ExpoNotificationToken */,
21
+ token: deviceToken,
22
+ refreshedCount: 0,
23
+ usedCount: 0,
24
+ };
25
+ return this.accountRepository.update({ _id: accountId }, {
26
+ $push: {
27
+ tokens: mobileToken
28
+ }
29
+ });
30
+ }
31
+ async removeDeviceToken(deviceToken, accountId) {
32
+ return this.accountRepository.update({ _id: accountId }, {
33
+ $pull: {
34
+ tokens: Object.assign({}, deviceToken)
35
+ }
36
+ });
37
+ }
38
+ };
39
+ ExtendedTokenAccountService = __decorate([
40
+ injectable(),
41
+ __param(0, inject(TYPES.IAccountRepository))
42
+ ], ExtendedTokenAccountService);export{ExtendedTokenAccountService};//# sourceMappingURL=extended-token-account-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extended-token-account-service.js","sources":["../../src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Y,CAAC,kBAAkB,CAAC,CAAA;AAFnC,CAAA,EAAA,2BAA2B,CAiDvC"}
@@ -3,3 +3,4 @@ export * from './post-service';
3
3
  export * from './post-thread-service';
4
4
  export * from './reaction-service';
5
5
  export * from './messenger-notification-service';
6
+ export * from './extended-token-account-service';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messenger-box/platform-server",
3
- "version": "0.0.1-alpha.269",
3
+ "version": "0.0.1-alpha.270",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -49,5 +49,5 @@
49
49
  "typescript": {
50
50
  "definition": "lib/index.d.ts"
51
51
  },
52
- "gitHead": "34b824cb0c2526bb0915fead6271a29e988c5f57"
52
+ "gitHead": "dc6abf71291f497e8e5ac6b3b4fc2a7b15034759"
53
53
  }