@deeptable/deeptable 0.1.0-alpha.1 → 0.1.0-alpha.2

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 (67) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +6 -6
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/files.d.mts +16 -2
  11. package/resources/files.d.mts.map +1 -1
  12. package/resources/files.d.ts +16 -2
  13. package/resources/files.d.ts.map +1 -1
  14. package/resources/files.js +25 -2
  15. package/resources/files.js.map +1 -1
  16. package/resources/files.mjs +25 -2
  17. package/resources/files.mjs.map +1 -1
  18. package/resources/index.d.mts +1 -1
  19. package/resources/index.d.mts.map +1 -1
  20. package/resources/index.d.ts +1 -1
  21. package/resources/index.d.ts.map +1 -1
  22. package/resources/index.js.map +1 -1
  23. package/resources/index.mjs.map +1 -1
  24. package/resources/structured-sheets/index.d.mts +2 -2
  25. package/resources/structured-sheets/index.d.mts.map +1 -1
  26. package/resources/structured-sheets/index.d.ts +2 -2
  27. package/resources/structured-sheets/index.d.ts.map +1 -1
  28. package/resources/structured-sheets/index.js +3 -3
  29. package/resources/structured-sheets/index.js.map +1 -1
  30. package/resources/structured-sheets/index.mjs +1 -1
  31. package/resources/structured-sheets/index.mjs.map +1 -1
  32. package/resources/structured-sheets/structured-sheets.d.mts +62 -22
  33. package/resources/structured-sheets/structured-sheets.d.mts.map +1 -1
  34. package/resources/structured-sheets/structured-sheets.d.ts +62 -22
  35. package/resources/structured-sheets/structured-sheets.d.ts.map +1 -1
  36. package/resources/structured-sheets/structured-sheets.js +51 -9
  37. package/resources/structured-sheets/structured-sheets.js.map +1 -1
  38. package/resources/structured-sheets/structured-sheets.mjs +51 -9
  39. package/resources/structured-sheets/structured-sheets.mjs.map +1 -1
  40. package/resources/structured-sheets/tables.d.mts +144 -0
  41. package/resources/structured-sheets/tables.d.mts.map +1 -0
  42. package/resources/structured-sheets/tables.d.ts +144 -0
  43. package/resources/structured-sheets/tables.d.ts.map +1 -0
  44. package/resources/structured-sheets/tables.js +75 -0
  45. package/resources/structured-sheets/tables.js.map +1 -0
  46. package/resources/structured-sheets/tables.mjs +71 -0
  47. package/resources/structured-sheets/tables.mjs.map +1 -0
  48. package/src/client.ts +6 -4
  49. package/src/resources/files.ts +26 -2
  50. package/src/resources/index.ts +3 -2
  51. package/src/resources/structured-sheets/index.ts +10 -3
  52. package/src/resources/structured-sheets/structured-sheets.ts +89 -26
  53. package/src/resources/structured-sheets/tables.ts +189 -0
  54. package/src/version.ts +1 -1
  55. package/version.d.mts +1 -1
  56. package/version.d.ts +1 -1
  57. package/version.js +1 -1
  58. package/version.mjs +1 -1
  59. package/resources/structured-sheets/exports.d.mts +0 -22
  60. package/resources/structured-sheets/exports.d.mts.map +0 -1
  61. package/resources/structured-sheets/exports.d.ts +0 -22
  62. package/resources/structured-sheets/exports.d.ts.map +0 -1
  63. package/resources/structured-sheets/exports.js +0 -33
  64. package/resources/structured-sheets/exports.js.map +0 -1
  65. package/resources/structured-sheets/exports.mjs +0 -29
  66. package/resources/structured-sheets/exports.mjs.map +0 -1
  67. package/src/resources/structured-sheets/exports.ts +0 -32
@@ -0,0 +1,144 @@
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
+ * },
49
+ * );
50
+ *
51
+ * const content = await response.blob();
52
+ * console.log(content);
53
+ * ```
54
+ */
55
+ download(tableID: string, params: TableDownloadParams, options?: RequestOptions): APIPromise<Response>;
56
+ }
57
+ /**
58
+ * Response representing a table extracted from a structured sheet.
59
+ *
60
+ * This is returned from GET (retrieve) and list table endpoints. Table names use
61
+ * SQL naming conventions (e.g., monthly_head_count).
62
+ */
63
+ export interface TableResponse {
64
+ /**
65
+ * The unique identifier for this table.
66
+ */
67
+ id: string;
68
+ /**
69
+ * The timestamp when this table was created.
70
+ */
71
+ created_at: string;
72
+ /**
73
+ * The name of the table using SQL naming conventions.
74
+ */
75
+ name: string;
76
+ /**
77
+ * The original Excel sheet name this table came from.
78
+ */
79
+ sheet_name: string;
80
+ /**
81
+ * Normalized sheet name for use in SQLite table names and export filenames
82
+ * (lowercase, snake_case).
83
+ */
84
+ sheet_name_normalized: string;
85
+ /**
86
+ * The ID of the structured sheet this table belongs to.
87
+ */
88
+ structured_sheet_id: string;
89
+ /**
90
+ * The type of table (relational, aggregation, or tableless).
91
+ */
92
+ type: 'relational' | 'aggregation' | 'tableless';
93
+ /**
94
+ * The object type, which is always 'table'.
95
+ */
96
+ object?: 'table';
97
+ }
98
+ /**
99
+ * Paginated response for listing tables from a structured sheet.
100
+ *
101
+ * Uses cursor-based pagination for efficient iteration through results.
102
+ */
103
+ export interface TableListResponse {
104
+ /**
105
+ * List of tables.
106
+ */
107
+ data: Array<TableResponse>;
108
+ /**
109
+ * Whether there are more results available after this page.
110
+ */
111
+ has_more: boolean;
112
+ /**
113
+ * Unique identifier for a table.
114
+ */
115
+ first_id?: string | null;
116
+ /**
117
+ * Unique identifier for a table.
118
+ */
119
+ last_id?: string | null;
120
+ /**
121
+ * The object type, which is always 'list'.
122
+ */
123
+ object?: 'list';
124
+ }
125
+ export interface TableRetrieveParams {
126
+ /**
127
+ * The unique identifier of the structured sheets conversion.
128
+ */
129
+ structured_sheets_id: string;
130
+ }
131
+ export interface TableDownloadParams {
132
+ /**
133
+ * Path param: The unique identifier of the structured sheets conversion.
134
+ */
135
+ structured_sheets_id: string;
136
+ /**
137
+ * Query param: The format to download the table data in.
138
+ */
139
+ format?: 'parquet' | 'csv';
140
+ }
141
+ export declare namespace Tables {
142
+ export { type TableResponse as TableResponse, type TableListResponse as TableListResponse, type TableRetrieveParams as TableRetrieveParams, type TableDownloadParams as TableDownloadParams, };
143
+ }
144
+ //# 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;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;CASvG;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,WAAW,CAAC;IAEjD;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;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,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CAC5B;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,144 @@
1
+ import { APIResource } 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
+ * },
49
+ * );
50
+ *
51
+ * const content = await response.blob();
52
+ * console.log(content);
53
+ * ```
54
+ */
55
+ download(tableID: string, params: TableDownloadParams, options?: RequestOptions): APIPromise<Response>;
56
+ }
57
+ /**
58
+ * Response representing a table extracted from a structured sheet.
59
+ *
60
+ * This is returned from GET (retrieve) and list table endpoints. Table names use
61
+ * SQL naming conventions (e.g., monthly_head_count).
62
+ */
63
+ export interface TableResponse {
64
+ /**
65
+ * The unique identifier for this table.
66
+ */
67
+ id: string;
68
+ /**
69
+ * The timestamp when this table was created.
70
+ */
71
+ created_at: string;
72
+ /**
73
+ * The name of the table using SQL naming conventions.
74
+ */
75
+ name: string;
76
+ /**
77
+ * The original Excel sheet name this table came from.
78
+ */
79
+ sheet_name: string;
80
+ /**
81
+ * Normalized sheet name for use in SQLite table names and export filenames
82
+ * (lowercase, snake_case).
83
+ */
84
+ sheet_name_normalized: string;
85
+ /**
86
+ * The ID of the structured sheet this table belongs to.
87
+ */
88
+ structured_sheet_id: string;
89
+ /**
90
+ * The type of table (relational, aggregation, or tableless).
91
+ */
92
+ type: 'relational' | 'aggregation' | 'tableless';
93
+ /**
94
+ * The object type, which is always 'table'.
95
+ */
96
+ object?: 'table';
97
+ }
98
+ /**
99
+ * Paginated response for listing tables from a structured sheet.
100
+ *
101
+ * Uses cursor-based pagination for efficient iteration through results.
102
+ */
103
+ export interface TableListResponse {
104
+ /**
105
+ * List of tables.
106
+ */
107
+ data: Array<TableResponse>;
108
+ /**
109
+ * Whether there are more results available after this page.
110
+ */
111
+ has_more: boolean;
112
+ /**
113
+ * Unique identifier for a table.
114
+ */
115
+ first_id?: string | null;
116
+ /**
117
+ * Unique identifier for a table.
118
+ */
119
+ last_id?: string | null;
120
+ /**
121
+ * The object type, which is always 'list'.
122
+ */
123
+ object?: 'list';
124
+ }
125
+ export interface TableRetrieveParams {
126
+ /**
127
+ * The unique identifier of the structured sheets conversion.
128
+ */
129
+ structured_sheets_id: string;
130
+ }
131
+ export interface TableDownloadParams {
132
+ /**
133
+ * Path param: The unique identifier of the structured sheets conversion.
134
+ */
135
+ structured_sheets_id: string;
136
+ /**
137
+ * Query param: The format to download the table data in.
138
+ */
139
+ format?: 'parquet' | 'csv';
140
+ }
141
+ export declare namespace Tables {
142
+ export { type TableResponse as TableResponse, type TableListResponse as TableListResponse, type TableRetrieveParams as TableRetrieveParams, type TableDownloadParams as TableDownloadParams, };
143
+ }
144
+ //# 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,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;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;CASvG;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,WAAW,CAAC;IAEjD;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;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,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CAC5B;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,75 @@
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
+ * },
58
+ * );
59
+ *
60
+ * const content = await response.blob();
61
+ * console.log(content);
62
+ * ```
63
+ */
64
+ download(tableID, params, options) {
65
+ const { structured_sheets_id, ...query } = params;
66
+ return this._client.get((0, path_1.path) `/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}/download`, {
67
+ query,
68
+ ...options,
69
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'application/vnd.apache.parquet' }, options?.headers]),
70
+ __binaryResponse: true,
71
+ });
72
+ }
73
+ }
74
+ exports.Tables = Tables;
75
+ //# 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;;;;;;;;;;;;;;;;;;;;;OAqBG;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;AAvED,wBAuEC"}
@@ -0,0 +1,71 @@
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
+ * },
55
+ * );
56
+ *
57
+ * const content = await response.blob();
58
+ * console.log(content);
59
+ * ```
60
+ */
61
+ download(tableID, params, options) {
62
+ const { structured_sheets_id, ...query } = params;
63
+ return this._client.get(path `/v1/structured-sheets/${structured_sheets_id}/tables/${tableID}/download`, {
64
+ query,
65
+ ...options,
66
+ headers: buildHeaders([{ Accept: 'application/vnd.apache.parquet' }, options?.headers]),
67
+ __binaryResponse: true,
68
+ });
69
+ }
70
+ }
71
+ //# 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;;;;;;;;;;;;;;;;;;;;;OAqBG;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 StructuredSheetResponse as StructuredSheetResponse,
769
- type StructuredSheetResponsesCursorIDPage as StructuredSheetResponsesCursorIDPage,
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
  }
@@ -16,7 +16,7 @@ export class Files extends APIResource {
16
16
  * @example
17
17
  * ```ts
18
18
  * const file = await client.files.retrieve(
19
- * 'file_01abc2def3ghjkmnpqrs4uvwxy',
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
- * 'file_01abc2def3ghjkmnpqrs4uvwxy',
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
  *
@@ -9,8 +9,9 @@ export {
9
9
  } from './files';
10
10
  export {
11
11
  StructuredSheets,
12
- type StructuredSheetResponse,
12
+ type StructuredSheetsResponse,
13
13
  type StructuredSheetCreateParams,
14
14
  type StructuredSheetListParams,
15
- type StructuredSheetResponsesCursorIDPage,
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 StructuredSheetResponse,
5
+ type StructuredSheetsResponse,
7
6
  type StructuredSheetCreateParams,
8
7
  type StructuredSheetListParams,
9
- type StructuredSheetResponsesCursorIDPage,
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';