@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.
Files changed (127) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/LICENSE +1 -1
  3. package/README.md +41 -36
  4. package/client.d.mts +18 -15
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +18 -15
  7. package/client.d.ts.map +1 -1
  8. package/client.js +41 -38
  9. package/client.js.map +1 -1
  10. package/client.mjs +40 -37
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.mts.map +1 -1
  14. package/core/api-promise.d.ts +2 -2
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +2 -2
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +2 -2
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +4 -4
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +2 -2
  25. package/core/error.mjs.map +1 -1
  26. package/core/resource.d.mts +3 -3
  27. package/core/resource.d.mts.map +1 -1
  28. package/core/resource.d.ts +3 -3
  29. package/core/resource.d.ts.map +1 -1
  30. package/core/resource.js.map +1 -1
  31. package/core/resource.mjs.map +1 -1
  32. package/index.d.mts +3 -3
  33. package/index.d.mts.map +1 -1
  34. package/index.d.ts +3 -3
  35. package/index.d.ts.map +1 -1
  36. package/index.js +4 -4
  37. package/index.js.map +1 -1
  38. package/index.mjs +3 -3
  39. package/index.mjs.map +1 -1
  40. package/internal/parse.d.mts +2 -2
  41. package/internal/parse.d.mts.map +1 -1
  42. package/internal/parse.d.ts +2 -2
  43. package/internal/parse.d.ts.map +1 -1
  44. package/internal/parse.js.map +1 -1
  45. package/internal/parse.mjs.map +1 -1
  46. package/internal/shims.js +1 -1
  47. package/internal/shims.js.map +1 -1
  48. package/internal/shims.mjs +1 -1
  49. package/internal/shims.mjs.map +1 -1
  50. package/internal/uploads.d.mts +4 -4
  51. package/internal/uploads.d.mts.map +1 -1
  52. package/internal/uploads.d.ts +4 -4
  53. package/internal/uploads.d.ts.map +1 -1
  54. package/internal/uploads.js.map +1 -1
  55. package/internal/uploads.mjs.map +1 -1
  56. package/internal/utils/base64.js +2 -2
  57. package/internal/utils/base64.js.map +1 -1
  58. package/internal/utils/base64.mjs +3 -3
  59. package/internal/utils/base64.mjs.map +1 -1
  60. package/internal/utils/log.d.mts +3 -3
  61. package/internal/utils/log.d.mts.map +1 -1
  62. package/internal/utils/log.d.ts +3 -3
  63. package/internal/utils/log.d.ts.map +1 -1
  64. package/internal/utils/log.js.map +1 -1
  65. package/internal/utils/log.mjs.map +1 -1
  66. package/internal/utils/path.js +1 -1
  67. package/internal/utils/path.js.map +1 -1
  68. package/internal/utils/path.mjs +2 -2
  69. package/internal/utils/path.mjs.map +1 -1
  70. package/internal/utils/values.js +5 -5
  71. package/internal/utils/values.js.map +1 -1
  72. package/internal/utils/values.mjs +6 -6
  73. package/internal/utils/values.mjs.map +1 -1
  74. package/package.json +3 -3
  75. package/resources/index.d.mts +3 -2
  76. package/resources/index.d.mts.map +1 -1
  77. package/resources/index.d.ts +3 -2
  78. package/resources/index.d.ts.map +1 -1
  79. package/resources/index.js +3 -1
  80. package/resources/index.js.map +1 -1
  81. package/resources/index.mjs +2 -1
  82. package/resources/index.mjs.map +1 -1
  83. package/resources/me.d.mts +23 -0
  84. package/resources/me.d.mts.map +1 -0
  85. package/resources/me.d.ts +23 -0
  86. package/resources/me.d.ts.map +1 -0
  87. package/resources/me.js +15 -0
  88. package/resources/me.js.map +1 -0
  89. package/resources/me.mjs +11 -0
  90. package/resources/me.mjs.map +1 -0
  91. package/resources/repository.d.mts +79 -1
  92. package/resources/repository.d.mts.map +1 -1
  93. package/resources/repository.d.ts +79 -1
  94. package/resources/repository.d.ts.map +1 -1
  95. package/resources/repository.js +1 -5
  96. package/resources/repository.js.map +1 -1
  97. package/resources/repository.mjs +1 -5
  98. package/resources/repository.mjs.map +1 -1
  99. package/resources/task.d.mts +107 -9
  100. package/resources/task.d.mts.map +1 -1
  101. package/resources/task.d.ts +107 -9
  102. package/resources/task.d.ts.map +1 -1
  103. package/resources/task.js +20 -16
  104. package/resources/task.js.map +1 -1
  105. package/resources/task.mjs +20 -16
  106. package/resources/task.mjs.map +1 -1
  107. package/src/client.ts +41 -25
  108. package/src/core/api-promise.ts +4 -4
  109. package/src/core/error.ts +2 -2
  110. package/src/core/resource.ts +3 -3
  111. package/src/index.ts +3 -3
  112. package/src/internal/parse.ts +2 -2
  113. package/src/internal/shims.ts +1 -1
  114. package/src/internal/uploads.ts +5 -5
  115. package/src/internal/utils/base64.ts +3 -3
  116. package/src/internal/utils/log.ts +3 -3
  117. package/src/internal/utils/path.ts +2 -2
  118. package/src/internal/utils/values.ts +6 -6
  119. package/src/resources/index.ts +11 -2
  120. package/src/resources/me.ts +30 -0
  121. package/src/resources/repository.ts +94 -6
  122. package/src/resources/task.ts +152 -26
  123. package/src/version.ts +1 -1
  124. package/version.d.mts +1 -1
  125. package/version.d.ts +1 -1
  126. package/version.js +1 -1
  127. package/version.mjs +1 -1
@@ -4,36 +4,134 @@ import { RequestOptions } from "../internal/request-options.js";
4
4
  export declare class Task extends APIResource {
5
5
  /**
6
6
  * Create a user-supplied task
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const task = await client.task.create();
11
+ * ```
7
12
  */
8
- create(body: TaskCreateParams, options?: RequestOptions): APIPromise<void>;
13
+ create(body: TaskCreateParams, options?: RequestOptions): APIPromise<TaskCreateResponse>;
9
14
  /**
10
15
  * Gets a paginated list of issues for the organization
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const tasks = await client.task.list();
20
+ * ```
11
21
  */
12
- list(query?: TaskListParams | null | undefined, options?: RequestOptions): APIPromise<void>;
22
+ list(query?: TaskListParams | null | undefined, options?: RequestOptions): APIPromise<TaskListResponse>;
13
23
  /**
14
24
  * Search issues for the organization with pagination
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const response = await client.task.search({
29
+ * q: 'authentication bug',
30
+ * });
31
+ * ```
15
32
  */
16
- search(query: TaskSearchParams, options?: RequestOptions): APIPromise<void>;
33
+ search(query: TaskSearchParams, options?: RequestOptions): APIPromise<TaskSearchResponse>;
34
+ }
35
+ export interface TaskCreateResponse {
36
+ id: string;
37
+ createdAt: string;
38
+ description: string;
39
+ organizationId: string;
40
+ status: string;
41
+ title: string;
42
+ updatedAt: string;
43
+ }
44
+ export interface TaskListResponse {
45
+ issues: Array<TaskListResponse.Issue>;
46
+ meta: TaskListResponse.Meta;
47
+ }
48
+ export declare namespace TaskListResponse {
49
+ interface Issue {
50
+ id: string;
51
+ createdAt: string;
52
+ description: string;
53
+ organizationId: string;
54
+ status: string;
55
+ title: string;
56
+ updatedAt: string;
57
+ }
58
+ interface Meta {
59
+ currentPage: number;
60
+ hasNext: boolean;
61
+ hasPrevious: boolean;
62
+ pageSize: number;
63
+ totalCount: number;
64
+ totalPages: number;
65
+ }
66
+ }
67
+ export interface TaskSearchResponse {
68
+ issues: Array<TaskSearchResponse.Issue>;
69
+ meta: TaskSearchResponse.Meta;
70
+ query: string;
71
+ }
72
+ export declare namespace TaskSearchResponse {
73
+ interface Issue {
74
+ id: string;
75
+ createdAt: string;
76
+ description: string;
77
+ organizationId: string;
78
+ status: string;
79
+ title: string;
80
+ updatedAt: string;
81
+ }
82
+ interface Meta {
83
+ currentPage: number;
84
+ hasNext: boolean;
85
+ hasPrevious: boolean;
86
+ pageSize: number;
87
+ totalCount: number;
88
+ totalPages: number;
89
+ }
17
90
  }
18
91
  export interface TaskCreateParams {
19
- json: string;
20
- agent?: string;
92
+ /**
93
+ * Specific git branch to target for this task
94
+ */
21
95
  branch?: string | null;
22
- codeRepoIds?: Array<string>;
23
- description?: string;
96
+ /**
97
+ * Brief description of the task to be performed
98
+ */
24
99
  prompt?: string;
25
- queueRightAway?: boolean;
100
+ /**
101
+ * Whether to immediately queue the task for processing (optional, defaults to
102
+ * true)
103
+ */
104
+ queueRightAway?: boolean | null;
105
+ /**
106
+ * Array of code repository IDs that this task relates to
107
+ */
108
+ repositories?: Array<string>;
26
109
  }
27
110
  export interface TaskListParams {
111
+ /**
112
+ * Number of items to return per page (max 100)
113
+ */
28
114
  limit?: number;
115
+ /**
116
+ * Page number to retrieve (starts from 1)
117
+ */
29
118
  page?: number;
30
119
  }
31
120
  export interface TaskSearchParams {
121
+ /**
122
+ * Search query to find issues by title or description
123
+ */
32
124
  q: string;
125
+ /**
126
+ * Number of items to return per page (max 100)
127
+ */
33
128
  limit?: number;
129
+ /**
130
+ * Page number to retrieve (starts from 1)
131
+ */
34
132
  page?: number;
35
133
  }
36
134
  export declare namespace Task {
37
- export { type TaskCreateParams as TaskCreateParams, type TaskListParams as TaskListParams, type TaskSearchParams as TaskSearchParams, };
135
+ export { type TaskCreateResponse as TaskCreateResponse, type TaskListResponse as TaskListResponse, type TaskSearchResponse as TaskSearchResponse, type TaskCreateParams as TaskCreateParams, type TaskListParams as TaskListParams, type TaskSearchParams as TaskSearchParams, };
38
136
  }
39
137
  //# sourceMappingURL=task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../src/resources/task.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ1E;;OAEG;IACH,IAAI,CAAC,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ/F;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO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C;CACH"}
package/resources/task.js CHANGED
@@ -3,37 +3,41 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Task = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
- const headers_1 = require("../internal/headers.js");
7
6
  class Task extends resource_1.APIResource {
8
7
  /**
9
8
  * Create a user-supplied task
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const task = await client.task.create();
13
+ * ```
10
14
  */
11
15
  create(body, options) {
12
- return this._client.post('/task/create', {
13
- body,
14
- ...options,
15
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
16
- });
16
+ return this._client.post('/task/create', { body, ...options });
17
17
  }
18
18
  /**
19
19
  * Gets a paginated list of issues for the organization
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const tasks = await client.task.list();
24
+ * ```
20
25
  */
21
26
  list(query = {}, options) {
22
- return this._client.get('/task/list', {
23
- query,
24
- ...options,
25
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
26
- });
27
+ return this._client.get('/task/list', { query, ...options });
27
28
  }
28
29
  /**
29
30
  * Search issues for the organization with pagination
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const response = await client.task.search({
35
+ * q: 'authentication bug',
36
+ * });
37
+ * ```
30
38
  */
31
39
  search(query, options) {
32
- return this._client.get('/task/search', {
33
- query,
34
- ...options,
35
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
36
- });
40
+ return this._client.get('/task/search', { query, ...options });
37
41
  }
38
42
  }
39
43
  exports.Task = Task;
@@ -1 +1 @@
1
- {"version":3,"file":"task.js","sourceRoot":"","sources":["../src/resources/task.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAGnD,MAAa,IAAK,SAAQ,sBAAW;IACnC;;OAEG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,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AE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAzCD,oBAyCC"}
@@ -1,36 +1,40 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../core/resource.mjs";
3
- import { buildHeaders } from "../internal/headers.mjs";
4
3
  export class Task extends APIResource {
5
4
  /**
6
5
  * Create a user-supplied task
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const task = await client.task.create();
10
+ * ```
7
11
  */
8
12
  create(body, options) {
9
- return this._client.post('/task/create', {
10
- body,
11
- ...options,
12
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
13
- });
13
+ return this._client.post('/task/create', { body, ...options });
14
14
  }
15
15
  /**
16
16
  * Gets a paginated list of issues for the organization
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const tasks = await client.task.list();
21
+ * ```
17
22
  */
18
23
  list(query = {}, options) {
19
- return this._client.get('/task/list', {
20
- query,
21
- ...options,
22
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
23
- });
24
+ return this._client.get('/task/list', { query, ...options });
24
25
  }
25
26
  /**
26
27
  * Search issues for the organization with pagination
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const response = await client.task.search({
32
+ * q: 'authentication bug',
33
+ * });
34
+ * ```
27
35
  */
28
36
  search(query, options) {
29
- return this._client.get('/task/search', {
30
- query,
31
- ...options,
32
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
33
- });
37
+ return this._client.get('/task/search', { query, ...options });
34
38
  }
35
39
  }
36
40
  //# sourceMappingURL=task.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"task.mjs","sourceRoot":"","sources":["../src/resources/task.ts"],"names":[],"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AAC,CAAC;IACjE,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -16,8 +16,17 @@ import * as Errors from './core/error';
16
16
  import * as Uploads from './core/uploads';
17
17
  import * as API from './resources/index';
18
18
  import { APIPromise } from './core/api-promise';
19
- import { Repository } from './resources/repository';
20
- import { Task, TaskCreateParams, TaskListParams, TaskSearchParams } from './resources/task';
19
+ import { Me, MeRetrieveResponse } from './resources/me';
20
+ import { Repository, RepositoryListResponse } from './resources/repository';
21
+ import {
22
+ Task,
23
+ TaskCreateParams,
24
+ TaskCreateResponse,
25
+ TaskListParams,
26
+ TaskListResponse,
27
+ TaskSearchParams,
28
+ TaskSearchResponse,
29
+ } from './resources/task';
21
30
  import { type Fetch } from './internal/builtin-types';
22
31
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
23
32
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -33,14 +42,14 @@ import { isEmptyObj } from './internal/utils/values';
33
42
 
34
43
  export interface ClientOptions {
35
44
  /**
36
- * Defaults to process.env['TEMBO_SDK_API_KEY'].
45
+ * Defaults to process.env['TEMBO_API_KEY'].
37
46
  */
38
47
  apiKey?: string | undefined;
39
48
 
40
49
  /**
41
50
  * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
42
51
  *
43
- * Defaults to process.env['TEMBO_SDK_BASE_URL'].
52
+ * Defaults to process.env['TEMBO_BASE_URL'].
44
53
  */
45
54
  baseURL?: string | null | undefined;
46
55
 
@@ -94,7 +103,7 @@ export interface ClientOptions {
94
103
  /**
95
104
  * Set the log level.
96
105
  *
97
- * Defaults to process.env['TEMBO_SDK_LOG'] or 'warn' if it isn't set.
106
+ * Defaults to process.env['TEMBO_LOG'] or 'warn' if it isn't set.
98
107
  */
99
108
  logLevel?: LogLevel | undefined;
100
109
 
@@ -107,9 +116,9 @@ export interface ClientOptions {
107
116
  }
108
117
 
109
118
  /**
110
- * API Client for interfacing with the Tembo SDK API.
119
+ * API Client for interfacing with the Tembo API.
111
120
  */
112
- export class TemboSDK {
121
+ export class Tembo {
113
122
  apiKey: string;
114
123
 
115
124
  baseURL: string;
@@ -125,10 +134,10 @@ export class TemboSDK {
125
134
  private _options: ClientOptions;
126
135
 
127
136
  /**
128
- * API Client for interfacing with the Tembo SDK API.
137
+ * API Client for interfacing with the Tembo API.
129
138
  *
130
- * @param {string | undefined} [opts.apiKey=process.env['TEMBO_SDK_API_KEY'] ?? undefined]
131
- * @param {string} [opts.baseURL=process.env['TEMBO_SDK_BASE_URL'] ?? https://api.v2.dba.ai/] - Override the default base URL for the API.
139
+ * @param {string | undefined} [opts.apiKey=process.env['TEMBO_API_KEY'] ?? undefined]
140
+ * @param {string} [opts.baseURL=process.env['TEMBO_BASE_URL'] ?? https://internal.tembo.io/] - Override the default base URL for the API.
132
141
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
133
142
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
134
143
  * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -137,31 +146,31 @@ export class TemboSDK {
137
146
  * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
138
147
  */
139
148
  constructor({
140
- baseURL = readEnv('TEMBO_SDK_BASE_URL'),
141
- apiKey = readEnv('TEMBO_SDK_API_KEY'),
149
+ baseURL = readEnv('TEMBO_BASE_URL'),
150
+ apiKey = readEnv('TEMBO_API_KEY'),
142
151
  ...opts
143
152
  }: ClientOptions = {}) {
144
153
  if (apiKey === undefined) {
145
- throw new Errors.TemboSDKError(
146
- "The TEMBO_SDK_API_KEY environment variable is missing or empty; either provide it, or instantiate the TemboSDK client with an apiKey option, like new TemboSDK({ apiKey: 'My API Key' }).",
154
+ throw new Errors.TemboError(
155
+ "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' }).",
147
156
  );
148
157
  }
149
158
 
150
159
  const options: ClientOptions = {
151
160
  apiKey,
152
161
  ...opts,
153
- baseURL: baseURL || `https://api.v2.dba.ai/`,
162
+ baseURL: baseURL || `https://internal.tembo.io/`,
154
163
  };
155
164
 
156
165
  this.baseURL = options.baseURL!;
157
- this.timeout = options.timeout ?? TemboSDK.DEFAULT_TIMEOUT /* 1 minute */;
166
+ this.timeout = options.timeout ?? Tembo.DEFAULT_TIMEOUT /* 1 minute */;
158
167
  this.logger = options.logger ?? console;
159
168
  const defaultLogLevel = 'warn';
160
169
  // Set default logLevel early so that we can log a warning in parseLogLevel.
161
170
  this.logLevel = defaultLogLevel;
162
171
  this.logLevel =
163
172
  parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
164
- parseLogLevel(readEnv('TEMBO_SDK_LOG'), "process.env['TEMBO_SDK_LOG']", this) ??
173
+ parseLogLevel(readEnv('TEMBO_LOG'), "process.env['TEMBO_LOG']", this) ??
165
174
  defaultLogLevel;
166
175
  this.fetchOptions = options.fetchOptions;
167
176
  this.maxRetries = options.maxRetries ?? 2;
@@ -196,7 +205,7 @@ export class TemboSDK {
196
205
  * Check whether the base URL is set to its default.
197
206
  */
198
207
  #baseURLOverridden(): boolean {
199
- return this.baseURL !== 'https://api.v2.dba.ai/';
208
+ return this.baseURL !== 'https://internal.tembo.io/';
200
209
  }
201
210
 
202
211
  protected defaultQuery(): Record<string, string | undefined> | undefined {
@@ -224,7 +233,7 @@ export class TemboSDK {
224
233
  if (value === null) {
225
234
  return `${encodeURIComponent(key)}=`;
226
235
  }
227
- throw new Errors.TemboSDKError(
236
+ throw new Errors.TemboError(
228
237
  `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.`,
229
238
  );
230
239
  })
@@ -696,10 +705,10 @@ export class TemboSDK {
696
705
  }
697
706
  }
698
707
 
699
- static TemboSDK = this;
708
+ static Tembo = this;
700
709
  static DEFAULT_TIMEOUT = 60000; // 1 minute
701
710
 
702
- static TemboSDKError = Errors.TemboSDKError;
711
+ static TemboError = Errors.TemboError;
703
712
  static APIError = Errors.APIError;
704
713
  static APIConnectionError = Errors.APIConnectionError;
705
714
  static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
@@ -715,22 +724,29 @@ export class TemboSDK {
715
724
 
716
725
  static toFile = Uploads.toFile;
717
726
 
727
+ me: API.Me = new API.Me(this);
718
728
  task: API.Task = new API.Task(this);
719
729
  repository: API.Repository = new API.Repository(this);
720
730
  }
721
731
 
722
- TemboSDK.Task = Task;
723
- TemboSDK.Repository = Repository;
732
+ Tembo.Me = Me;
733
+ Tembo.Task = Task;
734
+ Tembo.Repository = Repository;
724
735
 
725
- export declare namespace TemboSDK {
736
+ export declare namespace Tembo {
726
737
  export type RequestOptions = Opts.RequestOptions;
727
738
 
739
+ export { Me as Me, type MeRetrieveResponse as MeRetrieveResponse };
740
+
728
741
  export {
729
742
  Task as Task,
743
+ type TaskCreateResponse as TaskCreateResponse,
744
+ type TaskListResponse as TaskListResponse,
745
+ type TaskSearchResponse as TaskSearchResponse,
730
746
  type TaskCreateParams as TaskCreateParams,
731
747
  type TaskListParams as TaskListParams,
732
748
  type TaskSearchParams as TaskSearchParams,
733
749
  };
734
750
 
735
- export { Repository as Repository };
751
+ export { Repository as Repository, type RepositoryListResponse as RepositoryListResponse };
736
752
  }
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { type TemboSDK } from '../client';
3
+ import { type Tembo } from '../client';
4
4
 
5
5
  import { type PromiseOrValue } from '../internal/types';
6
6
  import { APIResponseProps, defaultParseResponse } from '../internal/parse';
@@ -11,13 +11,13 @@ import { APIResponseProps, defaultParseResponse } from '../internal/parse';
11
11
  */
12
12
  export class APIPromise<T> extends Promise<T> {
13
13
  private parsedPromise: Promise<T> | undefined;
14
- #client: TemboSDK;
14
+ #client: Tembo;
15
15
 
16
16
  constructor(
17
- client: TemboSDK,
17
+ client: Tembo,
18
18
  private responsePromise: Promise<APIResponseProps>,
19
19
  private parseResponse: (
20
- client: TemboSDK,
20
+ client: Tembo,
21
21
  props: APIResponseProps,
22
22
  ) => PromiseOrValue<T> = defaultParseResponse,
23
23
  ) {
package/src/core/error.ts CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  import { castToError } from '../internal/errors';
4
4
 
5
- export class TemboSDKError extends Error {}
5
+ export class TemboError extends Error {}
6
6
 
7
7
  export class APIError<
8
8
  TStatus extends number | undefined = number | undefined,
9
9
  THeaders extends Headers | undefined = Headers | undefined,
10
10
  TError extends Object | undefined = Object | undefined,
11
- > extends TemboSDKError {
11
+ > extends TemboError {
12
12
  /** HTTP status for the response that caused the error */
13
13
  readonly status: TStatus;
14
14
  /** HTTP headers for the response that caused the error */
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import type { TemboSDK } from '../client';
3
+ import type { Tembo } from '../client';
4
4
 
5
5
  export abstract class APIResource {
6
- protected _client: TemboSDK;
6
+ protected _client: Tembo;
7
7
 
8
- constructor(client: TemboSDK) {
8
+ constructor(client: Tembo) {
9
9
  this._client = client;
10
10
  }
11
11
  }
package/src/index.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { TemboSDK as default } from './client';
3
+ export { Tembo as default } from './client';
4
4
 
5
5
  export { type Uploadable, toFile } from './core/uploads';
6
6
  export { APIPromise } from './core/api-promise';
7
- export { TemboSDK, type ClientOptions } from './client';
7
+ export { Tembo, type ClientOptions } from './client';
8
8
  export {
9
- TemboSDKError,
9
+ TemboError,
10
10
  APIError,
11
11
  APIConnectionError,
12
12
  APIConnectionTimeoutError,
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import type { FinalRequestOptions } from './request-options';
4
- import { type TemboSDK } from '../client';
4
+ import { type Tembo } from '../client';
5
5
  import { formatRequestDetails, loggerFor } from './utils/log';
6
6
 
7
7
  export type APIResponseProps = {
@@ -13,7 +13,7 @@ export type APIResponseProps = {
13
13
  startTime: number;
14
14
  };
15
15
 
16
- export async function defaultParseResponse<T>(client: TemboSDK, props: APIResponseProps): Promise<T> {
16
+ export async function defaultParseResponse<T>(client: Tembo, props: APIResponseProps): Promise<T> {
17
17
  const { response, requestLogID, retryOfRequestLogID, startTime } = props;
18
18
  const body = await (async () => {
19
19
  // fetch refuses to read the body when the status code is 204.
@@ -16,7 +16,7 @@ export function getDefaultFetch(): Fetch {
16
16
  }
17
17
 
18
18
  throw new Error(
19
- '`fetch` is not defined as a global; Either pass `fetch` to the client, `new TemboSDK({ fetch })` or polyfill the global, `globalThis.fetch = fetch`',
19
+ '`fetch` is not defined as a global; Either pass `fetch` to the client, `new Tembo({ fetch })` or polyfill the global, `globalThis.fetch = fetch`',
20
20
  );
21
21
  }
22
22
 
@@ -1,6 +1,6 @@
1
1
  import { type RequestOptions } from './request-options';
2
2
  import type { FilePropertyBag, Fetch } from './builtin-types';
3
- import type { TemboSDK } from '../client';
3
+ import type { Tembo } from '../client';
4
4
  import { ReadableStreamFrom } from './shims';
5
5
 
6
6
  export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | DataView;
@@ -74,7 +74,7 @@ export const isAsyncIterable = (value: any): value is AsyncIterable<any> =>
74
74
  */
75
75
  export const maybeMultipartFormRequestOptions = async (
76
76
  opts: RequestOptions,
77
- fetch: TemboSDK | Fetch,
77
+ fetch: Tembo | Fetch,
78
78
  ): Promise<RequestOptions> => {
79
79
  if (!hasUploadableValue(opts.body)) return opts;
80
80
 
@@ -85,7 +85,7 @@ type MultipartFormRequestOptions = Omit<RequestOptions, 'body'> & { body: unknow
85
85
 
86
86
  export const multipartFormRequestOptions = async (
87
87
  opts: MultipartFormRequestOptions,
88
- fetch: TemboSDK | Fetch,
88
+ fetch: Tembo | Fetch,
89
89
  ): Promise<RequestOptions> => {
90
90
  return { ...opts, body: await createForm(opts.body, fetch) };
91
91
  };
@@ -98,7 +98,7 @@ const supportsFormDataMap = /* @__PURE__ */ new WeakMap<Fetch, Promise<boolean>>
98
98
  * This function detects if the fetch function provided supports the global FormData object to avoid
99
99
  * confusing error messages later on.
100
100
  */
101
- function supportsFormData(fetchObject: TemboSDK | Fetch): Promise<boolean> {
101
+ function supportsFormData(fetchObject: Tembo | Fetch): Promise<boolean> {
102
102
  const fetch: Fetch = typeof fetchObject === 'function' ? fetchObject : (fetchObject as any).fetch;
103
103
  const cached = supportsFormDataMap.get(fetch);
104
104
  if (cached) return cached;
@@ -124,7 +124,7 @@ function supportsFormData(fetchObject: TemboSDK | Fetch): Promise<boolean> {
124
124
 
125
125
  export const createForm = async <T = Record<string, unknown>>(
126
126
  body: T | undefined,
127
- fetch: TemboSDK | Fetch,
127
+ fetch: Tembo | Fetch,
128
128
  ): Promise<FormData> => {
129
129
  if (!(await supportsFormData(fetch))) {
130
130
  throw new TypeError(
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { TemboSDKError } from '../../core/error';
3
+ import { TemboError } from '../../core/error';
4
4
  import { encodeUTF8 } from './bytes';
5
5
 
6
6
  export const toBase64 = (data: string | Uint8Array | null | undefined): string => {
@@ -18,7 +18,7 @@ export const toBase64 = (data: string | Uint8Array | null | undefined): string =
18
18
  return btoa(String.fromCharCode.apply(null, data as any));
19
19
  }
20
20
 
21
- throw new TemboSDKError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');
21
+ throw new TemboError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');
22
22
  };
23
23
 
24
24
  export const fromBase64 = (str: string): Uint8Array => {
@@ -36,5 +36,5 @@ export const fromBase64 = (str: string): Uint8Array => {
36
36
  return buf;
37
37
  }
38
38
 
39
- throw new TemboSDKError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');
39
+ throw new TemboError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');
40
40
  };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { hasOwn } from './values';
4
- import { type TemboSDK } from '../../client';
4
+ import { type Tembo } from '../../client';
5
5
  import { RequestOptions } from '../request-options';
6
6
 
7
7
  type LogFn = (message: string, ...rest: unknown[]) => void;
@@ -24,7 +24,7 @@ const levelNumbers = {
24
24
  export const parseLogLevel = (
25
25
  maybeLevel: string | undefined,
26
26
  sourceName: string,
27
- client: TemboSDK,
27
+ client: Tembo,
28
28
  ): LogLevel | undefined => {
29
29
  if (!maybeLevel) {
30
30
  return undefined;
@@ -60,7 +60,7 @@ const noopLogger = {
60
60
 
61
61
  let cachedLoggers = /* @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
62
62
 
63
- export function loggerFor(client: TemboSDK): Logger {
63
+ export function loggerFor(client: Tembo): Logger {
64
64
  const logger = client.logger;
65
65
  const logLevel = client.logLevel ?? 'off';
66
66
  if (!logger) {