@effect-aws/client-api-gateway-v2 1.10.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.
- package/ApiGatewayV2ClientInstance/package.json +6 -0
- package/ApiGatewayV2Service/package.json +6 -0
- package/ApiGatewayV2ServiceConfig/package.json +6 -0
- package/Errors/package.json +6 -0
- package/LICENSE +19 -0
- package/README.md +58 -0
- package/dist/cjs/ApiGatewayV2ClientInstance.d.ts +24 -0
- package/dist/cjs/ApiGatewayV2ClientInstance.d.ts.map +1 -0
- package/dist/cjs/ApiGatewayV2ClientInstance.js +50 -0
- package/dist/cjs/ApiGatewayV2ClientInstance.js.map +1 -0
- package/dist/cjs/ApiGatewayV2Service.d.ts +330 -0
- package/dist/cjs/ApiGatewayV2Service.d.ts.map +1 -0
- package/dist/cjs/ApiGatewayV2Service.js +131 -0
- package/dist/cjs/ApiGatewayV2Service.js.map +1 -0
- package/dist/cjs/ApiGatewayV2ServiceConfig.d.ts +25 -0
- package/dist/cjs/ApiGatewayV2ServiceConfig.d.ts.map +1 -0
- package/dist/cjs/ApiGatewayV2ServiceConfig.js +35 -0
- package/dist/cjs/ApiGatewayV2ServiceConfig.js.map +1 -0
- package/dist/cjs/Errors.d.ts +12 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +13 -0
- package/dist/cjs/Errors.js.map +1 -0
- package/dist/cjs/index.d.ts +39 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +56 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/dts/ApiGatewayV2ClientInstance.d.ts +24 -0
- package/dist/dts/ApiGatewayV2ClientInstance.d.ts.map +1 -0
- package/dist/dts/ApiGatewayV2Service.d.ts +330 -0
- package/dist/dts/ApiGatewayV2Service.d.ts.map +1 -0
- package/dist/dts/ApiGatewayV2ServiceConfig.d.ts +25 -0
- package/dist/dts/ApiGatewayV2ServiceConfig.d.ts.map +1 -0
- package/dist/dts/Errors.d.ts +12 -0
- package/dist/dts/Errors.d.ts.map +1 -0
- package/dist/dts/index.d.ts +39 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/esm/ApiGatewayV2ClientInstance.js +23 -0
- package/dist/esm/ApiGatewayV2ClientInstance.js.map +1 -0
- package/dist/esm/ApiGatewayV2Service.js +104 -0
- package/dist/esm/ApiGatewayV2Service.js.map +1 -0
- package/dist/esm/ApiGatewayV2ServiceConfig.js +31 -0
- package/dist/esm/ApiGatewayV2ServiceConfig.js.map +1 -0
- package/dist/esm/Errors.js +10 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/package.json +71 -0
- package/src/ApiGatewayV2ClientInstance.ts +33 -0
- package/src/ApiGatewayV2Service.ts +1170 -0
- package/src/ApiGatewayV2ServiceConfig.ts +52 -0
- package/src/Errors.ts +26 -0
- package/src/index.ts +44 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ServiceLogger } from "@effect-aws/commons";
|
|
2
|
+
import { Effect, FiberRef, Layer } from "effect";
|
|
3
|
+
import { dual } from "effect/Function";
|
|
4
|
+
import { globalValue } from "effect/GlobalValue";
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
* @category api-gateway-v2 service config
|
|
8
|
+
*/
|
|
9
|
+
const currentApiGatewayV2ServiceConfig = globalValue("@effect-aws/client-api-gateway-v2/currentApiGatewayV2ServiceConfig", () => FiberRef.unsafeMake({}));
|
|
10
|
+
/**
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
* @category api-gateway-v2 service config
|
|
13
|
+
*/
|
|
14
|
+
export const withApiGatewayV2ServiceConfig = dual(2, (effect, config) => Effect.locally(effect, currentApiGatewayV2ServiceConfig, config));
|
|
15
|
+
/**
|
|
16
|
+
* @since 1.0.0
|
|
17
|
+
* @category api-gateway-v2 service config
|
|
18
|
+
*/
|
|
19
|
+
export const setApiGatewayV2ServiceConfig = (config) => Layer.locallyScoped(currentApiGatewayV2ServiceConfig, config);
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category adapters
|
|
23
|
+
*/
|
|
24
|
+
export const toApiGatewayV2ClientConfig = Effect.gen(function* () {
|
|
25
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentApiGatewayV2ServiceConfig);
|
|
26
|
+
const logger = serviceLogger === true
|
|
27
|
+
? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
|
|
28
|
+
: (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
|
|
29
|
+
return { logger, ...config };
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=ApiGatewayV2ServiceConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiGatewayV2ServiceConfig.js","sourceRoot":"","sources":["../../src/ApiGatewayV2ServiceConfig.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;;GAGG;AACH,MAAM,gCAAgC,GAAG,WAAW,CAClD,oEAAoE,EACpE,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAA6B,EAAE,CAAC,CAC1D,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAGtC,IAAI,CACN,CAAC,EACD,CAAU,MAA8B,EAAE,MAAkC,EAA0B,EAAE,CACtG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,gCAAgC,EAAE,MAAM,CAAC,CACnE,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,MAAkC,EAAE,EAAE,CACjF,KAAK,CAAC,aAAa,CAAC,gCAAgC,EAAE,MAAM,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA4C,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACrG,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAEnG,MAAM,MAAM,GAAG,aAAa,KAAK,IAAI;QACnC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,oBAAoB,CAAC;QACzE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEzG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SdkError as CommonSdkError } from "@effect-aws/commons";
|
|
2
|
+
export const AllServiceErrors = [
|
|
3
|
+
"AccessDeniedException",
|
|
4
|
+
"BadRequestException",
|
|
5
|
+
"ConflictException",
|
|
6
|
+
"NotFoundException",
|
|
7
|
+
"TooManyRequestsException",
|
|
8
|
+
];
|
|
9
|
+
export const SdkError = CommonSdkError;
|
|
10
|
+
//# sourceMappingURL=Errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../src/Errors.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,uBAAuB;IACvB,qBAAqB;IACrB,mBAAmB;IACnB,mBAAmB;IACnB,0BAA0B;CAClB,CAAC;AASX,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { ApiGatewayV2Service } from "./ApiGatewayV2Service.js";
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
export * from "./Errors.js";
|
|
9
|
+
/**
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
*/
|
|
12
|
+
export * as ApiGatewayV2ClientInstance from "./ApiGatewayV2ClientInstance.js";
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
export * as ApiGatewayV2ServiceConfig from "./ApiGatewayV2ServiceConfig.js";
|
|
17
|
+
/**
|
|
18
|
+
* @since 1.0.0
|
|
19
|
+
*/
|
|
20
|
+
export * from "./ApiGatewayV2Service.js";
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
* @category exports
|
|
24
|
+
* @alias ApiGatewayV2Service
|
|
25
|
+
*/
|
|
26
|
+
export const ApiGatewayV2 = ApiGatewayV2Service;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,cAAc,aAAa,CAAC;AAE5B;;GAEG;AACH,OAAO,KAAK,0BAA0B,MAAM,iCAAiC,CAAC;AAE9E;;GAEG;AACH,OAAO,KAAK,yBAAyB,MAAM,gCAAgC,CAAC;AAE5E;;GAEG;AACH,cAAc,0BAA0B,CAAC;AAezC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@effect-aws/client-api-gateway-v2",
|
|
3
|
+
"version": "1.10.0",
|
|
4
|
+
"description": "Effectful AWS API Gateway V2 client",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "github:floydspace/effect-aws",
|
|
9
|
+
"directory": "packages/client-api-gateway-v2"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": [],
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Victor Korzunin",
|
|
14
|
+
"email": "ifloydrose@gmail.com"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://floydspace.github.io/effect-aws/docs/client-api-gateway-v2",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@aws-sdk/client-apigatewayv2": "^3",
|
|
19
|
+
"@effect-aws/commons": "^0.3.0"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"effect": ">=3.0.4 <4.0.0"
|
|
23
|
+
},
|
|
24
|
+
"main": "./dist/cjs/index.js",
|
|
25
|
+
"module": "./dist/esm/index.js",
|
|
26
|
+
"types": "./dist/dts/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
"./package.json": "./package.json",
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/dts/index.d.ts",
|
|
31
|
+
"import": "./dist/esm/index.js",
|
|
32
|
+
"default": "./dist/cjs/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./ApiGatewayV2ClientInstance": {
|
|
35
|
+
"types": "./dist/dts/ApiGatewayV2ClientInstance.d.ts",
|
|
36
|
+
"import": "./dist/esm/ApiGatewayV2ClientInstance.js",
|
|
37
|
+
"default": "./dist/cjs/ApiGatewayV2ClientInstance.js"
|
|
38
|
+
},
|
|
39
|
+
"./ApiGatewayV2Service": {
|
|
40
|
+
"types": "./dist/dts/ApiGatewayV2Service.d.ts",
|
|
41
|
+
"import": "./dist/esm/ApiGatewayV2Service.js",
|
|
42
|
+
"default": "./dist/cjs/ApiGatewayV2Service.js"
|
|
43
|
+
},
|
|
44
|
+
"./ApiGatewayV2ServiceConfig": {
|
|
45
|
+
"types": "./dist/dts/ApiGatewayV2ServiceConfig.d.ts",
|
|
46
|
+
"import": "./dist/esm/ApiGatewayV2ServiceConfig.js",
|
|
47
|
+
"default": "./dist/cjs/ApiGatewayV2ServiceConfig.js"
|
|
48
|
+
},
|
|
49
|
+
"./Errors": {
|
|
50
|
+
"types": "./dist/dts/Errors.d.ts",
|
|
51
|
+
"import": "./dist/esm/Errors.js",
|
|
52
|
+
"default": "./dist/cjs/Errors.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"typesVersions": {
|
|
56
|
+
"*": {
|
|
57
|
+
"ApiGatewayV2ClientInstance": [
|
|
58
|
+
"./dist/dts/ApiGatewayV2ClientInstance.d.ts"
|
|
59
|
+
],
|
|
60
|
+
"ApiGatewayV2Service": [
|
|
61
|
+
"./dist/dts/ApiGatewayV2Service.d.ts"
|
|
62
|
+
],
|
|
63
|
+
"ApiGatewayV2ServiceConfig": [
|
|
64
|
+
"./dist/dts/ApiGatewayV2ServiceConfig.d.ts"
|
|
65
|
+
],
|
|
66
|
+
"Errors": [
|
|
67
|
+
"./dist/dts/Errors.d.ts"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { ApiGatewayV2Client } from "@aws-sdk/client-apigatewayv2";
|
|
5
|
+
import { Context, Effect, Layer } from "effect";
|
|
6
|
+
import * as ApiGatewayV2ServiceConfig from "./ApiGatewayV2ServiceConfig.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category tags
|
|
11
|
+
*/
|
|
12
|
+
export class ApiGatewayV2ClientInstance extends Context.Tag(
|
|
13
|
+
"@effect-aws/client-api-gateway-v2/ApiGatewayV2ClientInstance",
|
|
14
|
+
)<ApiGatewayV2ClientInstance, ApiGatewayV2Client>() {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category constructors
|
|
19
|
+
*/
|
|
20
|
+
export const make = Effect.flatMap(
|
|
21
|
+
ApiGatewayV2ServiceConfig.toApiGatewayV2ClientConfig,
|
|
22
|
+
(config) =>
|
|
23
|
+
Effect.acquireRelease(
|
|
24
|
+
Effect.sync(() => new ApiGatewayV2Client(config)),
|
|
25
|
+
(client) => Effect.sync(() => client.destroy()),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @since 1.0.0
|
|
31
|
+
* @category layers
|
|
32
|
+
*/
|
|
33
|
+
export const layer = Layer.scoped(ApiGatewayV2ClientInstance, make);
|