@postman/sdk-config 0.0.3 → 0.1.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 +42 -17
- package/dist/index.cjs +2017 -180
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1980 -181
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +2233 -0
- package/dist/sdk-config/index.cjs.map +1 -0
- package/dist/sdk-config/index.d.cts +3 -0
- package/dist/sdk-config/index.d.ts +3 -0
- package/dist/sdk-config/index.js +2192 -0
- package/dist/sdk-config/index.js.map +1 -0
- package/dist/sdk-config/v1/index.cjs +2233 -0
- package/dist/sdk-config/v1/index.cjs.map +1 -0
- package/dist/sdk-config/v1/index.d.cts +8644 -0
- package/dist/sdk-config/v1/index.d.ts +8644 -0
- package/dist/sdk-config/v1/index.js +2192 -0
- package/dist/sdk-config/v1/index.js.map +1 -0
- package/dist/sdk-config-ir/index.cjs +155 -19
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +2 -1
- package/dist/sdk-config-ir/index.d.ts +2 -1
- package/dist/sdk-config-ir/index.js +154 -20
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +155 -19
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +448 -398
- package/dist/sdk-config-ir/v1/index.d.ts +448 -398
- package/dist/sdk-config-ir/v1/index.js +154 -20
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/typescript-ByDbin_v.d.cts +426 -0
- package/dist/typescript-ByDbin_v.d.ts +426 -0
- package/package.json +15 -2
- package/src/sdk-config/v1/README.md +135 -0
- package/src/sdk-config-ir/v1/README.md +46 -27
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# @postman/sdk-config
|
|
2
2
|
|
|
3
|
-
Shared, runtime-validated configuration contracts for Postman's SDK generation
|
|
3
|
+
Shared, runtime-validated public and internal configuration contracts for Postman's SDK generation
|
|
4
|
+
pipeline.
|
|
4
5
|
|
|
5
|
-
This package is the source of truth for
|
|
6
|
-
sdk-gen-api, Postman and Fern CLIs, and translators that normalize
|
|
7
|
-
before generation.
|
|
6
|
+
This package is the source of truth for the customer-facing `SdkConfig` and internal `SdkConfigIr`.
|
|
7
|
+
It is intended for sdk-gen-core, sdk-gen-api, Postman and Fern CLIs, and translators that normalize
|
|
8
|
+
producer-specific configuration before generation.
|
|
8
9
|
|
|
9
10
|
## Install
|
|
10
11
|
|
|
@@ -16,7 +17,15 @@ npm install @postman/sdk-config
|
|
|
16
17
|
|
|
17
18
|
## Use
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
Use `SdkConfigV1` for customer-authored, potentially multi-target generation configuration:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { parseSdkConfigV1, type SdkConfigV1 } from '@postman/sdk-config/sdk-config/v1';
|
|
24
|
+
|
|
25
|
+
const sdkConfig: SdkConfigV1 = parseSdkConfigV1(untrustedInput);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use `SdkConfigIrV1` only for the normalized, single-target internal generator contract:
|
|
20
29
|
|
|
21
30
|
```ts
|
|
22
31
|
import { parseSdkConfigIrV1, type SdkConfigIrV1 } from '@postman/sdk-config/sdk-config-ir/v1';
|
|
@@ -24,8 +33,13 @@ import { parseSdkConfigIrV1, type SdkConfigIrV1 } from '@postman/sdk-config/sdk-
|
|
|
24
33
|
const sdkConfigIr: SdkConfigIrV1 = parseSdkConfigIrV1(untrustedInput);
|
|
25
34
|
```
|
|
26
35
|
|
|
27
|
-
The package also exposes `@postman/sdk-config
|
|
28
|
-
current-version entry points. Persisted payloads
|
|
36
|
+
The package also exposes `@postman/sdk-config`, `@postman/sdk-config/sdk-config`, and
|
|
37
|
+
`@postman/sdk-config/sdk-config-ir` as convenient current-version entry points. Persisted payloads
|
|
38
|
+
must still include the appropriate `schemaVersion`.
|
|
39
|
+
|
|
40
|
+
`SdkConfigV1` does not accept source selection, server-owned fields, `SdkConfigIrV1`, or legacy
|
|
41
|
+
Postman `BuildParameters`. See the [SDK Config v1 reference](src/sdk-config/v1/README.md) for the
|
|
42
|
+
boundaries and target precedence rules.
|
|
29
43
|
|
|
30
44
|
Both ESM `import` and CommonJS `require` consumers are supported.
|
|
31
45
|
|
|
@@ -33,11 +47,17 @@ Both ESM `import` and CommonJS `require` consumers are supported.
|
|
|
33
47
|
|
|
34
48
|
```text
|
|
35
49
|
src/
|
|
50
|
+
sdk-config-domain/
|
|
51
|
+
v1/ # Portable field schemas shared by public config and internal IR
|
|
52
|
+
sdk-config/
|
|
53
|
+
v1/ # Customer-facing multi-target schema and contract reference
|
|
36
54
|
sdk-config-ir/
|
|
37
55
|
v1/ # Versioned schema, inferred types, and contract reference
|
|
38
56
|
tests/
|
|
39
57
|
fixtures/
|
|
58
|
+
sdk-config/v1/ # Canonical public configuration payloads
|
|
40
59
|
sdk-config-ir/v1/ # Canonical portable payloads
|
|
60
|
+
sdk-config/v1/ # Public contract and export tests
|
|
41
61
|
sdk-config-ir/v1/ # Contract behavior tests
|
|
42
62
|
docs/
|
|
43
63
|
migration.md # sdk-gen-core adoption sequence
|
|
@@ -61,7 +81,8 @@ npm pack --dry-run
|
|
|
61
81
|
publish it.
|
|
62
82
|
- Additive v1 fields require a package minor version and a consumer-first rollout because v1 uses
|
|
63
83
|
strict runtime objects: an older consumer rejects fields it does not know.
|
|
64
|
-
- Breaking wire changes get a new schema directory and discriminator such as `sdk-config
|
|
84
|
+
- Breaking wire changes get a new schema directory and discriminator such as `sdk-config/v2` or
|
|
85
|
+
`sdk-config-ir/v2`.
|
|
65
86
|
- Keep the previous version exported while consumers migrate.
|
|
66
87
|
|
|
67
88
|
### Manual release process
|
|
@@ -120,20 +141,24 @@ git pull --ff-only origin main
|
|
|
120
141
|
node -p "require('./package.json').version"
|
|
121
142
|
```
|
|
122
143
|
|
|
123
|
-
Create
|
|
144
|
+
Create the signed tag and dispatch the **Package Release** workflow with the tag as its explicit
|
|
145
|
+
input:
|
|
124
146
|
|
|
125
147
|
```sh
|
|
126
|
-
|
|
127
|
-
git tag -v v1.1.0
|
|
128
|
-
git push origin v1.1.0
|
|
148
|
+
npm run release -- v1.1.0
|
|
129
149
|
```
|
|
130
150
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
151
|
+
The release script requires a clean, up-to-date `main`, verifies that the package version matches
|
|
152
|
+
the tag and that the commit is already contained in `main` and `develop`, creates and verifies a
|
|
153
|
+
signed, annotated tag, pushes it, and dispatches `.github/workflows/npm-publish.yml` with
|
|
154
|
+
`tag=v1.1.0`. The workflow independently rechecks `main` ancestry before calling the shared
|
|
155
|
+
publisher, which verifies `develop` ancestry and the tag signature. Explicit dispatch avoids
|
|
156
|
+
duplicate publish runs and keeps retries tied to the immutable tag. In GitHub, open **Actions** →
|
|
157
|
+
**Package Release** and confirm the dispatched run succeeds.
|
|
134
158
|
|
|
135
159
|
If publishing fails after the tag has been created, do not delete, move, or recreate the tag. After
|
|
136
|
-
the underlying problem is fixed,
|
|
137
|
-
|
|
160
|
+
the underlying problem is fixed, run the same command again. The script verifies and reuses the
|
|
161
|
+
existing tag before dispatching another run. You can also use **Actions** → **Package Release** →
|
|
162
|
+
**Run workflow** and enter the existing tag, such as `v1.1.0`.
|
|
138
163
|
|
|
139
164
|
See the [SDK Config IR v1 reference](src/sdk-config-ir/v1/README.md) for the complete contract.
|