@chrt-inc/typescript-sdk 0.0.179 → 0.0.183
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/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/dev/client/Client.d.ts +10 -0
- package/dist/cjs/api/resources/dev/client/Client.js +49 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/dev/client/Client.d.mts +10 -0
- package/dist/esm/api/resources/dev/client/Client.mjs +49 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +55 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -63,8 +63,8 @@ class ChrtClient {
|
|
|
63
63
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
64
64
|
"X-Fern-Language": "JavaScript",
|
|
65
65
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
66
|
-
"X-Fern-SDK-Version": "0.0.
|
|
67
|
-
"User-Agent": "@chrt-inc/typescript-sdk/0.0.
|
|
66
|
+
"X-Fern-SDK-Version": "0.0.183",
|
|
67
|
+
"User-Agent": "@chrt-inc/typescript-sdk/0.0.183",
|
|
68
68
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
69
69
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
70
70
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -58,6 +58,16 @@ export declare class Dev {
|
|
|
58
58
|
*/
|
|
59
59
|
getEmail(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
60
60
|
private __getEmail;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the current GitHub PR number and commit hash for the deployment.
|
|
63
|
+
*
|
|
64
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.dev.getGitInfo()
|
|
68
|
+
*/
|
|
69
|
+
getGitInfo(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, string>>;
|
|
70
|
+
private __getGitInfo;
|
|
61
71
|
/**
|
|
62
72
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
63
73
|
*
|
|
@@ -202,6 +202,55 @@ class Dev {
|
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Returns the current GitHub PR number and commit hash for the deployment.
|
|
207
|
+
*
|
|
208
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* await client.dev.getGitInfo()
|
|
212
|
+
*/
|
|
213
|
+
getGitInfo(requestOptions) {
|
|
214
|
+
return core.HttpResponsePromise.fromPromise(this.__getGitInfo(requestOptions));
|
|
215
|
+
}
|
|
216
|
+
__getGitInfo(requestOptions) {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
var _a, _b, _c, _d;
|
|
219
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
220
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "dev/git_info"),
|
|
221
|
+
method: "GET",
|
|
222
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
223
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
224
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
225
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
226
|
+
});
|
|
227
|
+
if (_response.ok) {
|
|
228
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
229
|
+
}
|
|
230
|
+
if (_response.error.reason === "status-code") {
|
|
231
|
+
throw new errors.ChrtError({
|
|
232
|
+
statusCode: _response.error.statusCode,
|
|
233
|
+
body: _response.error.body,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
switch (_response.error.reason) {
|
|
238
|
+
case "non-json":
|
|
239
|
+
throw new errors.ChrtError({
|
|
240
|
+
statusCode: _response.error.statusCode,
|
|
241
|
+
body: _response.error.rawBody,
|
|
242
|
+
rawResponse: _response.rawResponse,
|
|
243
|
+
});
|
|
244
|
+
case "timeout":
|
|
245
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/git_info.");
|
|
246
|
+
case "unknown":
|
|
247
|
+
throw new errors.ChrtError({
|
|
248
|
+
message: _response.error.errorMessage,
|
|
249
|
+
rawResponse: _response.rawResponse,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
205
254
|
/**
|
|
206
255
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
207
256
|
*
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.183";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -27,8 +27,8 @@ export class ChrtClient {
|
|
|
27
27
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
28
28
|
"X-Fern-Language": "JavaScript",
|
|
29
29
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
30
|
-
"X-Fern-SDK-Version": "0.0.
|
|
31
|
-
"User-Agent": "@chrt-inc/typescript-sdk/0.0.
|
|
30
|
+
"X-Fern-SDK-Version": "0.0.183",
|
|
31
|
+
"User-Agent": "@chrt-inc/typescript-sdk/0.0.183",
|
|
32
32
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
33
33
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
34
34
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -58,6 +58,16 @@ export declare class Dev {
|
|
|
58
58
|
*/
|
|
59
59
|
getEmail(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
60
60
|
private __getEmail;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the current GitHub PR number and commit hash for the deployment.
|
|
63
|
+
*
|
|
64
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.dev.getGitInfo()
|
|
68
|
+
*/
|
|
69
|
+
getGitInfo(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, string>>;
|
|
70
|
+
private __getGitInfo;
|
|
61
71
|
/**
|
|
62
72
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
63
73
|
*
|
|
@@ -166,6 +166,55 @@ export class Dev {
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Returns the current GitHub PR number and commit hash for the deployment.
|
|
171
|
+
*
|
|
172
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* await client.dev.getGitInfo()
|
|
176
|
+
*/
|
|
177
|
+
getGitInfo(requestOptions) {
|
|
178
|
+
return core.HttpResponsePromise.fromPromise(this.__getGitInfo(requestOptions));
|
|
179
|
+
}
|
|
180
|
+
__getGitInfo(requestOptions) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
var _a, _b, _c, _d;
|
|
183
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
184
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "dev/git_info"),
|
|
185
|
+
method: "GET",
|
|
186
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
187
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
188
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
189
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
190
|
+
});
|
|
191
|
+
if (_response.ok) {
|
|
192
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
193
|
+
}
|
|
194
|
+
if (_response.error.reason === "status-code") {
|
|
195
|
+
throw new errors.ChrtError({
|
|
196
|
+
statusCode: _response.error.statusCode,
|
|
197
|
+
body: _response.error.body,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
switch (_response.error.reason) {
|
|
202
|
+
case "non-json":
|
|
203
|
+
throw new errors.ChrtError({
|
|
204
|
+
statusCode: _response.error.statusCode,
|
|
205
|
+
body: _response.error.rawBody,
|
|
206
|
+
rawResponse: _response.rawResponse,
|
|
207
|
+
});
|
|
208
|
+
case "timeout":
|
|
209
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/git_info.");
|
|
210
|
+
case "unknown":
|
|
211
|
+
throw new errors.ChrtError({
|
|
212
|
+
message: _response.error.errorMessage,
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
169
218
|
/**
|
|
170
219
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
171
220
|
*
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.183";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.183";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -167,6 +167,61 @@ await client.dev.getEmail();
|
|
|
167
167
|
</dl>
|
|
168
168
|
</details>
|
|
169
169
|
|
|
170
|
+
<details><summary><code>client.dev.<a href="/src/api/resources/dev/client/Client.ts">getGitInfo</a>() -> Record<string, string></code></summary>
|
|
171
|
+
<dl>
|
|
172
|
+
<dd>
|
|
173
|
+
|
|
174
|
+
#### 📝 Description
|
|
175
|
+
|
|
176
|
+
<dl>
|
|
177
|
+
<dd>
|
|
178
|
+
|
|
179
|
+
<dl>
|
|
180
|
+
<dd>
|
|
181
|
+
|
|
182
|
+
Returns the current GitHub PR number and commit hash for the deployment.
|
|
183
|
+
|
|
184
|
+
</dd>
|
|
185
|
+
</dl>
|
|
186
|
+
</dd>
|
|
187
|
+
</dl>
|
|
188
|
+
|
|
189
|
+
#### 🔌 Usage
|
|
190
|
+
|
|
191
|
+
<dl>
|
|
192
|
+
<dd>
|
|
193
|
+
|
|
194
|
+
<dl>
|
|
195
|
+
<dd>
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
await client.dev.getGitInfo();
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
</dd>
|
|
202
|
+
</dl>
|
|
203
|
+
</dd>
|
|
204
|
+
</dl>
|
|
205
|
+
|
|
206
|
+
#### ⚙️ Parameters
|
|
207
|
+
|
|
208
|
+
<dl>
|
|
209
|
+
<dd>
|
|
210
|
+
|
|
211
|
+
<dl>
|
|
212
|
+
<dd>
|
|
213
|
+
|
|
214
|
+
**requestOptions:** `Dev.RequestOptions`
|
|
215
|
+
|
|
216
|
+
</dd>
|
|
217
|
+
</dl>
|
|
218
|
+
</dd>
|
|
219
|
+
</dl>
|
|
220
|
+
|
|
221
|
+
</dd>
|
|
222
|
+
</dl>
|
|
223
|
+
</details>
|
|
224
|
+
|
|
170
225
|
<details><summary><code>client.dev.<a href="/src/api/resources/dev/client/Client.ts">getTemplate</a>() -> string</code></summary>
|
|
171
226
|
<dl>
|
|
172
227
|
<dd>
|