fauna-api 0.0.0-stage → 1.0.676

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 (171) hide show
  1. package/dist/brands.d.ts +2 -0
  2. package/dist/brands.js +2 -0
  3. package/dist/index.d.ts +64 -0
  4. package/dist/index.js +121 -0
  5. package/dist/src/ant/chat.d.ts +130 -0
  6. package/dist/src/ant/chat.js +467 -0
  7. package/dist/src/ant/format.d.ts +40 -0
  8. package/dist/src/ant/format.js +143 -0
  9. package/dist/src/ant/graph.d.ts +130 -0
  10. package/dist/src/ant/graph.js +449 -0
  11. package/dist/src/ant/index.d.ts +16 -0
  12. package/dist/src/ant/index.js +61 -0
  13. package/dist/src/ant/persona.d.ts +151 -0
  14. package/dist/src/ant/persona.js +136 -0
  15. package/dist/src/ant/timeline.d.ts +283 -0
  16. package/dist/src/ant/timeline.js +1025 -0
  17. package/dist/src/authentification.d.ts +45 -0
  18. package/dist/src/authentification.js +194 -0
  19. package/dist/src/billing.d.ts +135 -0
  20. package/dist/src/billing.js +128 -0
  21. package/dist/src/calendar.d.ts +83 -0
  22. package/dist/src/calendar.js +133 -0
  23. package/dist/src/chats.d.ts +113 -0
  24. package/dist/src/chats.js +100 -0
  25. package/dist/src/cicada/contacts.d.ts +31 -0
  26. package/dist/src/cicada/contacts.js +28 -0
  27. package/dist/src/cicada/conversations.d.ts +73 -0
  28. package/dist/src/cicada/conversations.js +236 -0
  29. package/dist/src/cicada/inboxes.d.ts +48 -0
  30. package/dist/src/cicada/inboxes.js +82 -0
  31. package/dist/src/cicada/index.d.ts +16 -0
  32. package/dist/src/cicada/index.js +61 -0
  33. package/dist/src/cicada/phone.d.ts +48 -0
  34. package/dist/src/cicada/phone.js +306 -0
  35. package/dist/src/drive.d.ts +80 -0
  36. package/dist/src/drive.js +472 -0
  37. package/dist/src/extensions/index.d.ts +4 -0
  38. package/dist/src/extensions/index.js +5 -0
  39. package/dist/src/extensions/web/index.d.ts +6 -0
  40. package/dist/src/extensions/web/index.js +7 -0
  41. package/dist/src/extensions/web/session.d.ts +106 -0
  42. package/dist/src/extensions/web/session.js +469 -0
  43. package/dist/src/extensions/web/tools.d.ts +13 -0
  44. package/dist/src/extensions/web/tools.js +72 -0
  45. package/dist/src/friends.d.ts +39 -0
  46. package/dist/src/friends.js +119 -0
  47. package/dist/src/groups.d.ts +82 -0
  48. package/dist/src/groups.js +269 -0
  49. package/dist/src/inbox.d.ts +11 -0
  50. package/dist/src/inbox.js +35 -0
  51. package/dist/src/integrations.d.ts +52 -0
  52. package/dist/src/integrations.js +205 -0
  53. package/dist/src/magpie/explorer.d.ts +14 -0
  54. package/dist/src/magpie/explorer.js +36 -0
  55. package/dist/src/magpie/index.d.ts +16 -0
  56. package/dist/src/magpie/index.js +61 -0
  57. package/dist/src/magpie/portfolio.d.ts +52 -0
  58. package/dist/src/magpie/portfolio.js +179 -0
  59. package/dist/src/magpie/quotes.d.ts +35 -0
  60. package/dist/src/magpie/quotes.js +47 -0
  61. package/dist/src/magpie/room.d.ts +61 -0
  62. package/dist/src/magpie/room.js +238 -0
  63. package/dist/src/maps.d.ts +159 -0
  64. package/dist/src/maps.js +171 -0
  65. package/dist/src/marmot/browser.d.ts +139 -0
  66. package/dist/src/marmot/browser.js +389 -0
  67. package/dist/src/marmot/index.d.ts +20 -0
  68. package/dist/src/marmot/index.js +65 -0
  69. package/dist/src/marmot/media.d.ts +56 -0
  70. package/dist/src/marmot/media.js +265 -0
  71. package/dist/src/marmot/research.d.ts +337 -0
  72. package/dist/src/marmot/research.js +1138 -0
  73. package/dist/src/marmot/scraper.d.ts +59 -0
  74. package/dist/src/marmot/scraper.js +94 -0
  75. package/dist/src/marmot/web.d.ts +402 -0
  76. package/dist/src/marmot/web.js +2586 -0
  77. package/dist/src/marmot/workspace.d.ts +81 -0
  78. package/dist/src/marmot/workspace.js +263 -0
  79. package/dist/src/parrot/agent.d.ts +53 -0
  80. package/dist/src/parrot/agent.js +93 -0
  81. package/dist/src/parrot/chat.d.ts +84 -0
  82. package/dist/src/parrot/chat.js +237 -0
  83. package/dist/src/parrot/format.d.ts +128 -0
  84. package/dist/src/parrot/format.js +639 -0
  85. package/dist/src/parrot/generative.d.ts +261 -0
  86. package/dist/src/parrot/generative.js +185 -0
  87. package/dist/src/parrot/index.d.ts +22 -0
  88. package/dist/src/parrot/index.js +67 -0
  89. package/dist/src/parrot/room.d.ts +225 -0
  90. package/dist/src/parrot/room.js +466 -0
  91. package/dist/src/parrot/routing.d.ts +90 -0
  92. package/dist/src/parrot/routing.js +78 -0
  93. package/dist/src/parrot/share.d.ts +126 -0
  94. package/dist/src/parrot/share.js +261 -0
  95. package/dist/src/parrot/socket.d.ts +41 -0
  96. package/dist/src/parrot/socket.js +478 -0
  97. package/dist/src/payments.d.ts +73 -0
  98. package/dist/src/payments.js +107 -0
  99. package/dist/src/private/cards.css +75 -0
  100. package/dist/src/rooms.d.ts +76 -0
  101. package/dist/src/rooms.js +168 -0
  102. package/dist/src/shared/schema.d.ts +24 -0
  103. package/dist/src/shared/schema.js +1 -0
  104. package/dist/src/shared/server.d.ts +65 -0
  105. package/dist/src/shared/server.js +302 -0
  106. package/dist/src/termite/environment.d.ts +110 -0
  107. package/dist/src/termite/environment.js +263 -0
  108. package/dist/src/termite/index.d.ts +14 -0
  109. package/dist/src/termite/index.js +59 -0
  110. package/dist/src/termite/os.d.ts +326 -0
  111. package/dist/src/termite/os.js +572 -0
  112. package/dist/src/termite/versioning.d.ts +94 -0
  113. package/dist/src/termite/versioning.js +217 -0
  114. package/dist/src/tickets.d.ts +43 -0
  115. package/dist/src/tickets.js +138 -0
  116. package/dist/src/travel.d.ts +85 -0
  117. package/dist/src/travel.js +44 -0
  118. package/dist/src/ui/authentification.d.ts +24 -0
  119. package/dist/src/ui/authentification.js +177 -0
  120. package/dist/src/ui/brands.css +11 -0
  121. package/dist/src/ui/brands.d.ts +7 -0
  122. package/dist/src/ui/brands.js +14 -0
  123. package/dist/src/ui/browser.d.ts +74 -0
  124. package/dist/src/ui/browser.js +470 -0
  125. package/dist/src/ui/chat.d.ts +183 -0
  126. package/dist/src/ui/chat.js +2379 -0
  127. package/dist/src/ui/chatPanel.d.ts +109 -0
  128. package/dist/src/ui/chatPanel.js +768 -0
  129. package/dist/src/ui/chatSequence.d.ts +36 -0
  130. package/dist/src/ui/chatSequence.js +42 -0
  131. package/dist/src/ui/crown.d.ts +19 -0
  132. package/dist/src/ui/crown.js +199 -0
  133. package/dist/src/ui/cursor.d.ts +73 -0
  134. package/dist/src/ui/cursor.js +175 -0
  135. package/dist/src/ui/device.d.ts +33 -0
  136. package/dist/src/ui/device.js +49 -0
  137. package/dist/src/ui/drive.d.ts +69 -0
  138. package/dist/src/ui/drive.js +1243 -0
  139. package/dist/src/ui/generative.d.ts +39 -0
  140. package/dist/src/ui/generative.js +313 -0
  141. package/dist/src/ui/hover.d.ts +6 -0
  142. package/dist/src/ui/hover.js +210 -0
  143. package/dist/src/ui/index.d.ts +42 -0
  144. package/dist/src/ui/index.js +87 -0
  145. package/dist/src/ui/integrations.d.ts +13 -0
  146. package/dist/src/ui/integrations.js +175 -0
  147. package/dist/src/ui/maps.d.ts +87 -0
  148. package/dist/src/ui/maps.js +547 -0
  149. package/dist/src/ui/roster.d.ts +32 -0
  150. package/dist/src/ui/roster.js +163 -0
  151. package/dist/src/ui/talk.d.ts +12 -0
  152. package/dist/src/ui/talk.js +560 -0
  153. package/dist/src/ui/tickets.d.ts +13 -0
  154. package/dist/src/ui/tickets.js +966 -0
  155. package/dist/src/ui/toast.d.ts +7 -0
  156. package/dist/src/ui/toast.js +258 -0
  157. package/dist/src/ui/tokenText.d.ts +18 -0
  158. package/dist/src/ui/tokenText.js +96 -0
  159. package/dist/src/ui/tokenized.d.ts +42 -0
  160. package/dist/src/ui/tokenized.js +622 -0
  161. package/dist/src/ui/ui.css +4763 -0
  162. package/dist/src/ui/view.d.ts +23 -0
  163. package/dist/src/ui/view.js +584 -0
  164. package/dist/src/view.d.ts +113 -0
  165. package/dist/src/view.js +386 -0
  166. package/dist/src/webhooks.d.ts +66 -0
  167. package/dist/src/webhooks.js +78 -0
  168. package/dist/ui.d.ts +1 -0
  169. package/dist/ui.js +1 -0
  170. package/package.json +89 -6
  171. package/README.md +0 -3
@@ -0,0 +1,130 @@
1
+ import { File } from "../drive.js";
2
+ export type Stimuli = "start" | "file" | "text" | "website" | "x" | "linkedin";
3
+ export type GraphNodeWire = {
4
+ id: string;
5
+ kind: Stimuli;
6
+ x: number;
7
+ y: number;
8
+ label: string;
9
+ w?: number;
10
+ h?: number;
11
+ text?: string;
12
+ url?: string;
13
+ mime?: string;
14
+ filePath?: string;
15
+ };
16
+ type Size = {
17
+ w?: number;
18
+ h?: number;
19
+ };
20
+ export declare abstract class GraphNode {
21
+ readonly id: string;
22
+ x: number;
23
+ y: number;
24
+ w?: number;
25
+ h?: number;
26
+ constructor(id: string, x: number, y: number, size?: Size);
27
+ abstract readonly kind: Stimuli;
28
+ abstract clone(): GraphNode;
29
+ abstract toJSON(): GraphNodeWire;
30
+ static fromJSON(json: GraphNodeWire, files?: File | File[]): GraphNode;
31
+ }
32
+ export declare class StartNode extends GraphNode {
33
+ readonly kind: "start";
34
+ clone(): StartNode;
35
+ toJSON(): GraphNodeWire;
36
+ }
37
+ export declare class TextNode extends GraphNode {
38
+ readonly kind: "text";
39
+ label: string;
40
+ text: string;
41
+ constructor(id: string, x: number, y: number, label: string, text: string, size?: Size);
42
+ clone(): TextNode;
43
+ toJSON(): GraphNodeWire;
44
+ }
45
+ export declare class WebsiteNode extends GraphNode {
46
+ readonly kind: "website";
47
+ url: string;
48
+ constructor(id: string, x: number, y: number, url: string, size?: Size);
49
+ clone(): WebsiteNode;
50
+ toJSON(): GraphNodeWire;
51
+ }
52
+ export declare class FileNode extends GraphNode {
53
+ readonly kind: "file";
54
+ file?: File;
55
+ wirePath?: string;
56
+ wireMime?: string;
57
+ wireName?: string;
58
+ constructor(id: string, x: number, y: number, file?: File, size?: Size & {
59
+ filePath?: string;
60
+ mime?: string;
61
+ label?: string;
62
+ });
63
+ clone(): FileNode;
64
+ toJSON(): GraphNodeWire;
65
+ }
66
+ export declare class XNode extends GraphNode {
67
+ readonly kind: "x";
68
+ handle: string;
69
+ body: string;
70
+ media: File[];
71
+ quotedId: string | null;
72
+ extraPaths: {
73
+ path: string;
74
+ mime: string;
75
+ name: string;
76
+ }[];
77
+ wirePath?: string;
78
+ wireMime?: string;
79
+ constructor(id: string, x: number, y: number, handle: string, body: string, opts?: Size & {
80
+ quotedId?: string | null;
81
+ media?: File[];
82
+ extraPaths?: {
83
+ path: string;
84
+ mime: string;
85
+ name: string;
86
+ }[];
87
+ filePath?: string;
88
+ mime?: string;
89
+ });
90
+ get isPost(): boolean;
91
+ get isRepost(): boolean;
92
+ get isQuote(): boolean;
93
+ clone(): XNode;
94
+ toJSON(): GraphNodeWire;
95
+ static fromJSON(json: GraphNodeWire, files?: File | File[]): XNode;
96
+ }
97
+ export declare class LinkedInNode extends GraphNode {
98
+ readonly kind: "linkedin";
99
+ author: string;
100
+ body: string;
101
+ media: File[];
102
+ wirePath?: string;
103
+ wireMime?: string;
104
+ constructor(id: string, x: number, y: number, author: string, body: string, opts?: Size & {
105
+ media?: File[];
106
+ filePath?: string;
107
+ mime?: string;
108
+ });
109
+ clone(): LinkedInNode;
110
+ toJSON(): GraphNodeWire;
111
+ static fromJSON(json: GraphNodeWire, files?: File | File[]): LinkedInNode;
112
+ }
113
+ export declare class GraphEdge {
114
+ id: string;
115
+ fromNodeId: string;
116
+ toNodeId: string;
117
+ constructor(id: string, fromNodeId: string, toNodeId: string);
118
+ clone(): GraphEdge;
119
+ toJSON(): {
120
+ id: string;
121
+ fromNodeId: string;
122
+ toNodeId: string;
123
+ };
124
+ static fromJSON(json: {
125
+ id: string;
126
+ fromNodeId: string;
127
+ toNodeId: string;
128
+ }): GraphEdge;
129
+ }
130
+ export {};
@@ -0,0 +1,449 @@
1
+ function sizeOf(node) {
2
+ if (node.w == null && node.h == null)
3
+ return undefined;
4
+ return { w: node.w, h: node.h };
5
+ }
6
+ function parseXEnvelope(text) {
7
+ const raw = String(text ?? "").trim();
8
+ if (!raw)
9
+ return {};
10
+ if (raw.startsWith("{")) {
11
+ try {
12
+ const parsed = JSON.parse(raw);
13
+ if (parsed && typeof parsed === "object")
14
+ return parsed;
15
+ }
16
+ catch { /* body is plain text */ }
17
+ }
18
+ return { body: raw };
19
+ }
20
+ export class GraphNode {
21
+ constructor(id, x, y, size) {
22
+ Object.defineProperty(this, "id", {
23
+ enumerable: true,
24
+ configurable: true,
25
+ writable: true,
26
+ value: void 0
27
+ });
28
+ Object.defineProperty(this, "x", {
29
+ enumerable: true,
30
+ configurable: true,
31
+ writable: true,
32
+ value: void 0
33
+ });
34
+ Object.defineProperty(this, "y", {
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true,
38
+ value: void 0
39
+ });
40
+ Object.defineProperty(this, "w", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: void 0
45
+ });
46
+ Object.defineProperty(this, "h", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: void 0
51
+ });
52
+ this.id = id;
53
+ this.x = x;
54
+ this.y = y;
55
+ this.w = size?.w;
56
+ this.h = size?.h;
57
+ }
58
+ static fromJSON(json, files) {
59
+ switch (json.kind) {
60
+ case "start": return new StartNode(json.id, json.x, json.y, json);
61
+ case "text": return new TextNode(json.id, json.x, json.y, json.label, json.text ?? "", json);
62
+ case "website": return new WebsiteNode(json.id, json.x, json.y, json.url ?? "", json);
63
+ case "file": return new FileNode(json.id, json.x, json.y, Array.isArray(files) ? files[0] : files, {
64
+ ...json,
65
+ filePath: json.filePath,
66
+ mime: json.mime,
67
+ label: json.label,
68
+ });
69
+ case "x": return XNode.fromJSON(json, files);
70
+ case "linkedin": return LinkedInNode.fromJSON(json, files);
71
+ default: return new TextNode(json.id, json.x, json.y, json.label ?? "", json.text ?? "", json);
72
+ }
73
+ }
74
+ }
75
+ export class StartNode extends GraphNode {
76
+ constructor() {
77
+ super(...arguments);
78
+ Object.defineProperty(this, "kind", {
79
+ enumerable: true,
80
+ configurable: true,
81
+ writable: true,
82
+ value: "start"
83
+ });
84
+ }
85
+ clone() {
86
+ return new StartNode(this.id, this.x, this.y, this);
87
+ }
88
+ toJSON() {
89
+ return { id: this.id, kind: "start", x: this.x, y: this.y, label: "Start", w: this.w, h: this.h };
90
+ }
91
+ }
92
+ export class TextNode extends GraphNode {
93
+ constructor(id, x, y, label, text, size) {
94
+ super(id, x, y, size);
95
+ Object.defineProperty(this, "kind", {
96
+ enumerable: true,
97
+ configurable: true,
98
+ writable: true,
99
+ value: "text"
100
+ });
101
+ Object.defineProperty(this, "label", {
102
+ enumerable: true,
103
+ configurable: true,
104
+ writable: true,
105
+ value: void 0
106
+ });
107
+ Object.defineProperty(this, "text", {
108
+ enumerable: true,
109
+ configurable: true,
110
+ writable: true,
111
+ value: void 0
112
+ });
113
+ this.label = label;
114
+ this.text = text;
115
+ }
116
+ clone() {
117
+ return new TextNode(this.id, this.x, this.y, this.label, this.text, this);
118
+ }
119
+ toJSON() {
120
+ return {
121
+ id: this.id,
122
+ kind: "text",
123
+ x: this.x,
124
+ y: this.y,
125
+ label: this.label,
126
+ text: this.text,
127
+ w: this.w,
128
+ h: this.h,
129
+ };
130
+ }
131
+ }
132
+ export class WebsiteNode extends GraphNode {
133
+ constructor(id, x, y, url, size) {
134
+ super(id, x, y, size);
135
+ Object.defineProperty(this, "kind", {
136
+ enumerable: true,
137
+ configurable: true,
138
+ writable: true,
139
+ value: "website"
140
+ });
141
+ Object.defineProperty(this, "url", {
142
+ enumerable: true,
143
+ configurable: true,
144
+ writable: true,
145
+ value: void 0
146
+ });
147
+ this.url = url;
148
+ }
149
+ clone() {
150
+ return new WebsiteNode(this.id, this.x, this.y, this.url, this);
151
+ }
152
+ toJSON() {
153
+ return {
154
+ id: this.id,
155
+ kind: "website",
156
+ x: this.x,
157
+ y: this.y,
158
+ label: this.url || "Website",
159
+ url: this.url,
160
+ w: this.w,
161
+ h: this.h,
162
+ };
163
+ }
164
+ }
165
+ function filePathOf(file, fallback) {
166
+ if (file && "path" in file.authorization)
167
+ return file.authorization.path;
168
+ return fallback;
169
+ }
170
+ export class FileNode extends GraphNode {
171
+ constructor(id, x, y, file, size) {
172
+ super(id, x, y, size);
173
+ Object.defineProperty(this, "kind", {
174
+ enumerable: true,
175
+ configurable: true,
176
+ writable: true,
177
+ value: "file"
178
+ });
179
+ Object.defineProperty(this, "file", {
180
+ enumerable: true,
181
+ configurable: true,
182
+ writable: true,
183
+ value: void 0
184
+ });
185
+ Object.defineProperty(this, "wirePath", {
186
+ enumerable: true,
187
+ configurable: true,
188
+ writable: true,
189
+ value: void 0
190
+ });
191
+ Object.defineProperty(this, "wireMime", {
192
+ enumerable: true,
193
+ configurable: true,
194
+ writable: true,
195
+ value: void 0
196
+ });
197
+ Object.defineProperty(this, "wireName", {
198
+ enumerable: true,
199
+ configurable: true,
200
+ writable: true,
201
+ value: void 0
202
+ });
203
+ this.file = file;
204
+ this.wirePath = size?.filePath;
205
+ this.wireMime = size?.mime;
206
+ this.wireName = size?.label;
207
+ }
208
+ clone() {
209
+ const next = new FileNode(this.id, this.x, this.y, this.file, this);
210
+ next.wirePath = this.wirePath;
211
+ next.wireMime = this.wireMime;
212
+ next.wireName = this.wireName;
213
+ return next;
214
+ }
215
+ toJSON() {
216
+ return {
217
+ id: this.id,
218
+ kind: "file",
219
+ x: this.x,
220
+ y: this.y,
221
+ label: this.file?.name ?? this.wireName ?? "File",
222
+ mime: this.file?.contentType ?? this.wireMime,
223
+ filePath: filePathOf(this.file, this.wirePath),
224
+ w: this.w,
225
+ h: this.h,
226
+ };
227
+ }
228
+ }
229
+ export class XNode extends GraphNode {
230
+ constructor(id, x, y, handle, body, opts) {
231
+ super(id, x, y, opts);
232
+ Object.defineProperty(this, "kind", {
233
+ enumerable: true,
234
+ configurable: true,
235
+ writable: true,
236
+ value: "x"
237
+ });
238
+ Object.defineProperty(this, "handle", {
239
+ enumerable: true,
240
+ configurable: true,
241
+ writable: true,
242
+ value: void 0
243
+ });
244
+ Object.defineProperty(this, "body", {
245
+ enumerable: true,
246
+ configurable: true,
247
+ writable: true,
248
+ value: void 0
249
+ });
250
+ Object.defineProperty(this, "media", {
251
+ enumerable: true,
252
+ configurable: true,
253
+ writable: true,
254
+ value: void 0
255
+ });
256
+ Object.defineProperty(this, "quotedId", {
257
+ enumerable: true,
258
+ configurable: true,
259
+ writable: true,
260
+ value: void 0
261
+ });
262
+ Object.defineProperty(this, "extraPaths", {
263
+ enumerable: true,
264
+ configurable: true,
265
+ writable: true,
266
+ value: void 0
267
+ });
268
+ Object.defineProperty(this, "wirePath", {
269
+ enumerable: true,
270
+ configurable: true,
271
+ writable: true,
272
+ value: void 0
273
+ });
274
+ Object.defineProperty(this, "wireMime", {
275
+ enumerable: true,
276
+ configurable: true,
277
+ writable: true,
278
+ value: void 0
279
+ });
280
+ this.handle = handle;
281
+ this.body = body;
282
+ this.quotedId = opts?.quotedId ?? null;
283
+ this.media = opts?.media ? [...opts.media] : [];
284
+ this.extraPaths = opts?.extraPaths ? [...opts.extraPaths] : [];
285
+ this.wirePath = opts?.filePath;
286
+ this.wireMime = opts?.mime;
287
+ }
288
+ get isPost() { return this.quotedId == null; }
289
+ get isRepost() { return this.quotedId != null && !this.body.trim(); }
290
+ get isQuote() { return this.quotedId != null && Boolean(this.body.trim()); }
291
+ clone() {
292
+ return new XNode(this.id, this.x, this.y, this.handle, this.body, {
293
+ ...sizeOf(this),
294
+ quotedId: this.quotedId,
295
+ media: this.media,
296
+ extraPaths: this.extraPaths,
297
+ filePath: this.wirePath,
298
+ mime: this.wireMime,
299
+ });
300
+ }
301
+ toJSON() {
302
+ const first = this.media[0];
303
+ const extras = this.media.slice(1).map((file) => ({
304
+ path: "path" in file.authorization ? file.authorization.path : "",
305
+ mime: file.contentType,
306
+ name: file.name,
307
+ })).filter((row) => row.path).concat(this.extraPaths);
308
+ return {
309
+ id: this.id,
310
+ kind: "x",
311
+ x: this.x,
312
+ y: this.y,
313
+ label: this.handle,
314
+ text: JSON.stringify({
315
+ body: this.body,
316
+ quotedId: this.quotedId,
317
+ ...(extras.length ? { extra: extras } : {}),
318
+ }),
319
+ mime: first?.contentType ?? this.wireMime,
320
+ filePath: filePathOf(first, this.wirePath),
321
+ w: this.w,
322
+ h: this.h,
323
+ };
324
+ }
325
+ static fromJSON(json, files) {
326
+ const envelope = parseXEnvelope(json.text);
327
+ const list = files ? (Array.isArray(files) ? files : [files]) : [];
328
+ return new XNode(json.id, json.x, json.y, json.label || json.url || "", envelope.body ?? "", {
329
+ ...sizeOf(json),
330
+ quotedId: envelope.quotedId === undefined ? null : envelope.quotedId,
331
+ media: list,
332
+ extraPaths: envelope.extra,
333
+ filePath: json.filePath,
334
+ mime: json.mime,
335
+ });
336
+ }
337
+ }
338
+ export class LinkedInNode extends GraphNode {
339
+ constructor(id, x, y, author, body, opts) {
340
+ super(id, x, y, opts);
341
+ Object.defineProperty(this, "kind", {
342
+ enumerable: true,
343
+ configurable: true,
344
+ writable: true,
345
+ value: "linkedin"
346
+ });
347
+ Object.defineProperty(this, "author", {
348
+ enumerable: true,
349
+ configurable: true,
350
+ writable: true,
351
+ value: void 0
352
+ });
353
+ Object.defineProperty(this, "body", {
354
+ enumerable: true,
355
+ configurable: true,
356
+ writable: true,
357
+ value: void 0
358
+ });
359
+ Object.defineProperty(this, "media", {
360
+ enumerable: true,
361
+ configurable: true,
362
+ writable: true,
363
+ value: void 0
364
+ });
365
+ Object.defineProperty(this, "wirePath", {
366
+ enumerable: true,
367
+ configurable: true,
368
+ writable: true,
369
+ value: void 0
370
+ });
371
+ Object.defineProperty(this, "wireMime", {
372
+ enumerable: true,
373
+ configurable: true,
374
+ writable: true,
375
+ value: void 0
376
+ });
377
+ this.author = author;
378
+ this.body = body;
379
+ this.media = opts?.media ? [...opts.media] : [];
380
+ this.wirePath = opts?.filePath;
381
+ this.wireMime = opts?.mime;
382
+ }
383
+ clone() {
384
+ return new LinkedInNode(this.id, this.x, this.y, this.author, this.body, {
385
+ ...sizeOf(this),
386
+ media: this.media,
387
+ filePath: this.wirePath,
388
+ mime: this.wireMime,
389
+ });
390
+ }
391
+ toJSON() {
392
+ const first = this.media[0];
393
+ return {
394
+ id: this.id,
395
+ kind: "linkedin",
396
+ x: this.x,
397
+ y: this.y,
398
+ label: this.author,
399
+ text: this.body,
400
+ mime: first?.contentType ?? this.wireMime,
401
+ filePath: filePathOf(first, this.wirePath),
402
+ w: this.w,
403
+ h: this.h,
404
+ };
405
+ }
406
+ static fromJSON(json, files) {
407
+ const list = files ? (Array.isArray(files) ? files : [files]) : [];
408
+ return new LinkedInNode(json.id, json.x, json.y, json.label || "", json.text ?? "", {
409
+ ...sizeOf(json),
410
+ media: list,
411
+ filePath: json.filePath,
412
+ mime: json.mime,
413
+ });
414
+ }
415
+ }
416
+ export class GraphEdge {
417
+ constructor(id, fromNodeId, toNodeId) {
418
+ Object.defineProperty(this, "id", {
419
+ enumerable: true,
420
+ configurable: true,
421
+ writable: true,
422
+ value: void 0
423
+ });
424
+ Object.defineProperty(this, "fromNodeId", {
425
+ enumerable: true,
426
+ configurable: true,
427
+ writable: true,
428
+ value: void 0
429
+ });
430
+ Object.defineProperty(this, "toNodeId", {
431
+ enumerable: true,
432
+ configurable: true,
433
+ writable: true,
434
+ value: void 0
435
+ });
436
+ this.id = id;
437
+ this.fromNodeId = fromNodeId;
438
+ this.toNodeId = toNodeId;
439
+ }
440
+ clone() {
441
+ return new GraphEdge(this.id, this.fromNodeId, this.toNodeId);
442
+ }
443
+ toJSON() {
444
+ return { id: this.id, fromNodeId: this.fromNodeId, toNodeId: this.toNodeId };
445
+ }
446
+ static fromJSON(json) {
447
+ return new GraphEdge(json.id, json.fromNodeId, json.toNodeId);
448
+ }
449
+ }
@@ -0,0 +1,16 @@
1
+ import * as PersonaAPI from "./persona.js";
2
+ import * as TimelineAPI from "./timeline.js";
3
+ import * as ChatAPI from "./chat.js";
4
+ import * as FormatAPI from "./format.js";
5
+ export declare namespace Ant {
6
+ function setRoute(route: string): void;
7
+ function getIP(): string;
8
+ function getPort(): number;
9
+ function getRoute(): string;
10
+ function getURL(): string;
11
+ function ping(): Promise<number>;
12
+ export import Persona = PersonaAPI;
13
+ export import Timeline = TimelineAPI;
14
+ export import Chat = ChatAPI;
15
+ export import Format = FormatAPI;
16
+ }
@@ -0,0 +1,61 @@
1
+ import * as PersonaAPI from "./persona.js";
2
+ import * as TimelineAPI from "./timeline.js";
3
+ import * as ChatAPI from "./chat.js";
4
+ import * as FormatAPI from "./format.js";
5
+ export var Ant;
6
+ (function (Ant) {
7
+ var PREFIX = 'https://';
8
+ var IP = 'api.faunakit.com';
9
+ var PORT = 443;
10
+ function setRoute(route) {
11
+ const parts_0 = route.split('//');
12
+ if (parts_0.length > 1) {
13
+ PREFIX = parts_0[0] + '//';
14
+ const parts_1 = parts_0[1].split(':');
15
+ if (parts_1.length > 1) {
16
+ IP = parts_1[0];
17
+ PORT = Number(parts_1[1]);
18
+ }
19
+ else {
20
+ IP = parts_1[0];
21
+ }
22
+ }
23
+ else {
24
+ const parts_1 = parts_0[0].split(':');
25
+ if (parts_1.length > 1) {
26
+ IP = parts_1[0];
27
+ PORT = Number(parts_1[1]);
28
+ }
29
+ else {
30
+ IP = parts_1[0];
31
+ }
32
+ }
33
+ }
34
+ Ant.setRoute = setRoute;
35
+ function getIP() {
36
+ return IP;
37
+ }
38
+ Ant.getIP = getIP;
39
+ function getPort() {
40
+ return PORT;
41
+ }
42
+ Ant.getPort = getPort;
43
+ function getRoute() {
44
+ return IP + ':' + PORT;
45
+ }
46
+ Ant.getRoute = getRoute;
47
+ function getURL() {
48
+ return PREFIX + IP + ':' + PORT;
49
+ }
50
+ Ant.getURL = getURL;
51
+ async function ping() {
52
+ const start = Date.now();
53
+ await fetch(`${getURL()}/`);
54
+ return Date.now() - start;
55
+ }
56
+ Ant.ping = ping;
57
+ Ant.Persona = PersonaAPI;
58
+ Ant.Timeline = TimelineAPI;
59
+ Ant.Chat = ChatAPI;
60
+ Ant.Format = FormatAPI;
61
+ })(Ant || (Ant = {}));