@mixedbread/sdk 0.4.0 → 0.6.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 +69 -0
- package/README.md +2 -2
- package/api-promise.js +2 -15
- package/api-promise.js.map +1 -1
- package/bin/cli +52 -0
- package/bin/migration-config.json +176 -0
- package/client.d.mts +20 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -8
- package/client.d.ts.map +1 -1
- package/client.js +45 -50
- package/client.js.map +1 -1
- package/client.mjs +37 -19
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +0 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +0 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js +4 -14
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +1 -11
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +0 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +0 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts +0 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +0 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +3 -13
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +1 -11
- package/core/pagination.mjs.map +1 -1
- package/error.js +2 -15
- package/error.js.map +1 -1
- package/internal/builtin-types.d.mts +0 -2
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts +0 -2
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js +2 -2
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.d.mts +1 -2
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts +1 -2
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +3 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +3 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts +0 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +0 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +1 -2
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +0 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +0 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.js +5 -6
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/to-file.d.mts +0 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts +0 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.js +4 -4
- package/internal/to-file.js.map +1 -1
- package/internal/to-file.mjs +3 -2
- package/internal/to-file.mjs.map +1 -1
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +0 -1
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +0 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts +1 -3
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +1 -3
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +16 -6
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +12 -3
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js +12 -7
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +12 -7
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts +0 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +0 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -2
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js +2 -2
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/sleep.d.mts.map +1 -1
- package/internal/utils/sleep.d.ts.map +1 -1
- package/internal/utils/uuid.d.mts +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +1 -2
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +1 -2
- package/internal/utils/uuid.mjs.map +1 -1
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.js +7 -20
- package/internal/utils.js.map +1 -1
- package/lib/polling.js +1 -2
- package/lib/polling.js.map +1 -1
- package/lib/polling.mjs.map +1 -1
- package/package.json +5 -6
- package/pagination.js +2 -15
- package/pagination.js.map +1 -1
- package/resource.js +2 -15
- package/resource.js.map +1 -1
- package/resources/api-keys.d.mts +171 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +171 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +76 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +72 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/chat.d.mts +27 -0
- package/resources/chat.d.mts.map +1 -0
- package/resources/chat.d.ts +27 -0
- package/resources/chat.d.ts.map +1 -0
- package/resources/chat.js +28 -0
- package/resources/chat.js.map +1 -0
- package/resources/chat.mjs +24 -0
- package/resources/chat.mjs.map +1 -0
- package/resources/data-sources/connectors.d.mts +193 -0
- package/resources/data-sources/connectors.d.mts.map +1 -0
- package/resources/data-sources/connectors.d.ts +193 -0
- package/resources/data-sources/connectors.d.ts.map +1 -0
- package/resources/data-sources/connectors.js +73 -0
- package/resources/data-sources/connectors.js.map +1 -0
- package/resources/data-sources/connectors.mjs +69 -0
- package/resources/data-sources/connectors.mjs.map +1 -0
- package/resources/data-sources/data-sources.d.mts +183 -0
- package/resources/data-sources/data-sources.d.mts.map +1 -0
- package/resources/data-sources/data-sources.d.ts +183 -0
- package/resources/data-sources/data-sources.d.ts.map +1 -0
- package/resources/data-sources/data-sources.js +66 -0
- package/resources/data-sources/data-sources.js.map +1 -0
- package/resources/data-sources/data-sources.mjs +61 -0
- package/resources/data-sources/data-sources.mjs.map +1 -0
- package/resources/data-sources/index.d.mts +3 -0
- package/resources/data-sources/index.d.mts.map +1 -0
- package/resources/data-sources/index.d.ts +3 -0
- package/resources/data-sources/index.d.ts.map +1 -0
- package/resources/data-sources/index.js +9 -0
- package/resources/data-sources/index.js.map +1 -0
- package/resources/data-sources/index.mjs +4 -0
- package/resources/data-sources/index.mjs.map +1 -0
- package/resources/data-sources.d.mts +2 -0
- package/resources/data-sources.d.mts.map +1 -0
- package/resources/data-sources.d.ts +2 -0
- package/resources/data-sources.d.ts.map +1 -0
- package/resources/data-sources.js +6 -0
- package/resources/data-sources.js.map +1 -0
- package/resources/data-sources.mjs +3 -0
- package/resources/data-sources.mjs.map +1 -0
- package/resources/embeddings.d.mts +7 -2
- package/resources/embeddings.d.mts.map +1 -1
- package/resources/embeddings.d.ts +7 -2
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/extractions/content.d.mts +46 -2
- package/resources/extractions/content.d.mts.map +1 -1
- package/resources/extractions/content.d.ts +46 -2
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/extractions/extractions.d.mts +2 -2
- package/resources/extractions/extractions.d.mts.map +1 -1
- package/resources/extractions/extractions.d.ts +2 -2
- package/resources/extractions/extractions.d.ts.map +1 -1
- package/resources/extractions/extractions.js +4 -26
- package/resources/extractions/extractions.js.map +1 -1
- package/resources/extractions/extractions.mjs.map +1 -1
- package/resources/extractions/index.d.mts +1 -1
- package/resources/extractions/index.d.mts.map +1 -1
- package/resources/extractions/index.d.ts +1 -1
- package/resources/extractions/index.d.ts.map +1 -1
- package/resources/extractions/index.js.map +1 -1
- package/resources/extractions/index.mjs +1 -1
- package/resources/extractions/index.mjs.map +1 -1
- package/resources/extractions/jobs.d.mts +2 -1
- package/resources/extractions/jobs.d.mts.map +1 -1
- package/resources/extractions/jobs.d.ts +2 -1
- package/resources/extractions/jobs.d.ts.map +1 -1
- package/resources/extractions/jobs.js.map +1 -1
- package/resources/extractions/jobs.mjs.map +1 -1
- package/resources/extractions.js +2 -15
- package/resources/extractions.js.map +1 -1
- package/resources/files.d.mts +18 -2
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +18 -2
- package/resources/files.d.ts.map +1 -1
- package/resources/index.d.mts +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -16
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/parsing/index.d.mts +1 -1
- package/resources/parsing/index.d.mts.map +1 -1
- package/resources/parsing/index.d.ts +1 -1
- package/resources/parsing/index.d.ts.map +1 -1
- package/resources/parsing/index.js.map +1 -1
- package/resources/parsing/index.mjs.map +1 -1
- package/resources/parsing/jobs.d.mts +29 -11
- package/resources/parsing/jobs.d.mts.map +1 -1
- package/resources/parsing/jobs.d.ts +29 -11
- package/resources/parsing/jobs.d.ts.map +1 -1
- package/resources/parsing/jobs.js +2 -24
- package/resources/parsing/jobs.js.map +1 -1
- package/resources/parsing/jobs.mjs.map +1 -1
- package/resources/parsing/parsing.d.mts +2 -2
- package/resources/parsing/parsing.d.mts.map +1 -1
- package/resources/parsing/parsing.d.ts +2 -2
- package/resources/parsing/parsing.d.ts.map +1 -1
- package/resources/parsing/parsing.js +2 -24
- package/resources/parsing/parsing.js.map +1 -1
- package/resources/parsing/parsing.mjs.map +1 -1
- package/resources/parsing.js +2 -15
- package/resources/parsing.js.map +1 -1
- package/resources/top-level.d.mts +9 -4
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +9 -4
- package/resources/top-level.d.ts.map +1 -1
- package/resources/vector-stores/files.d.mts +29 -2
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +29 -2
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +2 -24
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/index.d.mts +1 -1
- package/resources/vector-stores/index.d.mts.map +1 -1
- package/resources/vector-stores/index.d.ts +1 -1
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +223 -81
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +223 -81
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +2 -24
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/vector-stores.js +2 -15
- package/resources/vector-stores.js.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/client.ts +94 -16
- package/src/internal/headers.ts +4 -3
- package/src/internal/to-file.ts +4 -2
- package/src/internal/uploads.ts +16 -4
- package/src/internal/utils/base64.ts +13 -10
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/uuid.ts +1 -3
- package/src/resources/api-keys.ts +225 -0
- package/src/resources/chat.ts +33 -0
- package/src/resources/data-sources/connectors.ts +280 -0
- package/src/resources/data-sources/data-sources.ts +271 -0
- package/src/resources/data-sources/index.ts +24 -0
- package/src/resources/data-sources.ts +3 -0
- package/src/resources/embeddings.ts +25 -10
- package/src/resources/extractions/content.ts +57 -2
- package/src/resources/extractions/extractions.ts +3 -1
- package/src/resources/extractions/index.ts +7 -1
- package/src/resources/extractions/jobs.ts +2 -1
- package/src/resources/files.ts +21 -0
- package/src/resources/index.ts +27 -4
- package/src/resources/parsing/index.ts +4 -0
- package/src/resources/parsing/jobs.ts +48 -45
- package/src/resources/parsing/parsing.ts +8 -0
- package/src/resources/top-level.ts +10 -40
- package/src/resources/vector-stores/files.ts +39 -2
- package/src/resources/vector-stores/index.ts +4 -3
- package/src/resources/vector-stores/vector-stores.ts +269 -91
- package/src/version.ts +1 -1
- package/uploads.js +2 -15
- package/uploads.js.map +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/internal/shims/crypto.d.mts +0 -13
- package/internal/shims/crypto.d.mts.map +0 -1
- package/internal/shims/crypto.d.ts +0 -13
- package/internal/shims/crypto.d.ts.map +0 -1
- package/internal/shims/crypto.js +0 -13
- package/internal/shims/crypto.js.map +0 -1
- package/internal/shims/crypto.mjs +0 -9
- package/internal/shims/crypto.mjs.map +0 -1
- package/internal/shims/file.d.mts +0 -23
- package/internal/shims/file.d.mts.map +0 -1
- package/internal/shims/file.d.ts +0 -23
- package/internal/shims/file.d.ts.map +0 -1
- package/internal/shims/file.js +0 -16
- package/internal/shims/file.js.map +0 -1
- package/internal/shims/file.mjs +0 -12
- package/internal/shims/file.mjs.map +0 -1
- package/internal/shims/getBuiltinModule.d.mts +0 -11
- package/internal/shims/getBuiltinModule.d.mts.map +0 -1
- package/internal/shims/getBuiltinModule.d.ts +0 -11
- package/internal/shims/getBuiltinModule.d.ts.map +0 -1
- package/internal/shims/getBuiltinModule.js +0 -68
- package/internal/shims/getBuiltinModule.js.map +0 -1
- package/internal/shims/getBuiltinModule.mjs +0 -64
- package/internal/shims/getBuiltinModule.mjs.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.js +0 -5
- package/internal/shims/nullGetBuiltinModule.js.map +0 -1
- package/internal/shims/nullGetBuiltinModule.mjs +0 -2
- package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
- package/src/internal/shims/crypto.ts +0 -18
- package/src/internal/shims/file.ts +0 -32
- package/src/internal/shims/getBuiltinModule.ts +0 -64
- package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
@@ -0,0 +1,171 @@
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
3
|
+
import { LimitOffset, type LimitOffsetParams, PagePromise } from "../core/pagination.mjs";
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
5
|
+
export declare class APIKeys extends APIResource {
|
6
|
+
/**
|
7
|
+
* Create a new API key.
|
8
|
+
*
|
9
|
+
* Args: params: The parameters for creating the API key.
|
10
|
+
*
|
11
|
+
* Returns: ApiKeyCreated: The response containing the details of the created API
|
12
|
+
* key.
|
13
|
+
*/
|
14
|
+
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKeyCreated>;
|
15
|
+
/**
|
16
|
+
* Retrieve details of a specific API key by its ID.
|
17
|
+
*
|
18
|
+
* Args: api_key_id: The ID of the API key to retrieve.
|
19
|
+
*
|
20
|
+
* Returns: ApiKey: The response containing the API key details.
|
21
|
+
*/
|
22
|
+
retrieve(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey>;
|
23
|
+
/**
|
24
|
+
* List all API keys for the authenticated user.
|
25
|
+
*
|
26
|
+
* Args: pagination: The pagination options
|
27
|
+
*
|
28
|
+
* Returns: A list of API keys belonging to the user.
|
29
|
+
*/
|
30
|
+
list(query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysLimitOffset, APIKey>;
|
31
|
+
/**
|
32
|
+
* Delete a specific API key by its ID.
|
33
|
+
*
|
34
|
+
* Args: api_key_id: The ID of the API key to delete.
|
35
|
+
*
|
36
|
+
* Returns: ApiKeyDeleted: The response containing the details of the deleted API
|
37
|
+
* key.
|
38
|
+
*/
|
39
|
+
delete(apiKeyID: string, options?: RequestOptions): APIPromise<APIKeyDeleteResponse>;
|
40
|
+
/**
|
41
|
+
* Reroll the secret for a specific API key by its ID.
|
42
|
+
*
|
43
|
+
* This generates a new secret key, invalidating the old one.
|
44
|
+
*
|
45
|
+
* Args: api_key_id: The ID of the API key to reroll.
|
46
|
+
*
|
47
|
+
* Returns: ApiKeyCreated: The response containing the API key details with the new
|
48
|
+
* secret key.
|
49
|
+
*/
|
50
|
+
reroll(apiKeyID: string, options?: RequestOptions): APIPromise<APIKeyCreated>;
|
51
|
+
/**
|
52
|
+
* Revoke a specific API key by its ID.
|
53
|
+
*
|
54
|
+
* Args: api_key_id: The ID of the API key to revoke.
|
55
|
+
*
|
56
|
+
* Returns: ApiKey: The response containing the details of the revoked API key.
|
57
|
+
*/
|
58
|
+
revoke(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey>;
|
59
|
+
}
|
60
|
+
export type APIKeysLimitOffset = LimitOffset<APIKey>;
|
61
|
+
/**
|
62
|
+
* Response model for an API key.
|
63
|
+
*/
|
64
|
+
export interface APIKey {
|
65
|
+
/**
|
66
|
+
* The ID of the API key
|
67
|
+
*/
|
68
|
+
id: string;
|
69
|
+
/**
|
70
|
+
* The name of the API key
|
71
|
+
*/
|
72
|
+
name: string;
|
73
|
+
/**
|
74
|
+
* The redacted value of the API key
|
75
|
+
*/
|
76
|
+
redacted_value: string;
|
77
|
+
/**
|
78
|
+
* The expiration datetime of the API key
|
79
|
+
*/
|
80
|
+
expires_at?: string | null;
|
81
|
+
/**
|
82
|
+
* The creation datetime of the API key
|
83
|
+
*/
|
84
|
+
created_at: string;
|
85
|
+
/**
|
86
|
+
* The last update datetime of the API key
|
87
|
+
*/
|
88
|
+
updated_at: string;
|
89
|
+
/**
|
90
|
+
* The last active datetime of the API key
|
91
|
+
*/
|
92
|
+
last_active_at?: string | null;
|
93
|
+
/**
|
94
|
+
* The type of the object
|
95
|
+
*/
|
96
|
+
object?: 'api_key';
|
97
|
+
}
|
98
|
+
/**
|
99
|
+
* Response model for creating an API key.
|
100
|
+
*/
|
101
|
+
export interface APIKeyCreated {
|
102
|
+
/**
|
103
|
+
* The ID of the API key
|
104
|
+
*/
|
105
|
+
id: string;
|
106
|
+
/**
|
107
|
+
* The name of the API key
|
108
|
+
*/
|
109
|
+
name: string;
|
110
|
+
/**
|
111
|
+
* The redacted value of the API key
|
112
|
+
*/
|
113
|
+
redacted_value: string;
|
114
|
+
/**
|
115
|
+
* The expiration datetime of the API key
|
116
|
+
*/
|
117
|
+
expires_at?: string | null;
|
118
|
+
/**
|
119
|
+
* The creation datetime of the API key
|
120
|
+
*/
|
121
|
+
created_at: string;
|
122
|
+
/**
|
123
|
+
* The last update datetime of the API key
|
124
|
+
*/
|
125
|
+
updated_at: string;
|
126
|
+
/**
|
127
|
+
* The last active datetime of the API key
|
128
|
+
*/
|
129
|
+
last_active_at?: string | null;
|
130
|
+
/**
|
131
|
+
* The type of the object
|
132
|
+
*/
|
133
|
+
object?: 'api_key';
|
134
|
+
/**
|
135
|
+
* The value of the API key
|
136
|
+
*/
|
137
|
+
value: string;
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* Response model for deleting an API key.
|
141
|
+
*/
|
142
|
+
export interface APIKeyDeleteResponse {
|
143
|
+
/**
|
144
|
+
* The ID of the deleted API key
|
145
|
+
*/
|
146
|
+
id: string;
|
147
|
+
/**
|
148
|
+
* Whether the API key was deleted
|
149
|
+
*/
|
150
|
+
deleted: boolean;
|
151
|
+
/**
|
152
|
+
* The type of the object deleted
|
153
|
+
*/
|
154
|
+
object?: 'api_key';
|
155
|
+
}
|
156
|
+
export interface APIKeyCreateParams {
|
157
|
+
/**
|
158
|
+
* A name/description for the API key
|
159
|
+
*/
|
160
|
+
name?: string;
|
161
|
+
/**
|
162
|
+
* Optional expiration datetime
|
163
|
+
*/
|
164
|
+
expires_at?: string | null;
|
165
|
+
}
|
166
|
+
export interface APIKeyListParams extends LimitOffsetParams {
|
167
|
+
}
|
168
|
+
export declare namespace APIKeys {
|
169
|
+
export { type APIKey as APIKey, type APIKeyCreated as APIKeyCreated, type APIKeyDeleteResponse as APIKeyDeleteResponse, type APIKeysLimitOffset as APIKeysLimitOffset, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyListParams as APIKeyListParams, };
|
170
|
+
}
|
171
|
+
//# sourceMappingURL=api-keys.d.mts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api-keys.d.mts","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,WAAW,EAAE;OACpD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIrF;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,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,CAAC;IAE3B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;CAAG;AAE9D,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
@@ -0,0 +1,171 @@
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
3
|
+
import { LimitOffset, type LimitOffsetParams, PagePromise } from "../core/pagination.js";
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
5
|
+
export declare class APIKeys extends APIResource {
|
6
|
+
/**
|
7
|
+
* Create a new API key.
|
8
|
+
*
|
9
|
+
* Args: params: The parameters for creating the API key.
|
10
|
+
*
|
11
|
+
* Returns: ApiKeyCreated: The response containing the details of the created API
|
12
|
+
* key.
|
13
|
+
*/
|
14
|
+
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKeyCreated>;
|
15
|
+
/**
|
16
|
+
* Retrieve details of a specific API key by its ID.
|
17
|
+
*
|
18
|
+
* Args: api_key_id: The ID of the API key to retrieve.
|
19
|
+
*
|
20
|
+
* Returns: ApiKey: The response containing the API key details.
|
21
|
+
*/
|
22
|
+
retrieve(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey>;
|
23
|
+
/**
|
24
|
+
* List all API keys for the authenticated user.
|
25
|
+
*
|
26
|
+
* Args: pagination: The pagination options
|
27
|
+
*
|
28
|
+
* Returns: A list of API keys belonging to the user.
|
29
|
+
*/
|
30
|
+
list(query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysLimitOffset, APIKey>;
|
31
|
+
/**
|
32
|
+
* Delete a specific API key by its ID.
|
33
|
+
*
|
34
|
+
* Args: api_key_id: The ID of the API key to delete.
|
35
|
+
*
|
36
|
+
* Returns: ApiKeyDeleted: The response containing the details of the deleted API
|
37
|
+
* key.
|
38
|
+
*/
|
39
|
+
delete(apiKeyID: string, options?: RequestOptions): APIPromise<APIKeyDeleteResponse>;
|
40
|
+
/**
|
41
|
+
* Reroll the secret for a specific API key by its ID.
|
42
|
+
*
|
43
|
+
* This generates a new secret key, invalidating the old one.
|
44
|
+
*
|
45
|
+
* Args: api_key_id: The ID of the API key to reroll.
|
46
|
+
*
|
47
|
+
* Returns: ApiKeyCreated: The response containing the API key details with the new
|
48
|
+
* secret key.
|
49
|
+
*/
|
50
|
+
reroll(apiKeyID: string, options?: RequestOptions): APIPromise<APIKeyCreated>;
|
51
|
+
/**
|
52
|
+
* Revoke a specific API key by its ID.
|
53
|
+
*
|
54
|
+
* Args: api_key_id: The ID of the API key to revoke.
|
55
|
+
*
|
56
|
+
* Returns: ApiKey: The response containing the details of the revoked API key.
|
57
|
+
*/
|
58
|
+
revoke(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey>;
|
59
|
+
}
|
60
|
+
export type APIKeysLimitOffset = LimitOffset<APIKey>;
|
61
|
+
/**
|
62
|
+
* Response model for an API key.
|
63
|
+
*/
|
64
|
+
export interface APIKey {
|
65
|
+
/**
|
66
|
+
* The ID of the API key
|
67
|
+
*/
|
68
|
+
id: string;
|
69
|
+
/**
|
70
|
+
* The name of the API key
|
71
|
+
*/
|
72
|
+
name: string;
|
73
|
+
/**
|
74
|
+
* The redacted value of the API key
|
75
|
+
*/
|
76
|
+
redacted_value: string;
|
77
|
+
/**
|
78
|
+
* The expiration datetime of the API key
|
79
|
+
*/
|
80
|
+
expires_at?: string | null;
|
81
|
+
/**
|
82
|
+
* The creation datetime of the API key
|
83
|
+
*/
|
84
|
+
created_at: string;
|
85
|
+
/**
|
86
|
+
* The last update datetime of the API key
|
87
|
+
*/
|
88
|
+
updated_at: string;
|
89
|
+
/**
|
90
|
+
* The last active datetime of the API key
|
91
|
+
*/
|
92
|
+
last_active_at?: string | null;
|
93
|
+
/**
|
94
|
+
* The type of the object
|
95
|
+
*/
|
96
|
+
object?: 'api_key';
|
97
|
+
}
|
98
|
+
/**
|
99
|
+
* Response model for creating an API key.
|
100
|
+
*/
|
101
|
+
export interface APIKeyCreated {
|
102
|
+
/**
|
103
|
+
* The ID of the API key
|
104
|
+
*/
|
105
|
+
id: string;
|
106
|
+
/**
|
107
|
+
* The name of the API key
|
108
|
+
*/
|
109
|
+
name: string;
|
110
|
+
/**
|
111
|
+
* The redacted value of the API key
|
112
|
+
*/
|
113
|
+
redacted_value: string;
|
114
|
+
/**
|
115
|
+
* The expiration datetime of the API key
|
116
|
+
*/
|
117
|
+
expires_at?: string | null;
|
118
|
+
/**
|
119
|
+
* The creation datetime of the API key
|
120
|
+
*/
|
121
|
+
created_at: string;
|
122
|
+
/**
|
123
|
+
* The last update datetime of the API key
|
124
|
+
*/
|
125
|
+
updated_at: string;
|
126
|
+
/**
|
127
|
+
* The last active datetime of the API key
|
128
|
+
*/
|
129
|
+
last_active_at?: string | null;
|
130
|
+
/**
|
131
|
+
* The type of the object
|
132
|
+
*/
|
133
|
+
object?: 'api_key';
|
134
|
+
/**
|
135
|
+
* The value of the API key
|
136
|
+
*/
|
137
|
+
value: string;
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* Response model for deleting an API key.
|
141
|
+
*/
|
142
|
+
export interface APIKeyDeleteResponse {
|
143
|
+
/**
|
144
|
+
* The ID of the deleted API key
|
145
|
+
*/
|
146
|
+
id: string;
|
147
|
+
/**
|
148
|
+
* Whether the API key was deleted
|
149
|
+
*/
|
150
|
+
deleted: boolean;
|
151
|
+
/**
|
152
|
+
* The type of the object deleted
|
153
|
+
*/
|
154
|
+
object?: 'api_key';
|
155
|
+
}
|
156
|
+
export interface APIKeyCreateParams {
|
157
|
+
/**
|
158
|
+
* A name/description for the API key
|
159
|
+
*/
|
160
|
+
name?: string;
|
161
|
+
/**
|
162
|
+
* Optional expiration datetime
|
163
|
+
*/
|
164
|
+
expires_at?: string | null;
|
165
|
+
}
|
166
|
+
export interface APIKeyListParams extends LimitOffsetParams {
|
167
|
+
}
|
168
|
+
export declare namespace APIKeys {
|
169
|
+
export { type APIKey as APIKey, type APIKeyCreated as APIKeyCreated, type APIKeyDeleteResponse as APIKeyDeleteResponse, type APIKeysLimitOffset as APIKeysLimitOffset, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyListParams as APIKeyListParams, };
|
170
|
+
}
|
171
|
+
//# sourceMappingURL=api-keys.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,WAAW,EAAE;OACpD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,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C5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;CAAG;AAE9D,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.APIKeys = void 0;
|
5
|
+
const resource_1 = require("../core/resource.js");
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
8
|
+
class APIKeys extends resource_1.APIResource {
|
9
|
+
/**
|
10
|
+
* Create a new API key.
|
11
|
+
*
|
12
|
+
* Args: params: The parameters for creating the API key.
|
13
|
+
*
|
14
|
+
* Returns: ApiKeyCreated: The response containing the details of the created API
|
15
|
+
* key.
|
16
|
+
*/
|
17
|
+
create(body, options) {
|
18
|
+
return this._client.post('/v1/api-keys', { body, ...options });
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Retrieve details of a specific API key by its ID.
|
22
|
+
*
|
23
|
+
* Args: api_key_id: The ID of the API key to retrieve.
|
24
|
+
*
|
25
|
+
* Returns: ApiKey: The response containing the API key details.
|
26
|
+
*/
|
27
|
+
retrieve(apiKeyID, options) {
|
28
|
+
return this._client.get((0, path_1.path) `/v1/api-keys/${apiKeyID}`, options);
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* List all API keys for the authenticated user.
|
32
|
+
*
|
33
|
+
* Args: pagination: The pagination options
|
34
|
+
*
|
35
|
+
* Returns: A list of API keys belonging to the user.
|
36
|
+
*/
|
37
|
+
list(query = {}, options) {
|
38
|
+
return this._client.getAPIList('/v1/api-keys', (pagination_1.LimitOffset), { query, ...options });
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Delete a specific API key by its ID.
|
42
|
+
*
|
43
|
+
* Args: api_key_id: The ID of the API key to delete.
|
44
|
+
*
|
45
|
+
* Returns: ApiKeyDeleted: The response containing the details of the deleted API
|
46
|
+
* key.
|
47
|
+
*/
|
48
|
+
delete(apiKeyID, options) {
|
49
|
+
return this._client.delete((0, path_1.path) `/v1/api-keys/${apiKeyID}`, options);
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
* Reroll the secret for a specific API key by its ID.
|
53
|
+
*
|
54
|
+
* This generates a new secret key, invalidating the old one.
|
55
|
+
*
|
56
|
+
* Args: api_key_id: The ID of the API key to reroll.
|
57
|
+
*
|
58
|
+
* Returns: ApiKeyCreated: The response containing the API key details with the new
|
59
|
+
* secret key.
|
60
|
+
*/
|
61
|
+
reroll(apiKeyID, options) {
|
62
|
+
return this._client.post((0, path_1.path) `/v1/api-keys/${apiKeyID}/reroll`, options);
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* Revoke a specific API key by its ID.
|
66
|
+
*
|
67
|
+
* Args: api_key_id: The ID of the API key to revoke.
|
68
|
+
*
|
69
|
+
* Returns: ApiKey: The response containing the details of the revoked API key.
|
70
|
+
*/
|
71
|
+
revoke(apiKeyID, options) {
|
72
|
+
return this._client.post((0, path_1.path) `/v1/api-keys/${apiKeyID}/revoke`, options);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
exports.APIKeys = APIKeys;
|
76
|
+
//# sourceMappingURL=api-keys.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAsF;AAEtF,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,wBAAmB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF;AA1ED,0BA0EC"}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
3
|
+
import { LimitOffset } from "../core/pagination.mjs";
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
5
|
+
export class APIKeys extends APIResource {
|
6
|
+
/**
|
7
|
+
* Create a new API key.
|
8
|
+
*
|
9
|
+
* Args: params: The parameters for creating the API key.
|
10
|
+
*
|
11
|
+
* Returns: ApiKeyCreated: The response containing the details of the created API
|
12
|
+
* key.
|
13
|
+
*/
|
14
|
+
create(body, options) {
|
15
|
+
return this._client.post('/v1/api-keys', { body, ...options });
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* Retrieve details of a specific API key by its ID.
|
19
|
+
*
|
20
|
+
* Args: api_key_id: The ID of the API key to retrieve.
|
21
|
+
*
|
22
|
+
* Returns: ApiKey: The response containing the API key details.
|
23
|
+
*/
|
24
|
+
retrieve(apiKeyID, options) {
|
25
|
+
return this._client.get(path `/v1/api-keys/${apiKeyID}`, options);
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* List all API keys for the authenticated user.
|
29
|
+
*
|
30
|
+
* Args: pagination: The pagination options
|
31
|
+
*
|
32
|
+
* Returns: A list of API keys belonging to the user.
|
33
|
+
*/
|
34
|
+
list(query = {}, options) {
|
35
|
+
return this._client.getAPIList('/v1/api-keys', (LimitOffset), { query, ...options });
|
36
|
+
}
|
37
|
+
/**
|
38
|
+
* Delete a specific API key by its ID.
|
39
|
+
*
|
40
|
+
* Args: api_key_id: The ID of the API key to delete.
|
41
|
+
*
|
42
|
+
* Returns: ApiKeyDeleted: The response containing the details of the deleted API
|
43
|
+
* key.
|
44
|
+
*/
|
45
|
+
delete(apiKeyID, options) {
|
46
|
+
return this._client.delete(path `/v1/api-keys/${apiKeyID}`, options);
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Reroll the secret for a specific API key by its ID.
|
50
|
+
*
|
51
|
+
* This generates a new secret key, invalidating the old one.
|
52
|
+
*
|
53
|
+
* Args: api_key_id: The ID of the API key to reroll.
|
54
|
+
*
|
55
|
+
* Returns: ApiKeyCreated: The response containing the API key details with the new
|
56
|
+
* secret key.
|
57
|
+
*/
|
58
|
+
reroll(apiKeyID, options) {
|
59
|
+
return this._client.post(path `/v1/api-keys/${apiKeyID}/reroll`, options);
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Revoke a specific API key by its ID.
|
63
|
+
*
|
64
|
+
* Args: api_key_id: The ID of the API key to revoke.
|
65
|
+
*
|
66
|
+
* Returns: ApiKey: The response containing the details of the revoked API key.
|
67
|
+
*/
|
68
|
+
revoke(apiKeyID, options) {
|
69
|
+
return this._client.post(path `/v1/api-keys/${apiKeyID}/revoke`, options);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
//# sourceMappingURL=api-keys.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api-keys.m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AAO,CAAC,CAAC;IAC3E,CAAC;CACF"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
4
|
+
export declare class Chat extends APIResource {
|
5
|
+
/**
|
6
|
+
* Create a chat completion using the provided parameters.
|
7
|
+
*
|
8
|
+
* Generates a completion response based on the chat messages and model parameters
|
9
|
+
* provided. The response can be either a full completion or streamed chunks
|
10
|
+
* depending on the request parameters.
|
11
|
+
*
|
12
|
+
* Args: params: Parameters for creating the chat completion including messages,
|
13
|
+
* model selection, and generation settings user: The authenticated user making the
|
14
|
+
* request
|
15
|
+
*
|
16
|
+
* Returns: Either a ChatCompletion containing the full response, or
|
17
|
+
* ChatCompletionChunk for streaming
|
18
|
+
*
|
19
|
+
* Raises: HTTPException: If there is an error creating the completion (500)
|
20
|
+
*/
|
21
|
+
createCompletion(options?: RequestOptions): APIPromise<unknown>;
|
22
|
+
}
|
23
|
+
export type ChatCreateCompletionResponse = unknown;
|
24
|
+
export declare namespace Chat {
|
25
|
+
export { type ChatCreateCompletionResponse as ChatCreateCompletionResponse };
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=chat.d.mts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"chat.d.mts","sourceRoot":"","sources":["../src/resources/chat.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAGhE;AAED,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEnD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,4BAA4B,IAAI,4BAA4B,EAAE,CAAC;CAC9E"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
4
|
+
export declare class Chat extends APIResource {
|
5
|
+
/**
|
6
|
+
* Create a chat completion using the provided parameters.
|
7
|
+
*
|
8
|
+
* Generates a completion response based on the chat messages and model parameters
|
9
|
+
* provided. The response can be either a full completion or streamed chunks
|
10
|
+
* depending on the request parameters.
|
11
|
+
*
|
12
|
+
* Args: params: Parameters for creating the chat completion including messages,
|
13
|
+
* model selection, and generation settings user: The authenticated user making the
|
14
|
+
* request
|
15
|
+
*
|
16
|
+
* Returns: Either a ChatCompletion containing the full response, or
|
17
|
+
* ChatCompletionChunk for streaming
|
18
|
+
*
|
19
|
+
* Raises: HTTPException: If there is an error creating the completion (500)
|
20
|
+
*/
|
21
|
+
createCompletion(options?: RequestOptions): APIPromise<unknown>;
|
22
|
+
}
|
23
|
+
export type ChatCreateCompletionResponse = unknown;
|
24
|
+
export declare namespace Chat {
|
25
|
+
export { type ChatCreateCompletionResponse as ChatCreateCompletionResponse };
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=chat.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/resources/chat.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAGhE;AAED,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEnD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,4BAA4B,IAAI,4BAA4B,EAAE,CAAC;CAC9E"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.Chat = void 0;
|
5
|
+
const resource_1 = require("../core/resource.js");
|
6
|
+
class Chat extends resource_1.APIResource {
|
7
|
+
/**
|
8
|
+
* Create a chat completion using the provided parameters.
|
9
|
+
*
|
10
|
+
* Generates a completion response based on the chat messages and model parameters
|
11
|
+
* provided. The response can be either a full completion or streamed chunks
|
12
|
+
* depending on the request parameters.
|
13
|
+
*
|
14
|
+
* Args: params: Parameters for creating the chat completion including messages,
|
15
|
+
* model selection, and generation settings user: The authenticated user making the
|
16
|
+
* request
|
17
|
+
*
|
18
|
+
* Returns: Either a ChatCompletion containing the full response, or
|
19
|
+
* ChatCompletionChunk for streaming
|
20
|
+
*
|
21
|
+
* Raises: HTTPException: If there is an error creating the completion (500)
|
22
|
+
*/
|
23
|
+
createCompletion(options) {
|
24
|
+
return this._client.post('/v1/chat/completions', options);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
exports.Chat = Chat;
|
28
|
+
//# sourceMappingURL=chat.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../src/resources/chat.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,OAAwB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF;AApBD,oBAoBC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
3
|
+
export class Chat extends APIResource {
|
4
|
+
/**
|
5
|
+
* Create a chat completion using the provided parameters.
|
6
|
+
*
|
7
|
+
* Generates a completion response based on the chat messages and model parameters
|
8
|
+
* provided. The response can be either a full completion or streamed chunks
|
9
|
+
* depending on the request parameters.
|
10
|
+
*
|
11
|
+
* Args: params: Parameters for creating the chat completion including messages,
|
12
|
+
* model selection, and generation settings user: The authenticated user making the
|
13
|
+
* request
|
14
|
+
*
|
15
|
+
* Returns: Either a ChatCompletion containing the full response, or
|
16
|
+
* ChatCompletionChunk for streaming
|
17
|
+
*
|
18
|
+
* Raises: HTTPException: If there is an error creating the completion (500)
|
19
|
+
*/
|
20
|
+
createCompletion(options) {
|
21
|
+
return this._client.post('/v1/chat/completions', options);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
//# sourceMappingURL=chat.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"chat.mjs","sourceRoot":"","sources":["../src/resources/chat.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,OAAwB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF"}
|