@platformatic/service 1.13.0 → 1.13.2
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.
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Platformatic Service API
|
|
2
|
+
|
|
3
|
+
This is a generated [Platformatic Service](https://docs.platformatic.dev/docs/reference/service/introduction) application.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
Platformatic supports macOS, Linux and Windows ([WSL](https://docs.microsoft.com/windows/wsl/) recommended).
|
|
8
|
+
You'll need to have [Node.js](https://nodejs.org/) >= v18.8.0 or >= v20.6.0
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
Install dependencies:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Run the API with:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm start
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Explore
|
|
27
|
+
- ⚡ The Platformatic DB server is running at http://localhost:3042/
|
|
28
|
+
- 📔 View the REST API's Swagger documentation at http://localhost:3042/documentation/
|
|
29
|
+
- 🔍 Try out the GraphiQL web UI at http://localhost:3042/graphiql
|
|
30
|
+
|
|
31
|
+
|
|
@@ -6,6 +6,6 @@ interface KeyValue {
|
|
|
6
6
|
|
|
7
7
|
export namespace ServiceGenerator {
|
|
8
8
|
export class ServiceGenerator extends BaseGenerator.BaseGenerator {
|
|
9
|
-
constructor (opts?: BaseGenerator.BaseGeneratorOptions)
|
|
9
|
+
constructor (opts?: Omit<BaseGenerator.BaseGeneratorOptions, 'module'>)
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { BaseGenerator } = require('@platformatic/generators')
|
|
4
|
+
const { getPackageConfigurationObject } = require('@platformatic/generators/lib/utils')
|
|
5
|
+
const { readFile } = require('node:fs/promises')
|
|
6
|
+
const { join } = require('node:path')
|
|
4
7
|
|
|
5
8
|
class ServiceGenerator extends BaseGenerator {
|
|
6
9
|
constructor (opts = {}) {
|
|
7
|
-
super(
|
|
8
|
-
|
|
10
|
+
super({
|
|
11
|
+
...opts,
|
|
12
|
+
module: '@platformatic/service'
|
|
13
|
+
})
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
async _beforePrepare () {
|
|
@@ -63,6 +68,8 @@ declare module 'fastify' {
|
|
|
63
68
|
// remove env variables since they are all for the config.server property
|
|
64
69
|
this.config.env = {}
|
|
65
70
|
}
|
|
71
|
+
|
|
72
|
+
this.addFile({ path: '', file: 'README.md', contents: await readFile(join(__dirname, 'README.md')) })
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
async _getConfigFileContents () {
|
|
@@ -97,6 +104,18 @@ declare module 'fastify' {
|
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
}
|
|
107
|
+
|
|
108
|
+
if (this.packages.length > 0) {
|
|
109
|
+
if (!config.plugins) {
|
|
110
|
+
config.plugins = {}
|
|
111
|
+
}
|
|
112
|
+
config.plugins.packages = this.packages.map((packageDefinition) => {
|
|
113
|
+
return {
|
|
114
|
+
name: packageDefinition.name,
|
|
115
|
+
options: getPackageConfigurationObject(packageDefinition.options)
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
}
|
|
100
119
|
return config
|
|
101
120
|
}
|
|
102
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"pino-pretty": "^10.2.0",
|
|
70
70
|
"rfdc": "^1.3.0",
|
|
71
71
|
"ua-parser-js": "^1.0.36",
|
|
72
|
-
"@platformatic/client": "1.13.
|
|
73
|
-
"@platformatic/
|
|
74
|
-
"@platformatic/
|
|
75
|
-
"@platformatic/utils": "1.13.
|
|
76
|
-
"@platformatic/
|
|
77
|
-
"@platformatic/
|
|
72
|
+
"@platformatic/client": "1.13.2",
|
|
73
|
+
"@platformatic/swagger-ui-theme": "1.13.2",
|
|
74
|
+
"@platformatic/telemetry": "1.13.2",
|
|
75
|
+
"@platformatic/utils": "1.13.2",
|
|
76
|
+
"@platformatic/generators": "1.13.2",
|
|
77
|
+
"@platformatic/config": "1.13.2"
|
|
78
78
|
},
|
|
79
79
|
"standard": {
|
|
80
80
|
"ignore": [
|