@deeptable/deeptable 0.1.0-alpha.3 → 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.
Files changed (57) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +6 -6
  3. package/client.d.mts +4 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +4 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/files.d.mts +22 -3
  12. package/resources/files.d.mts.map +1 -1
  13. package/resources/files.d.ts +22 -3
  14. package/resources/files.d.ts.map +1 -1
  15. package/resources/files.js +2 -5
  16. package/resources/files.js.map +1 -1
  17. package/resources/files.mjs +2 -5
  18. package/resources/files.mjs.map +1 -1
  19. package/resources/index.d.mts +2 -2
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +2 -2
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js.map +1 -1
  24. package/resources/index.mjs.map +1 -1
  25. package/resources/structured-sheets/index.d.mts +2 -2
  26. package/resources/structured-sheets/index.d.mts.map +1 -1
  27. package/resources/structured-sheets/index.d.ts +2 -2
  28. package/resources/structured-sheets/index.d.ts.map +1 -1
  29. package/resources/structured-sheets/index.js.map +1 -1
  30. package/resources/structured-sheets/index.mjs.map +1 -1
  31. package/resources/structured-sheets/structured-sheets.d.mts +45 -25
  32. package/resources/structured-sheets/structured-sheets.d.mts.map +1 -1
  33. package/resources/structured-sheets/structured-sheets.d.ts +45 -25
  34. package/resources/structured-sheets/structured-sheets.d.ts.map +1 -1
  35. package/resources/structured-sheets/structured-sheets.js +19 -21
  36. package/resources/structured-sheets/structured-sheets.js.map +1 -1
  37. package/resources/structured-sheets/structured-sheets.mjs +20 -22
  38. package/resources/structured-sheets/structured-sheets.mjs.map +1 -1
  39. package/resources/structured-sheets/tables.d.mts +17 -37
  40. package/resources/structured-sheets/tables.d.mts.map +1 -1
  41. package/resources/structured-sheets/tables.d.ts +17 -37
  42. package/resources/structured-sheets/tables.d.ts.map +1 -1
  43. package/resources/structured-sheets/tables.js +14 -10
  44. package/resources/structured-sheets/tables.js.map +1 -1
  45. package/resources/structured-sheets/tables.mjs +14 -10
  46. package/resources/structured-sheets/tables.mjs.map +1 -1
  47. package/src/client.ts +15 -5
  48. package/src/resources/files.ts +26 -6
  49. package/src/resources/index.ts +4 -2
  50. package/src/resources/structured-sheets/index.ts +5 -3
  51. package/src/resources/structured-sheets/structured-sheets.ts +63 -34
  52. package/src/resources/structured-sheets/tables.ts +32 -47
  53. package/src/version.ts +1 -1
  54. package/version.d.mts +1 -1
  55. package/version.d.ts +1 -1
  56. package/version.js +1 -1
  57. 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 { TableDownloadParams, TableListResponse, TableResponse, TableRetrieveParams, Tables } from './tables';
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 structuredSheetsResponse =
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<StructuredSheetsResponse> {
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 sheets conversion.
40
+ * Get the status and details of a structured sheet conversion.
34
41
  *
35
42
  * @example
36
43
  * ```ts
37
- * const structuredSheetsResponse =
44
+ * const structuredSheetResponse =
38
45
  * await client.structuredSheets.retrieve(
39
46
  * 'ss_01kfxgjd94fn9stqm42nejb627',
40
47
  * );
41
48
  * ```
42
49
  */
43
- retrieve(structuredSheetsID: string, options?: RequestOptions): APIPromise<StructuredSheetsResponse> {
44
- return this._client.get(path`/v1/structured-sheets/${structuredSheetsID}`, options);
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 structuredSheetsResponse of client.structuredSheets.list()) {
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<StructuredSheetsResponsesCursorIDPage, StructuredSheetsResponse> {
63
- return this._client.getAPIList('/v1/structured-sheets', CursorIDPage<StructuredSheetsResponse>, {
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 sheets conversion and its associated exports. This action
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
- * await client.structuredSheets.delete(
76
- * 'ss_01kfxgjd94fn9stqm42nejb627',
77
- * );
82
+ * const structuredSheet =
83
+ * await client.structuredSheets.delete(
84
+ * 'ss_01kfxgjd94fn9stqm42nejb627',
85
+ * );
78
86
  * ```
79
87
  */
80
- delete(structuredSheetsID: string, options?: RequestOptions): APIPromise<void> {
81
- return this._client.delete(path`/v1/structured-sheets/${structuredSheetsID}`, {
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 sheets conversion that is in progress. Only jobs with status
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 structuredSheetsResponse =
98
+ * const structuredSheetResponse =
94
99
  * await client.structuredSheets.cancel(
95
100
  * 'ss_01kfxgjd94fn9stqm42nejb627',
96
101
  * );
97
102
  * ```
98
103
  */
99
- cancel(structuredSheetsID: string, options?: RequestOptions): APIPromise<StructuredSheetsResponse> {
100
- return this._client.post(path`/v1/structured-sheets/${structuredSheetsID}/cancel`, options);
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
- structuredSheetsID: string,
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/${structuredSheetsID}/download`, {
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 StructuredSheetsResponsesCursorIDPage = CursorIDPage<StructuredSheetsResponse>;
141
+ export type StructuredSheetResponsesCursorIDPage = CursorIDPage<StructuredSheetResponse>;
137
142
 
138
143
  /**
139
- * Response representing a structured sheets conversion job.
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 StructuredSheetsResponse {
148
+ export interface StructuredSheetResponse {
144
149
  /**
145
- * The unique identifier for this structured sheets conversion.
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?: StructuredSheetsResponse.LastError | null;
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 StructuredSheetsResponse {
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 StructuredSheetsResponse as StructuredSheetsResponse,
234
- type StructuredSheetsResponsesCursorIDPage as StructuredSheetsResponsesCursorIDPage,
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 TableListResponse as TableListResponse,
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
- * structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
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 { structured_sheets_id } = params;
31
- return this._client.get(path`/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}`, options);
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
- * const tables = await client.structuredSheets.tables.list(
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(structuredSheetsID: string, options?: RequestOptions): APIPromise<TableListResponse> {
46
- return this._client.get(path`/v1/structured-sheets/${structuredSheetsID}/tables`, options);
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,7 @@ export class Tables extends APIResource {
60
72
  * await client.structuredSheets.tables.download(
61
73
  * 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
62
74
  * {
63
- * structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
75
+ * structured_sheet_id: 'ss_01kfxgjd94fn9stqm42nejb627',
64
76
  * format: 'parquet',
65
77
  * },
66
78
  * );
@@ -70,8 +82,8 @@ export class Tables extends APIResource {
70
82
  * ```
71
83
  */
72
84
  download(tableID: string, params: TableDownloadParams, options?: RequestOptions): APIPromise<Response> {
73
- const { structured_sheets_id, ...query } = params;
74
- return this._client.get(path`/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}/download`, {
85
+ const { structured_sheet_id, ...query } = params;
86
+ return this._client.get(path`/v1/structured-sheets/${structured_sheet_id}/tables/${tableID}/download`, {
75
87
  query,
76
88
  ...options,
77
89
  headers: buildHeaders([{ Accept: 'application/vnd.apache.parquet' }, options?.headers]),
@@ -80,6 +92,8 @@ export class Tables extends APIResource {
80
92
  }
81
93
  }
82
94
 
95
+ export type TableResponsesCursorIDPage = CursorIDPage<TableResponse>;
96
+
83
97
  /**
84
98
  * Response representing a table extracted from a structured sheet.
85
99
  *
@@ -129,50 +143,20 @@ export interface TableResponse {
129
143
  object?: 'table';
130
144
  }
131
145
 
132
- /**
133
- * Paginated response for listing tables from a structured sheet.
134
- *
135
- * Uses cursor-based pagination for efficient iteration through results.
136
- */
137
- export interface TableListResponse {
138
- /**
139
- * List of tables.
140
- */
141
- data: Array<TableResponse>;
142
-
143
- /**
144
- * Whether there are more results available after this page.
145
- */
146
- has_more: boolean;
147
-
148
- /**
149
- * Unique identifier for a table.
150
- */
151
- first_id?: string | null;
152
-
153
- /**
154
- * Unique identifier for a table.
155
- */
156
- last_id?: string | null;
157
-
158
- /**
159
- * The object type, which is always 'list'.
160
- */
161
- object?: 'list';
162
- }
163
-
164
146
  export interface TableRetrieveParams {
165
147
  /**
166
- * The unique identifier of the structured sheets conversion.
148
+ * The unique identifier of the structured sheet conversion.
167
149
  */
168
- structured_sheets_id: string;
150
+ structured_sheet_id: string;
169
151
  }
170
152
 
153
+ export interface TableListParams extends CursorIDPageParams {}
154
+
171
155
  export interface TableDownloadParams {
172
156
  /**
173
- * Path param: The unique identifier of the structured sheets conversion.
157
+ * Path param: The unique identifier of the structured sheet conversion.
174
158
  */
175
- structured_sheets_id: string;
159
+ structured_sheet_id: string;
176
160
 
177
161
  /**
178
162
  * Query param: The format to download the table data in.
@@ -183,8 +167,9 @@ export interface TableDownloadParams {
183
167
  export declare namespace Tables {
184
168
  export {
185
169
  type TableResponse as TableResponse,
186
- type TableListResponse as TableListResponse,
170
+ type TableResponsesCursorIDPage as TableResponsesCursorIDPage,
187
171
  type TableRetrieveParams as TableRetrieveParams,
172
+ type TableListParams as TableListParams,
188
173
  type TableDownloadParams as TableDownloadParams,
189
174
  };
190
175
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
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.3";
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.3";
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.3'; // x-release-please-version
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.3'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.4'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map