@feasibleone/blong-openapi 1.2.0 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.1](https://github.com/feasibleone/blong/compare/blong-openapi-v1.2.0...blong-openapi-v1.2.1) (2026-09-10)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * split core to folders ([3900de8](https://github.com/feasibleone/blong/commit/3900de88defe8a3e9c492c5cf9388ac4ee81d781))
9
+
3
10
  ## [1.2.0](https://github.com/feasibleone/blong/compare/blong-openapi-v1.1.4...blong-openapi-v1.2.0) (2026-05-19)
4
11
 
5
12
 
package/README.md CHANGED
@@ -13,15 +13,13 @@ OpenAPI/Swagger integration for the Blong framework
13
13
 
14
14
  ## Overview
15
15
 
16
- `@feasibleone/blong-openapi` provides seamless integration with external REST
17
- APIs using OpenAPI 2.0/3.0 (Swagger) definitions. It automatically generates
18
- type-safe handlers from API specifications, enabling you to call external
19
- services without writing manual HTTP request code.
16
+ `@feasibleone/blong-openapi` provides seamless integration with external REST APIs using OpenAPI
17
+ 2.0/3.0 (Swagger) definitions. It automatically generates type-safe handlers from API
18
+ specifications, enabling you to call external services without writing manual HTTP request code.
20
19
 
21
20
  ## Features
22
21
 
23
- - **Automatic Handler Generation**: Parse OpenAPI/Swagger definitions and
24
- generate callable handlers
22
+ - **Automatic Handler Generation**: Parse OpenAPI/Swagger definitions and generate callable handlers
25
23
  - **Type-Safe Integration**: Use `operationId` from API specs as handler names
26
24
  - **Multiple API Support**: Configure multiple API namespaces in a single orchestrator
27
25
  - **URL & File Support**: Load specifications from local files or remote URLs
@@ -99,13 +97,13 @@ const result = await this.bus.weatherGetCurrentWeather({
99
97
 
100
98
  ```yaml
101
99
  openapi:
102
- logLevel: info # Log level for the orchestrator
103
- namespace: ['api'] # Namespace prefix for calling handlers
104
- api:
105
- namespace:
106
- weather: # API namespace identifier
107
- - ./api/weather.yaml # OpenAPI/Swagger definition (local)
108
- - https://api.example.com/swagger.json # or remote URL
100
+ logLevel: info # Log level for the orchestrator
101
+ namespace: ['api'] # Namespace prefix for calling handlers
102
+ api:
103
+ namespace:
104
+ weather: # API namespace identifier
105
+ - ./api/weather.yaml # OpenAPI/Swagger definition (local)
106
+ - https://api.example.com/swagger.json # or remote URL
109
107
  ```
110
108
 
111
109
  ### Advanced Configuration
@@ -114,22 +112,22 @@ Configure multiple APIs with custom settings:
114
112
 
115
113
  ```yaml
116
114
  openapi:
117
- api:
118
- namespace:
119
- # External API with custom server override
120
- payment:
121
- - https://payment-api.example.com/openapi.json
122
- - host: 'api.production.com'
123
- basePath: '/v2'
124
- x-blong:
125
- destination: 'paymentService'
126
- namespace: 'payment'
127
-
128
- # Kubernetes API integration
129
- k8s:
130
- - https://kubernetes.io/api/v1/swagger.json
131
- - servers:
132
- - url: 'https://k8s-cluster:6443'
115
+ api:
116
+ namespace:
117
+ # External API with custom server override
118
+ payment:
119
+ - https://payment-api.example.com/openapi.json
120
+ - host: 'api.production.com'
121
+ basePath: '/v2'
122
+ x-blong:
123
+ destination: 'paymentService'
124
+ namespace: 'payment'
125
+
126
+ # Kubernetes API integration
127
+ k8s:
128
+ - https://kubernetes.io/api/v1/swagger.json
129
+ - servers:
130
+ - url: 'https://k8s-cluster:6443'
133
131
  ```
134
132
 
135
133
  ### Multiple Definition Files
@@ -138,12 +136,12 @@ Split large API definitions across multiple files:
138
136
 
139
137
  ```yaml
140
138
  api:
141
- namespace:
142
- time:
143
- - ./api/world-time.yaml # Base OpenAPI definition
144
- - ./api/world-time.operations.yaml # Additional operationId mappings
145
- - servers:
146
- - url: 'http://worldtimeapi.org'
139
+ namespace:
140
+ time:
141
+ - ./api/world-time.yaml # Base OpenAPI definition
142
+ - ./api/world-time.operations.yaml # Additional operationId mappings
143
+ - servers:
144
+ - url: 'http://worldtimeapi.org'
147
145
  ```
148
146
 
149
147
  ## Usage Patterns
@@ -184,9 +182,9 @@ Deploy as standalone microservice:
184
182
 
185
183
  ```yaml
186
184
  microservice:
187
- orchestrator: true # Enable orchestrator mode
188
- gateway:
189
- port: 8081 # Expose on port 8081
185
+ orchestrator: true # Enable orchestrator mode
186
+ gateway:
187
+ port: 8081 # Expose on port 8081
190
188
  ```
191
189
 
192
190
  ### Custom Operation IDs
@@ -196,10 +194,10 @@ If API doesn't define `operationId`, create mapping file:
196
194
  ```yaml
197
195
  # weather-operations.yaml
198
196
  paths:
199
- /weather/current:
200
- get:
201
- operationId: getCurrentWeather
202
- x-blong-method: weatherCurrent # Alternative method name
197
+ /weather/current:
198
+ get:
199
+ operationId: getCurrentWeather
200
+ x-blong-method: weatherCurrent # Alternative method name
203
201
  ```
204
202
 
205
203
  ## Handler Naming Convention
@@ -208,11 +206,11 @@ Generated handlers follow the pattern: `{namespace}{operationId}`
208
206
 
209
207
  **Examples:**
210
208
 
211
- | Namespace | operationId | Handler Name |
212
- | ----------- | ------------- | -------------- |
213
- | weather | GetForecast | `weatherGetForecast` |
214
- | payment | CreateTransaction | `paymentCreateTransaction` |
215
- | k8s | listNamespaces | `k8sListNamespaces` |
209
+ | Namespace | operationId | Handler Name |
210
+ | --------- | ----------------- | -------------------------- |
211
+ | weather | GetForecast | `weatherGetForecast` |
212
+ | payment | CreateTransaction | `paymentCreateTransaction` |
213
+ | k8s | listNamespaces | `k8sListNamespaces` |
216
214
 
217
215
  Names are case-sensitive and trimmed of whitespace.
218
216
 
@@ -237,21 +235,19 @@ Configure incoming webhooks with OpenAPI definitions:
237
235
 
238
236
  ```yaml
239
237
  webhook:
240
- imports: ['codec.openapi']
241
- 'codec.openapi':
242
- namespace:
243
- github:
244
- - ./api/github-webhooks.yaml
238
+ imports: ['codec.openapi']
239
+ 'codec.openapi':
240
+ namespace:
241
+ github:
242
+ - ./api/github-webhooks.yaml
245
243
  ```
246
244
 
247
245
  ## Related Packages
248
246
 
249
- - **[@feasibleone/blong](https://www.npmjs.com/package/@feasibleone/blong)** -
250
- Core framework
251
- - **[@feasibleone/blong-gogo](https://www.npmjs.com/package/@feasibleone/blong-gogo)** -
252
- Contains base `orchestrator.openapi` and `codec.openapi`
253
- - **[openapi-types](https://www.npmjs.com/package/openapi-types)** - TypeScript
254
- types for OpenAPI
247
+ - **[@feasibleone/blong](https://www.npmjs.com/package/@feasibleone/blong)** - Core framework
248
+ - **[@feasibleone/blong-gogo](https://www.npmjs.com/package/@feasibleone/blong-gogo)** - Contains
249
+ base `orchestrator.openapi` and `codec.openapi`
250
+ - **[openapi-types](https://www.npmjs.com/package/openapi-types)** - TypeScript types for OpenAPI
255
251
 
256
252
  ## Documentation
257
253
 
@@ -262,5 +258,5 @@ webhook:
262
258
 
263
259
  ## Example Projects
264
260
 
265
- See the [test/api](../../core/test/api/) folder for working examples with
266
- world-time API integration.
261
+ See the [test/api](../../test/framework/demo/api/) folder for working examples with world-time API
262
+ integration.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feasibleone/blong-openapi",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/feasibleone/blong.git"
6
6
  },
@@ -22,8 +22,8 @@
22
22
  "@rushstack/heft": "^1.2.6",
23
23
  "@rushstack/heft-lint-plugin": "^1.2.6",
24
24
  "@rushstack/heft-typescript-plugin": "^1.3.1",
25
- "typescript": "^5.9.3",
26
- "@feasibleone/blong-dev": "1.0.0"
25
+ "typescript": "^6.0.3",
26
+ "@feasibleone/blong-dev": "1.2.2"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "heft build --clean",
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- type Load = (...params: unknown[]) => Promise<{
2
- start: () => Promise<unknown>;
3
- }>;
4
- declare const _default: (load: Load) => Promise<void>;
5
- export default _default;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAaA,KAAK,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CAAC,CAAC,CAAC;yBASzD,MAAM,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC;AAAhD,wBAeO"}
package/dist/index.js DELETED
@@ -1,34 +0,0 @@
1
- import { server } from '@feasibleone/blong';
2
- const openapiServer = server(blong => ({
3
- url: import.meta.url,
4
- validation: blong.type.Object({
5
- openapi: blong.type.Object({}),
6
- }),
7
- children: ['../blong-openapi'],
8
- config: {
9
- default: {},
10
- },
11
- }));
12
- const openapi = async (load, config) => {
13
- const platforms = await Promise.all([
14
- load(openapiServer, 'impl', config, ['microservice', 'integration', 'dev']),
15
- ]);
16
- for (const platform of platforms)
17
- await platform.start();
18
- };
19
- export default async (load) => openapi(load, {
20
- 'blong-openapi': {
21
- openapi: {
22
- api: {
23
- namespace: {
24
- time: [
25
- '../test/api/world-time.yaml',
26
- '../test/api/world-time.operations.yaml',
27
- // {servers: [{url: 'http://localhost:8081'}]},
28
- ],
29
- },
30
- },
31
- },
32
- },
33
- });
34
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE1C,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG;IACpB,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;KACjC,CAAC;IACF,QAAQ,EAAE,CAAC,kBAAkB,CAAC;IAC9B,MAAM,EAAE;QACJ,OAAO,EAAE,EAAE;KACd;CACJ,CAAC,CAAC,CAAC;AAIJ,MAAM,OAAO,GAAG,KAAK,EAAE,IAAU,EAAE,MAAe,EAAiB,EAAE;IACjE,MAAM,SAAS,GAAuC,MAAM,OAAO,CAAC,GAAG,CAAC;QACpE,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;KAC9E,CAAC,CAAC;IACH,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;AAC7D,CAAC,CAAC;AAEF,eAAe,KAAK,EAAE,IAAU,EAAiB,EAAE,CAC/C,OAAO,CAAC,IAAI,EAAE;IACV,eAAe,EAAE;QACb,OAAO,EAAE;YACL,GAAG,EAAE;gBACD,SAAS,EAAE;oBACP,IAAI,EAAE;wBACF,6BAA6B;wBAC7B,wCAAwC;wBACxC,+CAA+C;qBAClD;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- declare const _default: import("@feasibleone/blong").IAdapterFactory<{
2
- logLevel: "info";
3
- }, import("@feasibleone/blong").AdapterContext> & {
4
- [x: symbol]: "orchestrator";
5
- };
6
- export default _default;
7
- //# sourceMappingURL=openapi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../orchestrator/openapi.ts"],"names":[],"mappings":";;;;;AAEA,wBAOI"}
@@ -1,10 +0,0 @@
1
- import { orchestrator } from '@feasibleone/blong';
2
- export default orchestrator(() => ({
3
- extends: 'orchestrator.openapi',
4
- activation: {
5
- default: {
6
- logLevel: 'info',
7
- },
8
- },
9
- }));
10
- //# sourceMappingURL=openapi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi.js","sourceRoot":"","sources":["../../orchestrator/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEhD,eAAe,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/B,OAAO,EAAE,sBAAsB;IAC/B,UAAU,EAAE;QACR,OAAO,EAAE;YACL,QAAQ,EAAE,MAAM;SACnB;KACJ;CACJ,CAAC,CAAC,CAAC"}
package/dist/package.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "name": "@feasibleone/blong-openapi",
3
- "version": "1.2.0",
4
- "repository": {
5
- "url": "git+https://github.com/feasibleone/blong.git"
6
- },
7
- "type": "module",
8
- "exports": {
9
- "./server.js": "./dist/server.js",
10
- "./server.d.ts": "./dist/server.d.ts",
11
- "./server.ts": "./server.ts",
12
- "./browser.js": "./dist/browser.js",
13
- "./browser.d.ts": "./dist/browser.d.ts",
14
- "./browser.ts": "./browser.ts",
15
- "./dist/package.json": "./package.json",
16
- "./package.json": "./package.json"
17
- },
18
- "scripts": {
19
- "build": "heft build --clean",
20
- "ci-lint": "blong-dev lint",
21
- "ci-publish": "node ../../common/scripts/install-run-rush-pnpm.js publish --access public --provenance"
22
- },
23
- "dependencies": {
24
- "@feasibleone/blong": "workspace:^1.0.0"
25
- },
26
- "devDependencies": {
27
- "@feasibleone/blong-dev": "workspace:*",
28
- "@rushstack/heft": "^1.2.6",
29
- "@rushstack/heft-lint-plugin": "^1.2.6",
30
- "@rushstack/heft-typescript-plugin": "^1.3.1",
31
- "typescript": "^5.9.3"
32
- }
33
- }
package/dist/server.d.ts DELETED
@@ -1,7 +0,0 @@
1
- declare const _default: import("@feasibleone/blong").SolutionFactory<import("typebox").TObject<{
2
- openapi: import("typebox").TObject<{}>;
3
- }>> & {
4
- [x: symbol]: "solution";
5
- };
6
- export default _default;
7
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":";;;;;AAEA,wBAiBI"}
package/dist/server.js DELETED
@@ -1,20 +0,0 @@
1
- import { realm } from '@feasibleone/blong';
2
- export default realm(blong => ({
3
- url: import.meta.url,
4
- validation: blong.type.Object({
5
- openapi: blong.type.Object({}),
6
- }),
7
- children: ['./orchestrator'],
8
- config: {
9
- default: {},
10
- dev: {},
11
- microservice: {
12
- orchestrator: true,
13
- gateway: {
14
- port: 8081,
15
- },
16
- },
17
- integration: {},
18
- },
19
- }));
20
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,eAAe,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG;IACpB,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;KACjC,CAAC;IACF,QAAQ,EAAE,CAAC,gBAAgB,CAAC;IAC5B,MAAM,EAAE;QACJ,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,EAAE;QACP,YAAY,EAAE;YACV,YAAY,EAAE,IAAI;YAClB,OAAO,EAAE;gBACL,IAAI,EAAE,IAAI;aACb;SACJ;QACD,WAAW,EAAE,EAAE;KAClB;CACJ,CAAC,CAAC,CAAC"}