@deepnote/convert 1.3.0 → 2.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.
- package/README.md +154 -71
- package/dist/bin.js +154 -45
- package/dist/index.d.ts +1097 -3
- package/dist/index.js +2 -2
- package/dist/src-CUESP0m8.js +1441 -0
- package/package.json +2 -2
- package/dist/src-j4HyYJfD.js +0 -279
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,634 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
|
+
//#region ../blocks/src/deserialize-file/deepnote-file-schema.d.ts
|
|
4
|
+
declare const deepnoteBlockSchema: z.ZodObject<{
|
|
5
|
+
blockGroup: z.ZodString;
|
|
6
|
+
content: z.ZodOptional<z.ZodString>;
|
|
7
|
+
contentHash: z.ZodOptional<z.ZodString>;
|
|
8
|
+
executionCount: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
executionFinishedAt: z.ZodOptional<z.ZodString>;
|
|
10
|
+
executionStartedAt: z.ZodOptional<z.ZodString>;
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
13
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
14
|
+
sortingKey: z.ZodString;
|
|
15
|
+
type: z.ZodString;
|
|
16
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
blockGroup: string;
|
|
19
|
+
id: string;
|
|
20
|
+
type: string;
|
|
21
|
+
sortingKey: string;
|
|
22
|
+
content?: string | undefined;
|
|
23
|
+
contentHash?: string | undefined;
|
|
24
|
+
executionCount?: number | undefined;
|
|
25
|
+
executionFinishedAt?: string | undefined;
|
|
26
|
+
executionStartedAt?: string | undefined;
|
|
27
|
+
metadata?: Record<string, any> | undefined;
|
|
28
|
+
outputs?: any[] | undefined;
|
|
29
|
+
version?: number | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
blockGroup: string;
|
|
32
|
+
id: string;
|
|
33
|
+
type: string;
|
|
34
|
+
sortingKey: string;
|
|
35
|
+
content?: string | undefined;
|
|
36
|
+
contentHash?: string | undefined;
|
|
37
|
+
executionCount?: number | undefined;
|
|
38
|
+
executionFinishedAt?: string | undefined;
|
|
39
|
+
executionStartedAt?: string | undefined;
|
|
40
|
+
metadata?: Record<string, any> | undefined;
|
|
41
|
+
outputs?: any[] | undefined;
|
|
42
|
+
version?: number | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
type DeepnoteBlock = z.infer<typeof deepnoteBlockSchema>;
|
|
45
|
+
declare const environmentSchema: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
customImage: z.ZodOptional<z.ZodString>;
|
|
47
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
48
|
+
packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
49
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
50
|
+
python: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
environment: z.ZodOptional<z.ZodEnum<["uv", "conda", "venv", "poetry", "system"]>>;
|
|
52
|
+
version: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
version?: string | undefined;
|
|
55
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
version?: string | undefined;
|
|
58
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
59
|
+
}>>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
customImage?: string | undefined;
|
|
62
|
+
hash?: string | undefined;
|
|
63
|
+
packages?: Record<string, string> | undefined;
|
|
64
|
+
platform?: string | undefined;
|
|
65
|
+
python?: {
|
|
66
|
+
version?: string | undefined;
|
|
67
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
customImage?: string | undefined;
|
|
71
|
+
hash?: string | undefined;
|
|
72
|
+
packages?: Record<string, string> | undefined;
|
|
73
|
+
platform?: string | undefined;
|
|
74
|
+
python?: {
|
|
75
|
+
version?: string | undefined;
|
|
76
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
}>>;
|
|
79
|
+
type Environment = z.infer<typeof environmentSchema>;
|
|
80
|
+
declare const executionSchema: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
message: z.ZodOptional<z.ZodString>;
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
traceback: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
message?: string | undefined;
|
|
87
|
+
name?: string | undefined;
|
|
88
|
+
traceback?: string[] | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
message?: string | undefined;
|
|
91
|
+
name?: string | undefined;
|
|
92
|
+
traceback?: string[] | undefined;
|
|
93
|
+
}>>;
|
|
94
|
+
finishedAt: z.ZodOptional<z.ZodString>;
|
|
95
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
96
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
97
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
blocksExecuted: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
blocksFailed: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
blocksSucceeded: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
totalDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
blocksExecuted?: number | undefined;
|
|
104
|
+
blocksFailed?: number | undefined;
|
|
105
|
+
blocksSucceeded?: number | undefined;
|
|
106
|
+
totalDurationMs?: number | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
blocksExecuted?: number | undefined;
|
|
109
|
+
blocksFailed?: number | undefined;
|
|
110
|
+
blocksSucceeded?: number | undefined;
|
|
111
|
+
totalDurationMs?: number | undefined;
|
|
112
|
+
}>>;
|
|
113
|
+
triggeredBy: z.ZodOptional<z.ZodEnum<["user", "schedule", "api", "ci"]>>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
error?: {
|
|
116
|
+
message?: string | undefined;
|
|
117
|
+
name?: string | undefined;
|
|
118
|
+
traceback?: string[] | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
finishedAt?: string | undefined;
|
|
121
|
+
inputs?: Record<string, unknown> | undefined;
|
|
122
|
+
startedAt?: string | undefined;
|
|
123
|
+
summary?: {
|
|
124
|
+
blocksExecuted?: number | undefined;
|
|
125
|
+
blocksFailed?: number | undefined;
|
|
126
|
+
blocksSucceeded?: number | undefined;
|
|
127
|
+
totalDurationMs?: number | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
triggeredBy?: "user" | "schedule" | "api" | "ci" | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
error?: {
|
|
132
|
+
message?: string | undefined;
|
|
133
|
+
name?: string | undefined;
|
|
134
|
+
traceback?: string[] | undefined;
|
|
135
|
+
} | undefined;
|
|
136
|
+
finishedAt?: string | undefined;
|
|
137
|
+
inputs?: Record<string, unknown> | undefined;
|
|
138
|
+
startedAt?: string | undefined;
|
|
139
|
+
summary?: {
|
|
140
|
+
blocksExecuted?: number | undefined;
|
|
141
|
+
blocksFailed?: number | undefined;
|
|
142
|
+
blocksSucceeded?: number | undefined;
|
|
143
|
+
totalDurationMs?: number | undefined;
|
|
144
|
+
} | undefined;
|
|
145
|
+
triggeredBy?: "user" | "schedule" | "api" | "ci" | undefined;
|
|
146
|
+
}>>;
|
|
147
|
+
type Execution = z.infer<typeof executionSchema>;
|
|
148
|
+
declare const deepnoteFileSchema: z.ZodObject<{
|
|
149
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
customImage: z.ZodOptional<z.ZodString>;
|
|
151
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
152
|
+
packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
153
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
154
|
+
python: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
environment: z.ZodOptional<z.ZodEnum<["uv", "conda", "venv", "poetry", "system"]>>;
|
|
156
|
+
version: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
version?: string | undefined;
|
|
159
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
version?: string | undefined;
|
|
162
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
163
|
+
}>>;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
customImage?: string | undefined;
|
|
166
|
+
hash?: string | undefined;
|
|
167
|
+
packages?: Record<string, string> | undefined;
|
|
168
|
+
platform?: string | undefined;
|
|
169
|
+
python?: {
|
|
170
|
+
version?: string | undefined;
|
|
171
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
172
|
+
} | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
customImage?: string | undefined;
|
|
175
|
+
hash?: string | undefined;
|
|
176
|
+
packages?: Record<string, string> | undefined;
|
|
177
|
+
platform?: string | undefined;
|
|
178
|
+
python?: {
|
|
179
|
+
version?: string | undefined;
|
|
180
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
181
|
+
} | undefined;
|
|
182
|
+
}>>;
|
|
183
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
message: z.ZodOptional<z.ZodString>;
|
|
186
|
+
name: z.ZodOptional<z.ZodString>;
|
|
187
|
+
traceback: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
message?: string | undefined;
|
|
190
|
+
name?: string | undefined;
|
|
191
|
+
traceback?: string[] | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
message?: string | undefined;
|
|
194
|
+
name?: string | undefined;
|
|
195
|
+
traceback?: string[] | undefined;
|
|
196
|
+
}>>;
|
|
197
|
+
finishedAt: z.ZodOptional<z.ZodString>;
|
|
198
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
199
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
200
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
blocksExecuted: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
blocksFailed: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
blocksSucceeded: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
totalDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
blocksExecuted?: number | undefined;
|
|
207
|
+
blocksFailed?: number | undefined;
|
|
208
|
+
blocksSucceeded?: number | undefined;
|
|
209
|
+
totalDurationMs?: number | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
blocksExecuted?: number | undefined;
|
|
212
|
+
blocksFailed?: number | undefined;
|
|
213
|
+
blocksSucceeded?: number | undefined;
|
|
214
|
+
totalDurationMs?: number | undefined;
|
|
215
|
+
}>>;
|
|
216
|
+
triggeredBy: z.ZodOptional<z.ZodEnum<["user", "schedule", "api", "ci"]>>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
error?: {
|
|
219
|
+
message?: string | undefined;
|
|
220
|
+
name?: string | undefined;
|
|
221
|
+
traceback?: string[] | undefined;
|
|
222
|
+
} | undefined;
|
|
223
|
+
finishedAt?: string | undefined;
|
|
224
|
+
inputs?: Record<string, unknown> | undefined;
|
|
225
|
+
startedAt?: string | undefined;
|
|
226
|
+
summary?: {
|
|
227
|
+
blocksExecuted?: number | undefined;
|
|
228
|
+
blocksFailed?: number | undefined;
|
|
229
|
+
blocksSucceeded?: number | undefined;
|
|
230
|
+
totalDurationMs?: number | undefined;
|
|
231
|
+
} | undefined;
|
|
232
|
+
triggeredBy?: "user" | "schedule" | "api" | "ci" | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
error?: {
|
|
235
|
+
message?: string | undefined;
|
|
236
|
+
name?: string | undefined;
|
|
237
|
+
traceback?: string[] | undefined;
|
|
238
|
+
} | undefined;
|
|
239
|
+
finishedAt?: string | undefined;
|
|
240
|
+
inputs?: Record<string, unknown> | undefined;
|
|
241
|
+
startedAt?: string | undefined;
|
|
242
|
+
summary?: {
|
|
243
|
+
blocksExecuted?: number | undefined;
|
|
244
|
+
blocksFailed?: number | undefined;
|
|
245
|
+
blocksSucceeded?: number | undefined;
|
|
246
|
+
totalDurationMs?: number | undefined;
|
|
247
|
+
} | undefined;
|
|
248
|
+
triggeredBy?: "user" | "schedule" | "api" | "ci" | undefined;
|
|
249
|
+
}>>;
|
|
250
|
+
metadata: z.ZodObject<{
|
|
251
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
252
|
+
createdAt: z.ZodString;
|
|
253
|
+
exportedAt: z.ZodOptional<z.ZodString>;
|
|
254
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
createdAt: string;
|
|
257
|
+
checksum?: string | undefined;
|
|
258
|
+
exportedAt?: string | undefined;
|
|
259
|
+
modifiedAt?: string | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
createdAt: string;
|
|
262
|
+
checksum?: string | undefined;
|
|
263
|
+
exportedAt?: string | undefined;
|
|
264
|
+
modifiedAt?: string | undefined;
|
|
265
|
+
}>;
|
|
266
|
+
project: z.ZodObject<{
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
initNotebookId: z.ZodOptional<z.ZodString>;
|
|
269
|
+
integrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
270
|
+
id: z.ZodString;
|
|
271
|
+
name: z.ZodString;
|
|
272
|
+
type: z.ZodString;
|
|
273
|
+
}, "strip", z.ZodTypeAny, {
|
|
274
|
+
id: string;
|
|
275
|
+
type: string;
|
|
276
|
+
name: string;
|
|
277
|
+
}, {
|
|
278
|
+
id: string;
|
|
279
|
+
type: string;
|
|
280
|
+
name: string;
|
|
281
|
+
}>, "many">>;
|
|
282
|
+
name: z.ZodString;
|
|
283
|
+
notebooks: z.ZodArray<z.ZodObject<{
|
|
284
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
285
|
+
blockGroup: z.ZodString;
|
|
286
|
+
content: z.ZodOptional<z.ZodString>;
|
|
287
|
+
contentHash: z.ZodOptional<z.ZodString>;
|
|
288
|
+
executionCount: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
executionFinishedAt: z.ZodOptional<z.ZodString>;
|
|
290
|
+
executionStartedAt: z.ZodOptional<z.ZodString>;
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
293
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
294
|
+
sortingKey: z.ZodString;
|
|
295
|
+
type: z.ZodString;
|
|
296
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
blockGroup: string;
|
|
299
|
+
id: string;
|
|
300
|
+
type: string;
|
|
301
|
+
sortingKey: string;
|
|
302
|
+
content?: string | undefined;
|
|
303
|
+
contentHash?: string | undefined;
|
|
304
|
+
executionCount?: number | undefined;
|
|
305
|
+
executionFinishedAt?: string | undefined;
|
|
306
|
+
executionStartedAt?: string | undefined;
|
|
307
|
+
metadata?: Record<string, any> | undefined;
|
|
308
|
+
outputs?: any[] | undefined;
|
|
309
|
+
version?: number | undefined;
|
|
310
|
+
}, {
|
|
311
|
+
blockGroup: string;
|
|
312
|
+
id: string;
|
|
313
|
+
type: string;
|
|
314
|
+
sortingKey: string;
|
|
315
|
+
content?: string | undefined;
|
|
316
|
+
contentHash?: string | undefined;
|
|
317
|
+
executionCount?: number | undefined;
|
|
318
|
+
executionFinishedAt?: string | undefined;
|
|
319
|
+
executionStartedAt?: string | undefined;
|
|
320
|
+
metadata?: Record<string, any> | undefined;
|
|
321
|
+
outputs?: any[] | undefined;
|
|
322
|
+
version?: number | undefined;
|
|
323
|
+
}>, "many">;
|
|
324
|
+
executionMode: z.ZodOptional<z.ZodEnum<["block", "downstream"]>>;
|
|
325
|
+
id: z.ZodString;
|
|
326
|
+
isModule: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
+
name: z.ZodString;
|
|
328
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
329
|
+
}, "strip", z.ZodTypeAny, {
|
|
330
|
+
id: string;
|
|
331
|
+
name: string;
|
|
332
|
+
blocks: {
|
|
333
|
+
blockGroup: string;
|
|
334
|
+
id: string;
|
|
335
|
+
type: string;
|
|
336
|
+
sortingKey: string;
|
|
337
|
+
content?: string | undefined;
|
|
338
|
+
contentHash?: string | undefined;
|
|
339
|
+
executionCount?: number | undefined;
|
|
340
|
+
executionFinishedAt?: string | undefined;
|
|
341
|
+
executionStartedAt?: string | undefined;
|
|
342
|
+
metadata?: Record<string, any> | undefined;
|
|
343
|
+
outputs?: any[] | undefined;
|
|
344
|
+
version?: number | undefined;
|
|
345
|
+
}[];
|
|
346
|
+
executionMode?: "block" | "downstream" | undefined;
|
|
347
|
+
isModule?: boolean | undefined;
|
|
348
|
+
workingDirectory?: string | undefined;
|
|
349
|
+
}, {
|
|
350
|
+
id: string;
|
|
351
|
+
name: string;
|
|
352
|
+
blocks: {
|
|
353
|
+
blockGroup: string;
|
|
354
|
+
id: string;
|
|
355
|
+
type: string;
|
|
356
|
+
sortingKey: string;
|
|
357
|
+
content?: string | undefined;
|
|
358
|
+
contentHash?: string | undefined;
|
|
359
|
+
executionCount?: number | undefined;
|
|
360
|
+
executionFinishedAt?: string | undefined;
|
|
361
|
+
executionStartedAt?: string | undefined;
|
|
362
|
+
metadata?: Record<string, any> | undefined;
|
|
363
|
+
outputs?: any[] | undefined;
|
|
364
|
+
version?: number | undefined;
|
|
365
|
+
}[];
|
|
366
|
+
executionMode?: "block" | "downstream" | undefined;
|
|
367
|
+
isModule?: boolean | undefined;
|
|
368
|
+
workingDirectory?: string | undefined;
|
|
369
|
+
}>, "many">;
|
|
370
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
371
|
+
/**
|
|
372
|
+
* @deprecated Use top-level `environment` instead.
|
|
373
|
+
* This field is kept for backward compatibility.
|
|
374
|
+
*/
|
|
375
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
376
|
+
customImage: z.ZodOptional<z.ZodString>;
|
|
377
|
+
pythonVersion: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, "strip", z.ZodTypeAny, {
|
|
379
|
+
customImage?: string | undefined;
|
|
380
|
+
pythonVersion?: string | undefined;
|
|
381
|
+
}, {
|
|
382
|
+
customImage?: string | undefined;
|
|
383
|
+
pythonVersion?: string | undefined;
|
|
384
|
+
}>>;
|
|
385
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
386
|
+
sqlCacheMaxAge: z.ZodOptional<z.ZodNumber>;
|
|
387
|
+
}, "strip", z.ZodTypeAny, {
|
|
388
|
+
environment?: {
|
|
389
|
+
customImage?: string | undefined;
|
|
390
|
+
pythonVersion?: string | undefined;
|
|
391
|
+
} | undefined;
|
|
392
|
+
requirements?: string[] | undefined;
|
|
393
|
+
sqlCacheMaxAge?: number | undefined;
|
|
394
|
+
}, {
|
|
395
|
+
environment?: {
|
|
396
|
+
customImage?: string | undefined;
|
|
397
|
+
pythonVersion?: string | undefined;
|
|
398
|
+
} | undefined;
|
|
399
|
+
requirements?: string[] | undefined;
|
|
400
|
+
sqlCacheMaxAge?: number | undefined;
|
|
401
|
+
}>>;
|
|
402
|
+
}, "strip", z.ZodTypeAny, {
|
|
403
|
+
id: string;
|
|
404
|
+
name: string;
|
|
405
|
+
notebooks: {
|
|
406
|
+
id: string;
|
|
407
|
+
name: string;
|
|
408
|
+
blocks: {
|
|
409
|
+
blockGroup: string;
|
|
410
|
+
id: string;
|
|
411
|
+
type: string;
|
|
412
|
+
sortingKey: string;
|
|
413
|
+
content?: string | undefined;
|
|
414
|
+
contentHash?: string | undefined;
|
|
415
|
+
executionCount?: number | undefined;
|
|
416
|
+
executionFinishedAt?: string | undefined;
|
|
417
|
+
executionStartedAt?: string | undefined;
|
|
418
|
+
metadata?: Record<string, any> | undefined;
|
|
419
|
+
outputs?: any[] | undefined;
|
|
420
|
+
version?: number | undefined;
|
|
421
|
+
}[];
|
|
422
|
+
executionMode?: "block" | "downstream" | undefined;
|
|
423
|
+
isModule?: boolean | undefined;
|
|
424
|
+
workingDirectory?: string | undefined;
|
|
425
|
+
}[];
|
|
426
|
+
initNotebookId?: string | undefined;
|
|
427
|
+
integrations?: {
|
|
428
|
+
id: string;
|
|
429
|
+
type: string;
|
|
430
|
+
name: string;
|
|
431
|
+
}[] | undefined;
|
|
432
|
+
settings?: {
|
|
433
|
+
environment?: {
|
|
434
|
+
customImage?: string | undefined;
|
|
435
|
+
pythonVersion?: string | undefined;
|
|
436
|
+
} | undefined;
|
|
437
|
+
requirements?: string[] | undefined;
|
|
438
|
+
sqlCacheMaxAge?: number | undefined;
|
|
439
|
+
} | undefined;
|
|
440
|
+
}, {
|
|
441
|
+
id: string;
|
|
442
|
+
name: string;
|
|
443
|
+
notebooks: {
|
|
444
|
+
id: string;
|
|
445
|
+
name: string;
|
|
446
|
+
blocks: {
|
|
447
|
+
blockGroup: string;
|
|
448
|
+
id: string;
|
|
449
|
+
type: string;
|
|
450
|
+
sortingKey: string;
|
|
451
|
+
content?: string | undefined;
|
|
452
|
+
contentHash?: string | undefined;
|
|
453
|
+
executionCount?: number | undefined;
|
|
454
|
+
executionFinishedAt?: string | undefined;
|
|
455
|
+
executionStartedAt?: string | undefined;
|
|
456
|
+
metadata?: Record<string, any> | undefined;
|
|
457
|
+
outputs?: any[] | undefined;
|
|
458
|
+
version?: number | undefined;
|
|
459
|
+
}[];
|
|
460
|
+
executionMode?: "block" | "downstream" | undefined;
|
|
461
|
+
isModule?: boolean | undefined;
|
|
462
|
+
workingDirectory?: string | undefined;
|
|
463
|
+
}[];
|
|
464
|
+
initNotebookId?: string | undefined;
|
|
465
|
+
integrations?: {
|
|
466
|
+
id: string;
|
|
467
|
+
type: string;
|
|
468
|
+
name: string;
|
|
469
|
+
}[] | undefined;
|
|
470
|
+
settings?: {
|
|
471
|
+
environment?: {
|
|
472
|
+
customImage?: string | undefined;
|
|
473
|
+
pythonVersion?: string | undefined;
|
|
474
|
+
} | undefined;
|
|
475
|
+
requirements?: string[] | undefined;
|
|
476
|
+
sqlCacheMaxAge?: number | undefined;
|
|
477
|
+
} | undefined;
|
|
478
|
+
}>;
|
|
479
|
+
version: z.ZodString;
|
|
480
|
+
}, "strip", z.ZodTypeAny, {
|
|
481
|
+
metadata: {
|
|
482
|
+
createdAt: string;
|
|
483
|
+
checksum?: string | undefined;
|
|
484
|
+
exportedAt?: string | undefined;
|
|
485
|
+
modifiedAt?: string | undefined;
|
|
486
|
+
};
|
|
487
|
+
version: string;
|
|
488
|
+
project: {
|
|
489
|
+
id: string;
|
|
490
|
+
name: string;
|
|
491
|
+
notebooks: {
|
|
492
|
+
id: string;
|
|
493
|
+
name: string;
|
|
494
|
+
blocks: {
|
|
495
|
+
blockGroup: string;
|
|
496
|
+
id: string;
|
|
497
|
+
type: string;
|
|
498
|
+
sortingKey: string;
|
|
499
|
+
content?: string | undefined;
|
|
500
|
+
contentHash?: string | undefined;
|
|
501
|
+
executionCount?: number | undefined;
|
|
502
|
+
executionFinishedAt?: string | undefined;
|
|
503
|
+
executionStartedAt?: string | undefined;
|
|
504
|
+
metadata?: Record<string, any> | undefined;
|
|
505
|
+
outputs?: any[] | undefined;
|
|
506
|
+
version?: number | undefined;
|
|
507
|
+
}[];
|
|
508
|
+
executionMode?: "block" | "downstream" | undefined;
|
|
509
|
+
isModule?: boolean | undefined;
|
|
510
|
+
workingDirectory?: string | undefined;
|
|
511
|
+
}[];
|
|
512
|
+
initNotebookId?: string | undefined;
|
|
513
|
+
integrations?: {
|
|
514
|
+
id: string;
|
|
515
|
+
type: string;
|
|
516
|
+
name: string;
|
|
517
|
+
}[] | undefined;
|
|
518
|
+
settings?: {
|
|
519
|
+
environment?: {
|
|
520
|
+
customImage?: string | undefined;
|
|
521
|
+
pythonVersion?: string | undefined;
|
|
522
|
+
} | undefined;
|
|
523
|
+
requirements?: string[] | undefined;
|
|
524
|
+
sqlCacheMaxAge?: number | undefined;
|
|
525
|
+
} | undefined;
|
|
526
|
+
};
|
|
527
|
+
environment?: {
|
|
528
|
+
customImage?: string | undefined;
|
|
529
|
+
hash?: string | undefined;
|
|
530
|
+
packages?: Record<string, string> | undefined;
|
|
531
|
+
platform?: string | undefined;
|
|
532
|
+
python?: {
|
|
533
|
+
version?: string | undefined;
|
|
534
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
535
|
+
} | undefined;
|
|
536
|
+
} | undefined;
|
|
537
|
+
execution?: {
|
|
538
|
+
error?: {
|
|
539
|
+
message?: string | undefined;
|
|
540
|
+
name?: string | undefined;
|
|
541
|
+
traceback?: string[] | undefined;
|
|
542
|
+
} | undefined;
|
|
543
|
+
finishedAt?: string | undefined;
|
|
544
|
+
inputs?: Record<string, unknown> | undefined;
|
|
545
|
+
startedAt?: string | undefined;
|
|
546
|
+
summary?: {
|
|
547
|
+
blocksExecuted?: number | undefined;
|
|
548
|
+
blocksFailed?: number | undefined;
|
|
549
|
+
blocksSucceeded?: number | undefined;
|
|
550
|
+
totalDurationMs?: number | undefined;
|
|
551
|
+
} | undefined;
|
|
552
|
+
triggeredBy?: "user" | "schedule" | "api" | "ci" | undefined;
|
|
553
|
+
} | undefined;
|
|
554
|
+
}, {
|
|
555
|
+
metadata: {
|
|
556
|
+
createdAt: string;
|
|
557
|
+
checksum?: string | undefined;
|
|
558
|
+
exportedAt?: string | undefined;
|
|
559
|
+
modifiedAt?: string | undefined;
|
|
560
|
+
};
|
|
561
|
+
version: string;
|
|
562
|
+
project: {
|
|
563
|
+
id: string;
|
|
564
|
+
name: string;
|
|
565
|
+
notebooks: {
|
|
566
|
+
id: string;
|
|
567
|
+
name: string;
|
|
568
|
+
blocks: {
|
|
569
|
+
blockGroup: string;
|
|
570
|
+
id: string;
|
|
571
|
+
type: string;
|
|
572
|
+
sortingKey: string;
|
|
573
|
+
content?: string | undefined;
|
|
574
|
+
contentHash?: string | undefined;
|
|
575
|
+
executionCount?: number | undefined;
|
|
576
|
+
executionFinishedAt?: string | undefined;
|
|
577
|
+
executionStartedAt?: string | undefined;
|
|
578
|
+
metadata?: Record<string, any> | undefined;
|
|
579
|
+
outputs?: any[] | undefined;
|
|
580
|
+
version?: number | undefined;
|
|
581
|
+
}[];
|
|
582
|
+
executionMode?: "block" | "downstream" | undefined;
|
|
583
|
+
isModule?: boolean | undefined;
|
|
584
|
+
workingDirectory?: string | undefined;
|
|
585
|
+
}[];
|
|
586
|
+
initNotebookId?: string | undefined;
|
|
587
|
+
integrations?: {
|
|
588
|
+
id: string;
|
|
589
|
+
type: string;
|
|
590
|
+
name: string;
|
|
591
|
+
}[] | undefined;
|
|
592
|
+
settings?: {
|
|
593
|
+
environment?: {
|
|
594
|
+
customImage?: string | undefined;
|
|
595
|
+
pythonVersion?: string | undefined;
|
|
596
|
+
} | undefined;
|
|
597
|
+
requirements?: string[] | undefined;
|
|
598
|
+
sqlCacheMaxAge?: number | undefined;
|
|
599
|
+
} | undefined;
|
|
600
|
+
};
|
|
601
|
+
environment?: {
|
|
602
|
+
customImage?: string | undefined;
|
|
603
|
+
hash?: string | undefined;
|
|
604
|
+
packages?: Record<string, string> | undefined;
|
|
605
|
+
platform?: string | undefined;
|
|
606
|
+
python?: {
|
|
607
|
+
version?: string | undefined;
|
|
608
|
+
environment?: "uv" | "conda" | "venv" | "poetry" | "system" | undefined;
|
|
609
|
+
} | undefined;
|
|
610
|
+
} | undefined;
|
|
611
|
+
execution?: {
|
|
612
|
+
error?: {
|
|
613
|
+
message?: string | undefined;
|
|
614
|
+
name?: string | undefined;
|
|
615
|
+
traceback?: string[] | undefined;
|
|
616
|
+
} | undefined;
|
|
617
|
+
finishedAt?: string | undefined;
|
|
618
|
+
inputs?: Record<string, unknown> | undefined;
|
|
619
|
+
startedAt?: string | undefined;
|
|
620
|
+
summary?: {
|
|
621
|
+
blocksExecuted?: number | undefined;
|
|
622
|
+
blocksFailed?: number | undefined;
|
|
623
|
+
blocksSucceeded?: number | undefined;
|
|
624
|
+
totalDurationMs?: number | undefined;
|
|
625
|
+
} | undefined;
|
|
626
|
+
triggeredBy?: "user" | "schedule" | "api" | "ci" | undefined;
|
|
627
|
+
} | undefined;
|
|
628
|
+
}>;
|
|
629
|
+
type DeepnoteFile = z.infer<typeof deepnoteFileSchema>;
|
|
630
|
+
//#endregion
|
|
3
631
|
//#region src/types/jupyter.d.ts
|
|
4
|
-
|
|
5
632
|
/**
|
|
6
633
|
* Shared Jupyter Notebook type definitions used by both
|
|
7
634
|
* deepnote-to-jupyter and jupyter-to-deepnote converters.
|
|
@@ -54,6 +681,10 @@ interface ConvertBlocksToJupyterOptions {
|
|
|
54
681
|
isModule?: boolean;
|
|
55
682
|
/** Working directory for the notebook */
|
|
56
683
|
workingDirectory?: string;
|
|
684
|
+
/** Environment snapshot metadata */
|
|
685
|
+
environment?: Environment;
|
|
686
|
+
/** Execution snapshot metadata */
|
|
687
|
+
execution?: Execution;
|
|
57
688
|
}
|
|
58
689
|
/**
|
|
59
690
|
* Converts an array of Deepnote blocks into a single Jupyter Notebook.
|
|
@@ -107,6 +738,290 @@ declare function convertDeepnoteToJupyterNotebooks(deepnoteFile: DeepnoteFile):
|
|
|
107
738
|
*/
|
|
108
739
|
declare function convertDeepnoteFileToJupyterFiles(deepnoteFilePath: string, options: ConvertDeepnoteFileToJupyterOptions): Promise<void>;
|
|
109
740
|
//#endregion
|
|
741
|
+
//#region src/types/marimo.d.ts
|
|
742
|
+
/**
|
|
743
|
+
* Marimo (.py) format type definitions.
|
|
744
|
+
*
|
|
745
|
+
* Marimo is a reactive Python notebook that stores notebooks as pure Python files.
|
|
746
|
+
* Key characteristics:
|
|
747
|
+
* - Pure Python with @app.cell decorators
|
|
748
|
+
* - Reactive execution based on variable dependencies
|
|
749
|
+
* - Function signatures declare dependencies (def __(df): means "depends on df")
|
|
750
|
+
* - Return statements declare exports (return df, means "exports df")
|
|
751
|
+
*
|
|
752
|
+
* Example:
|
|
753
|
+
* ```python
|
|
754
|
+
* import marimo
|
|
755
|
+
*
|
|
756
|
+
* __generated_with = "0.8.0"
|
|
757
|
+
* app = marimo.App(width="medium")
|
|
758
|
+
*
|
|
759
|
+
* @app.cell
|
|
760
|
+
* def __():
|
|
761
|
+
* import pandas as pd
|
|
762
|
+
* return pd,
|
|
763
|
+
*
|
|
764
|
+
* @app.cell
|
|
765
|
+
* def __(pd):
|
|
766
|
+
* df = pd.read_csv("data.csv")
|
|
767
|
+
* return df,
|
|
768
|
+
*
|
|
769
|
+
* if __name__ == "__main__":
|
|
770
|
+
* app.run()
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
interface MarimoCell {
|
|
774
|
+
/** Cell type: 'code', 'markdown', or 'sql' */
|
|
775
|
+
cellType: 'code' | 'markdown' | 'sql';
|
|
776
|
+
/** Cell content (Python code, markdown text, or SQL query) */
|
|
777
|
+
content: string;
|
|
778
|
+
/** Function name (usually __ for anonymous cells) */
|
|
779
|
+
functionName?: string;
|
|
780
|
+
/** Variables this cell depends on (from function parameters) */
|
|
781
|
+
dependencies?: string[];
|
|
782
|
+
/** Variables this cell exports (from return statement) */
|
|
783
|
+
exports?: string[];
|
|
784
|
+
/** Whether this cell is hidden in the UI */
|
|
785
|
+
hidden?: boolean;
|
|
786
|
+
/** Whether this cell is disabled */
|
|
787
|
+
disabled?: boolean;
|
|
788
|
+
}
|
|
789
|
+
interface MarimoApp {
|
|
790
|
+
/** Marimo version that generated this file */
|
|
791
|
+
generatedWith?: string;
|
|
792
|
+
/** App width setting ('medium', 'full', etc.) */
|
|
793
|
+
width?: string;
|
|
794
|
+
/** Array of cells */
|
|
795
|
+
cells: MarimoCell[];
|
|
796
|
+
/** App title (from app.title if present) */
|
|
797
|
+
title?: string;
|
|
798
|
+
}
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region src/deepnote-to-marimo.d.ts
|
|
801
|
+
interface ConvertDeepnoteFileToMarimoOptions {
|
|
802
|
+
outputDir: string;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Converts an array of Deepnote blocks into a Marimo app.
|
|
806
|
+
* This is the lowest-level conversion function.
|
|
807
|
+
*
|
|
808
|
+
* @param blocks - Array of DeepnoteBlock objects to convert
|
|
809
|
+
* @param notebookName - Name of the notebook (used for app title)
|
|
810
|
+
* @returns A MarimoApp object
|
|
811
|
+
*/
|
|
812
|
+
declare function convertBlocksToMarimoApp(blocks: DeepnoteBlock[], notebookName: string): MarimoApp;
|
|
813
|
+
/**
|
|
814
|
+
* Converts a Deepnote project into Marimo app objects.
|
|
815
|
+
* This is a pure conversion function that doesn't perform any file I/O.
|
|
816
|
+
* Each notebook in the Deepnote project is converted to a separate Marimo app.
|
|
817
|
+
*
|
|
818
|
+
* @param deepnoteFile - The deserialized Deepnote project file
|
|
819
|
+
* @returns Array of objects containing filename and corresponding Marimo app
|
|
820
|
+
*/
|
|
821
|
+
declare function convertDeepnoteToMarimoApps(deepnoteFile: DeepnoteFile): Array<{
|
|
822
|
+
filename: string;
|
|
823
|
+
app: MarimoApp;
|
|
824
|
+
}>;
|
|
825
|
+
/**
|
|
826
|
+
* Serializes a Marimo app to a Python file string.
|
|
827
|
+
*
|
|
828
|
+
* @param app - The Marimo app to serialize
|
|
829
|
+
* @returns The serialized Python code string
|
|
830
|
+
*/
|
|
831
|
+
declare function serializeMarimoFormat(app: MarimoApp): string;
|
|
832
|
+
/**
|
|
833
|
+
* Converts a Deepnote project file into separate Marimo (.py) files.
|
|
834
|
+
* Each notebook in the Deepnote project becomes a separate .py file.
|
|
835
|
+
*/
|
|
836
|
+
declare function convertDeepnoteFileToMarimoFiles(deepnoteFilePath: string, options: ConvertDeepnoteFileToMarimoOptions): Promise<void>;
|
|
837
|
+
//#endregion
|
|
838
|
+
//#region src/types/percent.d.ts
|
|
839
|
+
/**
|
|
840
|
+
* Percent format (.py with # %%) type definitions.
|
|
841
|
+
*
|
|
842
|
+
* The percent format is a convention for representing notebooks as plain Python files.
|
|
843
|
+
* It's supported by VS Code, Spyder, PyCharm, JupyText, and Hydrogen.
|
|
844
|
+
*
|
|
845
|
+
* Cell markers:
|
|
846
|
+
* - `# %%` - Code cell
|
|
847
|
+
* - `# %% [markdown]` - Markdown cell
|
|
848
|
+
* - `# %% [raw]` - Raw cell
|
|
849
|
+
* - `# %% title` - Code cell with title
|
|
850
|
+
* - `# %% [markdown] title` - Markdown cell with title
|
|
851
|
+
* - `# %% tags=["a", "b"]` - Cell with tags
|
|
852
|
+
*/
|
|
853
|
+
interface PercentCell {
|
|
854
|
+
/** Cell type: 'code', 'markdown', or 'raw' */
|
|
855
|
+
cellType: 'code' | 'markdown' | 'raw';
|
|
856
|
+
/** Cell content (for markdown cells, this is without the '# ' prefix on each line) */
|
|
857
|
+
content: string;
|
|
858
|
+
/** Optional cell title */
|
|
859
|
+
title?: string;
|
|
860
|
+
/** Optional cell tags */
|
|
861
|
+
tags?: string[];
|
|
862
|
+
/** Additional metadata from the cell marker */
|
|
863
|
+
metadata?: Record<string, unknown>;
|
|
864
|
+
}
|
|
865
|
+
interface PercentNotebook {
|
|
866
|
+
/** Array of cells in the notebook */
|
|
867
|
+
cells: PercentCell[];
|
|
868
|
+
/** Optional file-level metadata (from first line comments) */
|
|
869
|
+
metadata?: {
|
|
870
|
+
/** Original filename */
|
|
871
|
+
filename?: string;
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
//#endregion
|
|
875
|
+
//#region src/deepnote-to-percent.d.ts
|
|
876
|
+
interface ConvertDeepnoteFileToPercentOptions {
|
|
877
|
+
outputDir: string;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Converts an array of Deepnote blocks into a percent format notebook.
|
|
881
|
+
* This is the lowest-level conversion function.
|
|
882
|
+
*
|
|
883
|
+
* @param blocks - Array of DeepnoteBlock objects to convert
|
|
884
|
+
* @returns A PercentNotebook object
|
|
885
|
+
*/
|
|
886
|
+
declare function convertBlocksToPercentNotebook(blocks: DeepnoteBlock[]): PercentNotebook;
|
|
887
|
+
/**
|
|
888
|
+
* Converts a Deepnote project into percent format notebook objects.
|
|
889
|
+
* This is a pure conversion function that doesn't perform any file I/O.
|
|
890
|
+
* Each notebook in the Deepnote project is converted to a separate percent notebook.
|
|
891
|
+
*
|
|
892
|
+
* @param deepnoteFile - The deserialized Deepnote project file
|
|
893
|
+
* @returns Array of objects containing filename and corresponding percent notebook
|
|
894
|
+
*/
|
|
895
|
+
declare function convertDeepnoteToPercentNotebooks(deepnoteFile: DeepnoteFile): Array<{
|
|
896
|
+
filename: string;
|
|
897
|
+
notebook: PercentNotebook;
|
|
898
|
+
}>;
|
|
899
|
+
/**
|
|
900
|
+
* Serializes a percent format notebook to a string.
|
|
901
|
+
*
|
|
902
|
+
* @param notebook - The percent notebook to serialize
|
|
903
|
+
* @returns The serialized percent format string
|
|
904
|
+
*/
|
|
905
|
+
declare function serializePercentFormat(notebook: PercentNotebook): string;
|
|
906
|
+
/**
|
|
907
|
+
* Converts a Deepnote project file into separate percent format (.py) files.
|
|
908
|
+
* Each notebook in the Deepnote project becomes a separate .py file.
|
|
909
|
+
*/
|
|
910
|
+
declare function convertDeepnoteFileToPercentFiles(deepnoteFilePath: string, options: ConvertDeepnoteFileToPercentOptions): Promise<void>;
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region src/types/quarto.d.ts
|
|
913
|
+
/**
|
|
914
|
+
* Quarto (.qmd) format type definitions.
|
|
915
|
+
*
|
|
916
|
+
* Quarto is a next-generation publishing system for scientific and technical documents.
|
|
917
|
+
* It uses markdown with code chunks similar to R Markdown but is language-agnostic.
|
|
918
|
+
*
|
|
919
|
+
* Key elements:
|
|
920
|
+
* - YAML frontmatter for document metadata
|
|
921
|
+
* - Code chunks with ```{python} or ```{r} fencing
|
|
922
|
+
* - Cell options using #| syntax (e.g., #| label: my-chunk)
|
|
923
|
+
* - Rich markdown with special directives
|
|
924
|
+
*/
|
|
925
|
+
interface QuartoCell {
|
|
926
|
+
/** Cell type: 'code' or 'markdown' */
|
|
927
|
+
cellType: 'code' | 'markdown';
|
|
928
|
+
/** Cell content (code or markdown text) */
|
|
929
|
+
content: string;
|
|
930
|
+
/** Language for code cells (e.g., 'python', 'r') */
|
|
931
|
+
language?: string;
|
|
932
|
+
/** Cell options from #| lines */
|
|
933
|
+
options?: QuartoCellOptions;
|
|
934
|
+
}
|
|
935
|
+
interface QuartoCellOptions {
|
|
936
|
+
/** Cell label/identifier */
|
|
937
|
+
label?: string;
|
|
938
|
+
/** Whether to show the code in output */
|
|
939
|
+
echo?: boolean;
|
|
940
|
+
/** Whether to evaluate the code */
|
|
941
|
+
eval?: boolean;
|
|
942
|
+
/** Whether to show output */
|
|
943
|
+
output?: boolean;
|
|
944
|
+
/** Figure caption */
|
|
945
|
+
figCap?: string;
|
|
946
|
+
/** Figure width */
|
|
947
|
+
figWidth?: number;
|
|
948
|
+
/** Figure height */
|
|
949
|
+
figHeight?: number;
|
|
950
|
+
/** Table caption */
|
|
951
|
+
tblCap?: string;
|
|
952
|
+
/** Warning display setting */
|
|
953
|
+
warning?: boolean;
|
|
954
|
+
/** Message display setting */
|
|
955
|
+
message?: boolean;
|
|
956
|
+
/** Additional raw options */
|
|
957
|
+
raw?: Record<string, unknown>;
|
|
958
|
+
}
|
|
959
|
+
interface QuartoFrontmatter {
|
|
960
|
+
/** Document title */
|
|
961
|
+
title?: string;
|
|
962
|
+
/** Author(s) */
|
|
963
|
+
author?: string | string[];
|
|
964
|
+
/** Document date */
|
|
965
|
+
date?: string;
|
|
966
|
+
/** Output format(s) */
|
|
967
|
+
format?: string | Record<string, unknown>;
|
|
968
|
+
/** Jupyter kernel specification */
|
|
969
|
+
jupyter?: string;
|
|
970
|
+
/** Execute options */
|
|
971
|
+
execute?: {
|
|
972
|
+
echo?: boolean;
|
|
973
|
+
eval?: boolean;
|
|
974
|
+
warning?: boolean;
|
|
975
|
+
output?: boolean;
|
|
976
|
+
};
|
|
977
|
+
/** Additional metadata */
|
|
978
|
+
[key: string]: unknown;
|
|
979
|
+
}
|
|
980
|
+
interface QuartoDocument {
|
|
981
|
+
/** YAML frontmatter metadata */
|
|
982
|
+
frontmatter?: QuartoFrontmatter;
|
|
983
|
+
/** Array of cells (code chunks and markdown) */
|
|
984
|
+
cells: QuartoCell[];
|
|
985
|
+
}
|
|
986
|
+
//#endregion
|
|
987
|
+
//#region src/deepnote-to-quarto.d.ts
|
|
988
|
+
interface ConvertDeepnoteFileToQuartoOptions {
|
|
989
|
+
outputDir: string;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Converts an array of Deepnote blocks into a Quarto document.
|
|
993
|
+
* This is the lowest-level conversion function.
|
|
994
|
+
*
|
|
995
|
+
* @param blocks - Array of DeepnoteBlock objects to convert
|
|
996
|
+
* @param notebookName - Name of the notebook (used for document title)
|
|
997
|
+
* @returns A QuartoDocument object
|
|
998
|
+
*/
|
|
999
|
+
declare function convertBlocksToQuartoDocument(blocks: DeepnoteBlock[], notebookName: string): QuartoDocument;
|
|
1000
|
+
/**
|
|
1001
|
+
* Converts a Deepnote project into Quarto document objects.
|
|
1002
|
+
* This is a pure conversion function that doesn't perform any file I/O.
|
|
1003
|
+
* Each notebook in the Deepnote project is converted to a separate Quarto document.
|
|
1004
|
+
*
|
|
1005
|
+
* @param deepnoteFile - The deserialized Deepnote project file
|
|
1006
|
+
* @returns Array of objects containing filename and corresponding Quarto document
|
|
1007
|
+
*/
|
|
1008
|
+
declare function convertDeepnoteToQuartoDocuments(deepnoteFile: DeepnoteFile): Array<{
|
|
1009
|
+
filename: string;
|
|
1010
|
+
document: QuartoDocument;
|
|
1011
|
+
}>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Serializes a Quarto document to a string.
|
|
1014
|
+
*
|
|
1015
|
+
* @param document - The Quarto document to serialize
|
|
1016
|
+
* @returns The serialized Quarto format string
|
|
1017
|
+
*/
|
|
1018
|
+
declare function serializeQuartoFormat(document: QuartoDocument): string;
|
|
1019
|
+
/**
|
|
1020
|
+
* Converts a Deepnote project file into separate Quarto (.qmd) files.
|
|
1021
|
+
* Each notebook in the Deepnote project becomes a separate .qmd file.
|
|
1022
|
+
*/
|
|
1023
|
+
declare function convertDeepnoteFileToQuartoFiles(deepnoteFilePath: string, options: ConvertDeepnoteFileToQuartoOptions): Promise<void>;
|
|
1024
|
+
//#endregion
|
|
110
1025
|
//#region src/jupyter-to-deepnote.d.ts
|
|
111
1026
|
interface ConvertIpynbFilesToDeepnoteFileOptions {
|
|
112
1027
|
outputPath: string;
|
|
@@ -155,4 +1070,183 @@ declare function convertJupyterNotebooksToDeepnote(notebooks: JupyterNotebookInp
|
|
|
155
1070
|
*/
|
|
156
1071
|
declare function convertIpynbFilesToDeepnoteFile(inputFilePaths: string[], options: ConvertIpynbFilesToDeepnoteFileOptions): Promise<void>;
|
|
157
1072
|
//#endregion
|
|
158
|
-
|
|
1073
|
+
//#region src/marimo-to-deepnote.d.ts
|
|
1074
|
+
interface ConvertMarimoFilesToDeepnoteFileOptions {
|
|
1075
|
+
outputPath: string;
|
|
1076
|
+
projectName: string;
|
|
1077
|
+
}
|
|
1078
|
+
interface ConvertMarimoAppOptions {
|
|
1079
|
+
/** Custom ID generator function. Defaults to uuid v4. */
|
|
1080
|
+
idGenerator?: () => string;
|
|
1081
|
+
}
|
|
1082
|
+
interface MarimoAppInput {
|
|
1083
|
+
filename: string;
|
|
1084
|
+
app: MarimoApp;
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Parses a Marimo Python file into a MarimoApp structure.
|
|
1088
|
+
*
|
|
1089
|
+
* @param content - The raw content of the .py file
|
|
1090
|
+
* @returns A MarimoApp object
|
|
1091
|
+
*
|
|
1092
|
+
* @example
|
|
1093
|
+
* ```typescript
|
|
1094
|
+
* const content = `import marimo
|
|
1095
|
+
*
|
|
1096
|
+
* app = marimo.App()
|
|
1097
|
+
*
|
|
1098
|
+
* @app.cell
|
|
1099
|
+
* def __():
|
|
1100
|
+
* print("hello")
|
|
1101
|
+
* return
|
|
1102
|
+
* `
|
|
1103
|
+
* const app = parseMarimoFormat(content)
|
|
1104
|
+
* ```
|
|
1105
|
+
*/
|
|
1106
|
+
declare function parseMarimoFormat(content: string): MarimoApp;
|
|
1107
|
+
/**
|
|
1108
|
+
* Converts a single Marimo app into an array of Deepnote blocks.
|
|
1109
|
+
* This is the lowest-level conversion function.
|
|
1110
|
+
*
|
|
1111
|
+
* @param app - The Marimo app object to convert
|
|
1112
|
+
* @param options - Optional conversion options including custom ID generator
|
|
1113
|
+
* @returns Array of DeepnoteBlock objects
|
|
1114
|
+
*/
|
|
1115
|
+
declare function convertMarimoAppToBlocks(app: MarimoApp, options?: ConvertMarimoAppOptions): DeepnoteBlock[];
|
|
1116
|
+
interface ConvertMarimoAppsToDeepnoteOptions {
|
|
1117
|
+
/** Project name for the Deepnote file */
|
|
1118
|
+
projectName: string;
|
|
1119
|
+
/** Custom ID generator function. Defaults to uuid v4. */
|
|
1120
|
+
idGenerator?: () => string;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Converts Marimo app objects into a Deepnote project file.
|
|
1124
|
+
* This is a pure conversion function that doesn't perform any file I/O.
|
|
1125
|
+
*
|
|
1126
|
+
* @param apps - Array of Marimo apps with filenames
|
|
1127
|
+
* @param options - Conversion options including project name and optional ID generator
|
|
1128
|
+
* @returns A DeepnoteFile object
|
|
1129
|
+
*/
|
|
1130
|
+
declare function convertMarimoAppsToDeepnote(apps: MarimoAppInput[], options: ConvertMarimoAppsToDeepnoteOptions): DeepnoteFile;
|
|
1131
|
+
/**
|
|
1132
|
+
* Converts multiple Marimo (.py) files into a single Deepnote project file.
|
|
1133
|
+
*/
|
|
1134
|
+
declare function convertMarimoFilesToDeepnoteFile(inputFilePaths: string[], options: ConvertMarimoFilesToDeepnoteFileOptions): Promise<void>;
|
|
1135
|
+
//#endregion
|
|
1136
|
+
//#region src/percent-to-deepnote.d.ts
|
|
1137
|
+
interface ConvertPercentFilesToDeepnoteFileOptions {
|
|
1138
|
+
outputPath: string;
|
|
1139
|
+
projectName: string;
|
|
1140
|
+
}
|
|
1141
|
+
interface ConvertPercentNotebookOptions {
|
|
1142
|
+
/** Custom ID generator function. Defaults to uuid v4. */
|
|
1143
|
+
idGenerator?: () => string;
|
|
1144
|
+
}
|
|
1145
|
+
interface PercentNotebookInput {
|
|
1146
|
+
filename: string;
|
|
1147
|
+
notebook: PercentNotebook;
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Parses a percent format Python file into a PercentNotebook structure.
|
|
1151
|
+
*
|
|
1152
|
+
* @param content - The raw content of the .py file
|
|
1153
|
+
* @returns A PercentNotebook object
|
|
1154
|
+
*
|
|
1155
|
+
* @example
|
|
1156
|
+
* ```typescript
|
|
1157
|
+
* const content = `# %% [markdown]
|
|
1158
|
+
* # # My Title
|
|
1159
|
+
*
|
|
1160
|
+
* # %%
|
|
1161
|
+
* print("hello")
|
|
1162
|
+
* `
|
|
1163
|
+
* const notebook = parsePercentFormat(content)
|
|
1164
|
+
* ```
|
|
1165
|
+
*/
|
|
1166
|
+
declare function parsePercentFormat(content: string): PercentNotebook;
|
|
1167
|
+
/**
|
|
1168
|
+
* Converts a single percent format notebook into an array of Deepnote blocks.
|
|
1169
|
+
* This is the lowest-level conversion function.
|
|
1170
|
+
*
|
|
1171
|
+
* @param notebook - The percent notebook object to convert
|
|
1172
|
+
* @param options - Optional conversion options including custom ID generator
|
|
1173
|
+
* @returns Array of DeepnoteBlock objects
|
|
1174
|
+
*/
|
|
1175
|
+
declare function convertPercentNotebookToBlocks(notebook: PercentNotebook, options?: ConvertPercentNotebookOptions): DeepnoteBlock[];
|
|
1176
|
+
/**
|
|
1177
|
+
* Converts percent format notebook objects into a Deepnote project file.
|
|
1178
|
+
* This is a pure conversion function that doesn't perform any file I/O.
|
|
1179
|
+
*
|
|
1180
|
+
* @param notebooks - Array of percent notebooks with filenames
|
|
1181
|
+
* @param options - Conversion options including project name
|
|
1182
|
+
* @returns A DeepnoteFile object
|
|
1183
|
+
*/
|
|
1184
|
+
declare function convertPercentNotebooksToDeepnote(notebooks: PercentNotebookInput[], options: {
|
|
1185
|
+
projectName: string;
|
|
1186
|
+
}): DeepnoteFile;
|
|
1187
|
+
/**
|
|
1188
|
+
* Converts multiple percent format (.py) files into a single Deepnote project file.
|
|
1189
|
+
*/
|
|
1190
|
+
declare function convertPercentFilesToDeepnoteFile(inputFilePaths: string[], options: ConvertPercentFilesToDeepnoteFileOptions): Promise<void>;
|
|
1191
|
+
//#endregion
|
|
1192
|
+
//#region src/quarto-to-deepnote.d.ts
|
|
1193
|
+
interface ConvertQuartoFilesToDeepnoteFileOptions {
|
|
1194
|
+
outputPath: string;
|
|
1195
|
+
projectName: string;
|
|
1196
|
+
}
|
|
1197
|
+
interface ConvertQuartoDocumentOptions {
|
|
1198
|
+
/** Custom ID generator function. Defaults to uuid v4. */
|
|
1199
|
+
idGenerator?: () => string;
|
|
1200
|
+
}
|
|
1201
|
+
interface QuartoDocumentInput {
|
|
1202
|
+
filename: string;
|
|
1203
|
+
document: QuartoDocument;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Parses a Quarto (.qmd) file into a QuartoDocument structure.
|
|
1207
|
+
*
|
|
1208
|
+
* @param content - The raw content of the .qmd file
|
|
1209
|
+
* @returns A QuartoDocument object
|
|
1210
|
+
*
|
|
1211
|
+
* @example
|
|
1212
|
+
* ```typescript
|
|
1213
|
+
* const content = `---
|
|
1214
|
+
* title: "My Document"
|
|
1215
|
+
* ---
|
|
1216
|
+
*
|
|
1217
|
+
* # Introduction
|
|
1218
|
+
*
|
|
1219
|
+
* \`\`\`{python}
|
|
1220
|
+
* print("hello")
|
|
1221
|
+
* \`\`\`
|
|
1222
|
+
* `
|
|
1223
|
+
* const doc = parseQuartoFormat(content)
|
|
1224
|
+
* ```
|
|
1225
|
+
*/
|
|
1226
|
+
declare function parseQuartoFormat(content: string): QuartoDocument;
|
|
1227
|
+
/**
|
|
1228
|
+
* Converts a single Quarto document into an array of Deepnote blocks.
|
|
1229
|
+
* This is the lowest-level conversion function.
|
|
1230
|
+
*
|
|
1231
|
+
* @param document - The Quarto document object to convert
|
|
1232
|
+
* @param options - Optional conversion options including custom ID generator
|
|
1233
|
+
* @returns Array of DeepnoteBlock objects
|
|
1234
|
+
*/
|
|
1235
|
+
declare function convertQuartoDocumentToBlocks(document: QuartoDocument, options?: ConvertQuartoDocumentOptions): DeepnoteBlock[];
|
|
1236
|
+
/**
|
|
1237
|
+
* Converts Quarto document objects into a Deepnote project file.
|
|
1238
|
+
* This is a pure conversion function that doesn't perform any file I/O.
|
|
1239
|
+
*
|
|
1240
|
+
* @param documents - Array of Quarto documents with filenames
|
|
1241
|
+
* @param options - Conversion options including project name
|
|
1242
|
+
* @returns A DeepnoteFile object
|
|
1243
|
+
*/
|
|
1244
|
+
declare function convertQuartoDocumentsToDeepnote(documents: QuartoDocumentInput[], options: {
|
|
1245
|
+
projectName: string;
|
|
1246
|
+
}): DeepnoteFile;
|
|
1247
|
+
/**
|
|
1248
|
+
* Converts multiple Quarto (.qmd) files into a single Deepnote project file.
|
|
1249
|
+
*/
|
|
1250
|
+
declare function convertQuartoFilesToDeepnoteFile(inputFilePaths: string[], options: ConvertQuartoFilesToDeepnoteFileOptions): Promise<void>;
|
|
1251
|
+
//#endregion
|
|
1252
|
+
export { type ConvertBlocksToJupyterOptions, type ConvertDeepnoteFileToMarimoOptions, type ConvertDeepnoteFileToPercentOptions, type ConvertDeepnoteFileToQuartoOptions, type ConvertIpynbFilesToDeepnoteFileOptions, type ConvertJupyterNotebookOptions, type ConvertMarimoAppOptions, type ConvertMarimoAppsToDeepnoteOptions, type ConvertMarimoFilesToDeepnoteFileOptions, type ConvertPercentFilesToDeepnoteFileOptions, type ConvertPercentNotebookOptions, type ConvertQuartoDocumentOptions, type ConvertQuartoFilesToDeepnoteFileOptions, type JupyterCell, type JupyterNotebook, type JupyterNotebookInput, type MarimoApp, type MarimoAppInput, type MarimoCell, type PercentCell, type PercentNotebook, type PercentNotebookInput, type QuartoCell, type QuartoCellOptions, type QuartoDocument, type QuartoDocumentInput, type QuartoFrontmatter, convertBlocksToJupyterNotebook, convertBlocksToMarimoApp, convertBlocksToPercentNotebook, convertBlocksToQuartoDocument, convertDeepnoteFileToJupyterFiles as convertDeepnoteFileToJupyter, convertDeepnoteFileToMarimoFiles, convertDeepnoteFileToPercentFiles, convertDeepnoteFileToQuartoFiles, convertDeepnoteToJupyterNotebooks, convertDeepnoteToMarimoApps, convertDeepnoteToPercentNotebooks, convertDeepnoteToQuartoDocuments, convertIpynbFilesToDeepnoteFile, convertJupyterNotebookToBlocks, convertJupyterNotebooksToDeepnote, convertMarimoAppToBlocks, convertMarimoAppsToDeepnote, convertMarimoFilesToDeepnoteFile, convertPercentFilesToDeepnoteFile, convertPercentNotebookToBlocks, convertPercentNotebooksToDeepnote, convertQuartoDocumentToBlocks, convertQuartoDocumentsToDeepnote, convertQuartoFilesToDeepnoteFile, parseMarimoFormat, parsePercentFormat, parseQuartoFormat, serializeMarimoFormat, serializePercentFormat, serializeQuartoFormat };
|