@awsless/validate 0.0.13 → 0.0.14

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.
package/dist/index.cjs CHANGED
@@ -173,12 +173,6 @@ var snsTopic = (body) => {
173
173
 
174
174
  // src/schema/aws/dynamodb-stream.ts
175
175
  var import_valibot8 = require("valibot");
176
- var EventName = /* @__PURE__ */ ((EventName2) => {
177
- EventName2["modify"] = "MODIFY";
178
- EventName2["insert"] = "INSERT";
179
- EventName2["remove"] = "REMOVE";
180
- return EventName2;
181
- })(EventName || {});
182
176
  var dynamoDbStream = (table) => {
183
177
  const marshall = () => (0, import_valibot8.transform)((0, import_valibot8.unknown)(), (value) => table.unmarshall(value));
184
178
  return (0, import_valibot8.transform)(
@@ -186,8 +180,7 @@ var dynamoDbStream = (table) => {
186
180
  {
187
181
  Records: (0, import_valibot8.array)(
188
182
  (0, import_valibot8.object)({
189
- eventName: (0, import_valibot8.enum_)(EventName),
190
- // eventName: picklist(['MODIFY', 'INSERT', 'REMOVE']),
183
+ eventName: (0, import_valibot8.union)([(0, import_valibot8.literal)("MODIFY"), (0, import_valibot8.literal)("INSERT"), (0, import_valibot8.literal)("REMOVE")]),
191
184
  dynamodb: (0, import_valibot8.object)({
192
185
  Keys: marshall(),
193
186
  OldImage: (0, import_valibot8.optional)(marshall()),
package/dist/index.d.cts CHANGED
@@ -43,11 +43,7 @@ type SnsTopicSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S>
43
43
  }, Output<S>[]>;
44
44
  declare const snsTopic: <S extends BaseSchema<any, any> = UnknownSchema<unknown>>(body?: S | undefined) => SnsTopicSchema<S>;
45
45
 
46
- declare enum EventName {
47
- modify = "MODIFY",
48
- insert = "INSERT",
49
- remove = "REMOVE"
50
- }
46
+ type EventName = 'MODIFY' | 'INSERT' | 'REMOVE';
51
47
  type DynamoDBStreamSchema<T extends TableDefinition<any, any, any, any>> = BaseSchema<{
52
48
  Records: {
53
49
  eventName: EventName;
package/dist/index.d.ts CHANGED
@@ -43,11 +43,7 @@ type SnsTopicSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S>
43
43
  }, Output<S>[]>;
44
44
  declare const snsTopic: <S extends BaseSchema<any, any> = UnknownSchema<unknown>>(body?: S | undefined) => SnsTopicSchema<S>;
45
45
 
46
- declare enum EventName {
47
- modify = "MODIFY",
48
- insert = "INSERT",
49
- remove = "REMOVE"
50
- }
46
+ type EventName = 'MODIFY' | 'INSERT' | 'REMOVE';
51
47
  type DynamoDBStreamSchema<T extends TableDefinition<any, any, any, any>> = BaseSchema<{
52
48
  Records: {
53
49
  eventName: EventName;
package/dist/index.js CHANGED
@@ -145,13 +145,7 @@ var snsTopic = (body) => {
145
145
  };
146
146
 
147
147
  // src/schema/aws/dynamodb-stream.ts
148
- import { array as array3, object as object4, optional, enum_, transform as transform8, unknown as unknown3 } from "valibot";
149
- var EventName = /* @__PURE__ */ ((EventName2) => {
150
- EventName2["modify"] = "MODIFY";
151
- EventName2["insert"] = "INSERT";
152
- EventName2["remove"] = "REMOVE";
153
- return EventName2;
154
- })(EventName || {});
148
+ import { array as array3, object as object4, optional, transform as transform8, unknown as unknown3, union as union5, literal } from "valibot";
155
149
  var dynamoDbStream = (table) => {
156
150
  const marshall = () => transform8(unknown3(), (value) => table.unmarshall(value));
157
151
  return transform8(
@@ -159,8 +153,7 @@ var dynamoDbStream = (table) => {
159
153
  {
160
154
  Records: array3(
161
155
  object4({
162
- eventName: enum_(EventName),
163
- // eventName: picklist(['MODIFY', 'INSERT', 'REMOVE']),
156
+ eventName: union5([literal("MODIFY"), literal("INSERT"), literal("REMOVE")]),
164
157
  dynamodb: object4({
165
158
  Keys: marshall(),
166
159
  OldImage: optional(marshall()),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/validate",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -34,7 +34,7 @@
34
34
  "@awsless/dynamodb": "^0.0.42"
35
35
  },
36
36
  "dependencies": {
37
- "valibot": "^0.29.0"
37
+ "valibot": "^0.30.0"
38
38
  },
39
39
  "scripts": {
40
40
  "test": "pnpm code test",