@deeptable/deeptable 0.1.0-alpha.2 → 0.1.0-alpha.4
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/CHANGELOG.md +17 -0
- package/README.md +6 -6
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/files.d.mts +22 -3
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +22 -3
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +2 -5
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +2 -5
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/structured-sheets/index.d.mts +2 -2
- package/resources/structured-sheets/index.d.mts.map +1 -1
- package/resources/structured-sheets/index.d.ts +2 -2
- package/resources/structured-sheets/index.d.ts.map +1 -1
- package/resources/structured-sheets/index.js.map +1 -1
- package/resources/structured-sheets/index.mjs.map +1 -1
- package/resources/structured-sheets/structured-sheets.d.mts +45 -25
- package/resources/structured-sheets/structured-sheets.d.mts.map +1 -1
- package/resources/structured-sheets/structured-sheets.d.ts +45 -25
- package/resources/structured-sheets/structured-sheets.d.ts.map +1 -1
- package/resources/structured-sheets/structured-sheets.js +19 -21
- package/resources/structured-sheets/structured-sheets.js.map +1 -1
- package/resources/structured-sheets/structured-sheets.mjs +20 -22
- package/resources/structured-sheets/structured-sheets.mjs.map +1 -1
- package/resources/structured-sheets/tables.d.mts +19 -38
- package/resources/structured-sheets/tables.d.mts.map +1 -1
- package/resources/structured-sheets/tables.d.ts +19 -38
- package/resources/structured-sheets/tables.d.ts.map +1 -1
- package/resources/structured-sheets/tables.js +15 -10
- package/resources/structured-sheets/tables.js.map +1 -1
- package/resources/structured-sheets/tables.mjs +15 -10
- package/resources/structured-sheets/tables.mjs.map +1 -1
- package/src/client.ts +15 -5
- package/src/resources/files.ts +26 -6
- package/src/resources/index.ts +4 -2
- package/src/resources/structured-sheets/index.ts +5 -3
- package/src/resources/structured-sheets/structured-sheets.ts +63 -34
- package/src/resources/structured-sheets/tables.ts +34 -48
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as TablesAPI from './tables';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
TableDownloadParams,
|
|
7
|
+
TableListParams,
|
|
8
|
+
TableResponse,
|
|
9
|
+
TableResponsesCursorIDPage,
|
|
10
|
+
TableRetrieveParams,
|
|
11
|
+
Tables,
|
|
12
|
+
} from './tables';
|
|
6
13
|
import { APIPromise } from '../../core/api-promise';
|
|
7
14
|
import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../core/pagination';
|
|
8
15
|
import { buildHeaders } from '../../internal/headers';
|
|
@@ -19,29 +26,29 @@ export class StructuredSheets extends APIResource {
|
|
|
19
26
|
*
|
|
20
27
|
* @example
|
|
21
28
|
* ```ts
|
|
22
|
-
* const
|
|
29
|
+
* const structuredSheetResponse =
|
|
23
30
|
* await client.structuredSheets.create({
|
|
24
31
|
* file_id: 'file_01h45ytscbebyvny4gc8cr8ma2',
|
|
25
32
|
* });
|
|
26
33
|
* ```
|
|
27
34
|
*/
|
|
28
|
-
create(body: StructuredSheetCreateParams, options?: RequestOptions): APIPromise<
|
|
35
|
+
create(body: StructuredSheetCreateParams, options?: RequestOptions): APIPromise<StructuredSheetResponse> {
|
|
29
36
|
return this._client.post('/v1/structured-sheets', { body, ...options });
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
/**
|
|
33
|
-
* Get the status and details of a structured
|
|
40
|
+
* Get the status and details of a structured sheet conversion.
|
|
34
41
|
*
|
|
35
42
|
* @example
|
|
36
43
|
* ```ts
|
|
37
|
-
* const
|
|
44
|
+
* const structuredSheetResponse =
|
|
38
45
|
* await client.structuredSheets.retrieve(
|
|
39
46
|
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
40
47
|
* );
|
|
41
48
|
* ```
|
|
42
49
|
*/
|
|
43
|
-
retrieve(
|
|
44
|
-
return this._client.get(path`/v1/structured-sheets/${
|
|
50
|
+
retrieve(structuredSheetID: string, options?: RequestOptions): APIPromise<StructuredSheetResponse> {
|
|
51
|
+
return this._client.get(path`/v1/structured-sheets/${structuredSheetID}`, options);
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
/**
|
|
@@ -51,7 +58,7 @@ export class StructuredSheets extends APIResource {
|
|
|
51
58
|
* @example
|
|
52
59
|
* ```ts
|
|
53
60
|
* // Automatically fetches more pages as needed.
|
|
54
|
-
* for await (const
|
|
61
|
+
* for await (const structuredSheetResponse of client.structuredSheets.list()) {
|
|
55
62
|
* // ...
|
|
56
63
|
* }
|
|
57
64
|
* ```
|
|
@@ -59,45 +66,43 @@ export class StructuredSheets extends APIResource {
|
|
|
59
66
|
list(
|
|
60
67
|
query: StructuredSheetListParams | null | undefined = {},
|
|
61
68
|
options?: RequestOptions,
|
|
62
|
-
): PagePromise<
|
|
63
|
-
return this._client.getAPIList('/v1/structured-sheets', CursorIDPage<
|
|
69
|
+
): PagePromise<StructuredSheetResponsesCursorIDPage, StructuredSheetResponse> {
|
|
70
|
+
return this._client.getAPIList('/v1/structured-sheets', CursorIDPage<StructuredSheetResponse>, {
|
|
64
71
|
query,
|
|
65
72
|
...options,
|
|
66
73
|
});
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
/**
|
|
70
|
-
* Delete a structured
|
|
77
|
+
* Delete a structured sheet conversion and its associated exports. This action
|
|
71
78
|
* cannot be undone.
|
|
72
79
|
*
|
|
73
80
|
* @example
|
|
74
81
|
* ```ts
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
82
|
+
* const structuredSheet =
|
|
83
|
+
* await client.structuredSheets.delete(
|
|
84
|
+
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
85
|
+
* );
|
|
78
86
|
* ```
|
|
79
87
|
*/
|
|
80
|
-
delete(
|
|
81
|
-
return this._client.delete(path`/v1/structured-sheets/${
|
|
82
|
-
...options,
|
|
83
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
84
|
-
});
|
|
88
|
+
delete(structuredSheetID: string, options?: RequestOptions): APIPromise<StructuredSheetDeleteResponse> {
|
|
89
|
+
return this._client.delete(path`/v1/structured-sheets/${structuredSheetID}`, options);
|
|
85
90
|
}
|
|
86
91
|
|
|
87
92
|
/**
|
|
88
|
-
* Cancel a structured
|
|
93
|
+
* Cancel a structured sheet conversion that is in progress. Only jobs with status
|
|
89
94
|
* 'queued' or 'in_progress' can be cancelled.
|
|
90
95
|
*
|
|
91
96
|
* @example
|
|
92
97
|
* ```ts
|
|
93
|
-
* const
|
|
98
|
+
* const structuredSheetResponse =
|
|
94
99
|
* await client.structuredSheets.cancel(
|
|
95
100
|
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
96
101
|
* );
|
|
97
102
|
* ```
|
|
98
103
|
*/
|
|
99
|
-
cancel(
|
|
100
|
-
return this._client.post(path`/v1/structured-sheets/${
|
|
104
|
+
cancel(structuredSheetID: string, options?: RequestOptions): APIPromise<StructuredSheetResponse> {
|
|
105
|
+
return this._client.post(path`/v1/structured-sheets/${structuredSheetID}/cancel`, options);
|
|
101
106
|
}
|
|
102
107
|
|
|
103
108
|
/**
|
|
@@ -120,11 +125,11 @@ export class StructuredSheets extends APIResource {
|
|
|
120
125
|
* ```
|
|
121
126
|
*/
|
|
122
127
|
download(
|
|
123
|
-
|
|
128
|
+
structuredSheetID: string,
|
|
124
129
|
query: StructuredSheetDownloadParams | null | undefined = {},
|
|
125
130
|
options?: RequestOptions,
|
|
126
131
|
): APIPromise<Response> {
|
|
127
|
-
return this._client.get(path`/v1/structured-sheets/${
|
|
132
|
+
return this._client.get(path`/v1/structured-sheets/${structuredSheetID}/download`, {
|
|
128
133
|
query,
|
|
129
134
|
...options,
|
|
130
135
|
headers: buildHeaders([{ Accept: 'application/x-sqlite3' }, options?.headers]),
|
|
@@ -133,16 +138,16 @@ export class StructuredSheets extends APIResource {
|
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
140
|
|
|
136
|
-
export type
|
|
141
|
+
export type StructuredSheetResponsesCursorIDPage = CursorIDPage<StructuredSheetResponse>;
|
|
137
142
|
|
|
138
143
|
/**
|
|
139
|
-
* Response representing a structured
|
|
144
|
+
* Response representing a structured sheet conversion job.
|
|
140
145
|
*
|
|
141
146
|
* This is returned from POST (create), GET (retrieve), and list endpoints.
|
|
142
147
|
*/
|
|
143
|
-
export interface
|
|
148
|
+
export interface StructuredSheetResponse {
|
|
144
149
|
/**
|
|
145
|
-
* The unique identifier for this structured
|
|
150
|
+
* The unique identifier for this structured sheet conversion.
|
|
146
151
|
*/
|
|
147
152
|
id: string;
|
|
148
153
|
|
|
@@ -169,7 +174,7 @@ export interface StructuredSheetsResponse {
|
|
|
169
174
|
/**
|
|
170
175
|
* Error information when processing fails.
|
|
171
176
|
*/
|
|
172
|
-
last_error?:
|
|
177
|
+
last_error?: StructuredSheetResponse.LastError | null;
|
|
173
178
|
|
|
174
179
|
/**
|
|
175
180
|
* The object type, which is always 'structured_sheet'.
|
|
@@ -188,7 +193,7 @@ export interface StructuredSheetsResponse {
|
|
|
188
193
|
table_count?: number | null;
|
|
189
194
|
}
|
|
190
195
|
|
|
191
|
-
export namespace
|
|
196
|
+
export namespace StructuredSheetResponse {
|
|
192
197
|
/**
|
|
193
198
|
* Error information when processing fails.
|
|
194
199
|
*/
|
|
@@ -205,6 +210,28 @@ export namespace StructuredSheetsResponse {
|
|
|
205
210
|
}
|
|
206
211
|
}
|
|
207
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Response from deleting a structured sheet.
|
|
215
|
+
*
|
|
216
|
+
* Following the OpenAI API convention for delete responses.
|
|
217
|
+
*/
|
|
218
|
+
export interface StructuredSheetDeleteResponse {
|
|
219
|
+
/**
|
|
220
|
+
* The unique identifier of the deleted structured sheet.
|
|
221
|
+
*/
|
|
222
|
+
id: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Whether the structured sheet was successfully deleted.
|
|
226
|
+
*/
|
|
227
|
+
deleted?: true;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The object type, which is always 'structured_sheet'.
|
|
231
|
+
*/
|
|
232
|
+
object?: 'structured_sheet';
|
|
233
|
+
}
|
|
234
|
+
|
|
208
235
|
export interface StructuredSheetCreateParams {
|
|
209
236
|
/**
|
|
210
237
|
* The unique identifier of the file to convert.
|
|
@@ -230,8 +257,9 @@ StructuredSheets.Tables = Tables;
|
|
|
230
257
|
|
|
231
258
|
export declare namespace StructuredSheets {
|
|
232
259
|
export {
|
|
233
|
-
type
|
|
234
|
-
type
|
|
260
|
+
type StructuredSheetResponse as StructuredSheetResponse,
|
|
261
|
+
type StructuredSheetDeleteResponse as StructuredSheetDeleteResponse,
|
|
262
|
+
type StructuredSheetResponsesCursorIDPage as StructuredSheetResponsesCursorIDPage,
|
|
235
263
|
type StructuredSheetCreateParams as StructuredSheetCreateParams,
|
|
236
264
|
type StructuredSheetListParams as StructuredSheetListParams,
|
|
237
265
|
type StructuredSheetDownloadParams as StructuredSheetDownloadParams,
|
|
@@ -240,8 +268,9 @@ export declare namespace StructuredSheets {
|
|
|
240
268
|
export {
|
|
241
269
|
Tables as Tables,
|
|
242
270
|
type TableResponse as TableResponse,
|
|
243
|
-
type
|
|
271
|
+
type TableResponsesCursorIDPage as TableResponsesCursorIDPage,
|
|
244
272
|
type TableRetrieveParams as TableRetrieveParams,
|
|
273
|
+
type TableListParams as TableListParams,
|
|
245
274
|
type TableDownloadParams as TableDownloadParams,
|
|
246
275
|
};
|
|
247
276
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../core/pagination';
|
|
5
6
|
import { buildHeaders } from '../../internal/headers';
|
|
6
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
8
|
import { path } from '../../internal/utils/path';
|
|
@@ -17,7 +18,7 @@ export class Tables extends APIResource {
|
|
|
17
18
|
* await client.structuredSheets.tables.retrieve(
|
|
18
19
|
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
19
20
|
* {
|
|
20
|
-
*
|
|
21
|
+
* structured_sheet_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
21
22
|
* },
|
|
22
23
|
* );
|
|
23
24
|
* ```
|
|
@@ -27,8 +28,8 @@ export class Tables extends APIResource {
|
|
|
27
28
|
params: TableRetrieveParams,
|
|
28
29
|
options?: RequestOptions,
|
|
29
30
|
): APIPromise<TableResponse> {
|
|
30
|
-
const {
|
|
31
|
-
return this._client.get(path`/v1/structured-sheets/${
|
|
31
|
+
const { structured_sheet_id } = params;
|
|
32
|
+
return this._client.get(path`/v1/structured-sheets/${structured_sheet_id}/tables/${tableID}`, options);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -37,13 +38,24 @@ export class Tables extends APIResource {
|
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
39
40
|
* ```ts
|
|
40
|
-
*
|
|
41
|
+
* // Automatically fetches more pages as needed.
|
|
42
|
+
* for await (const tableResponse of client.structuredSheets.tables.list(
|
|
41
43
|
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
42
|
-
* )
|
|
44
|
+
* )) {
|
|
45
|
+
* // ...
|
|
46
|
+
* }
|
|
43
47
|
* ```
|
|
44
48
|
*/
|
|
45
|
-
list(
|
|
46
|
-
|
|
49
|
+
list(
|
|
50
|
+
structuredSheetID: string,
|
|
51
|
+
query: TableListParams | null | undefined = {},
|
|
52
|
+
options?: RequestOptions,
|
|
53
|
+
): PagePromise<TableResponsesCursorIDPage, TableResponse> {
|
|
54
|
+
return this._client.getAPIList(
|
|
55
|
+
path`/v1/structured-sheets/${structuredSheetID}/tables`,
|
|
56
|
+
CursorIDPage<TableResponse>,
|
|
57
|
+
{ query, ...options },
|
|
58
|
+
);
|
|
47
59
|
}
|
|
48
60
|
|
|
49
61
|
/**
|
|
@@ -60,7 +72,8 @@ export class Tables extends APIResource {
|
|
|
60
72
|
* await client.structuredSheets.tables.download(
|
|
61
73
|
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
62
74
|
* {
|
|
63
|
-
*
|
|
75
|
+
* structured_sheet_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
76
|
+
* format: 'parquet',
|
|
64
77
|
* },
|
|
65
78
|
* );
|
|
66
79
|
*
|
|
@@ -69,8 +82,8 @@ export class Tables extends APIResource {
|
|
|
69
82
|
* ```
|
|
70
83
|
*/
|
|
71
84
|
download(tableID: string, params: TableDownloadParams, options?: RequestOptions): APIPromise<Response> {
|
|
72
|
-
const {
|
|
73
|
-
return this._client.get(path`/v1/structured-sheets/${
|
|
85
|
+
const { structured_sheet_id, ...query } = params;
|
|
86
|
+
return this._client.get(path`/v1/structured-sheets/${structured_sheet_id}/tables/${tableID}/download`, {
|
|
74
87
|
query,
|
|
75
88
|
...options,
|
|
76
89
|
headers: buildHeaders([{ Accept: 'application/vnd.apache.parquet' }, options?.headers]),
|
|
@@ -79,6 +92,8 @@ export class Tables extends APIResource {
|
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
94
|
|
|
95
|
+
export type TableResponsesCursorIDPage = CursorIDPage<TableResponse>;
|
|
96
|
+
|
|
82
97
|
/**
|
|
83
98
|
* Response representing a table extracted from a structured sheet.
|
|
84
99
|
*
|
|
@@ -128,62 +143,33 @@ export interface TableResponse {
|
|
|
128
143
|
object?: 'table';
|
|
129
144
|
}
|
|
130
145
|
|
|
131
|
-
/**
|
|
132
|
-
* Paginated response for listing tables from a structured sheet.
|
|
133
|
-
*
|
|
134
|
-
* Uses cursor-based pagination for efficient iteration through results.
|
|
135
|
-
*/
|
|
136
|
-
export interface TableListResponse {
|
|
137
|
-
/**
|
|
138
|
-
* List of tables.
|
|
139
|
-
*/
|
|
140
|
-
data: Array<TableResponse>;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Whether there are more results available after this page.
|
|
144
|
-
*/
|
|
145
|
-
has_more: boolean;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Unique identifier for a table.
|
|
149
|
-
*/
|
|
150
|
-
first_id?: string | null;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Unique identifier for a table.
|
|
154
|
-
*/
|
|
155
|
-
last_id?: string | null;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The object type, which is always 'list'.
|
|
159
|
-
*/
|
|
160
|
-
object?: 'list';
|
|
161
|
-
}
|
|
162
|
-
|
|
163
146
|
export interface TableRetrieveParams {
|
|
164
147
|
/**
|
|
165
|
-
* The unique identifier of the structured
|
|
148
|
+
* The unique identifier of the structured sheet conversion.
|
|
166
149
|
*/
|
|
167
|
-
|
|
150
|
+
structured_sheet_id: string;
|
|
168
151
|
}
|
|
169
152
|
|
|
153
|
+
export interface TableListParams extends CursorIDPageParams {}
|
|
154
|
+
|
|
170
155
|
export interface TableDownloadParams {
|
|
171
156
|
/**
|
|
172
|
-
* Path param: The unique identifier of the structured
|
|
157
|
+
* Path param: The unique identifier of the structured sheet conversion.
|
|
173
158
|
*/
|
|
174
|
-
|
|
159
|
+
structured_sheet_id: string;
|
|
175
160
|
|
|
176
161
|
/**
|
|
177
162
|
* Query param: The format to download the table data in.
|
|
178
163
|
*/
|
|
179
|
-
format
|
|
164
|
+
format: 'parquet' | 'csv';
|
|
180
165
|
}
|
|
181
166
|
|
|
182
167
|
export declare namespace Tables {
|
|
183
168
|
export {
|
|
184
169
|
type TableResponse as TableResponse,
|
|
185
|
-
type
|
|
170
|
+
type TableResponsesCursorIDPage as TableResponsesCursorIDPage,
|
|
186
171
|
type TableRetrieveParams as TableRetrieveParams,
|
|
172
|
+
type TableListParams as TableListParams,
|
|
187
173
|
type TableDownloadParams as TableDownloadParams,
|
|
188
174
|
};
|
|
189
175
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.4'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.4";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '0.1.0-alpha.
|
|
4
|
+
exports.VERSION = '0.1.0-alpha.4'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.4'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|