@anvil-cloud/sdk 0.0.14 → 0.0.15

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 (56) hide show
  1. package/aws/cognitoAuth.ts +70 -0
  2. package/aws/cognitoUserPool.ts +132 -0
  3. package/aws/dynamoDB.ts +176 -0
  4. package/aws/eventBus.ts +91 -0
  5. package/aws/httpApi.ts +108 -0
  6. package/aws/index.ts +49 -0
  7. package/aws/lambda.ts +1 -1
  8. package/aws/oauthAuthorizer.ts +70 -0
  9. package/aws/queue.ts +156 -0
  10. package/aws/svelteKitSite.ts +14 -0
  11. package/aws/vpcEndpoint.ts +9 -4
  12. package/bin/aws/cognitoAuth.d.ts +36 -0
  13. package/bin/aws/cognitoAuth.js +53 -0
  14. package/bin/aws/cognitoAuth.js.map +1 -0
  15. package/bin/aws/cognitoUserPool.d.ts +82 -0
  16. package/bin/aws/cognitoUserPool.js +65 -0
  17. package/bin/aws/cognitoUserPool.js.map +1 -0
  18. package/bin/aws/dynamoDB.d.ts +115 -0
  19. package/bin/aws/dynamoDB.js +121 -0
  20. package/bin/aws/dynamoDB.js.map +1 -0
  21. package/bin/aws/eventBus.d.ts +47 -0
  22. package/bin/aws/eventBus.js +63 -0
  23. package/bin/aws/eventBus.js.map +1 -0
  24. package/bin/aws/httpApi.d.ts +66 -0
  25. package/bin/aws/httpApi.js +60 -0
  26. package/bin/aws/httpApi.js.map +1 -0
  27. package/bin/aws/index.d.ts +21 -0
  28. package/bin/aws/index.js +29 -1
  29. package/bin/aws/index.js.map +1 -1
  30. package/bin/aws/lambda.d.ts +1 -1
  31. package/bin/aws/oauthAuthorizer.d.ts +36 -0
  32. package/bin/aws/oauthAuthorizer.js +53 -0
  33. package/bin/aws/oauthAuthorizer.js.map +1 -0
  34. package/bin/aws/queue.d.ts +83 -0
  35. package/bin/aws/queue.js +103 -0
  36. package/bin/aws/queue.js.map +1 -0
  37. package/bin/aws/svelteKitSite.d.ts +9 -0
  38. package/bin/aws/svelteKitSite.js +3 -0
  39. package/bin/aws/svelteKitSite.js.map +1 -1
  40. package/bin/aws/vpcEndpoint.d.ts +9 -5
  41. package/bin/aws/vpcEndpoint.js +2 -1
  42. package/bin/aws/vpcEndpoint.js.map +1 -1
  43. package/bin/grants.js +4 -0
  44. package/bin/grants.js.map +1 -1
  45. package/bin/package.json +1 -1
  46. package/bin/types/enums/aws/index.d.ts +164 -36
  47. package/bin/types/enums/aws/index.js +149 -35
  48. package/bin/types/enums/aws/index.js.map +1 -1
  49. package/bin/types/input.d.ts +962 -10
  50. package/bin/types/output.d.ts +13 -0
  51. package/grants.ts +6 -1
  52. package/package.json +1 -1
  53. package/tsconfig.json +7 -0
  54. package/types/enums/aws/index.ts +186 -36
  55. package/types/input.ts +994 -10
  56. package/types/output.ts +14 -0
@@ -1,4 +1,17 @@
1
1
  export declare namespace aws {
2
+ /**
3
+ * ACM certificate DNS validation CNAME record. Only populated when domain.dns: false and domain.certificateArn is omitted. Add this record in your DNS provider (e.g. Cloudflare) then re-run deploy — Anvil blocks until ACM confirms validation.
4
+ */
5
+ interface HttpApiCertValidationCname {
6
+ /**
7
+ * The CNAME record name to add in your DNS provider.
8
+ */
9
+ name: string;
10
+ /**
11
+ * The CNAME record value to point to.
12
+ */
13
+ value: string;
14
+ }
2
15
  }
3
16
  export declare namespace gcp {
4
17
  }
package/grants.ts CHANGED
@@ -83,10 +83,15 @@ function sanitize(s: string): string {
83
83
  */
84
84
  export function buildResourceArns(
85
85
  baseArn: pulumi.Output<string>,
86
- paths?: string[]
86
+ paths?: string[] | null
87
87
  ): pulumi.Output<string>[] {
88
88
  const arns: pulumi.Output<string>[] = [baseArn];
89
89
 
90
+ if (paths === null) {
91
+ // Explicit null = base ARN only, no sub-paths (used by DynamoDB index grants)
92
+ return arns;
93
+ }
94
+
90
95
  if (!paths || paths.length === 0) {
91
96
  arns.push(pulumi.interpolate`${baseArn}/*`);
92
97
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvil-cloud/sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "scripts": {
5
5
  "build": "tsc && cp package.json bin/"
6
6
  },
package/tsconfig.json CHANGED
@@ -14,8 +14,15 @@
14
14
  },
15
15
  "files": [
16
16
  "aws/bucket.ts",
17
+ "aws/cognitoAuth.ts",
18
+ "aws/cognitoUserPool.ts",
19
+ "aws/dynamoDB.ts",
20
+ "aws/eventBus.ts",
21
+ "aws/httpApi.ts",
17
22
  "aws/index.ts",
18
23
  "aws/lambda.ts",
24
+ "aws/oauthAuthorizer.ts",
25
+ "aws/queue.ts",
19
26
  "aws/svelteKitSite.ts",
20
27
  "aws/vpc.ts",
21
28
  "aws/vpcEndpoint.ts",
@@ -2,73 +2,211 @@
2
2
  // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
3
 
4
4
 
5
- export const AwsVpcEndpointService = {
5
+ export const CognitoUserPoolCustomAttributeType = {
6
+ String: "String",
7
+ Number: "Number",
8
+ DateTime: "DateTime",
9
+ Boolean: "Boolean",
10
+ } as const;
11
+
12
+ export type CognitoUserPoolCustomAttributeType = (typeof CognitoUserPoolCustomAttributeType)[keyof typeof CognitoUserPoolCustomAttributeType];
13
+
14
+ export const CognitoUserPoolIdentityProviderType = {
15
+ /**
16
+ * Google OAuth 2.0. Requires clientId and clientSecret.
17
+ */
18
+ Google: "Google",
19
+ /**
20
+ * Facebook OAuth 2.0. Requires clientId and clientSecret.
21
+ */
22
+ Facebook: "Facebook",
23
+ /**
24
+ * Login with Amazon. Requires clientId and clientSecret.
25
+ */
26
+ LoginWithAmazon: "LoginWithAmazon",
27
+ /**
28
+ * Sign in with Apple. Requires clientId and clientSecret.
29
+ */
30
+ SignInWithApple: "SignInWithApple",
31
+ /**
32
+ * Generic OIDC provider (Okta, Auth0, Microsoft Entra, etc.). Requires clientId, clientSecret, and oidcIssuer.
33
+ */
34
+ OIDC: "OIDC",
35
+ /**
36
+ * SAML 2.0 provider (corporate SSO, Active Directory Federation Services etc.). Requires metadataUrl or metadataContent.
37
+ */
38
+ SAML: "SAML",
39
+ } as const;
40
+
41
+ export type CognitoUserPoolIdentityProviderType = (typeof CognitoUserPoolIdentityProviderType)[keyof typeof CognitoUserPoolIdentityProviderType];
42
+
43
+ export const CognitoUserPoolMfaMethod = {
44
+ /**
45
+ * Time-based one-time password (authenticator app). No additional AWS resources required.
46
+ */
47
+ TOTP: "TOTP",
6
48
  /**
7
- * AWS Systems Manager. Required alongside ssmmessages and ec2messages for full SSM functionality including Session Manager and Run Command.
49
+ * SMS one-time password via SNS. Requires snsCallerArn.
8
50
  */
9
- Ssm: "ssm",
51
+ SMS: "SMS",
52
+ } as const;
53
+
54
+ export type CognitoUserPoolMfaMethod = (typeof CognitoUserPoolMfaMethod)[keyof typeof CognitoUserPoolMfaMethod];
55
+
56
+ export const CognitoUserPoolMfaMode = {
57
+ /**
58
+ * MFA disabled. Default.
59
+ */
60
+ OFF: "OFF",
10
61
  /**
11
- * SSM Session Manager messaging. Required alongside ssm and ec2messages.
62
+ * MFA available but not required. Users opt in.
12
63
  */
13
- Ssmmessages: "ssmmessages",
64
+ OPTIONAL: "OPTIONAL",
65
+ /**
66
+ * MFA required for all users.
67
+ */
68
+ REQUIRED: "REQUIRED",
69
+ } as const;
70
+
71
+ export type CognitoUserPoolMfaMode = (typeof CognitoUserPoolMfaMode)[keyof typeof CognitoUserPoolMfaMode];
72
+
73
+ export const CognitoUserPoolOAuthFlow = {
14
74
  /**
15
- * SSM Run Command messaging. Required alongside ssm and ssmmessages.
75
+ * Authorization code grant (PKCE). Most secure use for all browser and server apps.
16
76
  */
17
- Ec2messages: "ec2messages",
77
+ Code: "code",
18
78
  /**
19
- * AWS Secrets Manager. Allows compute resources to call GetSecretValue and other Secrets Manager APIs without traversing the public internet.
79
+ * Implicit grant. Deprecated tokens visible in browser URL. Avoid for new applications.
20
80
  */
21
- Secretsmanager: "secretsmanager",
81
+ Implicit: "implicit",
22
82
  /**
23
- * ECR control plane — authentication, image manifests, and repository metadata. Required alongside ecr.dkr for private image pulls.
83
+ * Client credentials grant. M2M only no user interaction.
24
84
  */
25
- Ecr_api: "ecr.api",
85
+ Client_credentials: "client_credentials",
86
+ } as const;
87
+
88
+ export type CognitoUserPoolOAuthFlow = (typeof CognitoUserPoolOAuthFlow)[keyof typeof CognitoUserPoolOAuthFlow];
89
+
90
+ export const CognitoUserPoolUsernameAttribute = {
26
91
  /**
27
- * ECR data plane image layer pulls. Required alongside ecr.api for private image pulls.
92
+ * Users sign in with their email address.
28
93
  */
29
- Ecr_dkr: "ecr.dkr",
94
+ Email: "email",
30
95
  /**
31
- * Amazon Simple Queue Service. Covers all SQS operations including SendMessage, ReceiveMessage, and DeleteMessage — all are client-initiated HTTPS, one endpoint covers all operations.
96
+ * Users sign in with their phone number.
32
97
  */
33
- Sqs: "sqs",
98
+ Phone_number: "phone_number",
99
+ } as const;
100
+
101
+ export type CognitoUserPoolUsernameAttribute = (typeof CognitoUserPoolUsernameAttribute)[keyof typeof CognitoUserPoolUsernameAttribute];
102
+
103
+ export const DynamoDBAttributeType = {
34
104
  /**
35
- * Amazon Simple Notification Service. Allows compute resources to publish to SNS topics without traversing the public internet.
105
+ * String
36
106
  */
37
- Sns: "sns",
107
+ S: "S",
38
108
  /**
39
- * AWS Lambda invoke. Allows private invocation of Lambda functions from within the VPC.
109
+ * Number
40
110
  */
41
- Lambda: "lambda",
111
+ N: "N",
42
112
  /**
43
- * Amazon CloudWatch Logs. Required for compute resources in private subnets to ship logs to CloudWatch without a NAT Gateway.
113
+ * Binary
44
114
  */
45
- Logs: "logs",
115
+ B: "B",
116
+ } as const;
117
+
118
+ export type DynamoDBAttributeType = (typeof DynamoDBAttributeType)[keyof typeof DynamoDBAttributeType];
119
+
120
+ export const DynamoDBProjectionType = {
46
121
  /**
47
- * Amazon CloudWatch Metrics. Required for compute resources in private subnets to publish custom metrics without a NAT Gateway.
122
+ * All attributes are projected. Default.
48
123
  */
49
- Monitoring: "monitoring",
124
+ ALL: "ALL",
50
125
  /**
51
- * AWS Key Management Service. Required for compute resources that perform envelope encryption, use KMS-managed secrets, or interact with services that call KMS on their behalf.
126
+ * Only the table and GSI key attributes are projected.
52
127
  */
53
- Kms: "kms",
128
+ KEYS_ONLY: "KEYS_ONLY",
54
129
  /**
55
- * AWS Security Token Service. Required for IAM role assumption and temporary credential generation within private subnets.
130
+ * Only the specified nonKeyAttributes are projected in addition to keys.
56
131
  */
57
- Sts: "sts",
132
+ INCLUDE: "INCLUDE",
133
+ } as const;
134
+
135
+ export type DynamoDBProjectionType = (typeof DynamoDBProjectionType)[keyof typeof DynamoDBProjectionType];
136
+
137
+ export const DynamoDBStreamStartingPosition = {
138
+ /**
139
+ * Start reading from the oldest available record in the stream. Replays all existing records up to 24hr retention window. AWS default.
140
+ */
141
+ TRIM_HORIZON: "TRIM_HORIZON",
142
+ /**
143
+ * Start reading from the most recent record. Only processes new events from the point of consumer creation.
144
+ */
145
+ LATEST: "LATEST",
146
+ } as const;
147
+
148
+ export type DynamoDBStreamStartingPosition = (typeof DynamoDBStreamStartingPosition)[keyof typeof DynamoDBStreamStartingPosition];
149
+
150
+ export const DynamoDBStreamViewType = {
151
+ /**
152
+ * Only the new item image is written to the stream.
153
+ */
154
+ NEW_IMAGE: "NEW_IMAGE",
155
+ /**
156
+ * Only the old item image is written to the stream.
157
+ */
158
+ OLD_IMAGE: "OLD_IMAGE",
159
+ /**
160
+ * Both old and new item images are written to the stream.
161
+ */
162
+ NEW_AND_OLD_IMAGES: "NEW_AND_OLD_IMAGES",
163
+ /**
164
+ * Only the key attributes are written to the stream.
165
+ */
166
+ KEYS_ONLY: "KEYS_ONLY",
167
+ } as const;
168
+
169
+ export type DynamoDBStreamViewType = (typeof DynamoDBStreamViewType)[keyof typeof DynamoDBStreamViewType];
170
+
171
+ export const HttpApiMethod = {
172
+ /**
173
+ * HTTP GET — read operations.
174
+ */
175
+ GET: "GET",
176
+ /**
177
+ * HTTP POST — create operations and async consumers (SQS, EventBridge, Step Functions).
178
+ */
179
+ POST: "POST",
180
+ /**
181
+ * HTTP PUT — replace operations.
182
+ */
183
+ PUT: "PUT",
184
+ /**
185
+ * HTTP PATCH — partial update operations.
186
+ */
187
+ PATCH: "PATCH",
188
+ /**
189
+ * HTTP DELETE — delete operations.
190
+ */
191
+ DELETE: "DELETE",
192
+ /**
193
+ * Matches all HTTP methods. Maps to the $default route key.
194
+ */
195
+ ANY: "ANY",
58
196
  } as const;
59
197
 
60
198
  /**
61
- * The AWS service to route privately via an Interface VPC Endpoint. Each value maps to the com.amazonaws.{region}.{suffix} endpoint service name.
199
+ * HTTP method for an API route.
62
200
  */
63
- export type AwsVpcEndpointService = (typeof AwsVpcEndpointService)[keyof typeof AwsVpcEndpointService];
201
+ export type HttpApiMethod = (typeof HttpApiMethod)[keyof typeof HttpApiMethod];
64
202
 
65
203
  export const LambdaArchitecture = {
66
204
  /**
67
- * Graviton 20% cheaper, better performance. Default.
205
+ * Graviton - 20% cheaper, better performance. Default.
68
206
  */
69
207
  Arm64: "arm64",
70
208
  /**
71
- * Intel/AMD use for x86-specific native dependencies.
209
+ * Intel/AMD - use for x86-specific native dependencies.
72
210
  */
73
211
  X86_64: "x86_64",
74
212
  } as const;
@@ -89,19 +227,19 @@ export const LambdaLogRetention = {
89
227
  */
90
228
  LambdaLogRetention_90d: "90d",
91
229
  /**
92
- * 1 year (365 days) SOC 2 / ISO 27001 / PCI-DSS baseline. Default.
230
+ * 1 year (365 days) - SOC 2 / ISO 27001 / PCI-DSS baseline. Default.
93
231
  */
94
232
  LambdaLogRetention_1y: "1y",
95
233
  /**
96
- * 3 years (1095 days) FedRAMP minimum
234
+ * 3 years (1095 days) - FedRAMP minimum
97
235
  */
98
236
  LambdaLogRetention_3y: "3y",
99
237
  /**
100
- * 6 years (2190 days) HIPAA minimum
238
+ * 6 years (2190 days) - HIPAA minimum
101
239
  */
102
240
  LambdaLogRetention_6y: "6y",
103
241
  /**
104
- * 7 years (2555 days) IRAP minimum
242
+ * 7 years (2555 days) - IRAP minimum
105
243
  */
106
244
  LambdaLogRetention_7y: "7y",
107
245
  } as const;
@@ -110,7 +248,7 @@ export type LambdaLogRetention = (typeof LambdaLogRetention)[keyof typeof Lambda
110
248
 
111
249
  export const LambdaRuntime = {
112
250
  /**
113
- * Node.js 24 (LTS) recommended
251
+ * Node.js 24 (LTS) - recommended
114
252
  */
115
253
  Nodejs24_x: "nodejs24.x",
116
254
  /**
@@ -130,6 +268,18 @@ export const S3FlowLogLifecycle = {
130
268
 
131
269
  export type S3FlowLogLifecycle = (typeof S3FlowLogLifecycle)[keyof typeof S3FlowLogLifecycle];
132
270
 
271
+ export const SiteOriginProtectionProvider = {
272
+ /**
273
+ * Cloudflare — inject x-origin-secret via a Cloudflare Transform Rule.
274
+ */
275
+ Cloudflare: "cloudflare",
276
+ } as const;
277
+
278
+ /**
279
+ * The CDN/proxy provider sitting in front of CloudFront.
280
+ */
281
+ export type SiteOriginProtectionProvider = (typeof SiteOriginProtectionProvider)[keyof typeof SiteOriginProtectionProvider];
282
+
133
283
  export const VpcNatType = {
134
284
  /**
135
285
  * AWS managed NAT Gateway. One per AZ for true HA. ~$32/month per AZ plus $0.045/GB data processed.