@messenger-box/platform-server 10.0.2-alpha.0 → 10.0.2-alpha.3
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/lib/config/env-config.js +23 -13
- package/lib/config/env-config.js.map +1 -1
- package/lib/constants/default-notify-props.js +5 -5
- package/lib/constants/default-notify-props.js.map +1 -1
- package/lib/constants/extended-token-account.js +1 -1
- package/lib/constants/extended-token-account.js.map +1 -1
- package/lib/constants/query.constants.js +3 -3
- package/lib/constants/query.constants.js.map +1 -1
- package/lib/containers/containers.js +19 -57
- package/lib/containers/containers.js.map +1 -1
- package/lib/containers/context-services-from-container.js +11 -11
- package/lib/containers/context-services-from-container.js.map +1 -1
- package/lib/enums/notification-duration-unit-enum.js +4 -4
- package/lib/enums/notification-duration-unit-enum.js.map +1 -1
- package/lib/graphql/resolvers/channel-member.js +16 -12
- package/lib/graphql/resolvers/channel-member.js.map +1 -1
- package/lib/graphql/resolvers/channel.js +206 -102
- package/lib/graphql/resolvers/channel.js.map +1 -1
- package/lib/graphql/resolvers/extended-token-account.js +57 -37
- package/lib/graphql/resolvers/extended-token-account.js.map +1 -1
- package/lib/graphql/resolvers/index.js +1 -8
- package/lib/graphql/resolvers/index.js.map +1 -1
- package/lib/graphql/resolvers/post-thread.js +214 -136
- package/lib/graphql/resolvers/post-thread.js.map +1 -1
- package/lib/graphql/resolvers/post.js +450 -291
- package/lib/graphql/resolvers/post.js.map +1 -1
- package/lib/graphql/resolvers/reaction.js +43 -22
- package/lib/graphql/resolvers/reaction.js.map +1 -1
- package/lib/graphql/schema/account-ext.graphql +3 -0
- package/lib/graphql/schema/account-ext.graphql.js +1 -1
- package/lib/graphql/schema/base.graphql +6 -0
- package/lib/graphql/schema/base.graphql.js +1 -1
- package/lib/graphql/schema/channel-member.graphql +25 -0
- package/lib/graphql/schema/channel-member.graphql.js +1 -1
- package/lib/graphql/schema/channel.graphql +138 -0
- package/lib/graphql/schema/channel.graphql.js +1 -1
- package/lib/graphql/schema/extended-token-account-schema.graphql +18 -0
- package/lib/graphql/schema/extended-token-account-schema.graphql.js +1 -1
- package/lib/graphql/schema/extended.graphql +16 -0
- package/lib/graphql/schema/extended.graphql.js +1 -1
- package/lib/graphql/schema/index.js +1 -16
- package/lib/graphql/schema/index.js.map +1 -1
- package/lib/graphql/schema/mail-templates.graphql +3 -0
- package/lib/graphql/schema/mail-templates.graphql.js +1 -1
- package/lib/graphql/schema/messenger-notification-service.graphql +14 -0
- package/lib/graphql/schema/messenger-notification-service.graphql.js +1 -1
- package/lib/graphql/schema/messenger-preferences.graphql +16 -0
- package/lib/graphql/schema/messenger-preferences.graphql.js +1 -1
- package/lib/graphql/schema/post-thread.graphql +97 -0
- package/lib/graphql/schema/post-thread.graphql.js +1 -1
- package/lib/graphql/schema/post.graphql +132 -0
- package/lib/graphql/schema/post.graphql.js +1 -1
- package/lib/graphql/schema/preferences.graphql +42 -0
- package/lib/graphql/schema/preferences.graphql.js +1 -1
- package/lib/graphql/schema/reaction.graphql +20 -0
- package/lib/graphql/schema/reaction.graphql.js +1 -1
- package/lib/graphql/schema/services.graphql +72 -0
- package/lib/graphql/schema/users.graphql +23 -0
- package/lib/graphql/schema/users.graphql.js +1 -1
- package/lib/migrations/mail-template-migration.js +59 -58
- package/lib/migrations/mail-template-migration.js.map +1 -1
- package/lib/migrations/message-notification-template-migration.d.ts +2 -2
- package/lib/migrations/message-notification-template-migration.js +70 -74
- package/lib/migrations/message-notification-template-migration.js.map +1 -1
- package/lib/module.js +13 -20
- package/lib/module.js.map +1 -1
- package/lib/plugins/channel-moleculer-service.js +126 -119
- package/lib/plugins/channel-moleculer-service.js.map +1 -1
- package/lib/plugins/extended-token-account-moleculer-service.js +45 -41
- package/lib/plugins/extended-token-account-moleculer-service.js.map +1 -1
- package/lib/plugins/messenger-notification-moleculer-service.js +115 -85
- package/lib/plugins/messenger-notification-moleculer-service.js.map +1 -1
- package/lib/plugins/post-moleculer-service.js +386 -290
- package/lib/plugins/post-moleculer-service.js.map +1 -1
- package/lib/plugins/post-thread-moleculer-service.js +32 -27
- package/lib/plugins/post-thread-moleculer-service.js.map +1 -1
- package/lib/plugins/reaction-moleculer-service.js +19 -17
- package/lib/plugins/reaction-moleculer-service.js.map +1 -1
- package/lib/preferences/permissions/inbox-permission-contribution.js +96 -150
- package/lib/preferences/permissions/inbox-permission-contribution.js.map +1 -1
- package/lib/preferences/permissions/inbox-roles-permission-overwrite.d.ts +143 -143
- package/lib/preferences/permissions/inbox-roles-permission-overwrite.js +161 -161
- package/lib/preferences/permissions/inbox-roles-permission-overwrite.js.map +1 -1
- package/lib/preferences/settings/post-settings.js +43 -43
- package/lib/preferences/settings/post-settings.js.map +1 -1
- package/lib/routes.json +1 -0
- package/lib/services/channel-service.js +378 -308
- package/lib/services/channel-service.js.map +1 -1
- package/lib/services/extended-token-account-service.d.ts +3 -2
- package/lib/services/extended-token-account-service.js +73 -75
- package/lib/services/extended-token-account-service.js.map +1 -1
- package/lib/services/messenger-notification-service.js +502 -457
- package/lib/services/messenger-notification-service.js.map +1 -1
- package/lib/services/post-service.js +157 -146
- package/lib/services/post-service.js.map +1 -1
- package/lib/services/post-thread-service.js +23 -27
- package/lib/services/post-thread-service.js.map +1 -1
- package/lib/services/proxy-services/channel-microservice.d.ts +1 -1
- package/lib/services/proxy-services/channel-microservice.js +198 -117
- package/lib/services/proxy-services/channel-microservice.js.map +1 -1
- package/lib/services/proxy-services/messenger-notification-microservice.d.ts +2 -2
- package/lib/services/proxy-services/messenger-notification-microservice.js +49 -52
- package/lib/services/proxy-services/messenger-notification-microservice.js.map +1 -1
- package/lib/services/proxy-services/post-microservice.d.ts +1 -1
- package/lib/services/proxy-services/post-microservice.js +63 -40
- package/lib/services/proxy-services/post-microservice.js.map +1 -1
- package/lib/services/proxy-services/post-thread-microservice.d.ts +1 -1
- package/lib/services/proxy-services/post-thread-microservice.js +14 -15
- package/lib/services/proxy-services/post-thread-microservice.js.map +1 -1
- package/lib/services/proxy-services/reaction-microservice.d.ts +1 -1
- package/lib/services/proxy-services/reaction-microservice.js +9 -12
- package/lib/services/proxy-services/reaction-microservice.js.map +1 -1
- package/lib/services/reaction-service.js +6 -10
- package/lib/services/reaction-service.js.map +1 -1
- package/lib/store/models/account-token-store.js +3 -1
- package/lib/store/models/account-token-store.js.map +1 -1
- package/lib/store/models/channel.js +130 -91
- package/lib/store/models/channel.js.map +1 -1
- package/lib/store/models/common-options.js +17 -17
- package/lib/store/models/common-options.js.map +1 -1
- package/lib/store/models/post-thread.js +34 -17
- package/lib/store/models/post-thread.js.map +1 -1
- package/lib/store/models/post.js +55 -18
- package/lib/store/models/post.js.map +1 -1
- package/lib/store/models/reaction.js +15 -5
- package/lib/store/models/reaction.js.map +1 -1
- package/lib/store/repositories/channel-repository.js +4 -11
- package/lib/store/repositories/channel-repository.js.map +1 -1
- package/lib/store/repositories/post-repository.js +4 -11
- package/lib/store/repositories/post-repository.js.map +1 -1
- package/lib/store/repositories/post-thread-repository.js +4 -11
- package/lib/store/repositories/post-thread-repository.js.map +1 -1
- package/lib/store/repositories/reaction-repository.js +4 -10
- package/lib/store/repositories/reaction-repository.js.map +1 -1
- package/package.json +3 -4
package/lib/config/env-config.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {cleanEnv,num,str,json}from'envalid';const config = cleanEnv(process.env,
|
|
2
|
-
/* start */
|
|
1
|
+
import {cleanEnv,num,str,json}from'envalid';const config = cleanEnv(process.env, /* start */
|
|
3
2
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
FILES_TTL: num({
|
|
4
|
+
default: 3600,
|
|
5
|
+
desc: 'TTL for files cache in Seconds'
|
|
6
|
+
}),
|
|
7
|
+
NAMESPACE: str({
|
|
8
|
+
default: 'default'
|
|
9
|
+
}),
|
|
10
|
+
GRAPHQL_URL: str(),
|
|
11
|
+
MAIL_SEND_DEFAULT_EMAIL: str(),
|
|
12
|
+
APP_NAME: str(),
|
|
13
|
+
SUPPORT_SERVICE_SETTINGS: json(),
|
|
14
|
+
INBOX_MESSEGE_PATH: str({
|
|
15
|
+
default: 'MainStack.Message'
|
|
16
|
+
}),
|
|
17
|
+
// THREAD_MESSEGE_PATH: str({ default: 'MainStack.Thread' }),
|
|
18
|
+
// THREADS_PATH: str({ default: 'MainStack.ThreadMessage' }),
|
|
19
|
+
THREAD_MESSEGE_PATH: str({
|
|
20
|
+
default: 'MainStack.ThreadMessage'
|
|
21
|
+
}),
|
|
22
|
+
THREADS_PATH: str({
|
|
23
|
+
default: 'MainStack.Thread'
|
|
24
|
+
})
|
|
15
25
|
} /* end */);export{config};//# sourceMappingURL=env-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":"kDAEa,MAAM,GAAG,QAAQ,CAC1B,OAAO,CAAC,GAAG;AACX;AACA
|
|
1
|
+
{"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":"kDAEa,MAAM,GAAG,QAAQ,CAC1B,OAAO,CAAC,GAAG;AACX;AACA,EAAA,SAAA,EAAA,GAAA,CAAA;AACI,IAAA,OAAA,EAAS,IAAE;IACX,IAAS,EAAA;IACT;WACuB,EAAA,GAAA,CAAA;IACvB,OAAQ,EAAA;IACR;aACkB,EAAA,GAAA,EAAA;yBAC2C,EAAA,GAAA,EAAA;UACA,EAAA,GAAA,EAAA;4BACrC;sBACN;IACpB,OAAS,EACb;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const DEFAULT_NOTIFY_PROPS = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
desktopNotifyProp: true,
|
|
3
|
+
markUnreadNotifyProp: true,
|
|
4
|
+
pushNotifyProp: true,
|
|
5
|
+
emailNotifyProp: true,
|
|
6
|
+
ignoreChannelMentionsNotifyProp: true
|
|
7
7
|
};export{DEFAULT_NOTIFY_PROPS};//# sourceMappingURL=default-notify-props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-notify-props.js","sources":["../../src/constants/default-notify-props.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,oBAAoB,GAAG;AAChC,
|
|
1
|
+
{"version":3,"file":"default-notify-props.js","sources":["../../src/constants/default-notify-props.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,oBAAoB,GAAG;AAChC,EAAA,iBAAA,EAAiB,IAAM;AACvB,EAAA,oBAAA,EAAoB,IAAM;AAC1B,EAAA,cAAA,EAAc,IAAM;AACpB,EAAA,eAAA,EAAe,IAAM;AACrB,EAAA,+BAAA,EAA+B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extended-token-account.js","sources":["../../src/constants/extended-token-account.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,sBAAsB,GAAG;AAClC,
|
|
1
|
+
{"version":3,"file":"extended-token-account.js","sources":["../../src/constants/extended-token-account.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,sBAAsB,GAAG;AAClC,EAAA,2BAAA,EAA2B,MAAE,CAAA,6BAAO;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var PAGINATION_OPTIONS;
|
|
2
2
|
(function (PAGINATION_OPTIONS) {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
PAGINATION_OPTIONS[PAGINATION_OPTIONS["limit"] = 10] = "limit";
|
|
4
|
+
PAGINATION_OPTIONS[PAGINATION_OPTIONS["skip"] = 0] = "skip";
|
|
5
5
|
})(PAGINATION_OPTIONS || (PAGINATION_OPTIONS = {}));
|
|
6
6
|
const DEFAULT_SORTING = {
|
|
7
|
-
|
|
7
|
+
id: 'asc'
|
|
8
8
|
};export{DEFAULT_SORTING,PAGINATION_OPTIONS};//# sourceMappingURL=query.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.constants.js","sources":["../../src/constants/query.constants.ts"],"sourcesContent":[null],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAC1B,
|
|
1
|
+
{"version":3,"file":"query.constants.js","sources":["../../src/constants/query.constants.ts"],"sourcesContent":[null],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAC1B,EAAA,kBAAA,CAAA,kBAAA,CAAA,OAAA,CAAA,GAAA,EAAA,CAAA,GAAA,OAAA;AACA,EAAA,kBAAA,CAAA,kBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA;AACJ,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAG7B,EAAA,CAAA,CAAA;AAEY,MAAA,eAAe,GAAG;AAC3B,EAAA,EAAA,EAAE;"}
|
|
@@ -4,34 +4,14 @@ import {ContainerModule}from'inversify';import {TaggedType}from'@common-stack/co
|
|
|
4
4
|
*
|
|
5
5
|
* @param settings Settings
|
|
6
6
|
*/
|
|
7
|
-
const proxyServiceContainerModule =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
bind(TYPES.ChannelService)
|
|
16
|
-
.to(ChannelProxyService)
|
|
17
|
-
.inSingletonScope()
|
|
18
|
-
.whenTargetNamed(TaggedType.MICROSERVICE);
|
|
19
|
-
bind(TYPES.PostService)
|
|
20
|
-
.to(PostProxyService)
|
|
21
|
-
.inSingletonScope()
|
|
22
|
-
.whenTargetNamed(TaggedType.MICROSERVICE);
|
|
23
|
-
bind(TYPES.PostThreadService)
|
|
24
|
-
.to(PostThreadMicroservice)
|
|
25
|
-
.inSingletonScope()
|
|
26
|
-
.whenTargetNamed(TaggedType.MICROSERVICE);
|
|
27
|
-
bind(TYPES.ReactionService)
|
|
28
|
-
.to(ReactionMicroservice)
|
|
29
|
-
.inSingletonScope()
|
|
30
|
-
.whenTargetNamed(TaggedType.MICROSERVICE);
|
|
31
|
-
bind(TYPES.MessengerNotificationService)
|
|
32
|
-
.to(MessengerNotificationMicroservice)
|
|
33
|
-
.inSingletonScope()
|
|
34
|
-
.whenTargetNamed(TaggedType.MICROSERVICE);
|
|
7
|
+
const proxyServiceContainerModule = settings => new ContainerModule(bind => {
|
|
8
|
+
bind('MongodbMigration').to(MessageNotificationTemplateMigration).whenTargetNamed(MessageNotificationTemplateMigration.name);
|
|
9
|
+
bind(ExtendTokenAccountType.ExtendedTokenAccountService).to(ExtendedTokenAccountService).inSingletonScope().whenTargetIsDefault();
|
|
10
|
+
bind(TYPES.ChannelService).to(ChannelProxyService).inSingletonScope().whenTargetNamed(TaggedType.MICROSERVICE);
|
|
11
|
+
bind(TYPES.PostService).to(PostProxyService).inSingletonScope().whenTargetNamed(TaggedType.MICROSERVICE);
|
|
12
|
+
bind(TYPES.PostThreadService).to(PostThreadMicroservice).inSingletonScope().whenTargetNamed(TaggedType.MICROSERVICE);
|
|
13
|
+
bind(TYPES.ReactionService).to(ReactionMicroservice).inSingletonScope().whenTargetNamed(TaggedType.MICROSERVICE);
|
|
14
|
+
bind(TYPES.MessengerNotificationService).to(MessengerNotificationMicroservice).inSingletonScope().whenTargetNamed(TaggedType.MICROSERVICE);
|
|
35
15
|
});
|
|
36
16
|
/**
|
|
37
17
|
* Operates external to the Gateway. Usually a broker listen to calls and invoke this service
|
|
@@ -39,33 +19,15 @@ const proxyServiceContainerModule = (settings) => new ContainerModule((bind) =>
|
|
|
39
19
|
*
|
|
40
20
|
* @param settings Settings
|
|
41
21
|
*/
|
|
42
|
-
const serviceContainerModule =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.to(PostThreadRepository)
|
|
54
|
-
.inSingletonScope()
|
|
55
|
-
.whenTargetIsDefault();
|
|
56
|
-
bind(TYPES.ReactionRepository)
|
|
57
|
-
.to(ReactionRepository)
|
|
58
|
-
.inSingletonScope()
|
|
59
|
-
.whenTargetIsDefault();
|
|
60
|
-
bind(TYPES.ChannelService).to(ChannelService).inSingletonScope().whenTargetIsDefault();
|
|
61
|
-
bind(TYPES.PostService).to(PostService).inSingletonScope().whenTargetIsDefault();
|
|
62
|
-
bind(TYPES.PostThreadService)
|
|
63
|
-
.to(PostThreadService)
|
|
64
|
-
.inSingletonScope()
|
|
65
|
-
.whenTargetIsDefault();
|
|
66
|
-
bind(TYPES.ReactionService).to(ReactionService).inSingletonScope().whenTargetIsDefault();
|
|
67
|
-
bind(TYPES.MessengerNotificationService)
|
|
68
|
-
.to(MessengerNotificationService)
|
|
69
|
-
.inSingletonScope()
|
|
70
|
-
.whenTargetIsDefault();
|
|
22
|
+
const serviceContainerModule = settings => new ContainerModule(bind => {
|
|
23
|
+
bind(ExtendTokenAccountType.ExtendedTokenAccountService).to(ExtendedTokenAccountService).inSingletonScope().whenTargetIsDefault();
|
|
24
|
+
bind(TYPES.ChannelRepository).to(ChannelRepository).inSingletonScope().whenTargetIsDefault();
|
|
25
|
+
bind(TYPES.PostRepository).to(PostRepository).inSingletonScope().whenTargetIsDefault();
|
|
26
|
+
bind(TYPES.PostThreadRepository).to(PostThreadRepository).inSingletonScope().whenTargetIsDefault();
|
|
27
|
+
bind(TYPES.ReactionRepository).to(ReactionRepository).inSingletonScope().whenTargetIsDefault();
|
|
28
|
+
bind(TYPES.ChannelService).to(ChannelService).inSingletonScope().whenTargetIsDefault();
|
|
29
|
+
bind(TYPES.PostService).to(PostService).inSingletonScope().whenTargetIsDefault();
|
|
30
|
+
bind(TYPES.PostThreadService).to(PostThreadService).inSingletonScope().whenTargetIsDefault();
|
|
31
|
+
bind(TYPES.ReactionService).to(ReactionService).inSingletonScope().whenTargetIsDefault();
|
|
32
|
+
bind(TYPES.MessengerNotificationService).to(MessengerNotificationService).inSingletonScope().whenTargetIsDefault();
|
|
71
33
|
});export{proxyServiceContainerModule,serviceContainerModule};//# sourceMappingURL=containers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containers.js","sources":["../../src/containers/containers.ts"],"sourcesContent":[null],"names":[],"mappings":"wjDAgCA;;;;;AAKG;AACI,MAAM,2BAA2B,GAA6C,
|
|
1
|
+
{"version":3,"file":"containers.js","sources":["../../src/containers/containers.ts"],"sourcesContent":[null],"names":[],"mappings":"wjDAgCA;;;;;AAKG;AACI,MAAM,2BAA2B,GAA6C,QAAS,IAAI,mBAC3E,CAAA,IAAE;MACb,CAAA,oBAAmB,EAAC,CAAA,oCAAA,CAAA,CAAA,eAAA,CAAA,oCAAA,CAAA,IAAA,CAAA;yDACqB,CAAA,CAAA,EAAA,CAAA,2BAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AACxC,EAAA,IAAA,CAAA,KAAA,CAAA,cAAgB,CAAA,CAAA,EAAA,CAAA,mBAAA,CAAA,CAAA,gBAA2C,EAAA,CAAA,eAAA,CAAA,UAAA,CAAA,YAAA,CAAA;AAChE,EAAA,IAAA,CAAA,KAAK,CAAA,WAAA,CAAA,CAAA,EAAA,CAAA,gBAAuB,CAAA,CAAA,gBAA4B,EAAA,CAAA,eAAA,CAAA,UAAA,CAAA,YAAA,CAAA;YAChD,6CAA4B,CAAA,CAAA,gBAAA,EAAA,CAAA,eAAA,CAAA,UAAA,CAAA,YAAA,CAAA;AAC/B,EAAA,IAAA,CAAA,KAAA,CAAA,eAAkB,CAAA,CAAA,EAAA,CAAA,oBAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,eAAA,CAAA,UAAA,CAAA,YAAA,CAAA;AAClB,EAAA,IAAA,CAAA,KAAA,CAAA,4BAAsB,CAAA,CAAA,EAAA,CAAA,iCAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,eAAA,CAAA,UAAA,CAAA,YAAA,CAAA;AAE3B,CAAA;;AAEK;AACA;AAEL;;AAEK;AACA,MAAA,sBAA0B,GAAC,QAAA,IAAc,IAAA,eAAA,CAAA,IAAA,IAAA;AAC9C,EAAA,IAAA,CAAA,sBAA+B,CAAA,2BAAkB,CAAA,CAAA,EAAA,CAAA,2BAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;YACzC,sBAAsB,CAAC,iBAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AAC1B,EAAA,IAAA,CAAA,KAAA,CAAA,cAAkB,CAAA,CAAA,EAAA,CAAA,cAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AAClB,EAAA,IAAA,CAAA,KAAA,CAAA,oBAAgB,CAAA,CAAU,EAAC,CAAA,oBAAc,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AAE9C,EAAA,IAAA,CAAA,KAAuB,CAAA,kBAAsB,CAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;YACrC,oBAAoB,cAAC,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AACxB,EAAA,IAAA,CAAA,KAAA,CAAA,WAAA,CAAgB,CAAE,EAAA,CAAA,WAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AAClB,EAAA,IAAA,CAAA,KAAA,CAAA,iBAAgB,CAAA,CAAA,EAAA,CAAU,iBAAe,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AAE9C,EAAA,IAAA,CAAA,KAAoC,CAAA,eAAM,CAAA,CAAA,EAAA,CAAA,eAA6B,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;YAC/D,iCAAiC,CAAC,4BAAA,CAAA,CAAA,gBAAA,EAAA,CAAA,mBAAA,EAAA;AACrC,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {TaggedType}from'@common-stack/core';import'../constants/query.constants.js';import {ExtendTokenAccountType}from'../constants/extended-token-account.js';import {TYPES}from'@messenger-box/core/lib/server';const contextServicesFromContainer =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import {TaggedType}from'@common-stack/core';import'../constants/query.constants.js';import {ExtendTokenAccountType}from'../constants/extended-token-account.js';import {TYPES}from'@messenger-box/core/lib/server';const contextServicesFromContainer = container => {
|
|
2
|
+
const services = {
|
|
3
|
+
extendedTokenAccountService: container.get(ExtendTokenAccountType.ExtendedTokenAccountService),
|
|
4
|
+
pubsub: container.get('PubSub'),
|
|
5
|
+
channelService: container.getNamed(TYPES.ChannelService, TaggedType.MICROSERVICE),
|
|
6
|
+
postService: container.getNamed(TYPES.PostService, TaggedType.MICROSERVICE),
|
|
7
|
+
postThreadService: container.getNamed(TYPES.PostThreadService, TaggedType.MICROSERVICE),
|
|
8
|
+
reactionService: container.getNamed(TYPES.ReactionService, TaggedType.MICROSERVICE),
|
|
9
|
+
messengerNotificationService: container.getNamed(TYPES.MessengerNotificationService, TaggedType.MICROSERVICE)
|
|
10
|
+
};
|
|
11
|
+
return services;
|
|
12
12
|
};export{contextServicesFromContainer};//# sourceMappingURL=context-services-from-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-services-from-container.js","sources":["../../src/containers/context-services-from-container.ts"],"sourcesContent":[null],"names":[],"mappings":"mNAea,MAAA,4BAA4B,GAAG,
|
|
1
|
+
{"version":3,"file":"context-services-from-container.js","sources":["../../src/containers/context-services-from-container.ts"],"sourcesContent":[null],"names":[],"mappings":"mNAea,MAAA,4BAA4B,GAAG,SAAC,IAA8C;AACvF,EAAA,MAAA,WAAiB;+BACc,EAAA,aAAW,CAAC,sBAAuD,CAAA;AAC9F,IAAA,MAAA,EAAA,SAAiB,CAAA,GAAA,CAAC;AAClB,IAAA,cAAA,EAAA,SAAgB,CAAA,QAAU,CAAA,KAA0B,CAAA,cAAM,EAAA,UAAgB,CAAA,YAAW,CAAA;AACrF,IAAA,WAAA,EAAA,SAAa,CAAA,QAAU,CAAA,KAAuB,CAAA,WAAM,EAAA,UAAa,CAAA,YAAW,CAAA;AAC5E,IAAA,iBAAA,EAAA,SAAmB,CAAA,QAAU,CAAA,KAA6B,CAAA,iBAAM,EAAA,UAAmB,CAAA,YAAW,CAAA;AAC9F,IAAA,eAAA,EAAA,SAAiB,CAAA,QAAU,CAAA,KAA2B,CAAA,eAAM,EAAA,UAAiB,CAAA,YAAW,CAAA;AACxF,IAAA,4BAAA,EAAA,SAA8B,CAAA,QAAU,CAAA,KACpC,CAAA,4BAAM,EAAA,UACN,CAAA,YAAW;;AAGnB,EAAA,OAAA;AACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var NotificationDurationUnitEnum;
|
|
2
2
|
(function (NotificationDurationUnitEnum) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
NotificationDurationUnitEnum["days"] = "days";
|
|
4
|
+
NotificationDurationUnitEnum["hours"] = "hours";
|
|
5
|
+
NotificationDurationUnitEnum["minutes"] = "minutes";
|
|
6
|
+
NotificationDurationUnitEnum["seconds"] = "seconds";
|
|
7
7
|
})(NotificationDurationUnitEnum || (NotificationDurationUnitEnum = {}));export{NotificationDurationUnitEnum};//# sourceMappingURL=notification-duration-unit-enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-duration-unit-enum.js","sources":["../../src/enums/notification-duration-unit-enum.ts"],"sourcesContent":[null],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,4BAA4B,EAAA;AACpC,
|
|
1
|
+
{"version":3,"file":"notification-duration-unit-enum.js","sources":["../../src/enums/notification-duration-unit-enum.ts"],"sourcesContent":[null],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,4BAA4B,EAAA;AACpC,EAAA,4BAAA,CAAA,MAAA,CAAA,GAAA,MAAA;AACA,EAAA,4BAAA,CAAA,OAAA,CAAA,GAAA,OAAA;AACA,EAAA,4BAAA,CAAA,SAAA,CAAA,GAAA,SAAA;AACA,EAAA,4BAAA,CAAA,SAAA,CAAA,GAAA,SAAA;AACJ,CAAC,EALW,4BAA4B,KAA5B,4BAA4B,GAKvC,EAAA,CAAA,CAAA"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
const channelMemberResolvers = () => ({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
Channel: {
|
|
3
|
+
creator(src, args, {
|
|
4
|
+
accountService
|
|
5
|
+
}) {
|
|
6
|
+
return accountService.findAccountById(src.creator.toString());
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
ChannelMember: {
|
|
10
|
+
user(src, args, {
|
|
11
|
+
accountService
|
|
12
|
+
}) {
|
|
13
|
+
return accountService.findAccountById(src.user.toString());
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
Query: {},
|
|
17
|
+
Mutation: {}
|
|
14
18
|
});export{channelMemberResolvers};//# sourceMappingURL=channel-member.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-member.js","sources":["../../../src/graphql/resolvers/channel-member.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGa,MAAA,sBAAsB,GAAG,OAA6B;AAC/D,
|
|
1
|
+
{"version":3,"file":"channel-member.js","sources":["../../../src/graphql/resolvers/channel-member.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGa,MAAA,sBAAsB,GAAG,OAA6B;AAC/D,EAAA,OAAA,EAAO;AACH,IAAA,OAAA,CAAA,GAAO,EAAI,IAAE;;;AAGhB,MAAA,OAAA,cAAA,CAAA,eAAA,CAAA,GAAA,CAAA,OAAA,CAAA,QAAA,EAAA,CAAA;AACD;AACI,GAAA;eACW,EAAA;QACX,CAAC,GAAA,EAAA,IAAA,EAAA;AACJ,MAAA;AACD,KAAA,EAAA;AACA,MAAA,qBAAY,CAAA,eAAA,CAAA,GAAA,CAAA,IAAA,CAAA,QAAA,EAAA,CAAA;AACf;;;;"}
|
|
@@ -1,106 +1,210 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {RoomType}from'common';const channelResolvers = () => ({
|
|
2
|
+
Channel: {
|
|
3
|
+
creator(src, args, {
|
|
4
|
+
accountService
|
|
5
|
+
}) {
|
|
6
|
+
return accountService.findAccountById(src.creator.toString());
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
Query: {
|
|
10
|
+
channelByName(src, {
|
|
11
|
+
name
|
|
12
|
+
}, {
|
|
13
|
+
channelService,
|
|
14
|
+
userContext
|
|
15
|
+
}) {
|
|
16
|
+
return channelService.getByName(userContext.teamId, name);
|
|
6
17
|
},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const { criteria, role, ...rest } = args || { criteria: {} };
|
|
18
|
-
return channelService.getAll({
|
|
19
|
-
...rest,
|
|
20
|
-
criteria: {
|
|
21
|
-
...criteria,
|
|
22
|
-
members: criteria?.members ?? {
|
|
23
|
-
$elemMatch: {
|
|
24
|
-
user: accountId,
|
|
25
|
-
...(role ? { roles: role } : {}),
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
supportServiceChannels(src, args, { channelService, userContext }) {
|
|
32
|
-
const { criteria, role, ...rest } = args || { criteria: {} };
|
|
33
|
-
return channelService.getAll({
|
|
34
|
-
...rest,
|
|
35
|
-
criteria: {
|
|
36
|
-
...criteria,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
directChannel(src, { id }, { channelService, userContext }) {
|
|
41
|
-
return channelService.get({
|
|
42
|
-
criteria: {
|
|
43
|
-
id,
|
|
44
|
-
user: userContext.accountId,
|
|
45
|
-
type: IRoomType.Direct,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
viewChannelDetail(src, { id }, { channelService, userContext }) {
|
|
50
|
-
return channelService.get(id);
|
|
51
|
-
},
|
|
18
|
+
channels(src, _, {
|
|
19
|
+
channelService,
|
|
20
|
+
userContext
|
|
21
|
+
}) {
|
|
22
|
+
const {
|
|
23
|
+
accountId,
|
|
24
|
+
teamId,
|
|
25
|
+
orgId
|
|
26
|
+
} = userContext;
|
|
27
|
+
return channelService.getChannels(teamId, accountId, false, new Date().getTime(), orgId);
|
|
52
28
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return channelService.createDirectChannel({
|
|
82
|
-
sender: accountId,
|
|
83
|
-
receiver,
|
|
84
|
-
displayName,
|
|
85
|
-
orgName: orgId,
|
|
86
|
-
channelOptions,
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
hideChannel(src, { id }, { channelService }) {
|
|
90
|
-
return channelService.hideChannel(id);
|
|
91
|
-
},
|
|
92
|
-
leaveChannel(src, { id }, { channelService }) {
|
|
93
|
-
return channelService.leaveChannel(id);
|
|
94
|
-
},
|
|
95
|
-
deleteChannel(src, { id }, { channelService }) {
|
|
96
|
-
return channelService.deleteChannel(id);
|
|
97
|
-
},
|
|
98
|
-
viewChannel(src, { id }, { userContext, channelService }) {
|
|
99
|
-
return channelService.viewChannel(id, userContext.accountId);
|
|
100
|
-
},
|
|
101
|
-
async sendNotificationOfUnreadMessages(src, { unit, value }, { messengerNotificationService }) {
|
|
102
|
-
await messengerNotificationService.sendNotificationOfUnreadMessages(unit, value);
|
|
103
|
-
return true;
|
|
104
|
-
},
|
|
29
|
+
channelsByUser(src, args, {
|
|
30
|
+
channelService,
|
|
31
|
+
userContext
|
|
32
|
+
}) {
|
|
33
|
+
const {
|
|
34
|
+
accountId
|
|
35
|
+
} = userContext;
|
|
36
|
+
const {
|
|
37
|
+
criteria,
|
|
38
|
+
role,
|
|
39
|
+
...rest
|
|
40
|
+
} = args || {
|
|
41
|
+
criteria: {}
|
|
42
|
+
};
|
|
43
|
+
return channelService.getAll({
|
|
44
|
+
...rest,
|
|
45
|
+
criteria: {
|
|
46
|
+
...criteria,
|
|
47
|
+
members: criteria?.members ?? {
|
|
48
|
+
$elemMatch: {
|
|
49
|
+
user: accountId,
|
|
50
|
+
...(role ? {
|
|
51
|
+
roles: role
|
|
52
|
+
} : {})
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
105
57
|
},
|
|
58
|
+
supportServiceChannels(src, args, {
|
|
59
|
+
channelService,
|
|
60
|
+
userContext
|
|
61
|
+
}) {
|
|
62
|
+
const {
|
|
63
|
+
criteria,
|
|
64
|
+
role,
|
|
65
|
+
...rest
|
|
66
|
+
} = args || {
|
|
67
|
+
criteria: {}
|
|
68
|
+
};
|
|
69
|
+
return channelService.getAll({
|
|
70
|
+
...rest,
|
|
71
|
+
criteria: {
|
|
72
|
+
...criteria
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
directChannel(src, {
|
|
77
|
+
id
|
|
78
|
+
}, {
|
|
79
|
+
channelService,
|
|
80
|
+
userContext
|
|
81
|
+
}) {
|
|
82
|
+
return channelService.get({
|
|
83
|
+
criteria: {
|
|
84
|
+
id,
|
|
85
|
+
user: userContext.accountId,
|
|
86
|
+
type: RoomType.Direct
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
viewChannelDetail(src, {
|
|
91
|
+
id
|
|
92
|
+
}, {
|
|
93
|
+
channelService,
|
|
94
|
+
userContext
|
|
95
|
+
}) {
|
|
96
|
+
return channelService.get(id);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
Mutation: {
|
|
100
|
+
async createChannel(src, {
|
|
101
|
+
name,
|
|
102
|
+
description,
|
|
103
|
+
type,
|
|
104
|
+
team
|
|
105
|
+
}, {
|
|
106
|
+
channelService,
|
|
107
|
+
userContext
|
|
108
|
+
}) {
|
|
109
|
+
const {
|
|
110
|
+
accountId,
|
|
111
|
+
teamId,
|
|
112
|
+
orgId
|
|
113
|
+
} = userContext;
|
|
114
|
+
const formatedName = name[0].toUpperCase() + name.slice(1).toLowerCase();
|
|
115
|
+
const title = formatedName?.replace(/-/g, ' ') ?? '';
|
|
116
|
+
const channelDetail = await channelService.getByName(userContext.teamId, title);
|
|
117
|
+
if (channelDetail) return;
|
|
118
|
+
const channel = channelService.saveChannel({
|
|
119
|
+
type: type || RoomType.Channel,
|
|
120
|
+
orgName: orgId,
|
|
121
|
+
creator: accountId,
|
|
122
|
+
title: title,
|
|
123
|
+
displayName: name?.toLowerCase(),
|
|
124
|
+
topic: name?.toLowerCase(),
|
|
125
|
+
team: team || teamId,
|
|
126
|
+
description
|
|
127
|
+
});
|
|
128
|
+
return channel;
|
|
129
|
+
},
|
|
130
|
+
addMemberToChannel(src, {
|
|
131
|
+
channelId,
|
|
132
|
+
memberId
|
|
133
|
+
}, {
|
|
134
|
+
channelService,
|
|
135
|
+
userContext
|
|
136
|
+
}) {
|
|
137
|
+
return channelService.addMemberToChannel(channelId, memberId);
|
|
138
|
+
},
|
|
139
|
+
saveMembersToChannel(src, {
|
|
140
|
+
membersId,
|
|
141
|
+
channelId
|
|
142
|
+
}, {
|
|
143
|
+
channelService,
|
|
144
|
+
userContext
|
|
145
|
+
}) {
|
|
146
|
+
return channelService.saveMembersToChannel({
|
|
147
|
+
membersId: membersId,
|
|
148
|
+
channelId
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
createDirectChannel(src, {
|
|
152
|
+
receiver,
|
|
153
|
+
displayName,
|
|
154
|
+
channelOptions
|
|
155
|
+
}, {
|
|
156
|
+
channelService,
|
|
157
|
+
userContext
|
|
158
|
+
}) {
|
|
159
|
+
const {
|
|
160
|
+
accountId,
|
|
161
|
+
orgId
|
|
162
|
+
} = userContext;
|
|
163
|
+
return channelService.createDirectChannel({
|
|
164
|
+
sender: accountId,
|
|
165
|
+
receiver: receiver,
|
|
166
|
+
displayName,
|
|
167
|
+
orgName: orgId,
|
|
168
|
+
channelOptions
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
hideChannel(src, {
|
|
172
|
+
id
|
|
173
|
+
}, {
|
|
174
|
+
channelService
|
|
175
|
+
}) {
|
|
176
|
+
return channelService.hideChannel(id);
|
|
177
|
+
},
|
|
178
|
+
leaveChannel(src, {
|
|
179
|
+
id
|
|
180
|
+
}, {
|
|
181
|
+
channelService
|
|
182
|
+
}) {
|
|
183
|
+
return channelService.leaveChannel(id);
|
|
184
|
+
},
|
|
185
|
+
deleteChannel(src, {
|
|
186
|
+
id
|
|
187
|
+
}, {
|
|
188
|
+
channelService
|
|
189
|
+
}) {
|
|
190
|
+
return channelService.deleteChannel(id);
|
|
191
|
+
},
|
|
192
|
+
viewChannel(src, {
|
|
193
|
+
id
|
|
194
|
+
}, {
|
|
195
|
+
userContext,
|
|
196
|
+
channelService
|
|
197
|
+
}) {
|
|
198
|
+
return channelService.viewChannel(id, userContext.accountId);
|
|
199
|
+
},
|
|
200
|
+
async sendNotificationOfUnreadMessages(src, {
|
|
201
|
+
unit,
|
|
202
|
+
value
|
|
203
|
+
}, {
|
|
204
|
+
messengerNotificationService
|
|
205
|
+
}) {
|
|
206
|
+
await messengerNotificationService.sendNotificationOfUnreadMessages(unit, value);
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
106
210
|
});export{channelResolvers};//# sourceMappingURL=channel.js.map
|