@awsless/validate 0.0.15 → 0.0.16
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.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -4,10 +4,10 @@ export * from 'valibot';
|
|
|
4
4
|
import { BigFloat } from '@awsless/big-float';
|
|
5
5
|
import { UUID } from 'crypto';
|
|
6
6
|
import { DurationFormat, Duration } from '@awsless/duration';
|
|
7
|
-
import {
|
|
7
|
+
import { AnyTable, PrimaryKey } from '@awsless/dynamodb';
|
|
8
8
|
|
|
9
9
|
type JsonSchema<T extends BaseSchema> = SchemaWithTransform<StringSchema, Output<T>>;
|
|
10
|
-
declare const json: <T extends BaseSchema
|
|
10
|
+
declare const json: <T extends BaseSchema>(schema: T) => JsonSchema<T>;
|
|
11
11
|
|
|
12
12
|
type BigFloatSchema = BaseSchema<string | number | BigFloat | {
|
|
13
13
|
exponent: number;
|
|
@@ -36,7 +36,7 @@ type SqsQueueSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S>
|
|
|
36
36
|
body: string | Input<S>;
|
|
37
37
|
}[];
|
|
38
38
|
}, Output<S>[]>;
|
|
39
|
-
declare const sqsQueue: <S extends BaseSchema
|
|
39
|
+
declare const sqsQueue: <S extends BaseSchema = UnknownSchema<unknown>>(body?: S) => SqsQueueSchema<S>;
|
|
40
40
|
|
|
41
41
|
type SnsTopicSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S> | Input<S>[] | {
|
|
42
42
|
Records: {
|
|
@@ -45,10 +45,10 @@ type SnsTopicSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S>
|
|
|
45
45
|
};
|
|
46
46
|
}[];
|
|
47
47
|
}, Output<S>[]>;
|
|
48
|
-
declare const snsTopic: <S extends BaseSchema
|
|
48
|
+
declare const snsTopic: <S extends BaseSchema = UnknownSchema<unknown>>(body?: S) => SnsTopicSchema<S>;
|
|
49
49
|
|
|
50
50
|
type EventName = 'MODIFY' | 'INSERT' | 'REMOVE';
|
|
51
|
-
type DynamoDBStreamSchema<T extends
|
|
51
|
+
type DynamoDBStreamSchema<T extends AnyTable> = BaseSchema<{
|
|
52
52
|
Records: {
|
|
53
53
|
eventName: EventName;
|
|
54
54
|
dynamodb: {
|
|
@@ -63,7 +63,7 @@ type DynamoDBStreamSchema<T extends TableDefinition<any, any, any, any>> = BaseS
|
|
|
63
63
|
old?: T['schema']['OUTPUT'];
|
|
64
64
|
new?: T['schema']['OUTPUT'];
|
|
65
65
|
}[]>;
|
|
66
|
-
declare const dynamoDbStream: <T extends
|
|
66
|
+
declare const dynamoDbStream: <T extends AnyTable>(table: T) => DynamoDBStreamSchema<T>;
|
|
67
67
|
|
|
68
68
|
declare function positive<T extends BigFloat | number>(error?: ErrorMessage): valibot.CustomValidation<T>;
|
|
69
69
|
|
|
@@ -74,4 +74,4 @@ declare function unique<T extends any[]>(compare?: (a: T[number], b: T[number])
|
|
|
74
74
|
declare function minDuration<T extends Duration>(min: Duration, error?: ErrorMessage): valibot.CustomValidation<T>;
|
|
75
75
|
declare function maxDuration<T extends Duration>(max: Duration, error?: ErrorMessage): valibot.CustomValidation<T>;
|
|
76
76
|
|
|
77
|
-
export { BigFloatSchema, BigIntSchema, DateSchema, DurationSchema, DynamoDBStreamSchema, JsonSchema, SnsTopicSchema, SqsQueueSchema, UuidSchema, bigfloat, bigint, date, duration, dynamoDbStream, json, maxDuration, minDuration, positive, precision, snsTopic, sqsQueue, unique, uuid };
|
|
77
|
+
export { type BigFloatSchema, type BigIntSchema, type DateSchema, type DurationSchema, type DynamoDBStreamSchema, type JsonSchema, type SnsTopicSchema, type SqsQueueSchema, type UuidSchema, bigfloat, bigint, date, duration, dynamoDbStream, json, maxDuration, minDuration, positive, precision, snsTopic, sqsQueue, unique, uuid };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export * from 'valibot';
|
|
|
4
4
|
import { BigFloat } from '@awsless/big-float';
|
|
5
5
|
import { UUID } from 'crypto';
|
|
6
6
|
import { DurationFormat, Duration } from '@awsless/duration';
|
|
7
|
-
import {
|
|
7
|
+
import { AnyTable, PrimaryKey } from '@awsless/dynamodb';
|
|
8
8
|
|
|
9
9
|
type JsonSchema<T extends BaseSchema> = SchemaWithTransform<StringSchema, Output<T>>;
|
|
10
|
-
declare const json: <T extends BaseSchema
|
|
10
|
+
declare const json: <T extends BaseSchema>(schema: T) => JsonSchema<T>;
|
|
11
11
|
|
|
12
12
|
type BigFloatSchema = BaseSchema<string | number | BigFloat | {
|
|
13
13
|
exponent: number;
|
|
@@ -36,7 +36,7 @@ type SqsQueueSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S>
|
|
|
36
36
|
body: string | Input<S>;
|
|
37
37
|
}[];
|
|
38
38
|
}, Output<S>[]>;
|
|
39
|
-
declare const sqsQueue: <S extends BaseSchema
|
|
39
|
+
declare const sqsQueue: <S extends BaseSchema = UnknownSchema<unknown>>(body?: S) => SqsQueueSchema<S>;
|
|
40
40
|
|
|
41
41
|
type SnsTopicSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S> | Input<S>[] | {
|
|
42
42
|
Records: {
|
|
@@ -45,10 +45,10 @@ type SnsTopicSchema<S extends BaseSchema = UnknownSchema> = BaseSchema<Input<S>
|
|
|
45
45
|
};
|
|
46
46
|
}[];
|
|
47
47
|
}, Output<S>[]>;
|
|
48
|
-
declare const snsTopic: <S extends BaseSchema
|
|
48
|
+
declare const snsTopic: <S extends BaseSchema = UnknownSchema<unknown>>(body?: S) => SnsTopicSchema<S>;
|
|
49
49
|
|
|
50
50
|
type EventName = 'MODIFY' | 'INSERT' | 'REMOVE';
|
|
51
|
-
type DynamoDBStreamSchema<T extends
|
|
51
|
+
type DynamoDBStreamSchema<T extends AnyTable> = BaseSchema<{
|
|
52
52
|
Records: {
|
|
53
53
|
eventName: EventName;
|
|
54
54
|
dynamodb: {
|
|
@@ -63,7 +63,7 @@ type DynamoDBStreamSchema<T extends TableDefinition<any, any, any, any>> = BaseS
|
|
|
63
63
|
old?: T['schema']['OUTPUT'];
|
|
64
64
|
new?: T['schema']['OUTPUT'];
|
|
65
65
|
}[]>;
|
|
66
|
-
declare const dynamoDbStream: <T extends
|
|
66
|
+
declare const dynamoDbStream: <T extends AnyTable>(table: T) => DynamoDBStreamSchema<T>;
|
|
67
67
|
|
|
68
68
|
declare function positive<T extends BigFloat | number>(error?: ErrorMessage): valibot.CustomValidation<T>;
|
|
69
69
|
|
|
@@ -74,4 +74,4 @@ declare function unique<T extends any[]>(compare?: (a: T[number], b: T[number])
|
|
|
74
74
|
declare function minDuration<T extends Duration>(min: Duration, error?: ErrorMessage): valibot.CustomValidation<T>;
|
|
75
75
|
declare function maxDuration<T extends Duration>(max: Duration, error?: ErrorMessage): valibot.CustomValidation<T>;
|
|
76
76
|
|
|
77
|
-
export { BigFloatSchema, BigIntSchema, DateSchema, DurationSchema, DynamoDBStreamSchema, JsonSchema, SnsTopicSchema, SqsQueueSchema, UuidSchema, bigfloat, bigint, date, duration, dynamoDbStream, json, maxDuration, minDuration, positive, precision, snsTopic, sqsQueue, unique, uuid };
|
|
77
|
+
export { type BigFloatSchema, type BigIntSchema, type DateSchema, type DurationSchema, type DynamoDBStreamSchema, type JsonSchema, type SnsTopicSchema, type SqsQueueSchema, type UuidSchema, bigfloat, bigint, date, duration, dynamoDbStream, json, maxDuration, minDuration, positive, precision, snsTopic, sqsQueue, unique, uuid };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/validate",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@awsless/big-float": "^0.0.4",
|
|
28
|
-
"@awsless/
|
|
29
|
-
"@awsless/
|
|
28
|
+
"@awsless/dynamodb": "^0.1.1",
|
|
29
|
+
"@awsless/duration": "^0.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@awsless/big-float": "^0.0.4",
|
|
33
|
-
"@awsless/dynamodb": "^0.
|
|
33
|
+
"@awsless/dynamodb": "^0.1.1",
|
|
34
34
|
"@awsless/duration": "^0.0.1"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|