@awsless/awsless 0.0.657 → 0.0.659

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.
@@ -1 +1 @@
1
- 73b3439fb155315b972518d0d736d72eae472234
1
+ 393cbb18dc43b06c1a571bcc41442f5990664b22
Binary file
@@ -1 +1 @@
1
- b58a7ef4004def1e70afcf61a14ffd52c86500e7
1
+ 6d8d159d5802c724181129fc185c3a21adc9dbd7
Binary file
@@ -0,0 +1 @@
1
+ 4304abeec61c584fa70d497d693953142c9a16d6
@@ -1 +1 @@
1
- dd32268a749cfae81a7e5dc9b764bff5d3fc6e07
1
+ 79c41997ced733d15c6c862eb92d8aad3d38f83c
Binary file
@@ -1 +1 @@
1
- 59f2563b81c3c6d1b94cd5d4313598a21b89b366
1
+ c54103a5753560af7e66b318c01ded26d2bb3c95
Binary file
package/dist/prebuild.js CHANGED
@@ -149,7 +149,8 @@ var builds = {
149
149
  rpc: "../src/feature/rpc/server/handle.ts",
150
150
  image: "../src/feature/image/server/handle.ts",
151
151
  icon: "../src/feature/icon/server/handle.ts",
152
- "on-failure": "../src/feature/on-failure/server/handle.ts"
152
+ "on-failure": "../src/feature/on-failure/server/handle.ts",
153
+ "on-error-log": "../src/feature/on-error-log/server/handle.ts"
153
154
  };
154
155
  for (const [name, file] of Object.entries(builds)) {
155
156
  const output = join2(cwd, "prebuild", name);
package/dist/server.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AwsCredentialIdentityProvider } from '@aws-sdk/types';
2
2
  import * as vitest from 'vitest';
3
+ import * as _awsless_validate from '@awsless/validate';
3
4
  import { Duration } from '@awsless/duration';
4
5
  import { QoS } from '@awsless/iot';
5
6
  export { QoS } from '@awsless/iot';
@@ -33,7 +34,7 @@ declare const mockFunction: (cb: (mock: FunctionMock) => void) => FunctionMockRe
33
34
 
34
35
  declare const mockMetric: () => void;
35
36
 
36
- declare const mockPubSub: () => vitest.Mock<any, any>;
37
+ declare const mockPubSub: () => vitest.Mock;
37
38
 
38
39
  interface QueueMock {
39
40
  }
@@ -98,8 +99,22 @@ interface MetricResources {
98
99
  }
99
100
  declare const Metric: MetricResources;
100
101
 
101
- declare const onFailureName: string;
102
- declare const onFailureArn: string;
102
+ declare const onErrorLogSchema: _awsless_validate.ObjectSchema<{
103
+ readonly hash: _awsless_validate.StringSchema<undefined>;
104
+ readonly requestId: _awsless_validate.StringSchema<undefined>;
105
+ readonly origin: _awsless_validate.StringSchema<undefined>;
106
+ readonly level: _awsless_validate.PicklistSchema<["warn", "error", "fatal"], undefined>;
107
+ readonly type: _awsless_validate.StringSchema<undefined>;
108
+ readonly message: _awsless_validate.StringSchema<undefined>;
109
+ readonly stackTrace: _awsless_validate.OptionalSchema<_awsless_validate.StringSchema<undefined>, undefined>;
110
+ readonly data: _awsless_validate.OptionalSchema<_awsless_validate.UnknownSchema, undefined>;
111
+ readonly date: _awsless_validate.DateSchema<undefined>;
112
+ }, undefined>;
113
+
114
+ declare const onFailureBucketName: string;
115
+ declare const onFailureQueueName: string;
116
+ declare const onFailureBucketArn: string;
117
+ declare const onFailureQueueArn: string;
103
118
 
104
119
  declare const getPubSubTopic: <N extends string>(name: N) => `app/pubsub/${N}`;
105
120
 
@@ -176,4 +191,4 @@ declare const Topic: TopicResources;
176
191
  declare const APP: "app";
177
192
  declare const STACK: "stack";
178
193
 
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 };
194
+ 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, onErrorLogSchema, onFailureBucketArn, onFailureBucketName, onFailureQueueArn, onFailureQueueName, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
package/dist/server.js CHANGED
@@ -256,12 +256,17 @@ import { invoke as invoke2 } from "@awsless/lambda";
256
256
  import { schedule } from "@awsless/scheduler";
257
257
 
258
258
  // src/lib/server/on-failure.ts
259
- var onFailureName = build({
259
+ var onFailureBucketName = build({
260
260
  resourceType: "on-failure",
261
261
  resourceName: "failure",
262
262
  postfix: APP_ID
263
263
  });
264
- var onFailureArn = `arn:aws:s3:::${onFailureName}`;
264
+ var onFailureQueueName = build({
265
+ resourceType: "on-failure",
266
+ resourceName: "failure"
267
+ });
268
+ var onFailureBucketArn = `arn:aws:s3:::${onFailureBucketName}`;
269
+ var onFailureQueueArn = `arn:aws:sqs:${REGION}:${ACCOUNT_ID}:${onFailureQueueName}`;
265
270
 
266
271
  // src/lib/server/task.ts
267
272
  var getTaskName = bindLocalResourceName("task");
@@ -278,7 +283,7 @@ var Task = /* @__PURE__ */ createProxy((stackName) => {
278
283
  schedule: options.schedule,
279
284
  group: resourceTaskName("group"),
280
285
  roleArn: `arn:aws:iam::${process.env.AWS_ACCOUNT_ID}:role/${resourceTaskName("schedule")}`,
281
- deadLetterArn: onFailureArn
286
+ deadLetterArn: onFailureQueueArn
282
287
  });
283
288
  } else {
284
289
  await invoke2({
@@ -543,6 +548,20 @@ var Metric = /* @__PURE__ */ createProxy((stack) => {
543
548
  });
544
549
  });
545
550
 
551
+ // src/lib/server/on-error-log.ts
552
+ import { date, object, optional, picklist, string, unknown } from "@awsless/validate";
553
+ var onErrorLogSchema = object({
554
+ hash: string(),
555
+ requestId: string(),
556
+ origin: string(),
557
+ level: picklist(["warn", "error", "fatal"]),
558
+ type: string(),
559
+ message: string(),
560
+ stackTrace: optional(string()),
561
+ data: optional(unknown()),
562
+ date: date()
563
+ });
564
+
546
565
  // src/lib/server/pubsub.ts
547
566
  import { hours, toSeconds } from "@awsless/duration";
548
567
  import { publish as publish3, QoS } from "@awsless/iot";
@@ -676,15 +695,15 @@ var Store = /* @__PURE__ */ createProxy((stack) => {
676
695
  });
677
696
  },
678
697
  async get(key) {
679
- const object = await getObject({ bucket, key });
680
- if (object) {
681
- return object.body;
698
+ const object2 = await getObject({ bucket, key });
699
+ if (object2) {
700
+ return object2.body;
682
701
  }
683
702
  return void 0;
684
703
  },
685
704
  async has(key) {
686
- const object = await headObject({ bucket, key });
687
- return !!object;
705
+ const object2 = await headObject({ bucket, key });
706
+ return !!object2;
688
707
  },
689
708
  delete(key) {
690
709
  return deleteObject({ bucket, key });
@@ -746,8 +765,11 @@ export {
746
765
  mockQueue,
747
766
  mockTask,
748
767
  mockTopic,
749
- onFailureArn,
750
- onFailureName,
768
+ onErrorLogSchema,
769
+ onFailureBucketArn,
770
+ onFailureBucketName,
771
+ onFailureQueueArn,
772
+ onFailureQueueName,
751
773
  pubsubAuthorizerHandle,
752
774
  pubsubAuthorizerResponse,
753
775
  setConfigValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.657",
3
+ "version": "0.0.659",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -35,21 +35,21 @@
35
35
  "peerDependencies": {
36
36
  "@awsless/big-float": "^0.1.6",
37
37
  "@awsless/cloudwatch": "^0.0.1",
38
+ "@awsless/duration": "^0.0.4",
38
39
  "@awsless/clui": "^0.0.8",
39
- "@awsless/dynamodb": "^0.3.19",
40
- "@awsless/lambda": "^0.0.41",
40
+ "@awsless/dynamodb": "^0.3.20",
41
+ "@awsless/iot": "^0.0.5",
41
42
  "@awsless/json": "^0.0.11",
42
- "@awsless/duration": "^0.0.4",
43
- "@awsless/iot": "^0.0.3",
44
- "@awsless/s3": "^0.0.21",
43
+ "@awsless/lambda": "^0.0.42",
44
+ "@awsless/mqtt": "^0.0.5",
45
+ "@awsless/redis": "^0.0.16",
45
46
  "@awsless/sns": "^0.0.10",
46
- "@awsless/validate": "^0.1.6",
47
+ "@awsless/sqs": "^0.0.21",
47
48
  "@awsless/open-search": "^0.0.24",
48
- "@awsless/sqs": "^0.0.17",
49
- "@awsless/ssm": "^0.0.7",
50
- "@awsless/redis": "^0.0.16",
49
+ "@awsless/validate": "^0.1.7",
51
50
  "@awsless/weak-cache": "^0.0.1",
52
- "@awsless/mqtt": "^0.0.5"
51
+ "@awsless/s3": "^0.0.21",
52
+ "@awsless/ssm": "^0.0.7"
53
53
  },
54
54
  "dependencies": {
55
55
  "@aws-sdk/client-cloudformation": "^3.369.0",
@@ -114,15 +114,15 @@
114
114
  "zip-a-folder": "^3.1.6",
115
115
  "zod": "^3.24.2",
116
116
  "zod-to-json-schema": "^3.24.3",
117
+ "@awsless/cloudwatch": "^0.0.1",
117
118
  "@awsless/big-float": "^0.1.6",
118
119
  "@awsless/clui": "^0.0.8",
119
- "@awsless/cloudwatch": "^0.0.1",
120
120
  "@awsless/duration": "^0.0.4",
121
- "@awsless/json": "^0.0.11",
122
- "@awsless/ts-file-cache": "^0.0.12",
123
121
  "@awsless/size": "^0.0.2",
124
- "@awsless/validate": "^0.1.6",
125
- "@awsless/scheduler": "^0.0.4"
122
+ "@awsless/scheduler": "^0.0.4",
123
+ "@awsless/validate": "^0.1.7",
124
+ "@awsless/json": "^0.0.11",
125
+ "@awsless/ts-file-cache": "^0.0.12"
126
126
  },
127
127
  "devDependencies": {
128
128
  "@hono/node-server": "1.19.9",