testeranto 0.74.0 → 0.79.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.
Files changed (136) hide show
  1. package/README.md +25 -24
  2. package/devBot.dockerfile +12 -0
  3. package/dist/common/Node.js +1 -0
  4. package/dist/common/PM/index.js +0 -64
  5. package/dist/common/PM/main.js +278 -7
  6. package/dist/common/PM/node.js +4 -0
  7. package/dist/common/PM/web.js +3 -0
  8. package/dist/common/Project.js +6 -2
  9. package/dist/common/Puppeteer.js +12 -17
  10. package/dist/common/Reporter.js +1 -8
  11. package/dist/common/SubPackages/react-dom/component/web.js +5 -25
  12. package/dist/common/SubPackages/react-dom/jsx/web.js +80 -55
  13. package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -86
  14. package/dist/common/SubPackages/react-test-renderer/component/interface.js +68 -0
  15. package/dist/common/SubPackages/react-test-renderer/component/node.js +2 -2
  16. package/dist/common/SubPackages/react-test-renderer/component/web.js +2 -2
  17. package/dist/common/TaskManBackEnd.js +156 -0
  18. package/dist/common/Types.js +0 -2
  19. package/dist/common/esbuildConfigs/index.js +1 -0
  20. package/dist/common/esbuildConfigs/inputFilesPlugin.js +49 -0
  21. package/dist/common/esbuildConfigs/node.js +3 -1
  22. package/dist/common/esbuildConfigs/web.js +3 -1
  23. package/dist/common/lib/abstractBase.js +222 -17
  24. package/dist/common/lib/basebuilder.js +4 -38
  25. package/dist/common/lib/classBuilder.js +1 -3
  26. package/dist/common/lib/core.js +3 -5
  27. package/dist/common/mongooseSchemas.js +56 -0
  28. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  29. package/dist/common/utils.js +16 -0
  30. package/dist/module/ExampleTab.js +112 -0
  31. package/dist/module/Node.js +1 -0
  32. package/dist/module/PM/index.js +0 -64
  33. package/dist/module/PM/main.js +278 -7
  34. package/dist/module/PM/node.js +4 -0
  35. package/dist/module/PM/web.js +3 -0
  36. package/dist/module/Project.js +6 -2
  37. package/dist/module/Puppeteer.js +12 -17
  38. package/dist/module/Reporter.js +1 -8
  39. package/dist/module/SubPackages/react-dom/component/web.js +5 -25
  40. package/dist/module/SubPackages/react-dom/jsx/web.js +80 -55
  41. package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -59
  42. package/dist/module/SubPackages/react-test-renderer/component/interface.js +39 -0
  43. package/dist/module/SubPackages/react-test-renderer/component/node.js +1 -1
  44. package/dist/module/SubPackages/react-test-renderer/component/web.js +1 -1
  45. package/dist/module/TaskManBackEnd.js +151 -0
  46. package/dist/module/TaskManFrontEnd.js +600 -0
  47. package/dist/module/Types.js +0 -2
  48. package/dist/module/esbuildConfigs/index.js +1 -0
  49. package/dist/module/esbuildConfigs/inputFilesPlugin.js +44 -0
  50. package/dist/module/esbuildConfigs/node.js +3 -1
  51. package/dist/module/esbuildConfigs/web.js +3 -1
  52. package/dist/module/lib/abstractBase.js +222 -17
  53. package/dist/module/lib/basebuilder.js +4 -38
  54. package/dist/module/lib/classBuilder.js +1 -3
  55. package/dist/module/lib/core.js +3 -5
  56. package/dist/module/mongooseSchemas.js +50 -0
  57. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  58. package/dist/module/utils.js +9 -0
  59. package/dist/prebuild/Report.js +117 -36
  60. package/dist/prebuild/TaskManBackEnd.mjs +185 -0
  61. package/dist/prebuild/TaskManFrontEnd.css +12301 -0
  62. package/dist/prebuild/TaskManFrontEnd.js +81737 -0
  63. package/dist/types/Node.d.ts +1 -1
  64. package/dist/types/PM/index.d.ts +2 -1
  65. package/dist/types/PM/main.d.ts +8 -3
  66. package/dist/types/PM/node.d.ts +2 -0
  67. package/dist/types/PM/web.d.ts +1 -0
  68. package/dist/types/SubPackages/puppeteer.d.ts +1 -1
  69. package/dist/types/SubPackages/react/component/node.d.ts +1 -1
  70. package/dist/types/SubPackages/react/component/web.d.ts +1 -1
  71. package/dist/types/SubPackages/react/jsx/node.d.ts +2 -2
  72. package/dist/types/SubPackages/react/jsx/web.d.ts +2 -2
  73. package/dist/types/SubPackages/react-dom/component/node.d.ts +2 -2
  74. package/dist/types/SubPackages/react-dom/component/web.d.ts +8 -2
  75. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +2 -2
  76. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +2 -2
  77. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +2 -2
  78. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +0 -7
  79. package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
  80. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +1 -2
  81. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +1 -2
  82. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +1 -1
  83. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +1 -1
  84. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +1 -2
  85. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +1 -2
  86. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +1 -2
  87. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +1 -2
  88. package/dist/types/TaskManBackEnd.d.ts +1 -0
  89. package/dist/types/Types.d.ts +19 -19
  90. package/dist/types/Web.d.ts +1 -1
  91. package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
  92. package/dist/types/lib/abstractBase.d.ts +8 -8
  93. package/dist/types/lib/basebuilder.d.ts +1 -1
  94. package/dist/types/lib/classBuilder.d.ts +1 -1
  95. package/dist/types/lib/core.d.ts +1 -1
  96. package/dist/types/lib/index.d.ts +5 -5
  97. package/dist/types/lib/types.d.ts +15 -13
  98. package/dist/types/mongooseSchemas.d.ts +124 -0
  99. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  100. package/dist/types/utils.d.ts +2 -0
  101. package/docker-compose-dev.yml +9 -0
  102. package/docker-compose-prod.yml +18 -0
  103. package/package.json +20 -7
  104. package/src/ExampleTab.tsx +219 -0
  105. package/src/Node.ts +31 -2
  106. package/src/PM/index.ts +6 -83
  107. package/src/PM/main.ts +389 -11
  108. package/src/PM/node.ts +6 -0
  109. package/src/PM/web.ts +4 -0
  110. package/src/Project.ts +10 -2
  111. package/src/Puppeteer.ts +16 -17
  112. package/src/Report.tsx +17 -40
  113. package/src/Reporter.ts +1 -9
  114. package/src/SubPackages/react-dom/component/web.ts +10 -30
  115. package/src/SubPackages/react-dom/jsx/web.ts +111 -74
  116. package/src/SubPackages/react-test-renderer/component/index.ts +0 -66
  117. package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
  118. package/src/SubPackages/react-test-renderer/component/node.ts +2 -1
  119. package/src/SubPackages/react-test-renderer/component/web.ts +2 -1
  120. package/src/TaskManBackEnd.ts +200 -0
  121. package/src/TaskManFrontEnd.tsx +1222 -0
  122. package/src/Types.ts +136 -28
  123. package/src/Web.ts +32 -2
  124. package/src/esbuildConfigs/index.ts +1 -0
  125. package/src/esbuildConfigs/inputFilesPlugin.ts +65 -0
  126. package/src/esbuildConfigs/node.ts +3 -1
  127. package/src/esbuildConfigs/web.ts +4 -0
  128. package/src/lib/abstractBase.ts +337 -34
  129. package/src/lib/basebuilder.ts +17 -52
  130. package/src/lib/classBuilder.ts +14 -2
  131. package/src/lib/core.ts +18 -7
  132. package/src/lib/index.ts +115 -7
  133. package/src/lib/types.ts +143 -35
  134. package/src/mongooseSchemas.ts +105 -0
  135. package/src/utils.ts +15 -0
  136. package/yarn-error.log +3144 -0
package/src/lib/index.ts CHANGED
@@ -12,7 +12,22 @@ import { ITestInterface } from "./types.js";
12
12
 
13
13
  // import { INodeUtils, ITestInterface, IUtils, IWebUtils } from "./types.js";
14
14
 
15
- export const BaseTestInterface: ITestInterface<IBaseTest> = {
15
+ export const BaseTestInterface: ITestInterface<
16
+ IBaseTest<
17
+ unknown,
18
+ unknown,
19
+ unknown,
20
+ unknown,
21
+ unknown,
22
+ unknown,
23
+ unknown,
24
+ Record<string, any>,
25
+ Record<string, any>,
26
+ Record<string, any>,
27
+ Record<string, any>,
28
+ Record<string, any>
29
+ >
30
+ > = {
16
31
  beforeAll: async (s) => s,
17
32
  beforeEach: async function (
18
33
  subject: any,
@@ -24,8 +39,39 @@ export const BaseTestInterface: ITestInterface<IBaseTest> = {
24
39
  return subject as any;
25
40
  },
26
41
  afterEach: async (s) => s,
27
- afterAll: (store: IBaseTest["istore"]) => undefined,
28
- butThen: async (store: IBaseTest["istore"], thenCb) => thenCb(store),
42
+ afterAll: (
43
+ store: IBaseTest<
44
+ unknown,
45
+ unknown,
46
+ unknown,
47
+ unknown,
48
+ unknown,
49
+ unknown,
50
+ unknown,
51
+ Record<string, any>,
52
+ Record<string, any>,
53
+ Record<string, any>,
54
+ Record<string, any>,
55
+ Record<string, any>
56
+ >["istore"]
57
+ ) => undefined,
58
+ butThen: async (
59
+ store: IBaseTest<
60
+ unknown,
61
+ unknown,
62
+ unknown,
63
+ unknown,
64
+ unknown,
65
+ unknown,
66
+ unknown,
67
+ Record<string, any>,
68
+ Record<string, any>,
69
+ Record<string, any>,
70
+ Record<string, any>,
71
+ Record<string, any>
72
+ >["istore"],
73
+ thenCb
74
+ ) => thenCb(store),
29
75
  andWhen: (a) => a,
30
76
  assertThis: () => null,
31
77
  };
@@ -73,8 +119,38 @@ export type ITestArtificer = (key: string, data: any) => void;
73
119
  type ITest = {
74
120
  toObj(): object;
75
121
  name: string;
76
- givens: IGivens<IBaseTest>;
77
- checks: BaseCheck<IBaseTest>[];
122
+ givens: IGivens<
123
+ IBaseTest<
124
+ unknown,
125
+ unknown,
126
+ unknown,
127
+ unknown,
128
+ unknown,
129
+ unknown,
130
+ unknown,
131
+ Record<string, any>,
132
+ Record<string, any>,
133
+ Record<string, any>,
134
+ Record<string, any>,
135
+ Record<string, any>
136
+ >
137
+ >;
138
+ checks: BaseCheck<
139
+ IBaseTest<
140
+ unknown,
141
+ unknown,
142
+ unknown,
143
+ unknown,
144
+ unknown,
145
+ unknown,
146
+ unknown,
147
+ Record<string, any>,
148
+ Record<string, any>,
149
+ Record<string, any>,
150
+ Record<string, any>,
151
+ Record<string, any>
152
+ >
153
+ >[];
78
154
  testResourceConfiguration: ITTestResourceConfiguration;
79
155
  };
80
156
 
@@ -84,7 +160,24 @@ export type ITestJob<T = PM> = {
84
160
  runner: (
85
161
  x: ITTestResourceConfiguration,
86
162
  t: ITLog
87
- ) => Promise<BaseSuite<IBaseTest>>;
163
+ ) => Promise<
164
+ BaseSuite<
165
+ IBaseTest<
166
+ unknown,
167
+ unknown,
168
+ unknown,
169
+ unknown,
170
+ unknown,
171
+ unknown,
172
+ unknown,
173
+ Record<string, any>,
174
+ Record<string, any>,
175
+ Record<string, any>,
176
+ Record<string, any>,
177
+ Record<string, any>
178
+ >
179
+ >
180
+ >;
88
181
  testResourceRequirement: ITTestResourceRequirement;
89
182
  receiveTestResourceConfig: (pm: PM) => Promise<{
90
183
  failed: number;
@@ -101,7 +194,22 @@ export const defaultTestResourceRequirement: ITTestResourceRequest = {
101
194
 
102
195
  export type ITestArtifactory = (key: string, value: unknown) => unknown;
103
196
 
104
- export type ITestCheckCallback<ITestShape extends IBaseTest> = {
197
+ export type ITestCheckCallback<
198
+ ITestShape extends IBaseTest<
199
+ unknown,
200
+ unknown,
201
+ unknown,
202
+ unknown,
203
+ unknown,
204
+ unknown,
205
+ unknown,
206
+ Record<string, any>,
207
+ Record<string, any>,
208
+ Record<string, any>,
209
+ Record<string, any>,
210
+ Record<string, any>
211
+ >
212
+ > = {
105
213
  [K in keyof ITestShape["checks"]]: (
106
214
  name: string,
107
215
  features: string[],
package/src/lib/types.ts CHANGED
@@ -20,6 +20,7 @@ export type IJsonConfig = {
20
20
  outdir: string;
21
21
  tests: ITestTypes[];
22
22
  features: string;
23
+ botEmail: string;
23
24
  };
24
25
 
25
26
  export type IBaseConfig = {
@@ -35,17 +36,34 @@ export type IBaseConfig = {
35
36
  ports: string[];
36
37
  tests: ITestTypes[];
37
38
  webPlugins: any[];
39
+ botEmail: string;
38
40
  };
39
41
 
40
42
  export type IBuiltConfig = { buildDir: string } & IBaseConfig;
41
43
 
42
- export type IWebTestInterface<ITestShape extends IBaseTest> = {
44
+ export type IWebTestInterface<
45
+ ITestShape extends IBaseTest<
46
+ unknown,
47
+ unknown,
48
+ unknown,
49
+ unknown,
50
+ unknown,
51
+ unknown,
52
+ unknown,
53
+ Record<string, any>,
54
+ Record<string, any>,
55
+ Record<string, any>,
56
+ Record<string, any>,
57
+ Record<string, any>
58
+ >
59
+ > = {
43
60
  assertThis: (x: ITestShape["then"]) => void;
44
61
 
45
62
  andWhen: (
46
63
  store: ITestShape["istore"],
47
64
  whenCB: ITestShape["when"],
48
- testResource: ITTestResourceConfiguration
65
+ testResource: ITTestResourceConfiguration,
66
+ utils: PM
49
67
  ) => Promise<ITestShape["istore"]>;
50
68
  butThen: (
51
69
  store: ITestShape["istore"],
@@ -81,17 +99,34 @@ export type IWebTestInterface<ITestShape extends IBaseTest> = {
81
99
  };
82
100
  // & ITestInterface<ITestShape>;
83
101
 
84
- export type INodeTestInterface<ITestShape extends IBaseTest> = {
102
+ export type INodeTestInterface<
103
+ ITestShape extends IBaseTest<
104
+ unknown,
105
+ unknown,
106
+ unknown,
107
+ unknown,
108
+ unknown,
109
+ unknown,
110
+ unknown,
111
+ Record<string, any>,
112
+ Record<string, any>,
113
+ Record<string, any>,
114
+ Record<string, any>,
115
+ Record<string, any>
116
+ >
117
+ > = {
85
118
  assertThis: (x: ITestShape["then"]) => void;
86
119
  andWhen: (
87
120
  store: ITestShape["istore"],
88
121
  whenCB: ITestShape["when"],
89
- testResource: ITTestResourceConfiguration
122
+ testResource: ITTestResourceConfiguration,
123
+ utils: PM
90
124
  ) => Promise<ITestShape["istore"]>;
91
125
  butThen: (
92
126
  store: ITestShape["istore"],
93
127
  thenCB,
94
- testResource: ITTestResourceConfiguration
128
+ testResource: ITTestResourceConfiguration,
129
+ utils: PM
95
130
  ) => Promise<ITestShape["iselection"]>;
96
131
  afterAll: (
97
132
  store: ITestShape["istore"],
@@ -115,13 +150,28 @@ export type INodeTestInterface<ITestShape extends IBaseTest> = {
115
150
  initializer: (c?) => ITestShape["given"],
116
151
  artificer: ITestArtificer,
117
152
  testResource: ITTestResourceConfiguration,
118
- initialValues
119
- // utils: IUtils
153
+ initialValues,
154
+ pm: PM
120
155
  ) => Promise<ITestShape["istore"]>;
121
156
  };
122
157
  // & ITestInterface<ITestShape>;
123
158
 
124
- export type ITestInterface<ITestShape extends IBaseTest> = {
159
+ export type ITestInterface<
160
+ ITestShape extends IBaseTest<
161
+ unknown,
162
+ unknown,
163
+ unknown,
164
+ unknown,
165
+ unknown,
166
+ unknown,
167
+ unknown,
168
+ Record<string, any>,
169
+ Record<string, any>,
170
+ Record<string, any>,
171
+ Record<string, any>,
172
+ Record<string, any>
173
+ >
174
+ > = {
125
175
  assertThis: (x: ITestShape["then"]) => void;
126
176
 
127
177
  andWhen: (
@@ -133,7 +183,8 @@ export type ITestInterface<ITestShape extends IBaseTest> = {
133
183
  butThen: (
134
184
  store: ITestShape["istore"],
135
185
  thenCB,
136
- testResource: ITTestResourceConfiguration
186
+ testResource: ITTestResourceConfiguration,
187
+ pm: PM
137
188
  ) => Promise<ITestShape["iselection"]>;
138
189
 
139
190
  afterAll: (
@@ -163,35 +214,92 @@ export type ITestInterface<ITestShape extends IBaseTest> = {
163
214
  ) => Promise<ITestShape["istore"]>;
164
215
  };
165
216
 
166
- export type ISuiteKlasser<ITestShape extends IBaseTest> = (
217
+ export type ISuiteKlasser<
218
+ ITestShape extends IBaseTest<
219
+ unknown,
220
+ unknown,
221
+ unknown,
222
+ unknown,
223
+ unknown,
224
+ unknown,
225
+ unknown,
226
+ Record<string, any>,
227
+ Record<string, any>,
228
+ Record<string, any>,
229
+ Record<string, any>,
230
+ Record<string, any>
231
+ >
232
+ > = (
167
233
  name: string,
168
234
  index: number,
169
235
  givens: IGivens<ITestShape>,
170
236
  checks: BaseCheck<ITestShape>[]
171
237
  ) => BaseSuite<ITestShape>;
172
238
 
173
- export type IGivenKlasser<ITestShape extends IBaseTest> = (
174
- name,
175
- features,
176
- whens,
177
- thens,
178
- givenCB
179
- ) => BaseGiven<ITestShape>;
180
-
181
- export type IWhenKlasser<ITestShape extends IBaseTest> = (
182
- s,
183
- o
184
- ) => BaseWhen<ITestShape>;
185
-
186
- export type IThenKlasser<ITestShape extends IBaseTest> = (
187
- s,
188
- o
189
- ) => BaseThen<ITestShape>;
190
-
191
- export type ICheckKlasser<ITestShape extends IBaseTest> = (
192
- n,
193
- f,
194
- cb,
195
- w,
196
- t
197
- ) => BaseCheck<ITestShape>;
239
+ export type IGivenKlasser<
240
+ ITestShape extends IBaseTest<
241
+ unknown,
242
+ unknown,
243
+ unknown,
244
+ unknown,
245
+ unknown,
246
+ unknown,
247
+ unknown,
248
+ Record<string, any>,
249
+ Record<string, any>,
250
+ Record<string, any>,
251
+ Record<string, any>,
252
+ Record<string, any>
253
+ >
254
+ > = (name, features, whens, thens, givenCB) => BaseGiven<ITestShape>;
255
+
256
+ export type IWhenKlasser<
257
+ ITestShape extends IBaseTest<
258
+ unknown,
259
+ unknown,
260
+ unknown,
261
+ unknown,
262
+ unknown,
263
+ unknown,
264
+ unknown,
265
+ Record<string, any>,
266
+ Record<string, any>,
267
+ Record<string, any>,
268
+ Record<string, any>,
269
+ Record<string, any>
270
+ >
271
+ > = (s, o) => BaseWhen<ITestShape>;
272
+
273
+ export type IThenKlasser<
274
+ ITestShape extends IBaseTest<
275
+ unknown,
276
+ unknown,
277
+ unknown,
278
+ unknown,
279
+ unknown,
280
+ unknown,
281
+ unknown,
282
+ Record<string, any>,
283
+ Record<string, any>,
284
+ Record<string, any>,
285
+ Record<string, any>,
286
+ Record<string, any>
287
+ >
288
+ > = (s, o) => BaseThen<ITestShape>;
289
+
290
+ export type ICheckKlasser<
291
+ ITestShape extends IBaseTest<
292
+ unknown,
293
+ unknown,
294
+ unknown,
295
+ unknown,
296
+ unknown,
297
+ unknown,
298
+ unknown,
299
+ Record<string, any>,
300
+ Record<string, any>,
301
+ Record<string, any>,
302
+ Record<string, any>,
303
+ Record<string, any>
304
+ >
305
+ > = (n, f, cb, w, t) => BaseCheck<ITestShape>;
@@ -0,0 +1,105 @@
1
+ import mongoose from "mongoose";
2
+
3
+ export interface IUser {
4
+ email: string;
5
+ channels: string[];
6
+ dmgroups: string[];
7
+ }
8
+
9
+ export const userSchema = new mongoose.Schema<IUser>({
10
+ email: String,
11
+ channels: [{ type: mongoose.Schema.Types.ObjectId, ref: "Channel" }],
12
+ dmgroups: [{ type: mongoose.Schema.Types.ObjectId, ref: "Dmgroup" }],
13
+ });
14
+
15
+ userSchema.virtual("features", {
16
+ ref: "Feature",
17
+ localField: "_id",
18
+ foreignField: "owner",
19
+ });
20
+
21
+ export interface IKanban {
22
+ title: string;
23
+ }
24
+
25
+ export const kanbanSchema = new mongoose.Schema<IKanban>({
26
+ title: String,
27
+ });
28
+
29
+ export interface IGantt {
30
+ name: string;
31
+ type: "task" | "milestone" | "project";
32
+ start: Date;
33
+ end: Date;
34
+ }
35
+
36
+ export const ganttSchema = new mongoose.Schema<IGantt>({
37
+ name: String,
38
+ type: String,
39
+ start: Date,
40
+ end: Date,
41
+ });
42
+
43
+ export interface IFeature {
44
+ title: string;
45
+ state: string;
46
+ owner: {
47
+ type: mongoose.Schema.Types.ObjectId;
48
+ required: true;
49
+ ref: "User";
50
+ };
51
+ }
52
+
53
+ export const featuresSchema = new mongoose.Schema<IFeature>({
54
+ title: String,
55
+ state: String,
56
+ });
57
+
58
+ export const channelsFeature = new mongoose.Schema<IChatChannel>({});
59
+
60
+ export const chatCatMessageSchema = new mongoose.Schema({
61
+ user: {
62
+ type: mongoose.Schema.Types.ObjectId,
63
+ ref: "User",
64
+ required: true,
65
+ },
66
+ room: {
67
+ type: mongoose.Schema.Types.ObjectId,
68
+ ref: "ChatCatRoom",
69
+ required: true,
70
+ maxlength: 100,
71
+ },
72
+ timestamp: {
73
+ type: Date,
74
+ default: Date.now(),
75
+ },
76
+ text: {
77
+ type: String,
78
+ maxlength: 1000,
79
+ },
80
+ });
81
+
82
+ // A channel is a base type, extended by both a huddle and room
83
+ export interface IChatChannel {
84
+ users: string[];
85
+ messages: [{ type: mongoose.Schema.Types.ObjectId; ref: "Message" }];
86
+ }
87
+
88
+ export interface IChatCatHuddle {
89
+ users: {
90
+ type: String;
91
+ unique: true;
92
+ required: true;
93
+ }[];
94
+ }
95
+
96
+ export const HuddleSchema = new mongoose.Schema<IChatCatHuddle>({});
97
+
98
+ // a room is just a channel with a name
99
+ export interface IChatCatRoom {
100
+ name: string;
101
+ }
102
+
103
+ export const RoomSchema = new mongoose.Schema<IChatCatRoom>({
104
+ name: { type: String, required: true },
105
+ });
package/src/utils.ts ADDED
@@ -0,0 +1,15 @@
1
+ // import { configs } from "eslint-plugin-react";
2
+ import path from "path";
3
+ import { IBuiltConfig, IRunTime } from "./lib/types";
4
+
5
+ export const destinationOfRuntime = (
6
+ f: string,
7
+ r: IRunTime,
8
+ configs: IBuiltConfig
9
+ ) => {
10
+ return path
11
+ .normalize(`${configs.buildDir}/${r}/${f}`)
12
+ .split(".")
13
+ .slice(0, -1)
14
+ .join(".");
15
+ };