@deepnote/blocks 1.3.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,381 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/blocks/table-state.d.ts
4
+ interface TableState {
5
+ cellFormattingRules?: {
6
+ column: string;
7
+ rule: string;
8
+ }[];
9
+ columnDisplayNames?: {
10
+ columnName: string;
11
+ displayName: string;
12
+ }[];
13
+ columnOrder?: string[];
14
+ conditionalFilters?: unknown[];
15
+ filters?: {
16
+ id: string;
17
+ value: string;
18
+ }[];
19
+ hiddenColumnIds?: string[];
20
+ pageIndex?: number;
21
+ pageSize?: number;
22
+ sortBy?: {
23
+ id: string;
24
+ desc: boolean;
25
+ }[];
26
+ wrappedTextColumnIds?: string[];
27
+ }
28
+ //#endregion
29
+ //#region src/deserialize-file/deepnote-file-schema.d.ts
30
+ declare const deepnoteBlockSchema: z.ZodObject<{
31
+ blockGroup: z.ZodOptional<z.ZodString>;
32
+ content: z.ZodOptional<z.ZodString>;
33
+ executionCount: z.ZodOptional<z.ZodNumber>;
34
+ id: z.ZodString;
35
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
36
+ outputs: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
37
+ sortingKey: z.ZodString;
38
+ type: z.ZodString;
39
+ version: z.ZodOptional<z.ZodNumber>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ id: string;
42
+ type: string;
43
+ sortingKey: string;
44
+ blockGroup?: string | undefined;
45
+ content?: string | undefined;
46
+ executionCount?: number | undefined;
47
+ metadata?: Record<string, any> | undefined;
48
+ outputs?: any[] | undefined;
49
+ version?: number | undefined;
50
+ }, {
51
+ id: string;
52
+ type: string;
53
+ sortingKey: string;
54
+ blockGroup?: string | undefined;
55
+ content?: string | undefined;
56
+ executionCount?: number | undefined;
57
+ metadata?: Record<string, any> | undefined;
58
+ outputs?: any[] | undefined;
59
+ version?: number | undefined;
60
+ }>;
61
+ type DeepnoteBlock = z.infer<typeof deepnoteBlockSchema>;
62
+ declare const deepnoteFileSchema: z.ZodObject<{
63
+ metadata: z.ZodObject<{
64
+ checksum: z.ZodOptional<z.ZodString>;
65
+ createdAt: z.ZodString;
66
+ exportedAt: z.ZodOptional<z.ZodString>;
67
+ modifiedAt: z.ZodOptional<z.ZodString>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ createdAt: string;
70
+ checksum?: string | undefined;
71
+ exportedAt?: string | undefined;
72
+ modifiedAt?: string | undefined;
73
+ }, {
74
+ createdAt: string;
75
+ checksum?: string | undefined;
76
+ exportedAt?: string | undefined;
77
+ modifiedAt?: string | undefined;
78
+ }>;
79
+ project: z.ZodObject<{
80
+ id: z.ZodString;
81
+ initNotebookId: z.ZodOptional<z.ZodString>;
82
+ integrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
83
+ id: z.ZodString;
84
+ name: z.ZodString;
85
+ type: z.ZodString;
86
+ }, "strip", z.ZodTypeAny, {
87
+ id: string;
88
+ type: string;
89
+ name: string;
90
+ }, {
91
+ id: string;
92
+ type: string;
93
+ name: string;
94
+ }>, "many">>;
95
+ name: z.ZodString;
96
+ notebooks: z.ZodArray<z.ZodObject<{
97
+ blocks: z.ZodArray<z.ZodObject<{
98
+ blockGroup: z.ZodOptional<z.ZodString>;
99
+ content: z.ZodOptional<z.ZodString>;
100
+ executionCount: z.ZodOptional<z.ZodNumber>;
101
+ id: z.ZodString;
102
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
103
+ outputs: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
104
+ sortingKey: z.ZodString;
105
+ type: z.ZodString;
106
+ version: z.ZodOptional<z.ZodNumber>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ id: string;
109
+ type: string;
110
+ sortingKey: string;
111
+ blockGroup?: string | undefined;
112
+ content?: string | undefined;
113
+ executionCount?: number | undefined;
114
+ metadata?: Record<string, any> | undefined;
115
+ outputs?: any[] | undefined;
116
+ version?: number | undefined;
117
+ }, {
118
+ id: string;
119
+ type: string;
120
+ sortingKey: string;
121
+ blockGroup?: string | undefined;
122
+ content?: string | undefined;
123
+ executionCount?: number | undefined;
124
+ metadata?: Record<string, any> | undefined;
125
+ outputs?: any[] | undefined;
126
+ version?: number | undefined;
127
+ }>, "many">;
128
+ executionMode: z.ZodOptional<z.ZodEnum<["block", "downstream"]>>;
129
+ id: z.ZodString;
130
+ isModule: z.ZodOptional<z.ZodBoolean>;
131
+ name: z.ZodString;
132
+ workingDirectory: z.ZodOptional<z.ZodString>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ id: string;
135
+ name: string;
136
+ blocks: {
137
+ id: string;
138
+ type: string;
139
+ sortingKey: string;
140
+ blockGroup?: string | undefined;
141
+ content?: string | undefined;
142
+ executionCount?: number | undefined;
143
+ metadata?: Record<string, any> | undefined;
144
+ outputs?: any[] | undefined;
145
+ version?: number | undefined;
146
+ }[];
147
+ executionMode?: "block" | "downstream" | undefined;
148
+ isModule?: boolean | undefined;
149
+ workingDirectory?: string | undefined;
150
+ }, {
151
+ id: string;
152
+ name: string;
153
+ blocks: {
154
+ id: string;
155
+ type: string;
156
+ sortingKey: string;
157
+ blockGroup?: string | undefined;
158
+ content?: string | undefined;
159
+ executionCount?: number | undefined;
160
+ metadata?: Record<string, any> | undefined;
161
+ outputs?: any[] | undefined;
162
+ version?: number | undefined;
163
+ }[];
164
+ executionMode?: "block" | "downstream" | undefined;
165
+ isModule?: boolean | undefined;
166
+ workingDirectory?: string | undefined;
167
+ }>, "many">;
168
+ settings: z.ZodOptional<z.ZodObject<{
169
+ environment: z.ZodOptional<z.ZodObject<{
170
+ customImage: z.ZodOptional<z.ZodString>;
171
+ pythonVersion: z.ZodOptional<z.ZodString>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ customImage?: string | undefined;
174
+ pythonVersion?: string | undefined;
175
+ }, {
176
+ customImage?: string | undefined;
177
+ pythonVersion?: string | undefined;
178
+ }>>;
179
+ requirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
180
+ sqlCacheMaxAge: z.ZodOptional<z.ZodNumber>;
181
+ }, "strip", z.ZodTypeAny, {
182
+ environment?: {
183
+ customImage?: string | undefined;
184
+ pythonVersion?: string | undefined;
185
+ } | undefined;
186
+ requirements?: string[] | undefined;
187
+ sqlCacheMaxAge?: number | undefined;
188
+ }, {
189
+ environment?: {
190
+ customImage?: string | undefined;
191
+ pythonVersion?: string | undefined;
192
+ } | undefined;
193
+ requirements?: string[] | undefined;
194
+ sqlCacheMaxAge?: number | undefined;
195
+ }>>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ id: string;
198
+ name: string;
199
+ notebooks: {
200
+ id: string;
201
+ name: string;
202
+ blocks: {
203
+ id: string;
204
+ type: string;
205
+ sortingKey: string;
206
+ blockGroup?: string | undefined;
207
+ content?: string | undefined;
208
+ executionCount?: number | undefined;
209
+ metadata?: Record<string, any> | undefined;
210
+ outputs?: any[] | undefined;
211
+ version?: number | undefined;
212
+ }[];
213
+ executionMode?: "block" | "downstream" | undefined;
214
+ isModule?: boolean | undefined;
215
+ workingDirectory?: string | undefined;
216
+ }[];
217
+ initNotebookId?: string | undefined;
218
+ integrations?: {
219
+ id: string;
220
+ type: string;
221
+ name: string;
222
+ }[] | undefined;
223
+ settings?: {
224
+ environment?: {
225
+ customImage?: string | undefined;
226
+ pythonVersion?: string | undefined;
227
+ } | undefined;
228
+ requirements?: string[] | undefined;
229
+ sqlCacheMaxAge?: number | undefined;
230
+ } | undefined;
231
+ }, {
232
+ id: string;
233
+ name: string;
234
+ notebooks: {
235
+ id: string;
236
+ name: string;
237
+ blocks: {
238
+ id: string;
239
+ type: string;
240
+ sortingKey: string;
241
+ blockGroup?: string | undefined;
242
+ content?: string | undefined;
243
+ executionCount?: number | undefined;
244
+ metadata?: Record<string, any> | undefined;
245
+ outputs?: any[] | undefined;
246
+ version?: number | undefined;
247
+ }[];
248
+ executionMode?: "block" | "downstream" | undefined;
249
+ isModule?: boolean | undefined;
250
+ workingDirectory?: string | undefined;
251
+ }[];
252
+ initNotebookId?: string | undefined;
253
+ integrations?: {
254
+ id: string;
255
+ type: string;
256
+ name: string;
257
+ }[] | undefined;
258
+ settings?: {
259
+ environment?: {
260
+ customImage?: string | undefined;
261
+ pythonVersion?: string | undefined;
262
+ } | undefined;
263
+ requirements?: string[] | undefined;
264
+ sqlCacheMaxAge?: number | undefined;
265
+ } | undefined;
266
+ }>;
267
+ version: z.ZodString;
268
+ }, "strip", z.ZodTypeAny, {
269
+ metadata: {
270
+ createdAt: string;
271
+ checksum?: string | undefined;
272
+ exportedAt?: string | undefined;
273
+ modifiedAt?: string | undefined;
274
+ };
275
+ version: string;
276
+ project: {
277
+ id: string;
278
+ name: string;
279
+ notebooks: {
280
+ id: string;
281
+ name: string;
282
+ blocks: {
283
+ id: string;
284
+ type: string;
285
+ sortingKey: string;
286
+ blockGroup?: string | undefined;
287
+ content?: string | undefined;
288
+ executionCount?: number | undefined;
289
+ metadata?: Record<string, any> | undefined;
290
+ outputs?: any[] | undefined;
291
+ version?: number | undefined;
292
+ }[];
293
+ executionMode?: "block" | "downstream" | undefined;
294
+ isModule?: boolean | undefined;
295
+ workingDirectory?: string | undefined;
296
+ }[];
297
+ initNotebookId?: string | undefined;
298
+ integrations?: {
299
+ id: string;
300
+ type: string;
301
+ name: string;
302
+ }[] | undefined;
303
+ settings?: {
304
+ environment?: {
305
+ customImage?: string | undefined;
306
+ pythonVersion?: string | undefined;
307
+ } | undefined;
308
+ requirements?: string[] | undefined;
309
+ sqlCacheMaxAge?: number | undefined;
310
+ } | undefined;
311
+ };
312
+ }, {
313
+ metadata: {
314
+ createdAt: string;
315
+ checksum?: string | undefined;
316
+ exportedAt?: string | undefined;
317
+ modifiedAt?: string | undefined;
318
+ };
319
+ version: string;
320
+ project: {
321
+ id: string;
322
+ name: string;
323
+ notebooks: {
324
+ id: string;
325
+ name: string;
326
+ blocks: {
327
+ id: string;
328
+ type: string;
329
+ sortingKey: string;
330
+ blockGroup?: string | undefined;
331
+ content?: string | undefined;
332
+ executionCount?: number | undefined;
333
+ metadata?: Record<string, any> | undefined;
334
+ outputs?: any[] | undefined;
335
+ version?: number | undefined;
336
+ }[];
337
+ executionMode?: "block" | "downstream" | undefined;
338
+ isModule?: boolean | undefined;
339
+ workingDirectory?: string | undefined;
340
+ }[];
341
+ initNotebookId?: string | undefined;
342
+ integrations?: {
343
+ id: string;
344
+ type: string;
345
+ name: string;
346
+ }[] | undefined;
347
+ settings?: {
348
+ environment?: {
349
+ customImage?: string | undefined;
350
+ pythonVersion?: string | undefined;
351
+ } | undefined;
352
+ requirements?: string[] | undefined;
353
+ sqlCacheMaxAge?: number | undefined;
354
+ } | undefined;
355
+ };
356
+ }>;
357
+ type DeepnoteFile = z.infer<typeof deepnoteFileSchema>;
358
+ //#endregion
359
+ //#region src/deserialize-file/deserialize-deepnote-file.d.ts
360
+ /**
361
+ * Deserialize a YAML string into a DeepnoteFile object.
362
+ */
363
+ declare function deserializeDeepnoteFile(yamlContent: string): DeepnoteFile;
364
+ //#endregion
365
+ //#region src/markdown.d.ts
366
+ declare function createMarkdown(block: DeepnoteBlock): string;
367
+ declare function stripMarkdown(block: DeepnoteBlock): string;
368
+ //#endregion
369
+ //#region src/blocks/button-blocks.d.ts
370
+ interface ButtonExecutionContext {
371
+ /**
372
+ * If set, button blocks with this variable name that are being executed
373
+ * will resolve their source code to set the variable to True, False otherwise.
374
+ */
375
+ variableContext?: string[];
376
+ }
377
+ //#endregion
378
+ //#region src/python-code.d.ts
379
+ declare function createPythonCode(block: DeepnoteBlock, executionContext?: ButtonExecutionContext): string;
380
+ //#endregion
381
+ export { type DeepnoteBlock, type DeepnoteFile, type TableState, createMarkdown, createPythonCode, deepnoteBlockSchema, deserializeDeepnoteFile, stripMarkdown };