@probelabs/probe 0.6.0-rc147 → 0.6.0-rc149
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/bin/probe +12 -3
- package/build/agent/ProbeAgent.js +1 -3
- package/build/agent/index.js +58 -477
- package/build/extract.js +1 -1
- package/build/index.js +1 -7
- package/build/mcp/index.js +3 -3
- package/build/mcp/index.ts +3 -3
- package/build/tools/common.js +58 -49
- package/cjs/agent/ProbeAgent.cjs +699 -770
- package/cjs/index.cjs +650 -1347
- package/package.json +1 -12
- package/src/agent/ProbeAgent.js +1 -3
- package/src/extract.js +1 -1
- package/src/index.js +1 -7
- package/src/mcp/index.ts +3 -3
- package/src/tools/common.js +58 -49
- package/bin/binaries/probe-v0.6.0-rc147-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-aarch64-unknown-linux-gnu.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc147-x86_64-unknown-linux-gnu.tar.gz +0 -0
- package/build/agent/appTracer.js +0 -360
- package/build/agent/fileSpanExporter.js +0 -167
- package/build/agent/telemetry.js +0 -219
- package/cjs/agent/telemetry.cjs +0 -358
- package/src/agent/appTracer.js +0 -360
- package/src/agent/fileSpanExporter.js +0 -167
- package/src/agent/telemetry.js +0 -219
package/cjs/index.cjs
CHANGED
|
@@ -1589,7 +1589,7 @@ async function extract(options) {
|
|
|
1589
1589
|
const hasInputFile = !!options.inputFile;
|
|
1590
1590
|
const hasContent = options.content !== void 0 && options.content !== null;
|
|
1591
1591
|
if (!hasFiles && !hasInputFile && !hasContent) {
|
|
1592
|
-
throw new Error("
|
|
1592
|
+
throw new Error('Extract requires one of: "files" (array of file paths), "inputFile" (path to input file), or "content" (string/buffer for stdin)');
|
|
1593
1593
|
}
|
|
1594
1594
|
const binaryPath = await getBinaryPath(options.binaryOptions || {});
|
|
1595
1595
|
const filteredOptions = { ...options };
|
|
@@ -5912,6 +5912,27 @@ var init_zod = __esm({
|
|
|
5912
5912
|
});
|
|
5913
5913
|
|
|
5914
5914
|
// src/tools/common.js
|
|
5915
|
+
function getValidParamsForTool(toolName) {
|
|
5916
|
+
const schemaMap = {
|
|
5917
|
+
search: searchSchema,
|
|
5918
|
+
query: querySchema,
|
|
5919
|
+
extract: extractSchema,
|
|
5920
|
+
delegate: delegateSchema,
|
|
5921
|
+
bash: bashSchema,
|
|
5922
|
+
attempt_completion: attemptCompletionSchema
|
|
5923
|
+
};
|
|
5924
|
+
const schema = schemaMap[toolName];
|
|
5925
|
+
if (!schema) {
|
|
5926
|
+
return ["path", "directory", "pattern", "recursive", "includeHidden", "task", "files", "autoCommits", "result"];
|
|
5927
|
+
}
|
|
5928
|
+
if (toolName === "attempt_completion") {
|
|
5929
|
+
return ["result"];
|
|
5930
|
+
}
|
|
5931
|
+
if (schema && schema._def && schema._def.shape) {
|
|
5932
|
+
return Object.keys(schema._def.shape());
|
|
5933
|
+
}
|
|
5934
|
+
return [];
|
|
5935
|
+
}
|
|
5915
5936
|
function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
|
|
5916
5937
|
for (const toolName of validTools) {
|
|
5917
5938
|
const openTag = `<${toolName}>`;
|
|
@@ -5930,35 +5951,8 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
|
|
|
5930
5951
|
closeIndex
|
|
5931
5952
|
);
|
|
5932
5953
|
const params = {};
|
|
5933
|
-
const
|
|
5934
|
-
|
|
5935
|
-
"file_path",
|
|
5936
|
-
"line",
|
|
5937
|
-
"end_line",
|
|
5938
|
-
"path",
|
|
5939
|
-
"recursive",
|
|
5940
|
-
"includeHidden",
|
|
5941
|
-
"max_results",
|
|
5942
|
-
"maxResults",
|
|
5943
|
-
"result",
|
|
5944
|
-
"command",
|
|
5945
|
-
"description",
|
|
5946
|
-
"task",
|
|
5947
|
-
"param",
|
|
5948
|
-
"pattern",
|
|
5949
|
-
"allow_tests",
|
|
5950
|
-
"exact",
|
|
5951
|
-
"maxTokens",
|
|
5952
|
-
"language",
|
|
5953
|
-
"input_content",
|
|
5954
|
-
"context_lines",
|
|
5955
|
-
"format",
|
|
5956
|
-
"directory",
|
|
5957
|
-
"autoCommits",
|
|
5958
|
-
"files",
|
|
5959
|
-
"targets"
|
|
5960
|
-
];
|
|
5961
|
-
for (const paramName of commonParams3) {
|
|
5954
|
+
const validParams = getValidParamsForTool(toolName);
|
|
5955
|
+
for (const paramName of validParams) {
|
|
5962
5956
|
const paramOpenTag = `<${paramName}>`;
|
|
5963
5957
|
const paramCloseTag = `</${paramName}>`;
|
|
5964
5958
|
const paramOpenIndex = innerContent.indexOf(paramOpenTag);
|
|
@@ -5968,7 +5962,7 @@ function parseXmlToolCall(xmlString, validTools = DEFAULT_VALID_TOOLS) {
|
|
|
5968
5962
|
let paramCloseIndex = innerContent.indexOf(paramCloseTag, paramOpenIndex + paramOpenTag.length);
|
|
5969
5963
|
if (paramCloseIndex === -1) {
|
|
5970
5964
|
let nextTagIndex = innerContent.length;
|
|
5971
|
-
for (const nextParam of
|
|
5965
|
+
for (const nextParam of validParams) {
|
|
5972
5966
|
const nextOpenTag = `<${nextParam}>`;
|
|
5973
5967
|
const nextIndex = innerContent.indexOf(nextOpenTag, paramOpenIndex + paramOpenTag.length);
|
|
5974
5968
|
if (nextIndex !== -1 && nextIndex < nextTagIndex) {
|
|
@@ -6030,13 +6024,8 @@ var init_common = __esm({
|
|
|
6030
6024
|
"use strict";
|
|
6031
6025
|
init_zod();
|
|
6032
6026
|
searchSchema = external_exports.object({
|
|
6033
|
-
query: external_exports.string().describe("Search query with Elasticsearch syntax. Use
|
|
6034
|
-
path: external_exports.string().optional().default(".").describe('Path to search in. For dependencies use "go:github.com/owner/repo", "js:package_name", or "rust:cargo_name" etc.')
|
|
6035
|
-
allow_tests: external_exports.boolean().optional().default(false).describe("Allow test files in search results"),
|
|
6036
|
-
exact: external_exports.boolean().optional().default(false).describe("Perform exact search without tokenization (case-insensitive)"),
|
|
6037
|
-
maxResults: external_exports.number().optional().describe("Maximum number of results to return"),
|
|
6038
|
-
maxTokens: external_exports.number().optional().default(1e4).describe("Maximum number of tokens to return"),
|
|
6039
|
-
language: external_exports.string().optional().describe("Limit search to files of a specific programming language")
|
|
6027
|
+
query: external_exports.string().describe("Search query with Elasticsearch syntax. Use quotes for exact matches, AND/OR for boolean logic, - for negation."),
|
|
6028
|
+
path: external_exports.string().optional().default(".").describe('Path to search in. For dependencies use "go:github.com/owner/repo", "js:package_name", or "rust:cargo_name" etc.')
|
|
6040
6029
|
});
|
|
6041
6030
|
querySchema = external_exports.object({
|
|
6042
6031
|
pattern: external_exports.string().describe("AST pattern to search for. Use $NAME for variable names, $$$PARAMS for parameter lists, etc."),
|
|
@@ -6045,13 +6034,8 @@ var init_common = __esm({
|
|
|
6045
6034
|
allow_tests: external_exports.boolean().optional().default(false).describe("Allow test files in search results")
|
|
6046
6035
|
});
|
|
6047
6036
|
extractSchema = external_exports.object({
|
|
6048
|
-
targets: external_exports.string().optional().describe(
|
|
6049
|
-
input_content: external_exports.string().optional().describe("Text content to extract file paths from")
|
|
6050
|
-
line: external_exports.number().optional().describe("Start line number to extract a specific code block"),
|
|
6051
|
-
end_line: external_exports.number().optional().describe("End line number for extracting a range of lines"),
|
|
6052
|
-
allow_tests: external_exports.boolean().optional().default(false).describe("Allow test files and test code blocks"),
|
|
6053
|
-
context_lines: external_exports.number().optional().default(10).describe("Number of context lines to include"),
|
|
6054
|
-
format: external_exports.string().optional().default("plain").describe("Output format (plain, markdown, json, xml, color, outline-xml, outline-diff)")
|
|
6037
|
+
targets: external_exports.string().optional().describe('File paths or symbols to extract from. Formats: "file.js" (whole file), "file.js:42" (line 42), "file.js:10-20" (lines 10-20), "file.js#funcName" (symbol). Multiple targets separated by spaces.'),
|
|
6038
|
+
input_content: external_exports.string().optional().describe("Text content to extract file paths from (alternative to targets)")
|
|
6055
6039
|
});
|
|
6056
6040
|
delegateSchema = external_exports.object({
|
|
6057
6041
|
task: external_exports.string().describe("The task to delegate to a subagent. Be specific about what needs to be accomplished.")
|
|
@@ -6126,13 +6110,8 @@ You need to focus on main keywords when constructing the query, and always use e
|
|
|
6126
6110
|
- Once data is returned, it's cached and won't return on next runs (this is expected behavior)
|
|
6127
6111
|
|
|
6128
6112
|
Parameters:
|
|
6129
|
-
- query: (required) Search query with Elasticsearch syntax.
|
|
6130
|
-
- path: (
|
|
6131
|
-
- allow_tests: (optional, default: false) Allow test files in search results (true/false).
|
|
6132
|
-
- exact: (optional, default: false) Perform exact pricise search. Use it when you already know function or struct name, or some other code block, and want exact match.
|
|
6133
|
-
- maxResults: (optional) Maximum number of results to return (number).
|
|
6134
|
-
- maxTokens: (optional, default: 10000) Maximum number of tokens to return (number).
|
|
6135
|
-
- language: (optional) Limit search to files of a specific programming language (e.g., 'rust', 'js', 'python', 'go' etc.).
|
|
6113
|
+
- query: (required) Search query with Elasticsearch syntax. Use quotes for exact matches ("functionName"), AND/OR for boolean logic, - for negation, + for important terms.
|
|
6114
|
+
- path: (optional, default: '.') Path to search in. All dependencies located in /dep folder, under language sub folders, like this: "/dep/go/github.com/owner/repo", "/dep/js/package_name", or "/dep/rust/cargo_name" etc.
|
|
6136
6115
|
|
|
6137
6116
|
**Workflow:** Always start with search, then use extract for detailed context when needed.
|
|
6138
6117
|
|
|
@@ -6154,30 +6133,24 @@ User: How to calculate the total amount in the payments module?
|
|
|
6154
6133
|
<search>
|
|
6155
6134
|
<query>calculate AND payment</query>
|
|
6156
6135
|
<path>src/utils</path>
|
|
6157
|
-
<allow_tests>false</allow_tests>
|
|
6158
6136
|
</search>
|
|
6159
6137
|
|
|
6160
6138
|
User: How do the user authentication and authorization work?
|
|
6161
6139
|
<search>
|
|
6162
|
-
<query>+user
|
|
6140
|
+
<query>+user AND (authentication OR authorization OR authz)</query>
|
|
6163
6141
|
<path>.</path>
|
|
6164
|
-
<allow_tests>true</allow_tests>
|
|
6165
|
-
<language>go</language>
|
|
6166
6142
|
</search>
|
|
6167
6143
|
|
|
6168
6144
|
User: Find all react imports in the project.
|
|
6169
6145
|
<search>
|
|
6170
|
-
<query>import
|
|
6146
|
+
<query>"import" AND "react"</query>
|
|
6171
6147
|
<path>.</path>
|
|
6172
|
-
<exact>true</exact>
|
|
6173
|
-
<language>js</language>
|
|
6174
6148
|
</search>
|
|
6175
6149
|
|
|
6176
|
-
User: Find how
|
|
6150
|
+
User: Find how decompound library works?
|
|
6177
6151
|
<search>
|
|
6178
|
-
<query>
|
|
6152
|
+
<query>decompound</query>
|
|
6179
6153
|
<path>/dep/rust/decompound</path>
|
|
6180
|
-
<language>rust</language>
|
|
6181
6154
|
</search>
|
|
6182
6155
|
|
|
6183
6156
|
</examples>
|
|
@@ -6212,11 +6185,9 @@ Full file extraction should be the LAST RESORT! Always prefer search.
|
|
|
6212
6185
|
**Session Awareness:** Reuse context from previous tool calls. Don't re-extract the same symbols you already have.
|
|
6213
6186
|
|
|
6214
6187
|
Parameters:
|
|
6215
|
-
- targets: (required) File paths or symbols to extract from.
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
- end_line: (optional) End line number for extracting a range of lines.
|
|
6219
|
-
- allow_tests: (optional, default: false) Allow test files and test code blocks (true/false).
|
|
6188
|
+
- targets: (required) File paths or symbols to extract from. Formats: "file.js" (whole file), "file.js:42" (code block at line 42), "file.js:10-20" (lines 10-20), "file.js#funcName" (specific symbol). Multiple targets separated by spaces.
|
|
6189
|
+
- input_content: (optional) Text content to extract file paths from (alternative to targets for processing diffs/logs).
|
|
6190
|
+
|
|
6220
6191
|
Usage Example:
|
|
6221
6192
|
|
|
6222
6193
|
<examples>
|
|
@@ -6243,9 +6214,7 @@ User: Lets read the whole file
|
|
|
6243
6214
|
|
|
6244
6215
|
User: Read the first 10 lines of the file
|
|
6245
6216
|
<extract>
|
|
6246
|
-
<targets>src/search/ranking.rs</targets>
|
|
6247
|
-
<line>1</line>
|
|
6248
|
-
<end_line>10</end_line>
|
|
6217
|
+
<targets>src/search/ranking.rs:1-10</targets>
|
|
6249
6218
|
</extract>
|
|
6250
6219
|
|
|
6251
6220
|
User: Read file inside the dependency
|
|
@@ -8935,11 +8904,11 @@ var require_dist_cjs3 = __commonJS({
|
|
|
8935
8904
|
eventStreamPayloadHandler
|
|
8936
8905
|
});
|
|
8937
8906
|
}
|
|
8938
|
-
var eventStreamHandlingMiddleware = (options) => (next,
|
|
8907
|
+
var eventStreamHandlingMiddleware = (options) => (next, context) => async (args) => {
|
|
8939
8908
|
const { request } = args;
|
|
8940
8909
|
if (!protocolHttp.HttpRequest.isInstance(request))
|
|
8941
8910
|
return next(args);
|
|
8942
|
-
return options.eventStreamPayloadHandler.handle(next, args,
|
|
8911
|
+
return options.eventStreamPayloadHandler.handle(next, args, context);
|
|
8943
8912
|
};
|
|
8944
8913
|
var eventStreamHandlingMiddlewareOptions = {
|
|
8945
8914
|
tags: ["EVENT_STREAM", "SIGNATURE", "HANDLE"],
|
|
@@ -9030,13 +8999,13 @@ var require_dist_cjs4 = __commonJS({
|
|
|
9030
8999
|
var require_dist_cjs5 = __commonJS({
|
|
9031
9000
|
"node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js"(exports2) {
|
|
9032
9001
|
"use strict";
|
|
9033
|
-
var loggerMiddleware = () => (next,
|
|
9002
|
+
var loggerMiddleware = () => (next, context) => async (args) => {
|
|
9034
9003
|
try {
|
|
9035
9004
|
const response = await next(args);
|
|
9036
|
-
const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } =
|
|
9005
|
+
const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context;
|
|
9037
9006
|
const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
9038
|
-
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ??
|
|
9039
|
-
const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ??
|
|
9007
|
+
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
9008
|
+
const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
|
|
9040
9009
|
const { $metadata, ...outputWithoutMetadata } = response.output;
|
|
9041
9010
|
logger2?.info?.({
|
|
9042
9011
|
clientName,
|
|
@@ -9047,9 +9016,9 @@ var require_dist_cjs5 = __commonJS({
|
|
|
9047
9016
|
});
|
|
9048
9017
|
return response;
|
|
9049
9018
|
} catch (error2) {
|
|
9050
|
-
const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } =
|
|
9019
|
+
const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context;
|
|
9051
9020
|
const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
9052
|
-
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ??
|
|
9021
|
+
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
9053
9022
|
logger2?.error?.({
|
|
9054
9023
|
clientName,
|
|
9055
9024
|
commandName,
|
|
@@ -9099,8 +9068,8 @@ var require_invoke_store = __commonJS({
|
|
|
9099
9068
|
/**
|
|
9100
9069
|
* Initialize and run code within an invoke context
|
|
9101
9070
|
*/
|
|
9102
|
-
static run(
|
|
9103
|
-
return this.storage.run({ ...
|
|
9071
|
+
static run(context, fn) {
|
|
9072
|
+
return this.storage.run({ ...context }, fn);
|
|
9104
9073
|
}
|
|
9105
9074
|
/**
|
|
9106
9075
|
* Get the complete current context
|
|
@@ -9112,8 +9081,8 @@ var require_invoke_store = __commonJS({
|
|
|
9112
9081
|
* Get a specific value from the context by key
|
|
9113
9082
|
*/
|
|
9114
9083
|
static get(key) {
|
|
9115
|
-
const
|
|
9116
|
-
return
|
|
9084
|
+
const context = this.storage.getStore();
|
|
9085
|
+
return context?.[key];
|
|
9117
9086
|
}
|
|
9118
9087
|
/**
|
|
9119
9088
|
* Set a custom value in the current context
|
|
@@ -9123,9 +9092,9 @@ var require_invoke_store = __commonJS({
|
|
|
9123
9092
|
if (this.isProtectedKey(key)) {
|
|
9124
9093
|
throw new Error(`Cannot modify protected Lambda context field`);
|
|
9125
9094
|
}
|
|
9126
|
-
const
|
|
9127
|
-
if (
|
|
9128
|
-
|
|
9095
|
+
const context = this.storage.getStore();
|
|
9096
|
+
if (context) {
|
|
9097
|
+
context[key] = value;
|
|
9129
9098
|
}
|
|
9130
9099
|
}
|
|
9131
9100
|
/**
|
|
@@ -9237,7 +9206,7 @@ var import_types, getSmithyContext;
|
|
|
9237
9206
|
var init_getSmithyContext = __esm({
|
|
9238
9207
|
"node_modules/@smithy/core/dist-es/getSmithyContext.js"() {
|
|
9239
9208
|
import_types = __toESM(require_dist_cjs());
|
|
9240
|
-
getSmithyContext = (
|
|
9209
|
+
getSmithyContext = (context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {});
|
|
9241
9210
|
}
|
|
9242
9211
|
});
|
|
9243
9212
|
|
|
@@ -9246,7 +9215,7 @@ var require_dist_cjs7 = __commonJS({
|
|
|
9246
9215
|
"node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports2) {
|
|
9247
9216
|
"use strict";
|
|
9248
9217
|
var types2 = require_dist_cjs();
|
|
9249
|
-
var getSmithyContext9 = (
|
|
9218
|
+
var getSmithyContext9 = (context) => context[types2.SMITHY_CONTEXT_KEY] || (context[types2.SMITHY_CONTEXT_KEY] = {});
|
|
9250
9219
|
var normalizeProvider4 = (input) => {
|
|
9251
9220
|
if (typeof input === "function")
|
|
9252
9221
|
return input;
|
|
@@ -9298,12 +9267,12 @@ var init_httpAuthSchemeMiddleware = __esm({
|
|
|
9298
9267
|
"node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() {
|
|
9299
9268
|
import_util_middleware = __toESM(require_dist_cjs7());
|
|
9300
9269
|
init_resolveAuthOptions();
|
|
9301
|
-
httpAuthSchemeMiddleware = (config, mwOptions) => (next,
|
|
9302
|
-
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config,
|
|
9270
|
+
httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
|
|
9271
|
+
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
|
|
9303
9272
|
const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
|
|
9304
9273
|
const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
|
|
9305
9274
|
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
|
9306
|
-
const smithyContext = (0, import_util_middleware.getSmithyContext)(
|
|
9275
|
+
const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
|
|
9307
9276
|
const failureReasons = [];
|
|
9308
9277
|
for (const option of resolvedOptions) {
|
|
9309
9278
|
const scheme = authSchemes.get(option.schemeId);
|
|
@@ -9316,7 +9285,7 @@ var init_httpAuthSchemeMiddleware = __esm({
|
|
|
9316
9285
|
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
|
9317
9286
|
continue;
|
|
9318
9287
|
}
|
|
9319
|
-
const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config,
|
|
9288
|
+
const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
|
|
9320
9289
|
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
|
9321
9290
|
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
|
9322
9291
|
smithyContext.selectedHttpAuthScheme = {
|
|
@@ -9363,7 +9332,7 @@ var require_dist_cjs8 = __commonJS({
|
|
|
9363
9332
|
"node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports2) {
|
|
9364
9333
|
"use strict";
|
|
9365
9334
|
var protocolHttp = require_dist_cjs2();
|
|
9366
|
-
var deserializerMiddleware = (options, deserializer) => (next,
|
|
9335
|
+
var deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
|
|
9367
9336
|
const { response } = await next(args);
|
|
9368
9337
|
try {
|
|
9369
9338
|
const parsed = await deserializer(response, options);
|
|
@@ -9380,10 +9349,10 @@ var require_dist_cjs8 = __commonJS({
|
|
|
9380
9349
|
try {
|
|
9381
9350
|
error2.message += "\n " + hint;
|
|
9382
9351
|
} catch (e3) {
|
|
9383
|
-
if (!
|
|
9352
|
+
if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
|
|
9384
9353
|
console.warn(hint);
|
|
9385
9354
|
} else {
|
|
9386
|
-
|
|
9355
|
+
context.logger?.warn?.(hint);
|
|
9387
9356
|
}
|
|
9388
9357
|
}
|
|
9389
9358
|
if (typeof error2.$responseBodyText !== "undefined") {
|
|
@@ -9413,9 +9382,9 @@ var require_dist_cjs8 = __commonJS({
|
|
|
9413
9382
|
return k3.match(pattern);
|
|
9414
9383
|
}) || [void 0, void 0])[1];
|
|
9415
9384
|
};
|
|
9416
|
-
var serializerMiddleware = (options, serializer) => (next,
|
|
9385
|
+
var serializerMiddleware = (options, serializer) => (next, context) => async (args) => {
|
|
9417
9386
|
const endpointConfig = options;
|
|
9418
|
-
const endpoint =
|
|
9387
|
+
const endpoint = context.endpointV2?.url && endpointConfig.urlParser ? async () => endpointConfig.urlParser(context.endpointV2.url) : endpointConfig.endpoint;
|
|
9419
9388
|
if (!endpoint) {
|
|
9420
9389
|
throw new Error("No valid endpoint provider available.");
|
|
9421
9390
|
}
|
|
@@ -9498,11 +9467,11 @@ var init_httpSigningMiddleware = __esm({
|
|
|
9498
9467
|
};
|
|
9499
9468
|
defaultSuccessHandler = (httpResponse, signingProperties) => {
|
|
9500
9469
|
};
|
|
9501
|
-
httpSigningMiddleware = (config) => (next,
|
|
9470
|
+
httpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
9502
9471
|
if (!import_protocol_http.HttpRequest.isInstance(args.request)) {
|
|
9503
9472
|
return next(args);
|
|
9504
9473
|
}
|
|
9505
|
-
const smithyContext = (0, import_util_middleware2.getSmithyContext)(
|
|
9474
|
+
const smithyContext = (0, import_util_middleware2.getSmithyContext)(context);
|
|
9506
9475
|
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
9507
9476
|
if (!scheme) {
|
|
9508
9477
|
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
@@ -11489,14 +11458,14 @@ var import_util_stream, collectBody;
|
|
|
11489
11458
|
var init_collect_stream_body = __esm({
|
|
11490
11459
|
"node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() {
|
|
11491
11460
|
import_util_stream = __toESM(require_dist_cjs18());
|
|
11492
|
-
collectBody = async (streamBody = new Uint8Array(),
|
|
11461
|
+
collectBody = async (streamBody = new Uint8Array(), context) => {
|
|
11493
11462
|
if (streamBody instanceof Uint8Array) {
|
|
11494
11463
|
return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody);
|
|
11495
11464
|
}
|
|
11496
11465
|
if (!streamBody) {
|
|
11497
11466
|
return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array());
|
|
11498
11467
|
}
|
|
11499
|
-
const fromContext =
|
|
11468
|
+
const fromContext = context.streamCollector(streamBody);
|
|
11500
11469
|
return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext);
|
|
11501
11470
|
};
|
|
11502
11471
|
}
|
|
@@ -11547,14 +11516,14 @@ var init_schemaDeserializationMiddleware = __esm({
|
|
|
11547
11516
|
import_protocol_http2 = __toESM(require_dist_cjs2());
|
|
11548
11517
|
import_util_middleware3 = __toESM(require_dist_cjs7());
|
|
11549
11518
|
init_operation();
|
|
11550
|
-
schemaDeserializationMiddleware = (config) => (next,
|
|
11519
|
+
schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
|
|
11551
11520
|
const { response } = await next(args);
|
|
11552
|
-
const { operationSchema } = (0, import_util_middleware3.getSmithyContext)(
|
|
11521
|
+
const { operationSchema } = (0, import_util_middleware3.getSmithyContext)(context);
|
|
11553
11522
|
const [, ns, n3, t3, i3, o3] = operationSchema ?? [];
|
|
11554
11523
|
try {
|
|
11555
11524
|
const parsed = await config.protocol.deserializeResponse(operation(ns, n3, t3, i3, o3), {
|
|
11556
11525
|
...config,
|
|
11557
|
-
...
|
|
11526
|
+
...context
|
|
11558
11527
|
}, response);
|
|
11559
11528
|
return {
|
|
11560
11529
|
response,
|
|
@@ -11569,10 +11538,10 @@ var init_schemaDeserializationMiddleware = __esm({
|
|
|
11569
11538
|
try {
|
|
11570
11539
|
error2.message += "\n " + hint;
|
|
11571
11540
|
} catch (e3) {
|
|
11572
|
-
if (!
|
|
11541
|
+
if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
|
|
11573
11542
|
console.warn(hint);
|
|
11574
11543
|
} else {
|
|
11575
|
-
|
|
11544
|
+
context.logger?.warn?.(hint);
|
|
11576
11545
|
}
|
|
11577
11546
|
}
|
|
11578
11547
|
if (typeof error2.$responseBodyText !== "undefined") {
|
|
@@ -11611,13 +11580,13 @@ var init_schemaSerializationMiddleware = __esm({
|
|
|
11611
11580
|
"node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js"() {
|
|
11612
11581
|
import_util_middleware4 = __toESM(require_dist_cjs7());
|
|
11613
11582
|
init_operation();
|
|
11614
|
-
schemaSerializationMiddleware = (config) => (next,
|
|
11615
|
-
const { operationSchema } = (0, import_util_middleware4.getSmithyContext)(
|
|
11583
|
+
schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
|
|
11584
|
+
const { operationSchema } = (0, import_util_middleware4.getSmithyContext)(context);
|
|
11616
11585
|
const [, ns, n3, t3, i3, o3] = operationSchema ?? [];
|
|
11617
|
-
const endpoint =
|
|
11586
|
+
const endpoint = context.endpointV2?.url && config.urlParser ? async () => config.urlParser(context.endpointV2.url) : config.endpoint;
|
|
11618
11587
|
const request = await config.protocol.serializeRequest(operation(ns, n3, t3, i3, o3), args.input, {
|
|
11619
11588
|
...config,
|
|
11620
|
-
...
|
|
11589
|
+
...context,
|
|
11621
11590
|
endpoint
|
|
11622
11591
|
});
|
|
11623
11592
|
return next({
|
|
@@ -12743,14 +12712,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
12743
12712
|
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
12744
12713
|
var _2, done = false;
|
|
12745
12714
|
for (var i3 = decorators.length - 1; i3 >= 0; i3--) {
|
|
12746
|
-
var
|
|
12747
|
-
for (var p3 in contextIn)
|
|
12748
|
-
for (var p3 in contextIn.access)
|
|
12749
|
-
|
|
12715
|
+
var context = {};
|
|
12716
|
+
for (var p3 in contextIn) context[p3] = p3 === "access" ? {} : contextIn[p3];
|
|
12717
|
+
for (var p3 in contextIn.access) context.access[p3] = contextIn.access[p3];
|
|
12718
|
+
context.addInitializer = function(f3) {
|
|
12750
12719
|
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
12751
12720
|
extraInitializers.push(accept(f3 || null));
|
|
12752
12721
|
};
|
|
12753
|
-
var result = (0, decorators[i3])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key],
|
|
12722
|
+
var result = (0, decorators[i3])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
12754
12723
|
if (kind === "accessor") {
|
|
12755
12724
|
if (result === void 0) continue;
|
|
12756
12725
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
@@ -13887,20 +13856,20 @@ var init_HttpProtocol = __esm({
|
|
|
13887
13856
|
getDefaultContentType() {
|
|
13888
13857
|
throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
|
|
13889
13858
|
}
|
|
13890
|
-
async deserializeHttpMessage(schema,
|
|
13859
|
+
async deserializeHttpMessage(schema, context, response, arg4, arg5) {
|
|
13891
13860
|
void schema;
|
|
13892
|
-
void
|
|
13861
|
+
void context;
|
|
13893
13862
|
void response;
|
|
13894
13863
|
void arg4;
|
|
13895
13864
|
void arg5;
|
|
13896
13865
|
return [];
|
|
13897
13866
|
}
|
|
13898
13867
|
getEventStreamMarshaller() {
|
|
13899
|
-
const
|
|
13900
|
-
if (!
|
|
13868
|
+
const context = this.serdeContext;
|
|
13869
|
+
if (!context.eventStreamMarshaller) {
|
|
13901
13870
|
throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
|
|
13902
13871
|
}
|
|
13903
|
-
return
|
|
13872
|
+
return context.eventStreamMarshaller;
|
|
13904
13873
|
}
|
|
13905
13874
|
};
|
|
13906
13875
|
}
|
|
@@ -13918,14 +13887,14 @@ var init_HttpBindingProtocol = __esm({
|
|
|
13918
13887
|
init_extended_encode_uri_component();
|
|
13919
13888
|
init_HttpProtocol();
|
|
13920
13889
|
HttpBindingProtocol = class extends HttpProtocol {
|
|
13921
|
-
async serializeRequest(operationSchema, _input,
|
|
13890
|
+
async serializeRequest(operationSchema, _input, context) {
|
|
13922
13891
|
const input = {
|
|
13923
13892
|
..._input ?? {}
|
|
13924
13893
|
};
|
|
13925
13894
|
const serializer = this.serializer;
|
|
13926
13895
|
const query2 = {};
|
|
13927
13896
|
const headers = {};
|
|
13928
|
-
const endpoint = await
|
|
13897
|
+
const endpoint = await context.endpoint();
|
|
13929
13898
|
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
13930
13899
|
const schema = ns.getSchema();
|
|
13931
13900
|
let hasNonHttpBindingMember = false;
|
|
@@ -14050,16 +14019,16 @@ var init_HttpBindingProtocol = __esm({
|
|
|
14050
14019
|
query2[traits.httpQuery] = serializer.flush();
|
|
14051
14020
|
}
|
|
14052
14021
|
}
|
|
14053
|
-
async deserializeResponse(operationSchema,
|
|
14022
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
14054
14023
|
const deserializer = this.deserializer;
|
|
14055
14024
|
const ns = NormalizedSchema.of(operationSchema.output);
|
|
14056
14025
|
const dataObject = {};
|
|
14057
14026
|
if (response.statusCode >= 300) {
|
|
14058
|
-
const bytes = await collectBody(response.body,
|
|
14027
|
+
const bytes = await collectBody(response.body, context);
|
|
14059
14028
|
if (bytes.byteLength > 0) {
|
|
14060
14029
|
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
14061
14030
|
}
|
|
14062
|
-
await this.handleError(operationSchema,
|
|
14031
|
+
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
14063
14032
|
throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
|
|
14064
14033
|
}
|
|
14065
14034
|
for (const header in response.headers) {
|
|
@@ -14067,9 +14036,9 @@ var init_HttpBindingProtocol = __esm({
|
|
|
14067
14036
|
delete response.headers[header];
|
|
14068
14037
|
response.headers[header.toLowerCase()] = value;
|
|
14069
14038
|
}
|
|
14070
|
-
const nonHttpBindingMembers = await this.deserializeHttpMessage(ns,
|
|
14039
|
+
const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);
|
|
14071
14040
|
if (nonHttpBindingMembers.length) {
|
|
14072
|
-
const bytes = await collectBody(response.body,
|
|
14041
|
+
const bytes = await collectBody(response.body, context);
|
|
14073
14042
|
if (bytes.byteLength > 0) {
|
|
14074
14043
|
const dataFromBody = await deserializer.read(ns, bytes);
|
|
14075
14044
|
for (const member2 of nonHttpBindingMembers) {
|
|
@@ -14080,7 +14049,7 @@ var init_HttpBindingProtocol = __esm({
|
|
|
14080
14049
|
dataObject.$metadata = this.deserializeMetadata(response);
|
|
14081
14050
|
return dataObject;
|
|
14082
14051
|
}
|
|
14083
|
-
async deserializeHttpMessage(schema,
|
|
14052
|
+
async deserializeHttpMessage(schema, context, response, arg4, arg5) {
|
|
14084
14053
|
let dataObject;
|
|
14085
14054
|
if (arg4 instanceof Set) {
|
|
14086
14055
|
dataObject = arg5;
|
|
@@ -14105,7 +14074,7 @@ var init_HttpBindingProtocol = __esm({
|
|
|
14105
14074
|
dataObject[memberName] = (0, import_util_stream2.sdkStreamMixin)(response.body);
|
|
14106
14075
|
}
|
|
14107
14076
|
} else if (response.body) {
|
|
14108
|
-
const bytes = await collectBody(response.body,
|
|
14077
|
+
const bytes = await collectBody(response.body, context);
|
|
14109
14078
|
if (bytes.byteLength > 0) {
|
|
14110
14079
|
dataObject[memberName] = await deserializer.read(memberSchema, bytes);
|
|
14111
14080
|
}
|
|
@@ -14162,11 +14131,11 @@ var init_RpcProtocol = __esm({
|
|
|
14162
14131
|
init_collect_stream_body();
|
|
14163
14132
|
init_HttpProtocol();
|
|
14164
14133
|
RpcProtocol = class extends HttpProtocol {
|
|
14165
|
-
async serializeRequest(operationSchema, input,
|
|
14134
|
+
async serializeRequest(operationSchema, input, context) {
|
|
14166
14135
|
const serializer = this.serializer;
|
|
14167
14136
|
const query2 = {};
|
|
14168
14137
|
const headers = {};
|
|
14169
|
-
const endpoint = await
|
|
14138
|
+
const endpoint = await context.endpoint();
|
|
14170
14139
|
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
14171
14140
|
const schema = ns.getSchema();
|
|
14172
14141
|
let payload2;
|
|
@@ -14215,16 +14184,16 @@ var init_RpcProtocol = __esm({
|
|
|
14215
14184
|
request.method = "POST";
|
|
14216
14185
|
return request;
|
|
14217
14186
|
}
|
|
14218
|
-
async deserializeResponse(operationSchema,
|
|
14187
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
14219
14188
|
const deserializer = this.deserializer;
|
|
14220
14189
|
const ns = NormalizedSchema.of(operationSchema.output);
|
|
14221
14190
|
const dataObject = {};
|
|
14222
14191
|
if (response.statusCode >= 300) {
|
|
14223
|
-
const bytes = await collectBody(response.body,
|
|
14192
|
+
const bytes = await collectBody(response.body, context);
|
|
14224
14193
|
if (bytes.byteLength > 0) {
|
|
14225
14194
|
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
14226
14195
|
}
|
|
14227
|
-
await this.handleError(operationSchema,
|
|
14196
|
+
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
14228
14197
|
throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
|
|
14229
14198
|
}
|
|
14230
14199
|
for (const header in response.headers) {
|
|
@@ -14240,7 +14209,7 @@ var init_RpcProtocol = __esm({
|
|
|
14240
14209
|
initialResponseContainer: dataObject
|
|
14241
14210
|
});
|
|
14242
14211
|
} else {
|
|
14243
|
-
const bytes = await collectBody(response.body,
|
|
14212
|
+
const bytes = await collectBody(response.body, context);
|
|
14244
14213
|
if (bytes.byteLength > 0) {
|
|
14245
14214
|
Object.assign(dataObject, await deserializer.read(ns, bytes));
|
|
14246
14215
|
}
|
|
@@ -14273,8 +14242,8 @@ var init_resolve_path = __esm({
|
|
|
14273
14242
|
});
|
|
14274
14243
|
|
|
14275
14244
|
// node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js
|
|
14276
|
-
function requestBuilder(input,
|
|
14277
|
-
return new RequestBuilder(input,
|
|
14245
|
+
function requestBuilder(input, context) {
|
|
14246
|
+
return new RequestBuilder(input, context);
|
|
14278
14247
|
}
|
|
14279
14248
|
var import_protocol_http6, RequestBuilder;
|
|
14280
14249
|
var init_requestBuilder = __esm({
|
|
@@ -14291,9 +14260,9 @@ var init_requestBuilder = __esm({
|
|
|
14291
14260
|
body = null;
|
|
14292
14261
|
hostname = "";
|
|
14293
14262
|
resolvePathStack = [];
|
|
14294
|
-
constructor(input,
|
|
14263
|
+
constructor(input, context) {
|
|
14295
14264
|
this.input = input;
|
|
14296
|
-
this.context =
|
|
14265
|
+
this.context = context;
|
|
14297
14266
|
}
|
|
14298
14267
|
async build() {
|
|
14299
14268
|
const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
|
|
@@ -14662,15 +14631,15 @@ var init_requestBuilder2 = __esm({
|
|
|
14662
14631
|
});
|
|
14663
14632
|
|
|
14664
14633
|
// node_modules/@smithy/core/dist-es/setFeature.js
|
|
14665
|
-
function setFeature(
|
|
14666
|
-
if (!
|
|
14667
|
-
|
|
14634
|
+
function setFeature(context, feature, value) {
|
|
14635
|
+
if (!context.__smithy_context) {
|
|
14636
|
+
context.__smithy_context = {
|
|
14668
14637
|
features: {}
|
|
14669
14638
|
};
|
|
14670
|
-
} else if (!
|
|
14671
|
-
|
|
14639
|
+
} else if (!context.__smithy_context.features) {
|
|
14640
|
+
context.__smithy_context.features = {};
|
|
14672
14641
|
}
|
|
14673
|
-
|
|
14642
|
+
context.__smithy_context.features[feature] = value;
|
|
14674
14643
|
}
|
|
14675
14644
|
var init_setFeature = __esm({
|
|
14676
14645
|
"node_modules/@smithy/core/dist-es/setFeature.js"() {
|
|
@@ -15813,15 +15782,15 @@ var init_setCredentialFeature = __esm({
|
|
|
15813
15782
|
});
|
|
15814
15783
|
|
|
15815
15784
|
// node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
|
|
15816
|
-
function setFeature2(
|
|
15817
|
-
if (!
|
|
15818
|
-
|
|
15785
|
+
function setFeature2(context, feature, value) {
|
|
15786
|
+
if (!context.__aws_sdk_context) {
|
|
15787
|
+
context.__aws_sdk_context = {
|
|
15819
15788
|
features: {}
|
|
15820
15789
|
};
|
|
15821
|
-
} else if (!
|
|
15822
|
-
|
|
15790
|
+
} else if (!context.__aws_sdk_context.features) {
|
|
15791
|
+
context.__aws_sdk_context.features = {};
|
|
15823
15792
|
}
|
|
15824
|
-
|
|
15793
|
+
context.__aws_sdk_context.features[feature] = value;
|
|
15825
15794
|
}
|
|
15826
15795
|
var init_setFeature2 = __esm({
|
|
15827
15796
|
"node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() {
|
|
@@ -15922,9 +15891,9 @@ var init_AwsSdkSigV4Signer = __esm({
|
|
|
15922
15891
|
return property2;
|
|
15923
15892
|
};
|
|
15924
15893
|
validateSigningProperties = async (signingProperties) => {
|
|
15925
|
-
const
|
|
15894
|
+
const context = throwSigningPropertyError("context", signingProperties.context);
|
|
15926
15895
|
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
15927
|
-
const authScheme =
|
|
15896
|
+
const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
|
|
15928
15897
|
const signerFunction = throwSigningPropertyError("signer", config.signer);
|
|
15929
15898
|
const signer = await signerFunction(authScheme);
|
|
15930
15899
|
const signingRegion = signingProperties?.signingRegion;
|
|
@@ -17782,8 +17751,8 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
17782
17751
|
getPayloadCodec() {
|
|
17783
17752
|
return this.codec;
|
|
17784
17753
|
}
|
|
17785
|
-
async serializeRequest(operationSchema, input,
|
|
17786
|
-
const request = await super.serializeRequest(operationSchema, input,
|
|
17754
|
+
async serializeRequest(operationSchema, input, context) {
|
|
17755
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
17787
17756
|
Object.assign(request.headers, {
|
|
17788
17757
|
"content-type": this.getDefaultContentType(),
|
|
17789
17758
|
"smithy-protocol": "rpc-v2-cbor",
|
|
@@ -17802,7 +17771,7 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
17802
17771
|
} catch (e3) {
|
|
17803
17772
|
}
|
|
17804
17773
|
}
|
|
17805
|
-
const { service, operation: operation2 } = (0, import_util_middleware5.getSmithyContext)(
|
|
17774
|
+
const { service, operation: operation2 } = (0, import_util_middleware5.getSmithyContext)(context);
|
|
17806
17775
|
const path7 = `/service/${service}/operation/${operation2}`;
|
|
17807
17776
|
if (request.path.endsWith("/")) {
|
|
17808
17777
|
request.path += path7.slice(1);
|
|
@@ -17811,10 +17780,10 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
17811
17780
|
}
|
|
17812
17781
|
return request;
|
|
17813
17782
|
}
|
|
17814
|
-
async deserializeResponse(operationSchema,
|
|
17815
|
-
return super.deserializeResponse(operationSchema,
|
|
17783
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
17784
|
+
return super.deserializeResponse(operationSchema, context, response);
|
|
17816
17785
|
}
|
|
17817
|
-
async handleError(operationSchema,
|
|
17786
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
17818
17787
|
const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
|
|
17819
17788
|
let namespace = this.options.defaultNamespace;
|
|
17820
17789
|
if (errorName.includes("#")) {
|
|
@@ -17975,14 +17944,14 @@ var init_AwsSmithyRpcV2CborProtocol = __esm({
|
|
|
17975
17944
|
super({ defaultNamespace });
|
|
17976
17945
|
this.awsQueryCompatible = !!awsQueryCompatible;
|
|
17977
17946
|
}
|
|
17978
|
-
async serializeRequest(operationSchema, input,
|
|
17979
|
-
const request = await super.serializeRequest(operationSchema, input,
|
|
17947
|
+
async serializeRequest(operationSchema, input, context) {
|
|
17948
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
17980
17949
|
if (this.awsQueryCompatible) {
|
|
17981
17950
|
request.headers["x-amzn-query-mode"] = "true";
|
|
17982
17951
|
}
|
|
17983
17952
|
return request;
|
|
17984
17953
|
}
|
|
17985
|
-
async handleError(operationSchema,
|
|
17954
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
17986
17955
|
if (this.awsQueryCompatible) {
|
|
17987
17956
|
this.mixin.setQueryCompatError(dataObject, response);
|
|
17988
17957
|
}
|
|
@@ -18082,9 +18051,9 @@ var init_ConfigurableSerdeContext = __esm({
|
|
|
18082
18051
|
});
|
|
18083
18052
|
|
|
18084
18053
|
// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js
|
|
18085
|
-
function jsonReviver(key, value,
|
|
18086
|
-
if (
|
|
18087
|
-
const numericString =
|
|
18054
|
+
function jsonReviver(key, value, context) {
|
|
18055
|
+
if (context?.source) {
|
|
18056
|
+
const numericString = context.source;
|
|
18088
18057
|
if (typeof value === "number") {
|
|
18089
18058
|
if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) {
|
|
18090
18059
|
const isFractional = numericString.includes(".");
|
|
@@ -18347,9 +18316,9 @@ var require_dist_cjs26 = __commonJS({
|
|
|
18347
18316
|
identifyOnResolve = toggle;
|
|
18348
18317
|
return identifyOnResolve;
|
|
18349
18318
|
},
|
|
18350
|
-
resolve: (handler,
|
|
18319
|
+
resolve: (handler, context) => {
|
|
18351
18320
|
for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
|
|
18352
|
-
handler = middleware(handler,
|
|
18321
|
+
handler = middleware(handler, context);
|
|
18353
18322
|
}
|
|
18354
18323
|
if (identifyOnResolve) {
|
|
18355
18324
|
console.log(stack.identify());
|
|
@@ -18949,7 +18918,7 @@ var init_common2 = __esm({
|
|
|
18949
18918
|
"node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() {
|
|
18950
18919
|
import_smithy_client = __toESM(require_dist_cjs27());
|
|
18951
18920
|
import_util_utf86 = __toESM(require_dist_cjs11());
|
|
18952
|
-
collectBodyString = (streamBody,
|
|
18921
|
+
collectBodyString = (streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => (context?.utf8Encoder ?? import_util_utf86.toUtf8)(body));
|
|
18953
18922
|
}
|
|
18954
18923
|
});
|
|
18955
18924
|
|
|
@@ -18958,7 +18927,7 @@ var parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode;
|
|
|
18958
18927
|
var init_parseJsonBody = __esm({
|
|
18959
18928
|
"node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() {
|
|
18960
18929
|
init_common2();
|
|
18961
|
-
parseJsonBody = (streamBody,
|
|
18930
|
+
parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
18962
18931
|
if (encoded.length) {
|
|
18963
18932
|
try {
|
|
18964
18933
|
return JSON.parse(encoded);
|
|
@@ -18973,8 +18942,8 @@ var init_parseJsonBody = __esm({
|
|
|
18973
18942
|
}
|
|
18974
18943
|
return {};
|
|
18975
18944
|
});
|
|
18976
|
-
parseJsonErrorBody = async (errorBody,
|
|
18977
|
-
const value = await parseJsonBody(errorBody,
|
|
18945
|
+
parseJsonErrorBody = async (errorBody, context) => {
|
|
18946
|
+
const value = await parseJsonBody(errorBody, context);
|
|
18978
18947
|
value.message = value.message ?? value.Message;
|
|
18979
18948
|
return value;
|
|
18980
18949
|
};
|
|
@@ -19385,8 +19354,8 @@ var init_AwsJsonRpcProtocol = __esm({
|
|
|
19385
19354
|
this.deserializer = this.codec.createDeserializer();
|
|
19386
19355
|
this.awsQueryCompatible = !!awsQueryCompatible;
|
|
19387
19356
|
}
|
|
19388
|
-
async serializeRequest(operationSchema, input,
|
|
19389
|
-
const request = await super.serializeRequest(operationSchema, input,
|
|
19357
|
+
async serializeRequest(operationSchema, input, context) {
|
|
19358
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
19390
19359
|
if (!request.path.endsWith("/")) {
|
|
19391
19360
|
request.path += "/";
|
|
19392
19361
|
}
|
|
@@ -19405,7 +19374,7 @@ var init_AwsJsonRpcProtocol = __esm({
|
|
|
19405
19374
|
getPayloadCodec() {
|
|
19406
19375
|
return this.codec;
|
|
19407
19376
|
}
|
|
19408
|
-
async handleError(operationSchema,
|
|
19377
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
19409
19378
|
if (this.awsQueryCompatible) {
|
|
19410
19379
|
this.mixin.setQueryCompatError(dataObject, response);
|
|
19411
19380
|
}
|
|
@@ -19524,8 +19493,8 @@ var init_AwsRestJsonProtocol = __esm({
|
|
|
19524
19493
|
this.codec.setSerdeContext(serdeContext);
|
|
19525
19494
|
super.setSerdeContext(serdeContext);
|
|
19526
19495
|
}
|
|
19527
|
-
async serializeRequest(operationSchema, input,
|
|
19528
|
-
const request = await super.serializeRequest(operationSchema, input,
|
|
19496
|
+
async serializeRequest(operationSchema, input, context) {
|
|
19497
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
19529
19498
|
const inputSchema = NormalizedSchema.of(operationSchema.input);
|
|
19530
19499
|
if (!request.headers["content-type"]) {
|
|
19531
19500
|
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
|
|
@@ -19538,14 +19507,14 @@ var init_AwsRestJsonProtocol = __esm({
|
|
|
19538
19507
|
}
|
|
19539
19508
|
return request;
|
|
19540
19509
|
}
|
|
19541
|
-
async handleError(operationSchema,
|
|
19510
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
19542
19511
|
const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
|
|
19543
19512
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
19544
19513
|
const ns = NormalizedSchema.of(errorSchema);
|
|
19545
19514
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
19546
19515
|
const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
|
|
19547
19516
|
const exception = new ErrorCtor(message);
|
|
19548
|
-
await this.deserializeHttpMessage(errorSchema,
|
|
19517
|
+
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
19549
19518
|
const output = {};
|
|
19550
19519
|
for (const [name14, member2] of ns.structIterator()) {
|
|
19551
19520
|
const target = member2.getMergedTraits().jsonName ?? name14;
|
|
@@ -20848,8 +20817,8 @@ var init_AwsQueryProtocol = __esm({
|
|
|
20848
20817
|
getPayloadCodec() {
|
|
20849
20818
|
throw new Error("AWSQuery protocol has no payload codec.");
|
|
20850
20819
|
}
|
|
20851
|
-
async serializeRequest(operationSchema, input,
|
|
20852
|
-
const request = await super.serializeRequest(operationSchema, input,
|
|
20820
|
+
async serializeRequest(operationSchema, input, context) {
|
|
20821
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
20853
20822
|
if (!request.path.endsWith("/")) {
|
|
20854
20823
|
request.path += "/";
|
|
20855
20824
|
}
|
|
@@ -20866,16 +20835,16 @@ var init_AwsQueryProtocol = __esm({
|
|
|
20866
20835
|
}
|
|
20867
20836
|
return request;
|
|
20868
20837
|
}
|
|
20869
|
-
async deserializeResponse(operationSchema,
|
|
20838
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
20870
20839
|
const deserializer = this.deserializer;
|
|
20871
20840
|
const ns = NormalizedSchema.of(operationSchema.output);
|
|
20872
20841
|
const dataObject = {};
|
|
20873
20842
|
if (response.statusCode >= 300) {
|
|
20874
|
-
const bytes2 = await collectBody(response.body,
|
|
20843
|
+
const bytes2 = await collectBody(response.body, context);
|
|
20875
20844
|
if (bytes2.byteLength > 0) {
|
|
20876
20845
|
Object.assign(dataObject, await deserializer.read(15, bytes2));
|
|
20877
20846
|
}
|
|
20878
|
-
await this.handleError(operationSchema,
|
|
20847
|
+
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
20879
20848
|
}
|
|
20880
20849
|
for (const header in response.headers) {
|
|
20881
20850
|
const value = response.headers[header];
|
|
@@ -20884,7 +20853,7 @@ var init_AwsQueryProtocol = __esm({
|
|
|
20884
20853
|
}
|
|
20885
20854
|
const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name;
|
|
20886
20855
|
const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0;
|
|
20887
|
-
const bytes = await collectBody(response.body,
|
|
20856
|
+
const bytes = await collectBody(response.body, context);
|
|
20888
20857
|
if (bytes.byteLength > 0) {
|
|
20889
20858
|
Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
|
|
20890
20859
|
}
|
|
@@ -20897,7 +20866,7 @@ var init_AwsQueryProtocol = __esm({
|
|
|
20897
20866
|
useNestedResult() {
|
|
20898
20867
|
return true;
|
|
20899
20868
|
}
|
|
20900
|
-
async handleError(operationSchema,
|
|
20869
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
20901
20870
|
const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown";
|
|
20902
20871
|
const errorData = this.loadQueryError(dataObject);
|
|
20903
20872
|
const message = this.loadQueryErrorMessage(dataObject);
|
|
@@ -20978,7 +20947,7 @@ var init_parseXmlBody = __esm({
|
|
|
20978
20947
|
import_xml_builder2 = __toESM(require_dist_cjs28());
|
|
20979
20948
|
import_smithy_client5 = __toESM(require_dist_cjs27());
|
|
20980
20949
|
init_common2();
|
|
20981
|
-
parseXmlBody = (streamBody,
|
|
20950
|
+
parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
20982
20951
|
if (encoded.length) {
|
|
20983
20952
|
let parsedObj;
|
|
20984
20953
|
try {
|
|
@@ -21002,8 +20971,8 @@ var init_parseXmlBody = __esm({
|
|
|
21002
20971
|
}
|
|
21003
20972
|
return {};
|
|
21004
20973
|
});
|
|
21005
|
-
parseXmlErrorBody = async (errorBody,
|
|
21006
|
-
const value = await parseXmlBody(errorBody,
|
|
20974
|
+
parseXmlErrorBody = async (errorBody, context) => {
|
|
20975
|
+
const value = await parseXmlBody(errorBody, context);
|
|
21007
20976
|
if (value.Error) {
|
|
21008
20977
|
value.Error.message = value.Error.message ?? value.Error.Message;
|
|
21009
20978
|
}
|
|
@@ -21348,8 +21317,8 @@ var init_AwsRestXmlProtocol = __esm({
|
|
|
21348
21317
|
getShapeId() {
|
|
21349
21318
|
return "aws.protocols#restXml";
|
|
21350
21319
|
}
|
|
21351
|
-
async serializeRequest(operationSchema, input,
|
|
21352
|
-
const request = await super.serializeRequest(operationSchema, input,
|
|
21320
|
+
async serializeRequest(operationSchema, input, context) {
|
|
21321
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
21353
21322
|
const inputSchema = NormalizedSchema.of(operationSchema.input);
|
|
21354
21323
|
if (!request.headers["content-type"]) {
|
|
21355
21324
|
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
|
|
@@ -21364,17 +21333,17 @@ var init_AwsRestXmlProtocol = __esm({
|
|
|
21364
21333
|
}
|
|
21365
21334
|
return request;
|
|
21366
21335
|
}
|
|
21367
|
-
async deserializeResponse(operationSchema,
|
|
21368
|
-
return super.deserializeResponse(operationSchema,
|
|
21336
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
21337
|
+
return super.deserializeResponse(operationSchema, context, response);
|
|
21369
21338
|
}
|
|
21370
|
-
async handleError(operationSchema,
|
|
21339
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
21371
21340
|
const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown";
|
|
21372
21341
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
21373
21342
|
const ns = NormalizedSchema.of(errorSchema);
|
|
21374
21343
|
const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
21375
21344
|
const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
|
|
21376
21345
|
const exception = new ErrorCtor(message);
|
|
21377
|
-
await this.deserializeHttpMessage(errorSchema,
|
|
21346
|
+
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
21378
21347
|
const output = {};
|
|
21379
21348
|
for (const [name14, member2] of ns.structIterator()) {
|
|
21380
21349
|
const target = member2.getMergedTraits().xmlName ?? name14;
|
|
@@ -21503,48 +21472,48 @@ var require_dist_cjs29 = __commonJS({
|
|
|
21503
21472
|
});
|
|
21504
21473
|
}
|
|
21505
21474
|
var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
|
|
21506
|
-
async function checkFeatures(
|
|
21475
|
+
async function checkFeatures(context, config, args) {
|
|
21507
21476
|
const request = args.request;
|
|
21508
21477
|
if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
|
|
21509
|
-
core$1.setFeature(
|
|
21478
|
+
core$1.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
|
|
21510
21479
|
}
|
|
21511
21480
|
if (typeof config.retryStrategy === "function") {
|
|
21512
21481
|
const retryStrategy = await config.retryStrategy();
|
|
21513
21482
|
if (typeof retryStrategy.acquireInitialRetryToken === "function") {
|
|
21514
21483
|
if (retryStrategy.constructor?.name?.includes("Adaptive")) {
|
|
21515
|
-
core$1.setFeature(
|
|
21484
|
+
core$1.setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
|
|
21516
21485
|
} else {
|
|
21517
|
-
core$1.setFeature(
|
|
21486
|
+
core$1.setFeature(context, "RETRY_MODE_STANDARD", "E");
|
|
21518
21487
|
}
|
|
21519
21488
|
} else {
|
|
21520
|
-
core$1.setFeature(
|
|
21489
|
+
core$1.setFeature(context, "RETRY_MODE_LEGACY", "D");
|
|
21521
21490
|
}
|
|
21522
21491
|
}
|
|
21523
21492
|
if (typeof config.accountIdEndpointMode === "function") {
|
|
21524
|
-
const endpointV2 =
|
|
21493
|
+
const endpointV2 = context.endpointV2;
|
|
21525
21494
|
if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
|
|
21526
|
-
core$1.setFeature(
|
|
21495
|
+
core$1.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
|
|
21527
21496
|
}
|
|
21528
21497
|
switch (await config.accountIdEndpointMode?.()) {
|
|
21529
21498
|
case "disabled":
|
|
21530
|
-
core$1.setFeature(
|
|
21499
|
+
core$1.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
|
|
21531
21500
|
break;
|
|
21532
21501
|
case "preferred":
|
|
21533
|
-
core$1.setFeature(
|
|
21502
|
+
core$1.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
|
|
21534
21503
|
break;
|
|
21535
21504
|
case "required":
|
|
21536
|
-
core$1.setFeature(
|
|
21505
|
+
core$1.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
|
|
21537
21506
|
break;
|
|
21538
21507
|
}
|
|
21539
21508
|
}
|
|
21540
|
-
const identity2 =
|
|
21509
|
+
const identity2 = context.__smithy_context?.selectedHttpAuthScheme?.identity;
|
|
21541
21510
|
if (identity2?.$source) {
|
|
21542
21511
|
const credentials = identity2;
|
|
21543
21512
|
if (credentials.accountId) {
|
|
21544
|
-
core$1.setFeature(
|
|
21513
|
+
core$1.setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
|
|
21545
21514
|
}
|
|
21546
21515
|
for (const [key, value] of Object.entries(credentials.$source ?? {})) {
|
|
21547
|
-
core$1.setFeature(
|
|
21516
|
+
core$1.setFeature(context, key, value);
|
|
21548
21517
|
}
|
|
21549
21518
|
}
|
|
21550
21519
|
}
|
|
@@ -21572,17 +21541,17 @@ var require_dist_cjs29 = __commonJS({
|
|
|
21572
21541
|
}
|
|
21573
21542
|
return buffer;
|
|
21574
21543
|
}
|
|
21575
|
-
var userAgentMiddleware = (options) => (next,
|
|
21544
|
+
var userAgentMiddleware = (options) => (next, context) => async (args) => {
|
|
21576
21545
|
const { request } = args;
|
|
21577
21546
|
if (!protocolHttp.HttpRequest.isInstance(request)) {
|
|
21578
21547
|
return next(args);
|
|
21579
21548
|
}
|
|
21580
21549
|
const { headers } = request;
|
|
21581
|
-
const userAgent =
|
|
21550
|
+
const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
|
|
21582
21551
|
const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
|
|
21583
|
-
await checkFeatures(
|
|
21584
|
-
const awsContext =
|
|
21585
|
-
defaultUserAgent.push(`m/${encodeFeatures(Object.assign({},
|
|
21552
|
+
await checkFeatures(context, options, args);
|
|
21553
|
+
const awsContext = context;
|
|
21554
|
+
defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
|
|
21586
21555
|
const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
|
|
21587
21556
|
const appId = await options.userAgentAppId();
|
|
21588
21557
|
if (appId) {
|
|
@@ -22891,7 +22860,7 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22891
22860
|
this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
|
|
22892
22861
|
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
|
|
22893
22862
|
}
|
|
22894
|
-
async handle(next, args,
|
|
22863
|
+
async handle(next, args, context = {}) {
|
|
22895
22864
|
const request = args.request;
|
|
22896
22865
|
const { body: payload2, headers, query: query2 } = request;
|
|
22897
22866
|
if (!(payload2 instanceof ReadableStream)) {
|
|
@@ -23875,7 +23844,7 @@ var require_dist_cjs44 = __commonJS({
|
|
|
23875
23844
|
}
|
|
23876
23845
|
return urlParser.parseUrl(endpoint);
|
|
23877
23846
|
};
|
|
23878
|
-
var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig,
|
|
23847
|
+
var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => {
|
|
23879
23848
|
if (!clientConfig.isCustomEndpoint) {
|
|
23880
23849
|
let endpointFromConfig;
|
|
23881
23850
|
if (clientConfig.serviceConfiguredEndpoint) {
|
|
@@ -23892,7 +23861,7 @@ var require_dist_cjs44 = __commonJS({
|
|
|
23892
23861
|
if (typeof clientConfig.endpointProvider !== "function") {
|
|
23893
23862
|
throw new Error("config.endpointProvider is not set.");
|
|
23894
23863
|
}
|
|
23895
|
-
const endpoint = clientConfig.endpointProvider(endpointParams,
|
|
23864
|
+
const endpoint = clientConfig.endpointProvider(endpointParams, context);
|
|
23896
23865
|
return endpoint;
|
|
23897
23866
|
};
|
|
23898
23867
|
var resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
|
|
@@ -23926,22 +23895,22 @@ var require_dist_cjs44 = __commonJS({
|
|
|
23926
23895
|
return endpointParams;
|
|
23927
23896
|
};
|
|
23928
23897
|
var endpointMiddleware = ({ config, instructions }) => {
|
|
23929
|
-
return (next,
|
|
23898
|
+
return (next, context) => async (args) => {
|
|
23930
23899
|
if (config.isCustomEndpoint) {
|
|
23931
|
-
core.setFeature(
|
|
23900
|
+
core.setFeature(context, "ENDPOINT_OVERRIDE", "N");
|
|
23932
23901
|
}
|
|
23933
23902
|
const endpoint = await getEndpointFromInstructions(args.input, {
|
|
23934
23903
|
getEndpointParameterInstructions() {
|
|
23935
23904
|
return instructions;
|
|
23936
23905
|
}
|
|
23937
|
-
}, { ...config },
|
|
23938
|
-
|
|
23939
|
-
|
|
23940
|
-
const authScheme =
|
|
23906
|
+
}, { ...config }, context);
|
|
23907
|
+
context.endpointV2 = endpoint;
|
|
23908
|
+
context.authSchemes = endpoint.properties?.authSchemes;
|
|
23909
|
+
const authScheme = context.authSchemes?.[0];
|
|
23941
23910
|
if (authScheme) {
|
|
23942
|
-
|
|
23943
|
-
|
|
23944
|
-
const smithyContext = utilMiddleware.getSmithyContext(
|
|
23911
|
+
context["signing_region"] = authScheme.signingRegion;
|
|
23912
|
+
context["signing_service"] = authScheme.signingName;
|
|
23913
|
+
const smithyContext = utilMiddleware.getSmithyContext(context);
|
|
23945
23914
|
const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
|
|
23946
23915
|
if (httpAuthOption) {
|
|
23947
23916
|
httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
|
|
@@ -24590,12 +24559,12 @@ var require_dist_cjs47 = __commonJS({
|
|
|
24590
24559
|
clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);
|
|
24591
24560
|
}
|
|
24592
24561
|
});
|
|
24593
|
-
var retryMiddleware = (options) => (next,
|
|
24562
|
+
var retryMiddleware = (options) => (next, context) => async (args) => {
|
|
24594
24563
|
let retryStrategy = await options.retryStrategy();
|
|
24595
24564
|
const maxAttempts = await options.maxAttempts();
|
|
24596
24565
|
if (isRetryStrategyV2(retryStrategy)) {
|
|
24597
24566
|
retryStrategy = retryStrategy;
|
|
24598
|
-
let retryToken = await retryStrategy.acquireInitialRetryToken(
|
|
24567
|
+
let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]);
|
|
24599
24568
|
let lastError = new Error();
|
|
24600
24569
|
let attempts = 0;
|
|
24601
24570
|
let totalRetryDelay = 0;
|
|
@@ -24618,7 +24587,7 @@ var require_dist_cjs47 = __commonJS({
|
|
|
24618
24587
|
const retryErrorInfo = getRetryErrorInfo(e3);
|
|
24619
24588
|
lastError = asSdkError(e3);
|
|
24620
24589
|
if (isRequest && isStreamingPayload.isStreamingPayload(request)) {
|
|
24621
|
-
(
|
|
24590
|
+
(context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
|
|
24622
24591
|
throw lastError;
|
|
24623
24592
|
}
|
|
24624
24593
|
try {
|
|
@@ -24640,7 +24609,7 @@ var require_dist_cjs47 = __commonJS({
|
|
|
24640
24609
|
} else {
|
|
24641
24610
|
retryStrategy = retryStrategy;
|
|
24642
24611
|
if (retryStrategy?.mode)
|
|
24643
|
-
|
|
24612
|
+
context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
|
|
24644
24613
|
return retryStrategy.retry(next, args);
|
|
24645
24614
|
}
|
|
24646
24615
|
};
|
|
@@ -24720,9 +24689,9 @@ var require_httpAuthSchemeProvider = __commonJS({
|
|
|
24720
24689
|
var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2));
|
|
24721
24690
|
var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports));
|
|
24722
24691
|
var util_middleware_1 = require_dist_cjs7();
|
|
24723
|
-
var defaultBedrockRuntimeHttpAuthSchemeParametersProvider = async (config,
|
|
24692
|
+
var defaultBedrockRuntimeHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
24724
24693
|
return {
|
|
24725
|
-
operation: (0, util_middleware_1.getSmithyContext)(
|
|
24694
|
+
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
|
24726
24695
|
region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => {
|
|
24727
24696
|
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
24728
24697
|
})()
|
|
@@ -24736,10 +24705,10 @@ var require_httpAuthSchemeProvider = __commonJS({
|
|
|
24736
24705
|
name: "bedrock",
|
|
24737
24706
|
region: authParameters.region
|
|
24738
24707
|
},
|
|
24739
|
-
propertiesExtractor: (config,
|
|
24708
|
+
propertiesExtractor: (config, context) => ({
|
|
24740
24709
|
signingProperties: {
|
|
24741
24710
|
config,
|
|
24742
|
-
context
|
|
24711
|
+
context
|
|
24743
24712
|
}
|
|
24744
24713
|
})
|
|
24745
24714
|
};
|
|
@@ -24747,7 +24716,7 @@ var require_httpAuthSchemeProvider = __commonJS({
|
|
|
24747
24716
|
function createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) {
|
|
24748
24717
|
return {
|
|
24749
24718
|
schemeId: "smithy.api#httpBearerAuth",
|
|
24750
|
-
propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache },
|
|
24719
|
+
propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache }, context) => ({
|
|
24751
24720
|
identityProperties: {
|
|
24752
24721
|
profile,
|
|
24753
24722
|
filepath,
|
|
@@ -25493,10 +25462,10 @@ function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
|
25493
25462
|
name: "sso-oauth",
|
|
25494
25463
|
region: authParameters.region
|
|
25495
25464
|
},
|
|
25496
|
-
propertiesExtractor: (config,
|
|
25465
|
+
propertiesExtractor: (config, context) => ({
|
|
25497
25466
|
signingProperties: {
|
|
25498
25467
|
config,
|
|
25499
|
-
context
|
|
25468
|
+
context
|
|
25500
25469
|
}
|
|
25501
25470
|
})
|
|
25502
25471
|
};
|
|
@@ -25511,9 +25480,9 @@ var init_httpAuthSchemeProvider = __esm({
|
|
|
25511
25480
|
"node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js"() {
|
|
25512
25481
|
init_dist_es2();
|
|
25513
25482
|
import_util_middleware6 = __toESM(require_dist_cjs7());
|
|
25514
|
-
defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config,
|
|
25483
|
+
defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
25515
25484
|
return {
|
|
25516
|
-
operation: (0, import_util_middleware6.getSmithyContext)(
|
|
25485
|
+
operation: (0, import_util_middleware6.getSmithyContext)(context).operation,
|
|
25517
25486
|
region: await (0, import_util_middleware6.normalizeProvider)(config.region)() || (() => {
|
|
25518
25487
|
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
25519
25488
|
})()
|
|
@@ -25859,10 +25828,10 @@ var init_endpointResolver = __esm({
|
|
|
25859
25828
|
size: 50,
|
|
25860
25829
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
|
|
25861
25830
|
});
|
|
25862
|
-
defaultEndpointResolver = (endpointParams,
|
|
25831
|
+
defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
25863
25832
|
return cache.get(endpointParams, () => (0, import_util_endpoints2.resolveEndpoint)(ruleSet, {
|
|
25864
25833
|
endpointParams,
|
|
25865
|
-
logger:
|
|
25834
|
+
logger: context.logger
|
|
25866
25835
|
}));
|
|
25867
25836
|
};
|
|
25868
25837
|
import_util_endpoints2.customEndpointFunctions.aws = import_util_endpoints.awsEndpointFunctions;
|
|
@@ -26450,8 +26419,8 @@ var init_Aws_restJson1 = __esm({
|
|
|
26450
26419
|
import_smithy_client14 = __toESM(require_dist_cjs27());
|
|
26451
26420
|
init_models_0();
|
|
26452
26421
|
init_SSOOIDCServiceException();
|
|
26453
|
-
se_CreateTokenCommand = async (input,
|
|
26454
|
-
const b3 = requestBuilder(input,
|
|
26422
|
+
se_CreateTokenCommand = async (input, context) => {
|
|
26423
|
+
const b3 = requestBuilder(input, context);
|
|
26455
26424
|
const headers = {
|
|
26456
26425
|
"content-type": "application/json"
|
|
26457
26426
|
};
|
|
@@ -26471,14 +26440,14 @@ var init_Aws_restJson1 = __esm({
|
|
|
26471
26440
|
b3.m("POST").h(headers).b(body);
|
|
26472
26441
|
return b3.build();
|
|
26473
26442
|
};
|
|
26474
|
-
de_CreateTokenCommand = async (output,
|
|
26443
|
+
de_CreateTokenCommand = async (output, context) => {
|
|
26475
26444
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
26476
|
-
return de_CommandError(output,
|
|
26445
|
+
return de_CommandError(output, context);
|
|
26477
26446
|
}
|
|
26478
26447
|
const contents = (0, import_smithy_client14.map)({
|
|
26479
26448
|
$metadata: deserializeMetadata(output)
|
|
26480
26449
|
});
|
|
26481
|
-
const data2 = (0, import_smithy_client14.expectNonNull)((0, import_smithy_client14.expectObject)(await parseJsonBody(output.body,
|
|
26450
|
+
const data2 = (0, import_smithy_client14.expectNonNull)((0, import_smithy_client14.expectObject)(await parseJsonBody(output.body, context)), "body");
|
|
26482
26451
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
26483
26452
|
accessToken: import_smithy_client14.expectString,
|
|
26484
26453
|
expiresIn: import_smithy_client14.expectInt32,
|
|
@@ -26489,46 +26458,46 @@ var init_Aws_restJson1 = __esm({
|
|
|
26489
26458
|
Object.assign(contents, doc);
|
|
26490
26459
|
return contents;
|
|
26491
26460
|
};
|
|
26492
|
-
de_CommandError = async (output,
|
|
26461
|
+
de_CommandError = async (output, context) => {
|
|
26493
26462
|
const parsedOutput = {
|
|
26494
26463
|
...output,
|
|
26495
|
-
body: await parseJsonErrorBody(output.body,
|
|
26464
|
+
body: await parseJsonErrorBody(output.body, context)
|
|
26496
26465
|
};
|
|
26497
26466
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
26498
26467
|
switch (errorCode) {
|
|
26499
26468
|
case "AccessDeniedException":
|
|
26500
26469
|
case "com.amazonaws.ssooidc#AccessDeniedException":
|
|
26501
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput,
|
|
26470
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
26502
26471
|
case "AuthorizationPendingException":
|
|
26503
26472
|
case "com.amazonaws.ssooidc#AuthorizationPendingException":
|
|
26504
|
-
throw await de_AuthorizationPendingExceptionRes(parsedOutput,
|
|
26473
|
+
throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
|
|
26505
26474
|
case "ExpiredTokenException":
|
|
26506
26475
|
case "com.amazonaws.ssooidc#ExpiredTokenException":
|
|
26507
|
-
throw await de_ExpiredTokenExceptionRes(parsedOutput,
|
|
26476
|
+
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
|
|
26508
26477
|
case "InternalServerException":
|
|
26509
26478
|
case "com.amazonaws.ssooidc#InternalServerException":
|
|
26510
|
-
throw await de_InternalServerExceptionRes(parsedOutput,
|
|
26479
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
26511
26480
|
case "InvalidClientException":
|
|
26512
26481
|
case "com.amazonaws.ssooidc#InvalidClientException":
|
|
26513
|
-
throw await de_InvalidClientExceptionRes(parsedOutput,
|
|
26482
|
+
throw await de_InvalidClientExceptionRes(parsedOutput, context);
|
|
26514
26483
|
case "InvalidGrantException":
|
|
26515
26484
|
case "com.amazonaws.ssooidc#InvalidGrantException":
|
|
26516
|
-
throw await de_InvalidGrantExceptionRes(parsedOutput,
|
|
26485
|
+
throw await de_InvalidGrantExceptionRes(parsedOutput, context);
|
|
26517
26486
|
case "InvalidRequestException":
|
|
26518
26487
|
case "com.amazonaws.ssooidc#InvalidRequestException":
|
|
26519
|
-
throw await de_InvalidRequestExceptionRes(parsedOutput,
|
|
26488
|
+
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
26520
26489
|
case "InvalidScopeException":
|
|
26521
26490
|
case "com.amazonaws.ssooidc#InvalidScopeException":
|
|
26522
|
-
throw await de_InvalidScopeExceptionRes(parsedOutput,
|
|
26491
|
+
throw await de_InvalidScopeExceptionRes(parsedOutput, context);
|
|
26523
26492
|
case "SlowDownException":
|
|
26524
26493
|
case "com.amazonaws.ssooidc#SlowDownException":
|
|
26525
|
-
throw await de_SlowDownExceptionRes(parsedOutput,
|
|
26494
|
+
throw await de_SlowDownExceptionRes(parsedOutput, context);
|
|
26526
26495
|
case "UnauthorizedClientException":
|
|
26527
26496
|
case "com.amazonaws.ssooidc#UnauthorizedClientException":
|
|
26528
|
-
throw await de_UnauthorizedClientExceptionRes(parsedOutput,
|
|
26497
|
+
throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
|
|
26529
26498
|
case "UnsupportedGrantTypeException":
|
|
26530
26499
|
case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
|
|
26531
|
-
throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput,
|
|
26500
|
+
throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
|
|
26532
26501
|
default:
|
|
26533
26502
|
const parsedBody = parsedOutput.body;
|
|
26534
26503
|
return throwDefaultError({
|
|
@@ -26539,7 +26508,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26539
26508
|
}
|
|
26540
26509
|
};
|
|
26541
26510
|
throwDefaultError = (0, import_smithy_client14.withBaseException)(SSOOIDCServiceException);
|
|
26542
|
-
de_AccessDeniedExceptionRes = async (parsedOutput,
|
|
26511
|
+
de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
26543
26512
|
const contents = (0, import_smithy_client14.map)({});
|
|
26544
26513
|
const data2 = parsedOutput.body;
|
|
26545
26514
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26554,7 +26523,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26554
26523
|
});
|
|
26555
26524
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26556
26525
|
};
|
|
26557
|
-
de_AuthorizationPendingExceptionRes = async (parsedOutput,
|
|
26526
|
+
de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => {
|
|
26558
26527
|
const contents = (0, import_smithy_client14.map)({});
|
|
26559
26528
|
const data2 = parsedOutput.body;
|
|
26560
26529
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26568,7 +26537,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26568
26537
|
});
|
|
26569
26538
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26570
26539
|
};
|
|
26571
|
-
de_ExpiredTokenExceptionRes = async (parsedOutput,
|
|
26540
|
+
de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
|
|
26572
26541
|
const contents = (0, import_smithy_client14.map)({});
|
|
26573
26542
|
const data2 = parsedOutput.body;
|
|
26574
26543
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26582,7 +26551,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26582
26551
|
});
|
|
26583
26552
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26584
26553
|
};
|
|
26585
|
-
de_InternalServerExceptionRes = async (parsedOutput,
|
|
26554
|
+
de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
26586
26555
|
const contents = (0, import_smithy_client14.map)({});
|
|
26587
26556
|
const data2 = parsedOutput.body;
|
|
26588
26557
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26596,7 +26565,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26596
26565
|
});
|
|
26597
26566
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26598
26567
|
};
|
|
26599
|
-
de_InvalidClientExceptionRes = async (parsedOutput,
|
|
26568
|
+
de_InvalidClientExceptionRes = async (parsedOutput, context) => {
|
|
26600
26569
|
const contents = (0, import_smithy_client14.map)({});
|
|
26601
26570
|
const data2 = parsedOutput.body;
|
|
26602
26571
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26610,7 +26579,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26610
26579
|
});
|
|
26611
26580
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26612
26581
|
};
|
|
26613
|
-
de_InvalidGrantExceptionRes = async (parsedOutput,
|
|
26582
|
+
de_InvalidGrantExceptionRes = async (parsedOutput, context) => {
|
|
26614
26583
|
const contents = (0, import_smithy_client14.map)({});
|
|
26615
26584
|
const data2 = parsedOutput.body;
|
|
26616
26585
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26624,7 +26593,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26624
26593
|
});
|
|
26625
26594
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26626
26595
|
};
|
|
26627
|
-
de_InvalidRequestExceptionRes = async (parsedOutput,
|
|
26596
|
+
de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
|
|
26628
26597
|
const contents = (0, import_smithy_client14.map)({});
|
|
26629
26598
|
const data2 = parsedOutput.body;
|
|
26630
26599
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26639,7 +26608,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26639
26608
|
});
|
|
26640
26609
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26641
26610
|
};
|
|
26642
|
-
de_InvalidScopeExceptionRes = async (parsedOutput,
|
|
26611
|
+
de_InvalidScopeExceptionRes = async (parsedOutput, context) => {
|
|
26643
26612
|
const contents = (0, import_smithy_client14.map)({});
|
|
26644
26613
|
const data2 = parsedOutput.body;
|
|
26645
26614
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26653,7 +26622,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26653
26622
|
});
|
|
26654
26623
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26655
26624
|
};
|
|
26656
|
-
de_SlowDownExceptionRes = async (parsedOutput,
|
|
26625
|
+
de_SlowDownExceptionRes = async (parsedOutput, context) => {
|
|
26657
26626
|
const contents = (0, import_smithy_client14.map)({});
|
|
26658
26627
|
const data2 = parsedOutput.body;
|
|
26659
26628
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26667,7 +26636,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26667
26636
|
});
|
|
26668
26637
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26669
26638
|
};
|
|
26670
|
-
de_UnauthorizedClientExceptionRes = async (parsedOutput,
|
|
26639
|
+
de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => {
|
|
26671
26640
|
const contents = (0, import_smithy_client14.map)({});
|
|
26672
26641
|
const data2 = parsedOutput.body;
|
|
26673
26642
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26681,7 +26650,7 @@ var init_Aws_restJson1 = __esm({
|
|
|
26681
26650
|
});
|
|
26682
26651
|
return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
|
|
26683
26652
|
};
|
|
26684
|
-
de_UnsupportedGrantTypeExceptionRes = async (parsedOutput,
|
|
26653
|
+
de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => {
|
|
26685
26654
|
const contents = (0, import_smithy_client14.map)({});
|
|
26686
26655
|
const data2 = parsedOutput.body;
|
|
26687
26656
|
const doc = (0, import_smithy_client14.take)(data2, {
|
|
@@ -26949,9 +26918,9 @@ var require_httpAuthSchemeProvider2 = __commonJS({
|
|
|
26949
26918
|
exports2.resolveHttpAuthSchemeConfig = exports2.defaultSSOHttpAuthSchemeProvider = exports2.defaultSSOHttpAuthSchemeParametersProvider = void 0;
|
|
26950
26919
|
var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2));
|
|
26951
26920
|
var util_middleware_1 = require_dist_cjs7();
|
|
26952
|
-
var defaultSSOHttpAuthSchemeParametersProvider = async (config,
|
|
26921
|
+
var defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
26953
26922
|
return {
|
|
26954
|
-
operation: (0, util_middleware_1.getSmithyContext)(
|
|
26923
|
+
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
|
26955
26924
|
region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => {
|
|
26956
26925
|
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
26957
26926
|
})()
|
|
@@ -26965,10 +26934,10 @@ var require_httpAuthSchemeProvider2 = __commonJS({
|
|
|
26965
26934
|
name: "awsssoportal",
|
|
26966
26935
|
region: authParameters.region
|
|
26967
26936
|
},
|
|
26968
|
-
propertiesExtractor: (config,
|
|
26937
|
+
propertiesExtractor: (config, context) => ({
|
|
26969
26938
|
signingProperties: {
|
|
26970
26939
|
config,
|
|
26971
|
-
context
|
|
26940
|
+
context
|
|
26972
26941
|
}
|
|
26973
26942
|
})
|
|
26974
26943
|
};
|
|
@@ -27166,10 +27135,10 @@ var require_endpointResolver = __commonJS({
|
|
|
27166
27135
|
size: 50,
|
|
27167
27136
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
|
|
27168
27137
|
});
|
|
27169
|
-
var defaultEndpointResolver3 = (endpointParams,
|
|
27138
|
+
var defaultEndpointResolver3 = (endpointParams, context = {}) => {
|
|
27170
27139
|
return cache3.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
|
|
27171
27140
|
endpointParams,
|
|
27172
|
-
logger:
|
|
27141
|
+
logger: context.logger
|
|
27173
27142
|
}));
|
|
27174
27143
|
};
|
|
27175
27144
|
exports2.defaultEndpointResolver = defaultEndpointResolver3;
|
|
@@ -27467,8 +27436,8 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27467
27436
|
...obj,
|
|
27468
27437
|
...obj.accessToken && { accessToken: smithyClient.SENSITIVE_STRING }
|
|
27469
27438
|
});
|
|
27470
|
-
var se_GetRoleCredentialsCommand = async (input,
|
|
27471
|
-
const b3 = core.requestBuilder(input,
|
|
27439
|
+
var se_GetRoleCredentialsCommand = async (input, context) => {
|
|
27440
|
+
const b3 = core.requestBuilder(input, context);
|
|
27472
27441
|
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
27473
27442
|
[_xasbt]: input[_aT]
|
|
27474
27443
|
});
|
|
@@ -27481,8 +27450,8 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27481
27450
|
b3.m("GET").h(headers).q(query2).b(body);
|
|
27482
27451
|
return b3.build();
|
|
27483
27452
|
};
|
|
27484
|
-
var se_ListAccountRolesCommand = async (input,
|
|
27485
|
-
const b3 = core.requestBuilder(input,
|
|
27453
|
+
var se_ListAccountRolesCommand = async (input, context) => {
|
|
27454
|
+
const b3 = core.requestBuilder(input, context);
|
|
27486
27455
|
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
27487
27456
|
[_xasbt]: input[_aT]
|
|
27488
27457
|
});
|
|
@@ -27496,8 +27465,8 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27496
27465
|
b3.m("GET").h(headers).q(query2).b(body);
|
|
27497
27466
|
return b3.build();
|
|
27498
27467
|
};
|
|
27499
|
-
var se_ListAccountsCommand = async (input,
|
|
27500
|
-
const b3 = core.requestBuilder(input,
|
|
27468
|
+
var se_ListAccountsCommand = async (input, context) => {
|
|
27469
|
+
const b3 = core.requestBuilder(input, context);
|
|
27501
27470
|
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
27502
27471
|
[_xasbt]: input[_aT]
|
|
27503
27472
|
});
|
|
@@ -27510,8 +27479,8 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27510
27479
|
b3.m("GET").h(headers).q(query2).b(body);
|
|
27511
27480
|
return b3.build();
|
|
27512
27481
|
};
|
|
27513
|
-
var se_LogoutCommand = async (input,
|
|
27514
|
-
const b3 = core.requestBuilder(input,
|
|
27482
|
+
var se_LogoutCommand = async (input, context) => {
|
|
27483
|
+
const b3 = core.requestBuilder(input, context);
|
|
27515
27484
|
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
27516
27485
|
[_xasbt]: input[_aT]
|
|
27517
27486
|
});
|
|
@@ -27520,28 +27489,28 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27520
27489
|
b3.m("POST").h(headers).b(body);
|
|
27521
27490
|
return b3.build();
|
|
27522
27491
|
};
|
|
27523
|
-
var de_GetRoleCredentialsCommand = async (output,
|
|
27492
|
+
var de_GetRoleCredentialsCommand = async (output, context) => {
|
|
27524
27493
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
27525
|
-
return de_CommandError3(output,
|
|
27494
|
+
return de_CommandError3(output, context);
|
|
27526
27495
|
}
|
|
27527
27496
|
const contents = smithyClient.map({
|
|
27528
27497
|
$metadata: deserializeMetadata3(output)
|
|
27529
27498
|
});
|
|
27530
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
27499
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
27531
27500
|
const doc = smithyClient.take(data2, {
|
|
27532
27501
|
roleCredentials: smithyClient._json
|
|
27533
27502
|
});
|
|
27534
27503
|
Object.assign(contents, doc);
|
|
27535
27504
|
return contents;
|
|
27536
27505
|
};
|
|
27537
|
-
var de_ListAccountRolesCommand = async (output,
|
|
27506
|
+
var de_ListAccountRolesCommand = async (output, context) => {
|
|
27538
27507
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
27539
|
-
return de_CommandError3(output,
|
|
27508
|
+
return de_CommandError3(output, context);
|
|
27540
27509
|
}
|
|
27541
27510
|
const contents = smithyClient.map({
|
|
27542
27511
|
$metadata: deserializeMetadata3(output)
|
|
27543
27512
|
});
|
|
27544
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
27513
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
27545
27514
|
const doc = smithyClient.take(data2, {
|
|
27546
27515
|
nextToken: smithyClient.expectString,
|
|
27547
27516
|
roleList: smithyClient._json
|
|
@@ -27549,14 +27518,14 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27549
27518
|
Object.assign(contents, doc);
|
|
27550
27519
|
return contents;
|
|
27551
27520
|
};
|
|
27552
|
-
var de_ListAccountsCommand = async (output,
|
|
27521
|
+
var de_ListAccountsCommand = async (output, context) => {
|
|
27553
27522
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
27554
|
-
return de_CommandError3(output,
|
|
27523
|
+
return de_CommandError3(output, context);
|
|
27555
27524
|
}
|
|
27556
27525
|
const contents = smithyClient.map({
|
|
27557
27526
|
$metadata: deserializeMetadata3(output)
|
|
27558
27527
|
});
|
|
27559
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
27528
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
27560
27529
|
const doc = smithyClient.take(data2, {
|
|
27561
27530
|
accountList: smithyClient._json,
|
|
27562
27531
|
nextToken: smithyClient.expectString
|
|
@@ -27564,20 +27533,20 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27564
27533
|
Object.assign(contents, doc);
|
|
27565
27534
|
return contents;
|
|
27566
27535
|
};
|
|
27567
|
-
var de_LogoutCommand = async (output,
|
|
27536
|
+
var de_LogoutCommand = async (output, context) => {
|
|
27568
27537
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
27569
|
-
return de_CommandError3(output,
|
|
27538
|
+
return de_CommandError3(output, context);
|
|
27570
27539
|
}
|
|
27571
27540
|
const contents = smithyClient.map({
|
|
27572
27541
|
$metadata: deserializeMetadata3(output)
|
|
27573
27542
|
});
|
|
27574
|
-
await smithyClient.collectBody(output.body,
|
|
27543
|
+
await smithyClient.collectBody(output.body, context);
|
|
27575
27544
|
return contents;
|
|
27576
27545
|
};
|
|
27577
|
-
var de_CommandError3 = async (output,
|
|
27546
|
+
var de_CommandError3 = async (output, context) => {
|
|
27578
27547
|
const parsedOutput = {
|
|
27579
27548
|
...output,
|
|
27580
|
-
body: await core$1.parseJsonErrorBody(output.body,
|
|
27549
|
+
body: await core$1.parseJsonErrorBody(output.body, context)
|
|
27581
27550
|
};
|
|
27582
27551
|
const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
|
|
27583
27552
|
switch (errorCode) {
|
|
@@ -27603,7 +27572,7 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27603
27572
|
}
|
|
27604
27573
|
};
|
|
27605
27574
|
var throwDefaultError3 = smithyClient.withBaseException(SSOServiceException);
|
|
27606
|
-
var de_InvalidRequestExceptionRes2 = async (parsedOutput,
|
|
27575
|
+
var de_InvalidRequestExceptionRes2 = async (parsedOutput, context) => {
|
|
27607
27576
|
const contents = smithyClient.map({});
|
|
27608
27577
|
const data2 = parsedOutput.body;
|
|
27609
27578
|
const doc = smithyClient.take(data2, {
|
|
@@ -27616,7 +27585,7 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27616
27585
|
});
|
|
27617
27586
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
27618
27587
|
};
|
|
27619
|
-
var de_ResourceNotFoundExceptionRes = async (parsedOutput,
|
|
27588
|
+
var de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
27620
27589
|
const contents = smithyClient.map({});
|
|
27621
27590
|
const data2 = parsedOutput.body;
|
|
27622
27591
|
const doc = smithyClient.take(data2, {
|
|
@@ -27629,7 +27598,7 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27629
27598
|
});
|
|
27630
27599
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
27631
27600
|
};
|
|
27632
|
-
var de_TooManyRequestsExceptionRes = async (parsedOutput,
|
|
27601
|
+
var de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
|
|
27633
27602
|
const contents = smithyClient.map({});
|
|
27634
27603
|
const data2 = parsedOutput.body;
|
|
27635
27604
|
const doc = smithyClient.take(data2, {
|
|
@@ -27642,7 +27611,7 @@ var require_dist_cjs57 = __commonJS({
|
|
|
27642
27611
|
});
|
|
27643
27612
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
27644
27613
|
};
|
|
27645
|
-
var de_UnauthorizedExceptionRes = async (parsedOutput,
|
|
27614
|
+
var de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
|
|
27646
27615
|
const contents = smithyClient.map({});
|
|
27647
27616
|
const data2 = parsedOutput.body;
|
|
27648
27617
|
const doc = smithyClient.take(data2, {
|
|
@@ -27949,10 +27918,10 @@ function createAwsAuthSigv4HttpAuthOption2(authParameters) {
|
|
|
27949
27918
|
name: "sts",
|
|
27950
27919
|
region: authParameters.region
|
|
27951
27920
|
},
|
|
27952
|
-
propertiesExtractor: (config,
|
|
27921
|
+
propertiesExtractor: (config, context) => ({
|
|
27953
27922
|
signingProperties: {
|
|
27954
27923
|
config,
|
|
27955
|
-
context
|
|
27924
|
+
context
|
|
27956
27925
|
}
|
|
27957
27926
|
})
|
|
27958
27927
|
};
|
|
@@ -27968,9 +27937,9 @@ var init_httpAuthSchemeProvider2 = __esm({
|
|
|
27968
27937
|
init_dist_es2();
|
|
27969
27938
|
import_util_middleware7 = __toESM(require_dist_cjs7());
|
|
27970
27939
|
init_STSClient();
|
|
27971
|
-
defaultSTSHttpAuthSchemeParametersProvider = async (config,
|
|
27940
|
+
defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
27972
27941
|
return {
|
|
27973
|
-
operation: (0, import_util_middleware7.getSmithyContext)(
|
|
27942
|
+
operation: (0, import_util_middleware7.getSmithyContext)(context).operation,
|
|
27974
27943
|
region: await (0, import_util_middleware7.normalizeProvider)(config.region)() || (() => {
|
|
27975
27944
|
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
27976
27945
|
})()
|
|
@@ -28080,10 +28049,10 @@ var init_endpointResolver2 = __esm({
|
|
|
28080
28049
|
size: 50,
|
|
28081
28050
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"]
|
|
28082
28051
|
});
|
|
28083
|
-
defaultEndpointResolver2 = (endpointParams,
|
|
28052
|
+
defaultEndpointResolver2 = (endpointParams, context = {}) => {
|
|
28084
28053
|
return cache2.get(endpointParams, () => (0, import_util_endpoints4.resolveEndpoint)(ruleSet2, {
|
|
28085
28054
|
endpointParams,
|
|
28086
|
-
logger:
|
|
28055
|
+
logger: context.logger
|
|
28087
28056
|
}));
|
|
28088
28057
|
};
|
|
28089
28058
|
import_util_endpoints4.customEndpointFunctions.aws = import_util_endpoints3.awsEndpointFunctions;
|
|
@@ -28445,80 +28414,80 @@ var init_Aws_query = __esm({
|
|
|
28445
28414
|
import_smithy_client24 = __toESM(require_dist_cjs27());
|
|
28446
28415
|
init_models_02();
|
|
28447
28416
|
init_STSServiceException();
|
|
28448
|
-
se_AssumeRoleCommand = async (input,
|
|
28417
|
+
se_AssumeRoleCommand = async (input, context) => {
|
|
28449
28418
|
const headers = SHARED_HEADERS;
|
|
28450
28419
|
let body;
|
|
28451
28420
|
body = buildFormUrlencodedString({
|
|
28452
|
-
...se_AssumeRoleRequest(input,
|
|
28421
|
+
...se_AssumeRoleRequest(input, context),
|
|
28453
28422
|
[_A]: _AR,
|
|
28454
28423
|
[_V]: _
|
|
28455
28424
|
});
|
|
28456
|
-
return buildHttpRpcRequest(
|
|
28425
|
+
return buildHttpRpcRequest(context, headers, "/", void 0, body);
|
|
28457
28426
|
};
|
|
28458
|
-
se_AssumeRoleWithWebIdentityCommand = async (input,
|
|
28427
|
+
se_AssumeRoleWithWebIdentityCommand = async (input, context) => {
|
|
28459
28428
|
const headers = SHARED_HEADERS;
|
|
28460
28429
|
let body;
|
|
28461
28430
|
body = buildFormUrlencodedString({
|
|
28462
|
-
...se_AssumeRoleWithWebIdentityRequest(input,
|
|
28431
|
+
...se_AssumeRoleWithWebIdentityRequest(input, context),
|
|
28463
28432
|
[_A]: _ARWWI,
|
|
28464
28433
|
[_V]: _
|
|
28465
28434
|
});
|
|
28466
|
-
return buildHttpRpcRequest(
|
|
28435
|
+
return buildHttpRpcRequest(context, headers, "/", void 0, body);
|
|
28467
28436
|
};
|
|
28468
|
-
de_AssumeRoleCommand = async (output,
|
|
28437
|
+
de_AssumeRoleCommand = async (output, context) => {
|
|
28469
28438
|
if (output.statusCode >= 300) {
|
|
28470
|
-
return de_CommandError2(output,
|
|
28439
|
+
return de_CommandError2(output, context);
|
|
28471
28440
|
}
|
|
28472
|
-
const data2 = await parseXmlBody(output.body,
|
|
28441
|
+
const data2 = await parseXmlBody(output.body, context);
|
|
28473
28442
|
let contents = {};
|
|
28474
|
-
contents = de_AssumeRoleResponse(data2.AssumeRoleResult,
|
|
28443
|
+
contents = de_AssumeRoleResponse(data2.AssumeRoleResult, context);
|
|
28475
28444
|
const response = {
|
|
28476
28445
|
$metadata: deserializeMetadata2(output),
|
|
28477
28446
|
...contents
|
|
28478
28447
|
};
|
|
28479
28448
|
return response;
|
|
28480
28449
|
};
|
|
28481
|
-
de_AssumeRoleWithWebIdentityCommand = async (output,
|
|
28450
|
+
de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
|
|
28482
28451
|
if (output.statusCode >= 300) {
|
|
28483
|
-
return de_CommandError2(output,
|
|
28452
|
+
return de_CommandError2(output, context);
|
|
28484
28453
|
}
|
|
28485
|
-
const data2 = await parseXmlBody(output.body,
|
|
28454
|
+
const data2 = await parseXmlBody(output.body, context);
|
|
28486
28455
|
let contents = {};
|
|
28487
|
-
contents = de_AssumeRoleWithWebIdentityResponse(data2.AssumeRoleWithWebIdentityResult,
|
|
28456
|
+
contents = de_AssumeRoleWithWebIdentityResponse(data2.AssumeRoleWithWebIdentityResult, context);
|
|
28488
28457
|
const response = {
|
|
28489
28458
|
$metadata: deserializeMetadata2(output),
|
|
28490
28459
|
...contents
|
|
28491
28460
|
};
|
|
28492
28461
|
return response;
|
|
28493
28462
|
};
|
|
28494
|
-
de_CommandError2 = async (output,
|
|
28463
|
+
de_CommandError2 = async (output, context) => {
|
|
28495
28464
|
const parsedOutput = {
|
|
28496
28465
|
...output,
|
|
28497
|
-
body: await parseXmlErrorBody(output.body,
|
|
28466
|
+
body: await parseXmlErrorBody(output.body, context)
|
|
28498
28467
|
};
|
|
28499
28468
|
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
28500
28469
|
switch (errorCode) {
|
|
28501
28470
|
case "ExpiredTokenException":
|
|
28502
28471
|
case "com.amazonaws.sts#ExpiredTokenException":
|
|
28503
|
-
throw await de_ExpiredTokenExceptionRes2(parsedOutput,
|
|
28472
|
+
throw await de_ExpiredTokenExceptionRes2(parsedOutput, context);
|
|
28504
28473
|
case "MalformedPolicyDocument":
|
|
28505
28474
|
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
28506
|
-
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput,
|
|
28475
|
+
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
|
|
28507
28476
|
case "PackedPolicyTooLarge":
|
|
28508
28477
|
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
28509
|
-
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput,
|
|
28478
|
+
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
|
|
28510
28479
|
case "RegionDisabledException":
|
|
28511
28480
|
case "com.amazonaws.sts#RegionDisabledException":
|
|
28512
|
-
throw await de_RegionDisabledExceptionRes(parsedOutput,
|
|
28481
|
+
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
28513
28482
|
case "IDPCommunicationError":
|
|
28514
28483
|
case "com.amazonaws.sts#IDPCommunicationErrorException":
|
|
28515
|
-
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput,
|
|
28484
|
+
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
|
|
28516
28485
|
case "IDPRejectedClaim":
|
|
28517
28486
|
case "com.amazonaws.sts#IDPRejectedClaimException":
|
|
28518
|
-
throw await de_IDPRejectedClaimExceptionRes(parsedOutput,
|
|
28487
|
+
throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
|
|
28519
28488
|
case "InvalidIdentityToken":
|
|
28520
28489
|
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
|
28521
|
-
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput,
|
|
28490
|
+
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
|
|
28522
28491
|
default:
|
|
28523
28492
|
const parsedBody = parsedOutput.body;
|
|
28524
28493
|
return throwDefaultError2({
|
|
@@ -28528,70 +28497,70 @@ var init_Aws_query = __esm({
|
|
|
28528
28497
|
});
|
|
28529
28498
|
}
|
|
28530
28499
|
};
|
|
28531
|
-
de_ExpiredTokenExceptionRes2 = async (parsedOutput,
|
|
28500
|
+
de_ExpiredTokenExceptionRes2 = async (parsedOutput, context) => {
|
|
28532
28501
|
const body = parsedOutput.body;
|
|
28533
|
-
const deserialized = de_ExpiredTokenException(body.Error,
|
|
28502
|
+
const deserialized = de_ExpiredTokenException(body.Error, context);
|
|
28534
28503
|
const exception = new ExpiredTokenException2({
|
|
28535
28504
|
$metadata: deserializeMetadata2(parsedOutput),
|
|
28536
28505
|
...deserialized
|
|
28537
28506
|
});
|
|
28538
28507
|
return (0, import_smithy_client24.decorateServiceException)(exception, body);
|
|
28539
28508
|
};
|
|
28540
|
-
de_IDPCommunicationErrorExceptionRes = async (parsedOutput,
|
|
28509
|
+
de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context) => {
|
|
28541
28510
|
const body = parsedOutput.body;
|
|
28542
|
-
const deserialized = de_IDPCommunicationErrorException(body.Error,
|
|
28511
|
+
const deserialized = de_IDPCommunicationErrorException(body.Error, context);
|
|
28543
28512
|
const exception = new IDPCommunicationErrorException({
|
|
28544
28513
|
$metadata: deserializeMetadata2(parsedOutput),
|
|
28545
28514
|
...deserialized
|
|
28546
28515
|
});
|
|
28547
28516
|
return (0, import_smithy_client24.decorateServiceException)(exception, body);
|
|
28548
28517
|
};
|
|
28549
|
-
de_IDPRejectedClaimExceptionRes = async (parsedOutput,
|
|
28518
|
+
de_IDPRejectedClaimExceptionRes = async (parsedOutput, context) => {
|
|
28550
28519
|
const body = parsedOutput.body;
|
|
28551
|
-
const deserialized = de_IDPRejectedClaimException(body.Error,
|
|
28520
|
+
const deserialized = de_IDPRejectedClaimException(body.Error, context);
|
|
28552
28521
|
const exception = new IDPRejectedClaimException({
|
|
28553
28522
|
$metadata: deserializeMetadata2(parsedOutput),
|
|
28554
28523
|
...deserialized
|
|
28555
28524
|
});
|
|
28556
28525
|
return (0, import_smithy_client24.decorateServiceException)(exception, body);
|
|
28557
28526
|
};
|
|
28558
|
-
de_InvalidIdentityTokenExceptionRes = async (parsedOutput,
|
|
28527
|
+
de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context) => {
|
|
28559
28528
|
const body = parsedOutput.body;
|
|
28560
|
-
const deserialized = de_InvalidIdentityTokenException(body.Error,
|
|
28529
|
+
const deserialized = de_InvalidIdentityTokenException(body.Error, context);
|
|
28561
28530
|
const exception = new InvalidIdentityTokenException({
|
|
28562
28531
|
$metadata: deserializeMetadata2(parsedOutput),
|
|
28563
28532
|
...deserialized
|
|
28564
28533
|
});
|
|
28565
28534
|
return (0, import_smithy_client24.decorateServiceException)(exception, body);
|
|
28566
28535
|
};
|
|
28567
|
-
de_MalformedPolicyDocumentExceptionRes = async (parsedOutput,
|
|
28536
|
+
de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => {
|
|
28568
28537
|
const body = parsedOutput.body;
|
|
28569
|
-
const deserialized = de_MalformedPolicyDocumentException(body.Error,
|
|
28538
|
+
const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
|
|
28570
28539
|
const exception = new MalformedPolicyDocumentException({
|
|
28571
28540
|
$metadata: deserializeMetadata2(parsedOutput),
|
|
28572
28541
|
...deserialized
|
|
28573
28542
|
});
|
|
28574
28543
|
return (0, import_smithy_client24.decorateServiceException)(exception, body);
|
|
28575
28544
|
};
|
|
28576
|
-
de_PackedPolicyTooLargeExceptionRes = async (parsedOutput,
|
|
28545
|
+
de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context) => {
|
|
28577
28546
|
const body = parsedOutput.body;
|
|
28578
|
-
const deserialized = de_PackedPolicyTooLargeException(body.Error,
|
|
28547
|
+
const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
|
|
28579
28548
|
const exception = new PackedPolicyTooLargeException({
|
|
28580
28549
|
$metadata: deserializeMetadata2(parsedOutput),
|
|
28581
28550
|
...deserialized
|
|
28582
28551
|
});
|
|
28583
28552
|
return (0, import_smithy_client24.decorateServiceException)(exception, body);
|
|
28584
28553
|
};
|
|
28585
|
-
de_RegionDisabledExceptionRes = async (parsedOutput,
|
|
28554
|
+
de_RegionDisabledExceptionRes = async (parsedOutput, context) => {
|
|
28586
28555
|
const body = parsedOutput.body;
|
|
28587
|
-
const deserialized = de_RegionDisabledException(body.Error,
|
|
28556
|
+
const deserialized = de_RegionDisabledException(body.Error, context);
|
|
28588
28557
|
const exception = new RegionDisabledException({
|
|
28589
28558
|
$metadata: deserializeMetadata2(parsedOutput),
|
|
28590
28559
|
...deserialized
|
|
28591
28560
|
});
|
|
28592
28561
|
return (0, import_smithy_client24.decorateServiceException)(exception, body);
|
|
28593
28562
|
};
|
|
28594
|
-
se_AssumeRoleRequest = (input,
|
|
28563
|
+
se_AssumeRoleRequest = (input, context) => {
|
|
28595
28564
|
const entries = {};
|
|
28596
28565
|
if (input[_RA] != null) {
|
|
28597
28566
|
entries[_RA] = input[_RA];
|
|
@@ -28600,7 +28569,7 @@ var init_Aws_query = __esm({
|
|
|
28600
28569
|
entries[_RSN] = input[_RSN];
|
|
28601
28570
|
}
|
|
28602
28571
|
if (input[_PA] != null) {
|
|
28603
|
-
const memberEntries = se_policyDescriptorListType(input[_PA],
|
|
28572
|
+
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
28604
28573
|
if (input[_PA]?.length === 0) {
|
|
28605
28574
|
entries.PolicyArns = [];
|
|
28606
28575
|
}
|
|
@@ -28616,7 +28585,7 @@ var init_Aws_query = __esm({
|
|
|
28616
28585
|
entries[_DS] = input[_DS];
|
|
28617
28586
|
}
|
|
28618
28587
|
if (input[_T] != null) {
|
|
28619
|
-
const memberEntries = se_tagListType(input[_T],
|
|
28588
|
+
const memberEntries = se_tagListType(input[_T], context);
|
|
28620
28589
|
if (input[_T]?.length === 0) {
|
|
28621
28590
|
entries.Tags = [];
|
|
28622
28591
|
}
|
|
@@ -28626,7 +28595,7 @@ var init_Aws_query = __esm({
|
|
|
28626
28595
|
});
|
|
28627
28596
|
}
|
|
28628
28597
|
if (input[_TTK] != null) {
|
|
28629
|
-
const memberEntries = se_tagKeyListType(input[_TTK],
|
|
28598
|
+
const memberEntries = se_tagKeyListType(input[_TTK], context);
|
|
28630
28599
|
if (input[_TTK]?.length === 0) {
|
|
28631
28600
|
entries.TransitiveTagKeys = [];
|
|
28632
28601
|
}
|
|
@@ -28648,7 +28617,7 @@ var init_Aws_query = __esm({
|
|
|
28648
28617
|
entries[_SI] = input[_SI];
|
|
28649
28618
|
}
|
|
28650
28619
|
if (input[_PC] != null) {
|
|
28651
|
-
const memberEntries = se_ProvidedContextsListType(input[_PC],
|
|
28620
|
+
const memberEntries = se_ProvidedContextsListType(input[_PC], context);
|
|
28652
28621
|
if (input[_PC]?.length === 0) {
|
|
28653
28622
|
entries.ProvidedContexts = [];
|
|
28654
28623
|
}
|
|
@@ -28659,7 +28628,7 @@ var init_Aws_query = __esm({
|
|
|
28659
28628
|
}
|
|
28660
28629
|
return entries;
|
|
28661
28630
|
};
|
|
28662
|
-
se_AssumeRoleWithWebIdentityRequest = (input,
|
|
28631
|
+
se_AssumeRoleWithWebIdentityRequest = (input, context) => {
|
|
28663
28632
|
const entries = {};
|
|
28664
28633
|
if (input[_RA] != null) {
|
|
28665
28634
|
entries[_RA] = input[_RA];
|
|
@@ -28674,7 +28643,7 @@ var init_Aws_query = __esm({
|
|
|
28674
28643
|
entries[_PI] = input[_PI];
|
|
28675
28644
|
}
|
|
28676
28645
|
if (input[_PA] != null) {
|
|
28677
|
-
const memberEntries = se_policyDescriptorListType(input[_PA],
|
|
28646
|
+
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
28678
28647
|
if (input[_PA]?.length === 0) {
|
|
28679
28648
|
entries.PolicyArns = [];
|
|
28680
28649
|
}
|
|
@@ -28691,14 +28660,14 @@ var init_Aws_query = __esm({
|
|
|
28691
28660
|
}
|
|
28692
28661
|
return entries;
|
|
28693
28662
|
};
|
|
28694
|
-
se_policyDescriptorListType = (input,
|
|
28663
|
+
se_policyDescriptorListType = (input, context) => {
|
|
28695
28664
|
const entries = {};
|
|
28696
28665
|
let counter = 1;
|
|
28697
28666
|
for (const entry of input) {
|
|
28698
28667
|
if (entry === null) {
|
|
28699
28668
|
continue;
|
|
28700
28669
|
}
|
|
28701
|
-
const memberEntries = se_PolicyDescriptorType(entry,
|
|
28670
|
+
const memberEntries = se_PolicyDescriptorType(entry, context);
|
|
28702
28671
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
28703
28672
|
entries[`member.${counter}.${key}`] = value;
|
|
28704
28673
|
});
|
|
@@ -28706,14 +28675,14 @@ var init_Aws_query = __esm({
|
|
|
28706
28675
|
}
|
|
28707
28676
|
return entries;
|
|
28708
28677
|
};
|
|
28709
|
-
se_PolicyDescriptorType = (input,
|
|
28678
|
+
se_PolicyDescriptorType = (input, context) => {
|
|
28710
28679
|
const entries = {};
|
|
28711
28680
|
if (input[_a15] != null) {
|
|
28712
28681
|
entries[_a15] = input[_a15];
|
|
28713
28682
|
}
|
|
28714
28683
|
return entries;
|
|
28715
28684
|
};
|
|
28716
|
-
se_ProvidedContext = (input,
|
|
28685
|
+
se_ProvidedContext = (input, context) => {
|
|
28717
28686
|
const entries = {};
|
|
28718
28687
|
if (input[_PAr] != null) {
|
|
28719
28688
|
entries[_PAr] = input[_PAr];
|
|
@@ -28723,14 +28692,14 @@ var init_Aws_query = __esm({
|
|
|
28723
28692
|
}
|
|
28724
28693
|
return entries;
|
|
28725
28694
|
};
|
|
28726
|
-
se_ProvidedContextsListType = (input,
|
|
28695
|
+
se_ProvidedContextsListType = (input, context) => {
|
|
28727
28696
|
const entries = {};
|
|
28728
28697
|
let counter = 1;
|
|
28729
28698
|
for (const entry of input) {
|
|
28730
28699
|
if (entry === null) {
|
|
28731
28700
|
continue;
|
|
28732
28701
|
}
|
|
28733
|
-
const memberEntries = se_ProvidedContext(entry,
|
|
28702
|
+
const memberEntries = se_ProvidedContext(entry, context);
|
|
28734
28703
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
28735
28704
|
entries[`member.${counter}.${key}`] = value;
|
|
28736
28705
|
});
|
|
@@ -28738,7 +28707,7 @@ var init_Aws_query = __esm({
|
|
|
28738
28707
|
}
|
|
28739
28708
|
return entries;
|
|
28740
28709
|
};
|
|
28741
|
-
se_Tag = (input,
|
|
28710
|
+
se_Tag = (input, context) => {
|
|
28742
28711
|
const entries = {};
|
|
28743
28712
|
if (input[_K] != null) {
|
|
28744
28713
|
entries[_K] = input[_K];
|
|
@@ -28748,7 +28717,7 @@ var init_Aws_query = __esm({
|
|
|
28748
28717
|
}
|
|
28749
28718
|
return entries;
|
|
28750
28719
|
};
|
|
28751
|
-
se_tagKeyListType = (input,
|
|
28720
|
+
se_tagKeyListType = (input, context) => {
|
|
28752
28721
|
const entries = {};
|
|
28753
28722
|
let counter = 1;
|
|
28754
28723
|
for (const entry of input) {
|
|
@@ -28760,14 +28729,14 @@ var init_Aws_query = __esm({
|
|
|
28760
28729
|
}
|
|
28761
28730
|
return entries;
|
|
28762
28731
|
};
|
|
28763
|
-
se_tagListType = (input,
|
|
28732
|
+
se_tagListType = (input, context) => {
|
|
28764
28733
|
const entries = {};
|
|
28765
28734
|
let counter = 1;
|
|
28766
28735
|
for (const entry of input) {
|
|
28767
28736
|
if (entry === null) {
|
|
28768
28737
|
continue;
|
|
28769
28738
|
}
|
|
28770
|
-
const memberEntries = se_Tag(entry,
|
|
28739
|
+
const memberEntries = se_Tag(entry, context);
|
|
28771
28740
|
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
28772
28741
|
entries[`member.${counter}.${key}`] = value;
|
|
28773
28742
|
});
|
|
@@ -28775,7 +28744,7 @@ var init_Aws_query = __esm({
|
|
|
28775
28744
|
}
|
|
28776
28745
|
return entries;
|
|
28777
28746
|
};
|
|
28778
|
-
de_AssumedRoleUser = (output,
|
|
28747
|
+
de_AssumedRoleUser = (output, context) => {
|
|
28779
28748
|
const contents = {};
|
|
28780
28749
|
if (output[_ARI] != null) {
|
|
28781
28750
|
contents[_ARI] = (0, import_smithy_client24.expectString)(output[_ARI]);
|
|
@@ -28785,13 +28754,13 @@ var init_Aws_query = __esm({
|
|
|
28785
28754
|
}
|
|
28786
28755
|
return contents;
|
|
28787
28756
|
};
|
|
28788
|
-
de_AssumeRoleResponse = (output,
|
|
28757
|
+
de_AssumeRoleResponse = (output, context) => {
|
|
28789
28758
|
const contents = {};
|
|
28790
28759
|
if (output[_C] != null) {
|
|
28791
|
-
contents[_C] = de_Credentials(output[_C],
|
|
28760
|
+
contents[_C] = de_Credentials(output[_C], context);
|
|
28792
28761
|
}
|
|
28793
28762
|
if (output[_ARU] != null) {
|
|
28794
|
-
contents[_ARU] = de_AssumedRoleUser(output[_ARU],
|
|
28763
|
+
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
|
28795
28764
|
}
|
|
28796
28765
|
if (output[_PPS] != null) {
|
|
28797
28766
|
contents[_PPS] = (0, import_smithy_client24.strictParseInt32)(output[_PPS]);
|
|
@@ -28801,16 +28770,16 @@ var init_Aws_query = __esm({
|
|
|
28801
28770
|
}
|
|
28802
28771
|
return contents;
|
|
28803
28772
|
};
|
|
28804
|
-
de_AssumeRoleWithWebIdentityResponse = (output,
|
|
28773
|
+
de_AssumeRoleWithWebIdentityResponse = (output, context) => {
|
|
28805
28774
|
const contents = {};
|
|
28806
28775
|
if (output[_C] != null) {
|
|
28807
|
-
contents[_C] = de_Credentials(output[_C],
|
|
28776
|
+
contents[_C] = de_Credentials(output[_C], context);
|
|
28808
28777
|
}
|
|
28809
28778
|
if (output[_SFWIT] != null) {
|
|
28810
28779
|
contents[_SFWIT] = (0, import_smithy_client24.expectString)(output[_SFWIT]);
|
|
28811
28780
|
}
|
|
28812
28781
|
if (output[_ARU] != null) {
|
|
28813
|
-
contents[_ARU] = de_AssumedRoleUser(output[_ARU],
|
|
28782
|
+
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
|
28814
28783
|
}
|
|
28815
28784
|
if (output[_PPS] != null) {
|
|
28816
28785
|
contents[_PPS] = (0, import_smithy_client24.strictParseInt32)(output[_PPS]);
|
|
@@ -28826,7 +28795,7 @@ var init_Aws_query = __esm({
|
|
|
28826
28795
|
}
|
|
28827
28796
|
return contents;
|
|
28828
28797
|
};
|
|
28829
|
-
de_Credentials = (output,
|
|
28798
|
+
de_Credentials = (output, context) => {
|
|
28830
28799
|
const contents = {};
|
|
28831
28800
|
if (output[_AKI] != null) {
|
|
28832
28801
|
contents[_AKI] = (0, import_smithy_client24.expectString)(output[_AKI]);
|
|
@@ -28842,49 +28811,49 @@ var init_Aws_query = __esm({
|
|
|
28842
28811
|
}
|
|
28843
28812
|
return contents;
|
|
28844
28813
|
};
|
|
28845
|
-
de_ExpiredTokenException = (output,
|
|
28814
|
+
de_ExpiredTokenException = (output, context) => {
|
|
28846
28815
|
const contents = {};
|
|
28847
28816
|
if (output[_m] != null) {
|
|
28848
28817
|
contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
|
|
28849
28818
|
}
|
|
28850
28819
|
return contents;
|
|
28851
28820
|
};
|
|
28852
|
-
de_IDPCommunicationErrorException = (output,
|
|
28821
|
+
de_IDPCommunicationErrorException = (output, context) => {
|
|
28853
28822
|
const contents = {};
|
|
28854
28823
|
if (output[_m] != null) {
|
|
28855
28824
|
contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
|
|
28856
28825
|
}
|
|
28857
28826
|
return contents;
|
|
28858
28827
|
};
|
|
28859
|
-
de_IDPRejectedClaimException = (output,
|
|
28828
|
+
de_IDPRejectedClaimException = (output, context) => {
|
|
28860
28829
|
const contents = {};
|
|
28861
28830
|
if (output[_m] != null) {
|
|
28862
28831
|
contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
|
|
28863
28832
|
}
|
|
28864
28833
|
return contents;
|
|
28865
28834
|
};
|
|
28866
|
-
de_InvalidIdentityTokenException = (output,
|
|
28835
|
+
de_InvalidIdentityTokenException = (output, context) => {
|
|
28867
28836
|
const contents = {};
|
|
28868
28837
|
if (output[_m] != null) {
|
|
28869
28838
|
contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
|
|
28870
28839
|
}
|
|
28871
28840
|
return contents;
|
|
28872
28841
|
};
|
|
28873
|
-
de_MalformedPolicyDocumentException = (output,
|
|
28842
|
+
de_MalformedPolicyDocumentException = (output, context) => {
|
|
28874
28843
|
const contents = {};
|
|
28875
28844
|
if (output[_m] != null) {
|
|
28876
28845
|
contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
|
|
28877
28846
|
}
|
|
28878
28847
|
return contents;
|
|
28879
28848
|
};
|
|
28880
|
-
de_PackedPolicyTooLargeException = (output,
|
|
28849
|
+
de_PackedPolicyTooLargeException = (output, context) => {
|
|
28881
28850
|
const contents = {};
|
|
28882
28851
|
if (output[_m] != null) {
|
|
28883
28852
|
contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
|
|
28884
28853
|
}
|
|
28885
28854
|
return contents;
|
|
28886
28855
|
};
|
|
28887
|
-
de_RegionDisabledException = (output,
|
|
28856
|
+
de_RegionDisabledException = (output, context) => {
|
|
28888
28857
|
const contents = {};
|
|
28889
28858
|
if (output[_m] != null) {
|
|
28890
28859
|
contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
|
|
@@ -28898,8 +28867,8 @@ var init_Aws_query = __esm({
|
|
|
28898
28867
|
cfId: output.headers["x-amz-cf-id"]
|
|
28899
28868
|
});
|
|
28900
28869
|
throwDefaultError2 = (0, import_smithy_client24.withBaseException)(STSServiceException);
|
|
28901
|
-
buildHttpRpcRequest = async (
|
|
28902
|
-
const { hostname, protocol = "https", port, path: basePath } = await
|
|
28870
|
+
buildHttpRpcRequest = async (context, headers, path7, resolvedHostname, body) => {
|
|
28871
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
28903
28872
|
const contents = {
|
|
28904
28873
|
protocol,
|
|
28905
28874
|
hostname,
|
|
@@ -29749,7 +29718,7 @@ var require_dist_cjs63 = __commonJS({
|
|
|
29749
29718
|
this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
|
|
29750
29719
|
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
|
|
29751
29720
|
}
|
|
29752
|
-
async handle(next, args,
|
|
29721
|
+
async handle(next, args, context = {}) {
|
|
29753
29722
|
const request = args.request;
|
|
29754
29723
|
const { body: payload2, query: query2 } = request;
|
|
29755
29724
|
if (!(payload2 instanceof stream2.Readable)) {
|
|
@@ -29887,10 +29856,10 @@ var require_endpointResolver2 = __commonJS({
|
|
|
29887
29856
|
size: 50,
|
|
29888
29857
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
|
|
29889
29858
|
});
|
|
29890
|
-
var defaultEndpointResolver3 = (endpointParams,
|
|
29859
|
+
var defaultEndpointResolver3 = (endpointParams, context = {}) => {
|
|
29891
29860
|
return cache3.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
|
|
29892
29861
|
endpointParams,
|
|
29893
|
-
logger:
|
|
29862
|
+
logger: context.logger
|
|
29894
29863
|
}));
|
|
29895
29864
|
};
|
|
29896
29865
|
exports2.defaultEndpointResolver = defaultEndpointResolver3;
|
|
@@ -31298,8 +31267,8 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31298
31267
|
...obj,
|
|
31299
31268
|
...obj.input && { input: CountTokensInputFilterSensitiveLog(obj.input) }
|
|
31300
31269
|
});
|
|
31301
|
-
var se_ApplyGuardrailCommand = async (input,
|
|
31302
|
-
const b3 = core.requestBuilder(input,
|
|
31270
|
+
var se_ApplyGuardrailCommand = async (input, context) => {
|
|
31271
|
+
const b3 = core.requestBuilder(input, context);
|
|
31303
31272
|
const headers = {
|
|
31304
31273
|
"content-type": "application/json"
|
|
31305
31274
|
};
|
|
@@ -31308,15 +31277,15 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31308
31277
|
b3.p("guardrailVersion", () => input.guardrailVersion, "{guardrailVersion}", false);
|
|
31309
31278
|
let body;
|
|
31310
31279
|
body = JSON.stringify(smithyClient.take(input, {
|
|
31311
|
-
content: (_2) => se_GuardrailContentBlockList(_2,
|
|
31280
|
+
content: (_2) => se_GuardrailContentBlockList(_2, context),
|
|
31312
31281
|
outputScope: [],
|
|
31313
31282
|
source: []
|
|
31314
31283
|
}));
|
|
31315
31284
|
b3.m("POST").h(headers).b(body);
|
|
31316
31285
|
return b3.build();
|
|
31317
31286
|
};
|
|
31318
|
-
var se_ConverseCommand = async (input,
|
|
31319
|
-
const b3 = core.requestBuilder(input,
|
|
31287
|
+
var se_ConverseCommand = async (input, context) => {
|
|
31288
|
+
const b3 = core.requestBuilder(input, context);
|
|
31320
31289
|
const headers = {
|
|
31321
31290
|
"content-type": "application/json"
|
|
31322
31291
|
};
|
|
@@ -31328,18 +31297,18 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31328
31297
|
additionalModelResponseFieldPaths: (_2) => smithyClient._json(_2),
|
|
31329
31298
|
guardrailConfig: (_2) => smithyClient._json(_2),
|
|
31330
31299
|
inferenceConfig: (_2) => se_InferenceConfiguration(_2),
|
|
31331
|
-
messages: (_2) => se_Messages(_2,
|
|
31300
|
+
messages: (_2) => se_Messages(_2, context),
|
|
31332
31301
|
performanceConfig: (_2) => smithyClient._json(_2),
|
|
31333
31302
|
promptVariables: (_2) => smithyClient._json(_2),
|
|
31334
31303
|
requestMetadata: (_2) => smithyClient._json(_2),
|
|
31335
|
-
system: (_2) => se_SystemContentBlocks(_2,
|
|
31304
|
+
system: (_2) => se_SystemContentBlocks(_2, context),
|
|
31336
31305
|
toolConfig: (_2) => se_ToolConfiguration(_2)
|
|
31337
31306
|
}));
|
|
31338
31307
|
b3.m("POST").h(headers).b(body);
|
|
31339
31308
|
return b3.build();
|
|
31340
31309
|
};
|
|
31341
|
-
var se_ConverseStreamCommand = async (input,
|
|
31342
|
-
const b3 = core.requestBuilder(input,
|
|
31310
|
+
var se_ConverseStreamCommand = async (input, context) => {
|
|
31311
|
+
const b3 = core.requestBuilder(input, context);
|
|
31343
31312
|
const headers = {
|
|
31344
31313
|
"content-type": "application/json"
|
|
31345
31314
|
};
|
|
@@ -31351,18 +31320,18 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31351
31320
|
additionalModelResponseFieldPaths: (_2) => smithyClient._json(_2),
|
|
31352
31321
|
guardrailConfig: (_2) => smithyClient._json(_2),
|
|
31353
31322
|
inferenceConfig: (_2) => se_InferenceConfiguration(_2),
|
|
31354
|
-
messages: (_2) => se_Messages(_2,
|
|
31323
|
+
messages: (_2) => se_Messages(_2, context),
|
|
31355
31324
|
performanceConfig: (_2) => smithyClient._json(_2),
|
|
31356
31325
|
promptVariables: (_2) => smithyClient._json(_2),
|
|
31357
31326
|
requestMetadata: (_2) => smithyClient._json(_2),
|
|
31358
|
-
system: (_2) => se_SystemContentBlocks(_2,
|
|
31327
|
+
system: (_2) => se_SystemContentBlocks(_2, context),
|
|
31359
31328
|
toolConfig: (_2) => se_ToolConfiguration(_2)
|
|
31360
31329
|
}));
|
|
31361
31330
|
b3.m("POST").h(headers).b(body);
|
|
31362
31331
|
return b3.build();
|
|
31363
31332
|
};
|
|
31364
|
-
var se_CountTokensCommand = async (input,
|
|
31365
|
-
const b3 = core.requestBuilder(input,
|
|
31333
|
+
var se_CountTokensCommand = async (input, context) => {
|
|
31334
|
+
const b3 = core.requestBuilder(input, context);
|
|
31366
31335
|
const headers = {
|
|
31367
31336
|
"content-type": "application/json"
|
|
31368
31337
|
};
|
|
@@ -31370,13 +31339,13 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31370
31339
|
b3.p("modelId", () => input.modelId, "{modelId}", false);
|
|
31371
31340
|
let body;
|
|
31372
31341
|
body = JSON.stringify(smithyClient.take(input, {
|
|
31373
|
-
input: (_2) => se_CountTokensInput(_2,
|
|
31342
|
+
input: (_2) => se_CountTokensInput(_2, context)
|
|
31374
31343
|
}));
|
|
31375
31344
|
b3.m("POST").h(headers).b(body);
|
|
31376
31345
|
return b3.build();
|
|
31377
31346
|
};
|
|
31378
|
-
var se_GetAsyncInvokeCommand = async (input,
|
|
31379
|
-
const b3 = core.requestBuilder(input,
|
|
31347
|
+
var se_GetAsyncInvokeCommand = async (input, context) => {
|
|
31348
|
+
const b3 = core.requestBuilder(input, context);
|
|
31380
31349
|
const headers = {};
|
|
31381
31350
|
b3.bp("/async-invoke/{invocationArn}");
|
|
31382
31351
|
b3.p("invocationArn", () => input.invocationArn, "{invocationArn}", false);
|
|
@@ -31384,8 +31353,8 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31384
31353
|
b3.m("GET").h(headers).b(body);
|
|
31385
31354
|
return b3.build();
|
|
31386
31355
|
};
|
|
31387
|
-
var se_InvokeModelCommand = async (input,
|
|
31388
|
-
const b3 = core.requestBuilder(input,
|
|
31356
|
+
var se_InvokeModelCommand = async (input, context) => {
|
|
31357
|
+
const b3 = core.requestBuilder(input, context);
|
|
31389
31358
|
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
31390
31359
|
[_ct]: input[_cT] || "application/octet-stream",
|
|
31391
31360
|
[_a16]: input[_a16],
|
|
@@ -31403,8 +31372,8 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31403
31372
|
b3.m("POST").h(headers).b(body);
|
|
31404
31373
|
return b3.build();
|
|
31405
31374
|
};
|
|
31406
|
-
var se_InvokeModelWithBidirectionalStreamCommand = async (input,
|
|
31407
|
-
const b3 = core.requestBuilder(input,
|
|
31375
|
+
var se_InvokeModelWithBidirectionalStreamCommand = async (input, context) => {
|
|
31376
|
+
const b3 = core.requestBuilder(input, context);
|
|
31408
31377
|
const headers = {
|
|
31409
31378
|
"content-type": "application/json"
|
|
31410
31379
|
};
|
|
@@ -31412,13 +31381,13 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31412
31381
|
b3.p("modelId", () => input.modelId, "{modelId}", false);
|
|
31413
31382
|
let body;
|
|
31414
31383
|
if (input.body !== void 0) {
|
|
31415
|
-
body = se_InvokeModelWithBidirectionalStreamInput(input.body,
|
|
31384
|
+
body = se_InvokeModelWithBidirectionalStreamInput(input.body, context);
|
|
31416
31385
|
}
|
|
31417
31386
|
b3.m("POST").h(headers).b(body);
|
|
31418
31387
|
return b3.build();
|
|
31419
31388
|
};
|
|
31420
|
-
var se_InvokeModelWithResponseStreamCommand = async (input,
|
|
31421
|
-
const b3 = core.requestBuilder(input,
|
|
31389
|
+
var se_InvokeModelWithResponseStreamCommand = async (input, context) => {
|
|
31390
|
+
const b3 = core.requestBuilder(input, context);
|
|
31422
31391
|
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
31423
31392
|
[_ct]: input[_cT] || "application/octet-stream",
|
|
31424
31393
|
[_xaba]: input[_a16],
|
|
@@ -31436,8 +31405,8 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31436
31405
|
b3.m("POST").h(headers).b(body);
|
|
31437
31406
|
return b3.build();
|
|
31438
31407
|
};
|
|
31439
|
-
var se_ListAsyncInvokesCommand = async (input,
|
|
31440
|
-
const b3 = core.requestBuilder(input,
|
|
31408
|
+
var se_ListAsyncInvokesCommand = async (input, context) => {
|
|
31409
|
+
const b3 = core.requestBuilder(input, context);
|
|
31441
31410
|
const headers = {};
|
|
31442
31411
|
b3.bp("/async-invoke");
|
|
31443
31412
|
const query2 = smithyClient.map({
|
|
@@ -31453,8 +31422,8 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31453
31422
|
b3.m("GET").h(headers).q(query2).b(body);
|
|
31454
31423
|
return b3.build();
|
|
31455
31424
|
};
|
|
31456
|
-
var se_StartAsyncInvokeCommand = async (input,
|
|
31457
|
-
const b3 = core.requestBuilder(input,
|
|
31425
|
+
var se_StartAsyncInvokeCommand = async (input, context) => {
|
|
31426
|
+
const b3 = core.requestBuilder(input, context);
|
|
31458
31427
|
const headers = {
|
|
31459
31428
|
"content-type": "application/json"
|
|
31460
31429
|
};
|
|
@@ -31470,14 +31439,14 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31470
31439
|
b3.m("POST").h(headers).b(body);
|
|
31471
31440
|
return b3.build();
|
|
31472
31441
|
};
|
|
31473
|
-
var de_ApplyGuardrailCommand = async (output,
|
|
31442
|
+
var de_ApplyGuardrailCommand = async (output, context) => {
|
|
31474
31443
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31475
|
-
return de_CommandError3(output,
|
|
31444
|
+
return de_CommandError3(output, context);
|
|
31476
31445
|
}
|
|
31477
31446
|
const contents = smithyClient.map({
|
|
31478
31447
|
$metadata: deserializeMetadata3(output)
|
|
31479
31448
|
});
|
|
31480
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
31449
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
31481
31450
|
const doc = smithyClient.take(data2, {
|
|
31482
31451
|
action: smithyClient.expectString,
|
|
31483
31452
|
actionReason: smithyClient.expectString,
|
|
@@ -31489,18 +31458,18 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31489
31458
|
Object.assign(contents, doc);
|
|
31490
31459
|
return contents;
|
|
31491
31460
|
};
|
|
31492
|
-
var de_ConverseCommand = async (output,
|
|
31461
|
+
var de_ConverseCommand = async (output, context) => {
|
|
31493
31462
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31494
|
-
return de_CommandError3(output,
|
|
31463
|
+
return de_CommandError3(output, context);
|
|
31495
31464
|
}
|
|
31496
31465
|
const contents = smithyClient.map({
|
|
31497
31466
|
$metadata: deserializeMetadata3(output)
|
|
31498
31467
|
});
|
|
31499
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
31468
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
31500
31469
|
const doc = smithyClient.take(data2, {
|
|
31501
31470
|
additionalModelResponseFields: (_2) => de_Document(_2),
|
|
31502
31471
|
metrics: smithyClient._json,
|
|
31503
|
-
output: (_2) => de_ConverseOutput(core$1.awsExpectUnion(_2),
|
|
31472
|
+
output: (_2) => de_ConverseOutput(core$1.awsExpectUnion(_2), context),
|
|
31504
31473
|
performanceConfig: smithyClient._json,
|
|
31505
31474
|
stopReason: smithyClient.expectString,
|
|
31506
31475
|
trace: (_2) => de_ConverseTrace(_2),
|
|
@@ -31509,39 +31478,39 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31509
31478
|
Object.assign(contents, doc);
|
|
31510
31479
|
return contents;
|
|
31511
31480
|
};
|
|
31512
|
-
var de_ConverseStreamCommand = async (output,
|
|
31481
|
+
var de_ConverseStreamCommand = async (output, context) => {
|
|
31513
31482
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31514
|
-
return de_CommandError3(output,
|
|
31483
|
+
return de_CommandError3(output, context);
|
|
31515
31484
|
}
|
|
31516
31485
|
const contents = smithyClient.map({
|
|
31517
31486
|
$metadata: deserializeMetadata3(output)
|
|
31518
31487
|
});
|
|
31519
31488
|
const data2 = output.body;
|
|
31520
|
-
contents.stream = de_ConverseStreamOutput(data2,
|
|
31489
|
+
contents.stream = de_ConverseStreamOutput(data2, context);
|
|
31521
31490
|
return contents;
|
|
31522
31491
|
};
|
|
31523
|
-
var de_CountTokensCommand = async (output,
|
|
31492
|
+
var de_CountTokensCommand = async (output, context) => {
|
|
31524
31493
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31525
|
-
return de_CommandError3(output,
|
|
31494
|
+
return de_CommandError3(output, context);
|
|
31526
31495
|
}
|
|
31527
31496
|
const contents = smithyClient.map({
|
|
31528
31497
|
$metadata: deserializeMetadata3(output)
|
|
31529
31498
|
});
|
|
31530
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
31499
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
31531
31500
|
const doc = smithyClient.take(data2, {
|
|
31532
31501
|
inputTokens: smithyClient.expectInt32
|
|
31533
31502
|
});
|
|
31534
31503
|
Object.assign(contents, doc);
|
|
31535
31504
|
return contents;
|
|
31536
31505
|
};
|
|
31537
|
-
var de_GetAsyncInvokeCommand = async (output,
|
|
31506
|
+
var de_GetAsyncInvokeCommand = async (output, context) => {
|
|
31538
31507
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31539
|
-
return de_CommandError3(output,
|
|
31508
|
+
return de_CommandError3(output, context);
|
|
31540
31509
|
}
|
|
31541
31510
|
const contents = smithyClient.map({
|
|
31542
31511
|
$metadata: deserializeMetadata3(output)
|
|
31543
31512
|
});
|
|
31544
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
31513
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
31545
31514
|
const doc = smithyClient.take(data2, {
|
|
31546
31515
|
clientRequestToken: smithyClient.expectString,
|
|
31547
31516
|
endTime: (_2) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_2)),
|
|
@@ -31556,33 +31525,33 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31556
31525
|
Object.assign(contents, doc);
|
|
31557
31526
|
return contents;
|
|
31558
31527
|
};
|
|
31559
|
-
var de_InvokeModelCommand = async (output,
|
|
31528
|
+
var de_InvokeModelCommand = async (output, context) => {
|
|
31560
31529
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31561
|
-
return de_CommandError3(output,
|
|
31530
|
+
return de_CommandError3(output, context);
|
|
31562
31531
|
}
|
|
31563
31532
|
const contents = smithyClient.map({
|
|
31564
31533
|
$metadata: deserializeMetadata3(output),
|
|
31565
31534
|
[_cT]: [, output.headers[_ct]],
|
|
31566
31535
|
[_pCL]: [, output.headers[_xabpl]]
|
|
31567
31536
|
});
|
|
31568
|
-
const data2 = await smithyClient.collectBody(output.body,
|
|
31537
|
+
const data2 = await smithyClient.collectBody(output.body, context);
|
|
31569
31538
|
contents.body = data2;
|
|
31570
31539
|
return contents;
|
|
31571
31540
|
};
|
|
31572
|
-
var de_InvokeModelWithBidirectionalStreamCommand = async (output,
|
|
31541
|
+
var de_InvokeModelWithBidirectionalStreamCommand = async (output, context) => {
|
|
31573
31542
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31574
|
-
return de_CommandError3(output,
|
|
31543
|
+
return de_CommandError3(output, context);
|
|
31575
31544
|
}
|
|
31576
31545
|
const contents = smithyClient.map({
|
|
31577
31546
|
$metadata: deserializeMetadata3(output)
|
|
31578
31547
|
});
|
|
31579
31548
|
const data2 = output.body;
|
|
31580
|
-
contents.body = de_InvokeModelWithBidirectionalStreamOutput(data2,
|
|
31549
|
+
contents.body = de_InvokeModelWithBidirectionalStreamOutput(data2, context);
|
|
31581
31550
|
return contents;
|
|
31582
31551
|
};
|
|
31583
|
-
var de_InvokeModelWithResponseStreamCommand = async (output,
|
|
31552
|
+
var de_InvokeModelWithResponseStreamCommand = async (output, context) => {
|
|
31584
31553
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31585
|
-
return de_CommandError3(output,
|
|
31554
|
+
return de_CommandError3(output, context);
|
|
31586
31555
|
}
|
|
31587
31556
|
const contents = smithyClient.map({
|
|
31588
31557
|
$metadata: deserializeMetadata3(output),
|
|
@@ -31590,17 +31559,17 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31590
31559
|
[_pCL]: [, output.headers[_xabpl]]
|
|
31591
31560
|
});
|
|
31592
31561
|
const data2 = output.body;
|
|
31593
|
-
contents.body = de_ResponseStream(data2,
|
|
31562
|
+
contents.body = de_ResponseStream(data2, context);
|
|
31594
31563
|
return contents;
|
|
31595
31564
|
};
|
|
31596
|
-
var de_ListAsyncInvokesCommand = async (output,
|
|
31565
|
+
var de_ListAsyncInvokesCommand = async (output, context) => {
|
|
31597
31566
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31598
|
-
return de_CommandError3(output,
|
|
31567
|
+
return de_CommandError3(output, context);
|
|
31599
31568
|
}
|
|
31600
31569
|
const contents = smithyClient.map({
|
|
31601
31570
|
$metadata: deserializeMetadata3(output)
|
|
31602
31571
|
});
|
|
31603
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
31572
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
31604
31573
|
const doc = smithyClient.take(data2, {
|
|
31605
31574
|
asyncInvokeSummaries: (_2) => de_AsyncInvokeSummaries(_2),
|
|
31606
31575
|
nextToken: smithyClient.expectString
|
|
@@ -31608,24 +31577,24 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31608
31577
|
Object.assign(contents, doc);
|
|
31609
31578
|
return contents;
|
|
31610
31579
|
};
|
|
31611
|
-
var de_StartAsyncInvokeCommand = async (output,
|
|
31580
|
+
var de_StartAsyncInvokeCommand = async (output, context) => {
|
|
31612
31581
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
31613
|
-
return de_CommandError3(output,
|
|
31582
|
+
return de_CommandError3(output, context);
|
|
31614
31583
|
}
|
|
31615
31584
|
const contents = smithyClient.map({
|
|
31616
31585
|
$metadata: deserializeMetadata3(output)
|
|
31617
31586
|
});
|
|
31618
|
-
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body,
|
|
31587
|
+
const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
31619
31588
|
const doc = smithyClient.take(data2, {
|
|
31620
31589
|
invocationArn: smithyClient.expectString
|
|
31621
31590
|
});
|
|
31622
31591
|
Object.assign(contents, doc);
|
|
31623
31592
|
return contents;
|
|
31624
31593
|
};
|
|
31625
|
-
var de_CommandError3 = async (output,
|
|
31594
|
+
var de_CommandError3 = async (output, context) => {
|
|
31626
31595
|
const parsedOutput = {
|
|
31627
31596
|
...output,
|
|
31628
|
-
body: await core$1.parseJsonErrorBody(output.body,
|
|
31597
|
+
body: await core$1.parseJsonErrorBody(output.body, context)
|
|
31629
31598
|
};
|
|
31630
31599
|
const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
|
|
31631
31600
|
switch (errorCode) {
|
|
@@ -31675,7 +31644,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31675
31644
|
}
|
|
31676
31645
|
};
|
|
31677
31646
|
var throwDefaultError3 = smithyClient.withBaseException(BedrockRuntimeServiceException);
|
|
31678
|
-
var de_AccessDeniedExceptionRes2 = async (parsedOutput,
|
|
31647
|
+
var de_AccessDeniedExceptionRes2 = async (parsedOutput, context) => {
|
|
31679
31648
|
const contents = smithyClient.map({});
|
|
31680
31649
|
const data2 = parsedOutput.body;
|
|
31681
31650
|
const doc = smithyClient.take(data2, {
|
|
@@ -31688,7 +31657,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31688
31657
|
});
|
|
31689
31658
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31690
31659
|
};
|
|
31691
|
-
var de_ConflictExceptionRes = async (parsedOutput,
|
|
31660
|
+
var de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
31692
31661
|
const contents = smithyClient.map({});
|
|
31693
31662
|
const data2 = parsedOutput.body;
|
|
31694
31663
|
const doc = smithyClient.take(data2, {
|
|
@@ -31701,7 +31670,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31701
31670
|
});
|
|
31702
31671
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31703
31672
|
};
|
|
31704
|
-
var de_InternalServerExceptionRes2 = async (parsedOutput,
|
|
31673
|
+
var de_InternalServerExceptionRes2 = async (parsedOutput, context) => {
|
|
31705
31674
|
const contents = smithyClient.map({});
|
|
31706
31675
|
const data2 = parsedOutput.body;
|
|
31707
31676
|
const doc = smithyClient.take(data2, {
|
|
@@ -31714,7 +31683,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31714
31683
|
});
|
|
31715
31684
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31716
31685
|
};
|
|
31717
|
-
var de_ModelErrorExceptionRes = async (parsedOutput,
|
|
31686
|
+
var de_ModelErrorExceptionRes = async (parsedOutput, context) => {
|
|
31718
31687
|
const contents = smithyClient.map({});
|
|
31719
31688
|
const data2 = parsedOutput.body;
|
|
31720
31689
|
const doc = smithyClient.take(data2, {
|
|
@@ -31729,7 +31698,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31729
31698
|
});
|
|
31730
31699
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31731
31700
|
};
|
|
31732
|
-
var de_ModelNotReadyExceptionRes = async (parsedOutput,
|
|
31701
|
+
var de_ModelNotReadyExceptionRes = async (parsedOutput, context) => {
|
|
31733
31702
|
const contents = smithyClient.map({});
|
|
31734
31703
|
const data2 = parsedOutput.body;
|
|
31735
31704
|
const doc = smithyClient.take(data2, {
|
|
@@ -31742,7 +31711,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31742
31711
|
});
|
|
31743
31712
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31744
31713
|
};
|
|
31745
|
-
var de_ModelStreamErrorExceptionRes = async (parsedOutput,
|
|
31714
|
+
var de_ModelStreamErrorExceptionRes = async (parsedOutput, context) => {
|
|
31746
31715
|
const contents = smithyClient.map({});
|
|
31747
31716
|
const data2 = parsedOutput.body;
|
|
31748
31717
|
const doc = smithyClient.take(data2, {
|
|
@@ -31757,7 +31726,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31757
31726
|
});
|
|
31758
31727
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31759
31728
|
};
|
|
31760
|
-
var de_ModelTimeoutExceptionRes = async (parsedOutput,
|
|
31729
|
+
var de_ModelTimeoutExceptionRes = async (parsedOutput, context) => {
|
|
31761
31730
|
const contents = smithyClient.map({});
|
|
31762
31731
|
const data2 = parsedOutput.body;
|
|
31763
31732
|
const doc = smithyClient.take(data2, {
|
|
@@ -31770,7 +31739,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31770
31739
|
});
|
|
31771
31740
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31772
31741
|
};
|
|
31773
|
-
var de_ResourceNotFoundExceptionRes = async (parsedOutput,
|
|
31742
|
+
var de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
31774
31743
|
const contents = smithyClient.map({});
|
|
31775
31744
|
const data2 = parsedOutput.body;
|
|
31776
31745
|
const doc = smithyClient.take(data2, {
|
|
@@ -31783,7 +31752,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31783
31752
|
});
|
|
31784
31753
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31785
31754
|
};
|
|
31786
|
-
var de_ServiceQuotaExceededExceptionRes = async (parsedOutput,
|
|
31755
|
+
var de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
31787
31756
|
const contents = smithyClient.map({});
|
|
31788
31757
|
const data2 = parsedOutput.body;
|
|
31789
31758
|
const doc = smithyClient.take(data2, {
|
|
@@ -31796,7 +31765,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31796
31765
|
});
|
|
31797
31766
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31798
31767
|
};
|
|
31799
|
-
var de_ServiceUnavailableExceptionRes = async (parsedOutput,
|
|
31768
|
+
var de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
|
|
31800
31769
|
const contents = smithyClient.map({});
|
|
31801
31770
|
const data2 = parsedOutput.body;
|
|
31802
31771
|
const doc = smithyClient.take(data2, {
|
|
@@ -31809,7 +31778,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31809
31778
|
});
|
|
31810
31779
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31811
31780
|
};
|
|
31812
|
-
var de_ThrottlingExceptionRes = async (parsedOutput,
|
|
31781
|
+
var de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
31813
31782
|
const contents = smithyClient.map({});
|
|
31814
31783
|
const data2 = parsedOutput.body;
|
|
31815
31784
|
const doc = smithyClient.take(data2, {
|
|
@@ -31822,7 +31791,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31822
31791
|
});
|
|
31823
31792
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31824
31793
|
};
|
|
31825
|
-
var de_ValidationExceptionRes = async (parsedOutput,
|
|
31794
|
+
var de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
31826
31795
|
const contents = smithyClient.map({});
|
|
31827
31796
|
const data2 = parsedOutput.body;
|
|
31828
31797
|
const doc = smithyClient.take(data2, {
|
|
@@ -31835,367 +31804,367 @@ var require_dist_cjs65 = __commonJS({
|
|
|
31835
31804
|
});
|
|
31836
31805
|
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
31837
31806
|
};
|
|
31838
|
-
var se_InvokeModelWithBidirectionalStreamInput = (input,
|
|
31807
|
+
var se_InvokeModelWithBidirectionalStreamInput = (input, context) => {
|
|
31839
31808
|
const eventMarshallingVisitor = (event) => exports2.InvokeModelWithBidirectionalStreamInput.visit(event, {
|
|
31840
|
-
chunk: (value) => se_BidirectionalInputPayloadPart_event(value,
|
|
31809
|
+
chunk: (value) => se_BidirectionalInputPayloadPart_event(value, context),
|
|
31841
31810
|
_: (value) => value
|
|
31842
31811
|
});
|
|
31843
|
-
return
|
|
31812
|
+
return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
|
|
31844
31813
|
};
|
|
31845
|
-
var se_BidirectionalInputPayloadPart_event = (input,
|
|
31814
|
+
var se_BidirectionalInputPayloadPart_event = (input, context) => {
|
|
31846
31815
|
const headers = {
|
|
31847
31816
|
":event-type": { type: "string", value: "chunk" },
|
|
31848
31817
|
":message-type": { type: "string", value: "event" },
|
|
31849
31818
|
":content-type": { type: "string", value: "application/json" }
|
|
31850
31819
|
};
|
|
31851
31820
|
let body = new Uint8Array();
|
|
31852
|
-
body = se_BidirectionalInputPayloadPart(input,
|
|
31853
|
-
body =
|
|
31821
|
+
body = se_BidirectionalInputPayloadPart(input, context);
|
|
31822
|
+
body = context.utf8Decoder(JSON.stringify(body));
|
|
31854
31823
|
return { headers, body };
|
|
31855
31824
|
};
|
|
31856
|
-
var de_ConverseStreamOutput = (output,
|
|
31857
|
-
return
|
|
31825
|
+
var de_ConverseStreamOutput = (output, context) => {
|
|
31826
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
31858
31827
|
if (event["messageStart"] != null) {
|
|
31859
31828
|
return {
|
|
31860
|
-
messageStart: await de_MessageStartEvent_event(event["messageStart"],
|
|
31829
|
+
messageStart: await de_MessageStartEvent_event(event["messageStart"], context)
|
|
31861
31830
|
};
|
|
31862
31831
|
}
|
|
31863
31832
|
if (event["contentBlockStart"] != null) {
|
|
31864
31833
|
return {
|
|
31865
|
-
contentBlockStart: await de_ContentBlockStartEvent_event(event["contentBlockStart"],
|
|
31834
|
+
contentBlockStart: await de_ContentBlockStartEvent_event(event["contentBlockStart"], context)
|
|
31866
31835
|
};
|
|
31867
31836
|
}
|
|
31868
31837
|
if (event["contentBlockDelta"] != null) {
|
|
31869
31838
|
return {
|
|
31870
|
-
contentBlockDelta: await de_ContentBlockDeltaEvent_event(event["contentBlockDelta"],
|
|
31839
|
+
contentBlockDelta: await de_ContentBlockDeltaEvent_event(event["contentBlockDelta"], context)
|
|
31871
31840
|
};
|
|
31872
31841
|
}
|
|
31873
31842
|
if (event["contentBlockStop"] != null) {
|
|
31874
31843
|
return {
|
|
31875
|
-
contentBlockStop: await de_ContentBlockStopEvent_event(event["contentBlockStop"],
|
|
31844
|
+
contentBlockStop: await de_ContentBlockStopEvent_event(event["contentBlockStop"], context)
|
|
31876
31845
|
};
|
|
31877
31846
|
}
|
|
31878
31847
|
if (event["messageStop"] != null) {
|
|
31879
31848
|
return {
|
|
31880
|
-
messageStop: await de_MessageStopEvent_event(event["messageStop"],
|
|
31849
|
+
messageStop: await de_MessageStopEvent_event(event["messageStop"], context)
|
|
31881
31850
|
};
|
|
31882
31851
|
}
|
|
31883
31852
|
if (event["metadata"] != null) {
|
|
31884
31853
|
return {
|
|
31885
|
-
metadata: await de_ConverseStreamMetadataEvent_event(event["metadata"],
|
|
31854
|
+
metadata: await de_ConverseStreamMetadataEvent_event(event["metadata"], context)
|
|
31886
31855
|
};
|
|
31887
31856
|
}
|
|
31888
31857
|
if (event["internalServerException"] != null) {
|
|
31889
31858
|
return {
|
|
31890
|
-
internalServerException: await de_InternalServerException_event(event["internalServerException"],
|
|
31859
|
+
internalServerException: await de_InternalServerException_event(event["internalServerException"], context)
|
|
31891
31860
|
};
|
|
31892
31861
|
}
|
|
31893
31862
|
if (event["modelStreamErrorException"] != null) {
|
|
31894
31863
|
return {
|
|
31895
|
-
modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"],
|
|
31864
|
+
modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context)
|
|
31896
31865
|
};
|
|
31897
31866
|
}
|
|
31898
31867
|
if (event["validationException"] != null) {
|
|
31899
31868
|
return {
|
|
31900
|
-
validationException: await de_ValidationException_event(event["validationException"],
|
|
31869
|
+
validationException: await de_ValidationException_event(event["validationException"], context)
|
|
31901
31870
|
};
|
|
31902
31871
|
}
|
|
31903
31872
|
if (event["throttlingException"] != null) {
|
|
31904
31873
|
return {
|
|
31905
|
-
throttlingException: await de_ThrottlingException_event(event["throttlingException"],
|
|
31874
|
+
throttlingException: await de_ThrottlingException_event(event["throttlingException"], context)
|
|
31906
31875
|
};
|
|
31907
31876
|
}
|
|
31908
31877
|
if (event["serviceUnavailableException"] != null) {
|
|
31909
31878
|
return {
|
|
31910
|
-
serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"],
|
|
31879
|
+
serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context)
|
|
31911
31880
|
};
|
|
31912
31881
|
}
|
|
31913
31882
|
return { $unknown: event };
|
|
31914
31883
|
});
|
|
31915
31884
|
};
|
|
31916
|
-
var de_InvokeModelWithBidirectionalStreamOutput = (output,
|
|
31917
|
-
return
|
|
31885
|
+
var de_InvokeModelWithBidirectionalStreamOutput = (output, context) => {
|
|
31886
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
31918
31887
|
if (event["chunk"] != null) {
|
|
31919
31888
|
return {
|
|
31920
|
-
chunk: await de_BidirectionalOutputPayloadPart_event(event["chunk"],
|
|
31889
|
+
chunk: await de_BidirectionalOutputPayloadPart_event(event["chunk"], context)
|
|
31921
31890
|
};
|
|
31922
31891
|
}
|
|
31923
31892
|
if (event["internalServerException"] != null) {
|
|
31924
31893
|
return {
|
|
31925
|
-
internalServerException: await de_InternalServerException_event(event["internalServerException"],
|
|
31894
|
+
internalServerException: await de_InternalServerException_event(event["internalServerException"], context)
|
|
31926
31895
|
};
|
|
31927
31896
|
}
|
|
31928
31897
|
if (event["modelStreamErrorException"] != null) {
|
|
31929
31898
|
return {
|
|
31930
|
-
modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"],
|
|
31899
|
+
modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context)
|
|
31931
31900
|
};
|
|
31932
31901
|
}
|
|
31933
31902
|
if (event["validationException"] != null) {
|
|
31934
31903
|
return {
|
|
31935
|
-
validationException: await de_ValidationException_event(event["validationException"],
|
|
31904
|
+
validationException: await de_ValidationException_event(event["validationException"], context)
|
|
31936
31905
|
};
|
|
31937
31906
|
}
|
|
31938
31907
|
if (event["throttlingException"] != null) {
|
|
31939
31908
|
return {
|
|
31940
|
-
throttlingException: await de_ThrottlingException_event(event["throttlingException"],
|
|
31909
|
+
throttlingException: await de_ThrottlingException_event(event["throttlingException"], context)
|
|
31941
31910
|
};
|
|
31942
31911
|
}
|
|
31943
31912
|
if (event["modelTimeoutException"] != null) {
|
|
31944
31913
|
return {
|
|
31945
|
-
modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"],
|
|
31914
|
+
modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"], context)
|
|
31946
31915
|
};
|
|
31947
31916
|
}
|
|
31948
31917
|
if (event["serviceUnavailableException"] != null) {
|
|
31949
31918
|
return {
|
|
31950
|
-
serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"],
|
|
31919
|
+
serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context)
|
|
31951
31920
|
};
|
|
31952
31921
|
}
|
|
31953
31922
|
return { $unknown: event };
|
|
31954
31923
|
});
|
|
31955
31924
|
};
|
|
31956
|
-
var de_ResponseStream = (output,
|
|
31957
|
-
return
|
|
31925
|
+
var de_ResponseStream = (output, context) => {
|
|
31926
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
31958
31927
|
if (event["chunk"] != null) {
|
|
31959
31928
|
return {
|
|
31960
|
-
chunk: await de_PayloadPart_event(event["chunk"],
|
|
31929
|
+
chunk: await de_PayloadPart_event(event["chunk"], context)
|
|
31961
31930
|
};
|
|
31962
31931
|
}
|
|
31963
31932
|
if (event["internalServerException"] != null) {
|
|
31964
31933
|
return {
|
|
31965
|
-
internalServerException: await de_InternalServerException_event(event["internalServerException"],
|
|
31934
|
+
internalServerException: await de_InternalServerException_event(event["internalServerException"], context)
|
|
31966
31935
|
};
|
|
31967
31936
|
}
|
|
31968
31937
|
if (event["modelStreamErrorException"] != null) {
|
|
31969
31938
|
return {
|
|
31970
|
-
modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"],
|
|
31939
|
+
modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context)
|
|
31971
31940
|
};
|
|
31972
31941
|
}
|
|
31973
31942
|
if (event["validationException"] != null) {
|
|
31974
31943
|
return {
|
|
31975
|
-
validationException: await de_ValidationException_event(event["validationException"],
|
|
31944
|
+
validationException: await de_ValidationException_event(event["validationException"], context)
|
|
31976
31945
|
};
|
|
31977
31946
|
}
|
|
31978
31947
|
if (event["throttlingException"] != null) {
|
|
31979
31948
|
return {
|
|
31980
|
-
throttlingException: await de_ThrottlingException_event(event["throttlingException"],
|
|
31949
|
+
throttlingException: await de_ThrottlingException_event(event["throttlingException"], context)
|
|
31981
31950
|
};
|
|
31982
31951
|
}
|
|
31983
31952
|
if (event["modelTimeoutException"] != null) {
|
|
31984
31953
|
return {
|
|
31985
|
-
modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"],
|
|
31954
|
+
modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"], context)
|
|
31986
31955
|
};
|
|
31987
31956
|
}
|
|
31988
31957
|
if (event["serviceUnavailableException"] != null) {
|
|
31989
31958
|
return {
|
|
31990
|
-
serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"],
|
|
31959
|
+
serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context)
|
|
31991
31960
|
};
|
|
31992
31961
|
}
|
|
31993
31962
|
return { $unknown: event };
|
|
31994
31963
|
});
|
|
31995
31964
|
};
|
|
31996
|
-
var de_BidirectionalOutputPayloadPart_event = async (output,
|
|
31965
|
+
var de_BidirectionalOutputPayloadPart_event = async (output, context) => {
|
|
31997
31966
|
const contents = {};
|
|
31998
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
31999
|
-
Object.assign(contents, de_BidirectionalOutputPayloadPart(data2,
|
|
31967
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
31968
|
+
Object.assign(contents, de_BidirectionalOutputPayloadPart(data2, context));
|
|
32000
31969
|
return contents;
|
|
32001
31970
|
};
|
|
32002
|
-
var de_ContentBlockDeltaEvent_event = async (output,
|
|
31971
|
+
var de_ContentBlockDeltaEvent_event = async (output, context) => {
|
|
32003
31972
|
const contents = {};
|
|
32004
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
32005
|
-
Object.assign(contents, de_ContentBlockDeltaEvent(data2,
|
|
31973
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
31974
|
+
Object.assign(contents, de_ContentBlockDeltaEvent(data2, context));
|
|
32006
31975
|
return contents;
|
|
32007
31976
|
};
|
|
32008
|
-
var de_ContentBlockStartEvent_event = async (output,
|
|
31977
|
+
var de_ContentBlockStartEvent_event = async (output, context) => {
|
|
32009
31978
|
const contents = {};
|
|
32010
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
31979
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
32011
31980
|
Object.assign(contents, smithyClient._json(data2));
|
|
32012
31981
|
return contents;
|
|
32013
31982
|
};
|
|
32014
|
-
var de_ContentBlockStopEvent_event = async (output,
|
|
31983
|
+
var de_ContentBlockStopEvent_event = async (output, context) => {
|
|
32015
31984
|
const contents = {};
|
|
32016
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
31985
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
32017
31986
|
Object.assign(contents, smithyClient._json(data2));
|
|
32018
31987
|
return contents;
|
|
32019
31988
|
};
|
|
32020
|
-
var de_ConverseStreamMetadataEvent_event = async (output,
|
|
31989
|
+
var de_ConverseStreamMetadataEvent_event = async (output, context) => {
|
|
32021
31990
|
const contents = {};
|
|
32022
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
31991
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
32023
31992
|
Object.assign(contents, de_ConverseStreamMetadataEvent(data2));
|
|
32024
31993
|
return contents;
|
|
32025
31994
|
};
|
|
32026
|
-
var de_InternalServerException_event = async (output,
|
|
31995
|
+
var de_InternalServerException_event = async (output, context) => {
|
|
32027
31996
|
const parsedOutput = {
|
|
32028
31997
|
...output,
|
|
32029
|
-
body: await core$1.parseJsonBody(output.body,
|
|
31998
|
+
body: await core$1.parseJsonBody(output.body, context)
|
|
32030
31999
|
};
|
|
32031
32000
|
return de_InternalServerExceptionRes2(parsedOutput);
|
|
32032
32001
|
};
|
|
32033
|
-
var de_MessageStartEvent_event = async (output,
|
|
32002
|
+
var de_MessageStartEvent_event = async (output, context) => {
|
|
32034
32003
|
const contents = {};
|
|
32035
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
32004
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
32036
32005
|
Object.assign(contents, smithyClient._json(data2));
|
|
32037
32006
|
return contents;
|
|
32038
32007
|
};
|
|
32039
|
-
var de_MessageStopEvent_event = async (output,
|
|
32008
|
+
var de_MessageStopEvent_event = async (output, context) => {
|
|
32040
32009
|
const contents = {};
|
|
32041
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
32010
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
32042
32011
|
Object.assign(contents, de_MessageStopEvent(data2));
|
|
32043
32012
|
return contents;
|
|
32044
32013
|
};
|
|
32045
|
-
var de_ModelStreamErrorException_event = async (output,
|
|
32014
|
+
var de_ModelStreamErrorException_event = async (output, context) => {
|
|
32046
32015
|
const parsedOutput = {
|
|
32047
32016
|
...output,
|
|
32048
|
-
body: await core$1.parseJsonBody(output.body,
|
|
32017
|
+
body: await core$1.parseJsonBody(output.body, context)
|
|
32049
32018
|
};
|
|
32050
32019
|
return de_ModelStreamErrorExceptionRes(parsedOutput);
|
|
32051
32020
|
};
|
|
32052
|
-
var de_ModelTimeoutException_event = async (output,
|
|
32021
|
+
var de_ModelTimeoutException_event = async (output, context) => {
|
|
32053
32022
|
const parsedOutput = {
|
|
32054
32023
|
...output,
|
|
32055
|
-
body: await core$1.parseJsonBody(output.body,
|
|
32024
|
+
body: await core$1.parseJsonBody(output.body, context)
|
|
32056
32025
|
};
|
|
32057
32026
|
return de_ModelTimeoutExceptionRes(parsedOutput);
|
|
32058
32027
|
};
|
|
32059
|
-
var de_PayloadPart_event = async (output,
|
|
32028
|
+
var de_PayloadPart_event = async (output, context) => {
|
|
32060
32029
|
const contents = {};
|
|
32061
|
-
const data2 = await core$1.parseJsonBody(output.body,
|
|
32062
|
-
Object.assign(contents, de_PayloadPart(data2,
|
|
32030
|
+
const data2 = await core$1.parseJsonBody(output.body, context);
|
|
32031
|
+
Object.assign(contents, de_PayloadPart(data2, context));
|
|
32063
32032
|
return contents;
|
|
32064
32033
|
};
|
|
32065
|
-
var de_ServiceUnavailableException_event = async (output,
|
|
32034
|
+
var de_ServiceUnavailableException_event = async (output, context) => {
|
|
32066
32035
|
const parsedOutput = {
|
|
32067
32036
|
...output,
|
|
32068
|
-
body: await core$1.parseJsonBody(output.body,
|
|
32037
|
+
body: await core$1.parseJsonBody(output.body, context)
|
|
32069
32038
|
};
|
|
32070
32039
|
return de_ServiceUnavailableExceptionRes(parsedOutput);
|
|
32071
32040
|
};
|
|
32072
|
-
var de_ThrottlingException_event = async (output,
|
|
32041
|
+
var de_ThrottlingException_event = async (output, context) => {
|
|
32073
32042
|
const parsedOutput = {
|
|
32074
32043
|
...output,
|
|
32075
|
-
body: await core$1.parseJsonBody(output.body,
|
|
32044
|
+
body: await core$1.parseJsonBody(output.body, context)
|
|
32076
32045
|
};
|
|
32077
32046
|
return de_ThrottlingExceptionRes(parsedOutput);
|
|
32078
32047
|
};
|
|
32079
|
-
var de_ValidationException_event = async (output,
|
|
32048
|
+
var de_ValidationException_event = async (output, context) => {
|
|
32080
32049
|
const parsedOutput = {
|
|
32081
32050
|
...output,
|
|
32082
|
-
body: await core$1.parseJsonBody(output.body,
|
|
32051
|
+
body: await core$1.parseJsonBody(output.body, context)
|
|
32083
32052
|
};
|
|
32084
32053
|
return de_ValidationExceptionRes(parsedOutput);
|
|
32085
32054
|
};
|
|
32086
|
-
var se_BidirectionalInputPayloadPart = (input,
|
|
32055
|
+
var se_BidirectionalInputPayloadPart = (input, context) => {
|
|
32087
32056
|
return smithyClient.take(input, {
|
|
32088
|
-
bytes:
|
|
32057
|
+
bytes: context.base64Encoder
|
|
32089
32058
|
});
|
|
32090
32059
|
};
|
|
32091
|
-
var se_ContentBlock = (input,
|
|
32060
|
+
var se_ContentBlock = (input, context) => {
|
|
32092
32061
|
return exports2.ContentBlock.visit(input, {
|
|
32093
32062
|
cachePoint: (value) => ({ cachePoint: smithyClient._json(value) }),
|
|
32094
32063
|
citationsContent: (value) => ({ citationsContent: smithyClient._json(value) }),
|
|
32095
|
-
document: (value) => ({ document: se_DocumentBlock(value,
|
|
32096
|
-
guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value,
|
|
32097
|
-
image: (value) => ({ image: se_ImageBlock(value,
|
|
32098
|
-
reasoningContent: (value) => ({ reasoningContent: se_ReasoningContentBlock(value,
|
|
32064
|
+
document: (value) => ({ document: se_DocumentBlock(value, context) }),
|
|
32065
|
+
guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
|
|
32066
|
+
image: (value) => ({ image: se_ImageBlock(value, context) }),
|
|
32067
|
+
reasoningContent: (value) => ({ reasoningContent: se_ReasoningContentBlock(value, context) }),
|
|
32099
32068
|
text: (value) => ({ text: value }),
|
|
32100
|
-
toolResult: (value) => ({ toolResult: se_ToolResultBlock(value,
|
|
32069
|
+
toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context) }),
|
|
32101
32070
|
toolUse: (value) => ({ toolUse: se_ToolUseBlock(value) }),
|
|
32102
|
-
video: (value) => ({ video: se_VideoBlock(value,
|
|
32071
|
+
video: (value) => ({ video: se_VideoBlock(value, context) }),
|
|
32103
32072
|
_: (name14, value) => ({ [name14]: value })
|
|
32104
32073
|
});
|
|
32105
32074
|
};
|
|
32106
|
-
var se_ContentBlocks = (input,
|
|
32075
|
+
var se_ContentBlocks = (input, context) => {
|
|
32107
32076
|
return input.filter((e3) => e3 != null).map((entry) => {
|
|
32108
|
-
return se_ContentBlock(entry,
|
|
32077
|
+
return se_ContentBlock(entry, context);
|
|
32109
32078
|
});
|
|
32110
32079
|
};
|
|
32111
|
-
var se_ConverseTokensRequest = (input,
|
|
32080
|
+
var se_ConverseTokensRequest = (input, context) => {
|
|
32112
32081
|
return smithyClient.take(input, {
|
|
32113
|
-
messages: (_2) => se_Messages(_2,
|
|
32114
|
-
system: (_2) => se_SystemContentBlocks(_2,
|
|
32082
|
+
messages: (_2) => se_Messages(_2, context),
|
|
32083
|
+
system: (_2) => se_SystemContentBlocks(_2, context)
|
|
32115
32084
|
});
|
|
32116
32085
|
};
|
|
32117
|
-
var se_CountTokensInput = (input,
|
|
32086
|
+
var se_CountTokensInput = (input, context) => {
|
|
32118
32087
|
return exports2.CountTokensInput.visit(input, {
|
|
32119
|
-
converse: (value) => ({ converse: se_ConverseTokensRequest(value,
|
|
32120
|
-
invokeModel: (value) => ({ invokeModel: se_InvokeModelTokensRequest(value,
|
|
32088
|
+
converse: (value) => ({ converse: se_ConverseTokensRequest(value, context) }),
|
|
32089
|
+
invokeModel: (value) => ({ invokeModel: se_InvokeModelTokensRequest(value, context) }),
|
|
32121
32090
|
_: (name14, value) => ({ [name14]: value })
|
|
32122
32091
|
});
|
|
32123
32092
|
};
|
|
32124
|
-
var se_DocumentBlock = (input,
|
|
32093
|
+
var se_DocumentBlock = (input, context) => {
|
|
32125
32094
|
return smithyClient.take(input, {
|
|
32126
32095
|
citations: smithyClient._json,
|
|
32127
32096
|
context: [],
|
|
32128
32097
|
format: [],
|
|
32129
32098
|
name: [],
|
|
32130
|
-
source: (_2) => se_DocumentSource(_2,
|
|
32099
|
+
source: (_2) => se_DocumentSource(_2, context)
|
|
32131
32100
|
});
|
|
32132
32101
|
};
|
|
32133
|
-
var se_DocumentSource = (input,
|
|
32102
|
+
var se_DocumentSource = (input, context) => {
|
|
32134
32103
|
return exports2.DocumentSource.visit(input, {
|
|
32135
|
-
bytes: (value) => ({ bytes:
|
|
32104
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
32136
32105
|
content: (value) => ({ content: smithyClient._json(value) }),
|
|
32137
32106
|
s3Location: (value) => ({ s3Location: smithyClient._json(value) }),
|
|
32138
32107
|
text: (value) => ({ text: value }),
|
|
32139
32108
|
_: (name14, value) => ({ [name14]: value })
|
|
32140
32109
|
});
|
|
32141
32110
|
};
|
|
32142
|
-
var se_GuardrailContentBlock = (input,
|
|
32111
|
+
var se_GuardrailContentBlock = (input, context) => {
|
|
32143
32112
|
return exports2.GuardrailContentBlock.visit(input, {
|
|
32144
|
-
image: (value) => ({ image: se_GuardrailImageBlock(value,
|
|
32113
|
+
image: (value) => ({ image: se_GuardrailImageBlock(value, context) }),
|
|
32145
32114
|
text: (value) => ({ text: smithyClient._json(value) }),
|
|
32146
32115
|
_: (name14, value) => ({ [name14]: value })
|
|
32147
32116
|
});
|
|
32148
32117
|
};
|
|
32149
|
-
var se_GuardrailContentBlockList = (input,
|
|
32118
|
+
var se_GuardrailContentBlockList = (input, context) => {
|
|
32150
32119
|
return input.filter((e3) => e3 != null).map((entry) => {
|
|
32151
|
-
return se_GuardrailContentBlock(entry,
|
|
32120
|
+
return se_GuardrailContentBlock(entry, context);
|
|
32152
32121
|
});
|
|
32153
32122
|
};
|
|
32154
|
-
var se_GuardrailConverseContentBlock = (input,
|
|
32123
|
+
var se_GuardrailConverseContentBlock = (input, context) => {
|
|
32155
32124
|
return exports2.GuardrailConverseContentBlock.visit(input, {
|
|
32156
|
-
image: (value) => ({ image: se_GuardrailConverseImageBlock(value,
|
|
32125
|
+
image: (value) => ({ image: se_GuardrailConverseImageBlock(value, context) }),
|
|
32157
32126
|
text: (value) => ({ text: smithyClient._json(value) }),
|
|
32158
32127
|
_: (name14, value) => ({ [name14]: value })
|
|
32159
32128
|
});
|
|
32160
32129
|
};
|
|
32161
|
-
var se_GuardrailConverseImageBlock = (input,
|
|
32130
|
+
var se_GuardrailConverseImageBlock = (input, context) => {
|
|
32162
32131
|
return smithyClient.take(input, {
|
|
32163
32132
|
format: [],
|
|
32164
|
-
source: (_2) => se_GuardrailConverseImageSource(_2,
|
|
32133
|
+
source: (_2) => se_GuardrailConverseImageSource(_2, context)
|
|
32165
32134
|
});
|
|
32166
32135
|
};
|
|
32167
|
-
var se_GuardrailConverseImageSource = (input,
|
|
32136
|
+
var se_GuardrailConverseImageSource = (input, context) => {
|
|
32168
32137
|
return exports2.GuardrailConverseImageSource.visit(input, {
|
|
32169
|
-
bytes: (value) => ({ bytes:
|
|
32138
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
32170
32139
|
_: (name14, value) => ({ [name14]: value })
|
|
32171
32140
|
});
|
|
32172
32141
|
};
|
|
32173
|
-
var se_GuardrailImageBlock = (input,
|
|
32142
|
+
var se_GuardrailImageBlock = (input, context) => {
|
|
32174
32143
|
return smithyClient.take(input, {
|
|
32175
32144
|
format: [],
|
|
32176
|
-
source: (_2) => se_GuardrailImageSource(_2,
|
|
32145
|
+
source: (_2) => se_GuardrailImageSource(_2, context)
|
|
32177
32146
|
});
|
|
32178
32147
|
};
|
|
32179
|
-
var se_GuardrailImageSource = (input,
|
|
32148
|
+
var se_GuardrailImageSource = (input, context) => {
|
|
32180
32149
|
return exports2.GuardrailImageSource.visit(input, {
|
|
32181
|
-
bytes: (value) => ({ bytes:
|
|
32150
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
32182
32151
|
_: (name14, value) => ({ [name14]: value })
|
|
32183
32152
|
});
|
|
32184
32153
|
};
|
|
32185
|
-
var se_ImageBlock = (input,
|
|
32154
|
+
var se_ImageBlock = (input, context) => {
|
|
32186
32155
|
return smithyClient.take(input, {
|
|
32187
32156
|
format: [],
|
|
32188
|
-
source: (_2) => se_ImageSource(_2,
|
|
32157
|
+
source: (_2) => se_ImageSource(_2, context)
|
|
32189
32158
|
});
|
|
32190
32159
|
};
|
|
32191
|
-
var se_ImageSource = (input,
|
|
32160
|
+
var se_ImageSource = (input, context) => {
|
|
32192
32161
|
return exports2.ImageSource.visit(input, {
|
|
32193
|
-
bytes: (value) => ({ bytes:
|
|
32162
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
32194
32163
|
s3Location: (value) => ({ s3Location: smithyClient._json(value) }),
|
|
32195
32164
|
_: (name14, value) => ({ [name14]: value })
|
|
32196
32165
|
});
|
|
32197
32166
|
};
|
|
32198
|
-
var se_InferenceConfiguration = (input,
|
|
32167
|
+
var se_InferenceConfiguration = (input, context) => {
|
|
32199
32168
|
return smithyClient.take(input, {
|
|
32200
32169
|
maxTokens: [],
|
|
32201
32170
|
stopSequences: smithyClient._json,
|
|
@@ -32203,128 +32172,128 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32203
32172
|
topP: smithyClient.serializeFloat
|
|
32204
32173
|
});
|
|
32205
32174
|
};
|
|
32206
|
-
var se_InvokeModelTokensRequest = (input,
|
|
32175
|
+
var se_InvokeModelTokensRequest = (input, context) => {
|
|
32207
32176
|
return smithyClient.take(input, {
|
|
32208
|
-
body:
|
|
32177
|
+
body: context.base64Encoder
|
|
32209
32178
|
});
|
|
32210
32179
|
};
|
|
32211
|
-
var se_Message = (input,
|
|
32180
|
+
var se_Message = (input, context) => {
|
|
32212
32181
|
return smithyClient.take(input, {
|
|
32213
|
-
content: (_2) => se_ContentBlocks(_2,
|
|
32182
|
+
content: (_2) => se_ContentBlocks(_2, context),
|
|
32214
32183
|
role: []
|
|
32215
32184
|
});
|
|
32216
32185
|
};
|
|
32217
|
-
var se_Messages = (input,
|
|
32186
|
+
var se_Messages = (input, context) => {
|
|
32218
32187
|
return input.filter((e3) => e3 != null).map((entry) => {
|
|
32219
|
-
return se_Message(entry,
|
|
32188
|
+
return se_Message(entry, context);
|
|
32220
32189
|
});
|
|
32221
32190
|
};
|
|
32222
|
-
var se_ModelInputPayload = (input,
|
|
32191
|
+
var se_ModelInputPayload = (input, context) => {
|
|
32223
32192
|
return input;
|
|
32224
32193
|
};
|
|
32225
|
-
var se_ReasoningContentBlock = (input,
|
|
32194
|
+
var se_ReasoningContentBlock = (input, context) => {
|
|
32226
32195
|
return exports2.ReasoningContentBlock.visit(input, {
|
|
32227
32196
|
reasoningText: (value) => ({ reasoningText: smithyClient._json(value) }),
|
|
32228
|
-
redactedContent: (value) => ({ redactedContent:
|
|
32197
|
+
redactedContent: (value) => ({ redactedContent: context.base64Encoder(value) }),
|
|
32229
32198
|
_: (name14, value) => ({ [name14]: value })
|
|
32230
32199
|
});
|
|
32231
32200
|
};
|
|
32232
|
-
var se_SystemContentBlock = (input,
|
|
32201
|
+
var se_SystemContentBlock = (input, context) => {
|
|
32233
32202
|
return exports2.SystemContentBlock.visit(input, {
|
|
32234
32203
|
cachePoint: (value) => ({ cachePoint: smithyClient._json(value) }),
|
|
32235
|
-
guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value,
|
|
32204
|
+
guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
|
|
32236
32205
|
text: (value) => ({ text: value }),
|
|
32237
32206
|
_: (name14, value) => ({ [name14]: value })
|
|
32238
32207
|
});
|
|
32239
32208
|
};
|
|
32240
|
-
var se_SystemContentBlocks = (input,
|
|
32209
|
+
var se_SystemContentBlocks = (input, context) => {
|
|
32241
32210
|
return input.filter((e3) => e3 != null).map((entry) => {
|
|
32242
|
-
return se_SystemContentBlock(entry,
|
|
32211
|
+
return se_SystemContentBlock(entry, context);
|
|
32243
32212
|
});
|
|
32244
32213
|
};
|
|
32245
|
-
var se_Tool = (input,
|
|
32214
|
+
var se_Tool = (input, context) => {
|
|
32246
32215
|
return exports2.Tool.visit(input, {
|
|
32247
32216
|
cachePoint: (value) => ({ cachePoint: smithyClient._json(value) }),
|
|
32248
32217
|
toolSpec: (value) => ({ toolSpec: se_ToolSpecification(value) }),
|
|
32249
32218
|
_: (name14, value) => ({ [name14]: value })
|
|
32250
32219
|
});
|
|
32251
32220
|
};
|
|
32252
|
-
var se_ToolConfiguration = (input,
|
|
32221
|
+
var se_ToolConfiguration = (input, context) => {
|
|
32253
32222
|
return smithyClient.take(input, {
|
|
32254
32223
|
toolChoice: smithyClient._json,
|
|
32255
32224
|
tools: (_2) => se_Tools(_2)
|
|
32256
32225
|
});
|
|
32257
32226
|
};
|
|
32258
|
-
var se_ToolInputSchema = (input,
|
|
32227
|
+
var se_ToolInputSchema = (input, context) => {
|
|
32259
32228
|
return exports2.ToolInputSchema.visit(input, {
|
|
32260
32229
|
json: (value) => ({ json: se_Document(value) }),
|
|
32261
32230
|
_: (name14, value) => ({ [name14]: value })
|
|
32262
32231
|
});
|
|
32263
32232
|
};
|
|
32264
|
-
var se_ToolResultBlock = (input,
|
|
32233
|
+
var se_ToolResultBlock = (input, context) => {
|
|
32265
32234
|
return smithyClient.take(input, {
|
|
32266
|
-
content: (_2) => se_ToolResultContentBlocks(_2,
|
|
32235
|
+
content: (_2) => se_ToolResultContentBlocks(_2, context),
|
|
32267
32236
|
status: [],
|
|
32268
32237
|
toolUseId: []
|
|
32269
32238
|
});
|
|
32270
32239
|
};
|
|
32271
|
-
var se_ToolResultContentBlock = (input,
|
|
32240
|
+
var se_ToolResultContentBlock = (input, context) => {
|
|
32272
32241
|
return exports2.ToolResultContentBlock.visit(input, {
|
|
32273
|
-
document: (value) => ({ document: se_DocumentBlock(value,
|
|
32274
|
-
image: (value) => ({ image: se_ImageBlock(value,
|
|
32242
|
+
document: (value) => ({ document: se_DocumentBlock(value, context) }),
|
|
32243
|
+
image: (value) => ({ image: se_ImageBlock(value, context) }),
|
|
32275
32244
|
json: (value) => ({ json: se_Document(value) }),
|
|
32276
32245
|
text: (value) => ({ text: value }),
|
|
32277
|
-
video: (value) => ({ video: se_VideoBlock(value,
|
|
32246
|
+
video: (value) => ({ video: se_VideoBlock(value, context) }),
|
|
32278
32247
|
_: (name14, value) => ({ [name14]: value })
|
|
32279
32248
|
});
|
|
32280
32249
|
};
|
|
32281
|
-
var se_ToolResultContentBlocks = (input,
|
|
32250
|
+
var se_ToolResultContentBlocks = (input, context) => {
|
|
32282
32251
|
return input.filter((e3) => e3 != null).map((entry) => {
|
|
32283
|
-
return se_ToolResultContentBlock(entry,
|
|
32252
|
+
return se_ToolResultContentBlock(entry, context);
|
|
32284
32253
|
});
|
|
32285
32254
|
};
|
|
32286
|
-
var se_Tools = (input,
|
|
32255
|
+
var se_Tools = (input, context) => {
|
|
32287
32256
|
return input.filter((e3) => e3 != null).map((entry) => {
|
|
32288
32257
|
return se_Tool(entry);
|
|
32289
32258
|
});
|
|
32290
32259
|
};
|
|
32291
|
-
var se_ToolSpecification = (input,
|
|
32260
|
+
var se_ToolSpecification = (input, context) => {
|
|
32292
32261
|
return smithyClient.take(input, {
|
|
32293
32262
|
description: [],
|
|
32294
32263
|
inputSchema: (_2) => se_ToolInputSchema(_2),
|
|
32295
32264
|
name: []
|
|
32296
32265
|
});
|
|
32297
32266
|
};
|
|
32298
|
-
var se_ToolUseBlock = (input,
|
|
32267
|
+
var se_ToolUseBlock = (input, context) => {
|
|
32299
32268
|
return smithyClient.take(input, {
|
|
32300
32269
|
input: (_2) => se_Document(_2),
|
|
32301
32270
|
name: [],
|
|
32302
32271
|
toolUseId: []
|
|
32303
32272
|
});
|
|
32304
32273
|
};
|
|
32305
|
-
var se_VideoBlock = (input,
|
|
32274
|
+
var se_VideoBlock = (input, context) => {
|
|
32306
32275
|
return smithyClient.take(input, {
|
|
32307
32276
|
format: [],
|
|
32308
|
-
source: (_2) => se_VideoSource(_2,
|
|
32277
|
+
source: (_2) => se_VideoSource(_2, context)
|
|
32309
32278
|
});
|
|
32310
32279
|
};
|
|
32311
|
-
var se_VideoSource = (input,
|
|
32280
|
+
var se_VideoSource = (input, context) => {
|
|
32312
32281
|
return exports2.VideoSource.visit(input, {
|
|
32313
|
-
bytes: (value) => ({ bytes:
|
|
32282
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
32314
32283
|
s3Location: (value) => ({ s3Location: smithyClient._json(value) }),
|
|
32315
32284
|
_: (name14, value) => ({ [name14]: value })
|
|
32316
32285
|
});
|
|
32317
32286
|
};
|
|
32318
|
-
var se_Document = (input,
|
|
32287
|
+
var se_Document = (input, context) => {
|
|
32319
32288
|
return input;
|
|
32320
32289
|
};
|
|
32321
|
-
var de_AsyncInvokeSummaries = (output,
|
|
32290
|
+
var de_AsyncInvokeSummaries = (output, context) => {
|
|
32322
32291
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32323
32292
|
return de_AsyncInvokeSummary(entry);
|
|
32324
32293
|
});
|
|
32325
32294
|
return retVal;
|
|
32326
32295
|
};
|
|
32327
|
-
var de_AsyncInvokeSummary = (output,
|
|
32296
|
+
var de_AsyncInvokeSummary = (output, context) => {
|
|
32328
32297
|
return smithyClient.take(output, {
|
|
32329
32298
|
clientRequestToken: smithyClient.expectString,
|
|
32330
32299
|
endTime: (_2) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_2)),
|
|
@@ -32337,12 +32306,12 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32337
32306
|
submitTime: (_2) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_2))
|
|
32338
32307
|
});
|
|
32339
32308
|
};
|
|
32340
|
-
var de_BidirectionalOutputPayloadPart = (output,
|
|
32309
|
+
var de_BidirectionalOutputPayloadPart = (output, context) => {
|
|
32341
32310
|
return smithyClient.take(output, {
|
|
32342
|
-
bytes:
|
|
32311
|
+
bytes: context.base64Decoder
|
|
32343
32312
|
});
|
|
32344
32313
|
};
|
|
32345
|
-
var de_ContentBlock = (output,
|
|
32314
|
+
var de_ContentBlock = (output, context) => {
|
|
32346
32315
|
if (output.cachePoint != null) {
|
|
32347
32316
|
return {
|
|
32348
32317
|
cachePoint: smithyClient._json(output.cachePoint)
|
|
@@ -32355,22 +32324,22 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32355
32324
|
}
|
|
32356
32325
|
if (output.document != null) {
|
|
32357
32326
|
return {
|
|
32358
|
-
document: de_DocumentBlock(output.document,
|
|
32327
|
+
document: de_DocumentBlock(output.document, context)
|
|
32359
32328
|
};
|
|
32360
32329
|
}
|
|
32361
32330
|
if (output.guardContent != null) {
|
|
32362
32331
|
return {
|
|
32363
|
-
guardContent: de_GuardrailConverseContentBlock(core$1.awsExpectUnion(output.guardContent),
|
|
32332
|
+
guardContent: de_GuardrailConverseContentBlock(core$1.awsExpectUnion(output.guardContent), context)
|
|
32364
32333
|
};
|
|
32365
32334
|
}
|
|
32366
32335
|
if (output.image != null) {
|
|
32367
32336
|
return {
|
|
32368
|
-
image: de_ImageBlock(output.image,
|
|
32337
|
+
image: de_ImageBlock(output.image, context)
|
|
32369
32338
|
};
|
|
32370
32339
|
}
|
|
32371
32340
|
if (output.reasoningContent != null) {
|
|
32372
32341
|
return {
|
|
32373
|
-
reasoningContent: de_ReasoningContentBlock(core$1.awsExpectUnion(output.reasoningContent),
|
|
32342
|
+
reasoningContent: de_ReasoningContentBlock(core$1.awsExpectUnion(output.reasoningContent), context)
|
|
32374
32343
|
};
|
|
32375
32344
|
}
|
|
32376
32345
|
if (smithyClient.expectString(output.text) !== void 0) {
|
|
@@ -32378,7 +32347,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32378
32347
|
}
|
|
32379
32348
|
if (output.toolResult != null) {
|
|
32380
32349
|
return {
|
|
32381
|
-
toolResult: de_ToolResultBlock(output.toolResult,
|
|
32350
|
+
toolResult: de_ToolResultBlock(output.toolResult, context)
|
|
32382
32351
|
};
|
|
32383
32352
|
}
|
|
32384
32353
|
if (output.toolUse != null) {
|
|
@@ -32388,12 +32357,12 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32388
32357
|
}
|
|
32389
32358
|
if (output.video != null) {
|
|
32390
32359
|
return {
|
|
32391
|
-
video: de_VideoBlock(output.video,
|
|
32360
|
+
video: de_VideoBlock(output.video, context)
|
|
32392
32361
|
};
|
|
32393
32362
|
}
|
|
32394
32363
|
return { $unknown: Object.entries(output)[0] };
|
|
32395
32364
|
};
|
|
32396
|
-
var de_ContentBlockDelta = (output,
|
|
32365
|
+
var de_ContentBlockDelta = (output, context) => {
|
|
32397
32366
|
if (output.citation != null) {
|
|
32398
32367
|
return {
|
|
32399
32368
|
citation: smithyClient._json(output.citation)
|
|
@@ -32401,7 +32370,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32401
32370
|
}
|
|
32402
32371
|
if (output.reasoningContent != null) {
|
|
32403
32372
|
return {
|
|
32404
|
-
reasoningContent: de_ReasoningContentBlockDelta(core$1.awsExpectUnion(output.reasoningContent),
|
|
32373
|
+
reasoningContent: de_ReasoningContentBlockDelta(core$1.awsExpectUnion(output.reasoningContent), context)
|
|
32405
32374
|
};
|
|
32406
32375
|
}
|
|
32407
32376
|
if (smithyClient.expectString(output.text) !== void 0) {
|
|
@@ -32414,27 +32383,27 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32414
32383
|
}
|
|
32415
32384
|
return { $unknown: Object.entries(output)[0] };
|
|
32416
32385
|
};
|
|
32417
|
-
var de_ContentBlockDeltaEvent = (output,
|
|
32386
|
+
var de_ContentBlockDeltaEvent = (output, context) => {
|
|
32418
32387
|
return smithyClient.take(output, {
|
|
32419
32388
|
contentBlockIndex: smithyClient.expectInt32,
|
|
32420
|
-
delta: (_2) => de_ContentBlockDelta(core$1.awsExpectUnion(_2),
|
|
32389
|
+
delta: (_2) => de_ContentBlockDelta(core$1.awsExpectUnion(_2), context)
|
|
32421
32390
|
});
|
|
32422
32391
|
};
|
|
32423
|
-
var de_ContentBlocks = (output,
|
|
32392
|
+
var de_ContentBlocks = (output, context) => {
|
|
32424
32393
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32425
|
-
return de_ContentBlock(core$1.awsExpectUnion(entry),
|
|
32394
|
+
return de_ContentBlock(core$1.awsExpectUnion(entry), context);
|
|
32426
32395
|
});
|
|
32427
32396
|
return retVal;
|
|
32428
32397
|
};
|
|
32429
|
-
var de_ConverseOutput = (output,
|
|
32398
|
+
var de_ConverseOutput = (output, context) => {
|
|
32430
32399
|
if (output.message != null) {
|
|
32431
32400
|
return {
|
|
32432
|
-
message: de_Message(output.message,
|
|
32401
|
+
message: de_Message(output.message, context)
|
|
32433
32402
|
};
|
|
32434
32403
|
}
|
|
32435
32404
|
return { $unknown: Object.entries(output)[0] };
|
|
32436
32405
|
};
|
|
32437
|
-
var de_ConverseStreamMetadataEvent = (output,
|
|
32406
|
+
var de_ConverseStreamMetadataEvent = (output, context) => {
|
|
32438
32407
|
return smithyClient.take(output, {
|
|
32439
32408
|
metrics: smithyClient._json,
|
|
32440
32409
|
performanceConfig: smithyClient._json,
|
|
@@ -32442,31 +32411,31 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32442
32411
|
usage: smithyClient._json
|
|
32443
32412
|
});
|
|
32444
32413
|
};
|
|
32445
|
-
var de_ConverseStreamTrace = (output,
|
|
32414
|
+
var de_ConverseStreamTrace = (output, context) => {
|
|
32446
32415
|
return smithyClient.take(output, {
|
|
32447
32416
|
guardrail: (_2) => de_GuardrailTraceAssessment(_2),
|
|
32448
32417
|
promptRouter: smithyClient._json
|
|
32449
32418
|
});
|
|
32450
32419
|
};
|
|
32451
|
-
var de_ConverseTrace = (output,
|
|
32420
|
+
var de_ConverseTrace = (output, context) => {
|
|
32452
32421
|
return smithyClient.take(output, {
|
|
32453
32422
|
guardrail: (_2) => de_GuardrailTraceAssessment(_2),
|
|
32454
32423
|
promptRouter: smithyClient._json
|
|
32455
32424
|
});
|
|
32456
32425
|
};
|
|
32457
|
-
var de_DocumentBlock = (output,
|
|
32426
|
+
var de_DocumentBlock = (output, context) => {
|
|
32458
32427
|
return smithyClient.take(output, {
|
|
32459
32428
|
citations: smithyClient._json,
|
|
32460
32429
|
context: smithyClient.expectString,
|
|
32461
32430
|
format: smithyClient.expectString,
|
|
32462
32431
|
name: smithyClient.expectString,
|
|
32463
|
-
source: (_2) => de_DocumentSource(core$1.awsExpectUnion(_2),
|
|
32432
|
+
source: (_2) => de_DocumentSource(core$1.awsExpectUnion(_2), context)
|
|
32464
32433
|
});
|
|
32465
32434
|
};
|
|
32466
|
-
var de_DocumentSource = (output,
|
|
32435
|
+
var de_DocumentSource = (output, context) => {
|
|
32467
32436
|
if (output.bytes != null) {
|
|
32468
32437
|
return {
|
|
32469
|
-
bytes:
|
|
32438
|
+
bytes: context.base64Decoder(output.bytes)
|
|
32470
32439
|
};
|
|
32471
32440
|
}
|
|
32472
32441
|
if (output.content != null) {
|
|
@@ -32484,7 +32453,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32484
32453
|
}
|
|
32485
32454
|
return { $unknown: Object.entries(output)[0] };
|
|
32486
32455
|
};
|
|
32487
|
-
var de_GuardrailAssessment = (output,
|
|
32456
|
+
var de_GuardrailAssessment = (output, context) => {
|
|
32488
32457
|
return smithyClient.take(output, {
|
|
32489
32458
|
automatedReasoningPolicy: (_2) => de_GuardrailAutomatedReasoningPolicyAssessment(_2),
|
|
32490
32459
|
contentPolicy: smithyClient._json,
|
|
@@ -32495,13 +32464,13 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32495
32464
|
wordPolicy: smithyClient._json
|
|
32496
32465
|
});
|
|
32497
32466
|
};
|
|
32498
|
-
var de_GuardrailAssessmentList = (output,
|
|
32467
|
+
var de_GuardrailAssessmentList = (output, context) => {
|
|
32499
32468
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32500
32469
|
return de_GuardrailAssessment(entry);
|
|
32501
32470
|
});
|
|
32502
32471
|
return retVal;
|
|
32503
32472
|
};
|
|
32504
|
-
var de_GuardrailAssessmentListMap = (output,
|
|
32473
|
+
var de_GuardrailAssessmentListMap = (output, context) => {
|
|
32505
32474
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
32506
32475
|
if (value === null) {
|
|
32507
32476
|
return acc;
|
|
@@ -32510,7 +32479,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32510
32479
|
return acc;
|
|
32511
32480
|
}, {});
|
|
32512
32481
|
};
|
|
32513
|
-
var de_GuardrailAssessmentMap = (output,
|
|
32482
|
+
var de_GuardrailAssessmentMap = (output, context) => {
|
|
32514
32483
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
32515
32484
|
if (value === null) {
|
|
32516
32485
|
return acc;
|
|
@@ -32519,7 +32488,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32519
32488
|
return acc;
|
|
32520
32489
|
}, {});
|
|
32521
32490
|
};
|
|
32522
|
-
var de_GuardrailAutomatedReasoningFinding = (output,
|
|
32491
|
+
var de_GuardrailAutomatedReasoningFinding = (output, context) => {
|
|
32523
32492
|
if (output.impossible != null) {
|
|
32524
32493
|
return {
|
|
32525
32494
|
impossible: de_GuardrailAutomatedReasoningImpossibleFinding(output.impossible)
|
|
@@ -32557,32 +32526,32 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32557
32526
|
}
|
|
32558
32527
|
return { $unknown: Object.entries(output)[0] };
|
|
32559
32528
|
};
|
|
32560
|
-
var de_GuardrailAutomatedReasoningFindingList = (output,
|
|
32529
|
+
var de_GuardrailAutomatedReasoningFindingList = (output, context) => {
|
|
32561
32530
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32562
32531
|
return de_GuardrailAutomatedReasoningFinding(core$1.awsExpectUnion(entry));
|
|
32563
32532
|
});
|
|
32564
32533
|
return retVal;
|
|
32565
32534
|
};
|
|
32566
|
-
var de_GuardrailAutomatedReasoningImpossibleFinding = (output,
|
|
32535
|
+
var de_GuardrailAutomatedReasoningImpossibleFinding = (output, context) => {
|
|
32567
32536
|
return smithyClient.take(output, {
|
|
32568
32537
|
contradictingRules: smithyClient._json,
|
|
32569
32538
|
logicWarning: smithyClient._json,
|
|
32570
32539
|
translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
|
|
32571
32540
|
});
|
|
32572
32541
|
};
|
|
32573
|
-
var de_GuardrailAutomatedReasoningInvalidFinding = (output,
|
|
32542
|
+
var de_GuardrailAutomatedReasoningInvalidFinding = (output, context) => {
|
|
32574
32543
|
return smithyClient.take(output, {
|
|
32575
32544
|
contradictingRules: smithyClient._json,
|
|
32576
32545
|
logicWarning: smithyClient._json,
|
|
32577
32546
|
translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
|
|
32578
32547
|
});
|
|
32579
32548
|
};
|
|
32580
|
-
var de_GuardrailAutomatedReasoningPolicyAssessment = (output,
|
|
32549
|
+
var de_GuardrailAutomatedReasoningPolicyAssessment = (output, context) => {
|
|
32581
32550
|
return smithyClient.take(output, {
|
|
32582
32551
|
findings: (_2) => de_GuardrailAutomatedReasoningFindingList(_2)
|
|
32583
32552
|
});
|
|
32584
32553
|
};
|
|
32585
|
-
var de_GuardrailAutomatedReasoningSatisfiableFinding = (output,
|
|
32554
|
+
var de_GuardrailAutomatedReasoningSatisfiableFinding = (output, context) => {
|
|
32586
32555
|
return smithyClient.take(output, {
|
|
32587
32556
|
claimsFalseScenario: smithyClient._json,
|
|
32588
32557
|
claimsTrueScenario: smithyClient._json,
|
|
@@ -32590,7 +32559,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32590
32559
|
translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
|
|
32591
32560
|
});
|
|
32592
32561
|
};
|
|
32593
|
-
var de_GuardrailAutomatedReasoningTranslation = (output,
|
|
32562
|
+
var de_GuardrailAutomatedReasoningTranslation = (output, context) => {
|
|
32594
32563
|
return smithyClient.take(output, {
|
|
32595
32564
|
claims: smithyClient._json,
|
|
32596
32565
|
confidence: smithyClient.limitedParseDouble,
|
|
@@ -32599,30 +32568,30 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32599
32568
|
untranslatedPremises: smithyClient._json
|
|
32600
32569
|
});
|
|
32601
32570
|
};
|
|
32602
|
-
var de_GuardrailAutomatedReasoningTranslationAmbiguousFinding = (output,
|
|
32571
|
+
var de_GuardrailAutomatedReasoningTranslationAmbiguousFinding = (output, context) => {
|
|
32603
32572
|
return smithyClient.take(output, {
|
|
32604
32573
|
differenceScenarios: smithyClient._json,
|
|
32605
32574
|
options: (_2) => de_GuardrailAutomatedReasoningTranslationOptionList(_2)
|
|
32606
32575
|
});
|
|
32607
32576
|
};
|
|
32608
|
-
var de_GuardrailAutomatedReasoningTranslationList = (output,
|
|
32577
|
+
var de_GuardrailAutomatedReasoningTranslationList = (output, context) => {
|
|
32609
32578
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32610
32579
|
return de_GuardrailAutomatedReasoningTranslation(entry);
|
|
32611
32580
|
});
|
|
32612
32581
|
return retVal;
|
|
32613
32582
|
};
|
|
32614
|
-
var de_GuardrailAutomatedReasoningTranslationOption = (output,
|
|
32583
|
+
var de_GuardrailAutomatedReasoningTranslationOption = (output, context) => {
|
|
32615
32584
|
return smithyClient.take(output, {
|
|
32616
32585
|
translations: (_2) => de_GuardrailAutomatedReasoningTranslationList(_2)
|
|
32617
32586
|
});
|
|
32618
32587
|
};
|
|
32619
|
-
var de_GuardrailAutomatedReasoningTranslationOptionList = (output,
|
|
32588
|
+
var de_GuardrailAutomatedReasoningTranslationOptionList = (output, context) => {
|
|
32620
32589
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32621
32590
|
return de_GuardrailAutomatedReasoningTranslationOption(entry);
|
|
32622
32591
|
});
|
|
32623
32592
|
return retVal;
|
|
32624
32593
|
};
|
|
32625
|
-
var de_GuardrailAutomatedReasoningValidFinding = (output,
|
|
32594
|
+
var de_GuardrailAutomatedReasoningValidFinding = (output, context) => {
|
|
32626
32595
|
return smithyClient.take(output, {
|
|
32627
32596
|
claimsTrueScenario: smithyClient._json,
|
|
32628
32597
|
logicWarning: smithyClient._json,
|
|
@@ -32630,7 +32599,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32630
32599
|
translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
|
|
32631
32600
|
});
|
|
32632
32601
|
};
|
|
32633
|
-
var de_GuardrailContextualGroundingFilter = (output,
|
|
32602
|
+
var de_GuardrailContextualGroundingFilter = (output, context) => {
|
|
32634
32603
|
return smithyClient.take(output, {
|
|
32635
32604
|
action: smithyClient.expectString,
|
|
32636
32605
|
detected: smithyClient.expectBoolean,
|
|
@@ -32639,21 +32608,21 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32639
32608
|
type: smithyClient.expectString
|
|
32640
32609
|
});
|
|
32641
32610
|
};
|
|
32642
|
-
var de_GuardrailContextualGroundingFilters = (output,
|
|
32611
|
+
var de_GuardrailContextualGroundingFilters = (output, context) => {
|
|
32643
32612
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32644
32613
|
return de_GuardrailContextualGroundingFilter(entry);
|
|
32645
32614
|
});
|
|
32646
32615
|
return retVal;
|
|
32647
32616
|
};
|
|
32648
|
-
var de_GuardrailContextualGroundingPolicyAssessment = (output,
|
|
32617
|
+
var de_GuardrailContextualGroundingPolicyAssessment = (output, context) => {
|
|
32649
32618
|
return smithyClient.take(output, {
|
|
32650
32619
|
filters: (_2) => de_GuardrailContextualGroundingFilters(_2)
|
|
32651
32620
|
});
|
|
32652
32621
|
};
|
|
32653
|
-
var de_GuardrailConverseContentBlock = (output,
|
|
32622
|
+
var de_GuardrailConverseContentBlock = (output, context) => {
|
|
32654
32623
|
if (output.image != null) {
|
|
32655
32624
|
return {
|
|
32656
|
-
image: de_GuardrailConverseImageBlock(output.image,
|
|
32625
|
+
image: de_GuardrailConverseImageBlock(output.image, context)
|
|
32657
32626
|
};
|
|
32658
32627
|
}
|
|
32659
32628
|
if (output.text != null) {
|
|
@@ -32663,21 +32632,21 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32663
32632
|
}
|
|
32664
32633
|
return { $unknown: Object.entries(output)[0] };
|
|
32665
32634
|
};
|
|
32666
|
-
var de_GuardrailConverseImageBlock = (output,
|
|
32635
|
+
var de_GuardrailConverseImageBlock = (output, context) => {
|
|
32667
32636
|
return smithyClient.take(output, {
|
|
32668
32637
|
format: smithyClient.expectString,
|
|
32669
|
-
source: (_2) => de_GuardrailConverseImageSource(core$1.awsExpectUnion(_2),
|
|
32638
|
+
source: (_2) => de_GuardrailConverseImageSource(core$1.awsExpectUnion(_2), context)
|
|
32670
32639
|
});
|
|
32671
32640
|
};
|
|
32672
|
-
var de_GuardrailConverseImageSource = (output,
|
|
32641
|
+
var de_GuardrailConverseImageSource = (output, context) => {
|
|
32673
32642
|
if (output.bytes != null) {
|
|
32674
32643
|
return {
|
|
32675
|
-
bytes:
|
|
32644
|
+
bytes: context.base64Decoder(output.bytes)
|
|
32676
32645
|
};
|
|
32677
32646
|
}
|
|
32678
32647
|
return { $unknown: Object.entries(output)[0] };
|
|
32679
32648
|
};
|
|
32680
|
-
var de_GuardrailTraceAssessment = (output,
|
|
32649
|
+
var de_GuardrailTraceAssessment = (output, context) => {
|
|
32681
32650
|
return smithyClient.take(output, {
|
|
32682
32651
|
actionReason: smithyClient.expectString,
|
|
32683
32652
|
inputAssessment: (_2) => de_GuardrailAssessmentMap(_2),
|
|
@@ -32685,16 +32654,16 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32685
32654
|
outputAssessments: (_2) => de_GuardrailAssessmentListMap(_2)
|
|
32686
32655
|
});
|
|
32687
32656
|
};
|
|
32688
|
-
var de_ImageBlock = (output,
|
|
32657
|
+
var de_ImageBlock = (output, context) => {
|
|
32689
32658
|
return smithyClient.take(output, {
|
|
32690
32659
|
format: smithyClient.expectString,
|
|
32691
|
-
source: (_2) => de_ImageSource(core$1.awsExpectUnion(_2),
|
|
32660
|
+
source: (_2) => de_ImageSource(core$1.awsExpectUnion(_2), context)
|
|
32692
32661
|
});
|
|
32693
32662
|
};
|
|
32694
|
-
var de_ImageSource = (output,
|
|
32663
|
+
var de_ImageSource = (output, context) => {
|
|
32695
32664
|
if (output.bytes != null) {
|
|
32696
32665
|
return {
|
|
32697
|
-
bytes:
|
|
32666
|
+
bytes: context.base64Decoder(output.bytes)
|
|
32698
32667
|
};
|
|
32699
32668
|
}
|
|
32700
32669
|
if (output.s3Location != null) {
|
|
@@ -32704,24 +32673,24 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32704
32673
|
}
|
|
32705
32674
|
return { $unknown: Object.entries(output)[0] };
|
|
32706
32675
|
};
|
|
32707
|
-
var de_Message = (output,
|
|
32676
|
+
var de_Message = (output, context) => {
|
|
32708
32677
|
return smithyClient.take(output, {
|
|
32709
|
-
content: (_2) => de_ContentBlocks(_2,
|
|
32678
|
+
content: (_2) => de_ContentBlocks(_2, context),
|
|
32710
32679
|
role: smithyClient.expectString
|
|
32711
32680
|
});
|
|
32712
32681
|
};
|
|
32713
|
-
var de_MessageStopEvent = (output,
|
|
32682
|
+
var de_MessageStopEvent = (output, context) => {
|
|
32714
32683
|
return smithyClient.take(output, {
|
|
32715
32684
|
additionalModelResponseFields: (_2) => de_Document(_2),
|
|
32716
32685
|
stopReason: smithyClient.expectString
|
|
32717
32686
|
});
|
|
32718
32687
|
};
|
|
32719
|
-
var de_PayloadPart = (output,
|
|
32688
|
+
var de_PayloadPart = (output, context) => {
|
|
32720
32689
|
return smithyClient.take(output, {
|
|
32721
|
-
bytes:
|
|
32690
|
+
bytes: context.base64Decoder
|
|
32722
32691
|
});
|
|
32723
32692
|
};
|
|
32724
|
-
var de_ReasoningContentBlock = (output,
|
|
32693
|
+
var de_ReasoningContentBlock = (output, context) => {
|
|
32725
32694
|
if (output.reasoningText != null) {
|
|
32726
32695
|
return {
|
|
32727
32696
|
reasoningText: smithyClient._json(output.reasoningText)
|
|
@@ -32729,15 +32698,15 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32729
32698
|
}
|
|
32730
32699
|
if (output.redactedContent != null) {
|
|
32731
32700
|
return {
|
|
32732
|
-
redactedContent:
|
|
32701
|
+
redactedContent: context.base64Decoder(output.redactedContent)
|
|
32733
32702
|
};
|
|
32734
32703
|
}
|
|
32735
32704
|
return { $unknown: Object.entries(output)[0] };
|
|
32736
32705
|
};
|
|
32737
|
-
var de_ReasoningContentBlockDelta = (output,
|
|
32706
|
+
var de_ReasoningContentBlockDelta = (output, context) => {
|
|
32738
32707
|
if (output.redactedContent != null) {
|
|
32739
32708
|
return {
|
|
32740
|
-
redactedContent:
|
|
32709
|
+
redactedContent: context.base64Decoder(output.redactedContent)
|
|
32741
32710
|
};
|
|
32742
32711
|
}
|
|
32743
32712
|
if (smithyClient.expectString(output.signature) !== void 0) {
|
|
@@ -32748,22 +32717,22 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32748
32717
|
}
|
|
32749
32718
|
return { $unknown: Object.entries(output)[0] };
|
|
32750
32719
|
};
|
|
32751
|
-
var de_ToolResultBlock = (output,
|
|
32720
|
+
var de_ToolResultBlock = (output, context) => {
|
|
32752
32721
|
return smithyClient.take(output, {
|
|
32753
|
-
content: (_2) => de_ToolResultContentBlocks(_2,
|
|
32722
|
+
content: (_2) => de_ToolResultContentBlocks(_2, context),
|
|
32754
32723
|
status: smithyClient.expectString,
|
|
32755
32724
|
toolUseId: smithyClient.expectString
|
|
32756
32725
|
});
|
|
32757
32726
|
};
|
|
32758
|
-
var de_ToolResultContentBlock = (output,
|
|
32727
|
+
var de_ToolResultContentBlock = (output, context) => {
|
|
32759
32728
|
if (output.document != null) {
|
|
32760
32729
|
return {
|
|
32761
|
-
document: de_DocumentBlock(output.document,
|
|
32730
|
+
document: de_DocumentBlock(output.document, context)
|
|
32762
32731
|
};
|
|
32763
32732
|
}
|
|
32764
32733
|
if (output.image != null) {
|
|
32765
32734
|
return {
|
|
32766
|
-
image: de_ImageBlock(output.image,
|
|
32735
|
+
image: de_ImageBlock(output.image, context)
|
|
32767
32736
|
};
|
|
32768
32737
|
}
|
|
32769
32738
|
if (output.json != null) {
|
|
@@ -32776,34 +32745,34 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32776
32745
|
}
|
|
32777
32746
|
if (output.video != null) {
|
|
32778
32747
|
return {
|
|
32779
|
-
video: de_VideoBlock(output.video,
|
|
32748
|
+
video: de_VideoBlock(output.video, context)
|
|
32780
32749
|
};
|
|
32781
32750
|
}
|
|
32782
32751
|
return { $unknown: Object.entries(output)[0] };
|
|
32783
32752
|
};
|
|
32784
|
-
var de_ToolResultContentBlocks = (output,
|
|
32753
|
+
var de_ToolResultContentBlocks = (output, context) => {
|
|
32785
32754
|
const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
|
|
32786
|
-
return de_ToolResultContentBlock(core$1.awsExpectUnion(entry),
|
|
32755
|
+
return de_ToolResultContentBlock(core$1.awsExpectUnion(entry), context);
|
|
32787
32756
|
});
|
|
32788
32757
|
return retVal;
|
|
32789
32758
|
};
|
|
32790
|
-
var de_ToolUseBlock = (output,
|
|
32759
|
+
var de_ToolUseBlock = (output, context) => {
|
|
32791
32760
|
return smithyClient.take(output, {
|
|
32792
32761
|
input: (_2) => de_Document(_2),
|
|
32793
32762
|
name: smithyClient.expectString,
|
|
32794
32763
|
toolUseId: smithyClient.expectString
|
|
32795
32764
|
});
|
|
32796
32765
|
};
|
|
32797
|
-
var de_VideoBlock = (output,
|
|
32766
|
+
var de_VideoBlock = (output, context) => {
|
|
32798
32767
|
return smithyClient.take(output, {
|
|
32799
32768
|
format: smithyClient.expectString,
|
|
32800
|
-
source: (_2) => de_VideoSource(core$1.awsExpectUnion(_2),
|
|
32769
|
+
source: (_2) => de_VideoSource(core$1.awsExpectUnion(_2), context)
|
|
32801
32770
|
});
|
|
32802
32771
|
};
|
|
32803
|
-
var de_VideoSource = (output,
|
|
32772
|
+
var de_VideoSource = (output, context) => {
|
|
32804
32773
|
if (output.bytes != null) {
|
|
32805
32774
|
return {
|
|
32806
|
-
bytes:
|
|
32775
|
+
bytes: context.base64Decoder(output.bytes)
|
|
32807
32776
|
};
|
|
32808
32777
|
}
|
|
32809
32778
|
if (output.s3Location != null) {
|
|
@@ -32813,7 +32782,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
32813
32782
|
}
|
|
32814
32783
|
return { $unknown: Object.entries(output)[0] };
|
|
32815
32784
|
};
|
|
32816
|
-
var de_Document = (output,
|
|
32785
|
+
var de_Document = (output, context) => {
|
|
32817
32786
|
return output;
|
|
32818
32787
|
};
|
|
32819
32788
|
var deserializeMetadata3 = (output) => ({
|
|
@@ -37379,7 +37348,7 @@ var init_esm2 = __esm({
|
|
|
37379
37348
|
free: c3.#free,
|
|
37380
37349
|
// methods
|
|
37381
37350
|
isBackgroundFetch: (p3) => c3.#isBackgroundFetch(p3),
|
|
37382
|
-
backgroundFetch: (k3, index, options,
|
|
37351
|
+
backgroundFetch: (k3, index, options, context) => c3.#backgroundFetch(k3, index, options, context),
|
|
37383
37352
|
moveToTail: (index) => c3.#moveToTail(index),
|
|
37384
37353
|
indexes: (options) => c3.#indexes(options),
|
|
37385
37354
|
rindexes: (options) => c3.#rindexes(options),
|
|
@@ -38166,7 +38135,7 @@ var init_esm2 = __esm({
|
|
|
38166
38135
|
const v3 = this.#valList[index];
|
|
38167
38136
|
return this.#isBackgroundFetch(v3) ? v3.__staleWhileFetching : v3;
|
|
38168
38137
|
}
|
|
38169
|
-
#backgroundFetch(k3, index, options,
|
|
38138
|
+
#backgroundFetch(k3, index, options, context) {
|
|
38170
38139
|
const v3 = index === void 0 ? void 0 : this.#valList[index];
|
|
38171
38140
|
if (this.#isBackgroundFetch(v3)) {
|
|
38172
38141
|
return v3;
|
|
@@ -38179,7 +38148,7 @@ var init_esm2 = __esm({
|
|
|
38179
38148
|
const fetchOpts = {
|
|
38180
38149
|
signal: ac.signal,
|
|
38181
38150
|
options,
|
|
38182
|
-
context
|
|
38151
|
+
context
|
|
38183
38152
|
};
|
|
38184
38153
|
const cb = (v4, updateCache = false) => {
|
|
38185
38154
|
const { aborted } = ac.signal;
|
|
@@ -38296,7 +38265,7 @@ var init_esm2 = __esm({
|
|
|
38296
38265
|
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
|
38297
38266
|
ignoreFetchAbort = this.ignoreFetchAbort,
|
|
38298
38267
|
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
|
38299
|
-
context
|
|
38268
|
+
context,
|
|
38300
38269
|
forceRefresh = false,
|
|
38301
38270
|
status,
|
|
38302
38271
|
signal
|
|
@@ -38331,7 +38300,7 @@ var init_esm2 = __esm({
|
|
|
38331
38300
|
if (index === void 0) {
|
|
38332
38301
|
if (status)
|
|
38333
38302
|
status.fetch = "miss";
|
|
38334
|
-
const p3 = this.#backgroundFetch(k3, index, options,
|
|
38303
|
+
const p3 = this.#backgroundFetch(k3, index, options, context);
|
|
38335
38304
|
return p3.__returned = p3;
|
|
38336
38305
|
} else {
|
|
38337
38306
|
const v3 = this.#valList[index];
|
|
@@ -38356,7 +38325,7 @@ var init_esm2 = __esm({
|
|
|
38356
38325
|
this.#statusTTL(status, index);
|
|
38357
38326
|
return v3;
|
|
38358
38327
|
}
|
|
38359
|
-
const p3 = this.#backgroundFetch(k3, index, options,
|
|
38328
|
+
const p3 = this.#backgroundFetch(k3, index, options, context);
|
|
38360
38329
|
const hasStale = p3.__staleWhileFetching !== void 0;
|
|
38361
38330
|
const staleVal = hasStale && allowStale;
|
|
38362
38331
|
if (status) {
|
|
@@ -38378,13 +38347,13 @@ var init_esm2 = __esm({
|
|
|
38378
38347
|
if (!memoMethod) {
|
|
38379
38348
|
throw new Error("no memoMethod provided to constructor");
|
|
38380
38349
|
}
|
|
38381
|
-
const { context
|
|
38350
|
+
const { context, forceRefresh, ...options } = memoOptions;
|
|
38382
38351
|
const v3 = this.get(k3, options);
|
|
38383
38352
|
if (!forceRefresh && v3 !== void 0)
|
|
38384
38353
|
return v3;
|
|
38385
38354
|
const vv = memoMethod(k3, v3, {
|
|
38386
38355
|
options,
|
|
38387
|
-
context
|
|
38356
|
+
context
|
|
38388
38357
|
});
|
|
38389
38358
|
this.set(k3, vv, options);
|
|
38390
38359
|
return vv;
|
|
@@ -55651,8 +55620,8 @@ function mapFlowchartParserError(err, text) {
|
|
|
55651
55620
|
};
|
|
55652
55621
|
}
|
|
55653
55622
|
if (tokType === "QuotedString") {
|
|
55654
|
-
const
|
|
55655
|
-
const inLinkRule =
|
|
55623
|
+
const context = err?.context;
|
|
55624
|
+
const inLinkRule = context?.ruleStack?.includes("linkTextInline") || context?.ruleStack?.includes("link") || false;
|
|
55656
55625
|
const lineContent = allLines[Math.max(0, line - 1)] || "";
|
|
55657
55626
|
const beforeQuote = lineContent.slice(0, Math.max(0, column - 1));
|
|
55658
55627
|
const hasLinkBefore = beforeQuote.match(/--\s*$|==\s*$|-\.\s*$|-\.-\s*$|\[\s*$/);
|
|
@@ -75136,9 +75105,7 @@ Examples:
|
|
|
75136
75105
|
</search>
|
|
75137
75106
|
|
|
75138
75107
|
<extract>
|
|
75139
|
-
<
|
|
75140
|
-
<start_line>15</start_line>
|
|
75141
|
-
<end_line>25</end_line>
|
|
75108
|
+
<targets>src/config.js:15-25</targets>
|
|
75142
75109
|
</extract>
|
|
75143
75110
|
|
|
75144
75111
|
<attempt_completion>
|
|
@@ -76607,662 +76574,6 @@ var init_simpleTelemetry = __esm({
|
|
|
76607
76574
|
}
|
|
76608
76575
|
});
|
|
76609
76576
|
|
|
76610
|
-
// src/agent/fileSpanExporter.js
|
|
76611
|
-
var import_fs9, import_core17, FileSpanExporter;
|
|
76612
|
-
var init_fileSpanExporter = __esm({
|
|
76613
|
-
"src/agent/fileSpanExporter.js"() {
|
|
76614
|
-
"use strict";
|
|
76615
|
-
import_fs9 = require("fs");
|
|
76616
|
-
import_core17 = require("@opentelemetry/core");
|
|
76617
|
-
FileSpanExporter = class {
|
|
76618
|
-
constructor(filePath = "./traces.jsonl") {
|
|
76619
|
-
this.filePath = filePath;
|
|
76620
|
-
this.stream = (0, import_fs9.createWriteStream)(filePath, { flags: "a" });
|
|
76621
|
-
this.stream.on("error", (error2) => {
|
|
76622
|
-
console.error(`[FileSpanExporter] Stream error: ${error2.message}`);
|
|
76623
|
-
});
|
|
76624
|
-
}
|
|
76625
|
-
/**
|
|
76626
|
-
* Export spans to file
|
|
76627
|
-
* @param {ReadableSpan[]} spans - Array of spans to export
|
|
76628
|
-
* @param {function} resultCallback - Callback to call with the export result
|
|
76629
|
-
*/
|
|
76630
|
-
export(spans, resultCallback) {
|
|
76631
|
-
if (!spans || spans.length === 0) {
|
|
76632
|
-
resultCallback({ code: import_core17.ExportResultCode.SUCCESS });
|
|
76633
|
-
return;
|
|
76634
|
-
}
|
|
76635
|
-
try {
|
|
76636
|
-
const timestamp = Date.now();
|
|
76637
|
-
spans.forEach((span, index) => {
|
|
76638
|
-
let parentSpanId = void 0;
|
|
76639
|
-
if (span.parentSpanContext) {
|
|
76640
|
-
parentSpanId = span.parentSpanContext.spanId;
|
|
76641
|
-
} else if (span._parentSpanContext) {
|
|
76642
|
-
parentSpanId = span._parentSpanContext.spanId;
|
|
76643
|
-
} else if (span.parent) {
|
|
76644
|
-
parentSpanId = span.parent.spanId;
|
|
76645
|
-
} else if (span._parent) {
|
|
76646
|
-
parentSpanId = span._parent.spanId;
|
|
76647
|
-
} else if (span._parentId) {
|
|
76648
|
-
parentSpanId = span._parentId;
|
|
76649
|
-
} else if (span.parentSpanId) {
|
|
76650
|
-
parentSpanId = span.parentSpanId;
|
|
76651
|
-
}
|
|
76652
|
-
const spanData = {
|
|
76653
|
-
traceId: span.spanContext().traceId,
|
|
76654
|
-
spanId: span.spanContext().spanId,
|
|
76655
|
-
parentSpanId,
|
|
76656
|
-
name: span.name,
|
|
76657
|
-
kind: span.kind,
|
|
76658
|
-
startTimeUnixNano: span.startTime[0] * 1e9 + span.startTime[1],
|
|
76659
|
-
endTimeUnixNano: span.endTime[0] * 1e9 + span.endTime[1],
|
|
76660
|
-
attributes: this.convertAttributes(span.attributes),
|
|
76661
|
-
status: span.status,
|
|
76662
|
-
events: span.events?.map((event) => ({
|
|
76663
|
-
timeUnixNano: event.time[0] * 1e9 + event.time[1],
|
|
76664
|
-
name: event.name,
|
|
76665
|
-
attributes: this.convertAttributes(event.attributes)
|
|
76666
|
-
})) || [],
|
|
76667
|
-
links: span.links?.map((link) => ({
|
|
76668
|
-
traceId: link.context.traceId,
|
|
76669
|
-
spanId: link.context.spanId,
|
|
76670
|
-
attributes: this.convertAttributes(link.attributes)
|
|
76671
|
-
})) || [],
|
|
76672
|
-
resource: {
|
|
76673
|
-
attributes: this.convertAttributes(span.resource?.attributes || {})
|
|
76674
|
-
},
|
|
76675
|
-
instrumentationLibrary: {
|
|
76676
|
-
name: span.instrumentationLibrary?.name || "unknown",
|
|
76677
|
-
version: span.instrumentationLibrary?.version || "unknown"
|
|
76678
|
-
},
|
|
76679
|
-
timestamp
|
|
76680
|
-
};
|
|
76681
|
-
this.stream.write(JSON.stringify(spanData) + "\n");
|
|
76682
|
-
});
|
|
76683
|
-
resultCallback({ code: import_core17.ExportResultCode.SUCCESS });
|
|
76684
|
-
} catch (error2) {
|
|
76685
|
-
console.error(`[FileSpanExporter] Export error: ${error2.message}`);
|
|
76686
|
-
resultCallback({
|
|
76687
|
-
code: import_core17.ExportResultCode.FAILED,
|
|
76688
|
-
error: error2
|
|
76689
|
-
});
|
|
76690
|
-
}
|
|
76691
|
-
}
|
|
76692
|
-
/**
|
|
76693
|
-
* Convert OpenTelemetry attributes to plain object
|
|
76694
|
-
* @param {Object} attributes - OpenTelemetry attributes
|
|
76695
|
-
* @returns {Object} Plain object with string values
|
|
76696
|
-
*/
|
|
76697
|
-
convertAttributes(attributes) {
|
|
76698
|
-
if (!attributes) return {};
|
|
76699
|
-
const result = {};
|
|
76700
|
-
for (const [key, value] of Object.entries(attributes)) {
|
|
76701
|
-
if (typeof value === "object" && value !== null) {
|
|
76702
|
-
result[key] = JSON.stringify(value);
|
|
76703
|
-
} else {
|
|
76704
|
-
result[key] = String(value);
|
|
76705
|
-
}
|
|
76706
|
-
}
|
|
76707
|
-
return result;
|
|
76708
|
-
}
|
|
76709
|
-
/**
|
|
76710
|
-
* Shutdown the exporter
|
|
76711
|
-
* @returns {Promise<void>}
|
|
76712
|
-
*/
|
|
76713
|
-
async shutdown() {
|
|
76714
|
-
return new Promise((resolve4) => {
|
|
76715
|
-
if (this.stream) {
|
|
76716
|
-
this.stream.end(() => {
|
|
76717
|
-
console.log(`[FileSpanExporter] File stream closed: ${this.filePath}`);
|
|
76718
|
-
resolve4();
|
|
76719
|
-
});
|
|
76720
|
-
} else {
|
|
76721
|
-
resolve4();
|
|
76722
|
-
}
|
|
76723
|
-
});
|
|
76724
|
-
}
|
|
76725
|
-
/**
|
|
76726
|
-
* Force flush any pending spans
|
|
76727
|
-
* @returns {Promise<void>}
|
|
76728
|
-
*/
|
|
76729
|
-
async forceFlush() {
|
|
76730
|
-
return new Promise((resolve4, reject2) => {
|
|
76731
|
-
if (this.stream) {
|
|
76732
|
-
const flushTimeout = setTimeout(() => {
|
|
76733
|
-
console.warn("[FileSpanExporter] Flush timeout after 5 seconds");
|
|
76734
|
-
resolve4();
|
|
76735
|
-
}, 5e3);
|
|
76736
|
-
if (this.stream.writableCorked) {
|
|
76737
|
-
this.stream.uncork();
|
|
76738
|
-
}
|
|
76739
|
-
if (this.stream.writableNeedDrain) {
|
|
76740
|
-
this.stream.once("drain", () => {
|
|
76741
|
-
clearTimeout(flushTimeout);
|
|
76742
|
-
resolve4();
|
|
76743
|
-
});
|
|
76744
|
-
} else {
|
|
76745
|
-
setImmediate(() => {
|
|
76746
|
-
clearTimeout(flushTimeout);
|
|
76747
|
-
resolve4();
|
|
76748
|
-
});
|
|
76749
|
-
}
|
|
76750
|
-
} else {
|
|
76751
|
-
resolve4();
|
|
76752
|
-
}
|
|
76753
|
-
});
|
|
76754
|
-
}
|
|
76755
|
-
};
|
|
76756
|
-
}
|
|
76757
|
-
});
|
|
76758
|
-
|
|
76759
|
-
// src/agent/telemetry.js
|
|
76760
|
-
function initializeTelemetryFromOptions(options) {
|
|
76761
|
-
const config = new TelemetryConfig({
|
|
76762
|
-
serviceName: "probe-agent",
|
|
76763
|
-
serviceVersion: "1.0.0",
|
|
76764
|
-
enableFile: options.traceFile !== void 0,
|
|
76765
|
-
enableRemote: options.traceRemote !== void 0,
|
|
76766
|
-
enableConsole: options.traceConsole,
|
|
76767
|
-
filePath: options.traceFile || "./traces.jsonl",
|
|
76768
|
-
remoteEndpoint: options.traceRemote || "http://localhost:4318/v1/traces"
|
|
76769
|
-
});
|
|
76770
|
-
config.initialize();
|
|
76771
|
-
return config;
|
|
76772
|
-
}
|
|
76773
|
-
var import_sdk_node, import_resources, import_semantic_conventions, import_api, import_exporter_trace_otlp_http, import_sdk_trace_base, import_fs10, import_path11, TelemetryConfig;
|
|
76774
|
-
var init_telemetry = __esm({
|
|
76775
|
-
"src/agent/telemetry.js"() {
|
|
76776
|
-
"use strict";
|
|
76777
|
-
import_sdk_node = require("@opentelemetry/sdk-node");
|
|
76778
|
-
import_resources = require("@opentelemetry/resources");
|
|
76779
|
-
import_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
76780
|
-
import_api = require("@opentelemetry/api");
|
|
76781
|
-
import_exporter_trace_otlp_http = require("@opentelemetry/exporter-trace-otlp-http");
|
|
76782
|
-
import_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
76783
|
-
import_fs10 = require("fs");
|
|
76784
|
-
import_path11 = require("path");
|
|
76785
|
-
init_fileSpanExporter();
|
|
76786
|
-
TelemetryConfig = class {
|
|
76787
|
-
constructor(options = {}) {
|
|
76788
|
-
this.serviceName = options.serviceName || "probe-agent";
|
|
76789
|
-
this.serviceVersion = options.serviceVersion || "1.0.0";
|
|
76790
|
-
this.enableFile = options.enableFile || false;
|
|
76791
|
-
this.enableRemote = options.enableRemote || false;
|
|
76792
|
-
this.enableConsole = options.enableConsole || false;
|
|
76793
|
-
this.filePath = options.filePath || "./traces.jsonl";
|
|
76794
|
-
this.remoteEndpoint = options.remoteEndpoint || "http://localhost:4318/v1/traces";
|
|
76795
|
-
this.sdk = null;
|
|
76796
|
-
this.tracer = null;
|
|
76797
|
-
}
|
|
76798
|
-
/**
|
|
76799
|
-
* Initialize OpenTelemetry SDK
|
|
76800
|
-
*/
|
|
76801
|
-
initialize() {
|
|
76802
|
-
if (this.sdk) {
|
|
76803
|
-
console.warn("Telemetry already initialized");
|
|
76804
|
-
return;
|
|
76805
|
-
}
|
|
76806
|
-
const resource = (0, import_resources.resourceFromAttributes)({
|
|
76807
|
-
[import_semantic_conventions.ATTR_SERVICE_NAME]: this.serviceName,
|
|
76808
|
-
[import_semantic_conventions.ATTR_SERVICE_VERSION]: this.serviceVersion
|
|
76809
|
-
});
|
|
76810
|
-
const spanProcessors = [];
|
|
76811
|
-
if (this.enableFile) {
|
|
76812
|
-
try {
|
|
76813
|
-
const dir = (0, import_path11.dirname)(this.filePath);
|
|
76814
|
-
if (!(0, import_fs10.existsSync)(dir)) {
|
|
76815
|
-
(0, import_fs10.mkdirSync)(dir, { recursive: true });
|
|
76816
|
-
}
|
|
76817
|
-
const fileExporter = new FileSpanExporter(this.filePath);
|
|
76818
|
-
spanProcessors.push(new import_sdk_trace_base.BatchSpanProcessor(fileExporter, {
|
|
76819
|
-
maxQueueSize: 2048,
|
|
76820
|
-
maxExportBatchSize: 512,
|
|
76821
|
-
scheduledDelayMillis: 500,
|
|
76822
|
-
exportTimeoutMillis: 3e4
|
|
76823
|
-
}));
|
|
76824
|
-
console.log(`[Telemetry] File exporter enabled, writing to: ${this.filePath}`);
|
|
76825
|
-
} catch (error2) {
|
|
76826
|
-
console.error(`[Telemetry] Failed to initialize file exporter: ${error2.message}`);
|
|
76827
|
-
}
|
|
76828
|
-
}
|
|
76829
|
-
if (this.enableRemote) {
|
|
76830
|
-
try {
|
|
76831
|
-
const remoteExporter = new import_exporter_trace_otlp_http.OTLPTraceExporter({
|
|
76832
|
-
url: this.remoteEndpoint
|
|
76833
|
-
});
|
|
76834
|
-
spanProcessors.push(new import_sdk_trace_base.BatchSpanProcessor(remoteExporter, {
|
|
76835
|
-
maxQueueSize: 2048,
|
|
76836
|
-
maxExportBatchSize: 512,
|
|
76837
|
-
scheduledDelayMillis: 500,
|
|
76838
|
-
exportTimeoutMillis: 3e4
|
|
76839
|
-
}));
|
|
76840
|
-
console.log(`[Telemetry] Remote exporter enabled, endpoint: ${this.remoteEndpoint}`);
|
|
76841
|
-
} catch (error2) {
|
|
76842
|
-
console.error(`[Telemetry] Failed to initialize remote exporter: ${error2.message}`);
|
|
76843
|
-
}
|
|
76844
|
-
}
|
|
76845
|
-
if (this.enableConsole) {
|
|
76846
|
-
const consoleExporter = new import_sdk_trace_base.ConsoleSpanExporter();
|
|
76847
|
-
spanProcessors.push(new import_sdk_trace_base.BatchSpanProcessor(consoleExporter, {
|
|
76848
|
-
maxQueueSize: 2048,
|
|
76849
|
-
maxExportBatchSize: 512,
|
|
76850
|
-
scheduledDelayMillis: 500,
|
|
76851
|
-
exportTimeoutMillis: 3e4
|
|
76852
|
-
}));
|
|
76853
|
-
console.log(`[Telemetry] Console exporter enabled`);
|
|
76854
|
-
}
|
|
76855
|
-
if (spanProcessors.length === 0) {
|
|
76856
|
-
console.log("[Telemetry] No exporters configured, telemetry will not be collected");
|
|
76857
|
-
return;
|
|
76858
|
-
}
|
|
76859
|
-
this.sdk = new import_sdk_node.NodeSDK({
|
|
76860
|
-
resource,
|
|
76861
|
-
spanProcessors
|
|
76862
|
-
});
|
|
76863
|
-
try {
|
|
76864
|
-
this.sdk.start();
|
|
76865
|
-
this.tracer = import_api.trace.getTracer(this.serviceName, this.serviceVersion);
|
|
76866
|
-
console.log(`[Telemetry] OpenTelemetry SDK initialized successfully`);
|
|
76867
|
-
} catch (error2) {
|
|
76868
|
-
console.error(`[Telemetry] Failed to start OpenTelemetry SDK: ${error2.message}`);
|
|
76869
|
-
}
|
|
76870
|
-
}
|
|
76871
|
-
/**
|
|
76872
|
-
* Get the tracer instance
|
|
76873
|
-
*/
|
|
76874
|
-
getTracer() {
|
|
76875
|
-
return this.tracer;
|
|
76876
|
-
}
|
|
76877
|
-
/**
|
|
76878
|
-
* Create a span with the given name and attributes
|
|
76879
|
-
*/
|
|
76880
|
-
createSpan(name14, attributes = {}) {
|
|
76881
|
-
if (!this.tracer) {
|
|
76882
|
-
return null;
|
|
76883
|
-
}
|
|
76884
|
-
return this.tracer.startSpan(name14, {
|
|
76885
|
-
attributes
|
|
76886
|
-
});
|
|
76887
|
-
}
|
|
76888
|
-
/**
|
|
76889
|
-
* Wrap a function to automatically create spans
|
|
76890
|
-
*/
|
|
76891
|
-
wrapFunction(name14, fn, attributes = {}) {
|
|
76892
|
-
if (!this.tracer) {
|
|
76893
|
-
return fn;
|
|
76894
|
-
}
|
|
76895
|
-
return async (...args) => {
|
|
76896
|
-
const span = this.createSpan(name14, attributes);
|
|
76897
|
-
if (!span) {
|
|
76898
|
-
return fn(...args);
|
|
76899
|
-
}
|
|
76900
|
-
try {
|
|
76901
|
-
const result = await import_api.context.with(import_api.trace.setSpan(import_api.context.active(), span), () => fn(...args));
|
|
76902
|
-
span.setStatus({ code: import_api.SpanStatusCode.OK });
|
|
76903
|
-
return result;
|
|
76904
|
-
} catch (error2) {
|
|
76905
|
-
span.setStatus({
|
|
76906
|
-
code: import_api.SpanStatusCode.ERROR,
|
|
76907
|
-
message: error2.message
|
|
76908
|
-
});
|
|
76909
|
-
span.recordException(error2);
|
|
76910
|
-
throw error2;
|
|
76911
|
-
} finally {
|
|
76912
|
-
span.end();
|
|
76913
|
-
}
|
|
76914
|
-
};
|
|
76915
|
-
}
|
|
76916
|
-
/**
|
|
76917
|
-
* Force flush all pending spans
|
|
76918
|
-
*/
|
|
76919
|
-
async forceFlush() {
|
|
76920
|
-
if (this.sdk) {
|
|
76921
|
-
try {
|
|
76922
|
-
const tracerProvider = import_api.trace.getTracerProvider();
|
|
76923
|
-
if (tracerProvider && typeof tracerProvider.forceFlush === "function") {
|
|
76924
|
-
await tracerProvider.forceFlush();
|
|
76925
|
-
}
|
|
76926
|
-
await new Promise((resolve4) => setTimeout(resolve4, 100));
|
|
76927
|
-
console.log("[Telemetry] OpenTelemetry spans flushed successfully");
|
|
76928
|
-
} catch (error2) {
|
|
76929
|
-
console.error(`[Telemetry] Failed to flush OpenTelemetry spans: ${error2.message}`);
|
|
76930
|
-
}
|
|
76931
|
-
}
|
|
76932
|
-
}
|
|
76933
|
-
/**
|
|
76934
|
-
* Shutdown telemetry
|
|
76935
|
-
*/
|
|
76936
|
-
async shutdown() {
|
|
76937
|
-
if (this.sdk) {
|
|
76938
|
-
try {
|
|
76939
|
-
await this.sdk.shutdown();
|
|
76940
|
-
console.log("[Telemetry] OpenTelemetry SDK shutdown successfully");
|
|
76941
|
-
} catch (error2) {
|
|
76942
|
-
console.error(`[Telemetry] Failed to shutdown OpenTelemetry SDK: ${error2.message}`);
|
|
76943
|
-
}
|
|
76944
|
-
}
|
|
76945
|
-
}
|
|
76946
|
-
};
|
|
76947
|
-
}
|
|
76948
|
-
});
|
|
76949
|
-
|
|
76950
|
-
// src/agent/appTracer.js
|
|
76951
|
-
var import_api2, AppTracer;
|
|
76952
|
-
var init_appTracer = __esm({
|
|
76953
|
-
"src/agent/appTracer.js"() {
|
|
76954
|
-
"use strict";
|
|
76955
|
-
import_api2 = require("@opentelemetry/api");
|
|
76956
|
-
AppTracer = class {
|
|
76957
|
-
constructor(telemetryConfig, sessionId = null) {
|
|
76958
|
-
this.telemetryConfig = telemetryConfig;
|
|
76959
|
-
this.tracer = telemetryConfig?.getTracer();
|
|
76960
|
-
this.sessionId = sessionId || this.generateSessionId();
|
|
76961
|
-
this.traceId = this.generateTraceId();
|
|
76962
|
-
}
|
|
76963
|
-
/**
|
|
76964
|
-
* Generate a unique session ID
|
|
76965
|
-
*/
|
|
76966
|
-
generateSessionId() {
|
|
76967
|
-
return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
76968
|
-
}
|
|
76969
|
-
/**
|
|
76970
|
-
* Generate trace ID from session ID for consistent tracing
|
|
76971
|
-
*/
|
|
76972
|
-
generateTraceId() {
|
|
76973
|
-
if (!this.sessionId) return null;
|
|
76974
|
-
const hash = this.hashString(this.sessionId);
|
|
76975
|
-
return hash.padEnd(32, "0").substring(0, 32);
|
|
76976
|
-
}
|
|
76977
|
-
/**
|
|
76978
|
-
* Simple hash function for session ID
|
|
76979
|
-
*/
|
|
76980
|
-
hashString(str) {
|
|
76981
|
-
let hash = 0;
|
|
76982
|
-
for (let i3 = 0; i3 < str.length; i3++) {
|
|
76983
|
-
const char = str.charCodeAt(i3);
|
|
76984
|
-
hash = (hash << 5) - hash + char;
|
|
76985
|
-
hash = hash & hash;
|
|
76986
|
-
}
|
|
76987
|
-
return Math.abs(hash).toString(16);
|
|
76988
|
-
}
|
|
76989
|
-
/**
|
|
76990
|
-
* Check if tracing is enabled
|
|
76991
|
-
*/
|
|
76992
|
-
isEnabled() {
|
|
76993
|
-
return this.tracer !== null;
|
|
76994
|
-
}
|
|
76995
|
-
/**
|
|
76996
|
-
* Create a root span for the agent session
|
|
76997
|
-
*/
|
|
76998
|
-
createSessionSpan(attributes = {}) {
|
|
76999
|
-
if (!this.isEnabled()) return null;
|
|
77000
|
-
return this.tracer.startSpan("agent.session", {
|
|
77001
|
-
attributes: {
|
|
77002
|
-
"session.id": this.sessionId,
|
|
77003
|
-
"trace.id": this.traceId,
|
|
77004
|
-
...attributes
|
|
77005
|
-
}
|
|
77006
|
-
});
|
|
77007
|
-
}
|
|
77008
|
-
/**
|
|
77009
|
-
* Create a span for AI model requests
|
|
77010
|
-
*/
|
|
77011
|
-
createAISpan(modelName, provider, attributes = {}) {
|
|
77012
|
-
if (!this.isEnabled()) return null;
|
|
77013
|
-
return this.tracer.startSpan("ai.request", {
|
|
77014
|
-
attributes: {
|
|
77015
|
-
"ai.model": modelName,
|
|
77016
|
-
"ai.provider": provider,
|
|
77017
|
-
"session.id": this.sessionId,
|
|
77018
|
-
...attributes
|
|
77019
|
-
}
|
|
77020
|
-
});
|
|
77021
|
-
}
|
|
77022
|
-
/**
|
|
77023
|
-
* Create a span for tool calls
|
|
77024
|
-
*/
|
|
77025
|
-
createToolSpan(toolName, attributes = {}) {
|
|
77026
|
-
if (!this.isEnabled()) return null;
|
|
77027
|
-
return this.tracer.startSpan("tool.call", {
|
|
77028
|
-
attributes: {
|
|
77029
|
-
"tool.name": toolName,
|
|
77030
|
-
"session.id": this.sessionId,
|
|
77031
|
-
...attributes
|
|
77032
|
-
}
|
|
77033
|
-
});
|
|
77034
|
-
}
|
|
77035
|
-
/**
|
|
77036
|
-
* Create a span for code search operations
|
|
77037
|
-
*/
|
|
77038
|
-
createSearchSpan(query2, attributes = {}) {
|
|
77039
|
-
if (!this.isEnabled()) return null;
|
|
77040
|
-
return this.tracer.startSpan("search.query", {
|
|
77041
|
-
attributes: {
|
|
77042
|
-
"search.query": query2,
|
|
77043
|
-
"session.id": this.sessionId,
|
|
77044
|
-
...attributes
|
|
77045
|
-
}
|
|
77046
|
-
});
|
|
77047
|
-
}
|
|
77048
|
-
/**
|
|
77049
|
-
* Create a span for code extraction operations
|
|
77050
|
-
*/
|
|
77051
|
-
createExtractSpan(files, attributes = {}) {
|
|
77052
|
-
if (!this.isEnabled()) return null;
|
|
77053
|
-
return this.tracer.startSpan("extract.files", {
|
|
77054
|
-
attributes: {
|
|
77055
|
-
"extract.file_count": Array.isArray(files) ? files.length : 1,
|
|
77056
|
-
"extract.files": Array.isArray(files) ? files.join(",") : files,
|
|
77057
|
-
"session.id": this.sessionId,
|
|
77058
|
-
...attributes
|
|
77059
|
-
}
|
|
77060
|
-
});
|
|
77061
|
-
}
|
|
77062
|
-
/**
|
|
77063
|
-
* Create a span for agent iterations
|
|
77064
|
-
*/
|
|
77065
|
-
createIterationSpan(iteration, attributes = {}) {
|
|
77066
|
-
if (!this.isEnabled()) return null;
|
|
77067
|
-
return this.tracer.startSpan("agent.iteration", {
|
|
77068
|
-
attributes: {
|
|
77069
|
-
"iteration.number": iteration,
|
|
77070
|
-
"session.id": this.sessionId,
|
|
77071
|
-
...attributes
|
|
77072
|
-
}
|
|
77073
|
-
});
|
|
77074
|
-
}
|
|
77075
|
-
/**
|
|
77076
|
-
* Create a span for delegation operations
|
|
77077
|
-
*/
|
|
77078
|
-
createDelegationSpan(task, attributes = {}) {
|
|
77079
|
-
if (!this.isEnabled()) return null;
|
|
77080
|
-
return this.tracer.startSpan("agent.delegation", {
|
|
77081
|
-
attributes: {
|
|
77082
|
-
"delegation.task": task.substring(0, 200) + (task.length > 200 ? "..." : ""),
|
|
77083
|
-
"delegation.task_length": task.length,
|
|
77084
|
-
"session.id": this.sessionId,
|
|
77085
|
-
...attributes
|
|
77086
|
-
}
|
|
77087
|
-
});
|
|
77088
|
-
}
|
|
77089
|
-
/**
|
|
77090
|
-
* Create a span for JSON validation operations
|
|
77091
|
-
*/
|
|
77092
|
-
createJsonValidationSpan(responseLength, attributes = {}) {
|
|
77093
|
-
if (!this.isEnabled()) return null;
|
|
77094
|
-
return this.tracer.startSpan("validation.json", {
|
|
77095
|
-
attributes: {
|
|
77096
|
-
"validation.response_length": responseLength,
|
|
77097
|
-
"session.id": this.sessionId,
|
|
77098
|
-
...attributes
|
|
77099
|
-
}
|
|
77100
|
-
});
|
|
77101
|
-
}
|
|
77102
|
-
/**
|
|
77103
|
-
* Create a span for Mermaid validation operations
|
|
77104
|
-
*/
|
|
77105
|
-
createMermaidValidationSpan(diagramCount, attributes = {}) {
|
|
77106
|
-
if (!this.isEnabled()) return null;
|
|
77107
|
-
return this.tracer.startSpan("validation.mermaid", {
|
|
77108
|
-
attributes: {
|
|
77109
|
-
"validation.diagram_count": diagramCount,
|
|
77110
|
-
"session.id": this.sessionId,
|
|
77111
|
-
...attributes
|
|
77112
|
-
}
|
|
77113
|
-
});
|
|
77114
|
-
}
|
|
77115
|
-
/**
|
|
77116
|
-
* Create a span for schema processing operations
|
|
77117
|
-
*/
|
|
77118
|
-
createSchemaProcessingSpan(schemaType, attributes = {}) {
|
|
77119
|
-
if (!this.isEnabled()) return null;
|
|
77120
|
-
return this.tracer.startSpan("schema.processing", {
|
|
77121
|
-
attributes: {
|
|
77122
|
-
"schema.type": schemaType,
|
|
77123
|
-
"session.id": this.sessionId,
|
|
77124
|
-
...attributes
|
|
77125
|
-
}
|
|
77126
|
-
});
|
|
77127
|
-
}
|
|
77128
|
-
/**
|
|
77129
|
-
* Record delegation events
|
|
77130
|
-
*/
|
|
77131
|
-
recordDelegationEvent(eventType, data2 = {}) {
|
|
77132
|
-
if (!this.isEnabled()) return;
|
|
77133
|
-
this.addEvent(`delegation.${eventType}`, {
|
|
77134
|
-
"session.id": this.sessionId,
|
|
77135
|
-
...data2
|
|
77136
|
-
});
|
|
77137
|
-
}
|
|
77138
|
-
/**
|
|
77139
|
-
* Record JSON validation events
|
|
77140
|
-
*/
|
|
77141
|
-
recordJsonValidationEvent(eventType, data2 = {}) {
|
|
77142
|
-
if (!this.isEnabled()) return;
|
|
77143
|
-
this.addEvent(`json_validation.${eventType}`, {
|
|
77144
|
-
"session.id": this.sessionId,
|
|
77145
|
-
...data2
|
|
77146
|
-
});
|
|
77147
|
-
}
|
|
77148
|
-
/**
|
|
77149
|
-
* Record Mermaid validation events
|
|
77150
|
-
*/
|
|
77151
|
-
recordMermaidValidationEvent(eventType, data2 = {}) {
|
|
77152
|
-
if (!this.isEnabled()) return;
|
|
77153
|
-
this.addEvent(`mermaid_validation.${eventType}`, {
|
|
77154
|
-
"session.id": this.sessionId,
|
|
77155
|
-
...data2
|
|
77156
|
-
});
|
|
77157
|
-
}
|
|
77158
|
-
/**
|
|
77159
|
-
* Add an event to the current or most recent span
|
|
77160
|
-
*/
|
|
77161
|
-
addEvent(name14, attributes = {}) {
|
|
77162
|
-
if (!this.isEnabled()) return;
|
|
77163
|
-
const activeSpan = import_api2.trace.getActiveSpan();
|
|
77164
|
-
if (activeSpan) {
|
|
77165
|
-
activeSpan.addEvent(name14, {
|
|
77166
|
-
"session.id": this.sessionId,
|
|
77167
|
-
...attributes
|
|
77168
|
-
});
|
|
77169
|
-
} else {
|
|
77170
|
-
if (this.telemetryConfig?.enableConsole) {
|
|
77171
|
-
console.log(`[Event] ${name14}:`, attributes);
|
|
77172
|
-
}
|
|
77173
|
-
}
|
|
77174
|
-
}
|
|
77175
|
-
/**
|
|
77176
|
-
* Set attributes on the current span
|
|
77177
|
-
*/
|
|
77178
|
-
setAttributes(attributes) {
|
|
77179
|
-
if (!this.isEnabled()) return;
|
|
77180
|
-
const activeSpan = import_api2.trace.getActiveSpan();
|
|
77181
|
-
if (activeSpan) {
|
|
77182
|
-
activeSpan.setAttributes({
|
|
77183
|
-
"session.id": this.sessionId,
|
|
77184
|
-
...attributes
|
|
77185
|
-
});
|
|
77186
|
-
}
|
|
77187
|
-
}
|
|
77188
|
-
/**
|
|
77189
|
-
* Wrap a function with automatic span creation
|
|
77190
|
-
*/
|
|
77191
|
-
wrapFunction(spanName, fn, attributes = {}) {
|
|
77192
|
-
if (!this.isEnabled()) {
|
|
77193
|
-
return fn;
|
|
77194
|
-
}
|
|
77195
|
-
return async (...args) => {
|
|
77196
|
-
const span = this.tracer.startSpan(spanName, {
|
|
77197
|
-
attributes: {
|
|
77198
|
-
"session.id": this.sessionId,
|
|
77199
|
-
...attributes
|
|
77200
|
-
}
|
|
77201
|
-
});
|
|
77202
|
-
try {
|
|
77203
|
-
const result = await import_api2.context.with(import_api2.trace.setSpan(import_api2.context.active(), span), () => fn(...args));
|
|
77204
|
-
span.setStatus({ code: import_api2.SpanStatusCode.OK });
|
|
77205
|
-
return result;
|
|
77206
|
-
} catch (error2) {
|
|
77207
|
-
span.setStatus({
|
|
77208
|
-
code: import_api2.SpanStatusCode.ERROR,
|
|
77209
|
-
message: error2.message
|
|
77210
|
-
});
|
|
77211
|
-
span.recordException(error2);
|
|
77212
|
-
throw error2;
|
|
77213
|
-
} finally {
|
|
77214
|
-
span.end();
|
|
77215
|
-
}
|
|
77216
|
-
};
|
|
77217
|
-
}
|
|
77218
|
-
/**
|
|
77219
|
-
* Execute a function within a span context
|
|
77220
|
-
*/
|
|
77221
|
-
async withSpan(spanName, fn, attributes = {}) {
|
|
77222
|
-
if (!this.isEnabled()) {
|
|
77223
|
-
return fn();
|
|
77224
|
-
}
|
|
77225
|
-
const span = this.tracer.startSpan(spanName, {
|
|
77226
|
-
attributes: {
|
|
77227
|
-
"session.id": this.sessionId,
|
|
77228
|
-
...attributes
|
|
77229
|
-
}
|
|
77230
|
-
});
|
|
77231
|
-
try {
|
|
77232
|
-
const result = await import_api2.context.with(import_api2.trace.setSpan(import_api2.context.active(), span), () => fn());
|
|
77233
|
-
span.setStatus({ code: import_api2.SpanStatusCode.OK });
|
|
77234
|
-
return result;
|
|
77235
|
-
} catch (error2) {
|
|
77236
|
-
span.setStatus({
|
|
77237
|
-
code: import_api2.SpanStatusCode.ERROR,
|
|
77238
|
-
message: error2.message
|
|
77239
|
-
});
|
|
77240
|
-
span.recordException(error2);
|
|
77241
|
-
throw error2;
|
|
77242
|
-
} finally {
|
|
77243
|
-
span.end();
|
|
77244
|
-
}
|
|
77245
|
-
}
|
|
77246
|
-
/**
|
|
77247
|
-
* Force flush all pending spans
|
|
77248
|
-
*/
|
|
77249
|
-
async flush() {
|
|
77250
|
-
if (this.telemetryConfig) {
|
|
77251
|
-
await this.telemetryConfig.forceFlush();
|
|
77252
|
-
}
|
|
77253
|
-
}
|
|
77254
|
-
/**
|
|
77255
|
-
* Shutdown tracing
|
|
77256
|
-
*/
|
|
77257
|
-
async shutdown() {
|
|
77258
|
-
if (this.telemetryConfig) {
|
|
77259
|
-
await this.telemetryConfig.shutdown();
|
|
77260
|
-
}
|
|
77261
|
-
}
|
|
77262
|
-
};
|
|
77263
|
-
}
|
|
77264
|
-
});
|
|
77265
|
-
|
|
77266
76577
|
// src/agent/storage/index.js
|
|
77267
76578
|
var init_storage = __esm({
|
|
77268
76579
|
"src/agent/storage/index.js"() {
|
|
@@ -77283,7 +76594,6 @@ var init_hooks = __esm({
|
|
|
77283
76594
|
// src/index.js
|
|
77284
76595
|
var index_exports = {};
|
|
77285
76596
|
__export(index_exports, {
|
|
77286
|
-
AppTracer: () => AppTracer,
|
|
77287
76597
|
DEFAULT_SYSTEM_MESSAGE: () => DEFAULT_SYSTEM_MESSAGE,
|
|
77288
76598
|
HOOK_TYPES: () => HOOK_TYPES,
|
|
77289
76599
|
HookManager: () => HookManager,
|
|
@@ -77292,7 +76602,6 @@ __export(index_exports, {
|
|
|
77292
76602
|
SimpleAppTracer: () => SimpleAppTracer,
|
|
77293
76603
|
SimpleTelemetry: () => SimpleTelemetry,
|
|
77294
76604
|
StorageAdapter: () => StorageAdapter,
|
|
77295
|
-
TelemetryConfig: () => TelemetryConfig,
|
|
77296
76605
|
attemptCompletionSchema: () => attemptCompletionSchema,
|
|
77297
76606
|
attemptCompletionToolDefinition: () => attemptCompletionToolDefinition,
|
|
77298
76607
|
bashSchema: () => bashSchema,
|
|
@@ -77309,7 +76618,6 @@ __export(index_exports, {
|
|
|
77309
76618
|
getBinaryPath: () => getBinaryPath,
|
|
77310
76619
|
grep: () => grep,
|
|
77311
76620
|
initializeSimpleTelemetryFromOptions: () => initializeSimpleTelemetryFromOptions,
|
|
77312
|
-
initializeTelemetryFromOptions: () => initializeTelemetryFromOptions,
|
|
77313
76621
|
listFilesByLevel: () => listFilesByLevel,
|
|
77314
76622
|
listFilesToolInstance: () => listFilesToolInstance,
|
|
77315
76623
|
parseXmlToolCall: () => parseXmlToolCall,
|
|
@@ -77344,8 +76652,6 @@ var init_index = __esm({
|
|
|
77344
76652
|
init_bash();
|
|
77345
76653
|
init_ProbeAgent();
|
|
77346
76654
|
init_simpleTelemetry();
|
|
77347
|
-
init_telemetry();
|
|
77348
|
-
init_appTracer();
|
|
77349
76655
|
init_probeTool();
|
|
77350
76656
|
init_storage();
|
|
77351
76657
|
init_hooks();
|
|
@@ -77355,7 +76661,6 @@ var init_index = __esm({
|
|
|
77355
76661
|
init_index();
|
|
77356
76662
|
// Annotate the CommonJS export names for ESM import in node:
|
|
77357
76663
|
0 && (module.exports = {
|
|
77358
|
-
AppTracer,
|
|
77359
76664
|
DEFAULT_SYSTEM_MESSAGE,
|
|
77360
76665
|
HOOK_TYPES,
|
|
77361
76666
|
HookManager,
|
|
@@ -77364,7 +76669,6 @@ init_index();
|
|
|
77364
76669
|
SimpleAppTracer,
|
|
77365
76670
|
SimpleTelemetry,
|
|
77366
76671
|
StorageAdapter,
|
|
77367
|
-
TelemetryConfig,
|
|
77368
76672
|
attemptCompletionSchema,
|
|
77369
76673
|
attemptCompletionToolDefinition,
|
|
77370
76674
|
bashSchema,
|
|
@@ -77381,7 +76685,6 @@ init_index();
|
|
|
77381
76685
|
getBinaryPath,
|
|
77382
76686
|
grep,
|
|
77383
76687
|
initializeSimpleTelemetryFromOptions,
|
|
77384
|
-
initializeTelemetryFromOptions,
|
|
77385
76688
|
listFilesByLevel,
|
|
77386
76689
|
listFilesToolInstance,
|
|
77387
76690
|
parseXmlToolCall,
|