@effect-aws/client-api-gateway-management-api 1.6.0 → 1.9.3
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/ApiGatewayManagementApiClientInstance/package.json +6 -0
- package/ApiGatewayManagementApiService/package.json +6 -0
- package/ApiGatewayManagementApiServiceConfig/package.json +6 -0
- package/Errors/package.json +6 -0
- package/dist/cjs/ApiGatewayManagementApiClientInstance.d.ts +24 -0
- package/dist/cjs/ApiGatewayManagementApiClientInstance.d.ts.map +1 -0
- package/dist/cjs/ApiGatewayManagementApiClientInstance.js +50 -0
- package/dist/cjs/ApiGatewayManagementApiClientInstance.js.map +1 -0
- package/dist/cjs/ApiGatewayManagementApiService.d.ts +53 -0
- package/dist/cjs/ApiGatewayManagementApiService.d.ts.map +1 -0
- package/dist/cjs/ApiGatewayManagementApiService.js +62 -0
- package/dist/cjs/ApiGatewayManagementApiService.js.map +1 -0
- package/dist/cjs/ApiGatewayManagementApiServiceConfig.d.ts +25 -0
- package/dist/cjs/ApiGatewayManagementApiServiceConfig.d.ts.map +1 -0
- package/dist/cjs/ApiGatewayManagementApiServiceConfig.js +35 -0
- package/dist/cjs/ApiGatewayManagementApiServiceConfig.js.map +1 -0
- package/dist/cjs/Errors.d.ts +11 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +12 -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/ApiGatewayManagementApiClientInstance.d.ts +24 -0
- package/dist/dts/ApiGatewayManagementApiClientInstance.d.ts.map +1 -0
- package/dist/dts/ApiGatewayManagementApiService.d.ts +53 -0
- package/dist/dts/ApiGatewayManagementApiService.d.ts.map +1 -0
- package/dist/dts/ApiGatewayManagementApiServiceConfig.d.ts +25 -0
- package/dist/dts/ApiGatewayManagementApiServiceConfig.d.ts.map +1 -0
- package/dist/dts/Errors.d.ts +11 -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/ApiGatewayManagementApiClientInstance.js +23 -0
- package/dist/esm/ApiGatewayManagementApiClientInstance.js.map +1 -0
- package/dist/esm/ApiGatewayManagementApiService.js +35 -0
- package/dist/esm/ApiGatewayManagementApiService.js.map +1 -0
- package/dist/esm/ApiGatewayManagementApiServiceConfig.js +31 -0
- package/dist/esm/ApiGatewayManagementApiServiceConfig.js.map +1 -0
- package/dist/esm/Errors.js +9 -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 +60 -43
- package/src/ApiGatewayManagementApiClientInstance.ts +33 -0
- package/src/ApiGatewayManagementApiService.ts +126 -0
- package/src/ApiGatewayManagementApiServiceConfig.ts +54 -0
- package/src/Errors.ts +23 -0
- package/src/index.ts +44 -0
- package/CHANGELOG.md +0 -115
- package/docgen.json +0 -8
- package/lib/ApiGatewayManagementApiClientInstance.d.ts +0 -31
- package/lib/ApiGatewayManagementApiClientInstance.js +0 -57
- package/lib/ApiGatewayManagementApiClientInstanceConfig.d.ts +0 -23
- package/lib/ApiGatewayManagementApiClientInstanceConfig.js +0 -44
- package/lib/ApiGatewayManagementApiService.d.ts +0 -80
- package/lib/ApiGatewayManagementApiService.js +0 -91
- package/lib/Errors.d.ts +0 -16
- package/lib/Errors.js +0 -12
- package/lib/esm/ApiGatewayManagementApiClientInstance.js +0 -30
- package/lib/esm/ApiGatewayManagementApiClientInstanceConfig.js +0 -40
- package/lib/esm/ApiGatewayManagementApiService.js +0 -87
- package/lib/esm/Errors.js +0 -9
- package/lib/esm/index.js +0 -5
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -21
- package/project.json +0 -77
- package/vitest.config.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF;;GAEG;AACH,cAAc,aAAa,CAAC;AAE5B;;GAEG;AACH,OAAO,KAAK,qCAAqC,MAAM,4CAA4C,CAAC;AAEpG;;GAEG;AACH,OAAO,KAAK,oCAAoC,MAAM,2CAA2C,CAAC;AAElG;;GAEG;AACH,cAAc,qCAAqC,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,uBAAuB,CAAC;IAC/C;;;OAGG;IACH,KAAY,MAAM,GAAG,8BAA8B,CAAC,MAAM,CAAC;CAC5D;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,uCAAiC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { ApiGatewayManagementApiClient } from "@aws-sdk/client-apigatewaymanagementapi";
|
|
5
|
+
import { Context, Effect, Layer } from "effect";
|
|
6
|
+
import * as ApiGatewayManagementApiServiceConfig from "./ApiGatewayManagementApiServiceConfig.js";
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category tags
|
|
10
|
+
*/
|
|
11
|
+
export class ApiGatewayManagementApiClientInstance extends Context.Tag("@effect-aws/client-api-gateway-management-api/ApiGatewayManagementApiClientInstance")() {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
* @category constructors
|
|
16
|
+
*/
|
|
17
|
+
export const make = Effect.flatMap(ApiGatewayManagementApiServiceConfig.toApiGatewayManagementApiClientConfig, (config) => Effect.acquireRelease(Effect.sync(() => new ApiGatewayManagementApiClient(config)), (client) => Effect.sync(() => client.destroy())));
|
|
18
|
+
/**
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
* @category layers
|
|
21
|
+
*/
|
|
22
|
+
export const layer = Layer.scoped(ApiGatewayManagementApiClientInstance, make);
|
|
23
|
+
//# sourceMappingURL=ApiGatewayManagementApiClientInstance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiGatewayManagementApiClientInstance.js","sourceRoot":"","sources":["../../src/ApiGatewayManagementApiClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,oCAAoC,MAAM,2CAA2C,CAAC;AAElG;;;GAGG;AACH,MAAM,OAAO,qCAAsC,SAAQ,OAAO,CAAC,GAAG,CACpE,qFAAqF,CACtF,EAAwE;CAAG;AAE5E;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAChC,oCAAoC,CAAC,qCAAqC,EAC1E,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,cAAc,CACnB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,6BAA6B,CAAC,MAAM,CAAC,CAAC,EAC5D,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAChD,CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,qCAAqC,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { DeleteConnectionCommand, GetConnectionCommand, PostToConnectionCommand, } from "@aws-sdk/client-apigatewaymanagementapi";
|
|
5
|
+
import { Service } from "@effect-aws/commons";
|
|
6
|
+
import { Effect, Layer } from "effect";
|
|
7
|
+
import * as Instance from "./ApiGatewayManagementApiClientInstance.js";
|
|
8
|
+
import * as ApiGatewayManagementApiServiceConfig from "./ApiGatewayManagementApiServiceConfig.js";
|
|
9
|
+
import { AllServiceErrors } from "./Errors.js";
|
|
10
|
+
const commands = {
|
|
11
|
+
DeleteConnectionCommand,
|
|
12
|
+
GetConnectionCommand,
|
|
13
|
+
PostToConnectionCommand,
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @since 1.0.0
|
|
17
|
+
* @category constructors
|
|
18
|
+
*/
|
|
19
|
+
export const makeApiGatewayManagementApiService = Effect.gen(function* () {
|
|
20
|
+
const client = yield* Instance.ApiGatewayManagementApiClientInstance;
|
|
21
|
+
return Service.fromClientAndCommands(client, commands, {
|
|
22
|
+
errorTags: AllServiceErrors,
|
|
23
|
+
resolveClientConfig: ApiGatewayManagementApiServiceConfig.toApiGatewayManagementApiClientConfig,
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category models
|
|
29
|
+
*/
|
|
30
|
+
export class ApiGatewayManagementApiService extends Effect.Tag("@effect-aws/client-api-gateway-management-api/ApiGatewayManagementApiService")() {
|
|
31
|
+
static defaultLayer = Layer.effect(this, makeApiGatewayManagementApiService).pipe(Layer.provide(Instance.layer));
|
|
32
|
+
static layer = (config) => Layer.effect(this, makeApiGatewayManagementApiService).pipe(Layer.provide(Instance.layer), Layer.provide(ApiGatewayManagementApiServiceConfig.setApiGatewayManagementApiServiceConfig(config)));
|
|
33
|
+
static baseLayer = (evaluate) => Layer.effect(this, makeApiGatewayManagementApiService).pipe(Layer.provide(Layer.effect(Instance.ApiGatewayManagementApiClientInstance, Effect.map(ApiGatewayManagementApiServiceConfig.toApiGatewayManagementApiClientConfig, evaluate))));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ApiGatewayManagementApiService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiGatewayManagementApiService.js","sourceRoot":"","sources":["../../src/ApiGatewayManagementApiService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAGL,uBAAuB,EAGvB,oBAAoB,EAGpB,uBAAuB,GAGxB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,4CAA4C,CAAC;AACvE,OAAO,KAAK,oCAAoC,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,QAAQ,GAAG;IACf,uBAAuB;IACvB,oBAAoB;IACpB,uBAAuB;CACxB,CAAC;AAuCF;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAErE,OAAO,OAAO,CAAC,qBAAqB,CAClC,MAAM,EACN,QAAQ,EACR;QACE,SAAS,EAAE,gBAAgB;QAC3B,mBAAmB,EAAE,oCAAoC,CAAC,qCAAqC;KAChG,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,OAAO,8BACX,SAAQ,MAAM,CAAC,GAAG,CAAC,8EAA8E,CAAC,EAG/F;IAEH,MAAM,CAAU,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,kCAAkC,CAAC,CAAC,IAAI,CACxF,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC9B,CAAC;IACF,MAAM,CAAU,KAAK,GAAG,CAAC,MAA6C,EAAE,EAAE,CACxE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,kCAAkC,CAAC,CAAC,IAAI,CACzD,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC7B,KAAK,CAAC,OAAO,CAAC,oCAAoC,CAAC,uCAAuC,CAAC,MAAM,CAAC,CAAC,CACpG,CAAC;IACJ,MAAM,CAAU,SAAS,GAAG,CAC1B,QAA+F,EAC/F,EAAE,CACF,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,kCAAkC,CAAC,CAAC,IAAI,CACzD,KAAK,CAAC,OAAO,CACX,KAAK,CAAC,MAAM,CACV,QAAQ,CAAC,qCAAqC,EAC9C,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,qCAAqC,EAAE,QAAQ,CAAC,CACjG,CACF,CACF,CAAC"}
|
|
@@ -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-management-api service config
|
|
8
|
+
*/
|
|
9
|
+
const currentApiGatewayManagementApiServiceConfig = globalValue("@effect-aws/client-api-gateway-management-api/currentApiGatewayManagementApiServiceConfig", () => FiberRef.unsafeMake({}));
|
|
10
|
+
/**
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
* @category api-gateway-management-api service config
|
|
13
|
+
*/
|
|
14
|
+
export const withApiGatewayManagementApiServiceConfig = dual(2, (effect, config) => Effect.locally(effect, currentApiGatewayManagementApiServiceConfig, config));
|
|
15
|
+
/**
|
|
16
|
+
* @since 1.0.0
|
|
17
|
+
* @category api-gateway-management-api service config
|
|
18
|
+
*/
|
|
19
|
+
export const setApiGatewayManagementApiServiceConfig = (config) => Layer.locallyScoped(currentApiGatewayManagementApiServiceConfig, config);
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category adapters
|
|
23
|
+
*/
|
|
24
|
+
export const toApiGatewayManagementApiClientConfig = Effect.gen(function* () {
|
|
25
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentApiGatewayManagementApiServiceConfig);
|
|
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=ApiGatewayManagementApiServiceConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiGatewayManagementApiServiceConfig.js","sourceRoot":"","sources":["../../src/ApiGatewayManagementApiServiceConfig.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,2CAA2C,GAAG,WAAW,CAC7D,2FAA2F,EAC3F,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAwC,EAAE,CAAC,CACrE,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAGjD,IAAI,CACN,CAAC,EACD,CAAU,MAA8B,EAAE,MAA6C,EAA0B,EAAE,CACjH,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,2CAA2C,EAAE,MAAM,CAAC,CAC9E,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,MAA6C,EAAE,EAAE,CACvG,KAAK,CAAC,aAAa,CAAC,2CAA2C,EAAE,MAAM,CAAC,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAuD,MAAM,CAAC,GAAG,CACjH,QAAQ,CAAC;IACP,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IAE9G,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,CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SdkError as CommonSdkError } from "@effect-aws/commons";
|
|
2
|
+
export const AllServiceErrors = [
|
|
3
|
+
"ForbiddenException",
|
|
4
|
+
"GoneException",
|
|
5
|
+
"LimitExceededException",
|
|
6
|
+
"PayloadTooLargeException",
|
|
7
|
+
];
|
|
8
|
+
export const SdkError = CommonSdkError;
|
|
9
|
+
//# sourceMappingURL=Errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../src/Errors.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,oBAAoB;IACpB,eAAe;IACf,wBAAwB;IACxB,0BAA0B;CAClB,CAAC;AAQX,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { ApiGatewayManagementApiService } from "./ApiGatewayManagementApiService.js";
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
export * from "./Errors.js";
|
|
9
|
+
/**
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
*/
|
|
12
|
+
export * as ApiGatewayManagementApiClientInstance from "./ApiGatewayManagementApiClientInstance.js";
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
export * as ApiGatewayManagementApiServiceConfig from "./ApiGatewayManagementApiServiceConfig.js";
|
|
17
|
+
/**
|
|
18
|
+
* @since 1.0.0
|
|
19
|
+
*/
|
|
20
|
+
export * from "./ApiGatewayManagementApiService.js";
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
* @category exports
|
|
24
|
+
* @alias ApiGatewayManagementApiService
|
|
25
|
+
*/
|
|
26
|
+
export const ApiGatewayManagementApi = ApiGatewayManagementApiService;
|
|
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,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF;;GAEG;AACH,cAAc,aAAa,CAAC;AAE5B;;GAEG;AACH,OAAO,KAAK,qCAAqC,MAAM,4CAA4C,CAAC;AAEpG;;GAEG;AACH,OAAO,KAAK,oCAAoC,MAAM,2CAA2C,CAAC;AAElG;;GAEG;AACH,cAAc,qCAAqC,CAAC;AAepD;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,54 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-aws/client-api-gateway-management-api",
|
|
3
|
+
"version": "1.9.3",
|
|
4
|
+
"description": "Effectful AWS API Gateway Management API client",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "github:floydspace/effect-aws",
|
|
9
|
+
"directory": "packages/client-api-gateway-management-api"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": [],
|
|
3
12
|
"author": {
|
|
4
13
|
"name": "Victor Korzunin",
|
|
5
|
-
"email": "ifloydrose@gmail.com"
|
|
6
|
-
"organization": false
|
|
14
|
+
"email": "ifloydrose@gmail.com"
|
|
7
15
|
},
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"@
|
|
11
|
-
"@
|
|
12
|
-
"aws-sdk-client-mock": "^4.0.2",
|
|
13
|
-
"aws-sdk-client-mock-vitest": "^4.0.0",
|
|
14
|
-
"effect": "3.0.0",
|
|
15
|
-
"eslint": "^8",
|
|
16
|
-
"eslint-config-prettier": "^9.1.0",
|
|
17
|
-
"eslint-import-resolver-typescript": "^3.6.1",
|
|
18
|
-
"eslint-plugin-import": "^2.29.1",
|
|
19
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
20
|
-
"prettier": "^3.2.5",
|
|
21
|
-
"typescript": "^5.4.2",
|
|
22
|
-
"vitest": "^2.0.5"
|
|
16
|
+
"homepage": "https://floydspace.github.io/effect-aws/docs/client-api-gateway-management-api",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@aws-sdk/client-apigatewaymanagementapi": "^3",
|
|
19
|
+
"@effect-aws/commons": "^0.2.0"
|
|
23
20
|
},
|
|
24
21
|
"peerDependencies": {
|
|
25
|
-
"effect": ">=3.0.
|
|
22
|
+
"effect": ">=3.0.4 <4.0.0"
|
|
26
23
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
+
"./ApiGatewayManagementApiClientInstance": {
|
|
35
|
+
"types": "./dist/dts/ApiGatewayManagementApiClientInstance.d.ts",
|
|
36
|
+
"import": "./dist/esm/ApiGatewayManagementApiClientInstance.js",
|
|
37
|
+
"default": "./dist/cjs/ApiGatewayManagementApiClientInstance.js"
|
|
38
|
+
},
|
|
39
|
+
"./ApiGatewayManagementApiService": {
|
|
40
|
+
"types": "./dist/dts/ApiGatewayManagementApiService.d.ts",
|
|
41
|
+
"import": "./dist/esm/ApiGatewayManagementApiService.js",
|
|
42
|
+
"default": "./dist/cjs/ApiGatewayManagementApiService.js"
|
|
43
|
+
},
|
|
44
|
+
"./ApiGatewayManagementApiServiceConfig": {
|
|
45
|
+
"types": "./dist/dts/ApiGatewayManagementApiServiceConfig.d.ts",
|
|
46
|
+
"import": "./dist/esm/ApiGatewayManagementApiServiceConfig.js",
|
|
47
|
+
"default": "./dist/cjs/ApiGatewayManagementApiServiceConfig.js"
|
|
48
|
+
},
|
|
49
|
+
"./Errors": {
|
|
50
|
+
"types": "./dist/dts/Errors.d.ts",
|
|
51
|
+
"import": "./dist/esm/Errors.js",
|
|
52
|
+
"default": "./dist/cjs/Errors.js"
|
|
53
|
+
}
|
|
35
54
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"watch": "npx projen watch",
|
|
52
|
-
"docgen": "docgen"
|
|
55
|
+
"typesVersions": {
|
|
56
|
+
"*": {
|
|
57
|
+
"ApiGatewayManagementApiClientInstance": [
|
|
58
|
+
"./dist/dts/ApiGatewayManagementApiClientInstance.d.ts"
|
|
59
|
+
],
|
|
60
|
+
"ApiGatewayManagementApiService": [
|
|
61
|
+
"./dist/dts/ApiGatewayManagementApiService.d.ts"
|
|
62
|
+
],
|
|
63
|
+
"ApiGatewayManagementApiServiceConfig": [
|
|
64
|
+
"./dist/dts/ApiGatewayManagementApiServiceConfig.d.ts"
|
|
65
|
+
],
|
|
66
|
+
"Errors": [
|
|
67
|
+
"./dist/dts/Errors.d.ts"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
53
70
|
}
|
|
54
71
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { ApiGatewayManagementApiClient } from "@aws-sdk/client-apigatewaymanagementapi";
|
|
5
|
+
import { Context, Effect, Layer } from "effect";
|
|
6
|
+
import * as ApiGatewayManagementApiServiceConfig from "./ApiGatewayManagementApiServiceConfig.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category tags
|
|
11
|
+
*/
|
|
12
|
+
export class ApiGatewayManagementApiClientInstance extends Context.Tag(
|
|
13
|
+
"@effect-aws/client-api-gateway-management-api/ApiGatewayManagementApiClientInstance",
|
|
14
|
+
)<ApiGatewayManagementApiClientInstance, ApiGatewayManagementApiClient>() {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category constructors
|
|
19
|
+
*/
|
|
20
|
+
export const make = Effect.flatMap(
|
|
21
|
+
ApiGatewayManagementApiServiceConfig.toApiGatewayManagementApiClientConfig,
|
|
22
|
+
(config) =>
|
|
23
|
+
Effect.acquireRelease(
|
|
24
|
+
Effect.sync(() => new ApiGatewayManagementApiClient(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(ApiGatewayManagementApiClientInstance, make);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
type ApiGatewayManagementApiClient,
|
|
6
|
+
type ApiGatewayManagementApiClientConfig,
|
|
7
|
+
DeleteConnectionCommand,
|
|
8
|
+
type DeleteConnectionCommandInput,
|
|
9
|
+
type DeleteConnectionCommandOutput,
|
|
10
|
+
GetConnectionCommand,
|
|
11
|
+
type GetConnectionCommandInput,
|
|
12
|
+
type GetConnectionCommandOutput,
|
|
13
|
+
PostToConnectionCommand,
|
|
14
|
+
type PostToConnectionCommandInput,
|
|
15
|
+
type PostToConnectionCommandOutput,
|
|
16
|
+
} from "@aws-sdk/client-apigatewaymanagementapi";
|
|
17
|
+
import type { HttpHandlerOptions, SdkError, ServiceLogger } from "@effect-aws/commons";
|
|
18
|
+
import { Service } from "@effect-aws/commons";
|
|
19
|
+
import { Effect, Layer } from "effect";
|
|
20
|
+
import * as Instance from "./ApiGatewayManagementApiClientInstance.js";
|
|
21
|
+
import * as ApiGatewayManagementApiServiceConfig from "./ApiGatewayManagementApiServiceConfig.js";
|
|
22
|
+
import type { ForbiddenError, GoneError, LimitExceededError, PayloadTooLargeError } from "./Errors.js";
|
|
23
|
+
import { AllServiceErrors } from "./Errors.js";
|
|
24
|
+
|
|
25
|
+
const commands = {
|
|
26
|
+
DeleteConnectionCommand,
|
|
27
|
+
GetConnectionCommand,
|
|
28
|
+
PostToConnectionCommand,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
interface ApiGatewayManagementApiService$ {
|
|
32
|
+
readonly _: unique symbol;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @see {@link DeleteConnectionCommand}
|
|
36
|
+
*/
|
|
37
|
+
deleteConnection(
|
|
38
|
+
args: DeleteConnectionCommandInput,
|
|
39
|
+
options?: HttpHandlerOptions,
|
|
40
|
+
): Effect.Effect<
|
|
41
|
+
DeleteConnectionCommandOutput,
|
|
42
|
+
SdkError | ForbiddenError | GoneError | LimitExceededError
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @see {@link GetConnectionCommand}
|
|
47
|
+
*/
|
|
48
|
+
getConnection(
|
|
49
|
+
args: GetConnectionCommandInput,
|
|
50
|
+
options?: HttpHandlerOptions,
|
|
51
|
+
): Effect.Effect<
|
|
52
|
+
GetConnectionCommandOutput,
|
|
53
|
+
SdkError | ForbiddenError | GoneError | LimitExceededError
|
|
54
|
+
>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @see {@link PostToConnectionCommand}
|
|
58
|
+
*/
|
|
59
|
+
postToConnection(
|
|
60
|
+
args: PostToConnectionCommandInput,
|
|
61
|
+
options?: HttpHandlerOptions,
|
|
62
|
+
): Effect.Effect<
|
|
63
|
+
PostToConnectionCommandOutput,
|
|
64
|
+
SdkError | ForbiddenError | GoneError | LimitExceededError | PayloadTooLargeError
|
|
65
|
+
>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @since 1.0.0
|
|
70
|
+
* @category constructors
|
|
71
|
+
*/
|
|
72
|
+
export const makeApiGatewayManagementApiService = Effect.gen(function*() {
|
|
73
|
+
const client = yield* Instance.ApiGatewayManagementApiClientInstance;
|
|
74
|
+
|
|
75
|
+
return Service.fromClientAndCommands<ApiGatewayManagementApiService$>(
|
|
76
|
+
client,
|
|
77
|
+
commands,
|
|
78
|
+
{
|
|
79
|
+
errorTags: AllServiceErrors,
|
|
80
|
+
resolveClientConfig: ApiGatewayManagementApiServiceConfig.toApiGatewayManagementApiClientConfig,
|
|
81
|
+
},
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @since 1.0.0
|
|
87
|
+
* @category models
|
|
88
|
+
*/
|
|
89
|
+
export class ApiGatewayManagementApiService
|
|
90
|
+
extends Effect.Tag("@effect-aws/client-api-gateway-management-api/ApiGatewayManagementApiService")<
|
|
91
|
+
ApiGatewayManagementApiService,
|
|
92
|
+
ApiGatewayManagementApiService$
|
|
93
|
+
>()
|
|
94
|
+
{
|
|
95
|
+
static readonly defaultLayer = Layer.effect(this, makeApiGatewayManagementApiService).pipe(
|
|
96
|
+
Layer.provide(Instance.layer),
|
|
97
|
+
);
|
|
98
|
+
static readonly layer = (config: ApiGatewayManagementApiService.Config) =>
|
|
99
|
+
Layer.effect(this, makeApiGatewayManagementApiService).pipe(
|
|
100
|
+
Layer.provide(Instance.layer),
|
|
101
|
+
Layer.provide(ApiGatewayManagementApiServiceConfig.setApiGatewayManagementApiServiceConfig(config)),
|
|
102
|
+
);
|
|
103
|
+
static readonly baseLayer = (
|
|
104
|
+
evaluate: (defaultConfig: ApiGatewayManagementApiClientConfig) => ApiGatewayManagementApiClient,
|
|
105
|
+
) =>
|
|
106
|
+
Layer.effect(this, makeApiGatewayManagementApiService).pipe(
|
|
107
|
+
Layer.provide(
|
|
108
|
+
Layer.effect(
|
|
109
|
+
Instance.ApiGatewayManagementApiClientInstance,
|
|
110
|
+
Effect.map(ApiGatewayManagementApiServiceConfig.toApiGatewayManagementApiClientConfig, evaluate),
|
|
111
|
+
),
|
|
112
|
+
),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @since 1.0.0
|
|
118
|
+
*/
|
|
119
|
+
export declare namespace ApiGatewayManagementApiService {
|
|
120
|
+
/**
|
|
121
|
+
* @since 1.0.0
|
|
122
|
+
*/
|
|
123
|
+
export interface Config extends Omit<ApiGatewayManagementApiClientConfig, "logger"> {
|
|
124
|
+
readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { ApiGatewayManagementApiClientConfig } from "@aws-sdk/client-apigatewaymanagementapi";
|
|
5
|
+
import { ServiceLogger } from "@effect-aws/commons";
|
|
6
|
+
import { Effect, FiberRef, Layer } from "effect";
|
|
7
|
+
import { dual } from "effect/Function";
|
|
8
|
+
import { globalValue } from "effect/GlobalValue";
|
|
9
|
+
import type { ApiGatewayManagementApiService } from "./ApiGatewayManagementApiService.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category api-gateway-management-api service config
|
|
14
|
+
*/
|
|
15
|
+
const currentApiGatewayManagementApiServiceConfig = globalValue(
|
|
16
|
+
"@effect-aws/client-api-gateway-management-api/currentApiGatewayManagementApiServiceConfig",
|
|
17
|
+
() => FiberRef.unsafeMake<ApiGatewayManagementApiService.Config>({}),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category api-gateway-management-api service config
|
|
23
|
+
*/
|
|
24
|
+
export const withApiGatewayManagementApiServiceConfig: {
|
|
25
|
+
(config: ApiGatewayManagementApiService.Config): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
26
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: ApiGatewayManagementApiService.Config): Effect.Effect<A, E, R>;
|
|
27
|
+
} = dual(
|
|
28
|
+
2,
|
|
29
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: ApiGatewayManagementApiService.Config): Effect.Effect<A, E, R> =>
|
|
30
|
+
Effect.locally(effect, currentApiGatewayManagementApiServiceConfig, config),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
* @category api-gateway-management-api service config
|
|
36
|
+
*/
|
|
37
|
+
export const setApiGatewayManagementApiServiceConfig = (config: ApiGatewayManagementApiService.Config) =>
|
|
38
|
+
Layer.locallyScoped(currentApiGatewayManagementApiServiceConfig, config);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
* @category adapters
|
|
43
|
+
*/
|
|
44
|
+
export const toApiGatewayManagementApiClientConfig: Effect.Effect<ApiGatewayManagementApiClientConfig> = Effect.gen(
|
|
45
|
+
function*() {
|
|
46
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentApiGatewayManagementApiServiceConfig);
|
|
47
|
+
|
|
48
|
+
const logger = serviceLogger === true
|
|
49
|
+
? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
|
|
50
|
+
: (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
|
|
51
|
+
|
|
52
|
+
return { logger, ...config };
|
|
53
|
+
},
|
|
54
|
+
);
|
package/src/Errors.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ForbiddenException,
|
|
3
|
+
GoneException,
|
|
4
|
+
LimitExceededException,
|
|
5
|
+
PayloadTooLargeException,
|
|
6
|
+
} from "@aws-sdk/client-apigatewaymanagementapi";
|
|
7
|
+
import type { TaggedException } from "@effect-aws/commons";
|
|
8
|
+
import { SdkError as CommonSdkError } from "@effect-aws/commons";
|
|
9
|
+
|
|
10
|
+
export const AllServiceErrors = [
|
|
11
|
+
"ForbiddenException",
|
|
12
|
+
"GoneException",
|
|
13
|
+
"LimitExceededException",
|
|
14
|
+
"PayloadTooLargeException",
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
export type ForbiddenError = TaggedException<ForbiddenException>;
|
|
18
|
+
export type GoneError = TaggedException<GoneException>;
|
|
19
|
+
export type LimitExceededError = TaggedException<LimitExceededException>;
|
|
20
|
+
export type PayloadTooLargeError = TaggedException<PayloadTooLargeException>;
|
|
21
|
+
|
|
22
|
+
export type SdkError = CommonSdkError;
|
|
23
|
+
export const SdkError = CommonSdkError;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { ApiGatewayManagementApiService } from "./ApiGatewayManagementApiService.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export * from "./Errors.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
export * as ApiGatewayManagementApiClientInstance from "./ApiGatewayManagementApiClientInstance.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export * as ApiGatewayManagementApiServiceConfig from "./ApiGatewayManagementApiServiceConfig.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
export * from "./ApiGatewayManagementApiService.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category exports
|
|
29
|
+
* @alias ApiGatewayManagementApiService
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace ApiGatewayManagementApi {
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @alias ApiGatewayManagementApiService.Config
|
|
35
|
+
*/
|
|
36
|
+
export type Config = ApiGatewayManagementApiService.Config;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @since 1.0.0
|
|
41
|
+
* @category exports
|
|
42
|
+
* @alias ApiGatewayManagementApiService
|
|
43
|
+
*/
|
|
44
|
+
export const ApiGatewayManagementApi = ApiGatewayManagementApiService;
|