@liaisongroup/assist-api-js-client 1.5.39
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 +21 -0
- package/README.md +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/openapi.d.ts +5368 -0
- package/dist/openapi.json +13260 -0
- package/dist/openapi.zod.d.ts +145945 -0
- package/dist/openapi.zod.js +1710 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +8 -0
- package/dist/zod_template.hbs +9 -0
- package/package.json +76 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Liaison Group
|
|
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
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<img src="./hero.svg" alt="Hero" />
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
🏌️♂️ Liaison Assist API JS Client
|
|
5
|
+
<br />
|
|
6
|
+
Generated using <a href="https://github.com/openapistack/openapi-client-axios">openapi-client-axios</a> from the OpenAPI v3 definition
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# Installation
|
|
10
|
+
|
|
11
|
+
Using your node runtime of choice install the package.
|
|
12
|
+
|
|
13
|
+
bun add @liaisongroup/assist-api-js-client -D
|
|
14
|
+
|
|
15
|
+
# Usage
|
|
16
|
+
|
|
17
|
+
Create a file such as `client.ts` to store an instance of our JS Client.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { init } from "@liaisongroup/assist-api-js-client"
|
|
21
|
+
|
|
22
|
+
export const client = init("https://assist-dev-api.liaison.link")
|
|
23
|
+
// ^ returns a full typed client, with autocomplete for all methods, parameters etc.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then when needed, just import this `client` in project files as needed.
|
|
27
|
+
|
|
28
|
+
`init` takes the API base URL as an optional argument, otherwise it will default to the value defined in the OpenAPI definition.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { client } from "some/path/to/client"
|
|
32
|
+
|
|
33
|
+
async function make_api_call() {
|
|
34
|
+
const sso_configs = await client.get_sso_configs()
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
# Working with a local OpenAPI definition
|
|
39
|
+
|
|
40
|
+
If you want to work with a local OpenAPI definition (ie. you have the `infinity-api` repo setup), then you can:
|
|
41
|
+
|
|
42
|
+
1. Clone this repo and install its dependencies
|
|
43
|
+
2. Setup an `.env.local` file, with the absolute path to the OpenAPI file (ie. `OPENAPI_URL="/path/to/infinity-api/openapi.yaml"`)
|
|
44
|
+
3. Run `bun dev` to start the development server. This will watch for changes to the OpenAPI file and regenerate the client as needed.
|
|
45
|
+
4. From the front-end repo, reference this local repo instead of installing from remote. For example:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"@liaisongroup/assist-api-js-client": "../assist-api-js-client"
|
|
50
|
+
}
|
|
51
|
+
```
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenAPIClientAxios } from "openapi-client-axios";
|
|
2
|
+
import definition from "./openapi.json" assert { type: "json" };
|
|
3
|
+
export function init(base_url) {
|
|
4
|
+
const client = new OpenAPIClientAxios({
|
|
5
|
+
definition: definition,
|
|
6
|
+
axiosConfigDefaults: { withCredentials: true, baseURL: base_url },
|
|
7
|
+
}).initSync();
|
|
8
|
+
return client;
|
|
9
|
+
}
|