@deeptable/deeptable 0.1.0-alpha.1 → 0.1.0-alpha.3
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 +22 -0
- package/README.md +6 -6
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/files.d.mts +16 -2
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +16 -2
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +25 -2
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +25 -2
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- 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 +3 -3
- package/resources/structured-sheets/index.js.map +1 -1
- package/resources/structured-sheets/index.mjs +1 -1
- package/resources/structured-sheets/index.mjs.map +1 -1
- package/resources/structured-sheets/structured-sheets.d.mts +62 -22
- package/resources/structured-sheets/structured-sheets.d.mts.map +1 -1
- package/resources/structured-sheets/structured-sheets.d.ts +62 -22
- package/resources/structured-sheets/structured-sheets.d.ts.map +1 -1
- package/resources/structured-sheets/structured-sheets.js +51 -9
- package/resources/structured-sheets/structured-sheets.js.map +1 -1
- package/resources/structured-sheets/structured-sheets.mjs +51 -9
- package/resources/structured-sheets/structured-sheets.mjs.map +1 -1
- package/resources/structured-sheets/tables.d.mts +145 -0
- package/resources/structured-sheets/tables.d.mts.map +1 -0
- package/resources/structured-sheets/tables.d.ts +145 -0
- package/resources/structured-sheets/tables.d.ts.map +1 -0
- package/resources/structured-sheets/tables.js +76 -0
- package/resources/structured-sheets/tables.js.map +1 -0
- package/resources/structured-sheets/tables.mjs +72 -0
- package/resources/structured-sheets/tables.mjs.map +1 -0
- package/src/client.ts +6 -4
- package/src/resources/files.ts +26 -2
- package/src/resources/index.ts +3 -2
- package/src/resources/structured-sheets/index.ts +10 -3
- package/src/resources/structured-sheets/structured-sheets.ts +89 -26
- package/src/resources/structured-sheets/tables.ts +190 -0
- 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
- package/resources/structured-sheets/exports.d.mts +0 -22
- package/resources/structured-sheets/exports.d.mts.map +0 -1
- package/resources/structured-sheets/exports.d.ts +0 -22
- package/resources/structured-sheets/exports.d.ts.map +0 -1
- package/resources/structured-sheets/exports.js +0 -33
- package/resources/structured-sheets/exports.js.map +0 -1
- package/resources/structured-sheets/exports.mjs +0 -29
- package/resources/structured-sheets/exports.mjs.map +0 -1
- package/src/resources/structured-sheets/exports.ts +0 -32
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
export declare class Tables extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get details of a specific table extracted from the structured sheet. Only
|
|
7
|
+
* available when conversion status is 'completed'.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const tableResponse =
|
|
12
|
+
* await client.structuredSheets.tables.retrieve(
|
|
13
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
14
|
+
* {
|
|
15
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
16
|
+
* },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(tableID: string, params: TableRetrieveParams, options?: RequestOptions): APIPromise<TableResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* List all tables extracted from the structured sheet. Only available when
|
|
23
|
+
* conversion status is 'completed'.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const tables = await client.structuredSheets.tables.list(
|
|
28
|
+
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(structuredSheetsID: string, options?: RequestOptions): APIPromise<TableListResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Download the table data in the specified format.
|
|
35
|
+
*
|
|
36
|
+
* Available formats:
|
|
37
|
+
*
|
|
38
|
+
* - `parquet`: Apache Parquet columnar format (recommended for data analysis)
|
|
39
|
+
* - `csv`: Comma-separated values (compatible with any spreadsheet application)
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const response =
|
|
44
|
+
* await client.structuredSheets.tables.download(
|
|
45
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
46
|
+
* {
|
|
47
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
48
|
+
* format: 'parquet',
|
|
49
|
+
* },
|
|
50
|
+
* );
|
|
51
|
+
*
|
|
52
|
+
* const content = await response.blob();
|
|
53
|
+
* console.log(content);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
download(tableID: string, params: TableDownloadParams, options?: RequestOptions): APIPromise<Response>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Response representing a table extracted from a structured sheet.
|
|
60
|
+
*
|
|
61
|
+
* This is returned from GET (retrieve) and list table endpoints. Table names use
|
|
62
|
+
* SQL naming conventions (e.g., monthly_head_count).
|
|
63
|
+
*/
|
|
64
|
+
export interface TableResponse {
|
|
65
|
+
/**
|
|
66
|
+
* The unique identifier for this table.
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
/**
|
|
70
|
+
* The timestamp when this table was created.
|
|
71
|
+
*/
|
|
72
|
+
created_at: string;
|
|
73
|
+
/**
|
|
74
|
+
* The name of the table using SQL naming conventions.
|
|
75
|
+
*/
|
|
76
|
+
name: string;
|
|
77
|
+
/**
|
|
78
|
+
* The original Excel sheet name this table came from.
|
|
79
|
+
*/
|
|
80
|
+
sheet_name: string;
|
|
81
|
+
/**
|
|
82
|
+
* Normalized sheet name for use in SQLite table names and export filenames
|
|
83
|
+
* (lowercase, snake_case).
|
|
84
|
+
*/
|
|
85
|
+
sheet_name_normalized: string;
|
|
86
|
+
/**
|
|
87
|
+
* The ID of the structured sheet this table belongs to.
|
|
88
|
+
*/
|
|
89
|
+
structured_sheet_id: string;
|
|
90
|
+
/**
|
|
91
|
+
* The type of table (relational, aggregation, or tableless).
|
|
92
|
+
*/
|
|
93
|
+
type: 'relational' | 'aggregation' | 'tableless';
|
|
94
|
+
/**
|
|
95
|
+
* The object type, which is always 'table'.
|
|
96
|
+
*/
|
|
97
|
+
object?: 'table';
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Paginated response for listing tables from a structured sheet.
|
|
101
|
+
*
|
|
102
|
+
* Uses cursor-based pagination for efficient iteration through results.
|
|
103
|
+
*/
|
|
104
|
+
export interface TableListResponse {
|
|
105
|
+
/**
|
|
106
|
+
* List of tables.
|
|
107
|
+
*/
|
|
108
|
+
data: Array<TableResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Whether there are more results available after this page.
|
|
111
|
+
*/
|
|
112
|
+
has_more: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Unique identifier for a table.
|
|
115
|
+
*/
|
|
116
|
+
first_id?: string | null;
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier for a table.
|
|
119
|
+
*/
|
|
120
|
+
last_id?: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* The object type, which is always 'list'.
|
|
123
|
+
*/
|
|
124
|
+
object?: 'list';
|
|
125
|
+
}
|
|
126
|
+
export interface TableRetrieveParams {
|
|
127
|
+
/**
|
|
128
|
+
* The unique identifier of the structured sheets conversion.
|
|
129
|
+
*/
|
|
130
|
+
structured_sheets_id: string;
|
|
131
|
+
}
|
|
132
|
+
export interface TableDownloadParams {
|
|
133
|
+
/**
|
|
134
|
+
* Path param: The unique identifier of the structured sheets conversion.
|
|
135
|
+
*/
|
|
136
|
+
structured_sheets_id: string;
|
|
137
|
+
/**
|
|
138
|
+
* Query param: The format to download the table data in.
|
|
139
|
+
*/
|
|
140
|
+
format: 'parquet' | 'csv';
|
|
141
|
+
}
|
|
142
|
+
export declare namespace Tables {
|
|
143
|
+
export { type TableResponse as TableResponse, type TableListResponse as TableListResponse, type TableRetrieveParams as TableRetrieveParams, type TableDownloadParams as TableDownloadParams, };
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=tables.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.d.mts","sourceRoot":"","sources":["../../src/resources/structured-sheets/tables.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC;IAK5B;;;;;;;;;;OAUG;IACH,IAAI,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAIzF;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,C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Resource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
export declare class Tables extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get details of a specific table extracted from the structured sheet. Only
|
|
7
|
+
* available when conversion status is 'completed'.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const tableResponse =
|
|
12
|
+
* await client.structuredSheets.tables.retrieve(
|
|
13
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
14
|
+
* {
|
|
15
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
16
|
+
* },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(tableID: string, params: TableRetrieveParams, options?: RequestOptions): APIPromise<TableResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* List all tables extracted from the structured sheet. Only available when
|
|
23
|
+
* conversion status is 'completed'.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const tables = await client.structuredSheets.tables.list(
|
|
28
|
+
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(structuredSheetsID: string, options?: RequestOptions): APIPromise<TableListResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Download the table data in the specified format.
|
|
35
|
+
*
|
|
36
|
+
* Available formats:
|
|
37
|
+
*
|
|
38
|
+
* - `parquet`: Apache Parquet columnar format (recommended for data analysis)
|
|
39
|
+
* - `csv`: Comma-separated values (compatible with any spreadsheet application)
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const response =
|
|
44
|
+
* await client.structuredSheets.tables.download(
|
|
45
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
46
|
+
* {
|
|
47
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
48
|
+
* format: 'parquet',
|
|
49
|
+
* },
|
|
50
|
+
* );
|
|
51
|
+
*
|
|
52
|
+
* const content = await response.blob();
|
|
53
|
+
* console.log(content);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
download(tableID: string, params: TableDownloadParams, options?: RequestOptions): APIPromise<Response>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Response representing a table extracted from a structured sheet.
|
|
60
|
+
*
|
|
61
|
+
* This is returned from GET (retrieve) and list table endpoints. Table names use
|
|
62
|
+
* SQL naming conventions (e.g., monthly_head_count).
|
|
63
|
+
*/
|
|
64
|
+
export interface TableResponse {
|
|
65
|
+
/**
|
|
66
|
+
* The unique identifier for this table.
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
/**
|
|
70
|
+
* The timestamp when this table was created.
|
|
71
|
+
*/
|
|
72
|
+
created_at: string;
|
|
73
|
+
/**
|
|
74
|
+
* The name of the table using SQL naming conventions.
|
|
75
|
+
*/
|
|
76
|
+
name: string;
|
|
77
|
+
/**
|
|
78
|
+
* The original Excel sheet name this table came from.
|
|
79
|
+
*/
|
|
80
|
+
sheet_name: string;
|
|
81
|
+
/**
|
|
82
|
+
* Normalized sheet name for use in SQLite table names and export filenames
|
|
83
|
+
* (lowercase, snake_case).
|
|
84
|
+
*/
|
|
85
|
+
sheet_name_normalized: string;
|
|
86
|
+
/**
|
|
87
|
+
* The ID of the structured sheet this table belongs to.
|
|
88
|
+
*/
|
|
89
|
+
structured_sheet_id: string;
|
|
90
|
+
/**
|
|
91
|
+
* The type of table (relational, aggregation, or tableless).
|
|
92
|
+
*/
|
|
93
|
+
type: 'relational' | 'aggregation' | 'tableless';
|
|
94
|
+
/**
|
|
95
|
+
* The object type, which is always 'table'.
|
|
96
|
+
*/
|
|
97
|
+
object?: 'table';
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Paginated response for listing tables from a structured sheet.
|
|
101
|
+
*
|
|
102
|
+
* Uses cursor-based pagination for efficient iteration through results.
|
|
103
|
+
*/
|
|
104
|
+
export interface TableListResponse {
|
|
105
|
+
/**
|
|
106
|
+
* List of tables.
|
|
107
|
+
*/
|
|
108
|
+
data: Array<TableResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Whether there are more results available after this page.
|
|
111
|
+
*/
|
|
112
|
+
has_more: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Unique identifier for a table.
|
|
115
|
+
*/
|
|
116
|
+
first_id?: string | null;
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier for a table.
|
|
119
|
+
*/
|
|
120
|
+
last_id?: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* The object type, which is always 'list'.
|
|
123
|
+
*/
|
|
124
|
+
object?: 'list';
|
|
125
|
+
}
|
|
126
|
+
export interface TableRetrieveParams {
|
|
127
|
+
/**
|
|
128
|
+
* The unique identifier of the structured sheets conversion.
|
|
129
|
+
*/
|
|
130
|
+
structured_sheets_id: string;
|
|
131
|
+
}
|
|
132
|
+
export interface TableDownloadParams {
|
|
133
|
+
/**
|
|
134
|
+
* Path param: The unique identifier of the structured sheets conversion.
|
|
135
|
+
*/
|
|
136
|
+
structured_sheets_id: string;
|
|
137
|
+
/**
|
|
138
|
+
* Query param: The format to download the table data in.
|
|
139
|
+
*/
|
|
140
|
+
format: 'parquet' | 'csv';
|
|
141
|
+
}
|
|
142
|
+
export declare namespace Tables {
|
|
143
|
+
export { type TableResponse as TableResponse, type TableListResponse as TableListResponse, type TableRetrieveParams as TableRetrieveParams, type TableDownloadParams as TableDownloadParams, };
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/resources/structured-sheets/tables.ts"],"names":[],"mappings":"OAEO,EAAE,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;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,SAAS,GAAG,KAAK,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Tables = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
class Tables extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get details of a specific table extracted from the structured sheet. Only
|
|
11
|
+
* available when conversion status is 'completed'.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const tableResponse =
|
|
16
|
+
* await client.structuredSheets.tables.retrieve(
|
|
17
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
18
|
+
* {
|
|
19
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
20
|
+
* },
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
retrieve(tableID, params, options) {
|
|
25
|
+
const { structured_sheets_id } = params;
|
|
26
|
+
return this._client.get((0, path_1.path) `/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}`, options);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List all tables extracted from the structured sheet. Only available when
|
|
30
|
+
* conversion status is 'completed'.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const tables = await client.structuredSheets.tables.list(
|
|
35
|
+
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
list(structuredSheetsID, options) {
|
|
40
|
+
return this._client.get((0, path_1.path) `/v1/structured-sheets/${structuredSheetsID}/tables`, options);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Download the table data in the specified format.
|
|
44
|
+
*
|
|
45
|
+
* Available formats:
|
|
46
|
+
*
|
|
47
|
+
* - `parquet`: Apache Parquet columnar format (recommended for data analysis)
|
|
48
|
+
* - `csv`: Comma-separated values (compatible with any spreadsheet application)
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const response =
|
|
53
|
+
* await client.structuredSheets.tables.download(
|
|
54
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
55
|
+
* {
|
|
56
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
57
|
+
* format: 'parquet',
|
|
58
|
+
* },
|
|
59
|
+
* );
|
|
60
|
+
*
|
|
61
|
+
* const content = await response.blob();
|
|
62
|
+
* console.log(content);
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
download(tableID, params, options) {
|
|
66
|
+
const { structured_sheets_id, ...query } = params;
|
|
67
|
+
return this._client.get((0, path_1.path) `/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}/download`, {
|
|
68
|
+
query,
|
|
69
|
+
...options,
|
|
70
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'application/vnd.apache.parquet' }, options?.headers]),
|
|
71
|
+
__binaryResponse: true,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.Tables = Tables;
|
|
76
|
+
//# sourceMappingURL=tables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.js","sourceRoot":"","sources":["../../src/resources/structured-sheets/tables.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CACN,OAAe,EACf,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,yBAAyB,oBAAoB,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CAAC,kBAA0B,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,yBAAyB,kBAAkB,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,OAAe,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,oBAAoB,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,yBAAyB,oBAAoB,WAAW,OAAO,WAAW,EAAE;YACtG,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,gCAAgC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACvF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAxED,wBAwEC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
export class Tables extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get details of a specific table extracted from the structured sheet. Only
|
|
8
|
+
* available when conversion status is 'completed'.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const tableResponse =
|
|
13
|
+
* await client.structuredSheets.tables.retrieve(
|
|
14
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
15
|
+
* {
|
|
16
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
17
|
+
* },
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
retrieve(tableID, params, options) {
|
|
22
|
+
const { structured_sheets_id } = params;
|
|
23
|
+
return this._client.get(path `/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}`, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* List all tables extracted from the structured sheet. Only available when
|
|
27
|
+
* conversion status is 'completed'.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const tables = await client.structuredSheets.tables.list(
|
|
32
|
+
* 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
list(structuredSheetsID, options) {
|
|
37
|
+
return this._client.get(path `/v1/structured-sheets/${structuredSheetsID}/tables`, options);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Download the table data in the specified format.
|
|
41
|
+
*
|
|
42
|
+
* Available formats:
|
|
43
|
+
*
|
|
44
|
+
* - `parquet`: Apache Parquet columnar format (recommended for data analysis)
|
|
45
|
+
* - `csv`: Comma-separated values (compatible with any spreadsheet application)
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const response =
|
|
50
|
+
* await client.structuredSheets.tables.download(
|
|
51
|
+
* 'tbl_01kfxgjd94fn9stqm45rqr2pnz',
|
|
52
|
+
* {
|
|
53
|
+
* structured_sheets_id: 'ss_01kfxgjd94fn9stqm42nejb627',
|
|
54
|
+
* format: 'parquet',
|
|
55
|
+
* },
|
|
56
|
+
* );
|
|
57
|
+
*
|
|
58
|
+
* const content = await response.blob();
|
|
59
|
+
* console.log(content);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
download(tableID, params, options) {
|
|
63
|
+
const { structured_sheets_id, ...query } = params;
|
|
64
|
+
return this._client.get(path `/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}/download`, {
|
|
65
|
+
query,
|
|
66
|
+
...options,
|
|
67
|
+
headers: buildHeaders([{ Accept: 'application/vnd.apache.parquet' }, options?.headers]),
|
|
68
|
+
__binaryResponse: true,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=tables.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.mjs","sourceRoot":"","sources":["../../src/resources/structured-sheets/tables.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CACN,OAAe,EACf,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,oBAAoB,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CAAC,kBAA0B,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,kBAAkB,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,OAAe,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,oBAAoB,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,oBAAoB,WAAW,OAAO,WAAW,EAAE;YACtG,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,gCAAgC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACvF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -21,10 +21,11 @@ import { APIPromise } from './core/api-promise';
|
|
|
21
21
|
import { File, FileListParams, FileUploadParams, Files, FilesCursorIDPage } from './resources/files';
|
|
22
22
|
import {
|
|
23
23
|
StructuredSheetCreateParams,
|
|
24
|
+
StructuredSheetDownloadParams,
|
|
24
25
|
StructuredSheetListParams,
|
|
25
|
-
StructuredSheetResponse,
|
|
26
|
-
StructuredSheetResponsesCursorIDPage,
|
|
27
26
|
StructuredSheets,
|
|
27
|
+
StructuredSheetsResponse,
|
|
28
|
+
StructuredSheetsResponsesCursorIDPage,
|
|
28
29
|
} from './resources/structured-sheets/structured-sheets';
|
|
29
30
|
import { type Fetch } from './internal/builtin-types';
|
|
30
31
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
@@ -765,9 +766,10 @@ export declare namespace DeepTable {
|
|
|
765
766
|
|
|
766
767
|
export {
|
|
767
768
|
StructuredSheets as StructuredSheets,
|
|
768
|
-
type
|
|
769
|
-
type
|
|
769
|
+
type StructuredSheetsResponse as StructuredSheetsResponse,
|
|
770
|
+
type StructuredSheetsResponsesCursorIDPage as StructuredSheetsResponsesCursorIDPage,
|
|
770
771
|
type StructuredSheetCreateParams as StructuredSheetCreateParams,
|
|
771
772
|
type StructuredSheetListParams as StructuredSheetListParams,
|
|
773
|
+
type StructuredSheetDownloadParams as StructuredSheetDownloadParams,
|
|
772
774
|
};
|
|
773
775
|
}
|
package/src/resources/files.ts
CHANGED
|
@@ -16,7 +16,7 @@ export class Files extends APIResource {
|
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
18
18
|
* const file = await client.files.retrieve(
|
|
19
|
-
* '
|
|
19
|
+
* 'file_01kfxgjd94fn9stqm414vjb0s8',
|
|
20
20
|
* );
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
@@ -48,7 +48,7 @@ export class Files extends APIResource {
|
|
|
48
48
|
* @example
|
|
49
49
|
* ```ts
|
|
50
50
|
* await client.files.delete(
|
|
51
|
-
* '
|
|
51
|
+
* 'file_01kfxgjd94fn9stqm414vjb0s8',
|
|
52
52
|
* );
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
@@ -59,6 +59,30 @@ export class Files extends APIResource {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Download the original uploaded file content.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const response = await client.files.download(
|
|
68
|
+
* 'file_01kfxgjd94fn9stqm414vjb0s8',
|
|
69
|
+
* );
|
|
70
|
+
*
|
|
71
|
+
* const content = await response.blob();
|
|
72
|
+
* console.log(content);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
download(fileID: string, options?: RequestOptions): APIPromise<Response> {
|
|
76
|
+
return this._client.get(path`/v1/files/${fileID}/content`, {
|
|
77
|
+
...options,
|
|
78
|
+
headers: buildHeaders([
|
|
79
|
+
{ Accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' },
|
|
80
|
+
options?.headers,
|
|
81
|
+
]),
|
|
82
|
+
__binaryResponse: true,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
62
86
|
/**
|
|
63
87
|
* Upload an Excel spreadsheet file for later processing.
|
|
64
88
|
*
|
package/src/resources/index.ts
CHANGED
|
@@ -9,8 +9,9 @@ export {
|
|
|
9
9
|
} from './files';
|
|
10
10
|
export {
|
|
11
11
|
StructuredSheets,
|
|
12
|
-
type
|
|
12
|
+
type StructuredSheetsResponse,
|
|
13
13
|
type StructuredSheetCreateParams,
|
|
14
14
|
type StructuredSheetListParams,
|
|
15
|
-
type
|
|
15
|
+
type StructuredSheetDownloadParams,
|
|
16
|
+
type StructuredSheetsResponsesCursorIDPage,
|
|
16
17
|
} from './structured-sheets/structured-sheets';
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export { Exports } from './exports';
|
|
4
3
|
export {
|
|
5
4
|
StructuredSheets,
|
|
6
|
-
type
|
|
5
|
+
type StructuredSheetsResponse,
|
|
7
6
|
type StructuredSheetCreateParams,
|
|
8
7
|
type StructuredSheetListParams,
|
|
9
|
-
type
|
|
8
|
+
type StructuredSheetDownloadParams,
|
|
9
|
+
type StructuredSheetsResponsesCursorIDPage,
|
|
10
10
|
} from './structured-sheets';
|
|
11
|
+
export {
|
|
12
|
+
Tables,
|
|
13
|
+
type TableResponse,
|
|
14
|
+
type TableListResponse,
|
|
15
|
+
type TableRetrieveParams,
|
|
16
|
+
type TableDownloadParams,
|
|
17
|
+
} from './tables';
|