@platformatic/runtime 1.43.0 → 1.45.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 (22) hide show
  1. package/fixtures/configs/monorepo-with-dependencies.json +8 -0
  2. package/fixtures/management-api/services/service-1/platformatic.json +3 -1
  3. package/fixtures/management-api/services/service-db/migrations/001.do.sql +4 -0
  4. package/fixtures/management-api/services/service-db/migrations/001.undo.sql +1 -0
  5. package/fixtures/management-api/services/service-db/package.json +5 -0
  6. package/fixtures/management-api/services/service-db/platformatic.db.json +29 -0
  7. package/fixtures/management-api/services/service-db/plugin.js +12 -0
  8. package/fixtures/monorepo-with-dependencies/main/clients/service-1/package.json +3 -0
  9. package/fixtures/monorepo-with-dependencies/main/clients/service-1/schema.json +204 -0
  10. package/fixtures/monorepo-with-dependencies/main/clients/service-2/package.json +3 -0
  11. package/fixtures/monorepo-with-dependencies/main/clients/service-2/schema.json +204 -0
  12. package/fixtures/monorepo-with-dependencies/main/external-service.schema.json +204 -0
  13. package/fixtures/monorepo-with-dependencies/main/platformatic.json +46 -0
  14. package/fixtures/monorepo-with-dependencies/service-1/clients/service-2/package.json +3 -0
  15. package/fixtures/monorepo-with-dependencies/service-1/clients/service-2/schema.json +204 -0
  16. package/fixtures/monorepo-with-dependencies/service-1/external-service.schema.json +204 -0
  17. package/fixtures/monorepo-with-dependencies/service-1/platformatic.json +29 -0
  18. package/fixtures/monorepo-with-dependencies/service-2/platformatic.json +15 -0
  19. package/lib/api.js +11 -1
  20. package/lib/config.js +73 -116
  21. package/lib/management-api.js +12 -0
  22. package/package.json +10 -10
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://platformatic.dev/schemas/v1.44.0/runtime",
3
+ "entrypoint": "main",
4
+ "hotReload": true,
5
+ "autoload": {
6
+ "path": "../monorepo-with-dependencies"
7
+ }
8
+ }
@@ -4,7 +4,9 @@
4
4
  "openapi": true
5
5
  },
6
6
  "plugins": {
7
- "paths": ["plugin.js"]
7
+ "paths": [
8
+ "plugin.js"
9
+ ]
8
10
  },
9
11
  "watch": true
10
12
  }
@@ -0,0 +1,4 @@
1
+ CREATE TABLE IF NOT EXISTS movies (
2
+ id INTEGER PRIMARY KEY,
3
+ title TEXT NOT NULL
4
+ );
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@myscope/myname",
3
+ "version": "0.0.1",
4
+ "description": "test package.json"
5
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://platformatic.dev/schemas/v0.22.0/db",
3
+ "server": {
4
+ "hostname": "127.0.0.1",
5
+ "port": 0
6
+ },
7
+ "migrations": {
8
+ "dir": "migrations",
9
+ "table": "versions",
10
+ "autoApply": true
11
+ },
12
+ "types": {
13
+ "autogenerate": false
14
+ },
15
+ "db": {
16
+ "connectionString": "sqlite://db.sqlite",
17
+ "graphql": true,
18
+ "ignore": {
19
+ "versions": true
20
+ },
21
+ "events": false
22
+ },
23
+ "plugins": {
24
+ "paths": [
25
+ "plugin.js"
26
+ ]
27
+ },
28
+ "watch": false
29
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ /** @param {import('fastify').FastifyInstance} app */
4
+ module.exports = async function (app) {
5
+ app.get('/async_crash', async () => {
6
+ setImmediate(() => {
7
+ throw new Error('boom')
8
+ })
9
+
10
+ return 'ok'
11
+ })
12
+ }
@@ -0,0 +1,204 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "version": "8.3.1",
5
+ "title": "@fastify/swagger"
6
+ },
7
+ "components": {
8
+ "schemas": {}
9
+ },
10
+ "paths": {
11
+ "/posts": {
12
+ "get": {
13
+ "responses": {
14
+ "200": {
15
+ "description": "Default Response",
16
+ "content": {
17
+ "application/json": {
18
+ "schema": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "properties": {
23
+ "id": {
24
+ "type": "number"
25
+ },
26
+ "name": {
27
+ "type": "string"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "post": {
38
+ "requestBody": {
39
+ "content": {
40
+ "application/json": {
41
+ "schema": {
42
+ "type": "object",
43
+ "properties": {
44
+ "name": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "responses": {
53
+ "200": {
54
+ "description": "Default Response",
55
+ "content": {
56
+ "application/json": {
57
+ "schema": {
58
+ "type": "object",
59
+ "properties": {
60
+ "id": {
61
+ "type": "number"
62
+ },
63
+ "name": {
64
+ "type": "string"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ },
73
+ "put": {
74
+ "requestBody": {
75
+ "content": {
76
+ "application/json": {
77
+ "schema": {
78
+ "type": "object",
79
+ "properties": {
80
+ "id": {
81
+ "type": "number"
82
+ },
83
+ "name": {
84
+ "type": "string"
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "responses": {
92
+ "200": {
93
+ "description": "Default Response",
94
+ "content": {
95
+ "application/json": {
96
+ "schema": {
97
+ "type": "object",
98
+ "properties": {
99
+ "id": {
100
+ "type": "number"
101
+ },
102
+ "name": {
103
+ "type": "string"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "/posts/{id}": {
114
+ "get": {
115
+ "responses": {
116
+ "200": {
117
+ "description": "Default Response",
118
+ "content": {
119
+ "application/json": {
120
+ "schema": {
121
+ "type": "object",
122
+ "properties": {
123
+ "id": {
124
+ "type": "number"
125
+ },
126
+ "name": {
127
+ "type": "string"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ },
136
+ "post": {
137
+ "responses": {
138
+ "200": {
139
+ "description": "Default Response",
140
+ "content": {
141
+ "application/json": {
142
+ "schema": {
143
+ "type": "object",
144
+ "properties": {
145
+ "id": {
146
+ "type": "number"
147
+ },
148
+ "name": {
149
+ "type": "string"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "put": {
159
+ "responses": {
160
+ "200": {
161
+ "description": "Default Response",
162
+ "content": {
163
+ "application/json": {
164
+ "schema": {
165
+ "type": "object",
166
+ "properties": {
167
+ "id": {
168
+ "type": "number"
169
+ },
170
+ "name": {
171
+ "type": "string"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "delete": {
181
+ "responses": {
182
+ "200": {
183
+ "description": "Default Response",
184
+ "content": {
185
+ "application/json": {
186
+ "schema": {
187
+ "type": "object",
188
+ "properties": {
189
+ "id": {
190
+ "type": "number"
191
+ },
192
+ "name": {
193
+ "type": "string"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,204 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "version": "8.3.1",
5
+ "title": "@fastify/swagger"
6
+ },
7
+ "components": {
8
+ "schemas": {}
9
+ },
10
+ "paths": {
11
+ "/posts": {
12
+ "get": {
13
+ "responses": {
14
+ "200": {
15
+ "description": "Default Response",
16
+ "content": {
17
+ "application/json": {
18
+ "schema": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "properties": {
23
+ "id": {
24
+ "type": "number"
25
+ },
26
+ "name": {
27
+ "type": "string"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "post": {
38
+ "requestBody": {
39
+ "content": {
40
+ "application/json": {
41
+ "schema": {
42
+ "type": "object",
43
+ "properties": {
44
+ "name": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "responses": {
53
+ "200": {
54
+ "description": "Default Response",
55
+ "content": {
56
+ "application/json": {
57
+ "schema": {
58
+ "type": "object",
59
+ "properties": {
60
+ "id": {
61
+ "type": "number"
62
+ },
63
+ "name": {
64
+ "type": "string"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ },
73
+ "put": {
74
+ "requestBody": {
75
+ "content": {
76
+ "application/json": {
77
+ "schema": {
78
+ "type": "object",
79
+ "properties": {
80
+ "id": {
81
+ "type": "number"
82
+ },
83
+ "name": {
84
+ "type": "string"
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "responses": {
92
+ "200": {
93
+ "description": "Default Response",
94
+ "content": {
95
+ "application/json": {
96
+ "schema": {
97
+ "type": "object",
98
+ "properties": {
99
+ "id": {
100
+ "type": "number"
101
+ },
102
+ "name": {
103
+ "type": "string"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "/posts/{id}": {
114
+ "get": {
115
+ "responses": {
116
+ "200": {
117
+ "description": "Default Response",
118
+ "content": {
119
+ "application/json": {
120
+ "schema": {
121
+ "type": "object",
122
+ "properties": {
123
+ "id": {
124
+ "type": "number"
125
+ },
126
+ "name": {
127
+ "type": "string"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ },
136
+ "post": {
137
+ "responses": {
138
+ "200": {
139
+ "description": "Default Response",
140
+ "content": {
141
+ "application/json": {
142
+ "schema": {
143
+ "type": "object",
144
+ "properties": {
145
+ "id": {
146
+ "type": "number"
147
+ },
148
+ "name": {
149
+ "type": "string"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "put": {
159
+ "responses": {
160
+ "200": {
161
+ "description": "Default Response",
162
+ "content": {
163
+ "application/json": {
164
+ "schema": {
165
+ "type": "object",
166
+ "properties": {
167
+ "id": {
168
+ "type": "number"
169
+ },
170
+ "name": {
171
+ "type": "string"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "delete": {
181
+ "responses": {
182
+ "200": {
183
+ "description": "Default Response",
184
+ "content": {
185
+ "application/json": {
186
+ "schema": {
187
+ "type": "object",
188
+ "properties": {
189
+ "id": {
190
+ "type": "number"
191
+ },
192
+ "name": {
193
+ "type": "string"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,204 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "version": "8.3.1",
5
+ "title": "@fastify/swagger"
6
+ },
7
+ "components": {
8
+ "schemas": {}
9
+ },
10
+ "paths": {
11
+ "/posts": {
12
+ "get": {
13
+ "responses": {
14
+ "200": {
15
+ "description": "Default Response",
16
+ "content": {
17
+ "application/json": {
18
+ "schema": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "properties": {
23
+ "id": {
24
+ "type": "number"
25
+ },
26
+ "name": {
27
+ "type": "string"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "post": {
38
+ "requestBody": {
39
+ "content": {
40
+ "application/json": {
41
+ "schema": {
42
+ "type": "object",
43
+ "properties": {
44
+ "name": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "responses": {
53
+ "200": {
54
+ "description": "Default Response",
55
+ "content": {
56
+ "application/json": {
57
+ "schema": {
58
+ "type": "object",
59
+ "properties": {
60
+ "id": {
61
+ "type": "number"
62
+ },
63
+ "name": {
64
+ "type": "string"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ },
73
+ "put": {
74
+ "requestBody": {
75
+ "content": {
76
+ "application/json": {
77
+ "schema": {
78
+ "type": "object",
79
+ "properties": {
80
+ "id": {
81
+ "type": "number"
82
+ },
83
+ "name": {
84
+ "type": "string"
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "responses": {
92
+ "200": {
93
+ "description": "Default Response",
94
+ "content": {
95
+ "application/json": {
96
+ "schema": {
97
+ "type": "object",
98
+ "properties": {
99
+ "id": {
100
+ "type": "number"
101
+ },
102
+ "name": {
103
+ "type": "string"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "/posts/{id}": {
114
+ "get": {
115
+ "responses": {
116
+ "200": {
117
+ "description": "Default Response",
118
+ "content": {
119
+ "application/json": {
120
+ "schema": {
121
+ "type": "object",
122
+ "properties": {
123
+ "id": {
124
+ "type": "number"
125
+ },
126
+ "name": {
127
+ "type": "string"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ },
136
+ "post": {
137
+ "responses": {
138
+ "200": {
139
+ "description": "Default Response",
140
+ "content": {
141
+ "application/json": {
142
+ "schema": {
143
+ "type": "object",
144
+ "properties": {
145
+ "id": {
146
+ "type": "number"
147
+ },
148
+ "name": {
149
+ "type": "string"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "put": {
159
+ "responses": {
160
+ "200": {
161
+ "description": "Default Response",
162
+ "content": {
163
+ "application/json": {
164
+ "schema": {
165
+ "type": "object",
166
+ "properties": {
167
+ "id": {
168
+ "type": "number"
169
+ },
170
+ "name": {
171
+ "type": "string"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "delete": {
181
+ "responses": {
182
+ "200": {
183
+ "description": "Default Response",
184
+ "content": {
185
+ "application/json": {
186
+ "schema": {
187
+ "type": "object",
188
+ "properties": {
189
+ "id": {
190
+ "type": "number"
191
+ },
192
+ "name": {
193
+ "type": "string"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }