@caitlyn-ai/sdk 0.0.0-stage → 0.0.2

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 (45) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +164 -2
  4. package/dist-browser/sdk/index.mjs +1923 -0
  5. package/dist-browser/sdk/index.mjs.map +7 -0
  6. package/dist-cjs/sdk/index.cjs +1974 -0
  7. package/dist-cjs/sdk/index.cjs.map +7 -0
  8. package/dist-es/sdk/index.mjs +1925 -0
  9. package/dist-es/sdk/index.mjs.map +7 -0
  10. package/dist-types/Caitlyn.d.ts +76 -0
  11. package/dist-types/CaitlynClient.d.ts +160 -0
  12. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  13. package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
  14. package/dist-types/commandBuilder.d.ts +18 -0
  15. package/dist-types/commands/CreateDocumentCommand.d.ts +190 -0
  16. package/dist-types/commands/CreateUploadCommand.d.ts +165 -0
  17. package/dist-types/commands/GetAgentVersionCommand.d.ts +177 -0
  18. package/dist-types/commands/ListDocumentsCommand.d.ts +176 -0
  19. package/dist-types/commands/ResumeConversationStreamCommand.d.ts +146 -0
  20. package/dist-types/commands/SendMessageCommand.d.ts +183 -0
  21. package/dist-types/commands/UpdateDraftVersionCommand.d.ts +202 -0
  22. package/dist-types/commands/index.d.ts +7 -0
  23. package/dist-types/endpoint/EndpointParameters.d.ts +32 -0
  24. package/dist-types/endpoint/bdd.d.ts +2 -0
  25. package/dist-types/endpoint/endpointResolver.d.ts +8 -0
  26. package/dist-types/extensionConfiguration.d.ts +8 -0
  27. package/dist-types/index.d.ts +22 -0
  28. package/dist-types/models/CaitlynServiceException.d.ts +15 -0
  29. package/dist-types/models/enums.d.ts +148 -0
  30. package/dist-types/models/errors.d.ts +659 -0
  31. package/dist-types/models/models_0.d.ts +754 -0
  32. package/dist-types/pagination/Interfaces.d.ts +8 -0
  33. package/dist-types/pagination/ListDocumentsPaginator.d.ts +7 -0
  34. package/dist-types/pagination/index.d.ts +2 -0
  35. package/dist-types/runtimeConfig.browser.d.ts +50 -0
  36. package/dist-types/runtimeConfig.d.ts +50 -0
  37. package/dist-types/runtimeConfig.native.d.ts +49 -0
  38. package/dist-types/runtimeConfig.shared.d.ts +36 -0
  39. package/dist-types/runtimeExtensions.d.ts +17 -0
  40. package/dist-types/schemas/schemas_0.d.ts +51 -0
  41. package/dist-types/sdk/client.d.ts +47 -0
  42. package/dist-types/sdk/events.d.ts +163 -0
  43. package/dist-types/sdk/index.d.ts +8 -0
  44. package/dist-types/sdk/operations.d.ts +70 -0
  45. package/package.json +49 -5
@@ -0,0 +1,160 @@
1
+ import { type DefaultsMode as __DefaultsMode, type SmithyConfiguration as __SmithyConfiguration, type SmithyResolvedConfiguration as __SmithyResolvedConfiguration, Client as __Client } from "@smithy/core/client";
2
+ import { type EndpointInputConfig, type EndpointRequiredInputConfig, type EndpointRequiredResolvedConfig, type EndpointResolvedConfig } from "@smithy/core/endpoints";
3
+ import { type HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/core/protocols";
4
+ import { type RetryInputConfig, type RetryResolvedConfig } from "@smithy/core/retry";
5
+ import type { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, SdkStreamMixinInjector as __SdkStreamMixinInjector, StreamCollector as __StreamCollector, UrlParser as __UrlParser } from "@smithy/types";
6
+ import { type HttpAuthSchemeInputConfig, type HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
7
+ import type { CreateDocumentCommandInput, CreateDocumentCommandOutput } from "./commands/CreateDocumentCommand";
8
+ import type { CreateUploadCommandInput, CreateUploadCommandOutput } from "./commands/CreateUploadCommand";
9
+ import type { GetAgentVersionCommandInput, GetAgentVersionCommandOutput } from "./commands/GetAgentVersionCommand";
10
+ import type { ListDocumentsCommandInput, ListDocumentsCommandOutput } from "./commands/ListDocumentsCommand";
11
+ import type { ResumeConversationStreamCommandInput, ResumeConversationStreamCommandOutput } from "./commands/ResumeConversationStreamCommand";
12
+ import type { SendMessageCommandInput, SendMessageCommandOutput } from "./commands/SendMessageCommand";
13
+ import type { UpdateDraftVersionCommandInput, UpdateDraftVersionCommandOutput } from "./commands/UpdateDraftVersionCommand";
14
+ import { type ClientInputEndpointParameters, type ClientResolvedEndpointParameters, type EndpointParameters } from "./endpoint/EndpointParameters";
15
+ import { type RuntimeExtension, type RuntimeExtensionsConfig } from "./runtimeExtensions";
16
+ export { __Client };
17
+ /**
18
+ * @public
19
+ */
20
+ export type ServiceInputTypes = CreateDocumentCommandInput | CreateUploadCommandInput | GetAgentVersionCommandInput | ListDocumentsCommandInput | ResumeConversationStreamCommandInput | SendMessageCommandInput | UpdateDraftVersionCommandInput;
21
+ /**
22
+ * @public
23
+ */
24
+ export type ServiceOutputTypes = CreateDocumentCommandOutput | CreateUploadCommandOutput | GetAgentVersionCommandOutput | ListDocumentsCommandOutput | ResumeConversationStreamCommandOutput | SendMessageCommandOutput | UpdateDraftVersionCommandOutput;
25
+ /**
26
+ * @public
27
+ */
28
+ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {
29
+ /**
30
+ * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.
31
+ */
32
+ requestHandler?: __HttpHandlerUserInput;
33
+ /**
34
+ * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface
35
+ * that computes the SHA-256 HMAC or checksum of a string or binary buffer.
36
+ * @internal
37
+ */
38
+ sha256?: __ChecksumConstructor | __HashConstructor;
39
+ /**
40
+ * The function that will be used to convert strings into HTTP endpoints.
41
+ * @internal
42
+ */
43
+ urlParser?: __UrlParser;
44
+ /**
45
+ * A function that can calculate the length of a request body.
46
+ * @internal
47
+ */
48
+ bodyLengthChecker?: __BodyLengthCalculator;
49
+ /**
50
+ * A function that converts a stream into an array of bytes.
51
+ * @internal
52
+ */
53
+ streamCollector?: __StreamCollector;
54
+ /**
55
+ * The function that will be used to convert a base64-encoded string to a byte array.
56
+ * @internal
57
+ */
58
+ base64Decoder?: __Decoder;
59
+ /**
60
+ * The function that will be used to convert binary data to a base64-encoded string.
61
+ * @internal
62
+ */
63
+ base64Encoder?: __Encoder;
64
+ /**
65
+ * The function that will be used to convert a UTF8-encoded string to a byte array.
66
+ * @internal
67
+ */
68
+ utf8Decoder?: __Decoder;
69
+ /**
70
+ * The function that will be used to convert binary data to a UTF-8 encoded string.
71
+ * @internal
72
+ */
73
+ utf8Encoder?: __Encoder;
74
+ /**
75
+ * The runtime environment.
76
+ * @internal
77
+ */
78
+ runtime?: string;
79
+ /**
80
+ * Disable dynamically changing the endpoint of the client based on the hostPrefix
81
+ * trait of an operation.
82
+ */
83
+ disableHostPrefix?: boolean;
84
+ /**
85
+ * Value for how many times a request will be made at most in case of retry.
86
+ */
87
+ maxAttempts?: number | __Provider<number>;
88
+ /**
89
+ * Specifies which retry algorithm to use.
90
+ * Accepted values are "standard" and "adaptive".
91
+ * @see https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html
92
+ *
93
+ */
94
+ retryMode?: string | __Provider<string>;
95
+ /**
96
+ * Optional logger for logging debug/info/warn/error.
97
+ */
98
+ logger?: __Logger;
99
+ /**
100
+ * Optional extensions
101
+ */
102
+ extensions?: RuntimeExtension[];
103
+ /**
104
+ * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
105
+ */
106
+ defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
107
+ /**
108
+ * The internal function that inject utilities to runtime-specific stream to help users consume the data
109
+ * @internal
110
+ */
111
+ sdkStreamMixin?: __SdkStreamMixinInjector;
112
+ /**
113
+ * The SDK package version, sent in the user agent.
114
+ * @internal
115
+ */
116
+ caitlynSdkVersion?: string;
117
+ }
118
+ /**
119
+ * @public
120
+ */
121
+ export type CaitlynClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RetryInputConfig & EndpointInputConfig<EndpointParameters> & EndpointRequiredInputConfig & HttpAuthSchemeInputConfig & ClientInputEndpointParameters;
122
+ /**
123
+ * @public
124
+ *
125
+ * The configuration interface of CaitlynClient class constructor that set the region, credentials and other options.
126
+ */
127
+ export interface CaitlynClientConfig extends CaitlynClientConfigType {
128
+ }
129
+ /**
130
+ * @public
131
+ */
132
+ export type CaitlynClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RetryResolvedConfig & EndpointResolvedConfig<EndpointParameters> & EndpointRequiredResolvedConfig & HttpAuthSchemeResolvedConfig & ClientResolvedEndpointParameters;
133
+ /**
134
+ * @public
135
+ *
136
+ * The resolved configuration interface of CaitlynClient class. This is resolved and normalized from the {@link CaitlynClientConfig | constructor configuration interface}.
137
+ */
138
+ export interface CaitlynClientResolvedConfig extends CaitlynClientResolvedConfigType {
139
+ }
140
+ /**
141
+ * The Caitlyn v3 API.
142
+ *
143
+ * Every request is made to a workspace's own hostname, which names the workspace, and carries a
144
+ * short-lived Caitlyn bearer token, however the caller signed in. The `session` sign-in mode (the
145
+ * browser cookie) is handled by the SDKs' runtime and is not modelled per operation.
146
+ * @public
147
+ */
148
+ export declare class CaitlynClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, CaitlynClientResolvedConfig> {
149
+ /**
150
+ * The resolved configuration of CaitlynClient class. This is resolved and normalized from the {@link CaitlynClientConfig | constructor configuration interface}.
151
+ */
152
+ readonly config: CaitlynClientResolvedConfig;
153
+ constructor(...[configuration]: __CheckOptionalClientConfig<CaitlynClientConfig>);
154
+ /**
155
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
156
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
157
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
158
+ */
159
+ destroy(): void;
160
+ }
@@ -0,0 +1,29 @@
1
+ import { type HttpAuthScheme, TokenIdentity, TokenIdentityProvider } from "@smithy/types";
2
+ import type { CaitlynHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
3
+ /**
4
+ * @internal
5
+ */
6
+ export interface HttpAuthExtensionConfiguration {
7
+ setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
8
+ httpAuthSchemes(): HttpAuthScheme[];
9
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider: CaitlynHttpAuthSchemeProvider): void;
10
+ httpAuthSchemeProvider(): CaitlynHttpAuthSchemeProvider;
11
+ setToken(token: TokenIdentity | TokenIdentityProvider): void;
12
+ token(): TokenIdentity | TokenIdentityProvider | undefined;
13
+ }
14
+ /**
15
+ * @internal
16
+ */
17
+ export type HttpAuthRuntimeConfig = Partial<{
18
+ httpAuthSchemes: HttpAuthScheme[];
19
+ httpAuthSchemeProvider: CaitlynHttpAuthSchemeProvider;
20
+ token: TokenIdentity | TokenIdentityProvider;
21
+ }>;
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare const getHttpAuthExtensionConfiguration: (runtimeConfig: HttpAuthRuntimeConfig) => HttpAuthExtensionConfiguration;
26
+ /**
27
+ * @internal
28
+ */
29
+ export declare const resolveHttpAuthRuntimeConfig: (config: HttpAuthExtensionConfiguration) => HttpAuthRuntimeConfig;
@@ -0,0 +1,81 @@
1
+ import { type HandlerExecutionContext, type HttpAuthScheme, type HttpAuthSchemeParameters, type HttpAuthSchemeParametersProvider, type HttpAuthSchemeProvider, type Provider, TokenIdentity, TokenIdentityProvider } from "@smithy/types";
2
+ import type { CaitlynClientResolvedConfig } from "../CaitlynClient";
3
+ /**
4
+ * @internal
5
+ */
6
+ export interface CaitlynHttpAuthSchemeParameters extends HttpAuthSchemeParameters {
7
+ }
8
+ /**
9
+ * @internal
10
+ */
11
+ export interface CaitlynHttpAuthSchemeParametersProvider extends HttpAuthSchemeParametersProvider<CaitlynClientResolvedConfig, HandlerExecutionContext, CaitlynHttpAuthSchemeParameters, object> {
12
+ }
13
+ /**
14
+ * @internal
15
+ */
16
+ export declare const defaultCaitlynHttpAuthSchemeParametersProvider: (config: CaitlynClientResolvedConfig, context: HandlerExecutionContext, input: object) => Promise<CaitlynHttpAuthSchemeParameters>;
17
+ /**
18
+ * @internal
19
+ */
20
+ export interface CaitlynHttpAuthSchemeProvider extends HttpAuthSchemeProvider<CaitlynHttpAuthSchemeParameters> {
21
+ }
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare const defaultCaitlynHttpAuthSchemeProvider: CaitlynHttpAuthSchemeProvider;
26
+ /**
27
+ * @public
28
+ */
29
+ export interface HttpAuthSchemeInputConfig {
30
+ /**
31
+ * A comma-separated list of case-sensitive auth scheme names.
32
+ * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.
33
+ * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.
34
+ * @public
35
+ */
36
+ authSchemePreference?: string[] | Provider<string[]>;
37
+ /**
38
+ * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
39
+ * @internal
40
+ */
41
+ httpAuthSchemes?: HttpAuthScheme[];
42
+ /**
43
+ * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
44
+ * @internal
45
+ */
46
+ httpAuthSchemeProvider?: CaitlynHttpAuthSchemeProvider;
47
+ /**
48
+ * The token used to authenticate requests.
49
+ */
50
+ token?: TokenIdentity | TokenIdentityProvider;
51
+ }
52
+ /**
53
+ * @internal
54
+ */
55
+ export interface HttpAuthSchemeResolvedConfig {
56
+ /**
57
+ * A comma-separated list of case-sensitive auth scheme names.
58
+ * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.
59
+ * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.
60
+ * @public
61
+ */
62
+ readonly authSchemePreference: Provider<string[]>;
63
+ /**
64
+ * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
65
+ * @internal
66
+ */
67
+ readonly httpAuthSchemes: HttpAuthScheme[];
68
+ /**
69
+ * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
70
+ * @internal
71
+ */
72
+ readonly httpAuthSchemeProvider: CaitlynHttpAuthSchemeProvider;
73
+ /**
74
+ * The token used to authenticate requests.
75
+ */
76
+ readonly token?: TokenIdentityProvider;
77
+ }
78
+ /**
79
+ * @internal
80
+ */
81
+ export declare const resolveHttpAuthSchemeConfig: <T>(config: T & HttpAuthSchemeInputConfig) => T & HttpAuthSchemeResolvedConfig;
@@ -0,0 +1,18 @@
1
+ import type { EndpointParameterInstructions } from "@smithy/types";
2
+ import type { CaitlynClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "./CaitlynClient";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare const command: <I extends ServiceInputTypes, O extends ServiceOutputTypes>(added: EndpointParameterInstructions, plugins: (CommandCtor: any, clientStack: any, config: any, options: any) => import("@smithy/types").Pluggable<any, any>[], op: string, $: import("@smithy/types").StaticOperationSchema, smithyContext?: Record<string, unknown>) => {
7
+ new (input: I): import("@smithy/core/client").CommandImpl<I, O, CaitlynClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
8
+ new (...[input]: import("@smithy/types").OptionalParameter<I>): import("@smithy/core/client").CommandImpl<I, O, CaitlynClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
9
+ getEndpointParameterInstructions(): EndpointParameterInstructions;
10
+ };
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare const _ep0: EndpointParameterInstructions;
15
+ /**
16
+ * @internal
17
+ */
18
+ export declare const _mw0: (Command: any, cs: any, config: any, o: any) => never[];
@@ -0,0 +1,190 @@
1
+ import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
2
+ import type { CreateDocumentInput, CreateDocumentOutput } from "../models/models_0";
3
+ /**
4
+ * @public
5
+ */
6
+ export type { __MetadataBearer };
7
+ /**
8
+ * @public
9
+ *
10
+ * The input for {@link CreateDocumentCommand}.
11
+ */
12
+ export interface CreateDocumentCommandInput extends CreateDocumentInput {
13
+ }
14
+ /**
15
+ * @public
16
+ *
17
+ * The output of {@link CreateDocumentCommand}.
18
+ */
19
+ export interface CreateDocumentCommandOutput extends CreateDocumentOutput, __MetadataBearer {
20
+ }
21
+ declare const CreateDocumentCommand_base: {
22
+ new (input: CreateDocumentCommandInput): import("@smithy/core/client").CommandImpl<CreateDocumentCommandInput, CreateDocumentCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
23
+ new (input: CreateDocumentCommandInput): import("@smithy/core/client").CommandImpl<CreateDocumentCommandInput, CreateDocumentCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
24
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
25
+ };
26
+ /**
27
+ * Creates a document from an upload; ingestion continues after the response.
28
+ *
29
+ * Returns 202 with the document in its initial state and the Operation that tracks ingestion, and
30
+ * `Location` names the Operation. Needs the files permission, read access to the knowledge base and
31
+ * access to the folder; it does not need update access to the knowledge base, which is for the
32
+ * knowledge base's own configuration.
33
+ * @example
34
+ * Use a bare-bones client and the command you need to make an API call.
35
+ * ```javascript
36
+ * import { CaitlynClient, CreateDocumentCommand } from "@caitlyn-ai/sdk"; // ES Modules import
37
+ * // const { CaitlynClient, CreateDocumentCommand } = require("@caitlyn-ai/sdk"); // CommonJS import
38
+ * // import type { CaitlynClientConfig } from "@caitlyn-ai/sdk";
39
+ * const config = {}; // type is CaitlynClientConfig
40
+ * const client = new CaitlynClient(config);
41
+ * const input = { // CreateDocumentInput
42
+ * knowledgeBaseId: "STRING_VALUE", // required
43
+ * idempotencyKey: "STRING_VALUE",
44
+ * uploadId: "STRING_VALUE", // required
45
+ * folder: "STRING_VALUE", // required
46
+ * name: "STRING_VALUE",
47
+ * };
48
+ * const command = new CreateDocumentCommand(input);
49
+ * const response = await client.send(command);
50
+ * // { // CreateDocumentOutput
51
+ * // requestId: "STRING_VALUE",
52
+ * // apiVersion: "STRING_VALUE",
53
+ * // location: "STRING_VALUE",
54
+ * // document: { // Document
55
+ * // id: "STRING_VALUE", // required
56
+ * // knowledgeBaseId: "STRING_VALUE", // required
57
+ * // name: "STRING_VALUE", // required
58
+ * // folder: "STRING_VALUE", // required
59
+ * // status: "pending" || "processing" || "indexed" || "partially_indexed" || "failed" || "deleting", // required
60
+ * // stage: "STRING_VALUE",
61
+ * // contentType: "STRING_VALUE",
62
+ * // byteSize: Number("long"),
63
+ * // sha256: "STRING_VALUE",
64
+ * // createdAt: new Date("TIMESTAMP"), // required
65
+ * // updatedAt: new Date("TIMESTAMP"), // required
66
+ * // partialFailures: [ // PartialFailureList
67
+ * // { // PartialFailure
68
+ * // targetId: "STRING_VALUE",
69
+ * // code: "STRING_VALUE", // required
70
+ * // detail: "STRING_VALUE",
71
+ * // },
72
+ * // ],
73
+ * // },
74
+ * // operation: { // Operation
75
+ * // id: "STRING_VALUE", // required
76
+ * // kind: "document_ingestion", // required
77
+ * // status: "queued" || "running" || "succeeded" || "succeeded_with_failures" || "failed" || "cancelled", // required
78
+ * // createdAt: new Date("TIMESTAMP"), // required
79
+ * // },
80
+ * // };
81
+ *
82
+ * ```
83
+ *
84
+ * @param CreateDocumentCommandInput - {@link CreateDocumentCommandInput}
85
+ * @returns {@link CreateDocumentCommandOutput}
86
+ * @see {@link CreateDocumentCommandInput} for command's `input` shape.
87
+ * @see {@link CreateDocumentCommandOutput} for command's `response` shape.
88
+ * @see {@link CaitlynClientResolvedConfig | config} for CaitlynClient's `config` shape.
89
+ *
90
+ * @throws {@link ConflictError} (client fault)
91
+ * The resource's state does not allow the request, a unique name is taken, or a request with the
92
+ * same idempotency key is still in progress.
93
+ *
94
+ * @throws {@link NotFoundError} (client fault)
95
+ * The record does not exist, or the caller may not see it. The two are deliberately the same, so
96
+ * identifiers cannot be probed.
97
+ *
98
+ * @throws {@link UnprocessableContentError} (client fault)
99
+ * The idempotency key was already used with a different request body.
100
+ *
101
+ * @throws {@link InternalError} (server fault)
102
+ * An unexpected server failure. Not retried by the SDKs.
103
+ *
104
+ * @throws {@link PermissionDeniedError} (client fault)
105
+ * The caller may not call this operation: it lacks the permission, its credential type may not
106
+ * call it, or the operation is served only on the organisation's primary workspace. Decided before
107
+ * any record is read. A record the caller may not see is 404 instead.
108
+ *
109
+ * @throws {@link ServiceUnavailableError} (server fault)
110
+ * A dependency is briefly unavailable, or the request's audit event could not be recorded; wait for
111
+ * `Retry-After` and try again.
112
+ *
113
+ * @throws {@link TooManyRequestsError} (client fault)
114
+ * Too many requests; wait for `Retry-After` and try again.
115
+ *
116
+ * @throws {@link UnauthenticatedError} (client fault)
117
+ * No credential was sent, or it is expired or not valid.
118
+ *
119
+ * @throws {@link ValidationError} (client fault)
120
+ * The request is malformed: a member is missing, the wrong type or out of range; it has a member,
121
+ * filter or sort field the operation does not define; or its cursor is not valid for this list.
122
+ *
123
+ * @throws {@link CaitlynServiceException}
124
+ * <p>Base exception class for all service exceptions from Caitlyn service.</p>
125
+ *
126
+ *
127
+ * @example Add an uploaded file to the HR folder
128
+ * ```javascript
129
+ * //
130
+ * const input = {
131
+ * folder: "hr/",
132
+ * idempotencyKey: "3f0c9a1e-5d2b-4f7a-9c1e-2b8d4a6f0e13",
133
+ * knowledgeBaseId: "KB4T7YQ2WL",
134
+ * name: "Leave policy",
135
+ * uploadId: "0193a6f2-1111-7a2b-8c3d-4e5f60718293"
136
+ * };
137
+ * const command = new CreateDocumentCommand(input);
138
+ * const response = await client.send(command);
139
+ * /* response is
140
+ * {
141
+ * document: {
142
+ * createdAt: "2026-11-10T01:02:03.000Z",
143
+ * folder: "hr/",
144
+ * id: "doc-3b7f9e21",
145
+ * knowledgeBaseId: "KB4T7YQ2WL",
146
+ * name: "Leave policy",
147
+ * status: "pending",
148
+ * updatedAt: "2026-11-10T01:02:03.000Z"
149
+ * },
150
+ * location: "/api/v3/operations/0193a6f2-2222-7b3c-9d4e-5f6071829304",
151
+ * operation: {
152
+ * createdAt: "2026-11-10T01:02:03.000Z",
153
+ * id: "0193a6f2-2222-7b3c-9d4e-5f6071829304",
154
+ * kind: "document_ingestion",
155
+ * status: "queued"
156
+ * }
157
+ * }
158
+ * *\/
159
+ * ```
160
+ *
161
+ * @example The upload was already used, or has expired
162
+ * ```javascript
163
+ * //
164
+ * const input = {
165
+ * folder: "hr/",
166
+ * knowledgeBaseId: "KB4T7YQ2WL",
167
+ * uploadId: "0193a6f2-1111-7a2b-8c3d-4e5f60718293"
168
+ * };
169
+ * const command = new CreateDocumentCommand(input);
170
+ * const response = await client.send(command);
171
+ * /* response is
172
+ * { /* metadata only *\/ }
173
+ * *\/
174
+ * ```
175
+ *
176
+ * @public
177
+ */
178
+ export declare class CreateDocumentCommand extends CreateDocumentCommand_base {
179
+ /** @internal type navigation helper, not in runtime. */
180
+ protected static __types: {
181
+ api: {
182
+ input: CreateDocumentInput;
183
+ output: CreateDocumentOutput;
184
+ };
185
+ sdk: {
186
+ input: CreateDocumentCommandInput;
187
+ output: CreateDocumentCommandOutput;
188
+ };
189
+ };
190
+ }
@@ -0,0 +1,165 @@
1
+ import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
2
+ import type { CreateUploadInput, CreateUploadOutput } from "../models/models_0";
3
+ /**
4
+ * @public
5
+ */
6
+ export type { __MetadataBearer };
7
+ /**
8
+ * @public
9
+ *
10
+ * The input for {@link CreateUploadCommand}.
11
+ */
12
+ export interface CreateUploadCommandInput extends CreateUploadInput {
13
+ }
14
+ /**
15
+ * @public
16
+ *
17
+ * The output of {@link CreateUploadCommand}.
18
+ */
19
+ export interface CreateUploadCommandOutput extends CreateUploadOutput, __MetadataBearer {
20
+ }
21
+ declare const CreateUploadCommand_base: {
22
+ new (input: CreateUploadCommandInput): import("@smithy/core/client").CommandImpl<CreateUploadCommandInput, CreateUploadCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
23
+ new (input: CreateUploadCommandInput): import("@smithy/core/client").CommandImpl<CreateUploadCommandInput, CreateUploadCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
24
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
25
+ };
26
+ /**
27
+ * Reserves a short-lived slot for a file's bytes and returns a presigned URL bound to their
28
+ * checksum.
29
+ *
30
+ * Send the bytes with `uploadMethod` to `uploadUrl`, with every header in `requiredHeaders`,
31
+ * before `expiresAt`; then pass the upload's `id` to the operation that uses it. The SDKs'
32
+ * `uploads.create(file)` does all of this.
33
+ * @example
34
+ * Use a bare-bones client and the command you need to make an API call.
35
+ * ```javascript
36
+ * import { CaitlynClient, CreateUploadCommand } from "@caitlyn-ai/sdk"; // ES Modules import
37
+ * // const { CaitlynClient, CreateUploadCommand } = require("@caitlyn-ai/sdk"); // CommonJS import
38
+ * // import type { CaitlynClientConfig } from "@caitlyn-ai/sdk";
39
+ * const config = {}; // type is CaitlynClientConfig
40
+ * const client = new CaitlynClient(config);
41
+ * const input = { // CreateUploadInput
42
+ * idempotencyKey: "STRING_VALUE",
43
+ * fileName: "STRING_VALUE", // required
44
+ * contentType: "STRING_VALUE", // required
45
+ * byteSize: Number("long"), // required
46
+ * sha256: "STRING_VALUE", // required
47
+ * };
48
+ * const command = new CreateUploadCommand(input);
49
+ * const response = await client.send(command);
50
+ * // { // CreateUploadOutput
51
+ * // requestId: "STRING_VALUE",
52
+ * // apiVersion: "STRING_VALUE",
53
+ * // location: "STRING_VALUE",
54
+ * // id: "STRING_VALUE", // required
55
+ * // uploadUrl: "STRING_VALUE", // required
56
+ * // uploadMethod: "STRING_VALUE", // required
57
+ * // requiredHeaders: { // HeaderMap // required
58
+ * // "<keys>": "STRING_VALUE",
59
+ * // },
60
+ * // expiresAt: new Date("TIMESTAMP"), // required
61
+ * // status: "awaiting_bytes" || "received" || "consumed" || "expired", // required
62
+ * // };
63
+ *
64
+ * ```
65
+ *
66
+ * @param CreateUploadCommandInput - {@link CreateUploadCommandInput}
67
+ * @returns {@link CreateUploadCommandOutput}
68
+ * @see {@link CreateUploadCommandInput} for command's `input` shape.
69
+ * @see {@link CreateUploadCommandOutput} for command's `response` shape.
70
+ * @see {@link CaitlynClientResolvedConfig | config} for CaitlynClient's `config` shape.
71
+ *
72
+ * @throws {@link ConflictError} (client fault)
73
+ * The resource's state does not allow the request, a unique name is taken, or a request with the
74
+ * same idempotency key is still in progress.
75
+ *
76
+ * @throws {@link PayloadTooLargeError} (client fault)
77
+ * The body, a file or the send `context` is over its documented limit.
78
+ *
79
+ * @throws {@link UnprocessableContentError} (client fault)
80
+ * The idempotency key was already used with a different request body.
81
+ *
82
+ * @throws {@link InternalError} (server fault)
83
+ * An unexpected server failure. Not retried by the SDKs.
84
+ *
85
+ * @throws {@link PermissionDeniedError} (client fault)
86
+ * The caller may not call this operation: it lacks the permission, its credential type may not
87
+ * call it, or the operation is served only on the organisation's primary workspace. Decided before
88
+ * any record is read. A record the caller may not see is 404 instead.
89
+ *
90
+ * @throws {@link ServiceUnavailableError} (server fault)
91
+ * A dependency is briefly unavailable, or the request's audit event could not be recorded; wait for
92
+ * `Retry-After` and try again.
93
+ *
94
+ * @throws {@link TooManyRequestsError} (client fault)
95
+ * Too many requests; wait for `Retry-After` and try again.
96
+ *
97
+ * @throws {@link UnauthenticatedError} (client fault)
98
+ * No credential was sent, or it is expired or not valid.
99
+ *
100
+ * @throws {@link ValidationError} (client fault)
101
+ * The request is malformed: a member is missing, the wrong type or out of range; it has a member,
102
+ * filter or sort field the operation does not define; or its cursor is not valid for this list.
103
+ *
104
+ * @throws {@link CaitlynServiceException}
105
+ * <p>Base exception class for all service exceptions from Caitlyn service.</p>
106
+ *
107
+ *
108
+ * @example Reserve an upload for a PDF
109
+ * ```javascript
110
+ * //
111
+ * const input = {
112
+ * byteSize: 482113,
113
+ * contentType: "application/pdf",
114
+ * fileName: "leave-policy.pdf",
115
+ * idempotencyKey: "9b1d4e2a-7c3f-4a8e-b5d6-0e1f2a3b4c5d",
116
+ * sha256: "n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="
117
+ * };
118
+ * const command = new CreateUploadCommand(input);
119
+ * const response = await client.send(command);
120
+ * /* response is
121
+ * {
122
+ * expiresAt: "2026-11-10T01:17:03.000Z",
123
+ * id: "0193a6f2-1111-7a2b-8c3d-4e5f60718293",
124
+ * location: "/api/v3/uploads/0193a6f2-1111-7a2b-8c3d-4e5f60718293",
125
+ * requiredHeaders: {
126
+ * Content-Type: "application/pdf"
127
+ * },
128
+ * status: "awaiting_bytes",
129
+ * uploadMethod: "PUT",
130
+ * uploadUrl: "https://uploads.example.com/0193a6f2-1111-7a2b-8c3d-4e5f60718293?signature=abc"
131
+ * }
132
+ * *\/
133
+ * ```
134
+ *
135
+ * @example A file over the size limit
136
+ * ```javascript
137
+ * //
138
+ * const input = {
139
+ * byteSize: 9000000000,
140
+ * contentType: "application/zip",
141
+ * fileName: "archive.zip",
142
+ * sha256: "n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="
143
+ * };
144
+ * const command = new CreateUploadCommand(input);
145
+ * const response = await client.send(command);
146
+ * /* response is
147
+ * { /* metadata only *\/ }
148
+ * *\/
149
+ * ```
150
+ *
151
+ * @public
152
+ */
153
+ export declare class CreateUploadCommand extends CreateUploadCommand_base {
154
+ /** @internal type navigation helper, not in runtime. */
155
+ protected static __types: {
156
+ api: {
157
+ input: CreateUploadInput;
158
+ output: CreateUploadOutput;
159
+ };
160
+ sdk: {
161
+ input: CreateUploadCommandInput;
162
+ output: CreateUploadCommandOutput;
163
+ };
164
+ };
165
+ }