@platformatic/gateway 3.46.0 → 3.48.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 (3) hide show
  1. package/index.d.ts +25 -10
  2. package/package.json +10 -8
  3. package/schema.json +1 -1
package/index.d.ts CHANGED
@@ -3,13 +3,22 @@ import { Configuration, ConfigurationOptions } from '@platformatic/foundation'
3
3
  import {
4
4
  ServiceCapability,
5
5
  Generator as ServiceGenerator,
6
- PlatformaticServiceConfig,
7
6
  ServerInstance as ServiceServerInstance
8
7
  } from '@platformatic/service'
9
8
  import { JSONSchemaType } from 'ajv'
10
9
  import { FastifyError, FastifyInstance } from 'fastify'
11
10
  import type { PlatformaticGatewayConfig } from './config.d.ts'
12
11
 
12
+ export interface GatewayCommand {
13
+ usage: string
14
+ description: string
15
+ }
16
+
17
+ export interface GatewayCommandDefinition {
18
+ commands: Record<string, (...args: unknown[]) => Promise<void> | void>
19
+ help: Record<string, GatewayCommand>
20
+ }
21
+
13
22
  export type { PlatformaticServiceConfig } from '@platformatic/service'
14
23
  export type { PlatformaticGatewayConfig } from './config.d.ts'
15
24
 
@@ -20,19 +29,21 @@ export type ServerInstance = ServiceServerInstance<PlatformaticGatewayConfig>
20
29
  type GatewayConfiguration = Configuration<PlatformaticGatewayConfig>
21
30
 
22
31
  export declare function loadConfiguration (
23
- root: string | PlatformaticServiceConfig,
24
- source?: string | PlatformaticServiceConfig,
32
+ root: string | PlatformaticGatewayConfig,
33
+ source?: string | PlatformaticGatewayConfig,
25
34
  context?: ConfigurationOptions
26
35
  ): Promise<GatewayConfiguration>
27
36
 
28
37
  export function create (
29
- root: string,
38
+ root: string | PlatformaticGatewayConfig,
30
39
  source?: string | PlatformaticGatewayConfig,
31
40
  context?: ConfigurationOptions
32
41
  ): Promise<GatewayCapability>
33
42
 
34
43
  export declare function platformaticGateway (app: FastifyInstance, capability: BaseCapability): Promise<void>
35
44
 
45
+ export declare function createCommands (id: string): GatewayCommandDefinition
46
+
36
47
  export class Generator extends ServiceGenerator {}
37
48
 
38
49
  export declare const packageJson: Record<string, unknown>
@@ -44,15 +55,19 @@ export declare const schemaComponents: {
44
55
  entityResolver: JSONSchemaType<object>
45
56
  entities: JSONSchemaType<object>
46
57
  graphqlApplication: JSONSchemaType<object>
47
- graphqlGatewayOptions: JSONSchemaType<object>
58
+ graphqlComposerOptions: JSONSchemaType<object>
48
59
  gateway: JSONSchemaType<object>
49
60
  types: JSONSchemaType<object>
50
61
  }
51
62
 
63
+ export declare const skipTelemetryHooks: boolean
64
+
52
65
  export declare const version: string
53
66
 
54
- export function FastifyInstanceIsAlreadyListeningError (): FastifyError
55
- export function FailedToFetchOpenAPISchemaError (): FastifyError
56
- export function ValidationErrors (): FastifyError
57
- export function PathAlreadyExistsError (): FastifyError
58
- export function CouldNotReadOpenAPIConfigError (): FastifyError
67
+ export namespace errors {
68
+ export const FastifyInstanceIsAlreadyListeningError: () => FastifyError
69
+ export const FailedToFetchOpenAPISchemaError: () => FastifyError
70
+ export const ValidationErrors: () => FastifyError
71
+ export const PathAlreadyExistsError: () => FastifyError
72
+ export const CouldNotReadOpenAPIConfigError: () => FastifyError
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/gateway",
3
- "version": "3.46.0",
3
+ "version": "3.48.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -22,6 +22,7 @@
22
22
  "dedent": "^1.5.1",
23
23
  "eslint": "9",
24
24
  "json-schema-to-typescript": "^15.0.0",
25
+ "tstyche": "^6.2.0",
25
26
  "neostandard": "^0.12.0",
26
27
  "openapi-schema-validator": "^12.1.3",
27
28
  "pino-test": "^1.0.1",
@@ -32,7 +33,7 @@
32
33
  "typescript": "^5.5.4",
33
34
  "why-is-node-running": "2",
34
35
  "ws": "^8.16.0",
35
- "@platformatic/db": "3.46.0"
36
+ "@platformatic/db": "3.48.0"
36
37
  },
37
38
  "dependencies": {
38
39
  "@fastify/error": "^4.0.0",
@@ -63,17 +64,18 @@
63
64
  "rfdc": "^1.3.1",
64
65
  "semgrator": "^0.3.0",
65
66
  "undici": "^7.0.0",
66
- "@platformatic/basic": "3.46.0",
67
- "@platformatic/scalar-theme": "3.46.0",
68
- "@platformatic/foundation": "^3.46.0",
69
- "@platformatic/service": "3.46.0",
70
- "@platformatic/telemetry": "3.46.0"
67
+ "@platformatic/basic": "3.48.0",
68
+ "@platformatic/foundation": "^3.48.0",
69
+ "@platformatic/scalar-theme": "3.48.0",
70
+ "@platformatic/service": "3.48.0",
71
+ "@platformatic/telemetry": "3.48.0"
71
72
  },
72
73
  "engines": {
73
74
  "node": ">=22.19.0"
74
75
  },
75
76
  "scripts": {
76
- "test": "node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
77
+ "test": "npm run test:types && node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
78
+ "test:types": "tstyche",
77
79
  "gen-schema": "node lib/schema.js > schema.json",
78
80
  "gen-types": "json2ts > config.d.ts < schema.json",
79
81
  "build": "npm run gen-schema && npm run gen-types",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.46.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.48.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Gateway Config",
5
5
  "type": "object",