@greensecurity/javascript-sdk 0.9.1 → 0.10.2
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/README.md +14 -5
- package/funcs/organizationsGetFacility.d.ts +2 -1
- package/funcs/organizationsGetFacility.d.ts.map +1 -1
- package/funcs/organizationsGetFacility.js +11 -7
- package/funcs/organizationsGetFacility.js.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts +2 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.js +11 -7
- package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/funcs/userGetCurrentUser.d.ts +2 -1
- package/funcs/userGetCurrentUser.d.ts.map +1 -1
- package/funcs/userGetCurrentUser.js +10 -6
- package/funcs/userGetCurrentUser.js.map +1 -1
- package/funcs/userGetUserById.d.ts +2 -1
- package/funcs/userGetUserById.d.ts.map +1 -1
- package/funcs/userGetUserById.js +11 -7
- package/funcs/userGetUserById.js.map +1 -1
- package/funcs/userLogsUserIntoTheSystem.d.ts +2 -1
- package/funcs/userLogsUserIntoTheSystem.d.ts.map +1 -1
- package/funcs/userLogsUserIntoTheSystem.js +11 -7
- package/funcs/userLogsUserIntoTheSystem.js.map +1 -1
- package/funcs/userMagiclink.d.ts +17 -0
- package/funcs/userMagiclink.d.ts.map +1 -0
- package/funcs/userMagiclink.js +115 -0
- package/funcs/userMagiclink.js.map +1 -0
- package/funcs/userPassword.d.ts +18 -0
- package/funcs/userPassword.d.ts.map +1 -0
- package/funcs/userPassword.js +116 -0
- package/funcs/userPassword.js.map +1 -0
- package/funcs/userPasswordResetRequest.d.ts +17 -0
- package/funcs/userPasswordResetRequest.d.ts.map +1 -0
- package/funcs/userPasswordResetRequest.js +115 -0
- package/funcs/userPasswordResetRequest.js.map +1 -0
- package/funcs/vendorsCreateVendorRegistration.d.ts +2 -1
- package/funcs/vendorsCreateVendorRegistration.d.ts.map +1 -1
- package/funcs/vendorsCreateVendorRegistration.js +11 -7
- package/funcs/vendorsCreateVendorRegistration.js.map +1 -1
- package/funcs/vendorsListVendorJobTitles.d.ts +2 -1
- package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/funcs/vendorsListVendorJobTitles.js +11 -7
- package/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/magiclink.d.ts +57 -0
- package/models/operations/magiclink.d.ts.map +1 -0
- package/models/operations/magiclink.js +96 -0
- package/models/operations/magiclink.js.map +1 -0
- package/models/operations/password.d.ts +59 -0
- package/models/operations/password.d.ts.map +1 -0
- package/models/operations/password.js +107 -0
- package/models/operations/password.js.map +1 -0
- package/models/operations/passwordresetrequest.d.ts +57 -0
- package/models/operations/passwordresetrequest.d.ts.map +1 -0
- package/models/operations/passwordresetrequest.js +96 -0
- package/models/operations/passwordresetrequest.js.map +1 -0
- package/package.json +1 -1
- package/react-query/index.d.ts +3 -0
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +3 -0
- package/react-query/index.js.map +1 -1
- package/react-query/userMagiclink.d.ts +23 -0
- package/react-query/userMagiclink.d.ts.map +1 -0
- package/react-query/userMagiclink.js +47 -0
- package/react-query/userMagiclink.js.map +1 -0
- package/react-query/userPassword.d.ts +24 -0
- package/react-query/userPassword.d.ts.map +1 -0
- package/react-query/userPassword.js +48 -0
- package/react-query/userPassword.js.map +1 -0
- package/react-query/userPasswordResetRequest.d.ts +23 -0
- package/react-query/userPasswordResetRequest.d.ts.map +1 -0
- package/react-query/userPasswordResetRequest.js +47 -0
- package/react-query/userPasswordResetRequest.js.map +1 -0
- package/sdk/user.d.ts +22 -0
- package/sdk/user.d.ts.map +1 -1
- package/sdk/user.js +31 -0
- package/sdk/user.js.map +1 -1
- package/src/funcs/organizationsGetFacility.ts +37 -8
- package/src/funcs/organizationsListOrSearchFacilities.ts +35 -8
- package/src/funcs/userGetCurrentUser.ts +33 -7
- package/src/funcs/userGetUserById.ts +36 -8
- package/src/funcs/userLogsUserIntoTheSystem.ts +36 -8
- package/src/funcs/userMagiclink.ts +162 -0
- package/src/funcs/userPassword.ts +163 -0
- package/src/funcs/userPasswordResetRequest.ts +163 -0
- package/src/funcs/vendorsCreateVendorRegistration.ts +36 -8
- package/src/funcs/vendorsListVendorJobTitles.ts +37 -8
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +1 -1
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/magiclink.ts +127 -0
- package/src/models/operations/password.ts +140 -0
- package/src/models/operations/passwordresetrequest.ts +131 -0
- package/src/react-query/index.ts +3 -0
- package/src/react-query/userMagiclink.ts +88 -0
- package/src/react-query/userPassword.ts +89 -0
- package/src/react-query/userPasswordResetRequest.ts +89 -0
- package/src/sdk/user.ts +55 -0
- package/src/types/async.ts +68 -0
- package/types/async.d.ts +23 -0
- package/types/async.d.ts.map +1 -0
- package/types/async.js +44 -0
- package/types/async.js.map +1 -0
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/greensecurity/README.md +0 -14
- package/docs/sdks/organizations/README.md +0 -252
- package/docs/sdks/user/README.md +0 -348
- package/docs/sdks/vendors/README.md +0 -219
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
# Vendors
|
|
2
|
-
(*vendors*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
Vendors includes anyone that sells goods or services to `Organizations`. Someone is a vendor when they have a contract with a hospital (or looking to establish one).
|
|
7
|
-
|
|
8
|
-
### Available Operations
|
|
9
|
-
|
|
10
|
-
* [createVendorRegistration](#createvendorregistration) - Create vendor registration
|
|
11
|
-
* [listVendorJobTitles](#listvendorjobtitles) - List vendor job titles
|
|
12
|
-
|
|
13
|
-
## createVendorRegistration
|
|
14
|
-
|
|
15
|
-
Create an initial vendor registration. Once successful, the vendor will be able to continue to filling out the rest of their onboarding profile.
|
|
16
|
-
|
|
17
|
-
### Example Usage
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
21
|
-
|
|
22
|
-
const greenSecurity = new GreenSecurity();
|
|
23
|
-
|
|
24
|
-
async function run() {
|
|
25
|
-
const result = await greenSecurity.vendors.createVendorRegistration({
|
|
26
|
-
email: "user@example.com",
|
|
27
|
-
password: "Abcdef123!",
|
|
28
|
-
timezone: "America/Chicago",
|
|
29
|
-
affiliateId: 123,
|
|
30
|
-
vendorGroupId: 123,
|
|
31
|
-
managingCompanyId: 123,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// Handle the result
|
|
35
|
-
console.log(result);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
run();
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Standalone function
|
|
42
|
-
|
|
43
|
-
The standalone function version of this method:
|
|
44
|
-
|
|
45
|
-
```typescript
|
|
46
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
47
|
-
import { vendorsCreateVendorRegistration } from "@greensecurity/javascript-sdk/funcs/vendorsCreateVendorRegistration.js";
|
|
48
|
-
|
|
49
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
50
|
-
// You can create one instance of it to use across an application.
|
|
51
|
-
const greenSecurity = new GreenSecurityCore();
|
|
52
|
-
|
|
53
|
-
async function run() {
|
|
54
|
-
const res = await vendorsCreateVendorRegistration(greenSecurity, {
|
|
55
|
-
email: "user@example.com",
|
|
56
|
-
password: "Abcdef123!",
|
|
57
|
-
timezone: "America/Chicago",
|
|
58
|
-
affiliateId: 123,
|
|
59
|
-
vendorGroupId: 123,
|
|
60
|
-
managingCompanyId: 123,
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
if (!res.ok) {
|
|
64
|
-
throw res.error;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const { value: result } = res;
|
|
68
|
-
|
|
69
|
-
// Handle the result
|
|
70
|
-
console.log(result);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
run();
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### React hooks and utilities
|
|
77
|
-
|
|
78
|
-
This method can be used in React components through the following hooks and
|
|
79
|
-
associated utilities.
|
|
80
|
-
|
|
81
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
82
|
-
> below and how to get started using React hooks.
|
|
83
|
-
|
|
84
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
85
|
-
|
|
86
|
-
```tsx
|
|
87
|
-
import {
|
|
88
|
-
// Mutation hook for triggering the API call.
|
|
89
|
-
useVendorsCreateVendorRegistrationMutation
|
|
90
|
-
} from "@greensecurity/javascript-sdk/react-query/vendorsCreateVendorRegistration.js";
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Parameters
|
|
94
|
-
|
|
95
|
-
| Parameter | Type | Required | Description |
|
|
96
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
97
|
-
| `request` | [operations.CreateVendorRegistrationRequestBody](../../models/operations/createvendorregistrationrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
98
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
99
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
100
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
101
|
-
|
|
102
|
-
### Response
|
|
103
|
-
|
|
104
|
-
**Promise\<[operations.CreateVendorRegistrationResponseBody](../../models/operations/createvendorregistrationresponsebody.md)\>**
|
|
105
|
-
|
|
106
|
-
### Errors
|
|
107
|
-
|
|
108
|
-
| Error Type | Status Code | Content Type |
|
|
109
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
110
|
-
| errors.ApiErrorResponse | 400, 401, 403, 409 | application/json |
|
|
111
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
112
|
-
|
|
113
|
-
## listVendorJobTitles
|
|
114
|
-
|
|
115
|
-
List valid job titles for Vendors. This can be used during sign up or in a filter.
|
|
116
|
-
|
|
117
|
-
### Example Usage
|
|
118
|
-
|
|
119
|
-
```typescript
|
|
120
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
121
|
-
|
|
122
|
-
const greenSecurity = new GreenSecurity();
|
|
123
|
-
|
|
124
|
-
async function run() {
|
|
125
|
-
const result = await greenSecurity.vendors.listVendorJobTitles({
|
|
126
|
-
sort: "job",
|
|
127
|
-
desc: true,
|
|
128
|
-
itemsPerPage: 25,
|
|
129
|
-
jobLike: "job",
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
// Handle the result
|
|
133
|
-
console.log(result);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
run();
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Standalone function
|
|
140
|
-
|
|
141
|
-
The standalone function version of this method:
|
|
142
|
-
|
|
143
|
-
```typescript
|
|
144
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
145
|
-
import { vendorsListVendorJobTitles } from "@greensecurity/javascript-sdk/funcs/vendorsListVendorJobTitles.js";
|
|
146
|
-
|
|
147
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
148
|
-
// You can create one instance of it to use across an application.
|
|
149
|
-
const greenSecurity = new GreenSecurityCore();
|
|
150
|
-
|
|
151
|
-
async function run() {
|
|
152
|
-
const res = await vendorsListVendorJobTitles(greenSecurity, {
|
|
153
|
-
sort: "job",
|
|
154
|
-
desc: true,
|
|
155
|
-
itemsPerPage: 25,
|
|
156
|
-
jobLike: "job",
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
if (!res.ok) {
|
|
160
|
-
throw res.error;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const { value: result } = res;
|
|
164
|
-
|
|
165
|
-
// Handle the result
|
|
166
|
-
console.log(result);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
run();
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### React hooks and utilities
|
|
173
|
-
|
|
174
|
-
This method can be used in React components through the following hooks and
|
|
175
|
-
associated utilities.
|
|
176
|
-
|
|
177
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
178
|
-
> below and how to get started using React hooks.
|
|
179
|
-
|
|
180
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
181
|
-
|
|
182
|
-
```tsx
|
|
183
|
-
import {
|
|
184
|
-
// Query hooks for fetching data.
|
|
185
|
-
useVendorsListVendorJobTitles,
|
|
186
|
-
useVendorsListVendorJobTitlesSuspense,
|
|
187
|
-
|
|
188
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
189
|
-
// Server Components that will be immediately available to client components
|
|
190
|
-
// using the hooks.
|
|
191
|
-
prefetchVendorsListVendorJobTitles,
|
|
192
|
-
|
|
193
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
194
|
-
// mutations and other user actions.
|
|
195
|
-
invalidateVendorsListVendorJobTitles,
|
|
196
|
-
invalidateAllVendorsListVendorJobTitles,
|
|
197
|
-
} from "@greensecurity/javascript-sdk/react-query/vendorsListVendorJobTitles.js";
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Parameters
|
|
201
|
-
|
|
202
|
-
| Parameter | Type | Required | Description |
|
|
203
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
204
|
-
| `request` | [operations.ListVendorJobTitlesRequest](../../models/operations/listvendorjobtitlesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
205
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
206
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
207
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
208
|
-
|
|
209
|
-
### Response
|
|
210
|
-
|
|
211
|
-
**Promise\<[operations.ListVendorJobTitlesResponseBody](../../models/operations/listvendorjobtitlesresponsebody.md)\>**
|
|
212
|
-
|
|
213
|
-
### Errors
|
|
214
|
-
|
|
215
|
-
| Error Type | Status Code | Content Type |
|
|
216
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
217
|
-
| errors.ApiErrorResponse | 403 | application/json |
|
|
218
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
219
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|