@reventlessdev/reventless-aws 3.0.0-alpha.217 → 3.0.0-alpha.219
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 +15 -0
- package/package.json +4 -4
- package/src/Platform.res.mjs +2 -0
- package/src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res +436 -0
- package/src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res.mjs +340 -0
- package/src/adapter/Mcp/MCP_Lambda.res +8 -19
- package/src/adapter/Mcp/MCP_Lambda.res.mjs +2 -9
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +6 -2
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res.mjs +12 -2
- package/src/components/Aggregate_Builder_Micro.res.mjs +1 -0
- package/src/components/Aggregate_Builder_NoResolver.res.mjs +1 -0
- package/src/components/Aggregate_Builder_PerAggregate.res.mjs +1 -0
- package/src/components/Aggregate_Builder_Single.res.mjs +1 -0
- package/src/components/Aggregate_Builder_Single_Async.res.mjs +1 -0
- package/src/components/Api/AppSync_MergedApi.res +19 -16
- package/src/components/Api/AppSync_MergedApi.res.mjs +5 -6
- package/src/components/AutomationSlice_Builder.res.mjs +1 -0
- package/src/components/ExtensionPoint_Builder.res.mjs +1 -0
- package/src/components/ForeignReadModel_Builder.res.mjs +2 -0
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +1 -0
- package/src/components/Plugin.res.mjs +1 -0
- package/src/components/ReadModel_Builder_NoResolver.res.mjs +1 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res.mjs +1 -0
- package/src/components/ReadModel_Builder_PerReadModel.res.mjs +1 -0
- package/src/components/ReadModel_Builder_Single.res.mjs +1 -0
- package/src/components/ReadModel_Builder_Single_Stream.res.mjs +1 -0
- package/src/components/SideEffectHandler_PerSideEffectHandler.res.mjs +3 -0
- package/src/components/SideEffectHandler_Single.res.mjs +2 -0
- package/src/components/StateViewSlice_Builder.res.mjs +1 -0
- package/src/components/StateViewSlice_Builder_Stream.res.mjs +1 -0
- package/src/components/Task_Builder_PerBucket.res.mjs +2 -0
- package/src/plugin/stack/Plugin_ExtensionPoint_Builder.res.mjs +2 -0
- package/tests/AppSync_SourceApiAssociation_RetryingTest.res +112 -0
- package/tests/AppSync_SourceApiAssociation_RetryingTest.res.mjs +133 -0
|
@@ -14,6 +14,7 @@ function Make(Spec) {
|
|
|
14
14
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
15
15
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
16
16
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
17
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
17
18
|
asEventHandler: prim => prim,
|
|
18
19
|
asEffectHandler: prim => prim
|
|
19
20
|
})({
|
|
@@ -16,6 +16,7 @@ function Make(Spec) {
|
|
|
16
16
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
17
17
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
18
18
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
19
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
19
20
|
asEventHandler: prim => prim,
|
|
20
21
|
asEffectHandler: prim => prim
|
|
21
22
|
})(QueryDbStorage$ReventlessAws.SelectableStream)(QueryDbResolvers_AppSync_NoOp$ReventlessAws)({
|
|
@@ -14,6 +14,7 @@ function Make(Spec) {
|
|
|
14
14
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
15
15
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
16
16
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
17
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
17
18
|
asEventHandler: prim => prim,
|
|
18
19
|
asEffectHandler: prim => prim
|
|
19
20
|
})({
|
|
@@ -16,6 +16,7 @@ function Make(Spec) {
|
|
|
16
16
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
17
17
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
18
18
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
19
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
19
20
|
asEventHandler: prim => prim,
|
|
20
21
|
asEffectHandler: prim => prim
|
|
21
22
|
})(QueryDbStorage$ReventlessAws.Selectable)(QueryDbResolvers$ReventlessAws.Selectable)({
|
|
@@ -16,6 +16,7 @@ function Make(Spec) {
|
|
|
16
16
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
17
17
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
18
18
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
19
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
19
20
|
asEventHandler: prim => prim,
|
|
20
21
|
asEffectHandler: prim => prim
|
|
21
22
|
})(QueryDbStorage$ReventlessAws.SelectableStream)(QueryDbResolvers$ReventlessAws.Selectable)({
|
|
@@ -10,6 +10,7 @@ let EventCollectorRuntimeBuilder = EventCollectorRuntime_Builder_PerEventCollect
|
|
|
10
10
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
11
11
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
12
12
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
13
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
13
14
|
asEventHandler: prim => prim,
|
|
14
15
|
asEffectHandler: prim => prim
|
|
15
16
|
})({
|
|
@@ -21,6 +22,7 @@ let include = SideEffectHandler_Builder$ReventlessCore.Make({
|
|
|
21
22
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
22
23
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
23
24
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
25
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
24
26
|
asEventHandler: prim => prim,
|
|
25
27
|
asEffectHandler: prim => prim
|
|
26
28
|
})({
|
|
@@ -30,6 +32,7 @@ let include = SideEffectHandler_Builder$ReventlessCore.Make({
|
|
|
30
32
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
31
33
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
32
34
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
35
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
33
36
|
asEventHandler: prim => prim,
|
|
34
37
|
asEffectHandler: prim => prim
|
|
35
38
|
})({
|
|
@@ -12,6 +12,7 @@ function Make($star) {
|
|
|
12
12
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
13
13
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
14
14
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
15
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
15
16
|
asEventHandler: prim => prim,
|
|
16
17
|
asEffectHandler: prim => prim
|
|
17
18
|
})({
|
|
@@ -21,6 +22,7 @@ function Make($star) {
|
|
|
21
22
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
22
23
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
23
24
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
25
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
24
26
|
asEventHandler: prim => prim,
|
|
25
27
|
asEffectHandler: prim => prim
|
|
26
28
|
})({
|
|
@@ -16,6 +16,7 @@ function Make(Api) {
|
|
|
16
16
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
17
17
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
18
18
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
19
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
19
20
|
asEventHandler: prim => prim,
|
|
20
21
|
asEffectHandler: prim => prim
|
|
21
22
|
})(QueryDbStorage$ReventlessAws.Selectable)(QueryDbResolvers$ReventlessAws.Selectable)({
|
|
@@ -16,6 +16,7 @@ function Make(Api) {
|
|
|
16
16
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
17
17
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
18
18
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
19
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
19
20
|
asEventHandler: prim => prim,
|
|
20
21
|
asEffectHandler: prim => prim
|
|
21
22
|
})(QueryDbStorage$ReventlessAws.SelectableStream)(QueryDbResolvers$ReventlessAws.Selectable)({
|
|
@@ -12,6 +12,7 @@ let EventCollectorRuntimeBuilder = EventCollectorRuntime_Builder_PerEventCollect
|
|
|
12
12
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
13
13
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
14
14
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
15
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
15
16
|
asEventHandler: prim => prim,
|
|
16
17
|
asEffectHandler: prim => prim
|
|
17
18
|
})({
|
|
@@ -29,6 +30,7 @@ function Make(Spec) {
|
|
|
29
30
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
30
31
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
31
32
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
33
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
32
34
|
asEventHandler: prim => prim,
|
|
33
35
|
asEffectHandler: prim => prim
|
|
34
36
|
})({
|
|
@@ -20,6 +20,7 @@ function MakeWithConfig(Config) {
|
|
|
20
20
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
21
21
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
22
22
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
23
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
23
24
|
asEventHandler: prim => prim,
|
|
24
25
|
asEffectHandler: prim => prim
|
|
25
26
|
})({
|
|
@@ -42,6 +43,7 @@ let Make = PluginExtensionPoint_Builder$ReventlessCore.Make({
|
|
|
42
43
|
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
43
44
|
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
44
45
|
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
46
|
+
extractCausationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCausationId,
|
|
45
47
|
asEventHandler: prim => prim,
|
|
46
48
|
asEffectHandler: prim => prim
|
|
47
49
|
})({
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
open JestGlobals
|
|
2
|
+
|
|
3
|
+
// Build a plain JS object shaped like a JS Error / SDK exception, cast to
|
|
4
|
+
// JsExn.t so the classifiers can be called without a real throw/catch.
|
|
5
|
+
type testError = {name: string, message: string}
|
|
6
|
+
let mkErr = (~name, ~message): JsExn.t => Obj.magic(({name, message}: testError))
|
|
7
|
+
|
|
8
|
+
module Assoc = AppSync_SourceApiAssociation_Retrying
|
|
9
|
+
|
|
10
|
+
describe("AppSync_SourceApiAssociation_Retrying.isConcurrentModificationError", () => {
|
|
11
|
+
testSync("true for ConcurrentModificationException by name", () => {
|
|
12
|
+
let err = mkErr(~name="ConcurrentModificationException", ~message="Schema is currently being merged")
|
|
13
|
+
expect(Assoc.isConcurrentModificationError(err))->toBe(true)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
testSync("true when the name rides in the message", () => {
|
|
17
|
+
let err = mkErr(~name="Error", ~message="ConcurrentModificationException: try again")
|
|
18
|
+
expect(Assoc.isConcurrentModificationError(err))->toBe(true)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
testSync("false for an unrelated error", () => {
|
|
22
|
+
let err = mkErr(~name="ValidationException", ~message="bad SDL")
|
|
23
|
+
expect(Assoc.isConcurrentModificationError(err))->toBe(false)
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
describe("AppSync_SourceApiAssociation_Retrying.isRetryableAssociationError", () => {
|
|
28
|
+
describe("returns true", () => {
|
|
29
|
+
[
|
|
30
|
+
"ConcurrentModificationException",
|
|
31
|
+
"ThrottlingException",
|
|
32
|
+
"TooManyRequestsException",
|
|
33
|
+
"InternalFailureException",
|
|
34
|
+
"ServiceUnavailableException",
|
|
35
|
+
]->Array.forEach(name =>
|
|
36
|
+
testSync(name, () => {
|
|
37
|
+
expect(Assoc.isRetryableAssociationError(mkErr(~name, ~message="x")))->toBe(true)
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
describe("returns false", () => {
|
|
43
|
+
testSync("permanent ValidationException", () => {
|
|
44
|
+
expect(
|
|
45
|
+
Assoc.isRetryableAssociationError(mkErr(~name="ValidationException", ~message="bad input")),
|
|
46
|
+
)->toBe(false)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
testSync("NotFoundException (a delete no-op, not a retry)", () => {
|
|
50
|
+
expect(
|
|
51
|
+
Assoc.isRetryableAssociationError(
|
|
52
|
+
mkErr(~name="NotFoundException", ~message="association not found"),
|
|
53
|
+
),
|
|
54
|
+
)->toBe(false)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
testSync("non-exception value", () => {
|
|
58
|
+
let notErr: JsExn.t = Obj.magic(42)
|
|
59
|
+
expect(Assoc.isRetryableAssociationError(notErr))->toBe(false)
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
describe("AppSync_SourceApiAssociation_Retrying.isAlreadyGoneError", () => {
|
|
65
|
+
testSync("true for NotFoundException", () => {
|
|
66
|
+
expect(Assoc.isAlreadyGoneError(mkErr(~name="NotFoundException", ~message="gone")))->toBe(true)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
testSync("true when message says not found", () => {
|
|
70
|
+
expect(Assoc.isAlreadyGoneError(mkErr(~name="Error", ~message="merged API not found")))->toBe(
|
|
71
|
+
true,
|
|
72
|
+
)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
testSync("false for a transient race (must not be swallowed as gone)", () => {
|
|
76
|
+
expect(
|
|
77
|
+
Assoc.isAlreadyGoneError(mkErr(~name="ConcurrentModificationException", ~message="retry")),
|
|
78
|
+
)->toBe(false)
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe("AppSync_SourceApiAssociation_Retrying.idsFromArn", () => {
|
|
83
|
+
testSync("parses mergedApiId + associationId from an association ARN", () => {
|
|
84
|
+
let arn = "arn:aws:appsync:eu-west-1:123456789012:apis/mgd123/sourceApiAssociations/assoc456"
|
|
85
|
+
switch Assoc.idsFromArn(arn) {
|
|
86
|
+
| Some(ids) =>
|
|
87
|
+
expect(ids.mergedApiIdentifier)->toBe("mgd123")
|
|
88
|
+
expect(ids.associationId)->toBe("assoc456")
|
|
89
|
+
| None => fail("expected Some")
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
testSync("None for an ARN that is not an association", () => {
|
|
94
|
+
let arn = "arn:aws:appsync:eu-west-1:123456789012:apis/mgd123"
|
|
95
|
+
expect(Assoc.idsFromArn(arn)->Option.isNone)->toBe(true)
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
describe("AppSync_SourceApiAssociation_Retrying.idsFromComposite", () => {
|
|
100
|
+
testSync("parses the classic '<mergedApiId>,<assocId>' id", () => {
|
|
101
|
+
switch Assoc.idsFromComposite("mgd123,assoc456") {
|
|
102
|
+
| Some(ids) =>
|
|
103
|
+
expect(ids.mergedApiIdentifier)->toBe("mgd123")
|
|
104
|
+
expect(ids.associationId)->toBe("assoc456")
|
|
105
|
+
| None => fail("expected Some")
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
testSync("None for a non-composite string", () => {
|
|
110
|
+
expect(Assoc.idsFromComposite("just-one-value")->Option.isNone)->toBe(true)
|
|
111
|
+
})
|
|
112
|
+
})
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as JestGlobals from "@reventlessdev/rescript-jest/src/JestGlobals.res.mjs";
|
|
4
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
+
import * as AppSync_SourceApiAssociation_Retrying$ReventlessAws from "../src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res.mjs";
|
|
6
|
+
|
|
7
|
+
function mkErr(name, message) {
|
|
8
|
+
return {
|
|
9
|
+
name: name,
|
|
10
|
+
message: message
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
globalThis.describe("AppSync_SourceApiAssociation_Retrying.isConcurrentModificationError", () => {
|
|
15
|
+
globalThis.test("true for ConcurrentModificationException by name", () => {
|
|
16
|
+
let err = {
|
|
17
|
+
name: "ConcurrentModificationException",
|
|
18
|
+
message: "Schema is currently being merged"
|
|
19
|
+
};
|
|
20
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isConcurrentModificationError(err)).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
globalThis.test("true when the name rides in the message", () => {
|
|
23
|
+
let err = {
|
|
24
|
+
name: "Error",
|
|
25
|
+
message: "ConcurrentModificationException: try again"
|
|
26
|
+
};
|
|
27
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isConcurrentModificationError(err)).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
globalThis.test("false for an unrelated error", () => {
|
|
30
|
+
let err = {
|
|
31
|
+
name: "ValidationException",
|
|
32
|
+
message: "bad SDL"
|
|
33
|
+
};
|
|
34
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isConcurrentModificationError(err)).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
globalThis.describe("AppSync_SourceApiAssociation_Retrying.isRetryableAssociationError", () => {
|
|
39
|
+
globalThis.describe("returns true", () => {
|
|
40
|
+
[
|
|
41
|
+
"ConcurrentModificationException",
|
|
42
|
+
"ThrottlingException",
|
|
43
|
+
"TooManyRequestsException",
|
|
44
|
+
"InternalFailureException",
|
|
45
|
+
"ServiceUnavailableException"
|
|
46
|
+
].forEach(name => {
|
|
47
|
+
globalThis.test(name, () => {
|
|
48
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isRetryableAssociationError({
|
|
49
|
+
name: name,
|
|
50
|
+
message: "x"
|
|
51
|
+
})).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
globalThis.describe("returns false", () => {
|
|
56
|
+
globalThis.test("permanent ValidationException", () => {
|
|
57
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isRetryableAssociationError({
|
|
58
|
+
name: "ValidationException",
|
|
59
|
+
message: "bad input"
|
|
60
|
+
})).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
globalThis.test("NotFoundException (a delete no-op, not a retry)", () => {
|
|
63
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isRetryableAssociationError({
|
|
64
|
+
name: "NotFoundException",
|
|
65
|
+
message: "association not found"
|
|
66
|
+
})).toBe(false);
|
|
67
|
+
});
|
|
68
|
+
globalThis.test("non-exception value", () => {
|
|
69
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isRetryableAssociationError(42)).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
globalThis.describe("AppSync_SourceApiAssociation_Retrying.isAlreadyGoneError", () => {
|
|
75
|
+
globalThis.test("true for NotFoundException", () => {
|
|
76
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isAlreadyGoneError({
|
|
77
|
+
name: "NotFoundException",
|
|
78
|
+
message: "gone"
|
|
79
|
+
})).toBe(true);
|
|
80
|
+
});
|
|
81
|
+
globalThis.test("true when message says not found", () => {
|
|
82
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isAlreadyGoneError({
|
|
83
|
+
name: "Error",
|
|
84
|
+
message: "merged API not found"
|
|
85
|
+
})).toBe(true);
|
|
86
|
+
});
|
|
87
|
+
globalThis.test("false for a transient race (must not be swallowed as gone)", () => {
|
|
88
|
+
globalThis.expect(AppSync_SourceApiAssociation_Retrying$ReventlessAws.isAlreadyGoneError({
|
|
89
|
+
name: "ConcurrentModificationException",
|
|
90
|
+
message: "retry"
|
|
91
|
+
})).toBe(false);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
globalThis.describe("AppSync_SourceApiAssociation_Retrying.idsFromArn", () => {
|
|
96
|
+
globalThis.test("parses mergedApiId + associationId from an association ARN", () => {
|
|
97
|
+
let ids = AppSync_SourceApiAssociation_Retrying$ReventlessAws.idsFromArn("arn:aws:appsync:eu-west-1:123456789012:apis/mgd123/sourceApiAssociations/assoc456");
|
|
98
|
+
if (ids !== undefined) {
|
|
99
|
+
globalThis.expect(ids.mergedApiIdentifier).toBe("mgd123");
|
|
100
|
+
globalThis.expect(ids.associationId).toBe("assoc456");
|
|
101
|
+
return;
|
|
102
|
+
} else {
|
|
103
|
+
return JestGlobals.fail("expected Some");
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
globalThis.test("None for an ARN that is not an association", () => {
|
|
107
|
+
globalThis.expect(Stdlib_Option.isNone(AppSync_SourceApiAssociation_Retrying$ReventlessAws.idsFromArn("arn:aws:appsync:eu-west-1:123456789012:apis/mgd123"))).toBe(true);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
globalThis.describe("AppSync_SourceApiAssociation_Retrying.idsFromComposite", () => {
|
|
112
|
+
globalThis.test("parses the classic '<mergedApiId>,<assocId>' id", () => {
|
|
113
|
+
let ids = AppSync_SourceApiAssociation_Retrying$ReventlessAws.idsFromComposite("mgd123,assoc456");
|
|
114
|
+
if (ids !== undefined) {
|
|
115
|
+
globalThis.expect(ids.mergedApiIdentifier).toBe("mgd123");
|
|
116
|
+
globalThis.expect(ids.associationId).toBe("assoc456");
|
|
117
|
+
return;
|
|
118
|
+
} else {
|
|
119
|
+
return JestGlobals.fail("expected Some");
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
globalThis.test("None for a non-composite string", () => {
|
|
123
|
+
globalThis.expect(Stdlib_Option.isNone(AppSync_SourceApiAssociation_Retrying$ReventlessAws.idsFromComposite("just-one-value"))).toBe(true);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
let Assoc;
|
|
128
|
+
|
|
129
|
+
export {
|
|
130
|
+
mkErr,
|
|
131
|
+
Assoc,
|
|
132
|
+
}
|
|
133
|
+
/* Not a pure module */
|