@@ -58,10 +58,11 @@ npm exec --package librus-sdk -- librus-sdk grades list --child <id-or-login>
5858The canonical CLI binary is ` librus-sdk ` . A deprecated ` librus ` alias remains
5959temporarily for compatibility and prints a warning before delegating.
6060
61- The package also ships a generated [ ` openapi.json ` ] ( ./openapi.json ) for the
62- SDK-supported child-scoped ` https://api.librus.pl/3.0 ` surface, so non-TypeScript
63- consumers can generate clients in other languages. It is also exported as
64- ` librus-sdk/openapi.json ` .
61+ The package also ships generated OpenAPI documents for the SDK-supported
62+ ` api_v3 ` , ` gateway_api_20 ` , and ` wiadomosci.librus.pl/api ` surfaces, so
63+ non-TypeScript consumers can generate clients in other languages. The legacy
64+ API 3.0 document is [ ` openapi/api_v3_openapi.json ` ] ( ./openapi/api_v3_openapi.json ) .
65+ For package compatibility it is still also exported as ` librus-sdk/openapi.json ` .
6566
6667## Public Interface
6768
@@ -111,20 +112,24 @@ import {
111112 LibrusSession ,
112113 PortalClient ,
113114 SynergiaApiClient ,
115+ generateGatewayApi20OpenApiDocument ,
114116 generateOpenApiDocument ,
117+ generateWiadomosciOpenApiDocument ,
115118 LibrusSdkError ,
116119 type LibrusApiBackend ,
117120} from " librus-sdk" ;
118121```
119122
120- | Export | Purpose |
121- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
122- | ` LibrusSession ` | Recommended high-level entry point. Handles login, linked-child discovery, child selection, and creation of child-scoped API clients. |
123- | ` BffApiClient ` | Experimental child-scoped client for selected ` https://testbff.librus.pl/v1 ` mobile backend reads. |
124- | ` GatewayApi20AuthClient ` | Lower-level Gateway API 2.0 login/password auth client for ` synergia.librus.pl/gateway/api/2.0 ` cookie-backed requests. |
125- | ` PortalClient ` | Lower-level portal session client for ` portal.librus.pl ` login, ` /Me ` , and ` /SynergiaAccounts ` . |
126- | ` SynergiaApiClient ` | Child-scoped GET client for the supported ` https://api.librus.pl/3.0 ` surface when you already have a bearer token. |
127- | ` generateOpenApiDocument ` | Generates the shipped OpenAPI document for the supported child-scoped GET subset. |
123+ | Export | Purpose |
124+ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
125+ | ` LibrusSession ` | Recommended high-level entry point. Handles login, linked-child discovery, child selection, and creation of child-scoped API clients. |
126+ | ` BffApiClient ` | Experimental child-scoped client for selected ` https://testbff.librus.pl/v1 ` mobile backend reads. |
127+ | ` GatewayApi20AuthClient ` | Lower-level Gateway API 2.0 login/password auth client for ` synergia.librus.pl/gateway/api/2.0 ` cookie-backed requests. |
128+ | ` PortalClient ` | Lower-level portal session client for ` portal.librus.pl ` login, ` /Me ` , and ` /SynergiaAccounts ` . |
129+ | ` SynergiaApiClient ` | Child-scoped GET client for the supported ` https://api.librus.pl/3.0 ` surface when you already have a bearer token. |
130+ | ` generateOpenApiDocument ` | Generates the shipped OpenAPI document for the supported ` api_v3 ` child-scoped GET subset. |
131+ | ` generateGatewayApi20OpenApiDocument ` | Generates the shipped OpenAPI document for the supported ` gateway_api_20 ` GET subset. |
132+ | ` generateWiadomosciOpenApiDocument ` | Generates the shipped OpenAPI document for the supported ` wiadomosci.librus.pl/api ` inbox subset. |
128133
129134Recommended session flow:
130135
@@ -280,13 +285,13 @@ here rather than promising every helper type as a named top-level export.
280285| ` authMode ` | No | ` bearer ` by default, or ` cookie ` for Gateway-created sessions. |
281286| ` requestTimeoutMs ` | No | Positive integer timeout in milliseconds. Defaults to ` 30000 ` . |
282287
283- ` generateOpenApiDocument() ` options (` GenerateOpenApiDocumentOptions ` ):
288+ OpenAPI generator options (` GenerateOpenApiDocumentOptions ` ):
284289
285290| Property | Required | Meaning |
286291| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
287292| ` title ` | No | Overrides the generated OpenAPI ` info.title ` . |
288293| ` version ` | No | Overrides the generated OpenAPI ` info.version ` . Pass the package version when generating a publishable document. |
289- | ` serverUrl ` | No | Overrides the default server URL ` https://api.librus.pl/3.0 ` . |
294+ | ` serverUrl ` | No | Overrides the generator's default server URL. |
290295
291296### Public Types And Errors
292297
@@ -430,10 +435,18 @@ credentials, bearer tokens, and cookie values are not included.
430435
431436### OpenAPI
432437
433- ` openapi.json ` is generated from the SDK's supported Synergia GET endpoints and
434- the shared valibot response schemas. The document is best-effort and
435- intentionally covers only the child-scoped ` api.librus.pl/3.0 ` requests, not
436- the ` portal.librus.pl ` login flow.
438+ OpenAPI documents are generated from the SDK's supported endpoints and valibot
439+ response schemas. The documents are best-effort and intentionally cover only
440+ post-auth API calls, not the Portal or Gateway login flows.
441+
442+ Generated files:
443+
444+ - [ ` openapi/api_v3_openapi.json ` ] ( ./openapi/api_v3_openapi.json ) :
445+ child-scoped ` https://api.librus.pl/3.0 ` ` api_v3 ` bearer-token requests.
446+ - [ ` openapi/gateway_api_20_openapi.json ` ] ( ./openapi/gateway_api_20_openapi.json ) :
447+ cookie-backed ` https://synergia.librus.pl/gateway/api/2.0 ` requests.
448+ - [ ` openapi/wiadomosci_librus_pl_api_openapi.json ` ] ( ./openapi/wiadomosci_librus_pl_api_openapi.json ) :
449+ cookie-backed ` https://wiadomosci.librus.pl/api ` inbox requests.
437450
438451Regenerate or verify the file locally with:
439452
@@ -445,9 +458,15 @@ npm run openapi:check
445458You can also generate the document programmatically:
446459
447460``` ts
448- import { generateOpenApiDocument } from " librus-sdk" ;
461+ import {
462+ generateGatewayApi20OpenApiDocument ,
463+ generateOpenApiDocument ,
464+ generateWiadomosciOpenApiDocument ,
465+ } from " librus-sdk" ;
449466
450467const openApi = generateOpenApiDocument ({ version: " 0.4.0" });
468+ const gatewayApi20 = generateGatewayApi20OpenApiDocument ({ version: " 0.4.0" });
469+ const wiadomosciApi = generateWiadomosciOpenApiDocument ({ version: " 0.4.0" });
451470```
452471
453472### Release And Versioning Policy
0 commit comments