@contember/engine-http 2.0.0-alpha.15 → 2.0.0-alpha.17
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/development/index.cjs +0 -2
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +0 -2
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/MasterContainer.cjs +0 -2
- package/dist/development/src/MasterContainer.cjs.map +1 -1
- package/dist/development/src/MasterContainer.js +0 -2
- package/dist/development/src/MasterContainer.js.map +1 -1
- package/dist/development/src/graphql/dbQueriesListener.cjs +1 -1
- package/dist/development/src/graphql/dbQueriesListener.cjs.map +1 -1
- package/dist/development/src/graphql/dbQueriesListener.js +1 -1
- package/dist/development/src/graphql/dbQueriesListener.js.map +1 -1
- package/dist/development/src/graphql/execution.cjs +1 -0
- package/dist/development/src/graphql/execution.cjs.map +1 -1
- package/dist/development/src/graphql/execution.js +1 -0
- package/dist/development/src/graphql/execution.js.map +1 -1
- package/dist/development/src/transfer/ExportExecutor.cjs +1 -1
- package/dist/development/src/transfer/ExportExecutor.cjs.map +1 -1
- package/dist/development/src/transfer/ExportExecutor.js +1 -1
- package/dist/development/src/transfer/ExportExecutor.js.map +1 -1
- package/dist/production/index.cjs +0 -2
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +0 -2
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/MasterContainer.cjs +0 -2
- package/dist/production/src/MasterContainer.cjs.map +1 -1
- package/dist/production/src/MasterContainer.js +0 -2
- package/dist/production/src/MasterContainer.js.map +1 -1
- package/dist/production/src/graphql/dbQueriesListener.cjs +1 -1
- package/dist/production/src/graphql/dbQueriesListener.cjs.map +1 -1
- package/dist/production/src/graphql/dbQueriesListener.js +1 -1
- package/dist/production/src/graphql/dbQueriesListener.js.map +1 -1
- package/dist/production/src/graphql/execution.cjs +1 -0
- package/dist/production/src/graphql/execution.cjs.map +1 -1
- package/dist/production/src/graphql/execution.js +1 -0
- package/dist/production/src/graphql/execution.js.map +1 -1
- package/dist/production/src/transfer/ExportExecutor.cjs +1 -1
- package/dist/production/src/transfer/ExportExecutor.cjs.map +1 -1
- package/dist/production/src/transfer/ExportExecutor.js +1 -1
- package/dist/production/src/transfer/ExportExecutor.js.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/MasterContainer.d.ts.map +1 -1
- package/dist/types/config/configSchema.d.ts +23 -34
- package/dist/types/config/configSchema.d.ts.map +1 -1
- package/dist/types/graphql/execution.d.ts.map +1 -1
- package/dist/types/misc/index.d.ts +0 -1
- package/dist/types/misc/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -31
- package/src/MasterContainer.ts +2 -8
- package/src/graphql/dbQueriesListener.ts +1 -1
- package/src/graphql/execution.ts +1 -0
- package/src/misc/index.ts +0 -1
- package/src/transfer/ExportExecutor.ts +1 -1
- package/dist/development/src/misc/PlaygroundMiddlewareFactory.cjs +0 -13
- package/dist/development/src/misc/PlaygroundMiddlewareFactory.cjs.map +0 -1
- package/dist/development/src/misc/PlaygroundMiddlewareFactory.js +0 -13
- package/dist/development/src/misc/PlaygroundMiddlewareFactory.js.map +0 -1
- package/dist/production/src/misc/PlaygroundMiddlewareFactory.cjs +0 -13
- package/dist/production/src/misc/PlaygroundMiddlewareFactory.cjs.map +0 -1
- package/dist/production/src/misc/PlaygroundMiddlewareFactory.js +0 -13
- package/dist/production/src/misc/PlaygroundMiddlewareFactory.js.map +0 -1
- package/dist/types/misc/PlaygroundMiddlewareFactory.d.ts +0 -3
- package/dist/types/misc/PlaygroundMiddlewareFactory.d.ts.map +0 -1
- package/src/misc/PlaygroundMiddlewareFactory.ts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/engine-http",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.17",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/production/index.js",
|
|
6
6
|
"typings": "./dist/types/index.d.ts",
|
|
@@ -26,45 +26,44 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@contember/
|
|
31
|
-
"@contember/database": "2.0.0-alpha.
|
|
32
|
-
"@contember/
|
|
33
|
-
"@contember/
|
|
34
|
-
"@contember/engine-
|
|
35
|
-
"@contember/engine-
|
|
36
|
-
"@contember/engine-
|
|
37
|
-
"@contember/
|
|
38
|
-
"@contember/
|
|
39
|
-
"@contember/
|
|
40
|
-
"@contember/schema": "2.0.0-alpha.
|
|
41
|
-
"@contember/schema-
|
|
42
|
-
"@contember/
|
|
43
|
-
"@
|
|
44
|
-
"@graphql-tools/
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@sentry/node": "^7.80.1",
|
|
29
|
+
"@contember/config-loader": "2.0.0-alpha.17",
|
|
30
|
+
"@contember/database": "2.0.0-alpha.17",
|
|
31
|
+
"@contember/database-migrations": "2.0.0-alpha.17",
|
|
32
|
+
"@contember/dic": "2.0.0-alpha.17",
|
|
33
|
+
"@contember/engine-common": "2.0.0-alpha.17",
|
|
34
|
+
"@contember/engine-content-api": "2.0.0-alpha.17",
|
|
35
|
+
"@contember/engine-system-api": "2.0.0-alpha.17",
|
|
36
|
+
"@contember/engine-tenant-api": "2.0.0-alpha.17",
|
|
37
|
+
"@contember/graphql-utils": "2.0.0-alpha.17",
|
|
38
|
+
"@contember/logger": "2.0.0-alpha.17",
|
|
39
|
+
"@contember/schema": "2.0.0-alpha.17",
|
|
40
|
+
"@contember/schema-migrations": "2.0.0-alpha.17",
|
|
41
|
+
"@contember/schema-utils": "2.0.0-alpha.17",
|
|
42
|
+
"@contember/typesafe": "2.0.0-alpha.17",
|
|
43
|
+
"@graphql-tools/merge": "^9.0.7",
|
|
44
|
+
"@graphql-tools/schema": "^10.0.6",
|
|
45
|
+
"@koa/cors": "^5.0.0",
|
|
46
|
+
"@sentry/node": "^7.119.0",
|
|
48
47
|
"bcryptjs": "^2.4.3",
|
|
49
|
-
"koa": "^2.
|
|
48
|
+
"koa": "^2.15.3",
|
|
50
49
|
"koa-bodyparser": "^4.4.1",
|
|
51
50
|
"koa-compress": "^5.1.1",
|
|
52
|
-
"lru-cache": "^
|
|
53
|
-
"path-to-regexp": "^6.2.
|
|
51
|
+
"lru-cache": "^11.0.1",
|
|
52
|
+
"path-to-regexp": "^6.2.2",
|
|
54
53
|
"prom-client": "^12.0.0",
|
|
55
|
-
"uuid": "^
|
|
56
|
-
"ws": "^8.
|
|
54
|
+
"uuid": "^10.0.0",
|
|
55
|
+
"ws": "^8.18.0"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
58
|
"@types/bcryptjs": "^2.4.6",
|
|
60
|
-
"@types/koa": "^2.
|
|
59
|
+
"@types/koa": "^2.15.0",
|
|
61
60
|
"@types/koa-bodyparser": "^4.3.12",
|
|
62
|
-
"@types/koa__cors": "^
|
|
61
|
+
"@types/koa__cors": "^5.0.0",
|
|
63
62
|
"@types/lru-cache": "^7.10.10",
|
|
64
|
-
"@types/node": "^20.
|
|
65
|
-
"@types/uuid": "^
|
|
66
|
-
"@types/ws": "^8.5.
|
|
67
|
-
"graphql": "^16.
|
|
63
|
+
"@types/node": "^20.16.5",
|
|
64
|
+
"@types/uuid": "^10.0.0",
|
|
65
|
+
"@types/ws": "^8.5.12",
|
|
66
|
+
"graphql": "^16.9.0"
|
|
68
67
|
},
|
|
69
68
|
"peerDependencies": {
|
|
70
69
|
"graphql": ">= 14.6.0",
|
package/src/MasterContainer.ts
CHANGED
|
@@ -15,12 +15,7 @@ import { ExecutionContainerFactory, GraphQlSchemaBuilderFactory, PermissionFacto
|
|
|
15
15
|
import { createProviders, Providers } from './providers'
|
|
16
16
|
import { TenantApiMiddlewareFactory, TenantGraphQLContextFactory, TenantGraphQLHandlerFactory } from './tenant'
|
|
17
17
|
import { SystemApiMiddlewareFactory, SystemGraphQLContextFactory, SystemGraphQLHandlerFactory } from './system'
|
|
18
|
-
import {
|
|
19
|
-
ContentApiControllerFactory,
|
|
20
|
-
ContentGraphQLContextFactory,
|
|
21
|
-
ContentQueryHandlerFactory,
|
|
22
|
-
NotModifiedChecker,
|
|
23
|
-
} from './content'
|
|
18
|
+
import { ContentApiControllerFactory, ContentGraphQLContextFactory, ContentQueryHandlerFactory, NotModifiedChecker } from './content'
|
|
24
19
|
import { ProjectContextResolver } from './project-common'
|
|
25
20
|
import {
|
|
26
21
|
ContentSchemaTransferMappingFactory,
|
|
@@ -30,7 +25,7 @@ import {
|
|
|
30
25
|
ImportExecutor,
|
|
31
26
|
SystemSchemaTransferMappingFactory,
|
|
32
27
|
} from './transfer'
|
|
33
|
-
import { homepageController
|
|
28
|
+
import { homepageController } from './misc'
|
|
34
29
|
import { Plugin } from './plugin/Plugin'
|
|
35
30
|
import { Application } from './application'
|
|
36
31
|
import { ApplicationWorkerManager } from './workers'
|
|
@@ -208,7 +203,6 @@ export class MasterContainerFactory {
|
|
|
208
203
|
it.addRoute('system', '/system/:projectSlug', systemApiMiddlewareFactory.create())
|
|
209
204
|
it.addRoute('transfer', '/import', importApiMiddlewareFactory.create())
|
|
210
205
|
it.addRoute('transfer', '/export', exportApiMiddlewareFactory.create())
|
|
211
|
-
it.addRoute('misc', '/playground', playgroundController)
|
|
212
206
|
it.addRoute('misc', '/', homepageController)
|
|
213
207
|
|
|
214
208
|
it.addInternalRoute('internal', '/health', () => {
|
|
@@ -14,7 +14,7 @@ export const createDbQueriesListener = <Context extends { requestDebug: boolean
|
|
|
14
14
|
}
|
|
15
15
|
const queries: Query[] = []
|
|
16
16
|
const listener: EventManager.QueryEndCallback = ({ sql, parameters, meta }, { timing, rowCount }) =>
|
|
17
|
-
queries.push({ sql, bindings: parameters, elapsed: timing ? timing.selfDuration : 0, meta, rowCount })
|
|
17
|
+
queries.push({ sql, bindings: parameters, elapsed: timing ? timing.selfDuration : 0, meta, rowCount: rowCount ?? undefined })
|
|
18
18
|
const errorListener: EventManager.QueryErrorCallback = ({ sql, parameters, meta }, error) =>
|
|
19
19
|
queries.push({
|
|
20
20
|
sql,
|
package/src/graphql/execution.ts
CHANGED
|
@@ -141,6 +141,7 @@ export const createGraphQLQueryHandler = <Context>({
|
|
|
141
141
|
if (e instanceof GraphQLError) {
|
|
142
142
|
return respond(e instanceof ForbiddenError ? 403 : 400, { errors: [e] })
|
|
143
143
|
}
|
|
144
|
+
logger.error(e)
|
|
144
145
|
return respond(500, { errors: [{ message: 'Internal error' }] })
|
|
145
146
|
}
|
|
146
147
|
}
|
package/src/misc/index.ts
CHANGED
|
@@ -130,7 +130,7 @@ export class ExportExecutor {
|
|
|
130
130
|
|
|
131
131
|
while (resultPromise !== null) {
|
|
132
132
|
const result: Connection.Result = await resultPromise
|
|
133
|
-
resultPromise = result.rowCount < batchSize ? null : db.query(fetchSql) // pipeline
|
|
133
|
+
resultPromise = (result.rowCount ?? 0) < batchSize ? null : db.query(fetchSql) // pipeline
|
|
134
134
|
yield* result.rows
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const graphqlPlaygroundHtml = require("@apollographql/graphql-playground-html");
|
|
4
|
-
const HttpResponse = require("../common/HttpResponse.cjs");
|
|
5
|
-
const playgroundController = (ctx) => new HttpResponse.HttpResponse(
|
|
6
|
-
200,
|
|
7
|
-
graphqlPlaygroundHtml.renderPlaygroundPage({
|
|
8
|
-
endpoint: ctx.url.pathname
|
|
9
|
-
}),
|
|
10
|
-
"text/html"
|
|
11
|
-
);
|
|
12
|
-
exports.playgroundController = playgroundController;
|
|
13
|
-
//# sourceMappingURL=PlaygroundMiddlewareFactory.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundMiddlewareFactory.cjs","sources":["../../../../../packages/engine-http/src/misc/PlaygroundMiddlewareFactory.ts"],"sourcesContent":["import { renderPlaygroundPage } from '@apollographql/graphql-playground-html'\nimport { HttpController } from '../application'\nimport { HttpResponse } from '../common'\n\nexport const playgroundController: HttpController = ctx =>\n\tnew HttpResponse(\n\t\t200,\n\t\trenderPlaygroundPage({\n\t\t\tendpoint: ctx.url.pathname,\n\t\t}),\n\t\t'text/html',\n\t)\n"],"names":["HttpResponse","renderPlaygroundPage"],"mappings":";;;;AAIa,MAAA,uBAAuC,SACnD,IAAIA,aAAA;AAAA,EACH;AAAA,EACAC,2CAAqB;AAAA,IACpB,UAAU,IAAI,IAAI;AAAA,EAAA,CAClB;AAAA,EACD;AACD;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { renderPlaygroundPage } from "@apollographql/graphql-playground-html";
|
|
2
|
-
import { HttpResponse } from "../common/HttpResponse.js";
|
|
3
|
-
const playgroundController = (ctx) => new HttpResponse(
|
|
4
|
-
200,
|
|
5
|
-
renderPlaygroundPage({
|
|
6
|
-
endpoint: ctx.url.pathname
|
|
7
|
-
}),
|
|
8
|
-
"text/html"
|
|
9
|
-
);
|
|
10
|
-
export {
|
|
11
|
-
playgroundController
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=PlaygroundMiddlewareFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundMiddlewareFactory.js","sources":["../../../../../packages/engine-http/src/misc/PlaygroundMiddlewareFactory.ts"],"sourcesContent":["import { renderPlaygroundPage } from '@apollographql/graphql-playground-html'\nimport { HttpController } from '../application'\nimport { HttpResponse } from '../common'\n\nexport const playgroundController: HttpController = ctx =>\n\tnew HttpResponse(\n\t\t200,\n\t\trenderPlaygroundPage({\n\t\t\tendpoint: ctx.url.pathname,\n\t\t}),\n\t\t'text/html',\n\t)\n"],"names":[],"mappings":";;AAIa,MAAA,uBAAuC,SACnD,IAAI;AAAA,EACH;AAAA,EACA,qBAAqB;AAAA,IACpB,UAAU,IAAI,IAAI;AAAA,EAAA,CAClB;AAAA,EACD;AACD;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const graphqlPlaygroundHtml = require("@apollographql/graphql-playground-html");
|
|
4
|
-
const HttpResponse = require("../common/HttpResponse.cjs");
|
|
5
|
-
const playgroundController = (ctx) => new HttpResponse.HttpResponse(
|
|
6
|
-
200,
|
|
7
|
-
graphqlPlaygroundHtml.renderPlaygroundPage({
|
|
8
|
-
endpoint: ctx.url.pathname
|
|
9
|
-
}),
|
|
10
|
-
"text/html"
|
|
11
|
-
);
|
|
12
|
-
exports.playgroundController = playgroundController;
|
|
13
|
-
//# sourceMappingURL=PlaygroundMiddlewareFactory.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundMiddlewareFactory.cjs","sources":["../../../../../packages/engine-http/src/misc/PlaygroundMiddlewareFactory.ts"],"sourcesContent":["import { renderPlaygroundPage } from '@apollographql/graphql-playground-html'\nimport { HttpController } from '../application'\nimport { HttpResponse } from '../common'\n\nexport const playgroundController: HttpController = ctx =>\n\tnew HttpResponse(\n\t\t200,\n\t\trenderPlaygroundPage({\n\t\t\tendpoint: ctx.url.pathname,\n\t\t}),\n\t\t'text/html',\n\t)\n"],"names":["HttpResponse","renderPlaygroundPage"],"mappings":";;;;AAIa,MAAA,uBAAuC,SACnD,IAAIA,aAAA;AAAA,EACH;AAAA,EACAC,2CAAqB;AAAA,IACpB,UAAU,IAAI,IAAI;AAAA,EAAA,CAClB;AAAA,EACD;AACD;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { renderPlaygroundPage } from "@apollographql/graphql-playground-html";
|
|
2
|
-
import { HttpResponse } from "../common/HttpResponse.js";
|
|
3
|
-
const playgroundController = (ctx) => new HttpResponse(
|
|
4
|
-
200,
|
|
5
|
-
renderPlaygroundPage({
|
|
6
|
-
endpoint: ctx.url.pathname
|
|
7
|
-
}),
|
|
8
|
-
"text/html"
|
|
9
|
-
);
|
|
10
|
-
export {
|
|
11
|
-
playgroundController
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=PlaygroundMiddlewareFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundMiddlewareFactory.js","sources":["../../../../../packages/engine-http/src/misc/PlaygroundMiddlewareFactory.ts"],"sourcesContent":["import { renderPlaygroundPage } from '@apollographql/graphql-playground-html'\nimport { HttpController } from '../application'\nimport { HttpResponse } from '../common'\n\nexport const playgroundController: HttpController = ctx =>\n\tnew HttpResponse(\n\t\t200,\n\t\trenderPlaygroundPage({\n\t\t\tendpoint: ctx.url.pathname,\n\t\t}),\n\t\t'text/html',\n\t)\n"],"names":[],"mappings":";;AAIa,MAAA,uBAAuC,SACnD,IAAI;AAAA,EACH;AAAA,EACA,qBAAqB;AAAA,IACpB,UAAU,IAAI,IAAI;AAAA,EAAA,CAClB;AAAA,EACD;AACD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundMiddlewareFactory.d.ts","sourceRoot":"","sources":["../../../src/misc/PlaygroundMiddlewareFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,eAAO,MAAM,oBAAoB,EAAE,cAOjC,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { renderPlaygroundPage } from '@apollographql/graphql-playground-html'
|
|
2
|
-
import { HttpController } from '../application'
|
|
3
|
-
import { HttpResponse } from '../common'
|
|
4
|
-
|
|
5
|
-
export const playgroundController: HttpController = ctx =>
|
|
6
|
-
new HttpResponse(
|
|
7
|
-
200,
|
|
8
|
-
renderPlaygroundPage({
|
|
9
|
-
endpoint: ctx.url.pathname,
|
|
10
|
-
}),
|
|
11
|
-
'text/html',
|
|
12
|
-
)
|