@deeptable/deeptable 0.1.0-beta.2 → 0.1.0-beta.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 +40 -0
- package/client.d.mts +10 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -3
- package/client.d.ts.map +1 -1
- package/client.js +32 -20
- package/client.js.map +1 -1
- package/client.mjs +32 -20
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/files.d.mts +9 -6
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +9 -6
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +3 -0
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +3 -0
- package/resources/files.mjs.map +1 -1
- package/resources/structured-sheets/structured-sheets.d.mts +9 -6
- package/resources/structured-sheets/structured-sheets.d.mts.map +1 -1
- package/resources/structured-sheets/structured-sheets.d.ts +9 -6
- package/resources/structured-sheets/structured-sheets.d.ts.map +1 -1
- package/resources/structured-sheets/structured-sheets.js +3 -0
- package/resources/structured-sheets/structured-sheets.js.map +1 -1
- package/resources/structured-sheets/structured-sheets.mjs +3 -0
- package/resources/structured-sheets/structured-sheets.mjs.map +1 -1
- package/resources/structured-sheets/tables.d.mts +12 -7
- package/resources/structured-sheets/tables.d.mts.map +1 -1
- package/resources/structured-sheets/tables.d.ts +12 -7
- package/resources/structured-sheets/tables.d.ts.map +1 -1
- package/resources/structured-sheets/tables.js +3 -0
- package/resources/structured-sheets/tables.js.map +1 -1
- package/resources/structured-sheets/tables.mjs +3 -0
- package/resources/structured-sheets/tables.mjs.map +1 -1
- package/src/client.ts +42 -27
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/files.ts +9 -6
- package/src/resources/structured-sheets/structured-sheets.ts +10 -7
- package/src/resources/structured-sheets/tables.ts +13 -8
- 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
|
@@ -3,6 +3,9 @@ import { APIResource } from "../../core/resource.mjs";
|
|
|
3
3
|
import { CursorIDPage } from "../../core/pagination.mjs";
|
|
4
4
|
import { buildHeaders } from "../../internal/headers.mjs";
|
|
5
5
|
import { path } from "../../internal/utils/path.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Convert uploaded spreadsheets into structured data. Creates relational tables from messy spreadsheet data.
|
|
8
|
+
*/
|
|
6
9
|
export class Tables extends APIResource {
|
|
7
10
|
/**
|
|
8
11
|
* Get details of a specific table extracted from the structured sheet. Only
|
|
@@ -1 +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,EAAwC;OACtD,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,mBAAmB,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,mBAAmB,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,iBAAyB,EACzB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,yBAAyB,iBAAiB,SAAS,EACvD,CAAA,YAA2B,CAAA,EAC3B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,OAAe,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,mBAAmB,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,mBAAmB,WAAW,OAAO,WAAW,EAAE;YACrG,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"}
|
|
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,EAAwC;OACtD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CACN,OAAe,EACf,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,mBAAmB,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,iBAAyB,EACzB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,yBAAyB,iBAAiB,SAAS,EACvD,CAAA,YAA2B,CAAA,EAC3B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,OAAe,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,mBAAmB,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,mBAAmB,WAAW,OAAO,WAAW,EAAE;YACrG,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
|
@@ -11,6 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
14
15
|
import { VERSION } from './version';
|
|
15
16
|
import * as Errors from './core/error';
|
|
16
17
|
import * as Pagination from './core/pagination';
|
|
@@ -231,21 +232,8 @@ export class DeepTable {
|
|
|
231
232
|
/**
|
|
232
233
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
233
234
|
*/
|
|
234
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
235
|
-
return
|
|
236
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
237
|
-
.map(([key, value]) => {
|
|
238
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
239
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
240
|
-
}
|
|
241
|
-
if (value === null) {
|
|
242
|
-
return `${encodeURIComponent(key)}=`;
|
|
243
|
-
}
|
|
244
|
-
throw new Errors.DeepTableError(
|
|
245
|
-
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
246
|
-
);
|
|
247
|
-
})
|
|
248
|
-
.join('&');
|
|
235
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
236
|
+
return stringifyQuery(query);
|
|
249
237
|
}
|
|
250
238
|
|
|
251
239
|
private getUserAgent(): string {
|
|
@@ -277,12 +265,13 @@ export class DeepTable {
|
|
|
277
265
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
278
266
|
|
|
279
267
|
const defaultQuery = this.defaultQuery();
|
|
280
|
-
|
|
281
|
-
|
|
268
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
269
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
270
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
282
271
|
}
|
|
283
272
|
|
|
284
273
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
285
|
-
url.search = this.stringifyQuery(query
|
|
274
|
+
url.search = this.stringifyQuery(query);
|
|
286
275
|
}
|
|
287
276
|
|
|
288
277
|
return url.toString();
|
|
@@ -466,7 +455,7 @@ export class DeepTable {
|
|
|
466
455
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
467
456
|
|
|
468
457
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
469
|
-
const errJSON = safeJSON(errText);
|
|
458
|
+
const errJSON = safeJSON(errText) as any;
|
|
470
459
|
const errMessage = errJSON ? undefined : errText;
|
|
471
460
|
|
|
472
461
|
loggerFor(this).debug(
|
|
@@ -503,9 +492,14 @@ export class DeepTable {
|
|
|
503
492
|
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
504
493
|
path: string,
|
|
505
494
|
Page: new (...args: any[]) => PageClass,
|
|
506
|
-
opts?: RequestOptions
|
|
495
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
507
496
|
): Pagination.PagePromise<PageClass, Item> {
|
|
508
|
-
return this.requestAPIList(
|
|
497
|
+
return this.requestAPIList(
|
|
498
|
+
Page,
|
|
499
|
+
opts && 'then' in opts ?
|
|
500
|
+
opts.then((opts) => ({ method: 'get', path, ...opts }))
|
|
501
|
+
: { method: 'get', path, ...opts },
|
|
502
|
+
);
|
|
509
503
|
}
|
|
510
504
|
|
|
511
505
|
requestAPIList<
|
|
@@ -513,7 +507,7 @@ export class DeepTable {
|
|
|
513
507
|
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
514
508
|
>(
|
|
515
509
|
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
516
|
-
options: FinalRequestOptions
|
|
510
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
517
511
|
): Pagination.PagePromise<PageClass, Item> {
|
|
518
512
|
const request = this.makeRequest(options, null, undefined);
|
|
519
513
|
return new Pagination.PagePromise<PageClass, Item>(this as any as DeepTable, request, Page);
|
|
@@ -526,9 +520,10 @@ export class DeepTable {
|
|
|
526
520
|
controller: AbortController,
|
|
527
521
|
): Promise<Response> {
|
|
528
522
|
const { signal, method, ...options } = init || {};
|
|
529
|
-
|
|
523
|
+
const abort = this._makeAbort(controller);
|
|
524
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
530
525
|
|
|
531
|
-
const timeout = setTimeout(
|
|
526
|
+
const timeout = setTimeout(abort, ms);
|
|
532
527
|
|
|
533
528
|
const isReadableBody =
|
|
534
529
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -605,9 +600,9 @@ export class DeepTable {
|
|
|
605
600
|
}
|
|
606
601
|
}
|
|
607
602
|
|
|
608
|
-
// If the API asks us to wait a certain amount of time
|
|
609
|
-
//
|
|
610
|
-
if (
|
|
603
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
604
|
+
// says, but otherwise calculate a default
|
|
605
|
+
if (timeoutMillis === undefined) {
|
|
611
606
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
612
607
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
613
608
|
}
|
|
@@ -695,6 +690,12 @@ export class DeepTable {
|
|
|
695
690
|
return headers.values;
|
|
696
691
|
}
|
|
697
692
|
|
|
693
|
+
private _makeAbort(controller: AbortController) {
|
|
694
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
695
|
+
// would capture all request options, and cause a memory leak.
|
|
696
|
+
return () => controller.abort();
|
|
697
|
+
}
|
|
698
|
+
|
|
698
699
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
699
700
|
bodyHeaders: HeadersLike;
|
|
700
701
|
body: BodyInit | undefined;
|
|
@@ -727,6 +728,14 @@ export class DeepTable {
|
|
|
727
728
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
728
729
|
) {
|
|
729
730
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
731
|
+
} else if (
|
|
732
|
+
typeof body === 'object' &&
|
|
733
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
734
|
+
) {
|
|
735
|
+
return {
|
|
736
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
737
|
+
body: this.stringifyQuery(body),
|
|
738
|
+
};
|
|
730
739
|
} else {
|
|
731
740
|
return this.#encoder({ body, headers });
|
|
732
741
|
}
|
|
@@ -751,7 +760,13 @@ export class DeepTable {
|
|
|
751
760
|
|
|
752
761
|
static toFile = Uploads.toFile;
|
|
753
762
|
|
|
763
|
+
/**
|
|
764
|
+
* Upload and manage spreadsheet files. Files must be Excel (.xlsx) format.
|
|
765
|
+
*/
|
|
754
766
|
files: API.Files = new API.Files(this);
|
|
767
|
+
/**
|
|
768
|
+
* Convert uploaded spreadsheets into structured data. Creates relational tables from messy spreadsheet data.
|
|
769
|
+
*/
|
|
755
770
|
structuredSheets: API.StructuredSheets = new API.StructuredSheets(this);
|
|
756
771
|
}
|
|
757
772
|
|
package/src/internal/parse.ts
CHANGED
|
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: DeepTable, props: APIRespo
|
|
|
29
29
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
30
30
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
31
31
|
if (isJSON) {
|
|
32
|
+
const contentLength = response.headers.get('content-length');
|
|
33
|
+
if (contentLength === '0') {
|
|
34
|
+
// if there is no content we can't do anything
|
|
35
|
+
return undefined as T;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
const json = await response.json();
|
|
33
39
|
return json as T;
|
|
34
40
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { DeepTableError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
7
|
+
*/
|
|
8
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
9
|
+
return Object.entries(query)
|
|
10
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
11
|
+
.map(([key, value]) => {
|
|
12
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
13
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
14
|
+
}
|
|
15
|
+
if (value === null) {
|
|
16
|
+
return `${encodeURIComponent(key)}=`;
|
|
17
|
+
}
|
|
18
|
+
throw new DeepTableError(
|
|
19
|
+
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
20
|
+
);
|
|
21
|
+
})
|
|
22
|
+
.join('&');
|
|
23
|
+
}
|
package/src/internal/utils.ts
CHANGED
package/src/resources/files.ts
CHANGED
|
@@ -9,6 +9,9 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
9
9
|
import { multipartFormRequestOptions } from '../internal/uploads';
|
|
10
10
|
import { path } from '../internal/utils/path';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Upload and manage spreadsheet files. Files must be Excel (.xlsx) format.
|
|
14
|
+
*/
|
|
12
15
|
export class Files extends APIResource {
|
|
13
16
|
/**
|
|
14
17
|
* Get metadata for a specific file.
|
|
@@ -130,14 +133,14 @@ export interface File {
|
|
|
130
133
|
file_name: string;
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
|
-
* The
|
|
136
|
+
* The object type, which is always 'file'.
|
|
134
137
|
*/
|
|
135
|
-
|
|
138
|
+
object: 'file';
|
|
136
139
|
|
|
137
140
|
/**
|
|
138
|
-
* The
|
|
141
|
+
* The size of the file in bytes.
|
|
139
142
|
*/
|
|
140
|
-
|
|
143
|
+
size: number;
|
|
141
144
|
}
|
|
142
145
|
|
|
143
146
|
/**
|
|
@@ -154,12 +157,12 @@ export interface FileDeleteResponse {
|
|
|
154
157
|
/**
|
|
155
158
|
* Whether the file was successfully deleted.
|
|
156
159
|
*/
|
|
157
|
-
deleted
|
|
160
|
+
deleted: true;
|
|
158
161
|
|
|
159
162
|
/**
|
|
160
163
|
* The object type, which is always 'file'.
|
|
161
164
|
*/
|
|
162
|
-
object
|
|
165
|
+
object: 'file';
|
|
163
166
|
}
|
|
164
167
|
|
|
165
168
|
export interface FileListParams extends CursorIDPageParams {}
|
|
@@ -16,6 +16,9 @@ import { buildHeaders } from '../../internal/headers';
|
|
|
16
16
|
import { RequestOptions } from '../../internal/request-options';
|
|
17
17
|
import { path } from '../../internal/utils/path';
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Convert uploaded spreadsheets into structured data. Creates relational tables from messy spreadsheet data.
|
|
21
|
+
*/
|
|
19
22
|
export class StructuredSheets extends APIResource {
|
|
20
23
|
tables: TablesAPI.Tables = new TablesAPI.Tables(this._client);
|
|
21
24
|
|
|
@@ -161,6 +164,11 @@ export interface StructuredSheetResponse {
|
|
|
161
164
|
*/
|
|
162
165
|
file_id: string;
|
|
163
166
|
|
|
167
|
+
/**
|
|
168
|
+
* The object type, which is always 'structured_sheet'.
|
|
169
|
+
*/
|
|
170
|
+
object: 'structured_sheet';
|
|
171
|
+
|
|
164
172
|
/**
|
|
165
173
|
* The current processing status.
|
|
166
174
|
*/
|
|
@@ -176,11 +184,6 @@ export interface StructuredSheetResponse {
|
|
|
176
184
|
*/
|
|
177
185
|
last_error?: StructuredSheetResponse.LastError | null;
|
|
178
186
|
|
|
179
|
-
/**
|
|
180
|
-
* The object type, which is always 'structured_sheet'.
|
|
181
|
-
*/
|
|
182
|
-
object?: 'structured_sheet';
|
|
183
|
-
|
|
184
187
|
/**
|
|
185
188
|
* List of sheet names included in this conversion.
|
|
186
189
|
*/
|
|
@@ -224,12 +227,12 @@ export interface StructuredSheetDeleteResponse {
|
|
|
224
227
|
/**
|
|
225
228
|
* Whether the structured sheet was successfully deleted.
|
|
226
229
|
*/
|
|
227
|
-
deleted
|
|
230
|
+
deleted: true;
|
|
228
231
|
|
|
229
232
|
/**
|
|
230
233
|
* The object type, which is always 'structured_sheet'.
|
|
231
234
|
*/
|
|
232
|
-
object
|
|
235
|
+
object: 'structured_sheet';
|
|
233
236
|
}
|
|
234
237
|
|
|
235
238
|
export interface StructuredSheetCreateParams {
|
|
@@ -7,6 +7,9 @@ import { buildHeaders } from '../../internal/headers';
|
|
|
7
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
8
|
import { path } from '../../internal/utils/path';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Convert uploaded spreadsheets into structured data. Creates relational tables from messy spreadsheet data.
|
|
12
|
+
*/
|
|
10
13
|
export class Tables extends APIResource {
|
|
11
14
|
/**
|
|
12
15
|
* Get details of a specific table extracted from the structured sheet. Only
|
|
@@ -113,11 +116,18 @@ export interface TableResponse {
|
|
|
113
116
|
|
|
114
117
|
/**
|
|
115
118
|
* Composite table name: {normalized_sheet_name}**{table_name}. Uses lowercase
|
|
116
|
-
* snake_case. Aggregation tables end with '**aggregations'.
|
|
117
|
-
*
|
|
119
|
+
* snake_case. Aggregation tables end with '**aggregations'. Two special metadata
|
|
120
|
+
* tables exist per structured sheet: '**deeptable_workbook_metadata' (workbook
|
|
121
|
+
* provenance info) and '**deeptable_table_overview' (summary of all tables).
|
|
122
|
+
* Example: 'staffing**head_count' or 'staffing**head_count\_\_aggregations'.
|
|
118
123
|
*/
|
|
119
124
|
name: string;
|
|
120
125
|
|
|
126
|
+
/**
|
|
127
|
+
* The object type, which is always 'table'.
|
|
128
|
+
*/
|
|
129
|
+
object: 'table';
|
|
130
|
+
|
|
121
131
|
/**
|
|
122
132
|
* The original Excel sheet name this table came from.
|
|
123
133
|
*/
|
|
@@ -129,14 +139,9 @@ export interface TableResponse {
|
|
|
129
139
|
structured_sheet_id: string;
|
|
130
140
|
|
|
131
141
|
/**
|
|
132
|
-
* The type of table (relational, aggregation, or
|
|
142
|
+
* The type of table (relational, aggregation, tableless, or metadata).
|
|
133
143
|
*/
|
|
134
144
|
type: 'relational' | 'aggregation' | 'tableless' | 'metadata';
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* The object type, which is always 'table'.
|
|
138
|
-
*/
|
|
139
|
-
object?: 'table';
|
|
140
145
|
}
|
|
141
146
|
|
|
142
147
|
export interface TableRetrieveParams {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.4'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-beta.
|
|
1
|
+
export declare const VERSION = "0.1.0-beta.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-beta.
|
|
1
|
+
export declare const VERSION = "0.1.0-beta.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-beta.
|
|
4
|
+
exports.VERSION = '0.1.0-beta.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-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.4'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|