@postman/sdk-config 0.19.1 → 0.20.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/dist/index.cjs +208 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +208 -51
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +154 -5
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +1 -1
- package/dist/sdk-config/index.d.ts +1 -1
- package/dist/sdk-config/index.js +154 -5
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +154 -5
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +164 -30
- package/dist/sdk-config/v1/index.d.ts +164 -30
- package/dist/sdk-config/v1/index.js +154 -5
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +199 -49
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +1 -1
- package/dist/sdk-config-ir/index.d.ts +1 -1
- package/dist/sdk-config-ir/index.js +199 -50
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +199 -49
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +163 -4
- package/dist/sdk-config-ir/v1/index.d.ts +163 -4
- package/dist/sdk-config-ir/v1/index.js +199 -50
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-D0YeGxxS.d.cts → typescript-VEqEGvnA.d.cts} +60 -1
- package/dist/{typescript-D0YeGxxS.d.ts → typescript-VEqEGvnA.d.ts} +60 -1
- package/package.json +2 -2
- package/src/sdk-config/v1/README.md +59 -4
|
@@ -206,6 +206,40 @@ declare const profilesConfigSchema: z.ZodObject<{
|
|
|
206
206
|
revokeParameters: z.ZodOptional<z.ZodType<Record<string, string>, unknown, z.core.$ZodTypeInternals<Record<string, string>, unknown>>>;
|
|
207
207
|
}, z.core.$strict>>;
|
|
208
208
|
}, z.core.$strict>;
|
|
209
|
+
declare const oauthTokenEndpointsSchema: z.ZodObject<{
|
|
210
|
+
token: z.ZodOptional<z.ZodObject<{
|
|
211
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
213
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
214
|
+
scopes: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
217
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
218
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
219
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strict>>;
|
|
221
|
+
}, z.core.$strict>>;
|
|
222
|
+
refresh: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
224
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, z.core.$strict>>;
|
|
226
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
228
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
229
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
230
|
+
}, z.core.$strict>>;
|
|
231
|
+
}, z.core.$strict>>;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
type CliOAuthTokenEndpoints = z.infer<typeof oauthTokenEndpointsSchema>;
|
|
234
|
+
interface CrossCheckIssue {
|
|
235
|
+
message: string;
|
|
236
|
+
path: (string | number)[];
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Checks the token endpoint settings against the auth schemes of the same document: each key must be the id of an
|
|
240
|
+
* OAuth scheme with a client credentials flow, and refresh settings need the flow's refreshUrl.
|
|
241
|
+
*/
|
|
242
|
+
declare function oauthTokenEndpointsIssues(oauthTokenEndpoints: Record<string, CliOAuthTokenEndpoints> | undefined, schemes: readonly unknown[] | undefined, basePath: (string | number)[]): CrossCheckIssue[];
|
|
209
243
|
/**
|
|
210
244
|
* Omitted fields are left undefined; the CLI generator applies its own defaults: a binary name
|
|
211
245
|
* derived from the API display name, custom commands on, no root group, profiles off, a single
|
|
@@ -215,6 +249,7 @@ declare const cliGenerationConfigSchema: z.ZodObject<{
|
|
|
215
249
|
paginationParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
216
250
|
skills: z.ZodOptional<z.ZodBoolean>;
|
|
217
251
|
binaryName: z.ZodOptional<z.ZodString>;
|
|
252
|
+
crateName: z.ZodOptional<z.ZodString>;
|
|
218
253
|
customCommands: z.ZodOptional<z.ZodBoolean>;
|
|
219
254
|
rootGroup: z.ZodOptional<z.ZodString>;
|
|
220
255
|
profiles: z.ZodOptional<z.ZodObject<{
|
|
@@ -229,6 +264,30 @@ declare const cliGenerationConfigSchema: z.ZodObject<{
|
|
|
229
264
|
}, z.core.$strict>>;
|
|
230
265
|
splitTypeCrates: z.ZodOptional<z.ZodBoolean>;
|
|
231
266
|
userAgentSuffixFlag: z.ZodOptional<z.ZodString>;
|
|
267
|
+
oauthTokenEndpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
268
|
+
token: z.ZodOptional<z.ZodObject<{
|
|
269
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
271
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
272
|
+
scopes: z.ZodOptional<z.ZodString>;
|
|
273
|
+
}, z.core.$strict>>;
|
|
274
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
275
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
276
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
277
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
278
|
+
}, z.core.$strict>>;
|
|
279
|
+
}, z.core.$strict>>;
|
|
280
|
+
refresh: z.ZodOptional<z.ZodObject<{
|
|
281
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
282
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
285
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
286
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
287
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
288
|
+
}, z.core.$strict>>;
|
|
289
|
+
}, z.core.$strict>>;
|
|
290
|
+
}, z.core.$strict>>>;
|
|
232
291
|
}, z.core.$strict>;
|
|
233
292
|
type CliProfilesProvisionOperation = z.infer<typeof profilesProvisionOperationSchema>;
|
|
234
293
|
type CliProfilesConfig = z.infer<typeof profilesConfigSchema>;
|
|
@@ -603,4 +662,4 @@ declare const typescriptGenerationConfigSchema: z.ZodObject<{
|
|
|
603
662
|
}, z.core.$strict>;
|
|
604
663
|
type TypescriptGenerationConfig = z.infer<typeof typescriptGenerationConfigSchema>;
|
|
605
664
|
|
|
606
|
-
export {
|
|
665
|
+
export { relativePathSchema as $, dependencySchema as A, exactSemverSchema as B, CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE as C, type Dependency as D, githubActionsSecretNameSchema as E, goGenerationConfigSchema as F, type GoGenerationConfig as G, goModulePathSchema as H, javaGenerationConfigSchema as I, type JavaGenerationConfig as J, type KotlinGenerationConfig as K, jsonObjectSchema as L, type McpAvailabilityStatus as M, jsonValueSchema as N, kotlinGenerationConfigSchema as O, type PackageConfig as P, mcpAvailabilityStatuses as Q, type RubyGenerationConfig as R, type SdkConfigDiagnostic as S, type TerraformGenerationConfig as T, mcpGenerationConfigSchema as U, nonEmptyStringSchema as V, oauthTokenEndpointsIssues as W, packageConfigSchema as X, parentRelativePathSchema as Y, phpGenerationConfigSchema as Z, pythonGenerationConfigSchema as _, type CliDistributionConfig as a, rubyGenerationConfigSchema as a0, rustGenerationConfigSchema as a1, swiftGenerationConfigSchema as a2, terraformGenerationConfigSchema as a3, typescriptGenerationConfigSchema as a4, type CliDistributionGithubAppConfig as b, type CliDistributionHomebrewConfig as c, type CliDistributionScoopConfig as d, type CliGenerationConfig as e, type CliOAuthTokenEndpoints as f, type CliProfilesConfig as g, type CliProfilesProvisionOperation as h, type CsharpGenerationConfig as i, type JsonObject as j, type JsonValue as k, type McpGenerationConfig as l, type McpToolFilter as m, type PhpGenerationConfig as n, type PlanModifiers as o, type PythonGenerationConfig as p, type RustGenerationConfig as q, type SwiftGenerationConfig as r, type TypescriptGenerationConfig as s, cliDistributionConfigSchema as t, cliDistributionGithubAppSchema as u, cliDistributionHomebrewSchema as v, cliDistributionScoopSchema as w, cliGenerationConfigSchema as x, composerPackageNameSchema as y, csharpGenerationConfigSchema as z };
|
|
@@ -206,6 +206,40 @@ declare const profilesConfigSchema: z.ZodObject<{
|
|
|
206
206
|
revokeParameters: z.ZodOptional<z.ZodType<Record<string, string>, unknown, z.core.$ZodTypeInternals<Record<string, string>, unknown>>>;
|
|
207
207
|
}, z.core.$strict>>;
|
|
208
208
|
}, z.core.$strict>;
|
|
209
|
+
declare const oauthTokenEndpointsSchema: z.ZodObject<{
|
|
210
|
+
token: z.ZodOptional<z.ZodObject<{
|
|
211
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
213
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
214
|
+
scopes: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
217
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
218
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
219
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strict>>;
|
|
221
|
+
}, z.core.$strict>>;
|
|
222
|
+
refresh: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
224
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, z.core.$strict>>;
|
|
226
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
228
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
229
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
230
|
+
}, z.core.$strict>>;
|
|
231
|
+
}, z.core.$strict>>;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
type CliOAuthTokenEndpoints = z.infer<typeof oauthTokenEndpointsSchema>;
|
|
234
|
+
interface CrossCheckIssue {
|
|
235
|
+
message: string;
|
|
236
|
+
path: (string | number)[];
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Checks the token endpoint settings against the auth schemes of the same document: each key must be the id of an
|
|
240
|
+
* OAuth scheme with a client credentials flow, and refresh settings need the flow's refreshUrl.
|
|
241
|
+
*/
|
|
242
|
+
declare function oauthTokenEndpointsIssues(oauthTokenEndpoints: Record<string, CliOAuthTokenEndpoints> | undefined, schemes: readonly unknown[] | undefined, basePath: (string | number)[]): CrossCheckIssue[];
|
|
209
243
|
/**
|
|
210
244
|
* Omitted fields are left undefined; the CLI generator applies its own defaults: a binary name
|
|
211
245
|
* derived from the API display name, custom commands on, no root group, profiles off, a single
|
|
@@ -215,6 +249,7 @@ declare const cliGenerationConfigSchema: z.ZodObject<{
|
|
|
215
249
|
paginationParameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
216
250
|
skills: z.ZodOptional<z.ZodBoolean>;
|
|
217
251
|
binaryName: z.ZodOptional<z.ZodString>;
|
|
252
|
+
crateName: z.ZodOptional<z.ZodString>;
|
|
218
253
|
customCommands: z.ZodOptional<z.ZodBoolean>;
|
|
219
254
|
rootGroup: z.ZodOptional<z.ZodString>;
|
|
220
255
|
profiles: z.ZodOptional<z.ZodObject<{
|
|
@@ -229,6 +264,30 @@ declare const cliGenerationConfigSchema: z.ZodObject<{
|
|
|
229
264
|
}, z.core.$strict>>;
|
|
230
265
|
splitTypeCrates: z.ZodOptional<z.ZodBoolean>;
|
|
231
266
|
userAgentSuffixFlag: z.ZodOptional<z.ZodString>;
|
|
267
|
+
oauthTokenEndpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
268
|
+
token: z.ZodOptional<z.ZodObject<{
|
|
269
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
271
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
272
|
+
scopes: z.ZodOptional<z.ZodString>;
|
|
273
|
+
}, z.core.$strict>>;
|
|
274
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
275
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
276
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
277
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
278
|
+
}, z.core.$strict>>;
|
|
279
|
+
}, z.core.$strict>>;
|
|
280
|
+
refresh: z.ZodOptional<z.ZodObject<{
|
|
281
|
+
requestProperties: z.ZodOptional<z.ZodObject<{
|
|
282
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
responseProperties: z.ZodOptional<z.ZodObject<{
|
|
285
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
286
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
287
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
288
|
+
}, z.core.$strict>>;
|
|
289
|
+
}, z.core.$strict>>;
|
|
290
|
+
}, z.core.$strict>>>;
|
|
232
291
|
}, z.core.$strict>;
|
|
233
292
|
type CliProfilesProvisionOperation = z.infer<typeof profilesProvisionOperationSchema>;
|
|
234
293
|
type CliProfilesConfig = z.infer<typeof profilesConfigSchema>;
|
|
@@ -603,4 +662,4 @@ declare const typescriptGenerationConfigSchema: z.ZodObject<{
|
|
|
603
662
|
}, z.core.$strict>;
|
|
604
663
|
type TypescriptGenerationConfig = z.infer<typeof typescriptGenerationConfigSchema>;
|
|
605
664
|
|
|
606
|
-
export {
|
|
665
|
+
export { relativePathSchema as $, dependencySchema as A, exactSemverSchema as B, CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE as C, type Dependency as D, githubActionsSecretNameSchema as E, goGenerationConfigSchema as F, type GoGenerationConfig as G, goModulePathSchema as H, javaGenerationConfigSchema as I, type JavaGenerationConfig as J, type KotlinGenerationConfig as K, jsonObjectSchema as L, type McpAvailabilityStatus as M, jsonValueSchema as N, kotlinGenerationConfigSchema as O, type PackageConfig as P, mcpAvailabilityStatuses as Q, type RubyGenerationConfig as R, type SdkConfigDiagnostic as S, type TerraformGenerationConfig as T, mcpGenerationConfigSchema as U, nonEmptyStringSchema as V, oauthTokenEndpointsIssues as W, packageConfigSchema as X, parentRelativePathSchema as Y, phpGenerationConfigSchema as Z, pythonGenerationConfigSchema as _, type CliDistributionConfig as a, rubyGenerationConfigSchema as a0, rustGenerationConfigSchema as a1, swiftGenerationConfigSchema as a2, terraformGenerationConfigSchema as a3, typescriptGenerationConfigSchema as a4, type CliDistributionGithubAppConfig as b, type CliDistributionHomebrewConfig as c, type CliDistributionScoopConfig as d, type CliGenerationConfig as e, type CliOAuthTokenEndpoints as f, type CliProfilesConfig as g, type CliProfilesProvisionOperation as h, type CsharpGenerationConfig as i, type JsonObject as j, type JsonValue as k, type McpGenerationConfig as l, type McpToolFilter as m, type PhpGenerationConfig as n, type PlanModifiers as o, type PythonGenerationConfig as p, type RustGenerationConfig as q, type SwiftGenerationConfig as r, type TypescriptGenerationConfig as s, cliDistributionConfigSchema as t, cliDistributionGithubAppSchema as u, cliDistributionHomebrewSchema as v, cliDistributionScoopSchema as w, cliGenerationConfigSchema as x, composerPackageNameSchema as y, csharpGenerationConfigSchema as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postman/sdk-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Shared SDK configuration contracts and transformations for Postman SDK generation",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"test:watch": "vitest",
|
|
66
66
|
"typecheck": "tsc --noEmit",
|
|
67
67
|
"check": "npm run format:check && npm run lint && npm run typecheck && npm test && npm run build && npm run test:exports",
|
|
68
|
-
"prepack": "npm run build"
|
|
68
|
+
"prepack": "npm run format:check && npm run lint && npm run typecheck && npm run build && npm run test:exports"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"semver": "^7.7.4",
|
|
@@ -156,13 +156,41 @@ An OAuth 2.0 scheme distinguishes two kinds of client identity:
|
|
|
156
156
|
- `api.auth.schemes[].clientId` and `clientSecret` describe SDK parameters that the caller supplies
|
|
157
157
|
at runtime, optionally from an environment variable. They carry confidential-client credentials
|
|
158
158
|
and never contain literal values.
|
|
159
|
-
- `api.auth.schemes[].flows[].clientId` is accepted
|
|
160
|
-
literal, public (RFC 6749 §2.2) identifier of an installed application, such as a CLI that runs
|
|
159
|
+
- `api.auth.schemes[].flows[].clientId` is accepted on `authorization-code` and `device-code` flows.
|
|
160
|
+
It is the literal, public (RFC 6749 §2.2) identifier of an installed application, such as a CLI that runs
|
|
161
161
|
browser login with PKCE. Generators embed it verbatim, so environment expressions are rejected and
|
|
162
162
|
it must never hold a client secret.
|
|
163
163
|
|
|
164
|
-
The flow-level `clientId` is optional so existing documents keep
|
|
165
|
-
for an interactive login reports an error when it is absent.
|
|
164
|
+
The flow-level `clientId` of an `authorization-code` flow is optional so existing documents keep
|
|
165
|
+
parsing. A generator that needs it for an interactive login reports an error when it is absent. A
|
|
166
|
+
`device-code` flow exists only for interactive login, so it requires it.
|
|
167
|
+
|
|
168
|
+
### OAuth interactive login
|
|
169
|
+
|
|
170
|
+
The flows a CLI logs in with take a few more settings, all optional (they carry what the identity
|
|
171
|
+
provider asks for):
|
|
172
|
+
|
|
173
|
+
- `authorization-code`: `redirectUri` pins the loopback callback (an `http` URL on `127.0.0.1` or
|
|
174
|
+
`localhost` with a port, such as `http://127.0.0.1:8484/callback`); `redirectUriBackupPorts` lists
|
|
175
|
+
ports tried when that port is busy (it requires `redirectUri`); `successRedirectUrl` and
|
|
176
|
+
`errorRedirectUrl` are hosted pages the browser is sent to afterwards; `authorizationParameters`,
|
|
177
|
+
`tokenParameters` and `refreshParameters` add literal parameters (such as `audience`) to the
|
|
178
|
+
authorization, code exchange and refresh requests. PKCE with `S256` is always applied.
|
|
179
|
+
- `device-code` (RFC 8628): `clientId`, `deviceAuthorizationUrl` and `tokenUrl` are required;
|
|
180
|
+
`refreshUrl`, `scopes`, `deviceAuthorizationParameters`, `tokenParameters` and
|
|
181
|
+
`refreshParameters` are optional. It has no browser callback, so the callback settings above are
|
|
182
|
+
rejected on it.
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
- type: authorization-code
|
|
186
|
+
authorizationUrl: https://auth.example.com/authorize
|
|
187
|
+
tokenUrl: https://auth.example.com/token
|
|
188
|
+
clientId: acme-cli
|
|
189
|
+
redirectUri: http://127.0.0.1:8484/callback
|
|
190
|
+
redirectUriBackupPorts: [8483, 8482]
|
|
191
|
+
authorizationParameters:
|
|
192
|
+
audience: https://api.example.com
|
|
193
|
+
```
|
|
166
194
|
|
|
167
195
|
```yaml
|
|
168
196
|
api:
|
|
@@ -177,6 +205,32 @@ api:
|
|
|
177
205
|
clientId: acme-cli
|
|
178
206
|
```
|
|
179
207
|
|
|
208
|
+
### OAuth token endpoint properties (CLI)
|
|
209
|
+
|
|
210
|
+
A CLI that logs in with the client credentials flow builds the token request and reads the token
|
|
211
|
+
response itself. It uses the RFC 6749 names (`client_id`, `client_secret`, `scope` out;
|
|
212
|
+
`access_token`, `expires_in`, `refresh_token` in). For a token endpoint that names them differently,
|
|
213
|
+
the CLI option `oauthTokenEndpoints` gives, per OAuth scheme id, the names to use:
|
|
214
|
+
|
|
215
|
+
- `token.requestProperties`: `clientId`, `clientSecret`, `scopes`.
|
|
216
|
+
- `token.responseProperties`: `accessToken`, `expiresIn`, `refreshToken`.
|
|
217
|
+
- `refresh.requestProperties`: `refreshToken`; `refresh.responseProperties`: as for the token.
|
|
218
|
+
|
|
219
|
+
Each value is a property name, or a dotted path to a nested one (`data.token`). The token endpoint
|
|
220
|
+
is the `tokenUrl` of the scheme's client-credentials flow and the refresh endpoint its `refreshUrl`,
|
|
221
|
+
so `refresh` settings need a `refreshUrl`. Other properties of the token request are filled from
|
|
222
|
+
environment variables by the CLI.
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
targets:
|
|
226
|
+
- language: cli
|
|
227
|
+
generation:
|
|
228
|
+
oauthTokenEndpoints:
|
|
229
|
+
oauth:
|
|
230
|
+
token:
|
|
231
|
+
requestProperties: { clientId: username, clientSecret: password }
|
|
232
|
+
```
|
|
233
|
+
|
|
180
234
|
## Shape
|
|
181
235
|
|
|
182
236
|
```json
|
|
@@ -440,6 +494,7 @@ rejects is left out and reported as `FERN_CONFIG_VALUE_INVALID`.
|
|
|
440
494
|
| Setting | Behavior | Validation | Generator default when omitted |
|
|
441
495
|
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
442
496
|
| `binaryName` | Executable name. The generator kebab-cases it (`Acme CLI` becomes `acme-cli`) and uses the result for the Cargo binary, the CLI source directory, the runtime app name, and the fallback environment-variable prefix. | Non-empty string with at least one ASCII letter or digit, since the generator rejects names that kebab-case to empty. | Kebab-cased API display name |
|
|
497
|
+
| `crateName` | Name of the generated Cargo package, which release archives and installers (`<name>-installer.sh`) are named after. Defaults to the binary name when the output is delivered to GitHub. | Cargo package name: starts with a letter, then letters, digits, `-` or `_`, at most 64 characters. |
|
|
443
498
|
| `customCommands` | Generates hand-written command support: the model and SDK crates, `sdk.rs`, and `custom.rs`. | Boolean | `true` |
|
|
444
499
|
| `rootGroup` | Nests every spec-derived command under one group, so `acme users list` becomes `acme api users list`. | `^[a-z][a-z0-9_-]*$` | No group |
|
|
445
500
|
| `profiles.enabled` | Emits the profile command group and the global `--profile` / `-p` flag. Profiles store per-profile credentials and request defaults. | Required boolean when `profiles` is present, following the SDK Config convention for feature objects. The generator itself treats a missing `enabled` as `false`. | Profiles off |
|