@webstir-io/module-contract 0.1.13
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/LICENSE +21 -0
- package/README.md +220 -0
- package/dist/adapters/ts-rest.d.ts +38 -0
- package/dist/adapters/ts-rest.js +147 -0
- package/dist/index.d.ts +1517 -0
- package/dist/index.js +109 -0
- package/package.json +64 -0
- package/schema/module-error.schema.json +35 -0
- package/schema/module-manifest.schema.json +357 -0
- package/schema/route-definition.schema.json +165 -0
- package/schema/route-input.schema.json +45 -0
- package/schema/route-output.schema.json +47 -0
- package/schema/view-definition.schema.json +88 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/route-definition",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"route-definition": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"minLength": 1
|
|
10
|
+
},
|
|
11
|
+
"method": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": [
|
|
14
|
+
"GET",
|
|
15
|
+
"HEAD",
|
|
16
|
+
"POST",
|
|
17
|
+
"PUT",
|
|
18
|
+
"PATCH",
|
|
19
|
+
"DELETE",
|
|
20
|
+
"OPTIONS"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"path": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"minLength": 1
|
|
26
|
+
},
|
|
27
|
+
"summary": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"description": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"tags": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"items": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"input": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"params": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"kind": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": [
|
|
48
|
+
"zod",
|
|
49
|
+
"json-schema",
|
|
50
|
+
"ts-rest"
|
|
51
|
+
],
|
|
52
|
+
"default": "zod"
|
|
53
|
+
},
|
|
54
|
+
"name": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"source": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": [
|
|
62
|
+
"name"
|
|
63
|
+
],
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
},
|
|
66
|
+
"query": {
|
|
67
|
+
"$ref": "#/definitions/route-definition/properties/input/properties/params"
|
|
68
|
+
},
|
|
69
|
+
"body": {
|
|
70
|
+
"$ref": "#/definitions/route-definition/properties/input/properties/params"
|
|
71
|
+
},
|
|
72
|
+
"headers": {
|
|
73
|
+
"$ref": "#/definitions/route-definition/properties/input/properties/params"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"additionalProperties": false
|
|
77
|
+
},
|
|
78
|
+
"output": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"properties": {
|
|
81
|
+
"body": {
|
|
82
|
+
"$ref": "#/definitions/route-definition/properties/input/properties/params"
|
|
83
|
+
},
|
|
84
|
+
"status": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 100,
|
|
87
|
+
"maximum": 599
|
|
88
|
+
},
|
|
89
|
+
"headers": {
|
|
90
|
+
"$ref": "#/definitions/route-definition/properties/input/properties/params"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": [
|
|
94
|
+
"body"
|
|
95
|
+
],
|
|
96
|
+
"additionalProperties": false
|
|
97
|
+
},
|
|
98
|
+
"errors": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"items": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"properties": {
|
|
103
|
+
"code": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"enum": [
|
|
106
|
+
"validation",
|
|
107
|
+
"auth",
|
|
108
|
+
"not_found",
|
|
109
|
+
"domain",
|
|
110
|
+
"conflict",
|
|
111
|
+
"internal"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"message": {
|
|
115
|
+
"type": "string"
|
|
116
|
+
},
|
|
117
|
+
"details": {},
|
|
118
|
+
"cause": {},
|
|
119
|
+
"correlationId": {
|
|
120
|
+
"type": "string"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"required": [
|
|
124
|
+
"code",
|
|
125
|
+
"message"
|
|
126
|
+
],
|
|
127
|
+
"additionalProperties": false
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"renderMode": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"enum": [
|
|
133
|
+
"ssg",
|
|
134
|
+
"ssr",
|
|
135
|
+
"spa"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"staticPaths": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"items": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"minLength": 1
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"ssg": {
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"revalidateSeconds": {
|
|
149
|
+
"type": "integer",
|
|
150
|
+
"exclusiveMinimum": 0
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"additionalProperties": false
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"required": [
|
|
157
|
+
"name",
|
|
158
|
+
"method",
|
|
159
|
+
"path"
|
|
160
|
+
],
|
|
161
|
+
"additionalProperties": false
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
165
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/route-input",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"route-input": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"params": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"kind": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": [
|
|
13
|
+
"zod",
|
|
14
|
+
"json-schema",
|
|
15
|
+
"ts-rest"
|
|
16
|
+
],
|
|
17
|
+
"default": "zod"
|
|
18
|
+
},
|
|
19
|
+
"name": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"source": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"required": [
|
|
27
|
+
"name"
|
|
28
|
+
],
|
|
29
|
+
"additionalProperties": false
|
|
30
|
+
},
|
|
31
|
+
"query": {
|
|
32
|
+
"$ref": "#/definitions/route-input/properties/params"
|
|
33
|
+
},
|
|
34
|
+
"body": {
|
|
35
|
+
"$ref": "#/definitions/route-input/properties/params"
|
|
36
|
+
},
|
|
37
|
+
"headers": {
|
|
38
|
+
"$ref": "#/definitions/route-input/properties/params"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
45
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/route-output",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"route-output": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"body": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"kind": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": [
|
|
13
|
+
"zod",
|
|
14
|
+
"json-schema",
|
|
15
|
+
"ts-rest"
|
|
16
|
+
],
|
|
17
|
+
"default": "zod"
|
|
18
|
+
},
|
|
19
|
+
"name": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"source": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"required": [
|
|
27
|
+
"name"
|
|
28
|
+
],
|
|
29
|
+
"additionalProperties": false
|
|
30
|
+
},
|
|
31
|
+
"status": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 100,
|
|
34
|
+
"maximum": 599
|
|
35
|
+
},
|
|
36
|
+
"headers": {
|
|
37
|
+
"$ref": "#/definitions/route-output/properties/body"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": [
|
|
41
|
+
"body"
|
|
42
|
+
],
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
47
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/view-definition",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"view-definition": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"minLength": 1
|
|
10
|
+
},
|
|
11
|
+
"path": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1
|
|
14
|
+
},
|
|
15
|
+
"summary": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"description": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
},
|
|
21
|
+
"tags": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"params": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"kind": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"enum": [
|
|
33
|
+
"zod",
|
|
34
|
+
"json-schema",
|
|
35
|
+
"ts-rest"
|
|
36
|
+
],
|
|
37
|
+
"default": "zod"
|
|
38
|
+
},
|
|
39
|
+
"name": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
},
|
|
42
|
+
"source": {
|
|
43
|
+
"type": "string"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": [
|
|
47
|
+
"name"
|
|
48
|
+
],
|
|
49
|
+
"additionalProperties": false
|
|
50
|
+
},
|
|
51
|
+
"data": {
|
|
52
|
+
"$ref": "#/definitions/view-definition/properties/params"
|
|
53
|
+
},
|
|
54
|
+
"renderMode": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"enum": [
|
|
57
|
+
"ssg",
|
|
58
|
+
"ssr",
|
|
59
|
+
"spa"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"staticPaths": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"minLength": 1
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"ssg": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"revalidateSeconds": {
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"exclusiveMinimum": 0
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"additionalProperties": false
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"required": [
|
|
81
|
+
"name",
|
|
82
|
+
"path"
|
|
83
|
+
],
|
|
84
|
+
"additionalProperties": false
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
88
|
+
}
|