@effect-aws/client-textract 1.1.0 → 1.9.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/Errors/package.json +6 -0
- package/LICENSE +1 -1
- package/TextractClientInstance/package.json +6 -0
- package/TextractService/package.json +6 -0
- package/TextractServiceConfig/package.json +6 -0
- package/{lib → dist/cjs}/Errors.d.ts +6 -11
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +26 -0
- package/dist/cjs/Errors.js.map +1 -0
- package/dist/cjs/TextractClientInstance.d.ts +24 -0
- package/dist/cjs/TextractClientInstance.d.ts.map +1 -0
- package/dist/cjs/TextractClientInstance.js +50 -0
- package/dist/cjs/TextractClientInstance.js.map +1 -0
- package/{lib → dist/cjs}/TextractService.d.ts +16 -38
- package/dist/cjs/TextractService.d.ts.map +1 -0
- package/dist/cjs/TextractService.js +81 -0
- package/dist/cjs/TextractService.js.map +1 -0
- package/dist/cjs/TextractServiceConfig.d.ts +25 -0
- package/dist/cjs/TextractServiceConfig.d.ts.map +1 -0
- package/dist/cjs/TextractServiceConfig.js +35 -0
- package/dist/cjs/TextractServiceConfig.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/Errors.d.ts +25 -0
- package/dist/dts/Errors.d.ts.map +1 -0
- package/dist/dts/TextractClientInstance.d.ts +24 -0
- package/dist/dts/TextractClientInstance.d.ts.map +1 -0
- package/dist/dts/TextractService.d.ts +168 -0
- package/dist/dts/TextractService.d.ts.map +1 -0
- package/dist/dts/TextractServiceConfig.d.ts +25 -0
- package/dist/dts/TextractServiceConfig.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/Errors.js +23 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/TextractClientInstance.js +23 -0
- package/dist/esm/TextractClientInstance.js.map +1 -0
- package/dist/esm/TextractService.js +54 -0
- package/dist/esm/TextractService.js.map +1 -0
- package/dist/esm/TextractServiceConfig.js +31 -0
- package/dist/esm/TextractServiceConfig.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/Errors.ts +65 -0
- package/src/TextractClientInstance.ts +33 -0
- package/src/TextractService.ts +685 -0
- package/src/TextractServiceConfig.ts +52 -0
- package/src/index.ts +44 -0
- package/CHANGELOG.md +0 -13
- package/docgen.json +0 -8
- package/lib/Errors.js +0 -26
- package/lib/TextractClientInstance.d.ts +0 -31
- package/lib/TextractClientInstance.js +0 -57
- package/lib/TextractClientInstanceConfig.d.ts +0 -23
- package/lib/TextractClientInstanceConfig.js +0 -44
- package/lib/TextractService.js +0 -113
- package/lib/esm/Errors.js +0 -23
- package/lib/esm/TextractClientInstance.js +0 -30
- package/lib/esm/TextractClientInstanceConfig.js +0 -40
- package/lib/esm/TextractService.js +0 -109
- 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
package/src/Errors.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccessDeniedException,
|
|
3
|
+
BadDocumentException,
|
|
4
|
+
ConflictException,
|
|
5
|
+
DocumentTooLargeException,
|
|
6
|
+
HumanLoopQuotaExceededException,
|
|
7
|
+
IdempotentParameterMismatchException,
|
|
8
|
+
InternalServerError as InternalServerException,
|
|
9
|
+
InvalidJobIdException,
|
|
10
|
+
InvalidKMSKeyException,
|
|
11
|
+
InvalidParameterException,
|
|
12
|
+
InvalidS3ObjectException,
|
|
13
|
+
LimitExceededException,
|
|
14
|
+
ProvisionedThroughputExceededException,
|
|
15
|
+
ResourceNotFoundException,
|
|
16
|
+
ServiceQuotaExceededException,
|
|
17
|
+
ThrottlingException,
|
|
18
|
+
UnsupportedDocumentException,
|
|
19
|
+
ValidationException,
|
|
20
|
+
} from "@aws-sdk/client-textract";
|
|
21
|
+
import type { TaggedException } from "@effect-aws/commons";
|
|
22
|
+
import { SdkError as CommonSdkError } from "@effect-aws/commons";
|
|
23
|
+
|
|
24
|
+
export const AllServiceErrors = [
|
|
25
|
+
"AccessDeniedException",
|
|
26
|
+
"BadDocumentException",
|
|
27
|
+
"ConflictException",
|
|
28
|
+
"DocumentTooLargeException",
|
|
29
|
+
"HumanLoopQuotaExceededException",
|
|
30
|
+
"IdempotentParameterMismatchException",
|
|
31
|
+
"InternalServerError",
|
|
32
|
+
"InvalidJobIdException",
|
|
33
|
+
"InvalidKMSKeyException",
|
|
34
|
+
"InvalidParameterException",
|
|
35
|
+
"InvalidS3ObjectException",
|
|
36
|
+
"LimitExceededException",
|
|
37
|
+
"ProvisionedThroughputExceededException",
|
|
38
|
+
"ResourceNotFoundException",
|
|
39
|
+
"ServiceQuotaExceededException",
|
|
40
|
+
"ThrottlingException",
|
|
41
|
+
"UnsupportedDocumentException",
|
|
42
|
+
"ValidationException",
|
|
43
|
+
] as const;
|
|
44
|
+
|
|
45
|
+
export type AccessDeniedError = TaggedException<AccessDeniedException>;
|
|
46
|
+
export type BadDocumentError = TaggedException<BadDocumentException>;
|
|
47
|
+
export type ConflictError = TaggedException<ConflictException>;
|
|
48
|
+
export type DocumentTooLargeError = TaggedException<DocumentTooLargeException>;
|
|
49
|
+
export type HumanLoopQuotaExceededError = TaggedException<HumanLoopQuotaExceededException>;
|
|
50
|
+
export type IdempotentParameterMismatchError = TaggedException<IdempotentParameterMismatchException>;
|
|
51
|
+
export type InternalServerError = TaggedException<InternalServerException>;
|
|
52
|
+
export type InvalidJobIdError = TaggedException<InvalidJobIdException>;
|
|
53
|
+
export type InvalidKMSKeyError = TaggedException<InvalidKMSKeyException>;
|
|
54
|
+
export type InvalidParameterError = TaggedException<InvalidParameterException>;
|
|
55
|
+
export type InvalidS3ObjectError = TaggedException<InvalidS3ObjectException>;
|
|
56
|
+
export type LimitExceededError = TaggedException<LimitExceededException>;
|
|
57
|
+
export type ProvisionedThroughputExceededError = TaggedException<ProvisionedThroughputExceededException>;
|
|
58
|
+
export type ResourceNotFoundError = TaggedException<ResourceNotFoundException>;
|
|
59
|
+
export type ServiceQuotaExceededError = TaggedException<ServiceQuotaExceededException>;
|
|
60
|
+
export type ThrottlingError = TaggedException<ThrottlingException>;
|
|
61
|
+
export type UnsupportedDocumentError = TaggedException<UnsupportedDocumentException>;
|
|
62
|
+
export type ValidationError = TaggedException<ValidationException>;
|
|
63
|
+
|
|
64
|
+
export type SdkError = CommonSdkError;
|
|
65
|
+
export const SdkError = CommonSdkError;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { TextractClient } from "@aws-sdk/client-textract";
|
|
5
|
+
import { Context, Effect, Layer } from "effect";
|
|
6
|
+
import * as TextractServiceConfig from "./TextractServiceConfig.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category tags
|
|
11
|
+
*/
|
|
12
|
+
export class TextractClientInstance extends Context.Tag(
|
|
13
|
+
"@effect-aws/client-textract/TextractClientInstance",
|
|
14
|
+
)<TextractClientInstance, TextractClient>() {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category constructors
|
|
19
|
+
*/
|
|
20
|
+
export const make = Effect.flatMap(
|
|
21
|
+
TextractServiceConfig.toTextractClientConfig,
|
|
22
|
+
(config) =>
|
|
23
|
+
Effect.acquireRelease(
|
|
24
|
+
Effect.sync(() => new TextractClient(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(TextractClientInstance, make);
|