@stacksjs/ts-cloud 0.1.3 → 0.1.5

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.
Files changed (187) hide show
  1. package/README.md +98 -13
  2. package/dist/aws/acm.d.ts +129 -0
  3. package/dist/aws/application-autoscaling.d.ts +282 -0
  4. package/dist/aws/bedrock.d.ts +2292 -0
  5. package/dist/aws/client.d.ts +79 -0
  6. package/dist/aws/cloudformation.d.ts +105 -0
  7. package/dist/aws/cloudfront.d.ts +265 -0
  8. package/dist/aws/cloudwatch-logs.d.ts +48 -0
  9. package/dist/aws/comprehend.d.ts +505 -0
  10. package/dist/aws/connect.d.ts +377 -0
  11. package/dist/aws/deploy-imap.d.ts +14 -0
  12. package/dist/aws/dynamodb.d.ts +176 -0
  13. package/dist/aws/ec2.d.ts +272 -0
  14. package/dist/aws/ecr.d.ts +149 -0
  15. package/dist/aws/ecs.d.ts +162 -0
  16. package/dist/aws/elasticache.d.ts +71 -0
  17. package/dist/aws/elbv2.d.ts +248 -0
  18. package/dist/aws/email.d.ts +175 -0
  19. package/dist/aws/eventbridge.d.ts +142 -0
  20. package/dist/aws/iam.d.ts +638 -0
  21. package/dist/aws/imap-server.d.ts +119 -0
  22. package/{src/aws/index.ts → dist/aws/index.d.ts} +62 -83
  23. package/{src/aws/kendra.ts → dist/aws/kendra.d.ts} +71 -386
  24. package/dist/aws/lambda.d.ts +232 -0
  25. package/dist/aws/opensearch.d.ts +87 -0
  26. package/dist/aws/personalize.d.ts +516 -0
  27. package/dist/aws/polly.d.ts +214 -0
  28. package/dist/aws/rds.d.ts +240 -0
  29. package/dist/aws/rekognition.d.ts +543 -0
  30. package/dist/aws/route53-domains.d.ts +113 -0
  31. package/dist/aws/route53.d.ts +215 -0
  32. package/dist/aws/s3.d.ts +212 -0
  33. package/dist/aws/scheduler.d.ts +140 -0
  34. package/dist/aws/secrets-manager.d.ts +170 -0
  35. package/dist/aws/ses.d.ts +288 -0
  36. package/dist/aws/setup-phone.d.ts +0 -0
  37. package/dist/aws/setup-sms.d.ts +115 -0
  38. package/dist/aws/sms.d.ts +304 -0
  39. package/dist/aws/smtp-server.d.ts +61 -0
  40. package/dist/aws/sns.d.ts +117 -0
  41. package/dist/aws/sqs.d.ts +65 -0
  42. package/dist/aws/ssm.d.ts +179 -0
  43. package/dist/aws/sts.d.ts +15 -0
  44. package/dist/aws/support.d.ts +104 -0
  45. package/dist/aws/test-imap.d.ts +0 -0
  46. package/dist/aws/textract.d.ts +403 -0
  47. package/dist/aws/transcribe.d.ts +60 -0
  48. package/dist/aws/translate.d.ts +358 -0
  49. package/dist/aws/voice.d.ts +219 -0
  50. package/dist/bin/cli.js +1724 -0
  51. package/dist/config.d.ts +7 -0
  52. package/dist/deploy/index.d.ts +2 -0
  53. package/dist/deploy/static-site-external-dns.d.ts +51 -0
  54. package/dist/deploy/static-site.d.ts +71 -0
  55. package/dist/dns/cloudflare.d.ts +52 -0
  56. package/dist/dns/godaddy.d.ts +38 -0
  57. package/dist/dns/index.d.ts +45 -0
  58. package/dist/dns/porkbun.d.ts +18 -0
  59. package/dist/dns/route53-adapter.d.ts +38 -0
  60. package/{src/dns/types.ts → dist/dns/types.d.ts} +26 -63
  61. package/dist/dns/validator.d.ts +78 -0
  62. package/dist/generators/index.d.ts +1 -0
  63. package/dist/generators/infrastructure.d.ts +30 -0
  64. package/{src/index.ts → dist/index.d.ts} +70 -93
  65. package/dist/index.js +7881 -0
  66. package/dist/push/apns.d.ts +60 -0
  67. package/dist/push/fcm.d.ts +117 -0
  68. package/dist/push/index.d.ts +14 -0
  69. package/dist/security/pre-deploy-scanner.d.ts +69 -0
  70. package/dist/ssl/acme-client.d.ts +67 -0
  71. package/dist/ssl/index.d.ts +2 -0
  72. package/dist/ssl/letsencrypt.d.ts +48 -0
  73. package/dist/types.d.ts +1 -0
  74. package/dist/utils/cli.d.ts +123 -0
  75. package/dist/validation/index.d.ts +1 -0
  76. package/dist/validation/template.d.ts +23 -0
  77. package/package.json +8 -8
  78. package/bin/cli.ts +0 -133
  79. package/bin/commands/analytics.ts +0 -328
  80. package/bin/commands/api.ts +0 -379
  81. package/bin/commands/assets.ts +0 -221
  82. package/bin/commands/audit.ts +0 -501
  83. package/bin/commands/backup.ts +0 -682
  84. package/bin/commands/cache.ts +0 -294
  85. package/bin/commands/cdn.ts +0 -281
  86. package/bin/commands/config.ts +0 -202
  87. package/bin/commands/container.ts +0 -105
  88. package/bin/commands/cost.ts +0 -208
  89. package/bin/commands/database.ts +0 -401
  90. package/bin/commands/deploy.ts +0 -674
  91. package/bin/commands/domain.ts +0 -397
  92. package/bin/commands/email.ts +0 -423
  93. package/bin/commands/environment.ts +0 -285
  94. package/bin/commands/events.ts +0 -424
  95. package/bin/commands/firewall.ts +0 -145
  96. package/bin/commands/function.ts +0 -116
  97. package/bin/commands/generate.ts +0 -280
  98. package/bin/commands/git.ts +0 -139
  99. package/bin/commands/iam.ts +0 -464
  100. package/bin/commands/index.ts +0 -48
  101. package/bin/commands/init.ts +0 -120
  102. package/bin/commands/logs.ts +0 -148
  103. package/bin/commands/network.ts +0 -579
  104. package/bin/commands/notify.ts +0 -489
  105. package/bin/commands/queue.ts +0 -407
  106. package/bin/commands/scheduler.ts +0 -370
  107. package/bin/commands/secrets.ts +0 -54
  108. package/bin/commands/server.ts +0 -629
  109. package/bin/commands/shared.ts +0 -97
  110. package/bin/commands/ssl.ts +0 -138
  111. package/bin/commands/stack.ts +0 -325
  112. package/bin/commands/status.ts +0 -385
  113. package/bin/commands/storage.ts +0 -450
  114. package/bin/commands/team.ts +0 -96
  115. package/bin/commands/tunnel.ts +0 -489
  116. package/bin/commands/utils.ts +0 -202
  117. package/build.ts +0 -15
  118. package/cloud +0 -2
  119. package/src/aws/acm.ts +0 -768
  120. package/src/aws/application-autoscaling.ts +0 -845
  121. package/src/aws/bedrock.ts +0 -4074
  122. package/src/aws/client.ts +0 -878
  123. package/src/aws/cloudformation.ts +0 -896
  124. package/src/aws/cloudfront.ts +0 -1531
  125. package/src/aws/cloudwatch-logs.ts +0 -154
  126. package/src/aws/comprehend.ts +0 -839
  127. package/src/aws/connect.ts +0 -1056
  128. package/src/aws/deploy-imap.ts +0 -384
  129. package/src/aws/dynamodb.ts +0 -340
  130. package/src/aws/ec2.ts +0 -1385
  131. package/src/aws/ecr.ts +0 -621
  132. package/src/aws/ecs.ts +0 -615
  133. package/src/aws/elasticache.ts +0 -301
  134. package/src/aws/elbv2.ts +0 -942
  135. package/src/aws/email.ts +0 -928
  136. package/src/aws/eventbridge.ts +0 -248
  137. package/src/aws/iam.ts +0 -1689
  138. package/src/aws/imap-server.ts +0 -2100
  139. package/src/aws/lambda.ts +0 -786
  140. package/src/aws/opensearch.ts +0 -158
  141. package/src/aws/personalize.ts +0 -977
  142. package/src/aws/polly.ts +0 -559
  143. package/src/aws/rds.ts +0 -888
  144. package/src/aws/rekognition.ts +0 -846
  145. package/src/aws/route53-domains.ts +0 -359
  146. package/src/aws/route53.ts +0 -1046
  147. package/src/aws/s3.ts +0 -2318
  148. package/src/aws/scheduler.ts +0 -571
  149. package/src/aws/secrets-manager.ts +0 -769
  150. package/src/aws/ses.ts +0 -1081
  151. package/src/aws/setup-phone.ts +0 -104
  152. package/src/aws/setup-sms.ts +0 -580
  153. package/src/aws/sms.ts +0 -1735
  154. package/src/aws/smtp-server.ts +0 -531
  155. package/src/aws/sns.ts +0 -758
  156. package/src/aws/sqs.ts +0 -382
  157. package/src/aws/ssm.ts +0 -807
  158. package/src/aws/sts.ts +0 -92
  159. package/src/aws/support.ts +0 -391
  160. package/src/aws/test-imap.ts +0 -86
  161. package/src/aws/textract.ts +0 -780
  162. package/src/aws/transcribe.ts +0 -108
  163. package/src/aws/translate.ts +0 -641
  164. package/src/aws/voice.ts +0 -1379
  165. package/src/config.ts +0 -35
  166. package/src/deploy/index.ts +0 -7
  167. package/src/deploy/static-site-external-dns.ts +0 -906
  168. package/src/deploy/static-site.ts +0 -1125
  169. package/src/dns/godaddy.ts +0 -412
  170. package/src/dns/index.ts +0 -183
  171. package/src/dns/porkbun.ts +0 -362
  172. package/src/dns/route53-adapter.ts +0 -414
  173. package/src/dns/validator.ts +0 -369
  174. package/src/generators/index.ts +0 -5
  175. package/src/generators/infrastructure.ts +0 -1660
  176. package/src/push/apns.ts +0 -452
  177. package/src/push/fcm.ts +0 -506
  178. package/src/push/index.ts +0 -58
  179. package/src/ssl/acme-client.ts +0 -478
  180. package/src/ssl/index.ts +0 -7
  181. package/src/ssl/letsencrypt.ts +0 -747
  182. package/src/types.ts +0 -2
  183. package/src/utils/cli.ts +0 -398
  184. package/src/validation/index.ts +0 -5
  185. package/src/validation/template.ts +0 -405
  186. package/test/index.test.ts +0 -128
  187. package/tsconfig.json +0 -18
@@ -0,0 +1,179 @@
1
+ import { AWSClient } from './client';
2
+ export declare interface Parameter {
3
+ Name?: string
4
+ Type?: 'String' | 'StringList' | 'SecureString'
5
+ Value?: string
6
+ Version?: number
7
+ LastModifiedDate?: string
8
+ ARN?: string
9
+ DataType?: string
10
+ Description?: string
11
+ AllowedPattern?: string
12
+ KeyId?: string
13
+ Tier?: 'Standard' | 'Advanced' | 'Intelligent-Tiering'
14
+ }
15
+ export declare interface ParameterHistory {
16
+ Name?: string
17
+ Type?: 'String' | 'StringList' | 'SecureString'
18
+ KeyId?: string
19
+ LastModifiedDate?: string
20
+ LastModifiedUser?: string
21
+ Description?: string
22
+ Value?: string
23
+ Version?: number
24
+ Labels?: string[]
25
+ Tier?: string
26
+ }
27
+ export declare interface PutParameterOptions {
28
+ Name: string
29
+ Value: string
30
+ Type?: 'String' | 'StringList' | 'SecureString'
31
+ Description?: string
32
+ KeyId?: string
33
+ Overwrite?: boolean
34
+ AllowedPattern?: string
35
+ Tags?: { Key: string, Value: string }[]
36
+ Tier?: 'Standard' | 'Advanced' | 'Intelligent-Tiering'
37
+ DataType?: string
38
+ }
39
+ export declare interface GetParameterOptions {
40
+ Name: string
41
+ WithDecryption?: boolean
42
+ }
43
+ export declare interface GetParametersOptions {
44
+ Names: string[]
45
+ WithDecryption?: boolean
46
+ }
47
+ export declare interface GetParametersByPathOptions {
48
+ Path: string
49
+ Recursive?: boolean
50
+ WithDecryption?: boolean
51
+ MaxResults?: number
52
+ NextToken?: string
53
+ ParameterFilters?: {
54
+ Key: string
55
+ Option?: string
56
+ Values?: string[]
57
+ }[]
58
+ }
59
+ export declare interface DeleteParameterOptions {
60
+ Name: string
61
+ }
62
+ /**
63
+ * SSM Parameter Store client using direct API calls
64
+ */
65
+ export declare class SSMClient {
66
+ private client: AWSClient;
67
+ private region: string;
68
+ constructor(region?: string, profile?: string);
69
+ putParameter(options: PutParameterOptions): Promise<{
70
+ Version?: number
71
+ Tier?: string
72
+ }>;
73
+ getParameter(options: GetParameterOptions): Promise<{
74
+ Parameter?: Parameter
75
+ }>;
76
+ getParameters(options: GetParametersOptions): Promise<{
77
+ Parameters?: Parameter[]
78
+ InvalidParameters?: string[]
79
+ }>;
80
+ getParametersByPath(options: GetParametersByPathOptions): Promise<{
81
+ Parameters?: Parameter[]
82
+ NextToken?: string
83
+ }>;
84
+ deleteParameter(options: DeleteParameterOptions): Promise<void>;
85
+ deleteParameters(names: string[]): Promise<{
86
+ DeletedParameters?: string[]
87
+ InvalidParameters?: string[]
88
+ }>;
89
+ describeParameters(options?: {
90
+ Filters?: { Key: string, Values: string[] }[]
91
+ ParameterFilters?: { Key: string, Option?: string, Values?: string[] }[]
92
+ MaxResults?: number
93
+ NextToken?: string
94
+ }): Promise<{
95
+ Parameters?: Parameter[]
96
+ NextToken?: string
97
+ }>;
98
+ getParameterHistory(options: {
99
+ Name: string
100
+ WithDecryption?: boolean
101
+ MaxResults?: number
102
+ NextToken?: string
103
+ }): Promise<{
104
+ Parameters?: ParameterHistory[]
105
+ NextToken?: string
106
+ }>;
107
+ labelParameterVersion(options: {
108
+ Name: string
109
+ ParameterVersion?: number
110
+ Labels: string[]
111
+ }): Promise<{
112
+ InvalidLabels?: string[]
113
+ ParameterVersion?: number
114
+ }>;
115
+ addTagsToResource(options: {
116
+ ResourceType: 'Parameter'
117
+ ResourceId: string
118
+ Tags: { Key: string, Value: string }[]
119
+ }): Promise<void>;
120
+ removeTagsFromResource(options: {
121
+ ResourceType: 'Parameter'
122
+ ResourceId: string
123
+ TagKeys: string[]
124
+ }): Promise<void>;
125
+ listTagsForResource(options: {
126
+ ResourceType: 'Parameter'
127
+ ResourceId: string
128
+ }): Promise<{
129
+ TagList?: { Key: string, Value: string }[]
130
+ }>;
131
+ setString(name: string, value: string, options?: {
132
+ description?: string
133
+ overwrite?: boolean
134
+ tags?: { Key: string, Value: string }[]
135
+ }): Promise<{ Version?: number }>;
136
+ setSecureString(name: string, value: string, options?: {
137
+ description?: string
138
+ overwrite?: boolean
139
+ kmsKeyId?: string
140
+ tags?: { Key: string, Value: string }[]
141
+ }): Promise<{ Version?: number }>;
142
+ getValue(name: string): Promise<string | undefined>;
143
+ getAllByPath(path: string, recursive?: boolean): Promise<Parameter[]>;
144
+ private parseParameter(p: any): Parameter;
145
+ sendCommand(options: {
146
+ InstanceIds: string[]
147
+ DocumentName: string
148
+ Parameters?: Record<string, string[]>
149
+ TimeoutSeconds?: number
150
+ Comment?: string
151
+ OutputS3BucketName?: string
152
+ OutputS3KeyPrefix?: string
153
+ }): Promise<{
154
+ CommandId?: string
155
+ Status?: string
156
+ StatusDetails?: string
157
+ }>;
158
+ getCommandInvocation(options: {
159
+ CommandId: string
160
+ InstanceId: string
161
+ }): Promise<{
162
+ Status?: string
163
+ StatusDetails?: string
164
+ StandardOutputContent?: string
165
+ StandardErrorContent?: string
166
+ ResponseCode?: number
167
+ }>;
168
+ runShellCommand(instanceId: string, commands: string[], options?: {
169
+ timeoutSeconds?: number
170
+ waitForCompletion?: boolean
171
+ pollIntervalMs?: number
172
+ maxWaitMs?: number
173
+ }): Promise<{
174
+ success: boolean
175
+ output?: string
176
+ error?: string
177
+ status?: string
178
+ }>;
179
+ }
@@ -0,0 +1,15 @@
1
+ import { AWSClient } from './client';
2
+ export declare interface CallerIdentity {
3
+ UserId?: string
4
+ Account?: string
5
+ Arn?: string
6
+ }
7
+ /**
8
+ * STS (Security Token Service) management using direct API calls
9
+ */
10
+ export declare class STSClient {
11
+ private client: AWSClient;
12
+ private region: string;
13
+ constructor(region?: string, profile?: string);
14
+ getCallerIdentity(): Promise<CallerIdentity>;
15
+ }
@@ -0,0 +1,104 @@
1
+ import { AWSClient } from './client';
2
+ /**
3
+ * Pre-built support case templates for common requests
4
+ */
5
+ export declare const SupportTemplates: {
6
+ /**
7
+ * Request to exit SMS sandbox
8
+ */
9
+ smsSandboxExit: (params: SmsSandboxExitParams) => any;
10
+ /**
11
+ * Request to increase SMS spending limit
12
+ */
13
+ smsSpendLimitIncrease: (params: SmsSpendLimitIncreaseParams) => any;
14
+ /**
15
+ * Request SES production access (exit sandbox)
16
+ */
17
+ sesSandboxExit: (params: SesSandboxExitParams) => any;
18
+ /**
19
+ * Request Connect phone number limit increase
20
+ */
21
+ connectPhoneNumberIncrease: (params: ConnectPhoneNumberIncreaseParams) => any
22
+ };
23
+ export declare interface SupportCase {
24
+ caseId?: string
25
+ displayId?: string
26
+ subject?: string
27
+ status?: string
28
+ serviceCode?: string
29
+ categoryCode?: string
30
+ severityCode?: string
31
+ submittedBy?: string
32
+ timeCreated?: string
33
+ recentCommunications?: {
34
+ communications?: Array<{
35
+ body?: string
36
+ submittedBy?: string
37
+ timeCreated?: string
38
+ }>
39
+ }
40
+ }
41
+ export declare interface CreateCaseParams {
42
+ subject: string
43
+ communicationBody: string
44
+ serviceCode: string
45
+ categoryCode: string
46
+ severityCode?: 'low' | 'normal' | 'high' | 'urgent' | 'critical'
47
+ ccEmailAddresses?: string[]
48
+ language?: string
49
+ issueType?: 'customer-service' | 'technical'
50
+ attachmentSetId?: string
51
+ }
52
+ export declare interface SupportService {
53
+ code: string
54
+ name: string
55
+ categories?: Array<{
56
+ code: string
57
+ name: string
58
+ }>
59
+ }
60
+ export declare interface SmsSandboxExitParams {
61
+ companyName: string
62
+ useCase: string
63
+ expectedMonthlyVolume: number
64
+ websiteUrl?: string
65
+ }
66
+ export declare interface SmsSpendLimitIncreaseParams {
67
+ companyName: string
68
+ currentLimit: number
69
+ requestedLimit: number
70
+ useCase: string
71
+ }
72
+ export declare interface SesSandboxExitParams {
73
+ companyName: string
74
+ websiteUrl: string
75
+ useCase: string
76
+ expectedDailyVolume: number
77
+ }
78
+ export declare interface ConnectPhoneNumberIncreaseParams {
79
+ companyName: string
80
+ instanceId: string
81
+ currentLimit: number
82
+ requestedLimit: number
83
+ useCase: string
84
+ }
85
+ /**
86
+ * AWS Support client for creating and managing support cases
87
+ */
88
+ export declare class SupportClient {
89
+ private client: AWSClient;
90
+ private region: string;
91
+ constructor(region?: string);
92
+ createCase(params: CreateCaseParams): Promise<{ caseId?: string }>;
93
+ describeCase(caseId: string): Promise<SupportCase | null>;
94
+ listCases(options?: {
95
+ includeResolved?: boolean
96
+ maxResults?: number
97
+ nextToken?: string
98
+ }): Promise<{ cases: SupportCase[], nextToken?: string }>;
99
+ addCommunication(caseId: string, message: string, ccEmailAddresses?: string[]): Promise<boolean>;
100
+ resolveCase(caseId: string): Promise<{ initialCaseStatus?: string, finalCaseStatus?: string }>;
101
+ describeServices(serviceCodeList?: string[]): Promise<SupportService[]>;
102
+ describeSeverityLevels(): Promise<Array<{ code: string, name: string }>>;
103
+ }
104
+ export default SupportClient;
File without changes
@@ -0,0 +1,403 @@
1
+ import { AWSClient } from './client';
2
+ /**
3
+ * Quick text extraction from S3 document
4
+ */
5
+ export declare function extractTextFromS3(bucket: string, key: string, region?: string): Promise<string>;
6
+ /**
7
+ * Quick form extraction from S3 document
8
+ */
9
+ export declare function extractFormsFromS3(bucket: string, key: string, region?: string): Promise<Record<string, string>>;
10
+ /**
11
+ * Quick table extraction from S3 document
12
+ */
13
+ export declare function extractTablesFromS3(bucket: string, key: string, region?: string): Promise<string[][][]>;
14
+ // ============================================================================
15
+ // Types
16
+ // ============================================================================
17
+ export declare interface S3Object {
18
+ Bucket?: string
19
+ Name?: string
20
+ Version?: string
21
+ }
22
+ export declare interface Document {
23
+ Bytes?: Uint8Array
24
+ S3Object?: S3Object
25
+ }
26
+ export declare interface BoundingBox {
27
+ Width?: number
28
+ Height?: number
29
+ Left?: number
30
+ Top?: number
31
+ }
32
+ export declare interface Point {
33
+ X?: number
34
+ Y?: number
35
+ }
36
+ export declare interface Geometry {
37
+ BoundingBox?: BoundingBox
38
+ Polygon?: Point[]
39
+ }
40
+ export declare interface Relationship {
41
+ Type?: 'VALUE' | 'CHILD' | 'COMPLEX_FEATURES' | 'MERGED_CELL' | 'TITLE' | 'ANSWER' | 'TABLE' | 'TABLE_TITLE' | 'TABLE_FOOTER'
42
+ Ids?: string[]
43
+ }
44
+ export declare interface Block {
45
+ BlockType?: 'KEY_VALUE_SET' | 'PAGE' | 'LINE' | 'WORD' | 'TABLE' | 'CELL' | 'SELECTION_ELEMENT' | 'MERGED_CELL' | 'TITLE' | 'QUERY' | 'QUERY_RESULT' | 'SIGNATURE' | 'TABLE_TITLE' | 'TABLE_FOOTER' | 'LAYOUT_TEXT' | 'LAYOUT_TITLE' | 'LAYOUT_HEADER' | 'LAYOUT_FOOTER' | 'LAYOUT_SECTION_HEADER' | 'LAYOUT_PAGE_NUMBER' | 'LAYOUT_LIST' | 'LAYOUT_FIGURE' | 'LAYOUT_TABLE' | 'LAYOUT_KEY_VALUE'
46
+ Confidence?: number
47
+ Text?: string
48
+ TextType?: 'HANDWRITING' | 'PRINTED'
49
+ RowIndex?: number
50
+ ColumnIndex?: number
51
+ RowSpan?: number
52
+ ColumnSpan?: number
53
+ Geometry?: Geometry
54
+ Id?: string
55
+ Relationships?: Relationship[]
56
+ EntityTypes?: ('KEY' | 'VALUE' | 'COLUMN_HEADER' | 'TABLE_TITLE' | 'TABLE_FOOTER' | 'TABLE_SECTION_TITLE' | 'TABLE_SUMMARY' | 'STRUCTURED_TABLE' | 'SEMI_STRUCTURED_TABLE')[]
57
+ SelectionStatus?: 'SELECTED' | 'NOT_SELECTED'
58
+ Page?: number
59
+ Query?: {
60
+ Text: string
61
+ Alias?: string
62
+ Pages?: string[]
63
+ }
64
+ }
65
+ export declare interface DocumentMetadata {
66
+ Pages?: number
67
+ }
68
+ export declare interface Warning {
69
+ ErrorCode?: string
70
+ Pages?: number[]
71
+ }
72
+ export declare interface DetectDocumentTextCommandInput {
73
+ Document: Document
74
+ }
75
+ export declare interface DetectDocumentTextCommandOutput {
76
+ DocumentMetadata?: DocumentMetadata
77
+ Blocks?: Block[]
78
+ DetectDocumentTextModelVersion?: string
79
+ }
80
+ export declare interface AnalyzeDocumentCommandInput {
81
+ Document: Document
82
+ FeatureTypes: ('TABLES' | 'FORMS' | 'QUERIES' | 'SIGNATURES' | 'LAYOUT')[]
83
+ HumanLoopConfig?: {
84
+ HumanLoopName: string
85
+ FlowDefinitionArn: string
86
+ DataAttributes?: {
87
+ ContentClassifiers?: ('FreeOfPersonallyIdentifiableInformation' | 'FreeOfAdultContent')[]
88
+ }
89
+ }
90
+ QueriesConfig?: {
91
+ Queries: Array<{
92
+ Text: string
93
+ Alias?: string
94
+ Pages?: string[]
95
+ }>
96
+ }
97
+ AdaptersConfig?: {
98
+ Adapters: Array<{
99
+ AdapterId: string
100
+ Pages?: string[]
101
+ Version: string
102
+ }>
103
+ }
104
+ }
105
+ export declare interface AnalyzeDocumentCommandOutput {
106
+ DocumentMetadata?: DocumentMetadata
107
+ Blocks?: Block[]
108
+ HumanLoopActivationOutput?: {
109
+ HumanLoopArn?: string
110
+ HumanLoopActivationReasons?: string[]
111
+ HumanLoopActivationConditionsEvaluationResults?: string
112
+ }
113
+ AnalyzeDocumentModelVersion?: string
114
+ }
115
+ export declare interface AnalyzeExpenseCommandInput {
116
+ Document: Document
117
+ }
118
+ export declare interface ExpenseField {
119
+ Type?: {
120
+ Text?: string
121
+ Confidence?: number
122
+ }
123
+ LabelDetection?: {
124
+ Text?: string
125
+ Geometry?: Geometry
126
+ Confidence?: number
127
+ }
128
+ ValueDetection?: {
129
+ Text?: string
130
+ Geometry?: Geometry
131
+ Confidence?: number
132
+ }
133
+ PageNumber?: number
134
+ Currency?: {
135
+ Code?: string
136
+ Confidence?: number
137
+ }
138
+ GroupProperties?: Array<{
139
+ Types?: string[]
140
+ Id?: string
141
+ }>
142
+ }
143
+ export declare interface LineItemGroup {
144
+ LineItemGroupIndex?: number
145
+ LineItems?: Array<{
146
+ LineItemExpenseFields?: ExpenseField[]
147
+ }>
148
+ }
149
+ export declare interface ExpenseDocument {
150
+ ExpenseIndex?: number
151
+ SummaryFields?: ExpenseField[]
152
+ LineItemGroups?: LineItemGroup[]
153
+ Blocks?: Block[]
154
+ }
155
+ export declare interface AnalyzeExpenseCommandOutput {
156
+ DocumentMetadata?: DocumentMetadata
157
+ ExpenseDocuments?: ExpenseDocument[]
158
+ }
159
+ export declare interface AnalyzeIDCommandInput {
160
+ DocumentPages: Document[]
161
+ }
162
+ export declare interface IdentityDocument {
163
+ DocumentIndex?: number
164
+ IdentityDocumentFields?: Array<{
165
+ Type?: {
166
+ Text?: string
167
+ Confidence?: number
168
+ }
169
+ ValueDetection?: {
170
+ Text?: string
171
+ NormalizedValue?: {
172
+ Value?: string
173
+ ValueType?: 'DATE'
174
+ }
175
+ Confidence?: number
176
+ }
177
+ }>
178
+ Blocks?: Block[]
179
+ }
180
+ export declare interface AnalyzeIDCommandOutput {
181
+ IdentityDocuments?: IdentityDocument[]
182
+ DocumentMetadata?: DocumentMetadata
183
+ AnalyzeIDModelVersion?: string
184
+ }
185
+ export declare interface StartDocumentTextDetectionCommandInput {
186
+ DocumentLocation: {
187
+ S3Object?: S3Object
188
+ }
189
+ ClientRequestToken?: string
190
+ JobTag?: string
191
+ NotificationChannel?: {
192
+ SNSTopicArn: string
193
+ RoleArn: string
194
+ }
195
+ OutputConfig?: {
196
+ S3Bucket: string
197
+ S3Prefix?: string
198
+ }
199
+ KMSKeyId?: string
200
+ }
201
+ export declare interface StartDocumentTextDetectionCommandOutput {
202
+ JobId?: string
203
+ }
204
+ export declare interface GetDocumentTextDetectionCommandInput {
205
+ JobId: string
206
+ MaxResults?: number
207
+ NextToken?: string
208
+ }
209
+ export declare interface GetDocumentTextDetectionCommandOutput {
210
+ DocumentMetadata?: DocumentMetadata
211
+ JobStatus?: 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'PARTIAL_SUCCESS'
212
+ NextToken?: string
213
+ Blocks?: Block[]
214
+ Warnings?: Warning[]
215
+ StatusMessage?: string
216
+ DetectDocumentTextModelVersion?: string
217
+ }
218
+ export declare interface StartDocumentAnalysisCommandInput {
219
+ DocumentLocation: {
220
+ S3Object?: S3Object
221
+ }
222
+ FeatureTypes: ('TABLES' | 'FORMS' | 'QUERIES' | 'SIGNATURES' | 'LAYOUT')[]
223
+ ClientRequestToken?: string
224
+ JobTag?: string
225
+ NotificationChannel?: {
226
+ SNSTopicArn: string
227
+ RoleArn: string
228
+ }
229
+ OutputConfig?: {
230
+ S3Bucket: string
231
+ S3Prefix?: string
232
+ }
233
+ KMSKeyId?: string
234
+ QueriesConfig?: {
235
+ Queries: Array<{
236
+ Text: string
237
+ Alias?: string
238
+ Pages?: string[]
239
+ }>
240
+ }
241
+ AdaptersConfig?: {
242
+ Adapters: Array<{
243
+ AdapterId: string
244
+ Pages?: string[]
245
+ Version: string
246
+ }>
247
+ }
248
+ }
249
+ export declare interface StartDocumentAnalysisCommandOutput {
250
+ JobId?: string
251
+ }
252
+ export declare interface GetDocumentAnalysisCommandInput {
253
+ JobId: string
254
+ MaxResults?: number
255
+ NextToken?: string
256
+ }
257
+ export declare interface GetDocumentAnalysisCommandOutput {
258
+ DocumentMetadata?: DocumentMetadata
259
+ JobStatus?: 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'PARTIAL_SUCCESS'
260
+ NextToken?: string
261
+ Blocks?: Block[]
262
+ Warnings?: Warning[]
263
+ StatusMessage?: string
264
+ AnalyzeDocumentModelVersion?: string
265
+ }
266
+ export declare interface StartExpenseAnalysisCommandInput {
267
+ DocumentLocation: {
268
+ S3Object?: S3Object
269
+ }
270
+ ClientRequestToken?: string
271
+ JobTag?: string
272
+ NotificationChannel?: {
273
+ SNSTopicArn: string
274
+ RoleArn: string
275
+ }
276
+ OutputConfig?: {
277
+ S3Bucket: string
278
+ S3Prefix?: string
279
+ }
280
+ KMSKeyId?: string
281
+ }
282
+ export declare interface StartExpenseAnalysisCommandOutput {
283
+ JobId?: string
284
+ }
285
+ export declare interface GetExpenseAnalysisCommandInput {
286
+ JobId: string
287
+ MaxResults?: number
288
+ NextToken?: string
289
+ }
290
+ export declare interface GetExpenseAnalysisCommandOutput {
291
+ DocumentMetadata?: DocumentMetadata
292
+ JobStatus?: 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'PARTIAL_SUCCESS'
293
+ NextToken?: string
294
+ ExpenseDocuments?: ExpenseDocument[]
295
+ Warnings?: Warning[]
296
+ StatusMessage?: string
297
+ AnalyzeExpenseModelVersion?: string
298
+ }
299
+ export declare interface StartLendingAnalysisCommandInput {
300
+ DocumentLocation: {
301
+ S3Object?: S3Object
302
+ }
303
+ ClientRequestToken?: string
304
+ JobTag?: string
305
+ NotificationChannel?: {
306
+ SNSTopicArn: string
307
+ RoleArn: string
308
+ }
309
+ OutputConfig?: {
310
+ S3Bucket: string
311
+ S3Prefix?: string
312
+ }
313
+ KMSKeyId?: string
314
+ }
315
+ export declare interface StartLendingAnalysisCommandOutput {
316
+ JobId?: string
317
+ }
318
+ export declare interface GetLendingAnalysisCommandInput {
319
+ JobId: string
320
+ MaxResults?: number
321
+ NextToken?: string
322
+ }
323
+ export declare interface LendingDocument {
324
+ LendingFields?: Array<{
325
+ Type?: string
326
+ KeyDetection?: {
327
+ Text?: string
328
+ Geometry?: Geometry
329
+ Confidence?: number
330
+ }
331
+ ValueDetections?: Array<{
332
+ Text?: string
333
+ Geometry?: Geometry
334
+ Confidence?: number
335
+ SelectionStatus?: 'SELECTED' | 'NOT_SELECTED'
336
+ }>
337
+ }>
338
+ SignatureDetections?: Array<{
339
+ Confidence?: number
340
+ Geometry?: Geometry
341
+ }>
342
+ }
343
+ export declare interface LendingResult {
344
+ Page?: number
345
+ PageClassification?: {
346
+ PageType?: Array<{
347
+ Value?: string
348
+ Confidence?: number
349
+ }>
350
+ PageNumber?: Array<{
351
+ Value?: string
352
+ Confidence?: number
353
+ }>
354
+ }
355
+ Extractions?: Array<{
356
+ LendingDocument?: LendingDocument
357
+ ExpenseDocument?: ExpenseDocument
358
+ IdentityDocument?: IdentityDocument
359
+ }>
360
+ }
361
+ export declare interface GetLendingAnalysisCommandOutput {
362
+ DocumentMetadata?: DocumentMetadata
363
+ JobStatus?: 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'PARTIAL_SUCCESS'
364
+ NextToken?: string
365
+ Results?: LendingResult[]
366
+ Warnings?: Warning[]
367
+ StatusMessage?: string
368
+ AnalyzeLendingModelVersion?: string
369
+ }
370
+ // ============================================================================
371
+ // Textract Client
372
+ // ============================================================================
373
+ export declare class TextractClient {
374
+ private client: AWSClient;
375
+ private region: string;
376
+ constructor(region?: string);
377
+ private request<T>(action: string, params: Record<string, unknown>): Promise<T>;
378
+ detectDocumentText(params: DetectDocumentTextCommandInput): Promise<DetectDocumentTextCommandOutput>;
379
+ analyzeDocument(params: AnalyzeDocumentCommandInput): Promise<AnalyzeDocumentCommandOutput>;
380
+ analyzeExpense(params: AnalyzeExpenseCommandInput): Promise<AnalyzeExpenseCommandOutput>;
381
+ analyzeID(params: AnalyzeIDCommandInput): Promise<AnalyzeIDCommandOutput>;
382
+ startDocumentTextDetection(params: StartDocumentTextDetectionCommandInput): Promise<StartDocumentTextDetectionCommandOutput>;
383
+ getDocumentTextDetection(params: GetDocumentTextDetectionCommandInput): Promise<GetDocumentTextDetectionCommandOutput>;
384
+ startDocumentAnalysis(params: StartDocumentAnalysisCommandInput): Promise<StartDocumentAnalysisCommandOutput>;
385
+ getDocumentAnalysis(params: GetDocumentAnalysisCommandInput): Promise<GetDocumentAnalysisCommandOutput>;
386
+ startExpenseAnalysis(params: StartExpenseAnalysisCommandInput): Promise<StartExpenseAnalysisCommandOutput>;
387
+ getExpenseAnalysis(params: GetExpenseAnalysisCommandInput): Promise<GetExpenseAnalysisCommandOutput>;
388
+ startLendingAnalysis(params: StartLendingAnalysisCommandInput): Promise<StartLendingAnalysisCommandOutput>;
389
+ getLendingAnalysis(params: GetLendingAnalysisCommandInput): Promise<GetLendingAnalysisCommandOutput>;
390
+ extractText(document: Document): Promise<string[]>;
391
+ extractTextFromS3(bucket: string, key: string): Promise<string[]>;
392
+ extractForms(document: Document): Promise<Array<{ key: string; value: string; confidence: number }>>;
393
+ extractTables(document: Document): Promise<Array<{ rows: string[][] }>>;
394
+ extractExpenseSummary(document: Document): Promise<{
395
+ vendor?: string
396
+ total?: string
397
+ date?: string
398
+ items: Array<{ description?: string; quantity?: string; price?: string }>
399
+ }>;
400
+ queryDocument(document: Document, questions: string[]): Promise<Array<{ question: string; answer: string; confidence: number }>>;
401
+ waitForJob(jobId: string, getJob: (jobId: string) => Promise<{ JobStatus?: string }>, options?: { maxWaitMs?: number; pollIntervalMs?: number }): Promise<void>;
402
+ private getBlockText(block: Block, blockMap: Map<string, Block>): string;
403
+ }