@smithy/core 3.35.0 → 3.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist-cjs/submodules/client/index.js +33 -11
- package/dist-cjs/submodules/endpoints/index.browser.js +2 -1
- package/dist-cjs/submodules/endpoints/index.js +2 -1
- package/dist-cjs/submodules/schema/index.js +3 -0
- package/dist-es/submodules/client/smithy-client/exceptions.js +33 -11
- package/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js +2 -1
- package/dist-es/submodules/schema/TypeRegistry.js +3 -0
- package/dist-types/submodules/client/smithy-client/exceptions.d.ts +1 -0
- package/dist-types/ts3.4/submodules/client/smithy-client/exceptions.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.35.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d74fb5f: fix endpoint cache key collision between empty-string and absent parameters
|
|
8
|
+
|
|
9
|
+
## 3.35.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4734e1c: fix for SDK ServiceException instanceof detection relating to mangled class names
|
|
14
|
+
- 4f51625: restore a compat name-string fallback in ServiceException instanceof for clients predating shapeId stamping, gated on a class-name length of at least 6
|
|
15
|
+
|
|
3
16
|
## 3.35.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -765,6 +765,7 @@ const createAggregatedClient = (commands, Client, options) => {
|
|
|
765
765
|
};
|
|
766
766
|
|
|
767
767
|
class ServiceException extends Error {
|
|
768
|
+
static shapeId = "smithy.ts.sdk.synthetic.nonamespace.client#ServiceException";
|
|
768
769
|
$fault;
|
|
769
770
|
$response;
|
|
770
771
|
$retryable;
|
|
@@ -796,22 +797,43 @@ class ServiceException extends Error {
|
|
|
796
797
|
if (this.prototype.isPrototypeOf(instance)) {
|
|
797
798
|
return true;
|
|
798
799
|
}
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
|
|
800
|
+
const targetId = Object.prototype.hasOwnProperty.call(this, "shapeId")
|
|
801
|
+
? this.shapeId
|
|
802
|
+
: undefined;
|
|
803
|
+
let candidateHasShapeId = false;
|
|
804
|
+
if (targetId) {
|
|
805
|
+
let proto = Object.getPrototypeOf(candidate);
|
|
806
|
+
while (proto && proto !== Object.prototype) {
|
|
807
|
+
const ctor = proto.constructor;
|
|
808
|
+
const candidateId = ctor !== ServiceException && Object.prototype.hasOwnProperty.call(ctor, "shapeId")
|
|
809
|
+
? ctor?.shapeId
|
|
810
|
+
: undefined;
|
|
811
|
+
if (candidateId) {
|
|
812
|
+
candidateHasShapeId = true;
|
|
813
|
+
if (candidateId === targetId) {
|
|
814
|
+
return true;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
proto = Object.getPrototypeOf(proto);
|
|
818
|
+
}
|
|
802
819
|
}
|
|
803
|
-
if (
|
|
804
|
-
return
|
|
820
|
+
if (targetId && candidateHasShapeId) {
|
|
821
|
+
return false;
|
|
805
822
|
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
if (ctorName && ctorName !== "Error" && ctorName === targetName) {
|
|
823
|
+
const targetName = this.name;
|
|
824
|
+
if (targetName && targetName.length >= 6) {
|
|
825
|
+
if (candidate.name === targetName) {
|
|
810
826
|
return true;
|
|
811
827
|
}
|
|
812
|
-
proto = Object.getPrototypeOf(
|
|
828
|
+
let proto = Object.getPrototypeOf(candidate);
|
|
829
|
+
while (proto && proto !== Object.prototype) {
|
|
830
|
+
const ctorName = proto.constructor?.name;
|
|
831
|
+
if (ctorName && ctorName !== "Error" && ctorName === targetName) {
|
|
832
|
+
return true;
|
|
833
|
+
}
|
|
834
|
+
proto = Object.getPrototypeOf(proto);
|
|
835
|
+
}
|
|
813
836
|
}
|
|
814
|
-
return false;
|
|
815
837
|
}
|
|
816
838
|
return false;
|
|
817
839
|
}
|
|
@@ -307,7 +307,8 @@ class EndpointCache {
|
|
|
307
307
|
return false;
|
|
308
308
|
}
|
|
309
309
|
for (const param of parameters) {
|
|
310
|
-
const
|
|
310
|
+
const raw = endpointParams[param];
|
|
311
|
+
const val = raw == null ? "\0" : String(raw);
|
|
311
312
|
if (val.includes("|;")) {
|
|
312
313
|
return false;
|
|
313
314
|
}
|
|
@@ -355,7 +355,8 @@ class EndpointCache {
|
|
|
355
355
|
return false;
|
|
356
356
|
}
|
|
357
357
|
for (const param of parameters) {
|
|
358
|
-
const
|
|
358
|
+
const raw = endpointParams[param];
|
|
359
|
+
const val = raw == null ? "\0" : String(raw);
|
|
359
360
|
if (val.includes("|;")) {
|
|
360
361
|
return false;
|
|
361
362
|
}
|
|
@@ -630,6 +630,9 @@ class TypeRegistry {
|
|
|
630
630
|
const $error = es;
|
|
631
631
|
const ns = $error[1];
|
|
632
632
|
const qualifiedName = ns + "#" + $error[2];
|
|
633
|
+
if (!ctor.hasOwnProperty?.("shapeId")) {
|
|
634
|
+
ctor.shapeId = qualifiedName;
|
|
635
|
+
}
|
|
633
636
|
for (const r of [this, TypeRegistry.for(ns)]) {
|
|
634
637
|
if (!r.schemas.has(qualifiedName) && !r.exceptions.has($error)) {
|
|
635
638
|
r.schemas.set(qualifiedName, $error);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export class ServiceException extends Error {
|
|
2
|
+
static shapeId = "smithy.ts.sdk.synthetic.nonamespace.client#ServiceException";
|
|
2
3
|
$fault;
|
|
3
4
|
$response;
|
|
4
5
|
$retryable;
|
|
@@ -30,22 +31,43 @@ export class ServiceException extends Error {
|
|
|
30
31
|
if (this.prototype.isPrototypeOf(instance)) {
|
|
31
32
|
return true;
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const targetId = Object.prototype.hasOwnProperty.call(this, "shapeId")
|
|
35
|
+
? this.shapeId
|
|
36
|
+
: undefined;
|
|
37
|
+
let candidateHasShapeId = false;
|
|
38
|
+
if (targetId) {
|
|
39
|
+
let proto = Object.getPrototypeOf(candidate);
|
|
40
|
+
while (proto && proto !== Object.prototype) {
|
|
41
|
+
const ctor = proto.constructor;
|
|
42
|
+
const candidateId = ctor !== ServiceException && Object.prototype.hasOwnProperty.call(ctor, "shapeId")
|
|
43
|
+
? ctor?.shapeId
|
|
44
|
+
: undefined;
|
|
45
|
+
if (candidateId) {
|
|
46
|
+
candidateHasShapeId = true;
|
|
47
|
+
if (candidateId === targetId) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
proto = Object.getPrototypeOf(proto);
|
|
52
|
+
}
|
|
36
53
|
}
|
|
37
|
-
if (
|
|
38
|
-
return
|
|
54
|
+
if (targetId && candidateHasShapeId) {
|
|
55
|
+
return false;
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (ctorName && ctorName !== "Error" && ctorName === targetName) {
|
|
57
|
+
const targetName = this.name;
|
|
58
|
+
if (targetName && targetName.length >= 6) {
|
|
59
|
+
if (candidate.name === targetName) {
|
|
44
60
|
return true;
|
|
45
61
|
}
|
|
46
|
-
proto = Object.getPrototypeOf(
|
|
62
|
+
let proto = Object.getPrototypeOf(candidate);
|
|
63
|
+
while (proto && proto !== Object.prototype) {
|
|
64
|
+
const ctorName = proto.constructor?.name;
|
|
65
|
+
if (ctorName && ctorName !== "Error" && ctorName === targetName) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
proto = Object.getPrototypeOf(proto);
|
|
69
|
+
}
|
|
47
70
|
}
|
|
48
|
-
return false;
|
|
49
71
|
}
|
|
50
72
|
return false;
|
|
51
73
|
}
|
|
@@ -39,7 +39,8 @@ export class EndpointCache {
|
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
for (const param of parameters) {
|
|
42
|
-
const
|
|
42
|
+
const raw = endpointParams[param];
|
|
43
|
+
const val = raw == null ? "\0" : String(raw);
|
|
43
44
|
if (val.includes("|;")) {
|
|
44
45
|
return false;
|
|
45
46
|
}
|
|
@@ -58,6 +58,9 @@ export class TypeRegistry {
|
|
|
58
58
|
const $error = es;
|
|
59
59
|
const ns = $error[1];
|
|
60
60
|
const qualifiedName = ns + "#" + $error[2];
|
|
61
|
+
if (!ctor.hasOwnProperty?.("shapeId")) {
|
|
62
|
+
ctor.shapeId = qualifiedName;
|
|
63
|
+
}
|
|
61
64
|
for (const r of [this, TypeRegistry.for(ns)]) {
|
|
62
65
|
if (!r.schemas.has(qualifiedName) && !r.exceptions.has($error)) {
|
|
63
66
|
r.schemas.set(qualifiedName, $error);
|
|
@@ -18,6 +18,7 @@ export interface ServiceExceptionOptions extends SmithyException, MetadataBearer
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare class ServiceException extends Error implements SmithyException, MetadataBearer {
|
|
21
|
+
static readonly shapeId: string;
|
|
21
22
|
readonly $fault: "client" | "server";
|
|
22
23
|
$response?: HttpResponse;
|
|
23
24
|
$retryable?: RetryableTrait;
|
|
@@ -18,6 +18,7 @@ export interface ServiceExceptionOptions extends SmithyException, MetadataBearer
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare class ServiceException extends Error implements SmithyException, MetadataBearer {
|
|
21
|
+
static readonly shapeId: string;
|
|
21
22
|
readonly $fault: "client" | "server";
|
|
22
23
|
$response?: HttpResponse;
|
|
23
24
|
$retryable?: RetryableTrait;
|