alchemy 0.2.3 → 0.2.4

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 (138) hide show
  1. package/lib/ai/ark.d.ts +11 -0
  2. package/lib/ai/ark.js +86 -0
  3. package/lib/ai/client.d.ts +51 -0
  4. package/lib/ai/client.js +29 -0
  5. package/lib/ai/document.d.ts +97 -0
  6. package/lib/ai/document.js +82 -0
  7. package/lib/{docs → ai}/index.d.ts +1 -0
  8. package/lib/{docs → ai}/index.js +1 -0
  9. package/lib/ai/object.d.ts +101 -0
  10. package/lib/ai/object.js +70 -0
  11. package/lib/alchemy.d.ts +83 -2
  12. package/lib/alchemy.js +31 -3
  13. package/lib/aws/bucket.d.ts +87 -1
  14. package/lib/aws/bucket.js +48 -1
  15. package/lib/aws/function.d.ts +186 -1
  16. package/lib/aws/function.js +62 -8
  17. package/lib/aws/oidc/github-oidc-provider.d.ts +81 -0
  18. package/lib/aws/oidc/github-oidc-provider.js +68 -0
  19. package/lib/aws/oidc/oidc-provider.d.ts +14 -6
  20. package/lib/aws/oidc/oidc-provider.js +26 -5
  21. package/lib/aws/policy-attachment.d.ts +44 -1
  22. package/lib/aws/policy-attachment.js +31 -0
  23. package/lib/aws/policy.d.ts +160 -1
  24. package/lib/aws/policy.js +78 -0
  25. package/lib/aws/queue.d.ts +83 -1
  26. package/lib/aws/queue.js +39 -0
  27. package/lib/aws/role.d.ts +162 -1
  28. package/lib/aws/role.js +114 -0
  29. package/lib/aws/ses.d.ts +57 -2
  30. package/lib/aws/ses.js +42 -1
  31. package/lib/aws/table.d.ts +96 -1
  32. package/lib/aws/table.js +36 -0
  33. package/lib/cloudflare/asset-manifest.js +0 -1
  34. package/lib/cloudflare/bound.js +0 -1
  35. package/lib/cloudflare/bucket.d.ts +37 -1
  36. package/lib/cloudflare/bucket.js +36 -0
  37. package/lib/cloudflare/durable-object-namespace.d.ts +25 -0
  38. package/lib/cloudflare/durable-object-namespace.js +22 -0
  39. package/lib/cloudflare/kv-namespace.d.ts +37 -1
  40. package/lib/cloudflare/kv-namespace.js +36 -0
  41. package/lib/cloudflare/static-site.d.ts +53 -1
  42. package/lib/cloudflare/static-site.js +53 -1
  43. package/lib/cloudflare/worker-metadata.js +0 -1
  44. package/lib/cloudflare/worker.d.ts +64 -1
  45. package/lib/cloudflare/worker.js +63 -0
  46. package/lib/cloudflare/wrangler.json.d.ts +1 -1
  47. package/lib/cloudflare/zone-settings.js +0 -1
  48. package/lib/cloudflare/zone.d.ts +56 -1
  49. package/lib/cloudflare/zone.js +55 -0
  50. package/lib/destroy.js +1 -1
  51. package/lib/esbuild/bundle.d.ts +43 -4
  52. package/lib/esbuild/bundle.js +16 -0
  53. package/lib/fs/file-collection.d.ts +16 -0
  54. package/lib/fs/file-collection.js +6 -0
  55. package/lib/fs/file-ref.d.ts +14 -0
  56. package/lib/fs/file-ref.js +6 -0
  57. package/lib/fs/file.d.ts +71 -25
  58. package/lib/fs/file.js +20 -44
  59. package/lib/fs/folder.d.ts +37 -5
  60. package/lib/fs/folder.js +26 -2
  61. package/lib/fs/index.d.ts +6 -0
  62. package/lib/fs/index.js +6 -0
  63. package/lib/fs/json-file.d.ts +16 -0
  64. package/lib/fs/json-file.js +7 -0
  65. package/lib/fs/text-file.d.ts +12 -0
  66. package/lib/fs/text-file.js +7 -0
  67. package/lib/fs/typescript-file.d.ts +19 -0
  68. package/lib/fs/typescript-file.js +14 -0
  69. package/lib/fs/yaml-file.d.ts +19 -0
  70. package/lib/fs/yaml-file.js +8 -0
  71. package/lib/github/secret.d.ts +63 -2
  72. package/lib/github/secret.js +61 -1
  73. package/lib/internal/docs.d.ts +5 -0
  74. package/lib/internal/docs.js +324 -0
  75. package/lib/resource.d.ts +1 -1
  76. package/lib/secret.d.ts +67 -0
  77. package/lib/secret.js +67 -0
  78. package/lib/shadcn/component.d.ts +1 -1
  79. package/lib/stripe/price.d.ts +51 -1
  80. package/lib/stripe/price.js +50 -0
  81. package/lib/stripe/product.d.ts +39 -1
  82. package/lib/stripe/product.js +38 -0
  83. package/lib/stripe/webhook.d.ts +46 -1
  84. package/lib/stripe/webhook.js +45 -0
  85. package/lib/test/bun.d.ts +64 -0
  86. package/lib/test/bun.js +35 -3
  87. package/lib/util/serde.js +14 -0
  88. package/lib/vite/vite.d.ts +1 -1
  89. package/lib/vitepress/dependencies.d.ts +2 -6
  90. package/lib/vitepress/vitepress.d.ts +12 -1
  91. package/lib/vitepress/vitepress.js +29 -23
  92. package/package.json +8 -3
  93. package/src/ai/ark.ts +118 -0
  94. package/src/ai/client.ts +78 -0
  95. package/src/ai/document.ts +160 -0
  96. package/src/{docs → ai}/index.ts +1 -0
  97. package/src/ai/object.ts +149 -0
  98. package/src/alchemy.ts +88 -5
  99. package/src/aws/bucket.ts +111 -7
  100. package/src/aws/function.ts +231 -10
  101. package/src/aws/oidc/github-oidc-provider.ts +83 -0
  102. package/src/aws/oidc/oidc-provider.ts +39 -7
  103. package/src/aws/policy-attachment.ts +44 -1
  104. package/src/aws/policy.ts +177 -2
  105. package/src/aws/queue.ts +89 -0
  106. package/src/aws/role.ts +174 -2
  107. package/src/aws/ses.ts +56 -1
  108. package/src/aws/table.ts +103 -0
  109. package/src/cloudflare/bucket.ts +36 -0
  110. package/src/cloudflare/durable-object-namespace.ts +25 -0
  111. package/src/cloudflare/kv-namespace.ts +36 -0
  112. package/src/cloudflare/static-site.ts +53 -1
  113. package/src/cloudflare/worker.ts +63 -0
  114. package/src/cloudflare/zone.ts +55 -0
  115. package/src/destroy.ts +1 -1
  116. package/src/esbuild/bundle.ts +53 -3
  117. package/src/fs/file-collection.ts +24 -0
  118. package/src/fs/file-ref.ts +22 -0
  119. package/src/fs/file.ts +70 -77
  120. package/src/fs/folder.ts +44 -5
  121. package/src/fs/index.ts +6 -0
  122. package/src/fs/json-file.ts +23 -0
  123. package/src/fs/text-file.ts +19 -0
  124. package/src/fs/typescript-file.ts +36 -0
  125. package/src/fs/yaml-file.ts +26 -0
  126. package/src/github/secret.ts +65 -2
  127. package/src/internal/docs.ts +369 -0
  128. package/src/resource.ts +1 -1
  129. package/src/secret.ts +67 -0
  130. package/src/stripe/price.ts +50 -0
  131. package/src/stripe/product.ts +38 -0
  132. package/src/stripe/webhook.ts +45 -0
  133. package/src/test/bun.ts +83 -3
  134. package/src/util/serde.ts +17 -0
  135. package/src/vitepress/vitepress.ts +47 -26
  136. package/lib/docs/document.d.ts +0 -123
  137. package/lib/docs/document.js +0 -67
  138. package/src/docs/document.ts +0 -225
package/lib/aws/queue.js CHANGED
@@ -1,5 +1,44 @@
1
1
  import { CreateQueueCommand, DeleteQueueCommand, GetQueueAttributesCommand, GetQueueUrlCommand, SQSClient, } from "@aws-sdk/client-sqs";
2
2
  import { Resource } from "../resource";
3
+ /**
4
+ * AWS SQS Queue Resource
5
+ *
6
+ * Creates and manages Amazon SQS queues with support for both standard and FIFO queues.
7
+ * Handles queue creation, attribute configuration, and automatic cleanup of deleted queues.
8
+ *
9
+ * @example
10
+ * // Create a standard queue with custom visibility timeout
11
+ * const standardQueue = await Queue("my-queue", {
12
+ * queueName: "my-queue",
13
+ * visibilityTimeout: 30,
14
+ * tags: {
15
+ * Environment: "production"
16
+ * }
17
+ * });
18
+ *
19
+ * @example
20
+ * // Create a FIFO queue with content-based deduplication
21
+ * const fifoQueue = await Queue("orders-queue", {
22
+ * queueName: "orders-queue.fifo",
23
+ * fifo: true,
24
+ * contentBasedDeduplication: true,
25
+ * visibilityTimeout: 30,
26
+ * tags: {
27
+ * Environment: "production"
28
+ * }
29
+ * });
30
+ *
31
+ * @example
32
+ * // Create a queue with custom message retention and size
33
+ * const customQueue = await Queue("large-messages", {
34
+ * queueName: "large-messages",
35
+ * messageRetentionPeriod: 345600, // 4 days
36
+ * maximumMessageSize: 262144, // 256 KB
37
+ * visibilityTimeout: 60,
38
+ * delaySeconds: 5,
39
+ * receiveMessageWaitTimeSeconds: 20
40
+ * });
41
+ */
3
42
  export const Queue = Resource("sqs::Queue", async function (id, props) {
4
43
  const client = new SQSClient({});
5
44
  // Don't automatically add .fifo suffix - user must include it in queueName
package/lib/aws/role.d.ts CHANGED
@@ -1,24 +1,185 @@
1
1
  import type { Context } from "../context";
2
2
  import { Resource } from "../resource";
3
3
  import type { PolicyDocument } from "./policy";
4
+ /**
5
+ * Properties for creating or updating an IAM role
6
+ */
4
7
  export interface RoleProps {
8
+ /**
9
+ * Name of the IAM role
10
+ */
5
11
  roleName: string;
12
+ /**
13
+ * Policy that defines which entities can assume this role
14
+ */
6
15
  assumeRolePolicy: PolicyDocument;
16
+ /**
17
+ * Optional description of the role's purpose
18
+ */
7
19
  description?: string;
20
+ /**
21
+ * Optional path prefix for the role
22
+ */
8
23
  path?: string;
24
+ /**
25
+ * Maximum session duration in seconds when assumed
26
+ * Default: 3600 seconds (1 hour)
27
+ */
9
28
  maxSessionDuration?: number;
29
+ /**
30
+ * ARN of the policy used to set the permissions boundary
31
+ */
10
32
  permissionsBoundary?: string;
33
+ /**
34
+ * Inline policies to embed in the role
35
+ * Each policy must have a unique name and policy document
36
+ */
11
37
  policies?: Array<{
12
38
  policyName: string;
13
39
  policyDocument: PolicyDocument;
14
40
  }>;
41
+ /**
42
+ * List of managed policy ARNs to attach to the role
43
+ */
15
44
  managedPolicyArns?: string[];
45
+ /**
46
+ * Resource tags for the role
47
+ */
16
48
  tags?: Record<string, string>;
17
49
  }
50
+ /**
51
+ * Output returned after IAM role creation/update
52
+ */
18
53
  export interface Role extends Resource<"iam::Role">, RoleProps {
54
+ /**
55
+ * ARN of the role
56
+ */
19
57
  arn: string;
58
+ /**
59
+ * Unique identifier for the role
60
+ */
20
61
  uniqueId: string;
62
+ /**
63
+ * The stable and unique string identifying the role
64
+ */
21
65
  roleId: string;
66
+ /**
67
+ * When the role was created
68
+ */
22
69
  createDate: Date;
23
70
  }
24
- export declare const Role: ((this: Context<Role>, id: string, props: RoleProps) => Promise<Role>) | (((this: any, id: string, props?: RoleProps | undefined) => never) & (new (_: never) => never));
71
+ /**
72
+ * AWS IAM Role Resource
73
+ *
74
+ * Creates and manages IAM roles with support for inline policies, managed policies,
75
+ * and automatic cleanup of attached policies during deletion.
76
+ *
77
+ * @example
78
+ * // Create a basic Lambda execution role with inline policy
79
+ * const basicRole = await Role("lambda-role", {
80
+ * roleName: "lambda-role",
81
+ * assumeRolePolicy: {
82
+ * Version: "2012-10-17",
83
+ * Statement: [{
84
+ * Effect: "Allow",
85
+ * Principal: {
86
+ * Service: "lambda.amazonaws.com"
87
+ * },
88
+ * Action: "sts:AssumeRole"
89
+ * }]
90
+ * },
91
+ * description: "Basic Lambda execution role",
92
+ * tags: {
93
+ * Environment: "production"
94
+ * },
95
+ * policies: [{
96
+ * policyName: "logs",
97
+ * policyDocument: {
98
+ * Version: "2012-10-17",
99
+ * Statement: [{
100
+ * Effect: "Allow",
101
+ * Action: [
102
+ * "logs:CreateLogGroup",
103
+ * "logs:CreateLogStream",
104
+ * "logs:PutLogEvents"
105
+ * ],
106
+ * Resource: "*"
107
+ * }]
108
+ * }
109
+ * }]
110
+ * });
111
+ *
112
+ * @example
113
+ * // Create a role with AWS managed policies
114
+ * const managedRole = await Role("readonly-role", {
115
+ * roleName: "readonly-role",
116
+ * assumeRolePolicy: {
117
+ * Version: "2012-10-17",
118
+ * Statement: [{
119
+ * Effect: "Allow",
120
+ * Principal: {
121
+ * Service: "lambda.amazonaws.com"
122
+ * },
123
+ * Action: "sts:AssumeRole"
124
+ * }]
125
+ * },
126
+ * description: "Role with managed policies",
127
+ * managedPolicyArns: [
128
+ * "arn:aws:iam::aws:policy/ReadOnlyAccess"
129
+ * ],
130
+ * tags: {
131
+ * Environment: "production"
132
+ * }
133
+ * });
134
+ *
135
+ * @example
136
+ * // Create a role with multiple inline policies and custom session duration
137
+ * const customRole = await Role("custom-role", {
138
+ * roleName: "custom-role",
139
+ * assumeRolePolicy: {
140
+ * Version: "2012-10-17",
141
+ * Statement: [{
142
+ * Effect: "Allow",
143
+ * Principal: {
144
+ * Service: "lambda.amazonaws.com"
145
+ * },
146
+ * Action: "sts:AssumeRole"
147
+ * }]
148
+ * },
149
+ * description: "Role with multiple policies",
150
+ * maxSessionDuration: 7200,
151
+ * policies: [
152
+ * {
153
+ * policyName: "logs",
154
+ * policyDocument: {
155
+ * Version: "2012-10-17",
156
+ * Statement: [{
157
+ * Effect: "Allow",
158
+ * Action: [
159
+ * "logs:CreateLogGroup",
160
+ * "logs:CreateLogStream",
161
+ * "logs:PutLogEvents"
162
+ * ],
163
+ * Resource: "*"
164
+ * }]
165
+ * }
166
+ * },
167
+ * {
168
+ * policyName: "s3",
169
+ * policyDocument: {
170
+ * Version: "2012-10-17",
171
+ * Statement: [{
172
+ * Effect: "Allow",
173
+ * Action: "s3:ListBucket",
174
+ * Resource: "*"
175
+ * }]
176
+ * }
177
+ * }
178
+ * ],
179
+ * tags: {
180
+ * Environment: "production",
181
+ * Updated: "true"
182
+ * }
183
+ * });
184
+ */
185
+ export declare const Role: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<Role>, id: string, props: RoleProps) => Promise<Role>);
package/lib/aws/role.js CHANGED
@@ -1,6 +1,120 @@
1
1
  import { AttachRolePolicyCommand, CreateRoleCommand, DeleteRoleCommand, DeleteRolePolicyCommand, DetachRolePolicyCommand, EntityAlreadyExistsException, GetRoleCommand, IAMClient, ListAttachedRolePoliciesCommand, NoSuchEntityException, PutRolePolicyCommand, TagRoleCommand, UpdateAssumeRolePolicyCommand, UpdateRoleCommand, } from "@aws-sdk/client-iam";
2
2
  import { Resource } from "../resource";
3
3
  import { ignore } from "../util/ignore";
4
+ /**
5
+ * AWS IAM Role Resource
6
+ *
7
+ * Creates and manages IAM roles with support for inline policies, managed policies,
8
+ * and automatic cleanup of attached policies during deletion.
9
+ *
10
+ * @example
11
+ * // Create a basic Lambda execution role with inline policy
12
+ * const basicRole = await Role("lambda-role", {
13
+ * roleName: "lambda-role",
14
+ * assumeRolePolicy: {
15
+ * Version: "2012-10-17",
16
+ * Statement: [{
17
+ * Effect: "Allow",
18
+ * Principal: {
19
+ * Service: "lambda.amazonaws.com"
20
+ * },
21
+ * Action: "sts:AssumeRole"
22
+ * }]
23
+ * },
24
+ * description: "Basic Lambda execution role",
25
+ * tags: {
26
+ * Environment: "production"
27
+ * },
28
+ * policies: [{
29
+ * policyName: "logs",
30
+ * policyDocument: {
31
+ * Version: "2012-10-17",
32
+ * Statement: [{
33
+ * Effect: "Allow",
34
+ * Action: [
35
+ * "logs:CreateLogGroup",
36
+ * "logs:CreateLogStream",
37
+ * "logs:PutLogEvents"
38
+ * ],
39
+ * Resource: "*"
40
+ * }]
41
+ * }
42
+ * }]
43
+ * });
44
+ *
45
+ * @example
46
+ * // Create a role with AWS managed policies
47
+ * const managedRole = await Role("readonly-role", {
48
+ * roleName: "readonly-role",
49
+ * assumeRolePolicy: {
50
+ * Version: "2012-10-17",
51
+ * Statement: [{
52
+ * Effect: "Allow",
53
+ * Principal: {
54
+ * Service: "lambda.amazonaws.com"
55
+ * },
56
+ * Action: "sts:AssumeRole"
57
+ * }]
58
+ * },
59
+ * description: "Role with managed policies",
60
+ * managedPolicyArns: [
61
+ * "arn:aws:iam::aws:policy/ReadOnlyAccess"
62
+ * ],
63
+ * tags: {
64
+ * Environment: "production"
65
+ * }
66
+ * });
67
+ *
68
+ * @example
69
+ * // Create a role with multiple inline policies and custom session duration
70
+ * const customRole = await Role("custom-role", {
71
+ * roleName: "custom-role",
72
+ * assumeRolePolicy: {
73
+ * Version: "2012-10-17",
74
+ * Statement: [{
75
+ * Effect: "Allow",
76
+ * Principal: {
77
+ * Service: "lambda.amazonaws.com"
78
+ * },
79
+ * Action: "sts:AssumeRole"
80
+ * }]
81
+ * },
82
+ * description: "Role with multiple policies",
83
+ * maxSessionDuration: 7200,
84
+ * policies: [
85
+ * {
86
+ * policyName: "logs",
87
+ * policyDocument: {
88
+ * Version: "2012-10-17",
89
+ * Statement: [{
90
+ * Effect: "Allow",
91
+ * Action: [
92
+ * "logs:CreateLogGroup",
93
+ * "logs:CreateLogStream",
94
+ * "logs:PutLogEvents"
95
+ * ],
96
+ * Resource: "*"
97
+ * }]
98
+ * }
99
+ * },
100
+ * {
101
+ * policyName: "s3",
102
+ * policyDocument: {
103
+ * Version: "2012-10-17",
104
+ * Statement: [{
105
+ * Effect: "Allow",
106
+ * Action: "s3:ListBucket",
107
+ * Resource: "*"
108
+ * }]
109
+ * }
110
+ * }
111
+ * ],
112
+ * tags: {
113
+ * Environment: "production",
114
+ * Updated: "true"
115
+ * }
116
+ * });
117
+ */
4
118
  export const Role = Resource("iam::Role", async function (id, props) {
5
119
  const client = new IAMClient({});
6
120
  if (this.phase === "delete") {
package/lib/aws/ses.d.ts CHANGED
@@ -7,38 +7,48 @@ import { Resource } from "../resource";
7
7
  export interface SESProps {
8
8
  /**
9
9
  * Name of the configuration set
10
+ * Used to group email sending and tracking settings
10
11
  */
11
12
  configurationSetName?: string;
12
13
  /**
13
14
  * Email identity to verify (email address or domain)
15
+ * For domains, use the format "example.com"
16
+ * For email addresses, use the format "user@example.com"
14
17
  */
15
18
  emailIdentity?: string;
16
19
  /**
17
20
  * Whether to enable DKIM signing for the email identity
21
+ * DKIM helps prevent email spoofing by verifying sender authenticity
18
22
  */
19
23
  enableDkim?: boolean;
20
24
  /**
21
25
  * Sending options for the configuration set
26
+ * Controls whether email sending is enabled and related settings
22
27
  */
23
28
  sendingOptions?: SendingOptions;
24
29
  /**
25
30
  * Reputation options for the configuration set
31
+ * Controls reputation tracking and metrics collection
26
32
  */
27
33
  reputationOptions?: ReputationOptions;
28
34
  /**
29
35
  * Tracking options for the configuration set
36
+ * Controls open and click tracking with optional custom domains
30
37
  */
31
38
  trackingOptions?: TrackingOptions;
32
39
  /**
33
40
  * Suppression options for the configuration set
41
+ * Controls how bounces and complaints are handled
34
42
  */
35
43
  suppressionOptions?: SuppressionOptions;
36
44
  /**
37
45
  * Delivery options for the configuration set
46
+ * Controls TLS settings and sending pool configuration
38
47
  */
39
48
  deliveryOptions?: DeliveryOptions;
40
49
  /**
41
50
  * Tags to apply to the SES resources
51
+ * Key-value pairs for resource organization
42
52
  */
43
53
  tags?: Record<string, string>;
44
54
  }
@@ -48,22 +58,67 @@ export interface SESProps {
48
58
  export interface SES extends Resource<"aws::SES">, SESProps {
49
59
  /**
50
60
  * ARN of the configuration set if created
61
+ * Format: arn:aws:ses:region:account-id:configuration-set/name
51
62
  */
52
63
  configurationSetArn?: string;
53
64
  /**
54
65
  * Email identity verification status if an identity was created
66
+ * Can be "PENDING" or "VERIFIED"
55
67
  */
56
68
  emailIdentityVerificationStatus?: string;
57
69
  /**
58
70
  * DKIM verification status if DKIM was enabled
71
+ * Can be "PENDING", "SUCCESS", "FAILED", "TEMPORARY_FAILURE", or "NOT_STARTED"
59
72
  */
60
73
  dkimVerificationStatus?: string;
61
74
  /**
62
75
  * Email identity ARN if an identity was created
76
+ * Format: arn:aws:ses:region:account-id:identity/name
63
77
  */
64
78
  emailIdentityArn?: string;
65
79
  }
66
80
  /**
67
- * AWS SES resource for creating and configuring Simple Email Service
81
+ * AWS SES Resource
82
+ *
83
+ * Creates and manages Amazon Simple Email Service (SES) configuration sets and email identities.
84
+ * Supports email sending configuration, DKIM signing, and identity verification.
85
+ *
86
+ * @example
87
+ * // Create a configuration set with sending options
88
+ * const configSet = await SES("email-config", {
89
+ * configurationSetName: "my-email-config",
90
+ * sendingOptions: {
91
+ * SendingEnabled: true
92
+ * },
93
+ * tags: {
94
+ * Environment: "production",
95
+ * Project: "notifications"
96
+ * }
97
+ * });
98
+ *
99
+ * @example
100
+ * // Create and verify a domain identity with DKIM
101
+ * const domainIdentity = await SES("domain-identity", {
102
+ * emailIdentity: "example.com",
103
+ * enableDkim: true,
104
+ * tags: {
105
+ * Environment: "production",
106
+ * Project: "transactional-emails"
107
+ * }
108
+ * });
109
+ *
110
+ * @example
111
+ * // Update configuration set sending options
112
+ * const updatedConfig = await SES("email-config", {
113
+ * configurationSetName: "my-email-config",
114
+ * sendingOptions: {
115
+ * SendingEnabled: false
116
+ * },
117
+ * tags: {
118
+ * Environment: "production",
119
+ * Project: "notifications",
120
+ * Updated: "true"
121
+ * }
122
+ * });
68
123
  */
69
- export declare const SES: ((this: Context<SES>, id: string, props: SESProps) => Promise<SES>) | (((this: any, id: string, props?: SESProps | undefined) => never) & (new (_: never) => never));
124
+ export declare const SES: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<SES>, id: string, props: SESProps) => Promise<SES>);
package/lib/aws/ses.js CHANGED
@@ -2,7 +2,48 @@ import { CreateConfigurationSetCommand, CreateEmailIdentityCommand, DeleteConfig
2
2
  import { Resource } from "../resource";
3
3
  import { ignore } from "../util/ignore";
4
4
  /**
5
- * AWS SES resource for creating and configuring Simple Email Service
5
+ * AWS SES Resource
6
+ *
7
+ * Creates and manages Amazon Simple Email Service (SES) configuration sets and email identities.
8
+ * Supports email sending configuration, DKIM signing, and identity verification.
9
+ *
10
+ * @example
11
+ * // Create a configuration set with sending options
12
+ * const configSet = await SES("email-config", {
13
+ * configurationSetName: "my-email-config",
14
+ * sendingOptions: {
15
+ * SendingEnabled: true
16
+ * },
17
+ * tags: {
18
+ * Environment: "production",
19
+ * Project: "notifications"
20
+ * }
21
+ * });
22
+ *
23
+ * @example
24
+ * // Create and verify a domain identity with DKIM
25
+ * const domainIdentity = await SES("domain-identity", {
26
+ * emailIdentity: "example.com",
27
+ * enableDkim: true,
28
+ * tags: {
29
+ * Environment: "production",
30
+ * Project: "transactional-emails"
31
+ * }
32
+ * });
33
+ *
34
+ * @example
35
+ * // Update configuration set sending options
36
+ * const updatedConfig = await SES("email-config", {
37
+ * configurationSetName: "my-email-config",
38
+ * sendingOptions: {
39
+ * SendingEnabled: false
40
+ * },
41
+ * tags: {
42
+ * Environment: "production",
43
+ * Project: "notifications",
44
+ * Updated: "true"
45
+ * }
46
+ * });
6
47
  */
7
48
  export const SES = Resource("aws::SES", async function (id, props) {
8
49
  // Create SES client
@@ -1,23 +1,118 @@
1
1
  import type { Context } from "../context";
2
2
  import { Resource } from "../resource";
3
+ /**
4
+ * Properties for creating or updating a DynamoDB table
5
+ */
3
6
  export interface TableProps {
7
+ /**
8
+ * Name of the DynamoDB table
9
+ */
4
10
  tableName: string;
11
+ /**
12
+ * Primary partition key (hash key) configuration
13
+ * Defines the main identifier for items in the table
14
+ */
5
15
  partitionKey: {
16
+ /**
17
+ * Name of the partition key attribute
18
+ */
6
19
  name: string;
20
+ /**
21
+ * Data type of the partition key
22
+ * S: String, N: Number, B: Binary
23
+ */
7
24
  type: "S" | "N" | "B";
8
25
  };
26
+ /**
27
+ * Optional sort key (range key) configuration
28
+ * Used to sort items with the same partition key
29
+ */
9
30
  sortKey?: {
31
+ /**
32
+ * Name of the sort key attribute
33
+ */
10
34
  name: string;
35
+ /**
36
+ * Data type of the sort key
37
+ * S: String, N: Number, B: Binary
38
+ */
11
39
  type: "S" | "N" | "B";
12
40
  };
41
+ /**
42
+ * Billing mode for the table
43
+ * PROVISIONED: Set read/write capacity units
44
+ * PAY_PER_REQUEST: Pay per request pricing
45
+ */
13
46
  billingMode?: "PROVISIONED" | "PAY_PER_REQUEST";
47
+ /**
48
+ * Read capacity units when using PROVISIONED billing mode
49
+ * Default: 5
50
+ */
14
51
  readCapacity?: number;
52
+ /**
53
+ * Write capacity units when using PROVISIONED billing mode
54
+ * Default: 5
55
+ */
15
56
  writeCapacity?: number;
57
+ /**
58
+ * Tags to apply to the table
59
+ * Key-value pairs for resource organization
60
+ */
16
61
  tags?: Record<string, string>;
17
62
  }
63
+ /**
64
+ * Output returned after DynamoDB table creation/update
65
+ */
18
66
  export interface Table extends Resource<"dynamo::Table">, TableProps {
67
+ /**
68
+ * ARN of the table
69
+ * Format: arn:aws:dynamodb:region:account-id:table/table-name
70
+ */
19
71
  arn: string;
72
+ /**
73
+ * ARN of the table's stream if enabled
74
+ * Format: arn:aws:dynamodb:region:account-id:table/table-name/stream/timestamp
75
+ */
20
76
  streamArn?: string;
77
+ /**
78
+ * Unique identifier for the table
79
+ */
21
80
  tableId: string;
22
81
  }
23
- export declare const Table: ((this: Context<Table>, id: string, props: TableProps) => Promise<Table>) | (((this: any, id: string, props?: TableProps | undefined) => never) & (new (_: never) => never));
82
+ /**
83
+ * AWS DynamoDB Table Resource
84
+ *
85
+ * Creates and manages DynamoDB tables with support for partition and sort keys,
86
+ * flexible billing modes, and automatic table status monitoring.
87
+ *
88
+ * @example
89
+ * // Create a table with partition and sort key
90
+ * const table = await Table("user-events", {
91
+ * tableName: "user-events",
92
+ * partitionKey: {
93
+ * name: "id",
94
+ * type: "S"
95
+ * },
96
+ * sortKey: {
97
+ * name: "timestamp",
98
+ * type: "N"
99
+ * },
100
+ * tags: {
101
+ * Environment: "test"
102
+ * }
103
+ * });
104
+ *
105
+ * @example
106
+ * // Create a table with provisioned capacity
107
+ * const table = await Table("high-throughput", {
108
+ * tableName: "high-throughput",
109
+ * partitionKey: {
110
+ * name: "userId",
111
+ * type: "S"
112
+ * },
113
+ * billingMode: "PROVISIONED",
114
+ * readCapacity: 100,
115
+ * writeCapacity: 50
116
+ * });
117
+ */
118
+ export declare const Table: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<Table>, id: string, props: TableProps) => Promise<Table>);
package/lib/aws/table.js CHANGED
@@ -2,6 +2,42 @@ import { CreateTableCommand, DeleteTableCommand, DescribeTableCommand, DynamoDBC
2
2
  import { Resource } from "../resource";
3
3
  import { ignore } from "../util/ignore";
4
4
  import { withExponentialBackoff } from "../util/retry";
5
+ /**
6
+ * AWS DynamoDB Table Resource
7
+ *
8
+ * Creates and manages DynamoDB tables with support for partition and sort keys,
9
+ * flexible billing modes, and automatic table status monitoring.
10
+ *
11
+ * @example
12
+ * // Create a table with partition and sort key
13
+ * const table = await Table("user-events", {
14
+ * tableName: "user-events",
15
+ * partitionKey: {
16
+ * name: "id",
17
+ * type: "S"
18
+ * },
19
+ * sortKey: {
20
+ * name: "timestamp",
21
+ * type: "N"
22
+ * },
23
+ * tags: {
24
+ * Environment: "test"
25
+ * }
26
+ * });
27
+ *
28
+ * @example
29
+ * // Create a table with provisioned capacity
30
+ * const table = await Table("high-throughput", {
31
+ * tableName: "high-throughput",
32
+ * partitionKey: {
33
+ * name: "userId",
34
+ * type: "S"
35
+ * },
36
+ * billingMode: "PROVISIONED",
37
+ * readCapacity: 100,
38
+ * writeCapacity: 50
39
+ * });
40
+ */
5
41
  export const Table = Resource("dynamo::Table", async function (id, props) {
6
42
  const client = new DynamoDBClient({});
7
43
  if (this.phase === "delete") {
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};