@edifice.io/aiwiki-v2-node-api 0.0.0-stage → 0.1.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.
@@ -0,0 +1,2 @@
1
+ export * from './nats/types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ (function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){"use strict"});
@@ -0,0 +1,371 @@
1
+ /**
2
+ * Request of the generation of a wiki from a description of its subject.
3
+ */
4
+ export interface ContentRequest {
5
+ /**
6
+ * User agent of the browser of the user.
7
+ */
8
+ browser?: string;
9
+ /**
10
+ * Description of the expected content.
11
+ */
12
+ content?: string;
13
+ /**
14
+ * Keywords of the wiki.
15
+ */
16
+ keywords?: string;
17
+ /**
18
+ * School level of the audience.
19
+ */
20
+ level?: string;
21
+ /**
22
+ * Identifier of the platform, to which the generated wiki is sent back.
23
+ */
24
+ pf_id?: string;
25
+ /**
26
+ * Session of the user.
27
+ */
28
+ session?: string;
29
+ /**
30
+ * Subject of the wiki.
31
+ */
32
+ subject?: string;
33
+ /**
34
+ * Identifier of the user who asked for the generation.
35
+ */
36
+ user_id?: string;
37
+ /**
38
+ * Identifier of the wiki to fill.
39
+ */
40
+ wiki_id?: string;
41
+ }
42
+ /**
43
+ * Request of the generation of a wiki from a PDF.
44
+ */
45
+ export interface ContentTransformRequest {
46
+ /**
47
+ * User agent of the browser of the user.
48
+ */
49
+ browser?: string;
50
+ /**
51
+ * Path of the PDF in the storage of the generator.
52
+ */
53
+ path_file?: string;
54
+ /**
55
+ * Identifier of the platform, to which the generated wiki is sent back.
56
+ */
57
+ pf_id?: string;
58
+ /**
59
+ * Session of the user.
60
+ */
61
+ session?: string;
62
+ /**
63
+ * Identifier of the user who asked for the generation.
64
+ */
65
+ user_id?: string;
66
+ /**
67
+ * Identifier of the wiki to fill.
68
+ */
69
+ wiki_id?: string;
70
+ }
71
+ /**
72
+ * A generated wiki.
73
+ */
74
+ export interface Course {
75
+ /**
76
+ * Creation date, ISO 8601.
77
+ */
78
+ created?: string;
79
+ description?: string;
80
+ /**
81
+ * Modification date, ISO 8601.
82
+ */
83
+ modified?: string;
84
+ /**
85
+ * Owner of the wiki.
86
+ */
87
+ owner?: Owner;
88
+ /**
89
+ * Pages of the wiki.
90
+ */
91
+ pages?: Page[];
92
+ /**
93
+ * Thumbnail of the wiki.
94
+ */
95
+ thumbnail?: string;
96
+ title?: string;
97
+ }
98
+ /**
99
+ * Structure of a generated wiki.
100
+ */
101
+ export interface CourseHierarchy {
102
+ /**
103
+ * Whether the wiki is generated from a PDF.
104
+ *
105
+ * @defaultValue `false`
106
+ */
107
+ fromPdf?: boolean;
108
+ /**
109
+ * Pages of the wiki, without their content.
110
+ */
111
+ pages?: PageStructure[];
112
+ /**
113
+ * Identifier of the wiki.
114
+ */
115
+ wiki_id?: string;
116
+ }
117
+ /**
118
+ * A generated page of a wiki, with the wiki it belongs to.
119
+ */
120
+ export interface CourseResponse {
121
+ /**
122
+ * The wiki, holding the generated page only.
123
+ */
124
+ course?: Course;
125
+ /**
126
+ * Whether the wiki is generated from a PDF : its images are then to be copied from the storage of the generator.
127
+ *
128
+ * @defaultValue `false`
129
+ */
130
+ fromPdf?: boolean;
131
+ /**
132
+ * Message describing the status.
133
+ *
134
+ * @defaultValue `"Course has been successfully generated."`
135
+ */
136
+ message?: string;
137
+ /**
138
+ * Model that generated the page.
139
+ */
140
+ model?: string;
141
+ /**
142
+ * Status of the generation : `success` or `error`.
143
+ *
144
+ * @defaultValue `"success"`
145
+ */
146
+ status?: string;
147
+ /**
148
+ * Tokens used by the generation.
149
+ */
150
+ usage?: Usage;
151
+ /**
152
+ * Version of the generator.
153
+ */
154
+ version?: string;
155
+ /**
156
+ * Identifier of the wiki.
157
+ */
158
+ wiki_id?: string;
159
+ }
160
+ /**
161
+ * Request of the check of a PDF.
162
+ */
163
+ export interface FileCheckRequest {
164
+ /**
165
+ * Path of the PDF in the storage of the generator.
166
+ */
167
+ path_file?: string;
168
+ /**
169
+ * Identifier of the platform.
170
+ */
171
+ pf_id?: string;
172
+ /**
173
+ * Identifier of the user who asked for the check.
174
+ */
175
+ user_id?: string;
176
+ }
177
+ /**
178
+ * Result of the check of a PDF.
179
+ */
180
+ export interface FileCheckResponse {
181
+ /**
182
+ * Why the PDF cannot be used.
183
+ */
184
+ reason?: string;
185
+ /**
186
+ * Numbers of the pages that are left out.
187
+ *
188
+ * @defaultValue `[]`
189
+ */
190
+ skipped_pages?: number[];
191
+ /**
192
+ * Number of pages of the PDF.
193
+ *
194
+ * @defaultValue `0`
195
+ */
196
+ total_pages?: number;
197
+ /**
198
+ * Whether the PDF can be turned into a wiki.
199
+ */
200
+ usable?: boolean;
201
+ /**
202
+ * Numbers of the pages that are used.
203
+ *
204
+ * @defaultValue `[]`
205
+ */
206
+ usable_pages?: number[];
207
+ }
208
+ /**
209
+ * Acknowledgement of a generation job.
210
+ */
211
+ export interface JobAccepted {
212
+ /**
213
+ * Whether the job was started.
214
+ */
215
+ accepted?: boolean;
216
+ /**
217
+ * Why the job was refused.
218
+ */
219
+ reason?: string;
220
+ }
221
+ /**
222
+ * Content of a page, in the JSON of the editor.
223
+ */
224
+ export interface JsonContent {
225
+ content?: JsonContentItem[];
226
+ /**
227
+ * Type of the root node, `doc`.
228
+ *
229
+ * @defaultValue `"doc"`
230
+ */
231
+ type?: string;
232
+ }
233
+ /**
234
+ * A node of the JSON of the editor.
235
+ */
236
+ export interface JsonContentItem {
237
+ /**
238
+ * Attributes of the node.
239
+ */
240
+ attrs?: object;
241
+ /**
242
+ * Children of the node, kept as free JSON.
243
+ */
244
+ content?: any[];
245
+ type?: string;
246
+ }
247
+ /**
248
+ * Acknowledgement of a generated part of a wiki, by the wiki application.
249
+ */
250
+ export interface MessageReceived {
251
+ /**
252
+ * Why the part could not be saved.
253
+ */
254
+ reason?: string;
255
+ /**
256
+ * Whether the part was saved.
257
+ */
258
+ received?: boolean;
259
+ }
260
+ /**
261
+ * Owner of a wiki.
262
+ */
263
+ export interface Owner {
264
+ displayName?: string;
265
+ userId?: string;
266
+ }
267
+ /**
268
+ * A generated page of a wiki.
269
+ */
270
+ export interface Page {
271
+ /**
272
+ * Identifier of the author.
273
+ */
274
+ author?: string;
275
+ authorName?: string;
276
+ /**
277
+ * Content of the page, in HTML.
278
+ */
279
+ content?: string;
280
+ /**
281
+ * Version of the format of the content.
282
+ */
283
+ contentVersion?: number;
284
+ /**
285
+ * Creation date, ISO 8601.
286
+ */
287
+ created?: string;
288
+ /**
289
+ * Images of the page, in the storage of the generator.
290
+ *
291
+ * @defaultValue `[]`
292
+ */
293
+ images?: PageImage[];
294
+ isVisible?: boolean;
295
+ /**
296
+ * Content of the page, in the JSON of the editor.
297
+ */
298
+ jsonContent?: JsonContent;
299
+ /**
300
+ * Identifier of the last contributor.
301
+ */
302
+ lastContributer?: string;
303
+ lastContributerName?: string;
304
+ /**
305
+ * Modification date, ISO 8601.
306
+ */
307
+ modified?: string;
308
+ /**
309
+ * Position of the page in the wiki.
310
+ */
311
+ position?: number;
312
+ title?: string;
313
+ }
314
+ /**
315
+ * An image of a generated page.
316
+ */
317
+ export interface PageImage {
318
+ contentType?: string;
319
+ /**
320
+ * Identifier of the image in the storage of the generator.
321
+ */
322
+ id?: string;
323
+ /**
324
+ * @defaultValue `""`
325
+ */
326
+ name?: string;
327
+ /**
328
+ * Size in bytes.
329
+ */
330
+ size?: number;
331
+ /**
332
+ * URL of the image in the content of the page.
333
+ */
334
+ url?: string;
335
+ }
336
+ /**
337
+ * A page of the structure of a generated wiki.
338
+ */
339
+ export interface PageStructure {
340
+ /**
341
+ * Whether the page is the main page of the wiki.
342
+ *
343
+ * @defaultValue `true`
344
+ */
345
+ is_main_page?: boolean;
346
+ /**
347
+ * Parent page, when the page is a sub page.
348
+ */
349
+ parent_id?: string;
350
+ /**
351
+ * Position of the page in the wiki.
352
+ */
353
+ position?: number;
354
+ /**
355
+ * Theme of the page.
356
+ */
357
+ theme?: string;
358
+ /**
359
+ * Title of the page.
360
+ */
361
+ title?: string;
362
+ }
363
+ /**
364
+ * Tokens used by a generation.
365
+ */
366
+ export interface Usage {
367
+ completion_tokens?: number;
368
+ prompt_tokens?: number;
369
+ total_tokens?: number;
370
+ }
371
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/nats/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;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,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@edifice.io/aiwiki-v2-node-api",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Clients to interact with aiwiki-v2-nats-service",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "keywords": [],
10
+ "author": "Edifice",
11
+ "license": "AGPL-3.0",
12
+ "engines": {
13
+ "node": "22"
14
+ },
15
+ "engineStrict": true,
16
+ "type": "module",
17
+ "exports": {
18
+ ".": {
19
+ "require": "./dist/index.umd.cjs",
20
+ "import": "./dist/index.js",
21
+ "types": "./dist/index.d.ts"
22
+ }
23
+ },
24
+ "main": "dist/index.umd.cjs",
25
+ "module": "dist/index.js",
26
+ "types": "dist/index.d.ts",
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "dependencies": {
31
+ "@nats-io/transport-node": "3.2.0",
32
+ "@nats-io/nats-core": "3.2.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "25.2.0",
36
+ "husky": "9.0.11",
37
+ "prettier": "3.2.5",
38
+ "semantic-release": "23.0.2",
39
+ "typescript": "5.2.2",
40
+ "vite": "5.1.4",
41
+ "vite-plugin-dts": "4.3.0",
42
+ "rxjs": "7.8.1"
43
+ },
44
+ "lint-staged": {
45
+ "*.{js,ts,jsx,tsx,json,css,md}": "pnpm format"
46
+ },
47
+ "scripts": {
48
+ "dev": "vite",
49
+ "build": "tsc && vite build",
50
+ "build:types": "tsc --build",
51
+ "preview": "vite preview",
52
+ "clean": "rm -Rf dist",
53
+ "format": "pnpm run format:write && pnpm run format:check",
54
+ "format:check": "npx prettier --check \"src/**/*.ts\"",
55
+ "format:write": "npx prettier --write \"src/**/*.ts\"",
56
+ "pre-commit": "pnpm run format"
57
+ }
6
58
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.