@tembo-io/sdk 0.0.2 → 0.0.5
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 +27 -1
- package/LICENSE +1 -1
- package/README.md +41 -36
- package/client.d.mts +18 -15
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -15
- package/client.d.ts.map +1 -1
- package/client.js +41 -38
- package/client.js.map +1 -1
- package/client.mjs +40 -37
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +2 -2
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +2 -2
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +2 -2
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +2 -2
- package/core/error.d.ts.map +1 -1
- package/core/error.js +4 -4
- package/core/error.js.map +1 -1
- package/core/error.mjs +2 -2
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts +3 -3
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +3 -3
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +3 -3
- package/index.d.mts.map +1 -1
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/index.mjs +3 -3
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts +2 -2
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -2
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/shims.js +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/uploads.d.mts +4 -4
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +4 -4
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.js +2 -2
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +3 -3
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts +3 -3
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +3 -3
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.js +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +2 -2
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -6
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +23 -0
- package/resources/me.d.mts.map +1 -0
- package/resources/me.d.ts +23 -0
- package/resources/me.d.ts.map +1 -0
- package/resources/me.js +15 -0
- package/resources/me.js.map +1 -0
- package/resources/me.mjs +11 -0
- package/resources/me.mjs.map +1 -0
- package/resources/repository.d.mts +79 -1
- package/resources/repository.d.mts.map +1 -1
- package/resources/repository.d.ts +79 -1
- package/resources/repository.d.ts.map +1 -1
- package/resources/repository.js +1 -5
- package/resources/repository.js.map +1 -1
- package/resources/repository.mjs +1 -5
- package/resources/repository.mjs.map +1 -1
- package/resources/task.d.mts +107 -9
- package/resources/task.d.mts.map +1 -1
- package/resources/task.d.ts +107 -9
- package/resources/task.d.ts.map +1 -1
- package/resources/task.js +20 -16
- package/resources/task.js.map +1 -1
- package/resources/task.mjs +20 -16
- package/resources/task.mjs.map +1 -1
- package/src/client.ts +41 -25
- package/src/core/api-promise.ts +4 -4
- package/src/core/error.ts +2 -2
- package/src/core/resource.ts +3 -3
- package/src/index.ts +3 -3
- package/src/internal/parse.ts +2 -2
- package/src/internal/shims.ts +1 -1
- package/src/internal/uploads.ts +5 -5
- package/src/internal/utils/base64.ts +3 -3
- package/src/internal/utils/log.ts +3 -3
- package/src/internal/utils/path.ts +2 -2
- package/src/internal/utils/values.ts +6 -6
- package/src/resources/index.ts +11 -2
- package/src/resources/me.ts +30 -0
- package/src/resources/repository.ts +94 -6
- package/src/resources/task.ts +152 -26
- 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/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.0.
|
|
3
|
+
## 0.0.5 (2025-10-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.0.4...v0.0.5](https://github.com/tembo/sdk/compare/v0.0.4...v0.0.5)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([bbfa5df](https://github.com/tembo/sdk/commit/bbfa5dfdbee0db3724ccc6083778a163bcbe4056))
|
|
10
|
+
|
|
11
|
+
## 0.0.4 (2025-09-30)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.0.3...v0.0.4](https://github.com/tembo/sdk/compare/v0.0.3...v0.0.4)
|
|
14
|
+
|
|
15
|
+
### Chores
|
|
16
|
+
|
|
17
|
+
* update SDK settings ([c558dd7](https://github.com/tembo/sdk/commit/c558dd7e3afc6411dc0a0feb8e07fab13863f51c))
|
|
18
|
+
|
|
19
|
+
## 0.0.3 (2025-09-30)
|
|
20
|
+
|
|
21
|
+
Full Changelog: [v0.0.2...v0.0.3](https://github.com/tembo/sdk/compare/v0.0.2...v0.0.3)
|
|
22
|
+
|
|
23
|
+
### Chores
|
|
24
|
+
|
|
25
|
+
* update SDK settings ([fe61ca5](https://github.com/tembo/sdk/commit/fe61ca5acc022810ed83f4050c36b65f6d1d334e))
|
|
26
|
+
|
|
27
|
+
## 0.0.2 (2025-09-30)
|
|
4
28
|
|
|
5
29
|
Full Changelog: [v0.0.1...v0.0.2](https://github.com/tembo/sdk/compare/v0.0.1...v0.0.2)
|
|
6
30
|
|
|
7
31
|
### Chores
|
|
8
32
|
|
|
33
|
+
* sync repo ([c753fc3](https://github.com/tembo/sdk/commit/c753fc351a61b38361030eb089c932da8e49126d))
|
|
34
|
+
* update SDK settings ([9d9eaef](https://github.com/tembo/sdk/commit/9d9eaef2160c9636d5c2830697bf4064127fb09b))
|
|
9
35
|
* update SDK settings ([1161aa0](https://github.com/tembo/sdk/commit/1161aa0a796625716b3df1737e01f267e429c31c))
|
|
10
36
|
* update SDK settings ([c9bfac4](https://github.com/tembo/sdk/commit/c9bfac477594e7c0f684379a4abecb49be6e2850))
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2025 Tembo
|
|
189
|
+
Copyright 2025 Tembo
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Tembo
|
|
1
|
+
# Tembo TypeScript API Library
|
|
2
2
|
|
|
3
3
|
[>)](https://npmjs.org/package/@tembo-io/sdk) 
|
|
4
4
|
|
|
5
|
-
This library provides convenient access to the Tembo
|
|
5
|
+
This library provides convenient access to the Tembo REST API from server-side TypeScript or JavaScript.
|
|
6
6
|
|
|
7
7
|
The full API of this library can be found in [api.md](api.md).
|
|
8
8
|
|
|
@@ -20,11 +20,15 @@ The full API of this library can be found in [api.md](api.md).
|
|
|
20
20
|
|
|
21
21
|
<!-- prettier-ignore -->
|
|
22
22
|
```js
|
|
23
|
-
import
|
|
23
|
+
import Tembo from '@tembo-io/sdk';
|
|
24
24
|
|
|
25
|
-
const client = new
|
|
25
|
+
const client = new Tembo({
|
|
26
|
+
apiKey: process.env['TEMBO_API_KEY'], // This is the default and can be omitted
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const me = await client.me.retrieve();
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
console.log(me.orgId);
|
|
28
32
|
```
|
|
29
33
|
|
|
30
34
|
### Request & Response types
|
|
@@ -33,12 +37,13 @@ This library includes TypeScript definitions for all request params and response
|
|
|
33
37
|
|
|
34
38
|
<!-- prettier-ignore -->
|
|
35
39
|
```ts
|
|
36
|
-
import
|
|
40
|
+
import Tembo from '@tembo-io/sdk';
|
|
37
41
|
|
|
38
|
-
const client = new
|
|
42
|
+
const client = new Tembo({
|
|
43
|
+
apiKey: process.env['TEMBO_API_KEY'], // This is the default and can be omitted
|
|
44
|
+
});
|
|
39
45
|
|
|
40
|
-
const
|
|
41
|
-
await client.task.create(params);
|
|
46
|
+
const me: Tembo.MeRetrieveResponse = await client.me.retrieve();
|
|
42
47
|
```
|
|
43
48
|
|
|
44
49
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
@@ -51,8 +56,8 @@ a subclass of `APIError` will be thrown:
|
|
|
51
56
|
|
|
52
57
|
<!-- prettier-ignore -->
|
|
53
58
|
```ts
|
|
54
|
-
const
|
|
55
|
-
if (err instanceof
|
|
59
|
+
const me = await client.me.retrieve().catch(async (err) => {
|
|
60
|
+
if (err instanceof Tembo.APIError) {
|
|
56
61
|
console.log(err.status); // 400
|
|
57
62
|
console.log(err.name); // BadRequestError
|
|
58
63
|
console.log(err.headers); // {server: 'nginx', ...}
|
|
@@ -86,12 +91,12 @@ You can use the `maxRetries` option to configure or disable this:
|
|
|
86
91
|
<!-- prettier-ignore -->
|
|
87
92
|
```js
|
|
88
93
|
// Configure the default for all requests:
|
|
89
|
-
const client = new
|
|
94
|
+
const client = new Tembo({
|
|
90
95
|
maxRetries: 0, // default is 2
|
|
91
96
|
});
|
|
92
97
|
|
|
93
98
|
// Or, configure per-request:
|
|
94
|
-
await client.
|
|
99
|
+
await client.me.retrieve({
|
|
95
100
|
maxRetries: 5,
|
|
96
101
|
});
|
|
97
102
|
```
|
|
@@ -103,12 +108,12 @@ Requests time out after 1 minute by default. You can configure this with a `time
|
|
|
103
108
|
<!-- prettier-ignore -->
|
|
104
109
|
```ts
|
|
105
110
|
// Configure the default for all requests:
|
|
106
|
-
const client = new
|
|
111
|
+
const client = new Tembo({
|
|
107
112
|
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
108
113
|
});
|
|
109
114
|
|
|
110
115
|
// Override per-request:
|
|
111
|
-
await client.
|
|
116
|
+
await client.me.retrieve({
|
|
112
117
|
timeout: 5 * 1000,
|
|
113
118
|
});
|
|
114
119
|
```
|
|
@@ -129,15 +134,15 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
129
134
|
|
|
130
135
|
<!-- prettier-ignore -->
|
|
131
136
|
```ts
|
|
132
|
-
const client = new
|
|
137
|
+
const client = new Tembo();
|
|
133
138
|
|
|
134
|
-
const response = await client.
|
|
139
|
+
const response = await client.me.retrieve().asResponse();
|
|
135
140
|
console.log(response.headers.get('X-My-Header'));
|
|
136
141
|
console.log(response.statusText); // access the underlying Response object
|
|
137
142
|
|
|
138
|
-
const { data:
|
|
143
|
+
const { data: me, response: raw } = await client.me.retrieve().withResponse();
|
|
139
144
|
console.log(raw.headers.get('X-My-Header'));
|
|
140
|
-
console.log(
|
|
145
|
+
console.log(me.orgId);
|
|
141
146
|
```
|
|
142
147
|
|
|
143
148
|
### Logging
|
|
@@ -150,13 +155,13 @@ console.log(result);
|
|
|
150
155
|
|
|
151
156
|
The log level can be configured in two ways:
|
|
152
157
|
|
|
153
|
-
1. Via the `
|
|
158
|
+
1. Via the `TEMBO_LOG` environment variable
|
|
154
159
|
2. Using the `logLevel` client option (overrides the environment variable if set)
|
|
155
160
|
|
|
156
161
|
```ts
|
|
157
|
-
import
|
|
162
|
+
import Tembo from '@tembo-io/sdk';
|
|
158
163
|
|
|
159
|
-
const client = new
|
|
164
|
+
const client = new Tembo({
|
|
160
165
|
logLevel: 'debug', // Show all log messages
|
|
161
166
|
});
|
|
162
167
|
```
|
|
@@ -182,13 +187,13 @@ When providing a custom logger, the `logLevel` option still controls which messa
|
|
|
182
187
|
below the configured level will not be sent to your logger.
|
|
183
188
|
|
|
184
189
|
```ts
|
|
185
|
-
import
|
|
190
|
+
import Tembo from '@tembo-io/sdk';
|
|
186
191
|
import pino from 'pino';
|
|
187
192
|
|
|
188
193
|
const logger = pino();
|
|
189
194
|
|
|
190
|
-
const client = new
|
|
191
|
-
logger: logger.child({ name: '
|
|
195
|
+
const client = new Tembo({
|
|
196
|
+
logger: logger.child({ name: 'Tembo' }),
|
|
192
197
|
logLevel: 'debug', // Send all messages to pino, allowing it to filter
|
|
193
198
|
});
|
|
194
199
|
```
|
|
@@ -217,7 +222,7 @@ parameter. This library doesn't validate at runtime that the request matches the
|
|
|
217
222
|
send will be sent as-is.
|
|
218
223
|
|
|
219
224
|
```ts
|
|
220
|
-
client.
|
|
225
|
+
client.me.retrieve({
|
|
221
226
|
// ...
|
|
222
227
|
// @ts-expect-error baz is not yet public
|
|
223
228
|
baz: 'undocumented option',
|
|
@@ -251,10 +256,10 @@ globalThis.fetch = fetch;
|
|
|
251
256
|
Or pass it to the client:
|
|
252
257
|
|
|
253
258
|
```ts
|
|
254
|
-
import
|
|
259
|
+
import Tembo from '@tembo-io/sdk';
|
|
255
260
|
import fetch from 'my-fetch';
|
|
256
261
|
|
|
257
|
-
const client = new
|
|
262
|
+
const client = new Tembo({ fetch });
|
|
258
263
|
```
|
|
259
264
|
|
|
260
265
|
### Fetch options
|
|
@@ -262,9 +267,9 @@ const client = new TemboSDK({ fetch });
|
|
|
262
267
|
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
|
|
263
268
|
|
|
264
269
|
```ts
|
|
265
|
-
import
|
|
270
|
+
import Tembo from '@tembo-io/sdk';
|
|
266
271
|
|
|
267
|
-
const client = new
|
|
272
|
+
const client = new Tembo({
|
|
268
273
|
fetchOptions: {
|
|
269
274
|
// `RequestInit` options
|
|
270
275
|
},
|
|
@@ -279,11 +284,11 @@ options to requests:
|
|
|
279
284
|
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
|
|
280
285
|
|
|
281
286
|
```ts
|
|
282
|
-
import
|
|
287
|
+
import Tembo from '@tembo-io/sdk';
|
|
283
288
|
import * as undici from 'undici';
|
|
284
289
|
|
|
285
290
|
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
|
|
286
|
-
const client = new
|
|
291
|
+
const client = new Tembo({
|
|
287
292
|
fetchOptions: {
|
|
288
293
|
dispatcher: proxyAgent,
|
|
289
294
|
},
|
|
@@ -293,9 +298,9 @@ const client = new TemboSDK({
|
|
|
293
298
|
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
|
|
294
299
|
|
|
295
300
|
```ts
|
|
296
|
-
import
|
|
301
|
+
import Tembo from '@tembo-io/sdk';
|
|
297
302
|
|
|
298
|
-
const client = new
|
|
303
|
+
const client = new Tembo({
|
|
299
304
|
fetchOptions: {
|
|
300
305
|
proxy: 'http://localhost:8888',
|
|
301
306
|
},
|
|
@@ -305,10 +310,10 @@ const client = new TemboSDK({
|
|
|
305
310
|
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
|
|
306
311
|
|
|
307
312
|
```ts
|
|
308
|
-
import
|
|
313
|
+
import Tembo from 'npm:@tembo-io/sdk';
|
|
309
314
|
|
|
310
315
|
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
|
|
311
|
-
const client = new
|
|
316
|
+
const client = new Tembo({
|
|
312
317
|
fetchOptions: {
|
|
313
318
|
client: httpClient,
|
|
314
319
|
},
|
package/client.d.mts
CHANGED
|
@@ -6,21 +6,22 @@ import * as Errors from "./core/error.mjs";
|
|
|
6
6
|
import * as Uploads from "./core/uploads.mjs";
|
|
7
7
|
import * as API from "./resources/index.mjs";
|
|
8
8
|
import { APIPromise } from "./core/api-promise.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Me, MeRetrieveResponse } from "./resources/me.mjs";
|
|
10
|
+
import { Repository, RepositoryListResponse } from "./resources/repository.mjs";
|
|
11
|
+
import { Task, TaskCreateParams, TaskCreateResponse, TaskListParams, TaskListResponse, TaskSearchParams, TaskSearchResponse } from "./resources/task.mjs";
|
|
11
12
|
import { type Fetch } from "./internal/builtin-types.mjs";
|
|
12
13
|
import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
|
|
13
14
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
|
|
14
15
|
import { type LogLevel, type Logger } from "./internal/utils/log.mjs";
|
|
15
16
|
export interface ClientOptions {
|
|
16
17
|
/**
|
|
17
|
-
* Defaults to process.env['
|
|
18
|
+
* Defaults to process.env['TEMBO_API_KEY'].
|
|
18
19
|
*/
|
|
19
20
|
apiKey?: string | undefined;
|
|
20
21
|
/**
|
|
21
22
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
22
23
|
*
|
|
23
|
-
* Defaults to process.env['
|
|
24
|
+
* Defaults to process.env['TEMBO_BASE_URL'].
|
|
24
25
|
*/
|
|
25
26
|
baseURL?: string | null | undefined;
|
|
26
27
|
/**
|
|
@@ -68,7 +69,7 @@ export interface ClientOptions {
|
|
|
68
69
|
/**
|
|
69
70
|
* Set the log level.
|
|
70
71
|
*
|
|
71
|
-
* Defaults to process.env['
|
|
72
|
+
* Defaults to process.env['TEMBO_LOG'] or 'warn' if it isn't set.
|
|
72
73
|
*/
|
|
73
74
|
logLevel?: LogLevel | undefined;
|
|
74
75
|
/**
|
|
@@ -79,9 +80,9 @@ export interface ClientOptions {
|
|
|
79
80
|
logger?: Logger | undefined;
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
|
-
* API Client for interfacing with the Tembo
|
|
83
|
+
* API Client for interfacing with the Tembo API.
|
|
83
84
|
*/
|
|
84
|
-
export declare class
|
|
85
|
+
export declare class Tembo {
|
|
85
86
|
#private;
|
|
86
87
|
apiKey: string;
|
|
87
88
|
baseURL: string;
|
|
@@ -94,10 +95,10 @@ export declare class TemboSDK {
|
|
|
94
95
|
protected idempotencyHeader?: string;
|
|
95
96
|
private _options;
|
|
96
97
|
/**
|
|
97
|
-
* API Client for interfacing with the Tembo
|
|
98
|
+
* API Client for interfacing with the Tembo API.
|
|
98
99
|
*
|
|
99
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
100
|
-
* @param {string} [opts.baseURL=process.env['
|
|
100
|
+
* @param {string | undefined} [opts.apiKey=process.env['TEMBO_API_KEY'] ?? undefined]
|
|
101
|
+
* @param {string} [opts.baseURL=process.env['TEMBO_BASE_URL'] ?? https://internal.tembo.io/] - Override the default base URL for the API.
|
|
101
102
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
102
103
|
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
103
104
|
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -156,9 +157,9 @@ export declare class TemboSDK {
|
|
|
156
157
|
}>;
|
|
157
158
|
private buildHeaders;
|
|
158
159
|
private buildBody;
|
|
159
|
-
static
|
|
160
|
+
static Tembo: typeof Tembo;
|
|
160
161
|
static DEFAULT_TIMEOUT: number;
|
|
161
|
-
static
|
|
162
|
+
static TemboError: typeof Errors.TemboError;
|
|
162
163
|
static APIError: typeof Errors.APIError;
|
|
163
164
|
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
164
165
|
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
@@ -172,12 +173,14 @@ export declare class TemboSDK {
|
|
|
172
173
|
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
173
174
|
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
174
175
|
static toFile: typeof Uploads.toFile;
|
|
176
|
+
me: API.Me;
|
|
175
177
|
task: API.Task;
|
|
176
178
|
repository: API.Repository;
|
|
177
179
|
}
|
|
178
|
-
export declare namespace
|
|
180
|
+
export declare namespace Tembo {
|
|
179
181
|
export type RequestOptions = Opts.RequestOptions;
|
|
180
|
-
export {
|
|
181
|
-
export {
|
|
182
|
+
export { Me as Me, type MeRetrieveResponse as MeRetrieveResponse };
|
|
183
|
+
export { Task as Task, type TaskCreateResponse as TaskCreateResponse, type TaskListResponse as TaskListResponse, type TaskSearchResponse as TaskSearchResponse, type TaskCreateParams as TaskCreateParams, type TaskListParams as TaskListParams, type TaskSearchParams as TaskSearchParams, };
|
|
184
|
+
export { Repository as Repository, type RepositoryListResponse as RepositoryListResponse };
|
|
182
185
|
}
|
|
183
186
|
//# sourceMappingURL=client.d.mts.map
|
package/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAET,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KA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G,CAAC,IAAI,CAAsB;IACpC,UAAU,EAAE,GAAG,CAAC,UAAU,CAA4B;CACvD;AAMD,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAEjD,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;IAEnE,OAAO,EACL,IAAI,IAAI,IAAI,EACZ,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,KAAK,sBAAsB,IAAI,sBAAsB,EAAE,CAAC;CAC5F"}
|
package/client.d.ts
CHANGED
|
@@ -6,21 +6,22 @@ import * as Errors from "./core/error.js";
|
|
|
6
6
|
import * as Uploads from "./core/uploads.js";
|
|
7
7
|
import * as API from "./resources/index.js";
|
|
8
8
|
import { APIPromise } from "./core/api-promise.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Me, MeRetrieveResponse } from "./resources/me.js";
|
|
10
|
+
import { Repository, RepositoryListResponse } from "./resources/repository.js";
|
|
11
|
+
import { Task, TaskCreateParams, TaskCreateResponse, TaskListParams, TaskListResponse, TaskSearchParams, TaskSearchResponse } from "./resources/task.js";
|
|
11
12
|
import { type Fetch } from "./internal/builtin-types.js";
|
|
12
13
|
import { HeadersLike, NullableHeaders } from "./internal/headers.js";
|
|
13
14
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js";
|
|
14
15
|
import { type LogLevel, type Logger } from "./internal/utils/log.js";
|
|
15
16
|
export interface ClientOptions {
|
|
16
17
|
/**
|
|
17
|
-
* Defaults to process.env['
|
|
18
|
+
* Defaults to process.env['TEMBO_API_KEY'].
|
|
18
19
|
*/
|
|
19
20
|
apiKey?: string | undefined;
|
|
20
21
|
/**
|
|
21
22
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
22
23
|
*
|
|
23
|
-
* Defaults to process.env['
|
|
24
|
+
* Defaults to process.env['TEMBO_BASE_URL'].
|
|
24
25
|
*/
|
|
25
26
|
baseURL?: string | null | undefined;
|
|
26
27
|
/**
|
|
@@ -68,7 +69,7 @@ export interface ClientOptions {
|
|
|
68
69
|
/**
|
|
69
70
|
* Set the log level.
|
|
70
71
|
*
|
|
71
|
-
* Defaults to process.env['
|
|
72
|
+
* Defaults to process.env['TEMBO_LOG'] or 'warn' if it isn't set.
|
|
72
73
|
*/
|
|
73
74
|
logLevel?: LogLevel | undefined;
|
|
74
75
|
/**
|
|
@@ -79,9 +80,9 @@ export interface ClientOptions {
|
|
|
79
80
|
logger?: Logger | undefined;
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
|
-
* API Client for interfacing with the Tembo
|
|
83
|
+
* API Client for interfacing with the Tembo API.
|
|
83
84
|
*/
|
|
84
|
-
export declare class
|
|
85
|
+
export declare class Tembo {
|
|
85
86
|
#private;
|
|
86
87
|
apiKey: string;
|
|
87
88
|
baseURL: string;
|
|
@@ -94,10 +95,10 @@ export declare class TemboSDK {
|
|
|
94
95
|
protected idempotencyHeader?: string;
|
|
95
96
|
private _options;
|
|
96
97
|
/**
|
|
97
|
-
* API Client for interfacing with the Tembo
|
|
98
|
+
* API Client for interfacing with the Tembo API.
|
|
98
99
|
*
|
|
99
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
100
|
-
* @param {string} [opts.baseURL=process.env['
|
|
100
|
+
* @param {string | undefined} [opts.apiKey=process.env['TEMBO_API_KEY'] ?? undefined]
|
|
101
|
+
* @param {string} [opts.baseURL=process.env['TEMBO_BASE_URL'] ?? https://internal.tembo.io/] - Override the default base URL for the API.
|
|
101
102
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
102
103
|
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
103
104
|
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -156,9 +157,9 @@ export declare class TemboSDK {
|
|
|
156
157
|
}>;
|
|
157
158
|
private buildHeaders;
|
|
158
159
|
private buildBody;
|
|
159
|
-
static
|
|
160
|
+
static Tembo: typeof Tembo;
|
|
160
161
|
static DEFAULT_TIMEOUT: number;
|
|
161
|
-
static
|
|
162
|
+
static TemboError: typeof Errors.TemboError;
|
|
162
163
|
static APIError: typeof Errors.APIError;
|
|
163
164
|
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
164
165
|
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
@@ -172,12 +173,14 @@ export declare class TemboSDK {
|
|
|
172
173
|
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
173
174
|
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
174
175
|
static toFile: typeof Uploads.toFile;
|
|
176
|
+
me: API.Me;
|
|
175
177
|
task: API.Task;
|
|
176
178
|
repository: API.Repository;
|
|
177
179
|
}
|
|
178
|
-
export declare namespace
|
|
180
|
+
export declare namespace Tembo {
|
|
179
181
|
export type RequestOptions = Opts.RequestOptions;
|
|
180
|
-
export {
|
|
181
|
-
export {
|
|
182
|
+
export { Me as Me, type MeRetrieveResponse as MeRetrieveResponse };
|
|
183
|
+
export { Task as Task, type TaskCreateResponse as TaskCreateResponse, type TaskListResponse as TaskListResponse, type TaskSearchResponse as TaskSearchResponse, type TaskCreateParams as TaskCreateParams, type TaskListParams as TaskListParams, type TaskSearchParams as TaskSearchParams, };
|
|
184
|
+
export { Repository as Repository, type RepositoryListResponse as RepositoryListResponse };
|
|
182
185
|
}
|
|
183
186
|
//# sourceMappingURL=client.d.ts.map
|
package/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAET,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAET,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,EAAE,EAAE,kBAAkB,EAAE;OAC1B,EAAE,UAAU,EAAE,sBAAsB,EAAE;OACtC,EACL,IAAI,EACJ,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EACnB;OACM,EAAE,KAAK,KAAK,EAAE;OACd,EAAE,WAAW,EAAE,eAAe,EAAgB;OAC9C,EAAE,mBAAmB,EAAE,cAAc,EAAE;OAEvC,EACL,KAAK,QAAQ,EACb,KAAK,MAAM,EAIZ;AAGD,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEpC;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;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C5C,MAAM,CAAC,cAAc,+BAAyB;IAC9C,MAAM,CAAC,eAAe,gCAA0B;IAChD,MAAM,CAAC,mBAAmB,oCAA8B;IACxD,MAAM,CAAC,mBAAmB,oCAA8B;IACxD,MAAM,CAAC,qBAAqB,sCAAgC;IAC5D,MAAM,CAAC,wBAAwB,yCAAmC;IAElE,MAAM,CAAC,MAAM,wBAAkB;IAE/B,EAAE,EAAE,GAAG,CAAC,EAAE,CAAoB;IAC9B,IAAI,EAAE,GAAG,CAAC,IAAI,CAAsB;IACpC,UAAU,EAAE,GAAG,CAAC,UAAU,CAA4B;CACvD;AAMD,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAEjD,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;IAEnE,OAAO,EACL,IAAI,IAAI,IAAI,EACZ,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,KAAK,sBAAsB,IAAI,sBAAsB,EAAE,CAAC;CAC5F"}
|
package/client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
var
|
|
3
|
+
var _Tembo_instances, _a, _Tembo_encoder, _Tembo_baseURLOverridden;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.Tembo = void 0;
|
|
6
6
|
const tslib_1 = require("./internal/tslib.js");
|
|
7
7
|
const uuid_1 = require("./internal/utils/uuid.js");
|
|
8
8
|
const values_1 = require("./internal/utils/values.js");
|
|
@@ -16,6 +16,7 @@ const Errors = tslib_1.__importStar(require("./core/error.js"));
|
|
|
16
16
|
const Uploads = tslib_1.__importStar(require("./core/uploads.js"));
|
|
17
17
|
const API = tslib_1.__importStar(require("./resources/index.js"));
|
|
18
18
|
const api_promise_1 = require("./core/api-promise.js");
|
|
19
|
+
const me_1 = require("./resources/me.js");
|
|
19
20
|
const repository_1 = require("./resources/repository.js");
|
|
20
21
|
const task_1 = require("./resources/task.js");
|
|
21
22
|
const headers_1 = require("./internal/headers.js");
|
|
@@ -23,14 +24,14 @@ const env_1 = require("./internal/utils/env.js");
|
|
|
23
24
|
const log_1 = require("./internal/utils/log.js");
|
|
24
25
|
const values_2 = require("./internal/utils/values.js");
|
|
25
26
|
/**
|
|
26
|
-
* API Client for interfacing with the Tembo
|
|
27
|
+
* API Client for interfacing with the Tembo API.
|
|
27
28
|
*/
|
|
28
|
-
class
|
|
29
|
+
class Tembo {
|
|
29
30
|
/**
|
|
30
|
-
* API Client for interfacing with the Tembo
|
|
31
|
+
* API Client for interfacing with the Tembo API.
|
|
31
32
|
*
|
|
32
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
33
|
-
* @param {string} [opts.baseURL=process.env['
|
|
33
|
+
* @param {string | undefined} [opts.apiKey=process.env['TEMBO_API_KEY'] ?? undefined]
|
|
34
|
+
* @param {string} [opts.baseURL=process.env['TEMBO_BASE_URL'] ?? https://internal.tembo.io/] - Override the default base URL for the API.
|
|
34
35
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
35
36
|
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
36
37
|
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -38,18 +39,19 @@ class TemboSDK {
|
|
|
38
39
|
* @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
39
40
|
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
40
41
|
*/
|
|
41
|
-
constructor({ baseURL = (0, env_1.readEnv)('
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
constructor({ baseURL = (0, env_1.readEnv)('TEMBO_BASE_URL'), apiKey = (0, env_1.readEnv)('TEMBO_API_KEY'), ...opts } = {}) {
|
|
43
|
+
_Tembo_instances.add(this);
|
|
44
|
+
_Tembo_encoder.set(this, void 0);
|
|
45
|
+
this.me = new API.Me(this);
|
|
44
46
|
this.task = new API.Task(this);
|
|
45
47
|
this.repository = new API.Repository(this);
|
|
46
48
|
if (apiKey === undefined) {
|
|
47
|
-
throw new Errors.
|
|
49
|
+
throw new Errors.TemboError("The TEMBO_API_KEY environment variable is missing or empty; either provide it, or instantiate the Tembo client with an apiKey option, like new Tembo({ apiKey: 'My API Key' }).");
|
|
48
50
|
}
|
|
49
51
|
const options = {
|
|
50
52
|
apiKey,
|
|
51
53
|
...opts,
|
|
52
|
-
baseURL: baseURL || `https://
|
|
54
|
+
baseURL: baseURL || `https://internal.tembo.io/`,
|
|
53
55
|
};
|
|
54
56
|
this.baseURL = options.baseURL;
|
|
55
57
|
this.timeout = options.timeout ?? _a.DEFAULT_TIMEOUT /* 1 minute */;
|
|
@@ -59,12 +61,12 @@ class TemboSDK {
|
|
|
59
61
|
this.logLevel = defaultLogLevel;
|
|
60
62
|
this.logLevel =
|
|
61
63
|
(0, log_1.parseLogLevel)(options.logLevel, 'ClientOptions.logLevel', this) ??
|
|
62
|
-
(0, log_1.parseLogLevel)((0, env_1.readEnv)('
|
|
64
|
+
(0, log_1.parseLogLevel)((0, env_1.readEnv)('TEMBO_LOG'), "process.env['TEMBO_LOG']", this) ??
|
|
63
65
|
defaultLogLevel;
|
|
64
66
|
this.fetchOptions = options.fetchOptions;
|
|
65
67
|
this.maxRetries = options.maxRetries ?? 2;
|
|
66
68
|
this.fetch = options.fetch ?? Shims.getDefaultFetch();
|
|
67
|
-
tslib_1.__classPrivateFieldSet(this,
|
|
69
|
+
tslib_1.__classPrivateFieldSet(this, _Tembo_encoder, Opts.FallbackEncoder, "f");
|
|
68
70
|
this._options = options;
|
|
69
71
|
this.apiKey = apiKey;
|
|
70
72
|
}
|
|
@@ -108,7 +110,7 @@ class TemboSDK {
|
|
|
108
110
|
if (value === null) {
|
|
109
111
|
return `${encodeURIComponent(key)}=`;
|
|
110
112
|
}
|
|
111
|
-
throw new Errors.
|
|
113
|
+
throw new Errors.TemboError(`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.`);
|
|
112
114
|
})
|
|
113
115
|
.join('&');
|
|
114
116
|
}
|
|
@@ -122,7 +124,7 @@ class TemboSDK {
|
|
|
122
124
|
return Errors.APIError.generate(status, error, message, headers);
|
|
123
125
|
}
|
|
124
126
|
buildURL(path, query, defaultBaseURL) {
|
|
125
|
-
const baseURL = (!tslib_1.__classPrivateFieldGet(this,
|
|
127
|
+
const baseURL = (!tslib_1.__classPrivateFieldGet(this, _Tembo_instances, "m", _Tembo_baseURLOverridden).call(this) && defaultBaseURL) || this.baseURL;
|
|
126
128
|
const url = (0, values_1.isAbsoluteURL)(path) ?
|
|
127
129
|
new URL(path)
|
|
128
130
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
@@ -435,30 +437,31 @@ class TemboSDK {
|
|
|
435
437
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body) };
|
|
436
438
|
}
|
|
437
439
|
else {
|
|
438
|
-
return tslib_1.__classPrivateFieldGet(this,
|
|
440
|
+
return tslib_1.__classPrivateFieldGet(this, _Tembo_encoder, "f").call(this, { body, headers });
|
|
439
441
|
}
|
|
440
442
|
}
|
|
441
443
|
}
|
|
442
|
-
exports.
|
|
443
|
-
_a =
|
|
444
|
-
return this.baseURL !== 'https://
|
|
444
|
+
exports.Tembo = Tembo;
|
|
445
|
+
_a = Tembo, _Tembo_encoder = new WeakMap(), _Tembo_instances = new WeakSet(), _Tembo_baseURLOverridden = function _Tembo_baseURLOverridden() {
|
|
446
|
+
return this.baseURL !== 'https://internal.tembo.io/';
|
|
445
447
|
};
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
448
|
+
Tembo.Tembo = _a;
|
|
449
|
+
Tembo.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
450
|
+
Tembo.TemboError = Errors.TemboError;
|
|
451
|
+
Tembo.APIError = Errors.APIError;
|
|
452
|
+
Tembo.APIConnectionError = Errors.APIConnectionError;
|
|
453
|
+
Tembo.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
454
|
+
Tembo.APIUserAbortError = Errors.APIUserAbortError;
|
|
455
|
+
Tembo.NotFoundError = Errors.NotFoundError;
|
|
456
|
+
Tembo.ConflictError = Errors.ConflictError;
|
|
457
|
+
Tembo.RateLimitError = Errors.RateLimitError;
|
|
458
|
+
Tembo.BadRequestError = Errors.BadRequestError;
|
|
459
|
+
Tembo.AuthenticationError = Errors.AuthenticationError;
|
|
460
|
+
Tembo.InternalServerError = Errors.InternalServerError;
|
|
461
|
+
Tembo.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
462
|
+
Tembo.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
463
|
+
Tembo.toFile = Uploads.toFile;
|
|
464
|
+
Tembo.Me = me_1.Me;
|
|
465
|
+
Tembo.Task = task_1.Task;
|
|
466
|
+
Tembo.Repository = repository_1.Repository;
|
|
464
467
|
//# sourceMappingURL=client.js.map
|