@awsless/awsless 0.0.658 → 0.0.660

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,6 +99,18 @@ interface MetricResources {
98
99
  }
99
100
  declare const Metric: MetricResources;
100
101
 
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
+
101
114
  declare const onFailureBucketName: string;
102
115
  declare const onFailureQueueName: string;
103
116
  declare const onFailureBucketArn: string;
@@ -178,4 +191,4 @@ declare const Topic: TopicResources;
178
191
  declare const APP: "app";
179
192
  declare const STACK: "stack";
180
193
 
181
- 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, onFailureBucketArn, onFailureBucketName, onFailureQueueArn, onFailureQueueName, 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
@@ -548,6 +548,20 @@ var Metric = /* @__PURE__ */ createProxy((stack) => {
548
548
  });
549
549
  });
550
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
+
551
565
  // src/lib/server/pubsub.ts
552
566
  import { hours, toSeconds } from "@awsless/duration";
553
567
  import { publish as publish3, QoS } from "@awsless/iot";
@@ -681,15 +695,15 @@ var Store = /* @__PURE__ */ createProxy((stack) => {
681
695
  });
682
696
  },
683
697
  async get(key) {
684
- const object = await getObject({ bucket, key });
685
- if (object) {
686
- return object.body;
698
+ const object2 = await getObject({ bucket, key });
699
+ if (object2) {
700
+ return object2.body;
687
701
  }
688
702
  return void 0;
689
703
  },
690
704
  async has(key) {
691
- const object = await headObject({ bucket, key });
692
- return !!object;
705
+ const object2 = await headObject({ bucket, key });
706
+ return !!object2;
693
707
  },
694
708
  delete(key) {
695
709
  return deleteObject({ bucket, key });
@@ -751,6 +765,7 @@ export {
751
765
  mockQueue,
752
766
  mockTask,
753
767
  mockTopic,
768
+ onErrorLogSchema,
754
769
  onFailureBucketArn,
755
770
  onFailureBucketName,
756
771
  onFailureQueueArn,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.658",
3
+ "version": "0.0.660",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -33,23 +33,23 @@
33
33
  ]
34
34
  },
35
35
  "peerDependencies": {
36
- "@awsless/big-float": "^0.1.6",
37
36
  "@awsless/cloudwatch": "^0.0.1",
38
- "@awsless/clui": "^0.0.8",
39
- "@awsless/duration": "^0.0.4",
40
- "@awsless/dynamodb": "^0.3.19",
37
+ "@awsless/dynamodb": "^0.3.20",
38
+ "@awsless/iot": "^0.0.5",
41
39
  "@awsless/json": "^0.0.11",
42
- "@awsless/lambda": "^0.0.41",
43
- "@awsless/iot": "^0.0.3",
40
+ "@awsless/lambda": "^0.0.42",
44
41
  "@awsless/mqtt": "^0.0.5",
45
42
  "@awsless/open-search": "^0.0.24",
43
+ "@awsless/clui": "^0.0.8",
44
+ "@awsless/duration": "^0.0.4",
45
+ "@awsless/big-float": "^0.1.6",
46
46
  "@awsless/redis": "^0.0.16",
47
+ "@awsless/sqs": "^0.0.21",
47
48
  "@awsless/s3": "^0.0.21",
48
49
  "@awsless/sns": "^0.0.10",
49
- "@awsless/sqs": "^0.0.17",
50
- "@awsless/ssm": "^0.0.7",
51
50
  "@awsless/validate": "^0.1.7",
52
- "@awsless/weak-cache": "^0.0.1"
51
+ "@awsless/weak-cache": "^0.0.1",
52
+ "@awsless/ssm": "^0.0.7"
53
53
  },
54
54
  "dependencies": {
55
55
  "@aws-sdk/client-cloudformation": "^3.369.0",
@@ -116,13 +116,13 @@
116
116
  "zod-to-json-schema": "^3.24.3",
117
117
  "@awsless/big-float": "^0.1.6",
118
118
  "@awsless/cloudwatch": "^0.0.1",
119
- "@awsless/clui": "^0.0.8",
120
- "@awsless/duration": "^0.0.4",
121
- "@awsless/json": "^0.0.11",
122
119
  "@awsless/scheduler": "^0.0.4",
123
120
  "@awsless/size": "^0.0.2",
124
121
  "@awsless/validate": "^0.1.7",
125
- "@awsless/ts-file-cache": "^0.0.12"
122
+ "@awsless/ts-file-cache": "^0.0.12",
123
+ "@awsless/clui": "^0.0.8",
124
+ "@awsless/json": "^0.0.11",
125
+ "@awsless/duration": "^0.0.4"
126
126
  },
127
127
  "devDependencies": {
128
128
  "@hono/node-server": "1.19.9",