create-zuplo-api 6.16.14 → 6.17.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.
- package/dist/index.js +72 -0
- package/dist/templates/default/README-template.md +29 -0
- package/dist/templates/default/config/dev-portal.json +5 -0
- package/dist/templates/default/config/policies.json +3 -0
- package/dist/templates/default/config/routes.oas.json +8 -0
- package/dist/templates/default/docs/index.md +43 -0
- package/dist/templates/default/docs/sidebar.json +13 -0
- package/dist/templates/default/docs/theme.css +29 -0
- package/dist/templates/default/env.example +2 -0
- package/dist/templates/default/eslintrc.json +7 -0
- package/dist/templates/default/gitignore +10 -0
- package/dist/templates/default/modules/hello-world.ts +21 -0
- package/dist/templates/default/prettierrc.json +1 -0
- package/dist/templates/default/tsconfig.json +19 -0
- package/dist/templates/default/vscode/launch.json +37 -0
- package/dist/templates/default/vscode/settings.json +20 -0
- package/dist/templates/default/zuplo.jsonc +4 -0
- package/dist/templates/default-empty/config/policies.json +3 -0
- package/dist/templates/default-empty/config/routes.oas.json +5 -0
- package/dist/templates/default-empty/env.example +2 -0
- package/dist/templates/default-empty/eslintrc.json +7 -0
- package/dist/templates/default-empty/gitignore +10 -0
- package/dist/templates/default-empty/prettierrc.json +1 -0
- package/dist/templates/default-empty/tsconfig.json +19 -0
- package/dist/templates/default-empty/zuplo.jsonc +4 -0
- package/package.json +3 -2
|
@@ -0,0 +1,29 @@
|
|
|
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).
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
|
2
|
+
|
|
3
|
+
export default async function (request: ZuploRequest, context: ZuploContext) {
|
|
4
|
+
/**
|
|
5
|
+
* Use the log property on context to enjoy
|
|
6
|
+
* logging magic when testing your API.
|
|
7
|
+
*/
|
|
8
|
+
context.log.info(`Hi, from inside your zup!`);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* If you want to proxy an API, you can simply
|
|
12
|
+
* return the content of a fetch. Try it by
|
|
13
|
+
* uncommenting the line below.
|
|
14
|
+
*/
|
|
15
|
+
// return fetch('http://www.example.com/');
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* In this example, we're just going to return some content.
|
|
19
|
+
*/
|
|
20
|
+
return "What zup?";
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["modules/**/*", ".zuplo/**/*", "tests/**/*"],
|
|
3
|
+
"exclude": ["./node_modules", "./dist"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"target": "ES2022",
|
|
7
|
+
"lib": ["ESNext", "WebWorker", "Webworker.Iterable"],
|
|
8
|
+
"preserveConstEnums": true,
|
|
9
|
+
"moduleResolution": "Bundler",
|
|
10
|
+
"useUnknownInCatchVariables": false,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"removeComments": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"strictNullChecks": true,
|
|
17
|
+
"experimentalDecorators": true
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "node",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "Launch Zuplo",
|
|
11
|
+
"runtimeExecutable": "npx",
|
|
12
|
+
"runtimeArgs": [
|
|
13
|
+
"@zuplo/cli",
|
|
14
|
+
"dev",
|
|
15
|
+
"--debug-port",
|
|
16
|
+
"9229",
|
|
17
|
+
"--port",
|
|
18
|
+
"9000"
|
|
19
|
+
],
|
|
20
|
+
"console": "integratedTerminal",
|
|
21
|
+
"internalConsoleOptions": "neverOpen"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Zuplo Gateway",
|
|
25
|
+
"type": "node",
|
|
26
|
+
"request": "attach",
|
|
27
|
+
"restart": true,
|
|
28
|
+
"port": 9229
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"compounds": [
|
|
32
|
+
{
|
|
33
|
+
"name": "Launch & Attach Zuplo",
|
|
34
|
+
"configurations": ["Launch Zuplo", "Zuplo Gateway"]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"json.schemas": [
|
|
3
|
+
{
|
|
4
|
+
"fileMatch": ["config/*.oas.json"],
|
|
5
|
+
"url": "https://cdn.zuplo.com/schemas/openapi-v3.1-zuplo.json"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"fileMatch": ["config/policies.json"],
|
|
9
|
+
"url": "https://cdn.zuplo.com/schemas/policies.json"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"fileMatch": ["config/dev-portal.json"],
|
|
13
|
+
"url": "https://cdn.zuplo.com/schemas/dev-portal.json"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"fileMatch": ["docs/sidebar.json"],
|
|
17
|
+
"url": "https://cdn.zuplo.com/schemas/sidebar.json"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["modules/**/*", ".zuplo/**/*", "tests/**/*"],
|
|
3
|
+
"exclude": ["./node_modules", "./dist"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"target": "ES2022",
|
|
7
|
+
"lib": ["ESNext", "WebWorker", "Webworker.Iterable"],
|
|
8
|
+
"preserveConstEnums": true,
|
|
9
|
+
"moduleResolution": "Bundler",
|
|
10
|
+
"useUnknownInCatchVariables": false,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"removeComments": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"strictNullChecks": true,
|
|
17
|
+
"experimentalDecorators": true
|
|
18
|
+
}
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-zuplo-api",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.17.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"api",
|
|
6
6
|
"openapi",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
27
|
"dev": "ncc build ./index.ts -w -o dist/",
|
|
28
|
-
"build": "rm -rf ./dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"
|
|
28
|
+
"build": "rm -rf ./dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register",
|
|
29
|
+
"build:public": "rm -rf ./dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/async-retry": "1.4.9",
|