@aws-sdk/client-workdocs 3.1075.0 → 3.1076.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ export declare const getRuntimeConfig: (config: WorkDocsClientConfig) => {
14
14
  requestHandler: import("@smithy/core/protocols").HttpHandler<any> | RequestHandler;
15
15
  retryMode: string | import("@smithy/types").Provider<string>;
16
16
  sha256: import("@smithy/types").HashConstructor;
17
- streamCollector: import("@smithy/types").StreamCollector;
17
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
18
18
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
19
19
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
20
20
  cacheMiddleware?: boolean | undefined;
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: WorkDocsClientConfig) => {
15
15
  requestHandler: RequestHandler | import("@smithy/core/protocols").HttpHandler<any>;
16
16
  retryMode: string | import("@smithy/types").Provider<string>;
17
17
  sha256: import("@smithy/types").HashConstructor;
18
- streamCollector: import("@smithy/types").StreamCollector;
18
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
19
19
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
20
20
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
21
21
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: WorkDocsClientConfig) => {
15
15
  apiVersion: string;
16
16
  urlParser: import("@smithy/types").UrlParser;
17
17
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
18
- streamCollector: import("@smithy/types").StreamCollector;
18
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
19
19
  base64Decoder: import("@smithy/types").Decoder;
20
20
  base64Encoder: (_input: Uint8Array | string) => string;
21
21
  utf8Decoder: import("@smithy/types").Decoder;
@@ -21,7 +21,13 @@ export declare const getRuntimeConfig: (config: WorkDocsClientConfig) => {
21
21
  | RequestHandler;
22
22
  retryMode: string | import("@smithy/types").Provider<string>;
23
23
  sha256: import("@smithy/types").HashConstructor;
24
- streamCollector: import("@smithy/types").StreamCollector;
24
+ streamCollector: (
25
+ stream:
26
+ | import("stream").Readable
27
+ | import("stream/web").ReadableStream
28
+ | ReadableStream
29
+ | Blob
30
+ ) => Promise<Uint8Array>;
25
31
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
26
32
  (boolean | import("@smithy/types").Provider<boolean | undefined>);
27
33
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
@@ -22,7 +22,13 @@ export declare const getRuntimeConfig: (config: WorkDocsClientConfig) => {
22
22
  | import("@smithy/core/protocols").HttpHandler<any>;
23
23
  retryMode: string | import("@smithy/types").Provider<string>;
24
24
  sha256: import("@smithy/types").HashConstructor;
25
- streamCollector: import("@smithy/types").StreamCollector;
25
+ streamCollector: (
26
+ stream:
27
+ | import("stream").Readable
28
+ | import("stream/web").ReadableStream
29
+ | ReadableStream
30
+ | Blob
31
+ ) => Promise<Uint8Array>;
26
32
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
27
33
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
28
34
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -20,7 +20,13 @@ export declare const getRuntimeConfig: (config: WorkDocsClientConfig) => {
20
20
  apiVersion: string;
21
21
  urlParser: import("@smithy/types").UrlParser;
22
22
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
23
- streamCollector: import("@smithy/types").StreamCollector;
23
+ streamCollector: (
24
+ stream:
25
+ | import("stream").Readable
26
+ | import("stream/web").ReadableStream
27
+ | ReadableStream
28
+ | Blob
29
+ ) => Promise<Uint8Array>;
24
30
  base64Decoder: import("@smithy/types").Decoder;
25
31
  base64Encoder: (_input: Uint8Array | string) => string;
26
32
  utf8Decoder: import("@smithy/types").Decoder;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-workdocs",
3
3
  "description": "AWS SDK for JavaScript Workdocs Client for Node.js, Browser and React Native",
4
- "version": "3.1075.0",
4
+ "version": "3.1076.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
7
7
  "build:cjs": "node ../../scripts/compilation/inline",
@@ -21,13 +21,13 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "5.2.0",
23
23
  "@aws-crypto/sha256-js": "5.2.0",
24
- "@aws-sdk/core": "^3.974.23",
25
- "@aws-sdk/credential-provider-node": "^3.972.58",
26
- "@aws-sdk/types": "^3.973.13",
27
- "@smithy/core": "^3.24.6",
28
- "@smithy/fetch-http-handler": "^5.4.6",
29
- "@smithy/node-http-handler": "^4.7.6",
30
- "@smithy/types": "^4.14.3",
24
+ "@aws-sdk/core": "^3.974.24",
25
+ "@aws-sdk/credential-provider-node": "^3.972.59",
26
+ "@aws-sdk/types": "^3.973.14",
27
+ "@smithy/core": "^3.27.0",
28
+ "@smithy/fetch-http-handler": "^5.6.0",
29
+ "@smithy/node-http-handler": "^4.9.0",
30
+ "@smithy/types": "^4.15.0",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "devDependencies": {
@@ -1,40 +0,0 @@
1
- const { resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
3
- exports.defaultWorkDocsHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
- return {
5
- operation: getSmithyContext(context).operation,
6
- region: await normalizeProvider(config.region)() || (() => {
7
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
8
- })(),
9
- };
10
- };
11
- function createAwsAuthSigv4HttpAuthOption(authParameters) {
12
- return {
13
- schemeId: "aws.auth#sigv4",
14
- signingProperties: {
15
- name: "workdocs",
16
- region: authParameters.region,
17
- },
18
- propertiesExtractor: (config, context) => ({
19
- signingProperties: {
20
- config,
21
- context,
22
- },
23
- }),
24
- };
25
- }
26
- exports.defaultWorkDocsHttpAuthSchemeProvider = (authParameters) => {
27
- const options = [];
28
- switch (authParameters.operation) {
29
- default: {
30
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
31
- }
32
- }
33
- return options;
34
- };
35
- exports.resolveHttpAuthSchemeConfig = (config) => {
36
- const config_0 = resolveAwsSdkSigV4Config(config);
37
- return Object.assign(config_0, {
38
- authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
39
- });
40
- };
@@ -1,46 +0,0 @@
1
- const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
2
- const k = "ref";
3
- const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [k]: "Endpoint" }, h = { [k]: d }, i = {}, j = [{ [k]: "Region" }];
4
- const _data = {
5
- conditions: [
6
- [c, [g]],
7
- [c, j],
8
- ["aws.partition", j, d],
9
- [e, [{ [k]: "UseFIPS" }, b]],
10
- [e, [{ [k]: "UseDualStack" }, b]],
11
- [e, [{ fn: f, argv: [h, "supportsDualStack"] }, b]],
12
- [e, [{ fn: f, argv: [h, "supportsFIPS"] }, b]]
13
- ],
14
- results: [
15
- [a],
16
- [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
17
- [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
18
- [g, i],
19
- ["https://workdocs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
20
- [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
21
- ["https://workdocs-fips.{Region}.{PartitionResult#dnsSuffix}", i],
22
- [a, "FIPS is enabled but this partition does not support FIPS"],
23
- ["https://workdocs.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
24
- [a, "DualStack is enabled but this partition does not support DualStack"],
25
- ["https://workdocs.{Region}.{PartitionResult#dnsSuffix}", i],
26
- [a, "Invalid Configuration: Missing Region"]
27
- ]
28
- };
29
- const root = 2;
30
- const r = 100_000_000;
31
- const nodes = new Int32Array([
32
- -1, 1, -1,
33
- 0, 12, 3,
34
- 1, 4, r + 11,
35
- 2, 5, r + 11,
36
- 3, 8, 6,
37
- 4, 7, r + 10,
38
- 5, r + 8, r + 9,
39
- 4, 10, 9,
40
- 6, r + 6, r + 7,
41
- 5, 11, r + 5,
42
- 6, r + 4, r + 5,
43
- 3, r + 1, 13,
44
- 4, r + 2, r + 3,
45
- ]);
46
- exports.bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
@@ -1,14 +0,0 @@
1
- const { awsEndpointFunctions } = require("@aws-sdk/core/client");
2
- const { customEndpointFunctions, decideEndpoint, EndpointCache } = require("@smithy/core/endpoints");
3
- const { bdd } = require("./bdd");
4
- const cache = new EndpointCache({
5
- size: 50,
6
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
7
- });
8
- exports.defaultEndpointResolver = (endpointParams, context = {}) => {
9
- return cache.get(endpointParams, () => decideEndpoint(bdd, {
10
- endpointParams: endpointParams,
11
- logger: context.logger,
12
- }));
13
- };
14
- customEndpointFunctions.aws = awsEndpointFunctions;
@@ -1,8 +0,0 @@
1
- const { ServiceException: __ServiceException } = require("@smithy/core/client");
2
- exports.__ServiceException = __ServiceException;
3
- exports.WorkDocsServiceException = class WorkDocsServiceException extends __ServiceException {
4
- constructor(options) {
5
- super(options);
6
- Object.setPrototypeOf(this, WorkDocsServiceException.prototype);
7
- }
8
- };
@@ -1,357 +0,0 @@
1
- const { WorkDocsServiceException: __BaseException } = require("./WorkDocsServiceException");
2
- exports.ConcurrentModificationException = class ConcurrentModificationException extends __BaseException {
3
- name = "ConcurrentModificationException";
4
- $fault = "client";
5
- Message;
6
- constructor(opts) {
7
- super({
8
- name: "ConcurrentModificationException",
9
- $fault: "client",
10
- ...opts,
11
- });
12
- Object.setPrototypeOf(this, ConcurrentModificationException.prototype);
13
- this.Message = opts.Message;
14
- }
15
- };
16
- exports.EntityNotExistsException = class EntityNotExistsException extends __BaseException {
17
- name = "EntityNotExistsException";
18
- $fault = "client";
19
- Message;
20
- EntityIds;
21
- constructor(opts) {
22
- super({
23
- name: "EntityNotExistsException",
24
- $fault: "client",
25
- ...opts,
26
- });
27
- Object.setPrototypeOf(this, EntityNotExistsException.prototype);
28
- this.Message = opts.Message;
29
- this.EntityIds = opts.EntityIds;
30
- }
31
- };
32
- exports.FailedDependencyException = class FailedDependencyException extends __BaseException {
33
- name = "FailedDependencyException";
34
- $fault = "client";
35
- Message;
36
- constructor(opts) {
37
- super({
38
- name: "FailedDependencyException",
39
- $fault: "client",
40
- ...opts,
41
- });
42
- Object.setPrototypeOf(this, FailedDependencyException.prototype);
43
- this.Message = opts.Message;
44
- }
45
- };
46
- exports.ProhibitedStateException = class ProhibitedStateException extends __BaseException {
47
- name = "ProhibitedStateException";
48
- $fault = "client";
49
- Message;
50
- constructor(opts) {
51
- super({
52
- name: "ProhibitedStateException",
53
- $fault: "client",
54
- ...opts,
55
- });
56
- Object.setPrototypeOf(this, ProhibitedStateException.prototype);
57
- this.Message = opts.Message;
58
- }
59
- };
60
- exports.ServiceUnavailableException = class ServiceUnavailableException extends __BaseException {
61
- name = "ServiceUnavailableException";
62
- $fault = "server";
63
- Message;
64
- constructor(opts) {
65
- super({
66
- name: "ServiceUnavailableException",
67
- $fault: "server",
68
- ...opts,
69
- });
70
- Object.setPrototypeOf(this, ServiceUnavailableException.prototype);
71
- this.Message = opts.Message;
72
- }
73
- };
74
- exports.UnauthorizedOperationException = class UnauthorizedOperationException extends __BaseException {
75
- name = "UnauthorizedOperationException";
76
- $fault = "client";
77
- Message;
78
- Code;
79
- constructor(opts) {
80
- super({
81
- name: "UnauthorizedOperationException",
82
- $fault: "client",
83
- ...opts,
84
- });
85
- Object.setPrototypeOf(this, UnauthorizedOperationException.prototype);
86
- this.Message = opts.Message;
87
- this.Code = opts.Code;
88
- }
89
- };
90
- exports.UnauthorizedResourceAccessException = class UnauthorizedResourceAccessException extends __BaseException {
91
- name = "UnauthorizedResourceAccessException";
92
- $fault = "client";
93
- Message;
94
- constructor(opts) {
95
- super({
96
- name: "UnauthorizedResourceAccessException",
97
- $fault: "client",
98
- ...opts,
99
- });
100
- Object.setPrototypeOf(this, UnauthorizedResourceAccessException.prototype);
101
- this.Message = opts.Message;
102
- }
103
- };
104
- exports.DocumentLockedForCommentsException = class DocumentLockedForCommentsException extends __BaseException {
105
- name = "DocumentLockedForCommentsException";
106
- $fault = "client";
107
- Message;
108
- constructor(opts) {
109
- super({
110
- name: "DocumentLockedForCommentsException",
111
- $fault: "client",
112
- ...opts,
113
- });
114
- Object.setPrototypeOf(this, DocumentLockedForCommentsException.prototype);
115
- this.Message = opts.Message;
116
- }
117
- };
118
- exports.InvalidCommentOperationException = class InvalidCommentOperationException extends __BaseException {
119
- name = "InvalidCommentOperationException";
120
- $fault = "client";
121
- Message;
122
- constructor(opts) {
123
- super({
124
- name: "InvalidCommentOperationException",
125
- $fault: "client",
126
- ...opts,
127
- });
128
- Object.setPrototypeOf(this, InvalidCommentOperationException.prototype);
129
- this.Message = opts.Message;
130
- }
131
- };
132
- exports.CustomMetadataLimitExceededException = class CustomMetadataLimitExceededException extends __BaseException {
133
- name = "CustomMetadataLimitExceededException";
134
- $fault = "client";
135
- Message;
136
- constructor(opts) {
137
- super({
138
- name: "CustomMetadataLimitExceededException",
139
- $fault: "client",
140
- ...opts,
141
- });
142
- Object.setPrototypeOf(this, CustomMetadataLimitExceededException.prototype);
143
- this.Message = opts.Message;
144
- }
145
- };
146
- exports.ConflictingOperationException = class ConflictingOperationException extends __BaseException {
147
- name = "ConflictingOperationException";
148
- $fault = "client";
149
- Message;
150
- constructor(opts) {
151
- super({
152
- name: "ConflictingOperationException",
153
- $fault: "client",
154
- ...opts,
155
- });
156
- Object.setPrototypeOf(this, ConflictingOperationException.prototype);
157
- this.Message = opts.Message;
158
- }
159
- };
160
- exports.EntityAlreadyExistsException = class EntityAlreadyExistsException extends __BaseException {
161
- name = "EntityAlreadyExistsException";
162
- $fault = "client";
163
- Message;
164
- constructor(opts) {
165
- super({
166
- name: "EntityAlreadyExistsException",
167
- $fault: "client",
168
- ...opts,
169
- });
170
- Object.setPrototypeOf(this, EntityAlreadyExistsException.prototype);
171
- this.Message = opts.Message;
172
- }
173
- };
174
- exports.LimitExceededException = class LimitExceededException extends __BaseException {
175
- name = "LimitExceededException";
176
- $fault = "client";
177
- Message;
178
- constructor(opts) {
179
- super({
180
- name: "LimitExceededException",
181
- $fault: "client",
182
- ...opts,
183
- });
184
- Object.setPrototypeOf(this, LimitExceededException.prototype);
185
- this.Message = opts.Message;
186
- }
187
- };
188
- exports.TooManyLabelsException = class TooManyLabelsException extends __BaseException {
189
- name = "TooManyLabelsException";
190
- $fault = "client";
191
- Message;
192
- constructor(opts) {
193
- super({
194
- name: "TooManyLabelsException",
195
- $fault: "client",
196
- ...opts,
197
- });
198
- Object.setPrototypeOf(this, TooManyLabelsException.prototype);
199
- this.Message = opts.Message;
200
- }
201
- };
202
- exports.InvalidArgumentException = class InvalidArgumentException extends __BaseException {
203
- name = "InvalidArgumentException";
204
- $fault = "client";
205
- Message;
206
- constructor(opts) {
207
- super({
208
- name: "InvalidArgumentException",
209
- $fault: "client",
210
- ...opts,
211
- });
212
- Object.setPrototypeOf(this, InvalidArgumentException.prototype);
213
- this.Message = opts.Message;
214
- }
215
- };
216
- exports.TooManySubscriptionsException = class TooManySubscriptionsException extends __BaseException {
217
- name = "TooManySubscriptionsException";
218
- $fault = "client";
219
- Message;
220
- constructor(opts) {
221
- super({
222
- name: "TooManySubscriptionsException",
223
- $fault: "client",
224
- ...opts,
225
- });
226
- Object.setPrototypeOf(this, TooManySubscriptionsException.prototype);
227
- this.Message = opts.Message;
228
- }
229
- };
230
- exports.InvalidOperationException = class InvalidOperationException extends __BaseException {
231
- name = "InvalidOperationException";
232
- $fault = "client";
233
- Message;
234
- constructor(opts) {
235
- super({
236
- name: "InvalidOperationException",
237
- $fault: "client",
238
- ...opts,
239
- });
240
- Object.setPrototypeOf(this, InvalidOperationException.prototype);
241
- this.Message = opts.Message;
242
- }
243
- };
244
- exports.InvalidPasswordException = class InvalidPasswordException extends __BaseException {
245
- name = "InvalidPasswordException";
246
- $fault = "client";
247
- Message;
248
- constructor(opts) {
249
- super({
250
- name: "InvalidPasswordException",
251
- $fault: "client",
252
- ...opts,
253
- });
254
- Object.setPrototypeOf(this, InvalidPasswordException.prototype);
255
- this.Message = opts.Message;
256
- }
257
- };
258
- exports.RequestedEntityTooLargeException = class RequestedEntityTooLargeException extends __BaseException {
259
- name = "RequestedEntityTooLargeException";
260
- $fault = "client";
261
- Message;
262
- constructor(opts) {
263
- super({
264
- name: "RequestedEntityTooLargeException",
265
- $fault: "client",
266
- ...opts,
267
- });
268
- Object.setPrototypeOf(this, RequestedEntityTooLargeException.prototype);
269
- this.Message = opts.Message;
270
- }
271
- };
272
- exports.DraftUploadOutOfSyncException = class DraftUploadOutOfSyncException extends __BaseException {
273
- name = "DraftUploadOutOfSyncException";
274
- $fault = "client";
275
- Message;
276
- constructor(opts) {
277
- super({
278
- name: "DraftUploadOutOfSyncException",
279
- $fault: "client",
280
- ...opts,
281
- });
282
- Object.setPrototypeOf(this, DraftUploadOutOfSyncException.prototype);
283
- this.Message = opts.Message;
284
- }
285
- };
286
- exports.ResourceAlreadyCheckedOutException = class ResourceAlreadyCheckedOutException extends __BaseException {
287
- name = "ResourceAlreadyCheckedOutException";
288
- $fault = "client";
289
- Message;
290
- constructor(opts) {
291
- super({
292
- name: "ResourceAlreadyCheckedOutException",
293
- $fault: "client",
294
- ...opts,
295
- });
296
- Object.setPrototypeOf(this, ResourceAlreadyCheckedOutException.prototype);
297
- this.Message = opts.Message;
298
- }
299
- };
300
- exports.StorageLimitExceededException = class StorageLimitExceededException extends __BaseException {
301
- name = "StorageLimitExceededException";
302
- $fault = "client";
303
- Message;
304
- constructor(opts) {
305
- super({
306
- name: "StorageLimitExceededException",
307
- $fault: "client",
308
- ...opts,
309
- });
310
- Object.setPrototypeOf(this, StorageLimitExceededException.prototype);
311
- this.Message = opts.Message;
312
- }
313
- };
314
- exports.StorageLimitWillExceedException = class StorageLimitWillExceedException extends __BaseException {
315
- name = "StorageLimitWillExceedException";
316
- $fault = "client";
317
- Message;
318
- constructor(opts) {
319
- super({
320
- name: "StorageLimitWillExceedException",
321
- $fault: "client",
322
- ...opts,
323
- });
324
- Object.setPrototypeOf(this, StorageLimitWillExceedException.prototype);
325
- this.Message = opts.Message;
326
- }
327
- };
328
- exports.DeactivatingLastSystemUserException = class DeactivatingLastSystemUserException extends __BaseException {
329
- name = "DeactivatingLastSystemUserException";
330
- $fault = "client";
331
- Message;
332
- Code;
333
- constructor(opts) {
334
- super({
335
- name: "DeactivatingLastSystemUserException",
336
- $fault: "client",
337
- ...opts,
338
- });
339
- Object.setPrototypeOf(this, DeactivatingLastSystemUserException.prototype);
340
- this.Message = opts.Message;
341
- this.Code = opts.Code;
342
- }
343
- };
344
- exports.IllegalUserStateException = class IllegalUserStateException extends __BaseException {
345
- name = "IllegalUserStateException";
346
- $fault = "client";
347
- Message;
348
- constructor(opts) {
349
- super({
350
- name: "IllegalUserStateException",
351
- $fault: "client",
352
- ...opts,
353
- });
354
- Object.setPrototypeOf(this, IllegalUserStateException.prototype);
355
- this.Message = opts.Message;
356
- }
357
- };
@@ -1,32 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { Sha256 } = require("@aws-crypto/sha256-browser");
3
- const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
4
- const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
5
- const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
6
- const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
7
- const { calculateBodyLength } = require("@smithy/core/serde");
8
- const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
9
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
10
- const getRuntimeConfig = (config) => {
11
- const defaultsMode = resolveDefaultsModeConfig(config);
12
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
13
- const clientSharedValues = getSharedRuntimeConfig(config);
14
- return {
15
- ...clientSharedValues,
16
- ...config,
17
- runtime: "browser",
18
- defaultsMode,
19
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
20
- credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
21
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
22
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
23
- region: config?.region ?? invalidProvider("Region is missing"),
24
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
25
- retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
26
- sha256: config?.sha256 ?? Sha256,
27
- streamCollector: config?.streamCollector ?? streamCollector,
28
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
29
- useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
30
- };
31
- };
32
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,45 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
3
- const { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
4
- const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
5
- const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
6
- const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
7
- const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
8
- const { calculateBodyLength, Hash } = require("@smithy/core/serde");
9
- const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
10
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
11
- const getRuntimeConfig = (config) => {
12
- emitWarningIfUnsupportedVersion(process.version);
13
- const defaultsMode = resolveDefaultsModeConfig(config);
14
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
15
- const clientSharedValues = getSharedRuntimeConfig(config);
16
- awsCheckVersion(process.version);
17
- const loaderConfig = {
18
- profile: config?.profile,
19
- logger: clientSharedValues.logger,
20
- };
21
- return {
22
- ...clientSharedValues,
23
- ...config,
24
- runtime: "node",
25
- defaultsMode,
26
- authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
27
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
28
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
29
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
30
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
31
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
32
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
33
- retryMode: config?.retryMode ??
34
- loadNodeConfig({
35
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
36
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
37
- }, config),
38
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
39
- streamCollector: config?.streamCollector ?? streamCollector,
40
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
41
- useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
42
- userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
43
- };
44
- };
45
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,12 +0,0 @@
1
- const { Sha256 } = require("@aws-crypto/sha256-js");
2
- const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
3
- const getRuntimeConfig = (config) => {
4
- const browserDefaults = getBrowserRuntimeConfig(config);
5
- return {
6
- ...browserDefaults,
7
- ...config,
8
- runtime: "react-native",
9
- sha256: config?.sha256 ?? Sha256,
10
- };
11
- };
12
- exports.getRuntimeConfig = getRuntimeConfig;