@awsless/awsless 0.0.654 → 0.0.656

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.
Binary file
@@ -1 +1 @@
1
- a8a0c621098150215b693d66e3304f6d4ae1db1b
1
+ b58a7ef4004def1e70afcf61a14ffd52c86500e7
Binary file
@@ -0,0 +1 @@
1
+ dd32268a749cfae81a7e5dc9b764bff5d3fc6e07
Binary file
package/dist/prebuild.js CHANGED
@@ -148,7 +148,8 @@ var cwd = join2(process.cwd(), "./dist");
148
148
  var builds = {
149
149
  rpc: "../src/feature/rpc/server/handle.ts",
150
150
  image: "../src/feature/image/server/handle.ts",
151
- icon: "../src/feature/icon/server/handle.ts"
151
+ icon: "../src/feature/icon/server/handle.ts",
152
+ "on-failure": "../src/feature/on-failure/server/handle.ts"
152
153
  };
153
154
  for (const [name, file] of Object.entries(builds)) {
154
155
  const output = join2(cwd, "prebuild", name);
package/dist/server.d.ts CHANGED
@@ -98,6 +98,9 @@ interface MetricResources {
98
98
  }
99
99
  declare const Metric: MetricResources;
100
100
 
101
+ declare const onFailureName: string;
102
+ declare const onFailureArn: string;
103
+
101
104
  declare const getPubSubTopic: <N extends string>(name: N) => `app/pubsub/${N}`;
102
105
 
103
106
  type PublishOptions = {
@@ -173,4 +176,4 @@ declare const Topic: TopicResources;
173
176
  declare const APP: "app";
174
177
  declare const STACK: "stack";
175
178
 
176
- export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, Config, type ConfigResources, Cron, type CronResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, Metric, type MetricResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getCronName, getFunctionName, getMetricName, getMetricNamespace, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockMetric, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
179
+ export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, Config, type ConfigResources, Cron, type CronResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, Metric, type MetricResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getCronName, getFunctionName, getMetricName, getMetricNamespace, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockMetric, mockPubSub, mockQueue, mockTask, mockTopic, onFailureArn, onFailureName, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
package/dist/server.js CHANGED
@@ -198,7 +198,12 @@ var Queue = /* @__PURE__ */ createProxy((stack) => {
198
198
  return sendMessage({
199
199
  ...options,
200
200
  queue: url ?? name,
201
- payload
201
+ payload,
202
+ attributes: {
203
+ ...options.attributes ?? {},
204
+ ...url ? { queueUrl: url } : {},
205
+ queueName: name
206
+ }
202
207
  });
203
208
  }
204
209
  };
@@ -208,7 +213,14 @@ var Queue = /* @__PURE__ */ createProxy((stack) => {
208
213
  return sendMessageBatch({
209
214
  ...options,
210
215
  queue: url ?? name,
211
- items
216
+ items: items.map((item) => ({
217
+ ...item,
218
+ attributes: {
219
+ ...item.attributes ?? {},
220
+ ...url ? { queueUrl: url } : {},
221
+ queueName: name
222
+ }
223
+ }))
212
224
  });
213
225
  };
214
226
  return send;
@@ -244,8 +256,12 @@ import { invoke as invoke2 } from "@awsless/lambda";
244
256
  import { schedule } from "@awsless/scheduler";
245
257
 
246
258
  // src/lib/server/on-failure.ts
247
- var onFailureQueue = bindGlobalResourceName("on-failure")("failure");
248
- var onFailureQueueArn = `arn:aws:sqs:${REGION}:${ACCOUNT_ID}:${onFailureQueue}`;
259
+ var onFailureName = build({
260
+ resourceType: "on-failure",
261
+ resourceName: "failure",
262
+ postfix: APP_ID
263
+ });
264
+ var onFailureArn = `arn:aws:s3:::${onFailureName}`;
249
265
 
250
266
  // src/lib/server/task.ts
251
267
  var getTaskName = bindLocalResourceName("task");
@@ -262,7 +278,7 @@ var Task = /* @__PURE__ */ createProxy((stackName) => {
262
278
  schedule: options.schedule,
263
279
  group: resourceTaskName("group"),
264
280
  roleArn: `arn:aws:iam::${process.env.AWS_ACCOUNT_ID}:role/${resourceTaskName("schedule")}`,
265
- deadLetterArn: onFailureQueueArn
281
+ deadLetterArn: onFailureArn
266
282
  });
267
283
  } else {
268
284
  await invoke2({
@@ -730,6 +746,8 @@ export {
730
746
  mockQueue,
731
747
  mockTask,
732
748
  mockTopic,
749
+ onFailureArn,
750
+ onFailureName,
733
751
  pubsubAuthorizerHandle,
734
752
  pubsubAuthorizerResponse,
735
753
  setConfigValue