@katerai/sdk 0.3.0 → 0.4.0
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 +8 -0
- package/README.md +2 -6
- package/client.d.mts +6 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -3
- package/client.d.ts.map +1 -1
- package/client.js +7 -29
- package/client.js.map +1 -1
- package/client.mjs +7 -29
- package/client.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +0 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +0 -1
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/healthz.d.mts +16 -0
- package/resources/healthz.d.mts.map +1 -0
- package/resources/healthz.d.ts +16 -0
- package/resources/healthz.d.ts.map +1 -0
- package/resources/healthz.js +15 -0
- package/resources/healthz.js.map +1 -0
- package/resources/healthz.mjs +11 -0
- package/resources/healthz.mjs.map +1 -0
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/readyz.d.mts +16 -0
- package/resources/readyz.d.mts.map +1 -0
- package/resources/readyz.d.ts +16 -0
- package/resources/readyz.d.ts.map +1 -0
- package/resources/readyz.js +15 -0
- package/resources/readyz.js.map +1 -0
- package/resources/readyz.mjs +11 -0
- package/resources/readyz.mjs.map +1 -0
- package/resources/v1/connections/connections.d.mts +258 -65
- package/resources/v1/connections/connections.d.mts.map +1 -1
- package/resources/v1/connections/connections.d.ts +258 -65
- package/resources/v1/connections/connections.d.ts.map +1 -1
- package/resources/v1/connections/connections.js +33 -0
- package/resources/v1/connections/connections.js.map +1 -1
- package/resources/v1/connections/connections.mjs +34 -1
- package/resources/v1/connections/connections.mjs.map +1 -1
- package/resources/v1/connections/databases.d.mts +118 -1
- package/resources/v1/connections/databases.d.mts.map +1 -1
- package/resources/v1/connections/databases.d.ts +118 -1
- package/resources/v1/connections/databases.d.ts.map +1 -1
- package/resources/v1/connections/databases.js +35 -0
- package/resources/v1/connections/databases.js.map +1 -1
- package/resources/v1/connections/databases.mjs +35 -0
- package/resources/v1/connections/databases.mjs.map +1 -1
- package/resources/v1/connections/index.d.mts +2 -2
- package/resources/v1/connections/index.d.mts.map +1 -1
- package/resources/v1/connections/index.d.ts +2 -2
- package/resources/v1/connections/index.d.ts.map +1 -1
- package/resources/v1/connections/index.js.map +1 -1
- package/resources/v1/connections/index.mjs +1 -1
- package/resources/v1/connections/index.mjs.map +1 -1
- package/resources/v1/github/github.d.mts +61 -1
- package/resources/v1/github/github.d.mts.map +1 -1
- package/resources/v1/github/github.d.ts +61 -1
- package/resources/v1/github/github.d.ts.map +1 -1
- package/resources/v1/github/github.js +22 -0
- package/resources/v1/github/github.js.map +1 -1
- package/resources/v1/github/github.mjs +22 -0
- package/resources/v1/github/github.mjs.map +1 -1
- package/resources/v1/github/index.d.mts +2 -1
- package/resources/v1/github/index.d.mts.map +1 -1
- package/resources/v1/github/index.d.ts +2 -1
- package/resources/v1/github/index.d.ts.map +1 -1
- package/resources/v1/github/index.js +3 -1
- package/resources/v1/github/index.js.map +1 -1
- package/resources/v1/github/index.mjs +2 -1
- package/resources/v1/github/index.mjs.map +1 -1
- package/resources/v1/github/webhooks.d.mts +28 -0
- package/resources/v1/github/webhooks.d.mts.map +1 -0
- package/resources/v1/github/webhooks.d.ts +28 -0
- package/resources/v1/github/webhooks.d.ts.map +1 -0
- package/resources/v1/github/webhooks.js +27 -0
- package/resources/v1/github/webhooks.js.map +1 -0
- package/resources/v1/github/webhooks.mjs +23 -0
- package/resources/v1/github/webhooks.mjs.map +1 -0
- package/resources/v1/index.d.mts +2 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/v1.d.mts +4 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +4 -4
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +11 -36
- package/src/internal/utils/log.ts +0 -1
- package/src/resources/healthz.ts +20 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/readyz.ts +20 -0
- package/src/resources/v1/connections/connections.ts +330 -68
- package/src/resources/v1/connections/databases.ts +165 -1
- package/src/resources/v1/connections/index.ts +9 -1
- package/src/resources/v1/github/github.ts +97 -1
- package/src/resources/v1/github/index.ts +10 -1
- package/src/resources/v1/github/webhooks.ts +60 -0
- package/src/resources/v1/index.ts +10 -1
- package/src/resources/v1/v1.ts +20 -2
- 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/src/client.ts
CHANGED
|
@@ -16,6 +16,8 @@ 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 { Healthz, HealthzCheckResponse } from './resources/healthz';
|
|
20
|
+
import { Readyz, ReadyzCheckResponse } from './resources/readyz';
|
|
19
21
|
import { V1 } from './resources/v1/v1';
|
|
20
22
|
import { type Fetch } from './internal/builtin-types';
|
|
21
23
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
@@ -208,41 +210,7 @@ export class Kater {
|
|
|
208
210
|
}
|
|
209
211
|
|
|
210
212
|
protected validateHeaders({ values, nulls }: NullableHeaders) {
|
|
211
|
-
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
if (nulls.has('authorization')) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (this.apiKey && values.get('x-api-key')) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (nulls.has('x-api-key')) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
throw new Error(
|
|
226
|
-
'Could not resolve authentication method. Expected either bearerToken or apiKey to be set. Or for one of the "Authorization" or "X-API-Key" headers to be explicitly omitted',
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
231
|
-
return buildHeaders([await this.propelAuth(opts), await this.apiKeyAuth(opts)]);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
protected async propelAuth(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
235
|
-
if (this.bearerToken == null) {
|
|
236
|
-
return undefined;
|
|
237
|
-
}
|
|
238
|
-
return buildHeaders([{ Authorization: `Bearer ${this.bearerToken}` }]);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
protected async apiKeyAuth(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
242
|
-
if (this.apiKey == null) {
|
|
243
|
-
return undefined;
|
|
244
|
-
}
|
|
245
|
-
return buildHeaders([{ 'X-API-Key': this.apiKey }]);
|
|
213
|
+
return;
|
|
246
214
|
}
|
|
247
215
|
|
|
248
216
|
/**
|
|
@@ -682,7 +650,6 @@ export class Kater {
|
|
|
682
650
|
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
|
|
683
651
|
...getPlatformHeaders(),
|
|
684
652
|
},
|
|
685
|
-
await this.authHeaders(options),
|
|
686
653
|
this._options.defaultHeaders,
|
|
687
654
|
bodyHeaders,
|
|
688
655
|
options.headers,
|
|
@@ -750,12 +717,20 @@ export class Kater {
|
|
|
750
717
|
static toFile = Uploads.toFile;
|
|
751
718
|
|
|
752
719
|
v1: API.V1 = new API.V1(this);
|
|
720
|
+
healthz: API.Healthz = new API.Healthz(this);
|
|
721
|
+
readyz: API.Readyz = new API.Readyz(this);
|
|
753
722
|
}
|
|
754
723
|
|
|
755
724
|
Kater.V1 = V1;
|
|
725
|
+
Kater.Healthz = Healthz;
|
|
726
|
+
Kater.Readyz = Readyz;
|
|
756
727
|
|
|
757
728
|
export declare namespace Kater {
|
|
758
729
|
export type RequestOptions = Opts.RequestOptions;
|
|
759
730
|
|
|
760
731
|
export { V1 as V1 };
|
|
732
|
+
|
|
733
|
+
export { Healthz as Healthz, type HealthzCheckResponse as HealthzCheckResponse };
|
|
734
|
+
|
|
735
|
+
export { Readyz as Readyz, type ReadyzCheckResponse as ReadyzCheckResponse };
|
|
761
736
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Healthz extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns 200 if the service is alive. Used by Kubernetes liveness probe.
|
|
10
|
+
*/
|
|
11
|
+
check(options?: RequestOptions): APIPromise<HealthzCheckResponse> {
|
|
12
|
+
return this._client.get('/healthz', options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type HealthzCheckResponse = { [key: string]: string };
|
|
17
|
+
|
|
18
|
+
export declare namespace Healthz {
|
|
19
|
+
export { type HealthzCheckResponse as HealthzCheckResponse };
|
|
20
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Readyz extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns 200 if the service is ready to accept traffic.
|
|
10
|
+
*/
|
|
11
|
+
check(options?: RequestOptions): APIPromise<ReadyzCheckResponse> {
|
|
12
|
+
return this._client.get('/readyz', options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ReadyzCheckResponse = { [key: string]: unknown };
|
|
17
|
+
|
|
18
|
+
export declare namespace Readyz {
|
|
19
|
+
export { type ReadyzCheckResponse as ReadyzCheckResponse };
|
|
20
|
+
}
|