Skip to content

Commit c3aacf0

Browse files
committed
Merge scalar-generated into scalar-next (build 5rzKHx2xe0HxwfjdMf9XX)
2 parents a67be3b + d14e5d6 commit c3aacf0

11 files changed

Lines changed: 158 additions & 173 deletions

File tree

‎api.md‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ SDKs
12511251

12521252
### List all SDKs
12531253

1254-
List every SDK on the team.
1254+
List every SDK on the team with the languages its config declares, each with its version labels highest first, the current version label per language (`current`), and the `currentVersion` and `latestVersion` tags.
12551255

12561256
| Direction | Type |
12571257
| --- | --- |
@@ -1280,7 +1280,7 @@ sdk = client.sdks.create(
12801280

12811281
### Get an SDK
12821282

1283-
Get a single SDK by its uid.
1283+
Get a single SDK by its uid with the languages its config declares, its version labels highest first, the current version label per language (`current`), and the `currentVersion` and `latestVersion` tags.
12841284

12851285
| Direction | Type |
12861286
| --- | --- |
@@ -1323,7 +1323,7 @@ sdk = client.sdks.delete(
13231323

13241324
### Build an SDK
13251325

1326-
Start a build. Omit `version` to build the current work — the open draft, else the latest version — and the resolved version comes back in the response.
1326+
Start a build with the SDK's saved config. Every input is optional: `version` is the version of the linked API description to build (default: its latest version), `customCodeRef` the branch, tag or commit each language merges as custom code (default: each language's `scalar-next` branch), and `languages` the languages to build (default: every language the config declares). The response names the version built. A 503 means the custom code could not be read from GitHub and nothing was built; try again.
13271327

13281328
| Direction | Type |
13291329
| --- | --- |
@@ -1342,7 +1342,7 @@ SDKs
13421342

13431343
#### Create an SDK version
13441344

1345-
Create a new SDK version against a specific API version.
1345+
Create a version label from a version of the SDK's API document and start its build. The label is the document version, and it becomes `latestVersion` when it is the highest.
13461346

13471347
| Direction | Type |
13481348
| --- | --- |
@@ -1353,13 +1353,12 @@ Create a new SDK version against a specific API version.
13531353
version = client.sdks.versions.create(
13541354
uid="UakgbKJ5m9gl0JDMbcJqL",
13551355
version="1.2.0",
1356-
api_version="1.2.0",
13571356
)
13581357
```
13591358

13601359
#### Delete an SDK version
13611360

1362-
Permanently delete one version of an SDK.
1361+
Permanently delete one version label of an SDK and its builds. A label that is the current build of any language promoting manually is refused with 409 and nothing is deleted; promote or roll back to another build for that language first. Each other language whose current build was of that label moves to the active build of the highest remaining label that has one for the language, and has no current build when none has; `currentVersion` shows the result. Each language that moved to another build syncs it to its linked repository unless the repository already holds it. When it was `latestVersion`, that tag moves to the highest remaining label holding an active build. An SDK's last version cannot be deleted.
13631362

13641363
| Direction | Type |
13651364
| --- | --- |

‎scalar-sdk.manifest.json‎

Lines changed: 54 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,27 +3109,28 @@
31093109
}
31103110
},
31113111
{
3112-
"name": "apiVersion",
3113-
"publicName": "apiVersion",
3114-
"required": false,
3112+
"name": "current",
3113+
"publicName": "current",
3114+
"required": true,
31153115
"deprecated": false,
31163116
"extensions": {
31173117
"source": [
31183118
"examples"
31193119
],
3120-
"examples": "1.2.0"
3120+
"examples": {
3121+
"typescript": "1.2.0"
3122+
}
31213123
},
31223124
"type": {
3123-
"kind": "union",
3124-
"variants": [
3125-
{
3126-
"kind": "ref",
3127-
"name": "version"
3128-
},
3129-
{
3130-
"kind": "null"
3131-
}
3132-
]
3125+
"kind": "record",
3126+
"value": {
3127+
"kind": "primitive",
3128+
"type": "string"
3129+
},
3130+
"propertyNames": {
3131+
"kind": "primitive",
3132+
"type": "string"
3133+
}
31333134
}
31343135
},
31353136
{
@@ -3144,8 +3145,32 @@
31443145
"examples": "1.2.0"
31453146
},
31463147
"type": {
3147-
"kind": "ref",
3148-
"name": "version"
3148+
"kind": "primitive",
3149+
"type": "string"
3150+
}
3151+
},
3152+
{
3153+
"name": "latestVersion",
3154+
"publicName": "latestVersion",
3155+
"required": true,
3156+
"deprecated": false,
3157+
"extensions": {
3158+
"source": [
3159+
"examples"
3160+
],
3161+
"examples": "1.3.0"
3162+
},
3163+
"type": {
3164+
"kind": "union",
3165+
"variants": [
3166+
{
3167+
"kind": "primitive",
3168+
"type": "string"
3169+
},
3170+
{
3171+
"kind": "null"
3172+
}
3173+
]
31493174
}
31503175
},
31513176
{
@@ -3286,51 +3311,24 @@
32863311
"examples": "1.2.0"
32873312
},
32883313
"type": {
3289-
"kind": "ref",
3290-
"name": "version"
3314+
"kind": "primitive",
3315+
"type": "string"
32913316
}
32923317
},
32933318
{
3294-
"name": "apiVersion",
3295-
"publicName": "apiVersion",
3319+
"name": "createdAt",
3320+
"publicName": "createdAt",
32963321
"required": true,
32973322
"deprecated": false,
32983323
"extensions": {
32993324
"source": [
33003325
"examples"
33013326
],
3302-
"examples": "1.2.0"
3327+
"examples": 1735689600
33033328
},
33043329
"type": {
33053330
"kind": "ref",
3306-
"name": "version"
3307-
}
3308-
},
3309-
{
3310-
"name": "status",
3311-
"publicName": "status",
3312-
"required": true,
3313-
"deprecated": false,
3314-
"extensions": {
3315-
"source": [
3316-
"examples"
3317-
],
3318-
"examples": "published"
3319-
},
3320-
"type": {
3321-
"kind": "enum",
3322-
"values": [
3323-
"draft",
3324-
"published"
3325-
],
3326-
"names": [
3327-
"Draft",
3328-
"Published"
3329-
],
3330-
"deprecations": [
3331-
false,
3332-
false
3333-
]
3331+
"name": "timestamp"
33343332
}
33353333
},
33363334
{
@@ -3397,38 +3395,6 @@
33973395
]
33983396
}
33993397
}
3400-
},
3401-
{
3402-
"name": "publishedAt",
3403-
"publicName": "publishedAt",
3404-
"required": false,
3405-
"deprecated": false,
3406-
"extensions": {
3407-
"source": [
3408-
"examples"
3409-
],
3410-
"examples": 1735689600
3411-
},
3412-
"type": {
3413-
"kind": "ref",
3414-
"name": "timestamp"
3415-
}
3416-
},
3417-
{
3418-
"name": "createdAt",
3419-
"publicName": "createdAt",
3420-
"required": false,
3421-
"deprecated": false,
3422-
"extensions": {
3423-
"source": [
3424-
"examples"
3425-
],
3426-
"examples": 1735689600
3427-
},
3428-
"type": {
3429-
"kind": "ref",
3430-
"name": "timestamp"
3431-
}
34323398
}
34333399
],
34343400
"additionalProperties": false
@@ -16539,17 +16505,23 @@
1653916505
"publicHeaderParams": [],
1654016506
"bodyParams": [
1654116507
"version",
16508+
"customCodeRef",
1654216509
"languages"
1654316510
],
1654416511
"publicBodyParams": [
1654516512
"version",
16513+
"customCodeRef",
1654616514
"languages"
1654716515
],
1654816516
"bodyParamDetails": [
1654916517
{
1655016518
"name": "version",
1655116519
"required": false
1655216520
},
16521+
{
16522+
"name": "customCodeRef",
16523+
"required": false
16524+
},
1655316525
{
1655416526
"name": "languages",
1655516527
"required": false
@@ -16734,7 +16706,7 @@
1673416706
},
1673516707
{
1673616708
"name": "apiVersion",
16737-
"required": true
16709+
"required": false
1673816710
}
1673916711
],
1674016712
"pathParamDetails": [

‎src/scalar_sdk/resources/sdks/sdks.py‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def list(
7676
timeout: float | httpx.Timeout | None | NotGiven = not_given,
7777
) -> SdkListResponse:
7878
"""
79-
List every SDK on the team.
79+
List every SDK on the team with the languages its config declares, each with its version labels highest first, the current version label per language (`current`), and the `currentVersion` and `latestVersion` tags.
8080
8181
Args:
8282
limit: Query parameter.
@@ -194,7 +194,7 @@ def retrieve(
194194
timeout: float | httpx.Timeout | None | NotGiven = not_given,
195195
) -> Sdk:
196196
"""
197-
Get a single SDK by its uid.
197+
Get a single SDK by its uid with the languages its config declares, its version labels highest first, the current version label per language (`current`), and the `currentVersion` and `latestVersion` tags.
198198
199199
Args:
200200
uid: Path parameter.
@@ -232,7 +232,7 @@ def update(
232232
is_private: bool | Omit = omit,
233233
config: str | Omit = omit,
234234
api_uid: Optional[Nanoid] | Omit = omit,
235-
api_version: Optional[str] | Omit = omit,
235+
api_version: object | Omit = omit,
236236
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
237237
# The extra values given here take precedence over values defined on the client or passed to this method.
238238
extra_headers: Headers | None = None,
@@ -250,7 +250,7 @@ def update(
250250
is_private: Body parameter.
251251
config: Body parameter.
252252
api_uid: Body parameter.
253-
api_version: Body parameter.
253+
api_version: Removed. A request that carries it is refused with a 400.
254254
extra_headers: Send extra headers with the request.
255255
extra_query: Send extra query parameters with the request.
256256
extra_body: Send extra JSON properties with the request.
@@ -333,6 +333,7 @@ def build(
333333
uid: str,
334334
*,
335335
version: str | Omit = omit,
336+
custom_code_ref: str | Omit = omit,
336337
languages: List[
337338
Literal[
338339
"typescript",
@@ -359,11 +360,12 @@ def build(
359360
timeout: float | httpx.Timeout | None | NotGiven = not_given,
360361
) -> SdkBuildResponse:
361362
"""
362-
Start a build. Omit `version` to build the current work — the open draft, else the latest version — and the resolved version comes back in the response.
363+
Start a build with the SDK's saved config. Every input is optional: `version` is the version of the linked API description to build (default: its latest version), `customCodeRef` the branch, tag or commit each language merges as custom code (default: each language's `scalar-next` branch), and `languages` the languages to build (default: every language the config declares). The response names the version built. A 503 means the custom code could not be read from GitHub and nothing was built; try again.
363364
364365
Args:
365366
uid: Path parameter.
366367
version: Body parameter.
368+
custom_code_ref: Body parameter.
367369
languages: Body parameter.
368370
extra_headers: Send extra headers with the request.
369371
extra_query: Send extra query parameters with the request.
@@ -387,6 +389,7 @@ def build(
387389
body=maybe_transform(
388390
{
389391
"version": version,
392+
"custom_code_ref": custom_code_ref,
390393
"languages": languages,
391394
},
392395
sdk_build_params.SdkBuildParams,
@@ -427,7 +430,7 @@ async def list(
427430
timeout: float | httpx.Timeout | None | NotGiven = not_given,
428431
) -> SdkListResponse:
429432
"""
430-
List every SDK on the team.
433+
List every SDK on the team with the languages its config declares, each with its version labels highest first, the current version label per language (`current`), and the `currentVersion` and `latestVersion` tags.
431434
432435
Args:
433436
limit: Query parameter.
@@ -545,7 +548,7 @@ async def retrieve(
545548
timeout: float | httpx.Timeout | None | NotGiven = not_given,
546549
) -> Sdk:
547550
"""
548-
Get a single SDK by its uid.
551+
Get a single SDK by its uid with the languages its config declares, its version labels highest first, the current version label per language (`current`), and the `currentVersion` and `latestVersion` tags.
549552
550553
Args:
551554
uid: Path parameter.
@@ -583,7 +586,7 @@ async def update(
583586
is_private: bool | Omit = omit,
584587
config: str | Omit = omit,
585588
api_uid: Optional[Nanoid] | Omit = omit,
586-
api_version: Optional[str] | Omit = omit,
589+
api_version: object | Omit = omit,
587590
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
588591
# The extra values given here take precedence over values defined on the client or passed to this method.
589592
extra_headers: Headers | None = None,
@@ -601,7 +604,7 @@ async def update(
601604
is_private: Body parameter.
602605
config: Body parameter.
603606
api_uid: Body parameter.
604-
api_version: Body parameter.
607+
api_version: Removed. A request that carries it is refused with a 400.
605608
extra_headers: Send extra headers with the request.
606609
extra_query: Send extra query parameters with the request.
607610
extra_body: Send extra JSON properties with the request.
@@ -684,6 +687,7 @@ async def build(
684687
uid: str,
685688
*,
686689
version: str | Omit = omit,
690+
custom_code_ref: str | Omit = omit,
687691
languages: List[
688692
Literal[
689693
"typescript",
@@ -710,11 +714,12 @@ async def build(
710714
timeout: float | httpx.Timeout | None | NotGiven = not_given,
711715
) -> SdkBuildResponse:
712716
"""
713-
Start a build. Omit `version` to build the current work — the open draft, else the latest version — and the resolved version comes back in the response.
717+
Start a build with the SDK's saved config. Every input is optional: `version` is the version of the linked API description to build (default: its latest version), `customCodeRef` the branch, tag or commit each language merges as custom code (default: each language's `scalar-next` branch), and `languages` the languages to build (default: every language the config declares). The response names the version built. A 503 means the custom code could not be read from GitHub and nothing was built; try again.
714718
715719
Args:
716720
uid: Path parameter.
717721
version: Body parameter.
722+
custom_code_ref: Body parameter.
718723
languages: Body parameter.
719724
extra_headers: Send extra headers with the request.
720725
extra_query: Send extra query parameters with the request.
@@ -738,6 +743,7 @@ async def build(
738743
body=await async_maybe_transform(
739744
{
740745
"version": version,
746+
"custom_code_ref": custom_code_ref,
741747
"languages": languages,
742748
},
743749
sdk_build_params.SdkBuildParams,

0 commit comments

Comments
 (0)