@zinn-digital/sdk 0.0.0-stage → 0.1.1347

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Neil Lock — CEO, Zinn Digital® Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # @zinn-digital/sdk — TypeScript client for the Zinn Digital Platform API
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A fully typed client for the [Zinn Digital](https://zinndigital.com/developers/sdk-typescript) public API. Every path,
4
+ parameter and response type is generated from the platform's OpenAPI specification, and a new version is
5
+ published automatically whenever the specification changes.
6
+
7
+ ```bash
8
+ npm install @zinn-digital/sdk
9
+ ```
10
+
11
+ ```ts
12
+ import { createApiClient } from "@zinn-digital/sdk";
13
+
14
+ const api = createApiClient({ baseUrl: "https://api.zinndigital.com" });
15
+
16
+ // Public catalogue endpoints need no key.
17
+ const { data: regions } = await api.GET("/v1/catalog/regions");
18
+
19
+ // Everything else uses a per-organisation API key (create one on the dashboard's API keys page).
20
+ api.use({
21
+ onRequest: ({ request }) => {
22
+ request.headers.set("Authorization", `Bearer ${process.env.ZINN_API_KEY}`);
23
+ },
24
+ });
25
+ const { data: sites, error } = await api.GET("/v1/sites");
26
+ ```
27
+
28
+ The client is [openapi-fetch](https://openapi-ts.dev/openapi-fetch); `components`, `paths` and
29
+ `operations` types are exported for your own code (`import type { components } from "@zinn-digital/sdk"`).
30
+
31
+ - Guide: https://zinndigital.com/developers/sdk-typescript
32
+ - API reference: https://zinndigital.com/developers/api
33
+ - Licence: MIT