create-zuplo-api 6.53.0 → 6.54.0

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.
Files changed (31) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/templates/default/config/policies.json +11 -1
  3. package/dist/templates/default/config/routes.oas.json +266 -12
  4. package/dist/templates/default/vscode/settings.json +0 -7
  5. package/package.json +1 -1
  6. package/dist/templates/default/config/dev-portal.json +0 -5
  7. package/dist/templates/default/docs/index.md +0 -43
  8. package/dist/templates/default/docs/sidebar.json +0 -13
  9. package/dist/templates/default/docs/theme.css +0 -29
  10. package/dist/templates/default-zudoku/README-template.md +0 -29
  11. package/dist/templates/default-zudoku/config/policies.json +0 -13
  12. package/dist/templates/default-zudoku/config/routes.oas.json +0 -284
  13. package/dist/templates/default-zudoku/env.example +0 -2
  14. package/dist/templates/default-zudoku/eslintrc.json +0 -7
  15. package/dist/templates/default-zudoku/gitignore +0 -10
  16. package/dist/templates/default-zudoku/modules/hello-world.ts +0 -21
  17. package/dist/templates/default-zudoku/prettierrc.json +0 -1
  18. package/dist/templates/default-zudoku/tsconfig.json +0 -19
  19. package/dist/templates/default-zudoku/vscode/launch.json +0 -37
  20. package/dist/templates/default-zudoku/vscode/settings.json +0 -20
  21. package/dist/templates/default-zudoku/zuplo.jsonc +0 -4
  22. /package/dist/templates/{default-zudoku → default}/docs/README-template.md +0 -0
  23. /package/dist/templates/{default-zudoku → default}/docs/gitignore +0 -0
  24. /package/dist/templates/{default-zudoku → default}/docs/pages/banner-dark.svg +0 -0
  25. /package/dist/templates/{default-zudoku → default}/docs/pages/banner.svg +0 -0
  26. /package/dist/templates/{default-zudoku → default}/docs/pages/introduction.mdx +0 -0
  27. /package/dist/templates/{default-zudoku → default}/docs/pages/markdown.mdx +0 -0
  28. /package/dist/templates/{default-zudoku → default}/docs/public/logodark.svg +0 -0
  29. /package/dist/templates/{default-zudoku → default}/docs/public/logolight.svg +0 -0
  30. /package/dist/templates/{default-zudoku → default}/docs/tsconfig.json +0 -0
  31. /package/dist/templates/{default-zudoku → default}/docs/zudoku.config.tsx +0 -0
@@ -1,3 +1,13 @@
1
1
  {
2
- "policies": []
2
+ "policies": [
3
+ {
4
+ "handler": {
5
+ "export": "MockApiInboundPolicy",
6
+ "module": "$import(@zuplo/runtime)",
7
+ "options": {}
8
+ },
9
+ "name": "mock-api-inbound",
10
+ "policyType": "mock-api-inbound"
11
+ }
12
+ ]
3
13
  }
@@ -5,25 +5,279 @@
5
5
  "title": "My Zuplo API"
6
6
  },
7
7
  "paths": {
8
- "/hello": {
9
- "x-zuplo-path": {
10
- "pathMode": "open-api"
11
- },
8
+ "/todos": {
12
9
  "get": {
13
- "summary": "Hello World",
14
- "description": "This is the first route to say hello",
10
+ "summary": "Get all todos",
11
+ "description": "**Retrieves a complete list of all todo items** from the system. This endpoint returns all todos regardless of their completion status or owner, making it useful for displaying comprehensive todo lists or performing bulk operations.",
12
+ "responses": {
13
+ "200": {
14
+ "description": "A list of todos",
15
+ "content": {
16
+ "application/json": {
17
+ "schema": {
18
+ "type": "array",
19
+ "items": {
20
+ "$ref": "#/components/schemas/Todo"
21
+ }
22
+ },
23
+ "examples": {
24
+ "mixed_todos": {
25
+ "summary": "A list of todos with different completion states",
26
+ "value": [
27
+ {
28
+ "id": 1,
29
+ "title": "Buy groceries",
30
+ "completed": false,
31
+ "userId": 123
32
+ },
33
+ {
34
+ "id": 2,
35
+ "title": "Write documentation",
36
+ "completed": true,
37
+ "userId": 456
38
+ },
39
+ {
40
+ "id": 3,
41
+ "title": "Review pull requests",
42
+ "completed": false,
43
+ "userId": 123
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "operationId": "1e0edd2a-8d53-4355-805f-54b7e5555725",
15
53
  "x-zuplo-route": {
16
54
  "corsPolicy": "none",
17
55
  "handler": {
18
- "export": "default",
19
- "module": "$import(./modules/hello-world)",
20
- "options": {}
56
+ "export": "urlForwardHandler",
57
+ "module": "$import(@zuplo/runtime)",
58
+ "options": {
59
+ "baseUrl": "https://todo-mock-main-b63f096.zuplo.app"
60
+ }
61
+ }
62
+ },
63
+ "tags": ["Todo"]
64
+ },
65
+ "post": {
66
+ "summary": "Create a new todo",
67
+ "description": "**Creates a new todo item** with the provided details. The todo will be assigned a unique ID automatically and can include a title, completion status, and user association. This is the primary endpoint for adding new tasks to the system.",
68
+ "requestBody": {
69
+ "required": true,
70
+ "content": {
71
+ "application/json": {
72
+ "schema": {
73
+ "$ref": "#/components/schemas/CreateTodo"
74
+ }
75
+ }
76
+ }
77
+ },
78
+ "responses": {
79
+ "201": {
80
+ "description": "Todo created successfully",
81
+ "content": {
82
+ "application/json": {
83
+ "schema": {
84
+ "$ref": "#/components/schemas/Todo"
85
+ },
86
+ "examples": {
87
+ "new_todo": {
88
+ "summary": "A newly created todo",
89
+ "value": {
90
+ "id": 4,
91
+ "title": "Deploy application",
92
+ "completed": false,
93
+ "userId": 789
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
21
99
  },
22
- "policies": {
23
- "inbound": []
100
+ "400": {
101
+ "description": "Invalid request body"
24
102
  }
25
103
  },
26
- "operationId": "004ff0e0-30cf-41a7-9e9f-zuplo35e3f725"
104
+ "operationId": "55ee860b-fe7e-4d66-a228-bb5320c3305d",
105
+ "x-zuplo-route": {
106
+ "corsPolicy": "none",
107
+ "handler": {
108
+ "export": "urlForwardHandler",
109
+ "module": "$import(@zuplo/runtime)",
110
+ "options": {
111
+ "baseUrl": "https://todo-mock-main-b63f096.zuplo.app"
112
+ }
113
+ }
114
+ },
115
+ "tags": ["Todo"]
116
+ }
117
+ },
118
+ "/todos/{id}": {
119
+ "put": {
120
+ "summary": "Update a todo",
121
+ "description": "**Updates an existing todo item** by its unique identifier. You can modify any combination of the todo's properties including title, completion status, and user assignment. All changes are applied atomically to ensure data consistency.",
122
+ "parameters": [
123
+ {
124
+ "name": "id",
125
+ "in": "path",
126
+ "required": true,
127
+ "schema": {
128
+ "type": "integer"
129
+ },
130
+ "description": "The todo ID"
131
+ }
132
+ ],
133
+ "requestBody": {
134
+ "required": true,
135
+ "content": {
136
+ "application/json": {
137
+ "schema": {
138
+ "$ref": "#/components/schemas/UpdateTodo"
139
+ }
140
+ }
141
+ }
142
+ },
143
+ "responses": {
144
+ "200": {
145
+ "description": "Todo updated successfully",
146
+ "content": {
147
+ "application/json": {
148
+ "schema": {
149
+ "$ref": "#/components/schemas/Todo"
150
+ },
151
+ "examples": {
152
+ "updated_todo": {
153
+ "summary": "A todo that has been updated",
154
+ "value": {
155
+ "id": 1,
156
+ "title": "Buy groceries and cook dinner",
157
+ "completed": true,
158
+ "userId": 123
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
164
+ },
165
+ "400": {
166
+ "description": "Invalid request body"
167
+ },
168
+ "404": {
169
+ "description": "Todo not found"
170
+ }
171
+ },
172
+ "operationId": "4569a607-338e-4d66-80f7-17f911778b1d",
173
+ "x-zuplo-route": {
174
+ "corsPolicy": "none",
175
+ "handler": {
176
+ "export": "urlForwardHandler",
177
+ "module": "$import(@zuplo/runtime)",
178
+ "options": {
179
+ "baseUrl": "https://todo-mock-main-b63f096.zuplo.app"
180
+ }
181
+ }
182
+ },
183
+ "tags": ["Todo"]
184
+ },
185
+ "delete": {
186
+ "summary": "Delete a todo",
187
+ "description": "**Permanently removes a todo item** from the system using its unique identifier. This operation cannot be undone, so use with caution. The endpoint will return a 404 error if the specified todo does not exist.",
188
+ "parameters": [
189
+ {
190
+ "name": "id",
191
+ "in": "path",
192
+ "required": true,
193
+ "schema": {
194
+ "type": "integer"
195
+ },
196
+ "description": "The todo ID"
197
+ }
198
+ ],
199
+ "responses": {
200
+ "204": {
201
+ "description": "Todo deleted successfully"
202
+ },
203
+ "404": {
204
+ "description": "Todo not found"
205
+ }
206
+ },
207
+ "operationId": "888a8d15-aa30-45fe-8957-b07a8bcdd7ca",
208
+ "x-zuplo-route": {
209
+ "corsPolicy": "none",
210
+ "handler": {
211
+ "export": "urlForwardHandler",
212
+ "module": "$import(@zuplo/runtime)",
213
+ "options": {
214
+ "baseUrl": "https://todo-mock-main-b63f096.zuplo.app"
215
+ }
216
+ }
217
+ },
218
+ "tags": ["Todo"]
219
+ }
220
+ }
221
+ },
222
+ "components": {
223
+ "schemas": {
224
+ "Todo": {
225
+ "type": "object",
226
+ "properties": {
227
+ "id": {
228
+ "type": "integer",
229
+ "description": "The todo ID"
230
+ },
231
+ "title": {
232
+ "type": "string",
233
+ "description": "The todo title"
234
+ },
235
+ "completed": {
236
+ "type": "boolean",
237
+ "description": "Whether the todo is completed"
238
+ },
239
+ "userId": {
240
+ "type": "integer",
241
+ "description": "The user ID who owns the todo"
242
+ }
243
+ },
244
+ "required": ["id", "title", "completed", "userId"]
245
+ },
246
+ "CreateTodo": {
247
+ "type": "object",
248
+ "properties": {
249
+ "title": {
250
+ "type": "string",
251
+ "description": "The todo title"
252
+ },
253
+ "completed": {
254
+ "type": "boolean",
255
+ "description": "Whether the todo is completed",
256
+ "default": false
257
+ },
258
+ "userId": {
259
+ "type": "integer",
260
+ "description": "The user ID who owns the todo"
261
+ }
262
+ },
263
+ "required": ["title", "userId"]
264
+ },
265
+ "UpdateTodo": {
266
+ "type": "object",
267
+ "properties": {
268
+ "title": {
269
+ "type": "string",
270
+ "description": "The todo title"
271
+ },
272
+ "completed": {
273
+ "type": "boolean",
274
+ "description": "Whether the todo is completed"
275
+ },
276
+ "userId": {
277
+ "type": "integer",
278
+ "description": "The user ID who owns the todo"
279
+ }
280
+ }
27
281
  }
28
282
  }
29
283
  }
@@ -15,13 +15,6 @@
15
15
  {
16
16
  "fileMatch": ["docs/sidebar.json"],
17
17
  "url": "https://cdn.zuplo.com/schemas/sidebar.json"
18
- },
19
- {
20
- "fileMatch": ["zuplo.jsonc"],
21
- "url": "https://cdn.zuplo.com/schemas/zuplo.json",
22
- "schema": {
23
- "allowTrailingCommas": true
24
- }
25
18
  }
26
19
  ]
27
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zuplo-api",
3
- "version": "6.53.0",
3
+ "version": "6.54.0",
4
4
  "keywords": [
5
5
  "api",
6
6
  "openapi",
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://cdn.zuplo.com/schemas/dev-portal.json",
3
- "enabled": true,
4
- "enableAuthentication": true
5
- }
@@ -1,43 +0,0 @@
1
- # My API
2
-
3
- You can write full markdown in these documents. Syntax highlighting and full
4
- Github Flavored markdown are supported. To learn more about customizing the
5
- documentation of this developer portal
6
- [see the documentation](https://zuplo.com/docs/developer-portal/adding-pages).
7
-
8
- ```ts
9
- const response = await fetch("https://echo.zuplo.io", {
10
- headers: {
11
- "content-type": "application/json",
12
- },
13
- });
14
-
15
- const data = await response.json();
16
- console.log(data);
17
- ```
18
-
19
- ## Labore et Dolore
20
-
21
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
22
- incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
23
- nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
24
- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
25
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
26
- culpa qui officia deserunt mollit anim id est laborum.
27
-
28
- | Item | Description | Quanity |
29
- | --------------- | -------------------------------------------- | ------- |
30
- | ullamco laboris | reprehenderit in voluptate velit esse cillum | 21 |
31
- | Excepteur sint | tempor incididunt ut labore | 1 |
32
- | anim id est | irure dolor in reprehenderit in voluptate | 82 |
33
- | non proiden | cupidatat non proident, sunt in | 53 |
34
-
35
- ## Aliquip pariatur
36
-
37
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
38
- deserunt mollit anim id est laborum.
39
-
40
- - **Item 1** - ullamco laboris nisi ut aliquip ex ea commodo
41
- - **Item 2** - ullamco laboris nisi ut aliquip ex ea commodo
42
- - **Item 3** - ullamco laboris nisi ut aliquip ex ea commodo
43
- - **Item 4** - ullamco laboris nisi ut aliquip ex ea commodo
@@ -1,13 +0,0 @@
1
- {
2
- "docs": [
3
- {
4
- "type": "doc",
5
- "id": "index",
6
- "label": "Index"
7
- },
8
- {
9
- "type": "api-ref",
10
- "label": "API Reference"
11
- }
12
- ]
13
- }
@@ -1,29 +0,0 @@
1
- /* Learn about theming here: https://zuplo.com/docs/developer-portal/theme */
2
-
3
- :root {
4
- --logo-url: url(https://cdn.zuplo.com/dev-portal/v2/made-with-zuplo.svg);
5
- }
6
-
7
- .light {
8
- --background-primary: white;
9
- --font-family-primary: "-apple-system", "BlinkMacSystemFont", "Segoe UI",
10
- "Roboto", "Helvetica Neue", "Ubuntu", "sans-serif";
11
- --text-color-h1: rgb(42 47 69);
12
- --text-color-h2: rgb(42 47 69);
13
- --text-color-primary: rgb(79 86 107);
14
- }
15
-
16
- .dark {
17
- --background-primary: #1a1f36;
18
- --font-family-primary: "-apple-system", "BlinkMacSystemFont", "Segoe UI",
19
- "Roboto", "Helvetica Neue", "Ubuntu", "sans-serif";
20
- --text-color-h1: #f7fafc;
21
- --text-color-h2: #f7fafc;
22
- --text-color-primary: rgb(193 201 210);
23
- }
24
-
25
- /* The logo image */
26
- .theme-logo {
27
- content: var(--logo-url);
28
- margin: 20px;
29
- }
@@ -1,29 +0,0 @@
1
- ## Zuplo API
2
-
3
- This is a Zuplo API that was created with
4
- [`create-zuplo-api`](https://zuplo.com/docs).
5
-
6
- ## Getting Started
7
-
8
- First, run the development server:
9
-
10
- ```bash
11
- npm run dev
12
- # or
13
- yarn dev
14
- # or
15
- pnpm dev
16
- ```
17
-
18
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the
19
- result.
20
-
21
- You can start editing the API by modifying `config/routes.oas.json`. The dev
22
- server will automatically reload the API with your changes.
23
-
24
- ## Learn More
25
-
26
- To learn more about Zuplo, you can visit the
27
- [Zuplo documentation](https://zuplo.com/docs).
28
-
29
- To connect with the community join [Discord](https://discord.zuplo.com).
@@ -1,13 +0,0 @@
1
- {
2
- "policies": [
3
- {
4
- "handler": {
5
- "export": "MockApiInboundPolicy",
6
- "module": "$import(@zuplo/runtime)",
7
- "options": {}
8
- },
9
- "name": "mock-api-inbound",
10
- "policyType": "mock-api-inbound"
11
- }
12
- ]
13
- }