@greensecurity/javascript-sdk 0.40.8-beta.31 → 0.40.8-beta.32
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/package.json +1 -1
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/alerts/README.md +0 -219
- package/docs/sdks/companies/README.md +0 -126
- package/docs/sdks/datarequests/README.md +0 -302
- package/docs/sdks/events/README.md +0 -1126
- package/docs/sdks/fhirconfigs/README.md +0 -551
- package/docs/sdks/greensecurity/README.md +0 -14
- package/docs/sdks/invoices/README.md +0 -324
- package/docs/sdks/mobiledevices/README.md +0 -100
- package/docs/sdks/organizations/README.md +0 -508
- package/docs/sdks/supportarticles/README.md +0 -249
- package/docs/sdks/systems/README.md +0 -136
- package/docs/sdks/users/README.md +0 -831
- package/docs/sdks/vendors/README.md +0 -4904
- package/docs/sdks/vendorscans/README.md +0 -104
- package/docs/sdks/webhooks/README.md +0 -352
- package/docs/sdks/zones/README.md +0 -344
- package/examples/README.md +0 -31
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
# Zones
|
|
2
|
-
(*zones*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [listOrSearchSecurityZones](#listorsearchsecurityzones) - List or search security zones
|
|
9
|
-
* [getSecurityZone](#getsecurityzone) - Get security zone details
|
|
10
|
-
* [securityZoneCheckin](#securityzonecheckin) - Security zone checkin request
|
|
11
|
-
|
|
12
|
-
## listOrSearchSecurityZones
|
|
13
|
-
|
|
14
|
-
List or search security zones
|
|
15
|
-
|
|
16
|
-
### Example Usage
|
|
17
|
-
|
|
18
|
-
<!-- UsageSnippet language="typescript" operationID="listOrSearchSecurityZones" method="get" path="/security_zones" -->
|
|
19
|
-
```typescript
|
|
20
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
21
|
-
|
|
22
|
-
const greenSecurity = new GreenSecurity({
|
|
23
|
-
security: {
|
|
24
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
async function run() {
|
|
29
|
-
const result = await greenSecurity.zones.listOrSearchSecurityZones({
|
|
30
|
-
sort: "job",
|
|
31
|
-
desc: true,
|
|
32
|
-
itemsPerPage: 25,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
for await (const page of result) {
|
|
36
|
-
console.log(page);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
run();
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Standalone function
|
|
44
|
-
|
|
45
|
-
The standalone function version of this method:
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
49
|
-
import { zonesListOrSearchSecurityZones } from "@greensecurity/javascript-sdk/funcs/zonesListOrSearchSecurityZones.js";
|
|
50
|
-
|
|
51
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
52
|
-
// You can create one instance of it to use across an application.
|
|
53
|
-
const greenSecurity = new GreenSecurityCore({
|
|
54
|
-
security: {
|
|
55
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
async function run() {
|
|
60
|
-
const res = await zonesListOrSearchSecurityZones(greenSecurity, {
|
|
61
|
-
sort: "job",
|
|
62
|
-
desc: true,
|
|
63
|
-
itemsPerPage: 25,
|
|
64
|
-
});
|
|
65
|
-
if (res.ok) {
|
|
66
|
-
const { value: result } = res;
|
|
67
|
-
for await (const page of result) {
|
|
68
|
-
console.log(page);
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
console.log("zonesListOrSearchSecurityZones failed:", res.error);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
run();
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### React hooks and utilities
|
|
79
|
-
|
|
80
|
-
This method can be used in React components through the following hooks and
|
|
81
|
-
associated utilities.
|
|
82
|
-
|
|
83
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
84
|
-
> below and how to get started using React hooks.
|
|
85
|
-
|
|
86
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
87
|
-
|
|
88
|
-
```tsx
|
|
89
|
-
import {
|
|
90
|
-
// Query hooks for fetching data.
|
|
91
|
-
useZonesListOrSearchSecurityZones,
|
|
92
|
-
useZonesListOrSearchSecurityZonesSuspense,
|
|
93
|
-
// Query hooks suitable for building infinite scrolling or "load more" UIs.
|
|
94
|
-
useZonesListOrSearchSecurityZonesInfinite,
|
|
95
|
-
useZonesListOrSearchSecurityZonesInfiniteSuspense,
|
|
96
|
-
|
|
97
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
98
|
-
// Server Components that will be immediately available to client components
|
|
99
|
-
// using the hooks.
|
|
100
|
-
prefetchZonesListOrSearchSecurityZones,
|
|
101
|
-
|
|
102
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
103
|
-
// mutations and other user actions.
|
|
104
|
-
invalidateZonesListOrSearchSecurityZones,
|
|
105
|
-
invalidateAllZonesListOrSearchSecurityZones,
|
|
106
|
-
} from "@greensecurity/javascript-sdk/react-query/zonesListOrSearchSecurityZones.js";
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Parameters
|
|
110
|
-
|
|
111
|
-
| Parameter | Type | Required | Description |
|
|
112
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
113
|
-
| `request` | [operations.ListOrSearchSecurityZonesRequest](../../models/operations/listorsearchsecurityzonesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
114
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
115
|
-
| `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. |
|
|
116
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
117
|
-
|
|
118
|
-
### Response
|
|
119
|
-
|
|
120
|
-
**Promise\<[operations.ListOrSearchSecurityZonesResponse](../../models/operations/listorsearchsecurityzonesresponse.md)\>**
|
|
121
|
-
|
|
122
|
-
### Errors
|
|
123
|
-
|
|
124
|
-
| Error Type | Status Code | Content Type |
|
|
125
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
126
|
-
| errors.ApiErrorResponse | 400, 401, 403 | application/json |
|
|
127
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
128
|
-
|
|
129
|
-
## getSecurityZone
|
|
130
|
-
|
|
131
|
-
Get security zone details
|
|
132
|
-
|
|
133
|
-
Available `expand` scopes are:
|
|
134
|
-
|
|
135
|
-
- zone.facility
|
|
136
|
-
- zone.department
|
|
137
|
-
- zone.rules
|
|
138
|
-
|
|
139
|
-
### Example Usage
|
|
140
|
-
|
|
141
|
-
<!-- UsageSnippet language="typescript" operationID="getSecurityZone" method="get" path="/security_zones/{id}" -->
|
|
142
|
-
```typescript
|
|
143
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
144
|
-
|
|
145
|
-
const greenSecurity = new GreenSecurity({
|
|
146
|
-
security: {
|
|
147
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
async function run() {
|
|
152
|
-
const result = await greenSecurity.zones.getSecurityZone({
|
|
153
|
-
id: 99489,
|
|
154
|
-
expand: [
|
|
155
|
-
"facility.system",
|
|
156
|
-
],
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
console.log(result);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
run();
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Standalone function
|
|
166
|
-
|
|
167
|
-
The standalone function version of this method:
|
|
168
|
-
|
|
169
|
-
```typescript
|
|
170
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
171
|
-
import { zonesGetSecurityZone } from "@greensecurity/javascript-sdk/funcs/zonesGetSecurityZone.js";
|
|
172
|
-
|
|
173
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
174
|
-
// You can create one instance of it to use across an application.
|
|
175
|
-
const greenSecurity = new GreenSecurityCore({
|
|
176
|
-
security: {
|
|
177
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
async function run() {
|
|
182
|
-
const res = await zonesGetSecurityZone(greenSecurity, {
|
|
183
|
-
id: 99489,
|
|
184
|
-
expand: [
|
|
185
|
-
"facility.system",
|
|
186
|
-
],
|
|
187
|
-
});
|
|
188
|
-
if (res.ok) {
|
|
189
|
-
const { value: result } = res;
|
|
190
|
-
console.log(result);
|
|
191
|
-
} else {
|
|
192
|
-
console.log("zonesGetSecurityZone failed:", res.error);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
run();
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### React hooks and utilities
|
|
200
|
-
|
|
201
|
-
This method can be used in React components through the following hooks and
|
|
202
|
-
associated utilities.
|
|
203
|
-
|
|
204
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
205
|
-
> below and how to get started using React hooks.
|
|
206
|
-
|
|
207
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
208
|
-
|
|
209
|
-
```tsx
|
|
210
|
-
import {
|
|
211
|
-
// Query hooks for fetching data.
|
|
212
|
-
useZonesGetSecurityZone,
|
|
213
|
-
useZonesGetSecurityZoneSuspense,
|
|
214
|
-
|
|
215
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
216
|
-
// Server Components that will be immediately available to client components
|
|
217
|
-
// using the hooks.
|
|
218
|
-
prefetchZonesGetSecurityZone,
|
|
219
|
-
|
|
220
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
221
|
-
// mutations and other user actions.
|
|
222
|
-
invalidateZonesGetSecurityZone,
|
|
223
|
-
invalidateAllZonesGetSecurityZone,
|
|
224
|
-
} from "@greensecurity/javascript-sdk/react-query/zonesGetSecurityZone.js";
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### Parameters
|
|
228
|
-
|
|
229
|
-
| Parameter | Type | Required | Description |
|
|
230
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
231
|
-
| `request` | [operations.GetSecurityZoneRequest](../../models/operations/getsecurityzonerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
232
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
233
|
-
| `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. |
|
|
234
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
235
|
-
|
|
236
|
-
### Response
|
|
237
|
-
|
|
238
|
-
**Promise\<[components.Zone](../../models/components/zone.md)\>**
|
|
239
|
-
|
|
240
|
-
### Errors
|
|
241
|
-
|
|
242
|
-
| Error Type | Status Code | Content Type |
|
|
243
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
244
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
245
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
246
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
247
|
-
|
|
248
|
-
## securityZoneCheckin
|
|
249
|
-
|
|
250
|
-
Security zone checkin request
|
|
251
|
-
|
|
252
|
-
### Example Usage
|
|
253
|
-
|
|
254
|
-
<!-- UsageSnippet language="typescript" operationID="securityZoneCheckin" method="post" path="/security_zones/checkin_request" -->
|
|
255
|
-
```typescript
|
|
256
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
257
|
-
|
|
258
|
-
const greenSecurity = new GreenSecurity({
|
|
259
|
-
security: {
|
|
260
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
261
|
-
},
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
async function run() {
|
|
265
|
-
const result = await greenSecurity.zones.securityZoneCheckin({
|
|
266
|
-
qrCode: "<value>",
|
|
267
|
-
zoneId: 572658,
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
console.log(result);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
run();
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Standalone function
|
|
277
|
-
|
|
278
|
-
The standalone function version of this method:
|
|
279
|
-
|
|
280
|
-
```typescript
|
|
281
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
282
|
-
import { zonesSecurityZoneCheckin } from "@greensecurity/javascript-sdk/funcs/zonesSecurityZoneCheckin.js";
|
|
283
|
-
|
|
284
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
285
|
-
// You can create one instance of it to use across an application.
|
|
286
|
-
const greenSecurity = new GreenSecurityCore({
|
|
287
|
-
security: {
|
|
288
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
289
|
-
},
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
async function run() {
|
|
293
|
-
const res = await zonesSecurityZoneCheckin(greenSecurity, {
|
|
294
|
-
qrCode: "<value>",
|
|
295
|
-
zoneId: 572658,
|
|
296
|
-
});
|
|
297
|
-
if (res.ok) {
|
|
298
|
-
const { value: result } = res;
|
|
299
|
-
console.log(result);
|
|
300
|
-
} else {
|
|
301
|
-
console.log("zonesSecurityZoneCheckin failed:", res.error);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
run();
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
### React hooks and utilities
|
|
309
|
-
|
|
310
|
-
This method can be used in React components through the following hooks and
|
|
311
|
-
associated utilities.
|
|
312
|
-
|
|
313
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
314
|
-
> below and how to get started using React hooks.
|
|
315
|
-
|
|
316
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
317
|
-
|
|
318
|
-
```tsx
|
|
319
|
-
import {
|
|
320
|
-
// Mutation hook for triggering the API call.
|
|
321
|
-
useZonesSecurityZoneCheckinMutation
|
|
322
|
-
} from "@greensecurity/javascript-sdk/react-query/zonesSecurityZoneCheckin.js";
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
### Parameters
|
|
326
|
-
|
|
327
|
-
| Parameter | Type | Required | Description |
|
|
328
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
329
|
-
| `request` | [operations.SecurityZoneCheckinRequestBody](../../models/operations/securityzonecheckinrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
330
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
331
|
-
| `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. |
|
|
332
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
333
|
-
|
|
334
|
-
### Response
|
|
335
|
-
|
|
336
|
-
**Promise\<[operations.SecurityZoneCheckinResponseBody](../../models/operations/securityzonecheckinresponsebody.md)\>**
|
|
337
|
-
|
|
338
|
-
### Errors
|
|
339
|
-
|
|
340
|
-
| Error Type | Status Code | Content Type |
|
|
341
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
342
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
343
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
344
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
package/examples/README.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# @greensecurity/javascript-sdk Examples
|
|
2
|
-
|
|
3
|
-
This directory contains example scripts demonstrating how to use the @greensecurity/javascript-sdk SDK.
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
- Node.js (v18 or higher)
|
|
8
|
-
- npm
|
|
9
|
-
|
|
10
|
-
## Setup
|
|
11
|
-
|
|
12
|
-
1. Copy `.env.template` to `.env`:
|
|
13
|
-
```bash
|
|
14
|
-
cp .env.template .env
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. Edit `.env` and add your actual credentials (API keys, tokens, etc.)
|
|
18
|
-
|
|
19
|
-
## Running the Examples
|
|
20
|
-
|
|
21
|
-
To run an example file from the examples directory:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm run build && npx tsx example.ts
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Creating new examples
|
|
28
|
-
|
|
29
|
-
Duplicate an existing example file, they won't be overwritten by the generation process.
|
|
30
|
-
|
|
31
|
-
|