@builder6/server 0.2.0

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 (185) hide show
  1. package/dist/app.controller.d.ts +3 -0
  2. package/dist/app.controller.js +29 -0
  3. package/dist/app.controller.js.map +1 -0
  4. package/dist/app.express.d.ts +2 -0
  5. package/dist/app.express.js +45 -0
  6. package/dist/app.express.js.map +1 -0
  7. package/dist/app.module.d.ts +2 -0
  8. package/dist/app.module.js +48 -0
  9. package/dist/app.module.js.map +1 -0
  10. package/dist/auth/admin.guard.d.ts +8 -0
  11. package/dist/auth/admin.guard.js +47 -0
  12. package/dist/auth/admin.guard.js.map +1 -0
  13. package/dist/auth/auth.controller.d.ts +7 -0
  14. package/dist/auth/auth.controller.js +80 -0
  15. package/dist/auth/auth.controller.js.map +1 -0
  16. package/dist/auth/auth.guard.d.ts +7 -0
  17. package/dist/auth/auth.guard.js +41 -0
  18. package/dist/auth/auth.guard.js.map +1 -0
  19. package/dist/auth/auth.module.d.ts +2 -0
  20. package/dist/auth/auth.module.js +34 -0
  21. package/dist/auth/auth.module.js.map +1 -0
  22. package/dist/auth/auth.service.d.ts +22 -0
  23. package/dist/auth/auth.service.js +172 -0
  24. package/dist/auth/auth.service.js.map +1 -0
  25. package/dist/auth/index.d.ts +5 -0
  26. package/dist/auth/index.js +22 -0
  27. package/dist/auth/index.js.map +1 -0
  28. package/dist/b6.config.d.ts +0 -0
  29. package/dist/b6.config.js +6 -0
  30. package/dist/b6.config.js.map +1 -0
  31. package/dist/b6.server.d.ts +2 -0
  32. package/dist/b6.server.js +276 -0
  33. package/dist/b6.server.js.map +1 -0
  34. package/dist/files/files.controller.d.ts +8 -0
  35. package/dist/files/files.controller.js +110 -0
  36. package/dist/files/files.controller.js.map +1 -0
  37. package/dist/files/files.module.d.ts +2 -0
  38. package/dist/files/files.module.js +25 -0
  39. package/dist/files/files.module.js.map +1 -0
  40. package/dist/files/files.service.d.ts +30 -0
  41. package/dist/files/files.service.js +206 -0
  42. package/dist/files/files.service.js.map +1 -0
  43. package/dist/files/index.d.ts +3 -0
  44. package/dist/files/index.js +20 -0
  45. package/dist/files/index.js.map +1 -0
  46. package/dist/index.d.ts +5 -0
  47. package/dist/index.js +28 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/main.d.ts +1 -0
  50. package/dist/main.js +10 -0
  51. package/dist/main.js.map +1 -0
  52. package/dist/microsoft365/microsoft365.controller.d.ts +8 -0
  53. package/dist/microsoft365/microsoft365.controller.js +83 -0
  54. package/dist/microsoft365/microsoft365.controller.js.map +1 -0
  55. package/dist/microsoft365/microsoft365.module.d.ts +2 -0
  56. package/dist/microsoft365/microsoft365.module.js +22 -0
  57. package/dist/microsoft365/microsoft365.module.js.map +1 -0
  58. package/dist/microsoft365/microsoft365.service.d.ts +3 -0
  59. package/dist/microsoft365/microsoft365.service.js +32 -0
  60. package/dist/microsoft365/microsoft365.service.js.map +1 -0
  61. package/dist/moleculer/env.config.d.ts +2 -0
  62. package/dist/moleculer/env.config.js +38 -0
  63. package/dist/moleculer/env.config.js.map +1 -0
  64. package/dist/moleculer/moleculer.config.d.ts +2 -0
  65. package/dist/moleculer/moleculer.config.js +78 -0
  66. package/dist/moleculer/moleculer.config.js.map +1 -0
  67. package/dist/moleculer/moleculer.module.d.ts +2 -0
  68. package/dist/moleculer/moleculer.module.js +20 -0
  69. package/dist/moleculer/moleculer.module.js.map +1 -0
  70. package/dist/moleculer/moleculer.service.d.ts +11 -0
  71. package/dist/moleculer/moleculer.service.js +95 -0
  72. package/dist/moleculer/moleculer.service.js.map +1 -0
  73. package/dist/mongodb/index.d.ts +2 -0
  74. package/dist/mongodb/index.js +19 -0
  75. package/dist/mongodb/index.js.map +1 -0
  76. package/dist/mongodb/mongodb.module.d.ts +2 -0
  77. package/dist/mongodb/mongodb.module.js +21 -0
  78. package/dist/mongodb/mongodb.module.js.map +1 -0
  79. package/dist/mongodb/mongodb.service.d.ts +17 -0
  80. package/dist/mongodb/mongodb.service.js +113 -0
  81. package/dist/mongodb/mongodb.service.js.map +1 -0
  82. package/dist/oidc/oidc.controller.d.ts +7 -0
  83. package/dist/oidc/oidc.controller.js +93 -0
  84. package/dist/oidc/oidc.controller.js.map +1 -0
  85. package/dist/oidc/oidc.module.d.ts +2 -0
  86. package/dist/oidc/oidc.module.js +22 -0
  87. package/dist/oidc/oidc.module.js.map +1 -0
  88. package/dist/oidc/oidc.service.d.ts +15 -0
  89. package/dist/oidc/oidc.service.js +38 -0
  90. package/dist/oidc/oidc.service.js.map +1 -0
  91. package/dist/rooms/globals/augmentation.d.ts +25 -0
  92. package/dist/rooms/globals/augmentation.js +3 -0
  93. package/dist/rooms/globals/augmentation.js.map +1 -0
  94. package/dist/rooms/lib/DateToString.d.ts +3 -0
  95. package/dist/rooms/lib/DateToString.js +3 -0
  96. package/dist/rooms/lib/DateToString.js.map +1 -0
  97. package/dist/rooms/lib/Json.d.ts +9 -0
  98. package/dist/rooms/lib/Json.js +18 -0
  99. package/dist/rooms/lib/Json.js.map +1 -0
  100. package/dist/rooms/lib/utils.d.ts +33 -0
  101. package/dist/rooms/lib/utils.js +122 -0
  102. package/dist/rooms/lib/utils.js.map +1 -0
  103. package/dist/rooms/protocol/AuthToken.d.ts +50 -0
  104. package/dist/rooms/protocol/AuthToken.js +49 -0
  105. package/dist/rooms/protocol/AuthToken.js.map +1 -0
  106. package/dist/rooms/protocol/Authentication.d.ts +22 -0
  107. package/dist/rooms/protocol/Authentication.js +3 -0
  108. package/dist/rooms/protocol/Authentication.js.map +1 -0
  109. package/dist/rooms/protocol/BaseActivitiesData.d.ts +4 -0
  110. package/dist/rooms/protocol/BaseActivitiesData.js +3 -0
  111. package/dist/rooms/protocol/BaseActivitiesData.js.map +1 -0
  112. package/dist/rooms/protocol/BaseRoomInfo.d.ts +6 -0
  113. package/dist/rooms/protocol/BaseRoomInfo.js +3 -0
  114. package/dist/rooms/protocol/BaseRoomInfo.js.map +1 -0
  115. package/dist/rooms/protocol/BaseUserMeta.d.ts +10 -0
  116. package/dist/rooms/protocol/BaseUserMeta.js +3 -0
  117. package/dist/rooms/protocol/BaseUserMeta.js.map +1 -0
  118. package/dist/rooms/protocol/ClientMsg.d.ts +41 -0
  119. package/dist/rooms/protocol/ClientMsg.js +13 -0
  120. package/dist/rooms/protocol/ClientMsg.js.map +1 -0
  121. package/dist/rooms/protocol/Comments.d.ts +146 -0
  122. package/dist/rooms/protocol/Comments.js +3 -0
  123. package/dist/rooms/protocol/Comments.js.map +1 -0
  124. package/dist/rooms/protocol/InboxNotifications.d.ts +49 -0
  125. package/dist/rooms/protocol/InboxNotifications.js +3 -0
  126. package/dist/rooms/protocol/InboxNotifications.js.map +1 -0
  127. package/dist/rooms/protocol/Op.d.ts +82 -0
  128. package/dist/rooms/protocol/Op.js +28 -0
  129. package/dist/rooms/protocol/Op.js.map +1 -0
  130. package/dist/rooms/protocol/SerializedCrdt.d.ts +40 -0
  131. package/dist/rooms/protocol/SerializedCrdt.js +19 -0
  132. package/dist/rooms/protocol/SerializedCrdt.js.map +1 -0
  133. package/dist/rooms/protocol/ServerMsg.d.ts +128 -0
  134. package/dist/rooms/protocol/ServerMsg.js +25 -0
  135. package/dist/rooms/protocol/ServerMsg.js.map +1 -0
  136. package/dist/rooms/protocol/VersionHistory.d.ts +9 -0
  137. package/dist/rooms/protocol/VersionHistory.js +3 -0
  138. package/dist/rooms/protocol/VersionHistory.js.map +1 -0
  139. package/dist/rooms/rooms.controller.d.ts +64 -0
  140. package/dist/rooms/rooms.controller.js +401 -0
  141. package/dist/rooms/rooms.controller.js.map +1 -0
  142. package/dist/rooms/rooms.gateway.d.ts +30 -0
  143. package/dist/rooms/rooms.gateway.js +189 -0
  144. package/dist/rooms/rooms.gateway.js.map +1 -0
  145. package/dist/rooms/rooms.guard.d.ts +9 -0
  146. package/dist/rooms/rooms.guard.js +48 -0
  147. package/dist/rooms/rooms.guard.js.map +1 -0
  148. package/dist/rooms/rooms.module.d.ts +2 -0
  149. package/dist/rooms/rooms.module.js +36 -0
  150. package/dist/rooms/rooms.module.js.map +1 -0
  151. package/dist/rooms/rooms.service.d.ts +51 -0
  152. package/dist/rooms/rooms.service.js +223 -0
  153. package/dist/rooms/rooms.service.js.map +1 -0
  154. package/dist/steedos/mongodb.controller.d.ts +13 -0
  155. package/dist/steedos/mongodb.controller.js +355 -0
  156. package/dist/steedos/mongodb.controller.js.map +1 -0
  157. package/dist/steedos/object.service.d.ts +6 -0
  158. package/dist/steedos/object.service.js +34 -0
  159. package/dist/steedos/object.service.js.map +1 -0
  160. package/dist/steedos/steedos.module.d.ts +2 -0
  161. package/dist/steedos/steedos.module.js +27 -0
  162. package/dist/steedos/steedos.module.js.map +1 -0
  163. package/dist/tables/meta.service.d.ts +6 -0
  164. package/dist/tables/meta.service.js +82 -0
  165. package/dist/tables/meta.service.js.map +1 -0
  166. package/dist/tables/records.service.d.ts +13 -0
  167. package/dist/tables/records.service.js +73 -0
  168. package/dist/tables/records.service.js.map +1 -0
  169. package/dist/tables/tables.controller.d.ts +24 -0
  170. package/dist/tables/tables.controller.js +414 -0
  171. package/dist/tables/tables.controller.js.map +1 -0
  172. package/dist/tables/tables.module.d.ts +2 -0
  173. package/dist/tables/tables.module.js +28 -0
  174. package/dist/tables/tables.module.js.map +1 -0
  175. package/package.json +112 -0
  176. package/public/ag-grid/locale_zh.js +595 -0
  177. package/public/grid/index.html +25 -0
  178. package/public/grid/index.js +207 -0
  179. package/public/grid/styles.css +4 -0
  180. package/public/pivot/index.html +30 -0
  181. package/public/pivot/index.js +109 -0
  182. package/public/pivot/styles.css +7 -0
  183. package/views/ag-grid/README.md +15 -0
  184. package/views/ag-grid/ag-grid.hbs +1099 -0
  185. package/views/devextreme/datagrid.hbs +240 -0
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.raise = raise;
4
+ exports.isPlainObject = isPlainObject;
5
+ exports.entries = entries;
6
+ exports.keys = keys;
7
+ exports.values = values;
8
+ exports.mapValues = mapValues;
9
+ exports.tryParseJson = tryParseJson;
10
+ exports.deepClone = deepClone;
11
+ exports.b64decode = b64decode;
12
+ exports.remove = remove;
13
+ exports.compact = compact;
14
+ exports.compactObject = compactObject;
15
+ exports.wait = wait;
16
+ exports.withTimeout = withTimeout;
17
+ exports.memoizeOnSuccess = memoizeOnSuccess;
18
+ function raise(msg) {
19
+ throw new Error(msg);
20
+ }
21
+ function isPlainObject(blob) {
22
+ return (blob !== null &&
23
+ typeof blob === "object" &&
24
+ Object.prototype.toString.call(blob) === "[object Object]");
25
+ }
26
+ function entries(obj) {
27
+ return Object.entries(obj);
28
+ }
29
+ function keys(obj) {
30
+ return Object.keys(obj);
31
+ }
32
+ function values(obj) {
33
+ return Object.values(obj);
34
+ }
35
+ function mapValues(obj, mapFn) {
36
+ const result = {};
37
+ for (const pair of Object.entries(obj)) {
38
+ const key = pair[0];
39
+ if (key === "__proto__") {
40
+ continue;
41
+ }
42
+ const value = pair[1];
43
+ result[key] = mapFn(value, key);
44
+ }
45
+ return result;
46
+ }
47
+ function tryParseJson(rawMessage) {
48
+ try {
49
+ return JSON.parse(rawMessage);
50
+ }
51
+ catch (e) {
52
+ return undefined;
53
+ }
54
+ }
55
+ function deepClone(value) {
56
+ return JSON.parse(JSON.stringify(value));
57
+ }
58
+ function b64decode(b64value) {
59
+ try {
60
+ const formattedValue = b64value.replace(/-/g, "+").replace(/_/g, "/");
61
+ const decodedValue = decodeURIComponent(atob(formattedValue)
62
+ .split("")
63
+ .map(function (c) {
64
+ return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
65
+ })
66
+ .join(""));
67
+ return decodedValue;
68
+ }
69
+ catch (err) {
70
+ return atob(b64value);
71
+ }
72
+ }
73
+ function remove(array, item) {
74
+ for (let i = 0; i < array.length; i++) {
75
+ if (array[i] === item) {
76
+ array.splice(i, 1);
77
+ break;
78
+ }
79
+ }
80
+ }
81
+ function compact(items) {
82
+ return items.filter((item) => item !== null && item !== undefined);
83
+ }
84
+ function compactObject(obj) {
85
+ const newObj = { ...obj };
86
+ Object.keys(obj).forEach((k) => {
87
+ const key = k;
88
+ if (newObj[key] === undefined) {
89
+ delete newObj[key];
90
+ }
91
+ });
92
+ return newObj;
93
+ }
94
+ function wait(millis) {
95
+ return new Promise((res) => setTimeout(res, millis));
96
+ }
97
+ async function withTimeout(promise, millis, errmsg) {
98
+ let timerID;
99
+ const timer$ = new Promise((_, reject) => {
100
+ timerID = setTimeout(() => {
101
+ reject(new Error(errmsg));
102
+ }, millis);
103
+ });
104
+ return (Promise
105
+ .race([promise, timer$])
106
+ .finally(() => clearTimeout(timerID)));
107
+ }
108
+ function memoizeOnSuccess(factoryFn) {
109
+ let cached = null;
110
+ return () => {
111
+ if (cached === null) {
112
+ cached = factoryFn().catch((err) => {
113
+ setTimeout(() => {
114
+ cached = null;
115
+ }, 5_000);
116
+ throw err;
117
+ });
118
+ }
119
+ return cached;
120
+ };
121
+ }
122
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/rooms/lib/utils.ts"],"names":[],"mappings":";;AAgBA,sBAEC;AAED,sCAUC;AAKD,0BAKC;AAKD,oBAIC;AAKD,wBAIC;AAMD,8BAeC;AAMD,oCAOC;AAQD,8BAKC;AAKD,8BAgBC;AAMD,wBAOC;AAMD,0BAIC;AAUD,sCAWC;AAKD,oBAEC;AAOD,kCAoBC;AAQD,4CA2BC;AA/ND,SAAgB,KAAK,CAAC,GAAW;IAC/B,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,SAAgB,aAAa,CAC3B,IAAa;IAIb,OAAO,CACL,IAAI,KAAK,IAAI;QACb,OAAO,IAAI,KAAK,QAAQ;QACxB,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,iBAAiB,CAC3D,CAAC;AACJ,CAAC;AAKD,SAAgB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 import type { IUserInfo } from "./BaseUserMeta";
3
+ export declare enum Permission {
4
+ Read = "room:read",
5
+ Write = "room:write",
6
+ PresenceWrite = "room:presence:write",
7
+ CommentsWrite = "comments:write",
8
+ CommentsRead = "comments:read"
9
+ }
10
+ export type LiveblocksPermissions = Record<string, Permission[]>;
11
+ export declare enum TokenKind {
12
+ SECRET_LEGACY = "sec-legacy",
13
+ ACCESS_TOKEN = "acc",
14
+ ID_TOKEN = "id"
15
+ }
16
+ export declare function canWriteStorage(scopes: readonly string[]): boolean;
17
+ export declare function canComment(scopes: readonly string[]): boolean;
18
+ type JwtMeta = {
19
+ iat: number;
20
+ exp: number;
21
+ };
22
+ export type LegacySecretToken = {
23
+ k: TokenKind.SECRET_LEGACY;
24
+ roomId: string;
25
+ scopes: string[];
26
+ id?: string;
27
+ info?: IUserInfo;
28
+ [other: string]: Json | undefined;
29
+ } & JwtMeta;
30
+ export type AccessToken = {
31
+ k: TokenKind.ACCESS_TOKEN;
32
+ pid: string;
33
+ uid: string;
34
+ perms: LiveblocksPermissions;
35
+ ui?: IUserInfo;
36
+ } & JwtMeta;
37
+ export type IDToken = {
38
+ k: TokenKind.ID_TOKEN;
39
+ pid: string;
40
+ uid: string;
41
+ gids?: string[];
42
+ ui?: IUserInfo;
43
+ } & JwtMeta;
44
+ export type AuthToken = AccessToken | IDToken | LegacySecretToken;
45
+ export type ParsedAuthToken = {
46
+ readonly raw: string;
47
+ readonly parsed: AuthToken;
48
+ };
49
+ export declare function parseAuthToken(rawTokenString: string): ParsedAuthToken;
50
+ export {};
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TokenKind = exports.Permission = void 0;
4
+ exports.canWriteStorage = canWriteStorage;
5
+ exports.canComment = canComment;
6
+ exports.parseAuthToken = parseAuthToken;
7
+ const utils_1 = require("../lib/utils");
8
+ var Permission;
9
+ (function (Permission) {
10
+ Permission["Read"] = "room:read";
11
+ Permission["Write"] = "room:write";
12
+ Permission["PresenceWrite"] = "room:presence:write";
13
+ Permission["CommentsWrite"] = "comments:write";
14
+ Permission["CommentsRead"] = "comments:read";
15
+ })(Permission || (exports.Permission = Permission = {}));
16
+ var TokenKind;
17
+ (function (TokenKind) {
18
+ TokenKind["SECRET_LEGACY"] = "sec-legacy";
19
+ TokenKind["ACCESS_TOKEN"] = "acc";
20
+ TokenKind["ID_TOKEN"] = "id";
21
+ })(TokenKind || (exports.TokenKind = TokenKind = {}));
22
+ function canWriteStorage(scopes) {
23
+ return scopes.includes(Permission.Write);
24
+ }
25
+ function canComment(scopes) {
26
+ return (scopes.includes(Permission.CommentsWrite) ||
27
+ scopes.includes(Permission.Write));
28
+ }
29
+ function isValidAuthTokenPayload(data) {
30
+ return ((0, utils_1.isPlainObject)(data) &&
31
+ (data.k === TokenKind.ACCESS_TOKEN ||
32
+ data.k === TokenKind.ID_TOKEN ||
33
+ data.k === TokenKind.SECRET_LEGACY));
34
+ }
35
+ function parseAuthToken(rawTokenString) {
36
+ const tokenParts = rawTokenString.split(".");
37
+ if (tokenParts.length !== 3) {
38
+ throw new Error("Authentication error: invalid JWT token");
39
+ }
40
+ const payload = (0, utils_1.tryParseJson)((0, utils_1.b64decode)(tokenParts[1]));
41
+ if (!(payload && isValidAuthTokenPayload(payload))) {
42
+ throw new Error("Authentication error: expected a valid token but did not get one. Hint: if you are using a callback, ensure the room is passed when creating the token. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientCallback");
43
+ }
44
+ return {
45
+ raw: rawTokenString,
46
+ parsed: payload,
47
+ };
48
+ }
49
+ //# sourceMappingURL=AuthToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthToken.js","sourceRoot":"","sources":["../../../src/rooms/protocol/AuthToken.ts"],"names":[],"mappings":";;;AAwBA,0CAEC;AAED,gCAKC;AA2ED,wCAiBC;AA5HD,wCAAsE;AAGtE,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,gCAAkB,CAAA;IAClB,k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I,KAAK,CACb,+PAA+P,CAChQ,CAAC;IACJ,CAAC;IAED,OAAO;QACL,GAAG,EAAE,cAAc;QACnB,MAAM,EAAE,OAAO;KAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ export type CustomAuthenticationResult = {
2
+ token: string;
3
+ error?: never;
4
+ } | {
5
+ token?: never;
6
+ error: "forbidden";
7
+ reason: string;
8
+ } | {
9
+ token?: never;
10
+ error: string;
11
+ reason: string;
12
+ };
13
+ export type Authentication = {
14
+ type: "public";
15
+ publicApiKey: string;
16
+ } | {
17
+ type: "private";
18
+ url: string;
19
+ } | {
20
+ type: "custom";
21
+ callback: (room?: string) => Promise<CustomAuthenticationResult>;
22
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Authentication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Authentication.js","sourceRoot":"","sources":["../../../src/rooms/protocol/Authentication.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { ActivityData } from "./InboxNotifications";
2
+ export type BaseActivitiesData = {
3
+ [key: `$${string}`]: ActivityData;
4
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BaseActivitiesData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseActivitiesData.js","sourceRoot":"","sources":["../../../src/rooms/protocol/BaseActivitiesData.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Json } from "../lib/Json";
2
+ export type BaseRoomInfo = {
3
+ [key: string]: Json | undefined;
4
+ name?: string;
5
+ url?: string;
6
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BaseRoomInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseRoomInfo.js","sourceRoot":"","sources":["../../../src/rooms/protocol/BaseRoomInfo.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { Json } from "../lib/Json";
2
+ export type IUserInfo = {
3
+ [key: string]: Json | undefined;
4
+ name?: string;
5
+ avatar?: string;
6
+ };
7
+ export type BaseUserMeta = {
8
+ id?: string;
9
+ info?: IUserInfo;
10
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BaseUserMeta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseUserMeta.js","sourceRoot":"","sources":["../../../src/rooms/protocol/BaseUserMeta.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ import type { Json, JsonObject } from "../lib/Json";
2
+ import type { Op } from "./Op";
3
+ export declare enum ClientMsgCode {
4
+ UPDATE_PRESENCE = 100,
5
+ BROADCAST_EVENT = 103,
6
+ FETCH_STORAGE = 200,
7
+ UPDATE_STORAGE = 201,
8
+ FETCH_YDOC = 300,
9
+ UPDATE_YDOC = 301
10
+ }
11
+ export type ClientMsg<P extends JsonObject, E extends Json> = BroadcastEventClientMsg<E> | UpdatePresenceClientMsg<P> | UpdateStorageClientMsg | FetchStorageClientMsg | FetchYDocClientMsg | UpdateYDocClientMsg;
12
+ export type BroadcastEventClientMsg<E extends Json> = {
13
+ type: ClientMsgCode.BROADCAST_EVENT;
14
+ event: E;
15
+ };
16
+ export type UpdatePresenceClientMsg<P extends JsonObject> = {
17
+ readonly type: ClientMsgCode.UPDATE_PRESENCE;
18
+ readonly targetActor: number;
19
+ readonly data: P;
20
+ } | {
21
+ readonly type: ClientMsgCode.UPDATE_PRESENCE;
22
+ readonly targetActor?: undefined;
23
+ readonly data: Partial<P>;
24
+ };
25
+ export type UpdateStorageClientMsg = {
26
+ readonly type: ClientMsgCode.UPDATE_STORAGE;
27
+ readonly ops: Op[];
28
+ };
29
+ export type FetchStorageClientMsg = {
30
+ readonly type: ClientMsgCode.FETCH_STORAGE;
31
+ };
32
+ export type FetchYDocClientMsg = {
33
+ readonly type: ClientMsgCode.FETCH_YDOC;
34
+ readonly vector: string;
35
+ readonly guid?: string;
36
+ };
37
+ export type UpdateYDocClientMsg = {
38
+ readonly type: ClientMsgCode.UPDATE_YDOC;
39
+ readonly update: string;
40
+ readonly guid?: string;
41
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClientMsgCode = void 0;
4
+ var ClientMsgCode;
5
+ (function (ClientMsgCode) {
6
+ ClientMsgCode[ClientMsgCode["UPDATE_PRESENCE"] = 100] = "UPDATE_PRESENCE";
7
+ ClientMsgCode[ClientMsgCode["BROADCAST_EVENT"] = 103] = "BROADCAST_EVENT";
8
+ ClientMsgCode[ClientMsgCode["FETCH_STORAGE"] = 200] = "FETCH_STORAGE";
9
+ ClientMsgCode[ClientMsgCode["UPDATE_STORAGE"] = 201] = "UPDATE_STORAGE";
10
+ ClientMsgCode[ClientMsgCode["FETCH_YDOC"] = 300] = "FETCH_YDOC";
11
+ ClientMsgCode[ClientMsgCode["UPDATE_YDOC"] = 301] = "UPDATE_YDOC";
12
+ })(ClientMsgCode || (exports.ClientMsgCode = ClientMsgCode = {}));
13
+ //# sourceMappingURL=ClientMsg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientMsg.js","sourceRoot":"","sources":["../../../src/rooms/protocol/ClientMsg.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAYX;AAZD,WAAY,aAAa;IAEvB,yEAAqB,CAAA;IACrB,yEAAqB,CAAA;IAGrB,qEAAmB,CAAA;IACnB,uEAAoB,CAAA;IAGpB,+DAAgB,CAAA;IAChB,iEAAiB,CAAA;AACnB,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB"}
@@ -0,0 +1,146 @@
1
+ import type { DM } from "../globals/augmentation";
2
+ import type { DateToString } from "../lib/DateToString";
3
+ export type BaseMetadata = Record<string, string | boolean | number | undefined>;
4
+ export type CommentReaction = {
5
+ emoji: string;
6
+ createdAt: Date;
7
+ users: {
8
+ id: string;
9
+ }[];
10
+ };
11
+ export type CommentAttachment = {
12
+ type: "attachment";
13
+ id: string;
14
+ name: string;
15
+ size: number;
16
+ mimeType: string;
17
+ };
18
+ export type CommentLocalAttachmentIdle = {
19
+ type: "localAttachment";
20
+ status: "idle";
21
+ id: string;
22
+ name: string;
23
+ size: number;
24
+ mimeType: string;
25
+ file: File;
26
+ };
27
+ export type CommentLocalAttachmentUploading = {
28
+ type: "localAttachment";
29
+ status: "uploading";
30
+ id: string;
31
+ name: string;
32
+ size: number;
33
+ mimeType: string;
34
+ file: File;
35
+ };
36
+ export type CommentLocalAttachmentUploaded = {
37
+ type: "localAttachment";
38
+ status: "uploaded";
39
+ id: string;
40
+ name: string;
41
+ size: number;
42
+ mimeType: string;
43
+ file: File;
44
+ };
45
+ export type CommentLocalAttachmentError = {
46
+ type: "localAttachment";
47
+ status: "error";
48
+ id: string;
49
+ name: string;
50
+ size: number;
51
+ mimeType: string;
52
+ file: File;
53
+ error: Error;
54
+ };
55
+ export type CommentLocalAttachment = CommentLocalAttachmentIdle | CommentLocalAttachmentUploading | CommentLocalAttachmentUploaded | CommentLocalAttachmentError;
56
+ export type CommentMixedAttachment = CommentAttachment | CommentLocalAttachment;
57
+ export type CommentData = {
58
+ type: "comment";
59
+ id: string;
60
+ threadId: string;
61
+ roomId: string;
62
+ userId: string;
63
+ createdAt: Date;
64
+ editedAt?: Date;
65
+ reactions: CommentReaction[];
66
+ attachments: CommentAttachment[];
67
+ } & ({
68
+ body: CommentBody;
69
+ deletedAt?: never;
70
+ } | {
71
+ body?: never;
72
+ deletedAt: Date;
73
+ });
74
+ export type CommentDataPlain = Omit<DateToString<CommentData>, "reactions" | "body"> & {
75
+ reactions: DateToString<CommentReaction>[];
76
+ } & ({
77
+ body: CommentBody;
78
+ deletedAt?: never;
79
+ } | {
80
+ body?: never;
81
+ deletedAt: string;
82
+ });
83
+ export type CommentBodyBlockElement = CommentBodyParagraph;
84
+ export type CommentBodyInlineElement = CommentBodyText | CommentBodyMention | CommentBodyLink;
85
+ export type CommentBodyElement = CommentBodyBlockElement | CommentBodyInlineElement;
86
+ export type CommentBodyParagraph = {
87
+ type: "paragraph";
88
+ children: CommentBodyInlineElement[];
89
+ };
90
+ export type CommentBodyMention = {
91
+ type: "mention";
92
+ id: string;
93
+ };
94
+ export type CommentBodyLink = {
95
+ type: "link";
96
+ url: string;
97
+ text?: string;
98
+ };
99
+ export type CommentBodyText = {
100
+ bold?: boolean;
101
+ italic?: boolean;
102
+ strikethrough?: boolean;
103
+ code?: boolean;
104
+ text: string;
105
+ };
106
+ export type CommentBody = {
107
+ version: 1;
108
+ content: CommentBodyBlockElement[];
109
+ };
110
+ export type CommentUserReaction = {
111
+ emoji: string;
112
+ createdAt: Date;
113
+ userId: string;
114
+ };
115
+ export type CommentUserReactionPlain = DateToString<CommentUserReaction>;
116
+ export type ThreadData<M extends BaseMetadata = DM> = {
117
+ type: "thread";
118
+ id: string;
119
+ roomId: string;
120
+ createdAt: Date;
121
+ updatedAt: Date;
122
+ comments: CommentData[];
123
+ metadata: M;
124
+ resolved: boolean;
125
+ };
126
+ export interface ThreadDataWithDeleteInfo<M extends BaseMetadata = DM> extends ThreadData<M> {
127
+ deletedAt?: Date;
128
+ }
129
+ export type ThreadDataPlain<M extends BaseMetadata> = Omit<DateToString<ThreadData<M>>, "comments" | "metadata"> & {
130
+ comments: CommentDataPlain[];
131
+ metadata: M;
132
+ };
133
+ export type ThreadDeleteInfo = {
134
+ type: "deletedThread";
135
+ id: string;
136
+ roomId: string;
137
+ deletedAt: Date;
138
+ };
139
+ export type ThreadDeleteInfoPlain = DateToString<ThreadDeleteInfo>;
140
+ type StringOperators<T> = T | {
141
+ startsWith: string;
142
+ };
143
+ export type QueryMetadata<M extends BaseMetadata> = {
144
+ [K in keyof M]: string extends M[K] ? StringOperators<M[K]> : M[K];
145
+ };
146
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Comments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Comments.js","sourceRoot":"","sources":["../../../src/rooms/protocol/Comments.ts"],"names":[],"mappings":""}
@@ -0,0 +1,49 @@
1
+ import type { DAD } from "../globals/augmentation";
2
+ import type { DateToString } from "../lib/DateToString";
3
+ export type InboxNotificationThreadData = {
4
+ kind: "thread";
5
+ id: string;
6
+ roomId: string;
7
+ threadId: string;
8
+ notifiedAt: Date;
9
+ readAt: Date | null;
10
+ };
11
+ export type InboxNotificationTextMentionData = {
12
+ kind: "textMention";
13
+ id: string;
14
+ roomId: string;
15
+ notifiedAt: Date;
16
+ readAt: Date | null;
17
+ createdBy: string;
18
+ mentionId: string;
19
+ };
20
+ export type InboxNotificationTextMentionDataPlain = DateToString<InboxNotificationTextMentionData>;
21
+ export type ActivityData = Record<string, string | boolean | number | undefined>;
22
+ type InboxNotificationActivity<K extends keyof DAD = keyof DAD> = {
23
+ id: string;
24
+ createdAt: Date;
25
+ data: DAD[K];
26
+ };
27
+ export type InboxNotificationCustomData<K extends keyof DAD = keyof DAD> = {
28
+ kind: K;
29
+ id: string;
30
+ roomId?: string;
31
+ subjectId: string;
32
+ notifiedAt: Date;
33
+ readAt: Date | null;
34
+ activities: InboxNotificationActivity<K>[];
35
+ };
36
+ export type InboxNotificationData = InboxNotificationThreadData | InboxNotificationCustomData | InboxNotificationTextMentionData;
37
+ export type InboxNotificationThreadDataPlain = DateToString<InboxNotificationThreadData>;
38
+ export type InboxNotificationCustomDataPlain = Omit<DateToString<InboxNotificationCustomData>, "activities"> & {
39
+ activities: DateToString<InboxNotificationActivity>[];
40
+ };
41
+ export type InboxNotificationDataPlain = InboxNotificationThreadDataPlain | InboxNotificationCustomDataPlain | InboxNotificationTextMentionDataPlain;
42
+ export type InboxNotificationDeleteInfo = {
43
+ type: "deletedInboxNotification";
44
+ id: string;
45
+ roomId: string;
46
+ deletedAt: Date;
47
+ };
48
+ export type InboxNotificationDeleteInfoPlain = DateToString<InboxNotificationDeleteInfo>;
49
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=InboxNotifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InboxNotifications.js","sourceRoot":"","sources":["../../../src/rooms/protocol/InboxNotifications.ts"],"names":[],"mappings":""}
@@ -0,0 +1,82 @@
1
+ import type { Json, JsonObject } from "../lib/Json";
2
+ export declare enum OpCode {
3
+ INIT = 0,
4
+ SET_PARENT_KEY = 1,
5
+ CREATE_LIST = 2,
6
+ UPDATE_OBJECT = 3,
7
+ CREATE_OBJECT = 4,
8
+ DELETE_CRDT = 5,
9
+ DELETE_OBJECT_KEY = 6,
10
+ CREATE_MAP = 7,
11
+ CREATE_REGISTER = 8
12
+ }
13
+ export type Op = AckOp | CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
14
+ export type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
15
+ export type UpdateObjectOp = {
16
+ readonly opId?: string;
17
+ readonly id: string;
18
+ readonly type: OpCode.UPDATE_OBJECT;
19
+ readonly data: Partial<JsonObject>;
20
+ };
21
+ export type CreateObjectOp = {
22
+ readonly opId?: string;
23
+ readonly id: string;
24
+ readonly intent?: "set";
25
+ readonly deletedId?: string;
26
+ readonly type: OpCode.CREATE_OBJECT;
27
+ readonly parentId: string;
28
+ readonly parentKey: string;
29
+ readonly data: JsonObject;
30
+ };
31
+ export type CreateListOp = {
32
+ readonly opId?: string;
33
+ readonly id: string;
34
+ readonly intent?: "set";
35
+ readonly deletedId?: string;
36
+ readonly type: OpCode.CREATE_LIST;
37
+ readonly parentId: string;
38
+ readonly parentKey: string;
39
+ };
40
+ export type CreateMapOp = {
41
+ readonly opId?: string;
42
+ readonly id: string;
43
+ readonly intent?: "set";
44
+ readonly deletedId?: string;
45
+ readonly type: OpCode.CREATE_MAP;
46
+ readonly parentId: string;
47
+ readonly parentKey: string;
48
+ };
49
+ export type CreateRegisterOp = {
50
+ readonly opId?: string;
51
+ readonly id: string;
52
+ readonly intent?: "set";
53
+ readonly deletedId?: string;
54
+ readonly type: OpCode.CREATE_REGISTER;
55
+ readonly parentId: string;
56
+ readonly parentKey: string;
57
+ readonly data: Json;
58
+ };
59
+ export type DeleteCrdtOp = {
60
+ readonly opId?: string;
61
+ readonly id: string;
62
+ readonly type: OpCode.DELETE_CRDT;
63
+ };
64
+ export type AckOp = {
65
+ readonly type: OpCode.DELETE_CRDT;
66
+ readonly id: "ACK";
67
+ readonly opId: string;
68
+ };
69
+ export declare function ackOp(opId: string): AckOp;
70
+ export declare function isAckOp(op: Op): op is AckOp;
71
+ export type SetParentKeyOp = {
72
+ readonly opId?: string;
73
+ readonly id: string;
74
+ readonly type: OpCode.SET_PARENT_KEY;
75
+ readonly parentKey: string;
76
+ };
77
+ export type DeleteObjectKeyOp = {
78
+ readonly opId?: string;
79
+ readonly id: string;
80
+ readonly type: OpCode.DELETE_OBJECT_KEY;
81
+ readonly key: string;
82
+ };