@contember/engine-http 1.2.0-alpha.17 → 1.2.0-alpha.19

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 (40) hide show
  1. package/dist/src/common/TimerMiddleware.js +2 -2
  2. package/dist/src/common/TimerMiddleware.js.map +1 -1
  3. package/dist/src/content/ContentApiMiddlewareFactory.js +1 -1
  4. package/dist/src/content/ContentApiMiddlewareFactory.js.map +1 -1
  5. package/dist/src/content/ContentGraphQLContextFactory.js +2 -2
  6. package/dist/src/content/ContentGraphQLContextFactory.js.map +1 -1
  7. package/dist/src/content/NotModifiedChecker.d.ts +2 -2
  8. package/dist/src/content/NotModifiedChecker.d.ts.map +1 -1
  9. package/dist/src/content/NotModifiedChecker.js +2 -2
  10. package/dist/src/content/NotModifiedChecker.js.map +1 -1
  11. package/dist/src/graphql/execution.js +2 -2
  12. package/dist/src/graphql/execution.js.map +1 -1
  13. package/dist/src/providers.d.ts +1 -1
  14. package/dist/src/providers.d.ts.map +1 -1
  15. package/dist/src/providers.js +3 -3
  16. package/dist/src/providers.js.map +1 -1
  17. package/dist/src/transfer/ExportApiMiddlewareFactory.js +2 -2
  18. package/dist/src/transfer/ExportApiMiddlewareFactory.js.map +1 -1
  19. package/dist/src/transfer/ImportApiMiddlewareFactory.js +2 -2
  20. package/dist/src/transfer/ImportApiMiddlewareFactory.js.map +1 -1
  21. package/dist/src/tsconfig.tsbuildinfo +1 -1
  22. package/dist/src/utils/CryptoWrapper.d.ts +1 -1
  23. package/dist/src/utils/CryptoWrapper.d.ts.map +1 -1
  24. package/dist/src/utils/CryptoWrapper.js +1 -1
  25. package/dist/src/utils/CryptoWrapper.js.map +1 -1
  26. package/dist/tests/cases/unit/crypto.test.js +1 -1
  27. package/dist/tests/cases/unit/crypto.test.js.map +1 -1
  28. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +13 -12
  30. package/src/common/TimerMiddleware.ts +1 -1
  31. package/src/content/ContentApiMiddlewareFactory.ts +1 -1
  32. package/src/content/ContentGraphQLContextFactory.ts +1 -1
  33. package/src/content/NotModifiedChecker.ts +3 -3
  34. package/src/graphql/execution.ts +1 -1
  35. package/src/providers.ts +1 -1
  36. package/src/transfer/ExportApiMiddlewareFactory.ts +1 -1
  37. package/src/transfer/ImportApiMiddlewareFactory.ts +1 -1
  38. package/src/tsconfig.json +3 -4
  39. package/src/utils/CryptoWrapper.ts +1 -1
  40. package/tests/cases/unit/crypto.test.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/engine-http",
3
- "version": "1.2.0-alpha.17",
3
+ "version": "1.2.0-alpha.19",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/src/index.js",
6
6
  "typings": "dist/src/index.d.ts",
@@ -9,17 +9,18 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@apollographql/graphql-playground-html": "^1.6.24",
12
- "@contember/database": "^1.2.0-alpha.17",
13
- "@contember/engine-content-api": "^1.2.0-alpha.17",
14
- "@contember/engine-plugins": "^1.2.0-alpha.17",
15
- "@contember/engine-system-api": "^1.2.0-alpha.17",
16
- "@contember/engine-tenant-api": "^1.2.0-alpha.17",
17
- "@contember/graphql-utils": "^1.2.0-alpha.17",
18
- "@contember/schema": "^1.2.0-alpha.17",
19
- "@contember/schema-utils": "^1.2.0-alpha.17",
20
- "@contember/typesafe": "^1.2.0-alpha.17",
12
+ "@contember/database": "^1.2.0-alpha.19",
13
+ "@contember/engine-content-api": "^1.2.0-alpha.19",
14
+ "@contember/engine-plugins": "^1.2.0-alpha.19",
15
+ "@contember/engine-system-api": "^1.2.0-alpha.19",
16
+ "@contember/engine-tenant-api": "^1.2.0-alpha.19",
17
+ "@contember/graphql-utils": "^1.2.0-alpha.19",
18
+ "@contember/logger": "^1.2.0-alpha.19",
19
+ "@contember/schema": "^1.2.0-alpha.19",
20
+ "@contember/schema-utils": "^1.2.0-alpha.19",
21
+ "@contember/typesafe": "^1.2.0-alpha.19",
21
22
  "@graphql-tools/schema": "^8.3.5",
22
- "@types/lru-cache": "^7.10.10",
23
+ "@graphql-tools/merge": "^8.3.5",
23
24
  "accepts": "^1.3.7",
24
25
  "bcrypt": "^5.0.1",
25
26
  "koa": "^2.11.0",
@@ -32,7 +33,7 @@
32
33
  "@types/koa": "^2.11.3",
33
34
  "@types/koa-bodyparser": "^4.2.2",
34
35
  "@types/koa__cors": "^3.0.2",
35
- "@types/lru-cache": "^5.1.0",
36
+ "@types/lru-cache": "^7.10.10",
36
37
  "@types/node": "^18",
37
38
  "@types/uuid": "^8.3.0",
38
39
  "graphql": "^16.5.0"
@@ -1,5 +1,5 @@
1
1
  import { KoaMiddleware } from '../koa'
2
- import { Readable } from 'stream'
2
+ import { Readable } from 'node:stream'
3
3
  import { LoggerMiddlewareState } from './LoggerMiddleware'
4
4
 
5
5
  type EventTime = { label: string; start: number; duration?: number }
@@ -69,7 +69,7 @@ export class ContentApiMiddlewareFactory {
69
69
  request,
70
70
  timer,
71
71
  systemDatabase,
72
- stageSlug: stage.slug,
72
+ stageId: stage.id,
73
73
  })
74
74
  if (notModifiedRes?.isModified === false) {
75
75
  response.status = 304
@@ -1,4 +1,4 @@
1
- import { getArgumentValues } from 'graphql/execution/values'
1
+ import { getArgumentValues } from 'graphql'
2
2
 
3
3
  import { Context, createAclVariables, ExecutionContainerFactory } from '@contember/engine-content-api'
4
4
  import { setupSystemVariables } from '@contember/engine-system-api'
@@ -11,11 +11,11 @@ export interface NotModifiedCheckResult {
11
11
  }
12
12
 
13
13
  export class NotModifiedChecker {
14
- public async checkNotModified({ request, timer, systemDatabase, stageSlug }: {
14
+ public async checkNotModified({ request, timer, systemDatabase, stageId }: {
15
15
  request: Request
16
16
  timer: Timer
17
17
  systemDatabase: DatabaseContext
18
- stageSlug: string
18
+ stageId: string
19
19
  }): Promise<NotModifiedCheckResult | null> {
20
20
  if (request.headers[NotModifiedHeaderName] === undefined) {
21
21
  return null
@@ -28,7 +28,7 @@ export class NotModifiedChecker {
28
28
  }
29
29
  const latestRef = await timer('NotModifiedCheck', () => {
30
30
  const queryHandler = systemDatabase.queryHandler
31
- return queryHandler.fetch(new LatestTransactionIdByStageQuery(stageSlug))
31
+ return queryHandler.fetch(new LatestTransactionIdByStageQuery(stageId))
32
32
  })
33
33
 
34
34
  return {
@@ -11,7 +11,7 @@ import {
11
11
  validateSchema,
12
12
  } from 'graphql'
13
13
  import LRUCache from 'lru-cache'
14
- import { createHash } from 'crypto'
14
+ import { createHash } from 'node:crypto'
15
15
  import { Request, Response } from 'koa'
16
16
  import { logger } from '@contember/logger'
17
17
  import { ForbiddenError } from '@contember/graphql-utils'
package/src/providers.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { v4 as uuidv4 } from 'uuid'
2
2
  import bcrypt from 'bcrypt'
3
- import crypto, { BinaryLike } from 'crypto'
3
+ import crypto, { BinaryLike } from 'node:crypto'
4
4
 
5
5
 
6
6
  export const createProviders = () => ({
@@ -1,7 +1,7 @@
1
1
  import { KoaMiddleware, KoaRequestState } from '../koa'
2
2
  import { AuthResult, HttpError, TimerMiddlewareState } from '../common'
3
3
  import { ProjectGroupResolver, ProjectInfoMiddlewareState } from '../project-common'
4
- import { Readable } from 'stream'
4
+ import { Readable } from 'node:stream'
5
5
  import { toBuffer } from './CommandStream'
6
6
  import { ExportExecutor, ExportRequest } from './ExportExecutor'
7
7
  import { ParseError } from '@contember/typesafe'
@@ -3,7 +3,7 @@ import { AuthResult, HttpError, TimerMiddlewareState } from '../common'
3
3
  import { ProjectGroupResolver, ProjectInfoMiddlewareState } from '../project-common'
4
4
  import { fromBuffer } from './CommandStream'
5
5
  import { ImportError, ImportExecutor } from './ImportExecutor'
6
- import { createGunzip } from 'zlib'
6
+ import { createGunzip } from 'node:zlib'
7
7
 
8
8
  type ImportApiMiddlewareState =
9
9
  & TimerMiddlewareState
package/src/tsconfig.json CHANGED
@@ -4,10 +4,6 @@
4
4
  "outDir": "../dist/src"
5
5
  },
6
6
  "references": [
7
-
8
- {
9
- "path": "../../config-loader/src"
10
- },
11
7
  {
12
8
  "path": "../../database/src"
13
9
  },
@@ -37,6 +33,9 @@
37
33
  },
38
34
  {
39
35
  "path": "../../schema-utils/src"
36
+ },
37
+ {
38
+ "path": "../../typesafe/src"
40
39
  }
41
40
  ]
42
41
  }
@@ -1,4 +1,4 @@
1
- import * as crypto from 'crypto'
1
+ import * as crypto from 'node:crypto'
2
2
 
3
3
  export class CryptoWrapper {
4
4
  public static cryptoAlgo = 'aes-256-gcm' as const
@@ -1,6 +1,6 @@
1
1
  import { test, assert } from 'vitest'
2
2
  import { CryptoWrapper } from '../../../src'
3
- import * as crypto from 'crypto'
3
+ import * as crypto from 'node:crypto'
4
4
 
5
5
  const encryptionKey = crypto.createSecretKey(Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex'))
6
6
  const iv = Buffer.alloc(16).fill('a')