@phpsandbox/sdk 0.1.15 → 0.1.17
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/dist/index.d.ts
CHANGED
|
@@ -52,16 +52,25 @@ export type NotebookInitResponse = {
|
|
|
52
52
|
provisioned: boolean;
|
|
53
53
|
provisioningAction: NotebookProvisioningAction | null;
|
|
54
54
|
};
|
|
55
|
-
export
|
|
56
|
-
|
|
55
|
+
export interface NotebookDownloadProgress {
|
|
56
|
+
totalBytes: number;
|
|
57
|
+
downloadedBytes: number;
|
|
58
|
+
}
|
|
59
|
+
export interface NotebookInitProgressMessage {
|
|
57
60
|
message: string;
|
|
58
61
|
details?: string;
|
|
59
|
-
kind?: NotebookInitProgressKind;
|
|
60
62
|
step?: string;
|
|
61
63
|
line?: string;
|
|
62
64
|
chunk?: string;
|
|
63
65
|
command?: string;
|
|
64
66
|
}
|
|
67
|
+
export type NotebookInitProgress = NotebookInitProgressMessage & ({
|
|
68
|
+
phase: 'downloading';
|
|
69
|
+
download: NotebookDownloadProgress;
|
|
70
|
+
} | {
|
|
71
|
+
phase: 'waiting' | 'preparing' | 'extracting' | 'provisioning' | 'starting';
|
|
72
|
+
download?: never;
|
|
73
|
+
});
|
|
65
74
|
export type NotebookInitErrorCode = 'GitHubImportCredentialMissing' | 'NotebookDiskQuotaExceeded' | 'NotebookNotFound' | 'NotebookSetupJsonInvalid' | 'NotebookBackupRestoreFailed';
|
|
66
75
|
export interface NotebookInitErrorData {
|
|
67
76
|
errorCode?: NotebookInitErrorCode;
|
|
@@ -268,12 +277,29 @@ export interface PaginatedApiResponse<TData> {
|
|
|
268
277
|
links?: Record<string, unknown>;
|
|
269
278
|
meta?: Record<string, unknown>;
|
|
270
279
|
}
|
|
280
|
+
/** Account-owned notebook metadata; listing does not open runtime connections. */
|
|
281
|
+
export interface NotebookListData {
|
|
282
|
+
id: string;
|
|
283
|
+
title: string | null;
|
|
284
|
+
slug: string | null;
|
|
285
|
+
description: string | null;
|
|
286
|
+
visibility: 'private' | 'public' | 'listed';
|
|
287
|
+
type: string;
|
|
288
|
+
policy: NotebookPolicyData;
|
|
289
|
+
createdAt: string | null;
|
|
290
|
+
updatedAt: string | null;
|
|
291
|
+
}
|
|
292
|
+
export interface NotebookListOptions {
|
|
293
|
+
page?: number;
|
|
294
|
+
perPage?: number;
|
|
295
|
+
}
|
|
271
296
|
export interface NotebookMailListOptions {
|
|
272
297
|
page?: number;
|
|
273
298
|
}
|
|
274
299
|
declare class NotebookApi {
|
|
275
300
|
private readonly client;
|
|
276
301
|
constructor(client: Client);
|
|
302
|
+
list(options?: NotebookListOptions): Promise<PaginatedApiResponse<NotebookListData>>;
|
|
277
303
|
inspectImport(input: InspectNotebookImportInput): Promise<NotebookImportInspectionData>;
|
|
278
304
|
create(template: string, input?: Partial<CreateNotebookInput>): Promise<NotebookInstance>;
|
|
279
305
|
get(id: string): Promise<NotebookInstance>;
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,9 @@ class NotebookApi {
|
|
|
47
47
|
constructor(client) {
|
|
48
48
|
this.client = client;
|
|
49
49
|
}
|
|
50
|
+
async list(options = {}) {
|
|
51
|
+
return this.client.get(`/notebook${formatQueryString({ page: options.page, per_page: options.perPage })}`);
|
|
52
|
+
}
|
|
50
53
|
async inspectImport(input) {
|
|
51
54
|
const response = await this.client.post('/notebook/imports/inspect', input);
|
|
52
55
|
return response.data;
|