@spader/spall-sdk 1.0.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 (70) hide show
  1. package/dist/app.d.ts +7 -0
  2. package/dist/app.d.ts.map +1 -0
  3. package/dist/client.d.ts +20 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +1642 -0
  6. package/dist/client.js.map +21 -0
  7. package/dist/gen/client/client.gen.d.ts +3 -0
  8. package/dist/gen/client/client.gen.d.ts.map +1 -0
  9. package/dist/gen/client/index.d.ts +9 -0
  10. package/dist/gen/client/index.d.ts.map +1 -0
  11. package/dist/gen/client/types.gen.d.ts +118 -0
  12. package/dist/gen/client/types.gen.d.ts.map +1 -0
  13. package/dist/gen/client/utils.gen.d.ts +34 -0
  14. package/dist/gen/client/utils.gen.d.ts.map +1 -0
  15. package/dist/gen/client.gen.d.ts +13 -0
  16. package/dist/gen/client.gen.d.ts.map +1 -0
  17. package/dist/gen/core/auth.gen.d.ts +19 -0
  18. package/dist/gen/core/auth.gen.d.ts.map +1 -0
  19. package/dist/gen/core/bodySerializer.gen.d.ts +26 -0
  20. package/dist/gen/core/bodySerializer.gen.d.ts.map +1 -0
  21. package/dist/gen/core/params.gen.d.ts +44 -0
  22. package/dist/gen/core/params.gen.d.ts.map +1 -0
  23. package/dist/gen/core/pathSerializer.gen.d.ts +34 -0
  24. package/dist/gen/core/pathSerializer.gen.d.ts.map +1 -0
  25. package/dist/gen/core/queryKeySerializer.gen.d.ts +19 -0
  26. package/dist/gen/core/queryKeySerializer.gen.d.ts.map +1 -0
  27. package/dist/gen/core/serverSentEvents.gen.d.ts +72 -0
  28. package/dist/gen/core/serverSentEvents.gen.d.ts.map +1 -0
  29. package/dist/gen/core/types.gen.d.ts +79 -0
  30. package/dist/gen/core/types.gen.d.ts.map +1 -0
  31. package/dist/gen/core/utils.gen.d.ts +20 -0
  32. package/dist/gen/core/utils.gen.d.ts.map +1 -0
  33. package/dist/gen/index.d.ts +3 -0
  34. package/dist/gen/index.d.ts.map +1 -0
  35. package/dist/gen/sdk.gen.d.ts +358 -0
  36. package/dist/gen/sdk.gen.d.ts.map +1 -0
  37. package/dist/gen/types.gen.d.ts +1596 -0
  38. package/dist/gen/types.gen.d.ts.map +1 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +2925 -0
  42. package/dist/index.js.map +32 -0
  43. package/dist/lock.d.ts +20 -0
  44. package/dist/lock.d.ts.map +1 -0
  45. package/dist/log.d.ts +22 -0
  46. package/dist/log.d.ts.map +1 -0
  47. package/dist/routes/commit.d.ts +19 -0
  48. package/dist/routes/commit.d.ts.map +1 -0
  49. package/dist/routes/corpus.d.ts +317 -0
  50. package/dist/routes/corpus.d.ts.map +1 -0
  51. package/dist/routes/note.d.ts +79 -0
  52. package/dist/routes/note.d.ts.map +1 -0
  53. package/dist/routes/query.d.ts +314 -0
  54. package/dist/routes/query.d.ts.map +1 -0
  55. package/dist/routes/sse.d.ts +75 -0
  56. package/dist/routes/sse.d.ts.map +1 -0
  57. package/dist/routes/workspace.d.ts +102 -0
  58. package/dist/routes/workspace.d.ts.map +1 -0
  59. package/dist/serve.d.ts +2 -0
  60. package/dist/serve.d.ts.map +1 -0
  61. package/dist/server.d.ts +27 -0
  62. package/dist/server.d.ts.map +1 -0
  63. package/dist/server.js +1433 -0
  64. package/dist/server.js.map +21 -0
  65. package/dist/sse.d.ts +8 -0
  66. package/dist/sse.d.ts.map +1 -0
  67. package/dist/util.d.ts +5 -0
  68. package/dist/util.d.ts.map +1 -0
  69. package/openapi.json +5694 -0
  70. package/package.json +70 -0
@@ -0,0 +1,314 @@
1
+ export declare const QueryRoutes: {
2
+ (): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
3
+ "/": {
4
+ $post: {
5
+ input: {
6
+ json: {
7
+ viewer: unknown;
8
+ corpora: unknown[];
9
+ tracked?: boolean | undefined;
10
+ };
11
+ };
12
+ output: {
13
+ code: string;
14
+ message: string;
15
+ };
16
+ outputFormat: "json";
17
+ status: 404;
18
+ } | {
19
+ input: {
20
+ json: {
21
+ viewer: unknown;
22
+ corpora: unknown[];
23
+ tracked?: boolean | undefined;
24
+ };
25
+ };
26
+ output: {
27
+ id: number & import("zod").$brand<"QueryId">;
28
+ viewer: number & import("zod").$brand<"WorkspaceId">;
29
+ tracked: boolean;
30
+ corpora: (number & import("zod").$brand<"CorpusId">)[];
31
+ createdAt: number;
32
+ };
33
+ outputFormat: "json";
34
+ status: import("hono/utils/http-status").ContentfulStatusCode;
35
+ };
36
+ };
37
+ } & {
38
+ "/recent": {
39
+ $get: {
40
+ input: {
41
+ query: {
42
+ limit?: string | string[] | undefined;
43
+ };
44
+ };
45
+ output: {
46
+ queries: {
47
+ id: number & import("zod").$brand<"QueryId">;
48
+ viewer: number & import("zod").$brand<"WorkspaceId">;
49
+ tracked: boolean;
50
+ corpora: (number & import("zod").$brand<"CorpusId">)[];
51
+ createdAt: number;
52
+ }[];
53
+ };
54
+ outputFormat: "json";
55
+ status: import("hono/utils/http-status").ContentfulStatusCode;
56
+ };
57
+ };
58
+ } & {
59
+ "/:id": {
60
+ $get: {
61
+ input: {
62
+ param: {
63
+ id: string;
64
+ };
65
+ };
66
+ output: {
67
+ code: string;
68
+ message: string;
69
+ };
70
+ outputFormat: "json";
71
+ status: 404;
72
+ } | {
73
+ input: {
74
+ param: {
75
+ id: string;
76
+ };
77
+ };
78
+ output: {
79
+ id: number & import("zod").$brand<"QueryId">;
80
+ viewer: number & import("zod").$brand<"WorkspaceId">;
81
+ tracked: boolean;
82
+ corpora: (number & import("zod").$brand<"CorpusId">)[];
83
+ createdAt: number;
84
+ };
85
+ outputFormat: "json";
86
+ status: import("hono/utils/http-status").ContentfulStatusCode;
87
+ };
88
+ };
89
+ } & {
90
+ "/:id/notes": {
91
+ $get: {
92
+ input: {
93
+ query: {
94
+ path?: string | string[] | undefined;
95
+ limit?: string | string[] | undefined;
96
+ after?: string | string[] | undefined;
97
+ };
98
+ } & {
99
+ param: {
100
+ id: string;
101
+ };
102
+ };
103
+ output: {
104
+ code: string;
105
+ message: string;
106
+ };
107
+ outputFormat: "json";
108
+ status: 404;
109
+ } | {
110
+ input: {
111
+ query: {
112
+ path?: string | string[] | undefined;
113
+ limit?: string | string[] | undefined;
114
+ after?: string | string[] | undefined;
115
+ };
116
+ } & {
117
+ param: {
118
+ id: string;
119
+ };
120
+ };
121
+ output: {
122
+ notes: {
123
+ id: number & import("zod").$brand<"NoteId">;
124
+ corpus: number & import("zod").$brand<"CorpusId">;
125
+ path: string;
126
+ size: number;
127
+ content: string;
128
+ contentHash: string;
129
+ }[];
130
+ nextCursor: string | null;
131
+ };
132
+ outputFormat: "json";
133
+ status: import("hono/utils/http-status").ContentfulStatusCode;
134
+ };
135
+ };
136
+ } & {
137
+ "/:id/search": {
138
+ $get: {
139
+ input: {
140
+ query: {
141
+ q: string | string[];
142
+ path?: string | string[] | undefined;
143
+ limit?: string | string[] | undefined;
144
+ mode?: string | string[] | undefined;
145
+ };
146
+ } & {
147
+ param: {
148
+ id: string;
149
+ };
150
+ };
151
+ output: {
152
+ code: string;
153
+ message: string;
154
+ };
155
+ outputFormat: "json";
156
+ status: 404;
157
+ } | {
158
+ input: {
159
+ query: {
160
+ q: string | string[];
161
+ path?: string | string[] | undefined;
162
+ limit?: string | string[] | undefined;
163
+ mode?: string | string[] | undefined;
164
+ };
165
+ } & {
166
+ param: {
167
+ id: string;
168
+ };
169
+ };
170
+ output: {
171
+ results: {
172
+ id: number & import("zod").$brand<"NoteId">;
173
+ corpus: number & import("zod").$brand<"CorpusId">;
174
+ path: string;
175
+ size: number;
176
+ snippet: string;
177
+ score: number;
178
+ }[];
179
+ };
180
+ outputFormat: "json";
181
+ status: import("hono/utils/http-status").ContentfulStatusCode;
182
+ };
183
+ };
184
+ } & {
185
+ "/:id/vsearch": {
186
+ $get: {
187
+ input: {
188
+ query: {
189
+ q: string | string[];
190
+ path?: string | string[] | undefined;
191
+ limit?: string | string[] | undefined;
192
+ };
193
+ } & {
194
+ param: {
195
+ id: string;
196
+ };
197
+ };
198
+ output: {
199
+ code: string;
200
+ message: string;
201
+ };
202
+ outputFormat: "json";
203
+ status: 404;
204
+ } | {
205
+ input: {
206
+ query: {
207
+ q: string | string[];
208
+ path?: string | string[] | undefined;
209
+ limit?: string | string[] | undefined;
210
+ };
211
+ } & {
212
+ param: {
213
+ id: string;
214
+ };
215
+ };
216
+ output: {
217
+ results: {
218
+ id: number & import("zod").$brand<"NoteId">;
219
+ corpus: number & import("zod").$brand<"CorpusId">;
220
+ path: string;
221
+ size: number;
222
+ chunk: string;
223
+ chunkPos: number;
224
+ score: number;
225
+ }[];
226
+ };
227
+ outputFormat: "json";
228
+ status: import("hono/utils/http-status").ContentfulStatusCode;
229
+ };
230
+ };
231
+ } & {
232
+ "/:id/fetch": {
233
+ $post: {
234
+ input: {
235
+ json: {
236
+ ids: unknown[];
237
+ };
238
+ } & {
239
+ param: {
240
+ id: string;
241
+ };
242
+ };
243
+ output: {
244
+ code: string;
245
+ message: string;
246
+ };
247
+ outputFormat: "json";
248
+ status: 404;
249
+ } | {
250
+ input: {
251
+ json: {
252
+ ids: unknown[];
253
+ };
254
+ } & {
255
+ param: {
256
+ id: string;
257
+ };
258
+ };
259
+ output: {
260
+ notes: {
261
+ id: number & import("zod").$brand<"NoteId">;
262
+ corpus: number & import("zod").$brand<"CorpusId">;
263
+ path: string;
264
+ size: number;
265
+ content: string;
266
+ contentHash: string;
267
+ }[];
268
+ };
269
+ outputFormat: "json";
270
+ status: import("hono/utils/http-status").ContentfulStatusCode;
271
+ };
272
+ };
273
+ } & {
274
+ "/:id/paths": {
275
+ $get: {
276
+ input: {
277
+ query: {
278
+ path?: string | undefined;
279
+ };
280
+ } & {
281
+ param: {
282
+ id: string;
283
+ };
284
+ };
285
+ output: {
286
+ code: string;
287
+ message: string;
288
+ };
289
+ outputFormat: "json";
290
+ status: 404;
291
+ } | {
292
+ input: {
293
+ query: {
294
+ path?: string | undefined;
295
+ };
296
+ } & {
297
+ param: {
298
+ id: string;
299
+ };
300
+ };
301
+ output: {
302
+ paths: {
303
+ corpus: number & import("zod").$brand<"CorpusId">;
304
+ paths: string[];
305
+ }[];
306
+ };
307
+ outputFormat: "json";
308
+ status: import("hono/utils/http-status").ContentfulStatusCode;
309
+ };
310
+ };
311
+ }, "/", "/:id/paths">;
312
+ reset(): void;
313
+ };
314
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/routes/query.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+SvB,CAAC"}
@@ -0,0 +1,75 @@
1
+ export declare const SseRoutes: {
2
+ (): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
3
+ "/corpus/sync": {
4
+ $post: {
5
+ input: {
6
+ json: {
7
+ directory: string;
8
+ corpus: unknown;
9
+ glob?: string | undefined;
10
+ path?: string | undefined;
11
+ };
12
+ };
13
+ output: {};
14
+ outputFormat: string;
15
+ status: import("hono/utils/http-status").StatusCode;
16
+ };
17
+ };
18
+ } & {
19
+ "/corpus/note": {
20
+ $post: {
21
+ input: {
22
+ json: {
23
+ corpus: unknown;
24
+ path: string;
25
+ content: string;
26
+ dupe?: boolean | undefined;
27
+ };
28
+ };
29
+ output: {};
30
+ outputFormat: string;
31
+ status: import("hono/utils/http-status").StatusCode;
32
+ };
33
+ };
34
+ } & {
35
+ "/corpus/:id/note/:path{.+}": {
36
+ $put: {
37
+ input: {
38
+ json: {
39
+ content: string;
40
+ dupe?: boolean | undefined;
41
+ };
42
+ } & {
43
+ param: {
44
+ id: string;
45
+ } & {
46
+ path: string;
47
+ };
48
+ };
49
+ output: {};
50
+ outputFormat: string;
51
+ status: import("hono/utils/http-status").StatusCode;
52
+ };
53
+ };
54
+ } & {
55
+ "/note/:id": {
56
+ $put: {
57
+ input: {
58
+ json: {
59
+ content: string;
60
+ dupe?: boolean | undefined;
61
+ };
62
+ } & {
63
+ param: {
64
+ id: string;
65
+ };
66
+ };
67
+ output: {};
68
+ outputFormat: string;
69
+ status: import("hono/utils/http-status").StatusCode;
70
+ };
71
+ };
72
+ }, "/", "/note/:id">;
73
+ reset(): void;
74
+ };
75
+ //# sourceMappingURL=sse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/routes/sse.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4GrB,CAAC"}
@@ -0,0 +1,102 @@
1
+ export declare const WorkspaceRoutes: {
2
+ (): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
3
+ "/": {
4
+ $post: {
5
+ input: {
6
+ json: {
7
+ name: string;
8
+ };
9
+ };
10
+ output: {
11
+ id: number & import("zod").$brand<"WorkspaceId">;
12
+ name: string;
13
+ createdAt: number;
14
+ updatedAt: number;
15
+ };
16
+ outputFormat: "json";
17
+ status: import("hono/utils/http-status").ContentfulStatusCode;
18
+ };
19
+ };
20
+ } & {
21
+ "/list": {
22
+ $get: {
23
+ input: {};
24
+ output: {
25
+ code: string;
26
+ message: string;
27
+ };
28
+ outputFormat: "json";
29
+ status: 500;
30
+ } | {
31
+ input: {};
32
+ output: {
33
+ id: number & import("zod").$brand<"WorkspaceId">;
34
+ name: string;
35
+ createdAt: number;
36
+ updatedAt: number;
37
+ }[];
38
+ outputFormat: "json";
39
+ status: import("hono/utils/http-status").ContentfulStatusCode;
40
+ };
41
+ };
42
+ } & {
43
+ "/": {
44
+ $get: {
45
+ input: {
46
+ query: {
47
+ name?: string | string[] | undefined;
48
+ id?: string | string[] | undefined;
49
+ };
50
+ };
51
+ output: {
52
+ code: string;
53
+ message: string;
54
+ };
55
+ outputFormat: "json";
56
+ status: 404;
57
+ } | {
58
+ input: {
59
+ query: {
60
+ name?: string | string[] | undefined;
61
+ id?: string | string[] | undefined;
62
+ };
63
+ };
64
+ output: {
65
+ id: number & import("zod").$brand<"WorkspaceId">;
66
+ name: string;
67
+ createdAt: number;
68
+ updatedAt: number;
69
+ };
70
+ outputFormat: "json";
71
+ status: import("hono/utils/http-status").ContentfulStatusCode;
72
+ };
73
+ };
74
+ } & {
75
+ "/:id": {
76
+ $delete: {
77
+ input: {
78
+ param: {
79
+ id: string;
80
+ };
81
+ };
82
+ output: {
83
+ code: string;
84
+ message: string;
85
+ };
86
+ outputFormat: "json";
87
+ status: 404;
88
+ } | {
89
+ input: {
90
+ param: {
91
+ id: string;
92
+ };
93
+ };
94
+ output: null;
95
+ outputFormat: "body";
96
+ status: 204;
97
+ };
98
+ };
99
+ }, "/", "/:id">;
100
+ reset(): void;
101
+ };
102
+ //# sourceMappingURL=workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/routes/workspace.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+H3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { type EventUnion } from "@spader/spall-core";
2
+ export { Lock } from "./lock";
3
+ export { ensure } from "./lock";
4
+ export { isProcessAlive, checkHealth } from "./lock";
5
+ export declare namespace Server {
6
+ type Options = {
7
+ persist: boolean;
8
+ idleTimeoutMs: number;
9
+ force: boolean;
10
+ };
11
+ namespace Sse {
12
+ function active(): boolean;
13
+ function track(): void;
14
+ function untrack(): void;
15
+ function reset(): void;
16
+ }
17
+ function increment(): void;
18
+ function decrement(): void;
19
+ interface ServerResult {
20
+ port: number;
21
+ stopped: Promise<void>;
22
+ }
23
+ function render(event: EventUnion): string;
24
+ function start(request?: Partial<Options>): Promise<ServerResult>;
25
+ function stop(): void;
26
+ }
27
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAuBrD,yBAAiB,MAAM,CAAC;IAiCtB,KAAY,OAAO,GAAG;QACpB,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IAEF,UAAiB,GAAG,CAAC;QAGnB,SAAgB,MAAM,IAAI,OAAO,CAEhC;QAED,SAAgB,KAAK,IAAI,IAAI,CAG5B;QAED,SAAgB,OAAO,IAAI,IAAI,CAG9B;QAED,SAAgB,KAAK,IAAI,IAAI,CAE5B;KACF;IAED,SAAgB,SAAS,IAAI,IAAI,CAGhC;IAED,SAAgB,SAAS,IAAI,IAAI,CAGhC;IAaD,UAAiB,YAAY;QAC3B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;KACxB;IAED,SAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CA6BhD;IAED,SAAsB,KAAK,CACzB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GACzB,OAAO,CAAC,YAAY,CAAC,CAgGvB;IAED,SAAgB,IAAI,IAAI,IAAI,CAe3B;CACF"}