@geekmidas/envkit 1.0.7 → 1.1.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.
@@ -171,6 +171,42 @@ describe('sst', () => {
171
171
  });
172
172
  });
173
173
 
174
+ describe('Queue resource', () => {
175
+ it('emits url, arn, and an SQS publisher connection string', () => {
176
+ const result = normalizeResourceEnv({
177
+ orders: {
178
+ type: ResourceType.Queue,
179
+ url: 'https://sqs.us-east-1.amazonaws.com/123/shop-orders',
180
+ arn: 'arn:aws:sqs:us-east-1:123:shop-orders',
181
+ },
182
+ });
183
+
184
+ expect(result).toEqual({
185
+ ORDERS_URL: 'https://sqs.us-east-1.amazonaws.com/123/shop-orders',
186
+ ORDERS_ARN: 'arn:aws:sqs:us-east-1:123:shop-orders',
187
+ ORDERS_PUBLISHER_CONNECTION_STRING:
188
+ 'sqs://?queueUrl=https%3A%2F%2Fsqs.us-east-1.amazonaws.com%2F123%2Fshop-orders',
189
+ });
190
+ });
191
+ });
192
+
193
+ describe('SnsTopic resource', () => {
194
+ it('emits arn and an SNS publisher connection string', () => {
195
+ const result = normalizeResourceEnv({
196
+ events: {
197
+ type: ResourceType.SnsTopic,
198
+ arn: 'arn:aws:sns:us-east-1:123:shop-events',
199
+ },
200
+ });
201
+
202
+ expect(result).toEqual({
203
+ EVENTS_ARN: 'arn:aws:sns:us-east-1:123:shop-events',
204
+ EVENTS_PUBLISHER_CONNECTION_STRING:
205
+ 'sns://?topicArn=arn%3Aaws%3Asns%3Aus-east-1%3A123%3Ashop-events',
206
+ });
207
+ });
208
+ });
209
+
174
210
  describe('Bucket resource', () => {
175
211
  it('should process Bucket resource correctly', () => {
176
212
  const bucket: Bucket = {
package/src/sst.ts CHANGED
@@ -15,6 +15,7 @@ export {
15
15
  type Dynamo,
16
16
  type Function,
17
17
  type Postgres,
18
+ type Queue,
18
19
  type ResourceProcessor,
19
20
  ResourceType,
20
21
  type Secret,
@@ -25,6 +26,21 @@ export {
25
26
  type Vpc,
26
27
  } from './SstEnvironmentBuilder';
27
28
 
29
+ export {
30
+ AWS_RUNTIME_ENV_VARS,
31
+ CLOUDFLARE_RUNTIME_ENV_VARS,
32
+ EnvValidationError,
33
+ EnvValidator,
34
+ type EnvValidatorOptions,
35
+ GCP_RUNTIME_ENV_VARS,
36
+ type LinkRecord,
37
+ PLATFORM_ENV_VARS,
38
+ type Platform,
39
+ platformEnvVars,
40
+ resolveEnvKeys,
41
+ type ValidationResult,
42
+ } from './SstEnvValidator';
43
+
28
44
  // Import for deprecated function
29
45
  import {
30
46
  SstEnvironmentBuilder,