@messenger-box/platform-client 0.0.1-alpha.134
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/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/jest.config.js +24 -0
- package/lib/graphql/id-generation.d.ts +14 -0
- package/lib/graphql/index.d.ts +4 -0
- package/lib/graphql/policies/channel-policies.d.ts +2 -0
- package/lib/graphql/policies/index.d.ts +3 -0
- package/lib/graphql/policies/posts-policies.d.ts +2 -0
- package/lib/graphql/policies/user-policies.d.ts +2 -0
- package/lib/graphql/schema/index.d.ts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +500 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/index.d.ts +3 -0
- package/package.json +60 -0
- package/src/graphql/fragments/configuration.gql +12 -0
- package/src/graphql/fragments/post-message.gql +42 -0
- package/src/graphql/id-generation.ts +8 -0
- package/src/graphql/index.ts +7 -0
- package/src/graphql/mutations/channel-mutation.gql +44 -0
- package/src/graphql/mutations/messages-mutation.gql +66 -0
- package/src/graphql/policies/channel-policies.ts +7 -0
- package/src/graphql/policies/index.ts +3 -0
- package/src/graphql/policies/posts-policies.ts +110 -0
- package/src/graphql/policies/user-policies.ts +32 -0
- package/src/graphql/queries/channel.gql +28 -0
- package/src/graphql/queries/post-message.gql +8 -0
- package/src/graphql/queries/users.gql +32 -0
- package/src/graphql/schema/index.ts +4 -0
- package/src/graphql/schema/post.graphql +44 -0
- package/src/graphql/schema/services.graphql +6 -0
- package/src/index.tsx +3 -0
- package/src/inversify-containers/index.ts +1 -0
- package/src/inversify-containers/module.ts +4 -0
- package/src/packages/constants/constants.ts +1831 -0
- package/src/packages/types/channels.ts +194 -0
- package/src/packages/types/emojis.ts +41 -0
- package/src/packages/types/files.ts +43 -0
- package/src/packages/types/posts.ts +155 -0
- package/src/packages/types/reactions.ts +8 -0
- package/src/packages/types/teams.ts +108 -0
- package/src/packages/types/utilities.ts +30 -0
- package/src/services/index.ts +0 -0
- package/src/utils/constants.tsx +1120 -0
- package/src/utils/i18n.tsx +15 -0
- package/src/utils/index.ts +34 -0
- package/src/utils/post_list.ts +54 -0
- package/src/utils/post_utils.ts +33 -0
- package/src/utils/user_agent.tsx +153 -0
- package/src/utils/utils.tsx +54 -0
- package/tsconfig.json +18 -0
- package/webpack.config.js +58 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [0.0.1-alpha.134](https://github.com/cdmbase/messenger-box/compare/v0.0.1-alpha.133...v0.0.1-alpha.134) (2022-02-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @messenger-box/platform-client
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 CDMBase LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const merge = require('merge');
|
|
2
|
+
const baseConfig = require('../../../jest.config.base');
|
|
3
|
+
|
|
4
|
+
const mergeData = merge.recursive(
|
|
5
|
+
baseConfig,
|
|
6
|
+
{
|
|
7
|
+
testEnvironment: 'jsdom',
|
|
8
|
+
transform: {
|
|
9
|
+
'\\.(js|jsx)?$': '../../../transform.js',
|
|
10
|
+
},
|
|
11
|
+
moduleNameMapper: {
|
|
12
|
+
'^__mocks__/(.*)$': '<rootDir>/../../__mocks__/$1',
|
|
13
|
+
// we'll use commonjs version of lodash for tests 👌
|
|
14
|
+
// because we don't need to use any kind of tree shaking right?!
|
|
15
|
+
'^lodash-es$': '<rootDir>/../../../node_modules/lodash/index.js',
|
|
16
|
+
},
|
|
17
|
+
roots: ['src'],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
globals: {},
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
module.exports = mergeData;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const dataIdFromObject: {
|
|
2
|
+
Post: ({ id }: {
|
|
3
|
+
id: any;
|
|
4
|
+
}) => string;
|
|
5
|
+
Channel: ({ id }: {
|
|
6
|
+
id: any;
|
|
7
|
+
}) => string;
|
|
8
|
+
ChannelMember: ({ id }: {
|
|
9
|
+
id: any;
|
|
10
|
+
}) => string;
|
|
11
|
+
UserAccount: ({ id }: {
|
|
12
|
+
id: any;
|
|
13
|
+
}) => string;
|
|
14
|
+
};
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
module.exports =
|
|
2
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
+
/******/ // The module cache
|
|
4
|
+
/******/ var installedModules = {};
|
|
5
|
+
/******/
|
|
6
|
+
/******/ // The require function
|
|
7
|
+
/******/ function __webpack_require__(moduleId) {
|
|
8
|
+
/******/
|
|
9
|
+
/******/ // Check if module is in cache
|
|
10
|
+
/******/ if(installedModules[moduleId]) {
|
|
11
|
+
/******/ return installedModules[moduleId].exports;
|
|
12
|
+
/******/ }
|
|
13
|
+
/******/ // Create a new module (and put it into the cache)
|
|
14
|
+
/******/ var module = installedModules[moduleId] = {
|
|
15
|
+
/******/ i: moduleId,
|
|
16
|
+
/******/ l: false,
|
|
17
|
+
/******/ exports: {}
|
|
18
|
+
/******/ };
|
|
19
|
+
/******/
|
|
20
|
+
/******/ // Execute the module function
|
|
21
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
+
/******/
|
|
23
|
+
/******/ // Flag the module as loaded
|
|
24
|
+
/******/ module.l = true;
|
|
25
|
+
/******/
|
|
26
|
+
/******/ // Return the exports of the module
|
|
27
|
+
/******/ return module.exports;
|
|
28
|
+
/******/ }
|
|
29
|
+
/******/
|
|
30
|
+
/******/
|
|
31
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
+
/******/ __webpack_require__.m = modules;
|
|
33
|
+
/******/
|
|
34
|
+
/******/ // expose the module cache
|
|
35
|
+
/******/ __webpack_require__.c = installedModules;
|
|
36
|
+
/******/
|
|
37
|
+
/******/ // define getter function for harmony exports
|
|
38
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ };
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // define __esModule on exports
|
|
45
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+
/******/ };
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // create a fake namespace object
|
|
53
|
+
/******/ // mode & 1: value is a module id, require it
|
|
54
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
+
/******/ // mode & 4: return value when already ns object
|
|
56
|
+
/******/ // mode & 8|1: behave like require
|
|
57
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
+
/******/ if(mode & 8) return value;
|
|
60
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
+
/******/ var ns = Object.create(null);
|
|
62
|
+
/******/ __webpack_require__.r(ns);
|
|
63
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
+
/******/ return ns;
|
|
66
|
+
/******/ };
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
+
/******/ __webpack_require__.n = function(module) {
|
|
70
|
+
/******/ var getter = module && module.__esModule ?
|
|
71
|
+
/******/ function getDefault() { return module['default']; } :
|
|
72
|
+
/******/ function getModuleExports() { return module; };
|
|
73
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
+
/******/ return getter;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
+
/******/
|
|
80
|
+
/******/ // __webpack_public_path__
|
|
81
|
+
/******/ __webpack_require__.p = "";
|
|
82
|
+
/******/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // Load entry module and return exports
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.tsx");
|
|
86
|
+
/******/ })
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ ({
|
|
89
|
+
|
|
90
|
+
/***/ "./src/graphql/id-generation.ts":
|
|
91
|
+
/*!**************************************!*\
|
|
92
|
+
!*** ./src/graphql/id-generation.ts ***!
|
|
93
|
+
\**************************************/
|
|
94
|
+
/*! no static exports found */
|
|
95
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
96
|
+
|
|
97
|
+
"use strict";
|
|
98
|
+
|
|
99
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
100
|
+
exports.dataIdFromObject = void 0;
|
|
101
|
+
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
102
|
+
exports.dataIdFromObject = {
|
|
103
|
+
[core_1.IClientCacheTypeNames.Post]: ({ id }) => `${core_1.IClientCacheTypeNames.Post}:${id}`,
|
|
104
|
+
[core_1.IClientCacheTypeNames.Channel]: ({ id }) => `${core_1.IClientCacheTypeNames.Channel}:${id}`,
|
|
105
|
+
[core_1.IClientCacheTypeNames.ChannelMember]: ({ id }) => `${core_1.IClientCacheTypeNames.ChannelMember}:${id}`,
|
|
106
|
+
[core_1.IClientCacheTypeNames.UserAccount]: ({ id }) => `${core_1.IClientCacheTypeNames.UserAccount}:${id}`,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
/***/ }),
|
|
111
|
+
|
|
112
|
+
/***/ "./src/graphql/index.ts":
|
|
113
|
+
/*!******************************!*\
|
|
114
|
+
!*** ./src/graphql/index.ts ***!
|
|
115
|
+
\******************************/
|
|
116
|
+
/*! no static exports found */
|
|
117
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
118
|
+
|
|
119
|
+
"use strict";
|
|
120
|
+
|
|
121
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
122
|
+
if (k2 === undefined) k2 = k;
|
|
123
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
124
|
+
}) : (function(o, m, k, k2) {
|
|
125
|
+
if (k2 === undefined) k2 = k;
|
|
126
|
+
o[k2] = m[k];
|
|
127
|
+
}));
|
|
128
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
129
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
130
|
+
};
|
|
131
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
132
|
+
exports.typePolicies = exports.schema = void 0;
|
|
133
|
+
const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
|
|
134
|
+
const policies_1 = __webpack_require__(/*! ./policies */ "./src/graphql/policies/index.ts");
|
|
135
|
+
const schema_1 = __webpack_require__(/*! ./schema */ "./src/graphql/schema/index.ts");
|
|
136
|
+
Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return schema_1.schema; } });
|
|
137
|
+
const typePolicies = lodash_1.merge({}, policies_1.postPolicies, policies_1.userPolicies, policies_1.channelPolicies);
|
|
138
|
+
exports.typePolicies = typePolicies;
|
|
139
|
+
__exportStar(__webpack_require__(/*! ./id-generation */ "./src/graphql/id-generation.ts"), exports);
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
/***/ }),
|
|
143
|
+
|
|
144
|
+
/***/ "./src/graphql/policies/channel-policies.ts":
|
|
145
|
+
/*!**************************************************!*\
|
|
146
|
+
!*** ./src/graphql/policies/channel-policies.ts ***!
|
|
147
|
+
\**************************************************/
|
|
148
|
+
/*! no static exports found */
|
|
149
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
150
|
+
|
|
151
|
+
"use strict";
|
|
152
|
+
|
|
153
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
154
|
+
exports.channelPolicies = void 0;
|
|
155
|
+
exports.channelPolicies = {
|
|
156
|
+
Query: {
|
|
157
|
+
fields: {},
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
/***/ }),
|
|
163
|
+
|
|
164
|
+
/***/ "./src/graphql/policies/index.ts":
|
|
165
|
+
/*!***************************************!*\
|
|
166
|
+
!*** ./src/graphql/policies/index.ts ***!
|
|
167
|
+
\***************************************/
|
|
168
|
+
/*! no static exports found */
|
|
169
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
170
|
+
|
|
171
|
+
"use strict";
|
|
172
|
+
|
|
173
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
174
|
+
if (k2 === undefined) k2 = k;
|
|
175
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
176
|
+
}) : (function(o, m, k, k2) {
|
|
177
|
+
if (k2 === undefined) k2 = k;
|
|
178
|
+
o[k2] = m[k];
|
|
179
|
+
}));
|
|
180
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
181
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
182
|
+
};
|
|
183
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
184
|
+
__exportStar(__webpack_require__(/*! ./posts-policies */ "./src/graphql/policies/posts-policies.ts"), exports);
|
|
185
|
+
__exportStar(__webpack_require__(/*! ./user-policies */ "./src/graphql/policies/user-policies.ts"), exports);
|
|
186
|
+
__exportStar(__webpack_require__(/*! ./channel-policies */ "./src/graphql/policies/channel-policies.ts"), exports);
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
/***/ }),
|
|
190
|
+
|
|
191
|
+
/***/ "./src/graphql/policies/posts-policies.ts":
|
|
192
|
+
/*!************************************************!*\
|
|
193
|
+
!*** ./src/graphql/policies/posts-policies.ts ***!
|
|
194
|
+
\************************************************/
|
|
195
|
+
/*! no static exports found */
|
|
196
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
197
|
+
|
|
198
|
+
"use strict";
|
|
199
|
+
|
|
200
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
201
|
+
exports.postPolicies = void 0;
|
|
202
|
+
exports.postPolicies = {
|
|
203
|
+
Post: {
|
|
204
|
+
fields: {
|
|
205
|
+
isPinned: {
|
|
206
|
+
read() {
|
|
207
|
+
return false;
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
center: {
|
|
211
|
+
merge(existing = [], incoming) {
|
|
212
|
+
return incoming;
|
|
213
|
+
},
|
|
214
|
+
read() {
|
|
215
|
+
return true;
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
compactDisplay: {
|
|
219
|
+
merge(existing = [], incoming) {
|
|
220
|
+
return incoming;
|
|
221
|
+
},
|
|
222
|
+
read() {
|
|
223
|
+
return '';
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
isFirstReply: {
|
|
227
|
+
merge(existing = [], incoming) {
|
|
228
|
+
return incoming;
|
|
229
|
+
},
|
|
230
|
+
read() {
|
|
231
|
+
return '';
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
shouldHighlight: {
|
|
235
|
+
merge(existing = [], incoming) {
|
|
236
|
+
return incoming;
|
|
237
|
+
},
|
|
238
|
+
read() {
|
|
239
|
+
return '';
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
consecutivePostByUser: {
|
|
243
|
+
merge(existing = [], incoming) {
|
|
244
|
+
return incoming;
|
|
245
|
+
},
|
|
246
|
+
read() {
|
|
247
|
+
return '';
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
previousPostIsComment: {
|
|
251
|
+
read(_, { readField, toReference, }) {
|
|
252
|
+
const dt = readField('created_at');
|
|
253
|
+
return '';
|
|
254
|
+
},
|
|
255
|
+
merge(existing = [], incoming) {
|
|
256
|
+
return incoming;
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
isCommentMention: {
|
|
260
|
+
merge(existing = [], incoming) {
|
|
261
|
+
return incoming;
|
|
262
|
+
},
|
|
263
|
+
read() {
|
|
264
|
+
return '';
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
hasReplies: {
|
|
268
|
+
merge(existing = [], incoming) {
|
|
269
|
+
return incoming;
|
|
270
|
+
},
|
|
271
|
+
read() {
|
|
272
|
+
return '';
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
isLastPost: {
|
|
276
|
+
merge(existing = [], incoming) {
|
|
277
|
+
return incoming;
|
|
278
|
+
},
|
|
279
|
+
read() {
|
|
280
|
+
return '';
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
channelArchived: {
|
|
284
|
+
merge(existing = [], incoming) {
|
|
285
|
+
return incoming;
|
|
286
|
+
},
|
|
287
|
+
read() {
|
|
288
|
+
return '';
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
isFlagged: {
|
|
292
|
+
merge(existing = [], incoming) {
|
|
293
|
+
return incoming;
|
|
294
|
+
},
|
|
295
|
+
read() {
|
|
296
|
+
return '';
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
isCollapsedThreadsEnabled: {
|
|
300
|
+
merge(existing = [], incoming) {
|
|
301
|
+
return incoming;
|
|
302
|
+
},
|
|
303
|
+
read() {
|
|
304
|
+
return '';
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
/***/ }),
|
|
313
|
+
|
|
314
|
+
/***/ "./src/graphql/policies/user-policies.ts":
|
|
315
|
+
/*!***********************************************!*\
|
|
316
|
+
!*** ./src/graphql/policies/user-policies.ts ***!
|
|
317
|
+
\***********************************************/
|
|
318
|
+
/*! no static exports found */
|
|
319
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
320
|
+
|
|
321
|
+
"use strict";
|
|
322
|
+
|
|
323
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
324
|
+
exports.userPolicies = void 0;
|
|
325
|
+
exports.userPolicies = {
|
|
326
|
+
Query: {
|
|
327
|
+
fields: {
|
|
328
|
+
usersToChat: {
|
|
329
|
+
read(existing, { readField, args }) {
|
|
330
|
+
const allUsers = readField('getUsers');
|
|
331
|
+
return allUsers === null || allUsers === void 0 ? void 0 : allUsers.filter((usr) => {
|
|
332
|
+
const temp = readField('alias', usr);
|
|
333
|
+
if (temp.includes(args.auth0Id)) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
return true;
|
|
337
|
+
});
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
currentUser: {
|
|
341
|
+
read(existing, { readField, args }) {
|
|
342
|
+
const allUsers = readField('getUsers');
|
|
343
|
+
return allUsers === null || allUsers === void 0 ? void 0 : allUsers.filter((usr) => {
|
|
344
|
+
const temp = readField('alias', usr);
|
|
345
|
+
if (temp.includes(args.auth0Id)) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
return false;
|
|
349
|
+
})[0];
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
/***/ }),
|
|
358
|
+
|
|
359
|
+
/***/ "./src/graphql/schema/index.ts":
|
|
360
|
+
/*!*************************************!*\
|
|
361
|
+
!*** ./src/graphql/schema/index.ts ***!
|
|
362
|
+
\*************************************/
|
|
363
|
+
/*! no static exports found */
|
|
364
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
365
|
+
|
|
366
|
+
"use strict";
|
|
367
|
+
|
|
368
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
369
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
370
|
+
};
|
|
371
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
372
|
+
exports.schema = void 0;
|
|
373
|
+
const post_graphql_1 = __importDefault(__webpack_require__(/*! ./post.graphql */ "./src/graphql/schema/post.graphql"));
|
|
374
|
+
const schema = [post_graphql_1.default];
|
|
375
|
+
exports.schema = schema;
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
/***/ }),
|
|
379
|
+
|
|
380
|
+
/***/ "./src/graphql/schema/post.graphql":
|
|
381
|
+
/*!*****************************************!*\
|
|
382
|
+
!*** ./src/graphql/schema/post.graphql ***!
|
|
383
|
+
\*****************************************/
|
|
384
|
+
/*! exports provided: default */
|
|
385
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
386
|
+
|
|
387
|
+
"use strict";
|
|
388
|
+
__webpack_require__.r(__webpack_exports__);
|
|
389
|
+
/* harmony default export */ __webpack_exports__["default"] = ("\n\nextend type Post {\n isPinned: Boolean @client\n disableGroupHighlight: Boolean @client\n fromBot: Boolean @client\n\n \"\"\" Set to center the post \"\"\"\n center: Boolean @client\n\n \"\"\" Set to render post compactly \"\"\"\n compactDisplay: Boolean @client\n\n \"\"\" Set to render a preview of the parent post above this reply \"\"\"\n isFirstReply: Boolean @client\n\n \"\"\" Set to highlight the background of the post \"\"\"\n shouldHighlight: Boolean @client\n\n \"\"\" Set to render this post as if it was attached to the previous post \"\"\"\n consecutivePostByUser: Boolean @client\n\n \"\"\" Set if the previous post is a comment \"\"\"\n previousPostIsComment: Boolean @client\n\n togglePostMenu: Boolean @client\n\n \"\"\" Set to render this comment as a mention \"\"\"\n isCommentMention: Boolean @client\n\n \"\"\" If the post has replies \"\"\"\n hasReplies: Boolean @client\n\n \"\"\" To check if the current post is last in the list \"\"\"\n isLastPost: Boolean @client\n\n \"\"\" Whether or not the channel that contains this post is archived \"\"\"\n channelArchived: Boolean @client\n\n \"\"\" Set to mark the post as flagged \"\"\"\n isFlagged: Boolean @client\n\n isCollapsedThreadsEnabled: Boolean @client\n}");
|
|
390
|
+
|
|
391
|
+
/***/ }),
|
|
392
|
+
|
|
393
|
+
/***/ "./src/index.tsx":
|
|
394
|
+
/*!***********************!*\
|
|
395
|
+
!*** ./src/index.tsx ***!
|
|
396
|
+
\***********************/
|
|
397
|
+
/*! no static exports found */
|
|
398
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
399
|
+
|
|
400
|
+
"use strict";
|
|
401
|
+
|
|
402
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
403
|
+
if (k2 === undefined) k2 = k;
|
|
404
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
405
|
+
}) : (function(o, m, k, k2) {
|
|
406
|
+
if (k2 === undefined) k2 = k;
|
|
407
|
+
o[k2] = m[k];
|
|
408
|
+
}));
|
|
409
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
410
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
411
|
+
};
|
|
412
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
413
|
+
__exportStar(__webpack_require__(/*! ./graphql */ "./src/graphql/index.ts"), exports);
|
|
414
|
+
__exportStar(__webpack_require__(/*! ./utils */ "./src/utils/index.ts"), exports);
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
/***/ }),
|
|
418
|
+
|
|
419
|
+
/***/ "./src/utils/index.ts":
|
|
420
|
+
/*!****************************!*\
|
|
421
|
+
!*** ./src/utils/index.ts ***!
|
|
422
|
+
\****************************/
|
|
423
|
+
/*! no static exports found */
|
|
424
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
425
|
+
|
|
426
|
+
"use strict";
|
|
427
|
+
|
|
428
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
429
|
+
var t = {};
|
|
430
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
431
|
+
t[p] = s[p];
|
|
432
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
433
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
434
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
435
|
+
t[p[i]] = s[p[i]];
|
|
436
|
+
}
|
|
437
|
+
return t;
|
|
438
|
+
};
|
|
439
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
440
|
+
exports.getFilteredTabs = exports.getFilteredRoutes = exports.getFilteredMenus = void 0;
|
|
441
|
+
const getFilteredMenus = (accountPageStore, selectedMenu) => accountPageStore
|
|
442
|
+
.map((item) => {
|
|
443
|
+
if (selectedMenu.indexOf(item.key) !== -1) {
|
|
444
|
+
const { path, component } = item, rest = __rest(item, ["path", "component"]);
|
|
445
|
+
return {
|
|
446
|
+
[path]: Object.assign({ name: rest.tab }, rest),
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
})
|
|
450
|
+
.filter((valid) => valid);
|
|
451
|
+
exports.getFilteredMenus = getFilteredMenus;
|
|
452
|
+
const getFilteredRoutes = (accountPageStore, selectedRoutes) => accountPageStore
|
|
453
|
+
.map((item) => {
|
|
454
|
+
if (selectedRoutes.indexOf(item.key) !== -1) {
|
|
455
|
+
const { path } = item;
|
|
456
|
+
return {
|
|
457
|
+
[path]: item,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
return null;
|
|
461
|
+
})
|
|
462
|
+
.filter((valid) => valid);
|
|
463
|
+
exports.getFilteredRoutes = getFilteredRoutes;
|
|
464
|
+
const getFilteredTabs = (accountPageStore, selectedTabs) => accountPageStore
|
|
465
|
+
.map((item) => {
|
|
466
|
+
if (selectedTabs.indexOf(item.key) !== -1) {
|
|
467
|
+
const { component } = item, rest = __rest(item, ["component"]);
|
|
468
|
+
return rest;
|
|
469
|
+
}
|
|
470
|
+
})
|
|
471
|
+
.filter((valid) => valid);
|
|
472
|
+
exports.getFilteredTabs = getFilteredTabs;
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
/***/ }),
|
|
476
|
+
|
|
477
|
+
/***/ "@messenger-box/core":
|
|
478
|
+
/*!**************************************!*\
|
|
479
|
+
!*** external "@messenger-box/core" ***!
|
|
480
|
+
\**************************************/
|
|
481
|
+
/*! no static exports found */
|
|
482
|
+
/***/ (function(module, exports) {
|
|
483
|
+
|
|
484
|
+
module.exports = require("@messenger-box/core");
|
|
485
|
+
|
|
486
|
+
/***/ }),
|
|
487
|
+
|
|
488
|
+
/***/ "lodash":
|
|
489
|
+
/*!*************************!*\
|
|
490
|
+
!*** external "lodash" ***!
|
|
491
|
+
\*************************/
|
|
492
|
+
/*! no static exports found */
|
|
493
|
+
/***/ (function(module, exports) {
|
|
494
|
+
|
|
495
|
+
module.exports = require("lodash");
|
|
496
|
+
|
|
497
|
+
/***/ })
|
|
498
|
+
|
|
499
|
+
/******/ });
|
|
500
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/graphql/id-generation.ts","webpack:///./src/graphql/index.ts","webpack:///./src/graphql/policies/channel-policies.ts","webpack:///./src/graphql/policies/index.ts","webpack:///./src/graphql/policies/posts-policies.ts","webpack:///./src/graphql/policies/user-policies.ts","webpack:///./src/graphql/schema/index.ts","webpack:///./src/graphql/schema/post.graphql","webpack:///./src/index.tsx","webpack:///./src/utils/index.ts","webpack:///external \"@messenger-box/core\"","webpack:///external \"lodash\""],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAi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M;;;;;;;;;;;;ACjClC,gD;;;;;;;;;;;ACAA,mC","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.tsx\");\n","import { IClientCacheTypeNames } from '@messenger-box/core';\n\nexport const dataIdFromObject = {\n [IClientCacheTypeNames.Post]: ({ id }) => `${IClientCacheTypeNames.Post}:${id}`,\n [IClientCacheTypeNames.Channel]: ({ id }) => `${IClientCacheTypeNames.Channel}:${id}`,\n [IClientCacheTypeNames.ChannelMember]: ({ id }) => `${IClientCacheTypeNames.ChannelMember}:${id}`,\n [IClientCacheTypeNames.UserAccount]: ({ id }) => `${IClientCacheTypeNames.UserAccount}:${id}`,\n};\n","import { merge } from 'lodash';\nimport { postPolicies, userPolicies, channelPolicies } from './policies';\nimport { schema } from './schema';\n\nconst typePolicies = merge({}, postPolicies, userPolicies, channelPolicies);\nexport { schema, typePolicies };\nexport * from './id-generation';\n","import { TypePolicies } from '@apollo/client';\n\nexport const channelPolicies: TypePolicies = {\n Query: {\n fields: {},\n },\n};\n","export * from './posts-policies';\nexport * from './user-policies';\nexport * from './channel-policies';\n","import { TypePolicies } from '@apollo/client';\n\nexport const postPolicies: TypePolicies = {\n Post: {\n fields: {\n isPinned: {\n read() {\n return false;\n },\n },\n center: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return true;\n },\n },\n compactDisplay: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n isFirstReply: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n shouldHighlight: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n consecutivePostByUser: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n previousPostIsComment: {\n read(_, { readField, toReference, }) {\n const dt = readField('created_at');\n return '';\n },\n merge(existing = [], incoming: []) {\n return incoming;\n },\n },\n isCommentMention: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n hasReplies: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n isLastPost: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n channelArchived: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n isFlagged: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n isCollapsedThreadsEnabled: {\n merge(existing = [], incoming: []) {\n return incoming;\n },\n read() {\n return '';\n },\n },\n },\n },\n};\n","import { TypePolicies } from '@apollo/client';\n\nexport const userPolicies: TypePolicies = {\n Query: {\n fields: {\n usersToChat: {\n read(existing, { readField, args }) {\n const allUsers: any = readField('getUsers');\n return allUsers?.filter((usr) => {\n const temp: any = readField('alias', usr);\n if (temp.includes(args.auth0Id)) {\n return false;\n }\n return true;\n });\n },\n },\n currentUser: {\n read(existing, { readField, args }) {\n const allUsers: any = readField('getUsers');\n return allUsers?.filter((usr) => {\n const temp: any = readField('alias', usr);\n if (temp.includes(args.auth0Id)) {\n return true;\n }\n return false;\n })[0];\n },\n },\n },\n },\n};\n","import postSchema from './post.graphql';\n\nconst schema = [postSchema];\nexport { schema };\n","export default \"\\n\\nextend type Post {\\n isPinned: Boolean @client\\n disableGroupHighlight: Boolean @client\\n fromBot: Boolean @client\\n\\n \\\"\\\"\\\" Set to center the post \\\"\\\"\\\"\\n center: Boolean @client\\n\\n \\\"\\\"\\\" Set to render post compactly \\\"\\\"\\\"\\n compactDisplay: Boolean @client\\n\\n \\\"\\\"\\\" Set to render a preview of the parent post above this reply \\\"\\\"\\\"\\n isFirstReply: Boolean @client\\n\\n \\\"\\\"\\\" Set to highlight the background of the post \\\"\\\"\\\"\\n shouldHighlight: Boolean @client\\n\\n \\\"\\\"\\\" Set to render this post as if it was attached to the previous post \\\"\\\"\\\"\\n consecutivePostByUser: Boolean @client\\n\\n \\\"\\\"\\\" Set if the previous post is a comment \\\"\\\"\\\"\\n previousPostIsComment: Boolean @client\\n\\n togglePostMenu: Boolean @client\\n\\n \\\"\\\"\\\" Set to render this comment as a mention \\\"\\\"\\\"\\n isCommentMention: Boolean @client\\n\\n \\\"\\\"\\\" If the post has replies \\\"\\\"\\\"\\n hasReplies: Boolean @client\\n\\n \\\"\\\"\\\" To check if the current post is last in the list \\\"\\\"\\\"\\n isLastPost: Boolean @client\\n\\n \\\"\\\"\\\" Whether or not the channel that contains this post is archived \\\"\\\"\\\"\\n channelArchived: Boolean @client\\n\\n \\\"\\\"\\\" Set to mark the post as flagged \\\"\\\"\\\"\\n isFlagged: Boolean @client\\n\\n isCollapsedThreadsEnabled: Boolean @client\\n}\";","\nexport * from './graphql';\nexport * from './utils';\n","export const getFilteredMenus = (accountPageStore, selectedMenu) =>\n accountPageStore\n .map((item) => {\n if (selectedMenu.indexOf(item.key) !== -1) {\n const { path, component, ...rest } = item;\n return {\n [path]: { name: rest.tab, ...rest },\n };\n }\n })\n .filter((valid) => valid);\n\nexport const getFilteredRoutes = (accountPageStore, selectedRoutes) =>\n accountPageStore\n .map((item) => {\n if (selectedRoutes.indexOf(item.key) !== -1) {\n const { path } = item;\n return {\n [path]: item,\n };\n }\n return null;\n })\n .filter((valid) => valid);\n\nexport const getFilteredTabs = (accountPageStore, selectedTabs) =>\n accountPageStore\n .map((item) => {\n if (selectedTabs.indexOf(item.key) !== -1) {\n const { component, ...rest } = item;\n return rest;\n }\n })\n .filter((valid) => valid);\n","module.exports = require(\"@messenger-box/core\");","module.exports = require(\"lodash\");"],"sourceRoot":""}
|