@ir-kit/openapi-typescript 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @ir-kit/openapi-typescript
2
2
 
3
- Thin programmatic wrapper around [`@hey-api/openapi-ts`](https://www.npmjs.com/package/@hey-api/openapi-ts) that exposes the same `generate()` shape as [`@ir-kit/openapi-{go,kotlin,swift}`](https://github.com/ir-kit/ir-kit). Lets the [`sdk-regen`](https://github.com/ir-kit/ir-kit/tree/main/actions/sdk-regen) GitHub Action drive a TypeScript SDK alongside the native ones — same workflow, same inputs, four targets.
3
+ Thin programmatic wrapper around [`@hey-api/openapi-ts`](https://www.npmjs.com/package/@hey-api/openapi-ts) that exposes the same `generate()` shape as [`@ir-kit/openapi-{go,kotlin,swift}`](https://github.com/ahmedrowaihi/ir-kit). Lets the [`sdk-regen`](https://github.com/ahmedrowaihi/ir-kit/tree/main/actions/sdk-regen) GitHub Action drive a TypeScript SDK alongside the native ones — same workflow, same inputs, four targets.
4
4
 
5
- Part of [ir-kit](https://github.com/ir-kit/ir-kit). **No new codegen** — the entire TypeScript pipeline (types, sdk, schemas, transformers, validators, query hooks, ...) is hey-api's; this package only normalises the calling convention and the result shape.
5
+ Part of [ir-kit](https://github.com/ahmedrowaihi/ir-kit). **No new codegen** — the entire TypeScript pipeline (types, sdk, schemas, transformers, validators, query hooks, ...) is hey-api's; this package only normalises the calling convention and the result shape.
6
6
 
7
7
  ## Install
8
8
 
@@ -63,7 +63,7 @@ interface GenerateResult {
63
63
  }
64
64
  ```
65
65
 
66
- Matches the result shape of `@ir-kit/openapi-go` / `-kotlin` / `-swift`, so downstream tooling (the [`sdk-regen`](https://github.com/ir-kit/ir-kit/tree/main/actions/sdk-regen) action, your own CI scripts) can iterate the four packages uniformly.
66
+ Matches the result shape of `@ir-kit/openapi-go` / `-kotlin` / `-swift`, so downstream tooling (the [`sdk-regen`](https://github.com/ahmedrowaihi/ir-kit/tree/main/actions/sdk-regen) action, your own CI scripts) can iterate the four packages uniformly.
67
67
 
68
68
  ## Why a wrapper
69
69
 
@@ -2,9 +2,9 @@ import { type UserConfig } from "@hey-api/openapi-ts";
2
2
  import type { NormalizeOptions } from "@ir-kit/openapi";
3
3
  export interface GenerateOptions {
4
4
  /**
5
- * Path, URL, or pre-parsed OpenAPI 3.x spec. Forwarded to hey-api
6
- * which delegates to `@hey-api/json-schema-ref-parser` for strings
7
- * and accepts objects directly.
5
+ * Path, URL, or pre-parsed OpenAPI 3.x spec. Loaded and bundled with
6
+ * `@ir-kit/openapi-loader`, like the native targets, before hey-api
7
+ * sees it.
8
8
  */
9
9
  input: string | Record<string, unknown>;
10
10
  /** Directory the SDK is written to (created if missing). */
@@ -23,11 +23,7 @@ export interface GenerateOptions {
23
23
  * wins over the defaults set here.
24
24
  */
25
25
  heyApi?: Partial<UserConfig>;
26
- /**
27
- * Pre-codegen spec normalization. When enabled, the spec is bundled
28
- * + normalized before being handed to hey-api as a parsed object,
29
- * so all four targets share the same normalization logic.
30
- */
26
+ /** Pre-codegen spec normalization, shared with the native targets. */
31
27
  normalize?: boolean | NormalizeOptions;
32
28
  }
33
29
  export interface BuiltFile {
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAiBxD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;;;;OAKG;IACH,MAAM,CAA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AC,cAAc,CAAC,CAe7E"}
package/dist/generate.js CHANGED
@@ -23,9 +23,10 @@ const DEFAULT_PLUGINS = [
23
23
  */
24
24
  export async function generate(opts) {
25
25
  const out = resolve(process.cwd(), opts.output);
26
- const input = opts.normalize
27
- ? await loadOpenAPI({ input: opts.input, normalize: opts.normalize })
28
- : opts.input;
26
+ const input = await loadOpenAPI({
27
+ input: opts.input,
28
+ normalize: opts.normalize,
29
+ });
29
30
  const config = {
30
31
  input,
31
32
  output: out,
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,eAAe,GAA0B;IAC7C,uBAAuB;IACvB,qBAAqB;IACrB,cAAc;CACf,CAAC;AA6CF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAqB;IAClD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS;QAC1B,CAAC,CAAC,MAAM,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;QACrE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACf,MAAM,MAAM,GAAe;QACzB,KAAK;QACL,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,eAAe,CAA0B;QACnE,GAAG,IAAI,CAAC,M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O,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,CAAC,WAAW,EAAE;YAAE,MAAM,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;;YAC5C,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ir-kit/openapi-typescript",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Thin programmatic wrapper around @hey-api/openapi-ts that ships a `generate()` matching the shape of @ir-kit/openapi-{go,kotlin,swift}, so the same sdk-regen workflow can target TypeScript clients (types + sdk + schemas + transformers + validators + ...) via hey-api's plugin pipeline.",
5
5
  "keywords": [
6
6
  "openapi",
@@ -10,9 +10,9 @@
10
10
  "client",
11
11
  "hey-api"
12
12
  ],
13
- "homepage": "https://github.com/ir-kit/ir-kit/tree/main/packages/openapi/typescript",
13
+ "homepage": "https://github.com/ahmedrowaihi/ir-kit/tree/main/packages/openapi/typescript",
14
14
  "bugs": {
15
- "url": "https://github.com/ir-kit/ir-kit/issues"
15
+ "url": "https://github.com/ahmedrowaihi/ir-kit/issues"
16
16
  },
17
17
  "license": "MIT",
18
18
  "author": {
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
24
- "url": "git+https://github.com/ir-kit/ir-kit.git",
24
+ "url": "git+https://github.com/ahmedrowaihi/ir-kit.git",
25
25
  "directory": "packages/openapi/typescript"
26
26
  },
27
27
  "type": "module",
@@ -45,15 +45,15 @@
45
45
  "provenance": true
46
46
  },
47
47
  "peerDependencies": {
48
- "@hey-api/openapi-ts": ">=0.97.0"
48
+ "@hey-api/openapi-ts": ">=0.99.0"
49
49
  },
50
50
  "dependencies": {
51
- "@ir-kit/openapi": "0.3.0",
52
- "@ir-kit/openapi-loader": "0.2.0",
53
- "@ir-kit/openapi-tools": "0.3.0"
51
+ "@ir-kit/openapi": "0.5.0",
52
+ "@ir-kit/openapi-tools": "0.4.0",
53
+ "@ir-kit/openapi-loader": "0.4.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@hey-api/openapi-ts": "^0.97.0",
56
+ "@hey-api/openapi-ts": "^0.99.0",
57
57
  "@types/node": "^22",
58
58
  "vitest": "^4.0.0",
59
59
  "@ir-kit/tsconfig": "0.0.0"