@reventlessdev/reventless-aws 3.0.0-alpha.265 → 3.0.0-alpha.267
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 +14 -0
- package/package.json +6 -6
- package/src/Platform.res +49 -53
- package/src/Platform.res.mjs +17 -36
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +36 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res.mjs +14 -1
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +37 -6
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs +19 -6
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res +227 -0
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res.mjs +127 -0
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver_Ops.res +55 -0
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver_Ops.res.mjs +48 -0
- package/tests/Geocoder_AwsLocation_Resolver_OpsTest.res +53 -0
- package/tests/Geocoder_AwsLocation_Resolver_OpsTest.res.mjs +55 -0
- package/src/adapter/Geocoder/Geocoder_AwsLocation.res +0 -166
- package/src/adapter/Geocoder/Geocoder_AwsLocation.res.mjs +0 -105
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Ops.res +0 -144
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Ops.res.mjs +0 -137
- package/tests/Geocoder_AwsLocation_OpsTest.res +0 -78
- package/tests/Geocoder_AwsLocation_OpsTest.res.mjs +0 -71
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
|
|
3
|
-
import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
4
|
-
import * as Geocoder_AwsLocation_Ops$ReventlessAws from "../src/adapter/Geocoder/Geocoder_AwsLocation_Ops.res.mjs";
|
|
5
|
-
|
|
6
|
-
function setIndex(v) {
|
|
7
|
-
process.env["PLACE_INDEX_NAME"] = v;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function clearIndex() {
|
|
11
|
-
Stdlib_Dict.$$delete(process.env, "PLACE_INDEX_NAME");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
globalThis.describe("Geocoder_AwsLocation_Ops.handler status contract", () => {
|
|
15
|
-
globalThis.test("an unset PLACE_INDEX_NAME is a service failure, not a verdict", async () => {
|
|
16
|
-
Stdlib_Dict.$$delete(process.env, "PLACE_INDEX_NAME");
|
|
17
|
-
let resp = await Geocoder_AwsLocation_Ops$ReventlessAws.handler({
|
|
18
|
-
queryStringParameters: Object.fromEntries([[
|
|
19
|
-
"q",
|
|
20
|
-
"10 Downing Street"
|
|
21
|
-
]])
|
|
22
|
-
});
|
|
23
|
-
globalThis.expect(resp.statusCode).toBe(502);
|
|
24
|
-
globalThis.expect(resp.body).toBe("[]");
|
|
25
|
-
});
|
|
26
|
-
globalThis.test("an empty query is an answer — nothing was asked", async () => {
|
|
27
|
-
setIndex("some-index");
|
|
28
|
-
let resp = await Geocoder_AwsLocation_Ops$ReventlessAws.handler({
|
|
29
|
-
queryStringParameters: Object.fromEntries([[
|
|
30
|
-
"q",
|
|
31
|
-
""
|
|
32
|
-
]])
|
|
33
|
-
});
|
|
34
|
-
globalThis.expect(resp.statusCode).toBe(200);
|
|
35
|
-
globalThis.expect(resp.body).toBe("[]");
|
|
36
|
-
return Stdlib_Dict.$$delete(process.env, "PLACE_INDEX_NAME");
|
|
37
|
-
});
|
|
38
|
-
globalThis.test("a missing q param is treated as an empty one", async () => {
|
|
39
|
-
setIndex("some-index");
|
|
40
|
-
let resp = await Geocoder_AwsLocation_Ops$ReventlessAws.handler({});
|
|
41
|
-
globalThis.expect(resp.statusCode).toBe(200);
|
|
42
|
-
return Stdlib_Dict.$$delete(process.env, "PLACE_INDEX_NAME");
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
globalThis.describe("Geocoder_AwsLocation_Ops.readQueryParam", () => {
|
|
47
|
-
globalThis.test("prefers the parsed params", () => {
|
|
48
|
-
globalThis.expect(Geocoder_AwsLocation_Ops$ReventlessAws.readQueryParam({
|
|
49
|
-
queryStringParameters: Object.fromEntries([[
|
|
50
|
-
"q",
|
|
51
|
-
"Berlin"
|
|
52
|
-
]])
|
|
53
|
-
})).toEqual("Berlin");
|
|
54
|
-
});
|
|
55
|
-
globalThis.test("falls back to the raw query string, percent-decoded", () => {
|
|
56
|
-
globalThis.expect(Geocoder_AwsLocation_Ops$ReventlessAws.readQueryParam({
|
|
57
|
-
rawQueryString: "lang=en&q=10%20Downing%20Street"
|
|
58
|
-
})).toEqual("10 Downing Street");
|
|
59
|
-
});
|
|
60
|
-
globalThis.test("no q anywhere is None", () => {
|
|
61
|
-
globalThis.expect(Geocoder_AwsLocation_Ops$ReventlessAws.readQueryParam({
|
|
62
|
-
rawQueryString: "lang=en"
|
|
63
|
-
})).toEqual(undefined);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
export {
|
|
68
|
-
setIndex,
|
|
69
|
-
clearIndex,
|
|
70
|
-
}
|
|
71
|
-
/* Not a pure module */
|