@greensecurity/javascript-sdk 0.40.8-beta.30 → 0.40.8-beta.31

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.
Files changed (45) hide show
  1. package/.devcontainer/README.md +35 -0
  2. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  3. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +5 -19
  5. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  6. package/dist/commonjs/lib/config.d.ts +2 -2
  7. package/dist/commonjs/lib/config.js +2 -2
  8. package/dist/commonjs/models/components/vendor.d.ts +2 -0
  9. package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
  10. package/dist/commonjs/models/components/vendor.js +4 -0
  11. package/dist/commonjs/models/components/vendor.js.map +1 -1
  12. package/dist/esm/__tests__/webhooks.test.js +1 -1
  13. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  14. package/dist/esm/__tests__/zones.test.js +5 -19
  15. package/dist/esm/__tests__/zones.test.js.map +1 -1
  16. package/dist/esm/lib/config.d.ts +2 -2
  17. package/dist/esm/lib/config.js +2 -2
  18. package/dist/esm/models/components/vendor.d.ts +2 -0
  19. package/dist/esm/models/components/vendor.d.ts.map +1 -1
  20. package/dist/esm/models/components/vendor.js +4 -0
  21. package/dist/esm/models/components/vendor.js.map +1 -1
  22. package/docs/sdks/alerts/README.md +219 -0
  23. package/docs/sdks/companies/README.md +126 -0
  24. package/docs/sdks/datarequests/README.md +302 -0
  25. package/docs/sdks/events/README.md +1126 -0
  26. package/docs/sdks/fhirconfigs/README.md +551 -0
  27. package/docs/sdks/greensecurity/README.md +14 -0
  28. package/docs/sdks/invoices/README.md +324 -0
  29. package/docs/sdks/mobiledevices/README.md +100 -0
  30. package/docs/sdks/organizations/README.md +508 -0
  31. package/docs/sdks/supportarticles/README.md +249 -0
  32. package/docs/sdks/systems/README.md +136 -0
  33. package/docs/sdks/users/README.md +831 -0
  34. package/docs/sdks/vendors/README.md +4904 -0
  35. package/docs/sdks/vendorscans/README.md +104 -0
  36. package/docs/sdks/webhooks/README.md +352 -0
  37. package/docs/sdks/zones/README.md +344 -0
  38. package/examples/README.md +31 -0
  39. package/examples/package-lock.json +1 -1
  40. package/jsr.json +1 -1
  41. package/package.json +1 -1
  42. package/src/__tests__/webhooks.test.ts +1 -1
  43. package/src/__tests__/zones.test.ts +5 -19
  44. package/src/lib/config.ts +2 -2
  45. package/src/models/components/vendor.ts +6 -0
@@ -0,0 +1,104 @@
1
+ # VendorScans
2
+ (*vendorScans*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [vendorScanOut](#vendorscanout) - Vendor scan out
9
+
10
+ ## vendorScanOut
11
+
12
+ It scans out vendor from facility
13
+
14
+ ### Example Usage
15
+
16
+ <!-- UsageSnippet language="typescript" operationID="vendorScanOut" method="post" path="/vendor-scans/{id}/scan-out" -->
17
+ ```typescript
18
+ import { GreenSecurity } from "@greensecurity/javascript-sdk";
19
+
20
+ const greenSecurity = new GreenSecurity({
21
+ security: {
22
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
23
+ },
24
+ });
25
+
26
+ async function run() {
27
+ const result = await greenSecurity.vendorScans.vendorScanOut({
28
+ id: 716728,
29
+ });
30
+
31
+ console.log(result);
32
+ }
33
+
34
+ run();
35
+ ```
36
+
37
+ ### Standalone function
38
+
39
+ The standalone function version of this method:
40
+
41
+ ```typescript
42
+ import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
43
+ import { vendorScansVendorScanOut } from "@greensecurity/javascript-sdk/funcs/vendorScansVendorScanOut.js";
44
+
45
+ // Use `GreenSecurityCore` for best tree-shaking performance.
46
+ // You can create one instance of it to use across an application.
47
+ const greenSecurity = new GreenSecurityCore({
48
+ security: {
49
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
50
+ },
51
+ });
52
+
53
+ async function run() {
54
+ const res = await vendorScansVendorScanOut(greenSecurity, {
55
+ id: 716728,
56
+ });
57
+ if (res.ok) {
58
+ const { value: result } = res;
59
+ console.log(result);
60
+ } else {
61
+ console.log("vendorScansVendorScanOut failed:", res.error);
62
+ }
63
+ }
64
+
65
+ run();
66
+ ```
67
+
68
+ ### React hooks and utilities
69
+
70
+ This method can be used in React components through the following hooks and
71
+ associated utilities.
72
+
73
+ > Check out [this guide][hook-guide] for information about each of the utilities
74
+ > below and how to get started using React hooks.
75
+
76
+ [hook-guide]: ../../../REACT_QUERY.md
77
+
78
+ ```tsx
79
+ import {
80
+ // Mutation hook for triggering the API call.
81
+ useVendorScansVendorScanOutMutation
82
+ } from "@greensecurity/javascript-sdk/react-query/vendorScansVendorScanOut.js";
83
+ ```
84
+
85
+ ### Parameters
86
+
87
+ | Parameter | Type | Required | Description |
88
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
89
+ | `request` | [operations.VendorScanOutRequest](../../models/operations/vendorscanoutrequest.md) | :heavy_check_mark: | The request object to use for the request. |
90
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
91
+ | `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. |
92
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
93
+
94
+ ### Response
95
+
96
+ **Promise\<[operations.VendorScanOutVendorScanOutOk](../../models/operations/vendorscanoutvendorscanoutok.md)\>**
97
+
98
+ ### Errors
99
+
100
+ | Error Type | Status Code | Content Type |
101
+ | ----------------------- | ----------------------- | ----------------------- |
102
+ | errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
103
+ | errors.ApiErrorResponse | 500 | application/json |
104
+ | errors.APIError | 4XX, 5XX | \*/\* |
@@ -0,0 +1,352 @@
1
+ # Webhooks
2
+ (*webhooks*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [listAllWebhookEndpoints](#listallwebhookendpoints) - List all webhook endpoints
9
+ * [getWebhookEndpoint](#getwebhookendpoint) - Retrieves the webhook endpoint with the given ID.
10
+ * [updatesTheWebhookEndpointWithTheGivenId](#updatesthewebhookendpointwiththegivenid) - Updates the webhook endpoint with the given ID.
11
+
12
+ ## listAllWebhookEndpoints
13
+
14
+ Returns a list of your webhook endpoints.
15
+
16
+ ### Example Usage
17
+
18
+ <!-- UsageSnippet language="typescript" operationID="listAllWebhookEndpoints" method="get" path="/webhooks" -->
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.webhooks.listAllWebhookEndpoints({
30
+ itemsPerPage: 25,
31
+ desc: true,
32
+ sort: "job",
33
+ });
34
+
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 { webhooksListAllWebhookEndpoints } from "@greensecurity/javascript-sdk/funcs/webhooksListAllWebhookEndpoints.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
+ security: {
53
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
54
+ },
55
+ });
56
+
57
+ async function run() {
58
+ const res = await webhooksListAllWebhookEndpoints(greenSecurity, {
59
+ itemsPerPage: 25,
60
+ desc: true,
61
+ sort: "job",
62
+ });
63
+ if (res.ok) {
64
+ const { value: result } = res;
65
+ console.log(result);
66
+ } else {
67
+ console.log("webhooksListAllWebhookEndpoints failed:", res.error);
68
+ }
69
+ }
70
+
71
+ run();
72
+ ```
73
+
74
+ ### React hooks and utilities
75
+
76
+ This method can be used in React components through the following hooks and
77
+ associated utilities.
78
+
79
+ > Check out [this guide][hook-guide] for information about each of the utilities
80
+ > below and how to get started using React hooks.
81
+
82
+ [hook-guide]: ../../../REACT_QUERY.md
83
+
84
+ ```tsx
85
+ import {
86
+ // Query hooks for fetching data.
87
+ useWebhooksListAllWebhookEndpoints,
88
+ useWebhooksListAllWebhookEndpointsSuspense,
89
+
90
+ // Utility for prefetching data during server-side rendering and in React
91
+ // Server Components that will be immediately available to client components
92
+ // using the hooks.
93
+ prefetchWebhooksListAllWebhookEndpoints,
94
+
95
+ // Utilities to invalidate the query cache for this query in response to
96
+ // mutations and other user actions.
97
+ invalidateWebhooksListAllWebhookEndpoints,
98
+ invalidateAllWebhooksListAllWebhookEndpoints,
99
+ } from "@greensecurity/javascript-sdk/react-query/webhooksListAllWebhookEndpoints.js";
100
+ ```
101
+
102
+ ### Parameters
103
+
104
+ | Parameter | Type | Required | Description |
105
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
106
+ | `request` | [operations.ListAllWebhookEndpointsRequest](../../models/operations/listallwebhookendpointsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
107
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
108
+ | `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. |
109
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
110
+
111
+ ### Response
112
+
113
+ **Promise\<[operations.ListAllWebhookEndpointsListAllWebhookEndpointsOk](../../models/operations/listallwebhookendpointslistallwebhookendpointsok.md)\>**
114
+
115
+ ### Errors
116
+
117
+ | Error Type | Status Code | Content Type |
118
+ | ----------------------- | ----------------------- | ----------------------- |
119
+ | errors.ApiErrorResponse | 400, 401, 403 | application/json |
120
+ | errors.ApiErrorResponse | 500 | application/json |
121
+ | errors.APIError | 4XX, 5XX | \*/\* |
122
+
123
+ ## getWebhookEndpoint
124
+
125
+ Returns the definition of a webhook endpoint by ID.
126
+
127
+ ### Example Usage
128
+
129
+ <!-- UsageSnippet language="typescript" operationID="getWebhookEndpoint" method="get" path="/webhooks/{id}" -->
130
+ ```typescript
131
+ import { GreenSecurity } from "@greensecurity/javascript-sdk";
132
+
133
+ const greenSecurity = new GreenSecurity({
134
+ security: {
135
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
136
+ },
137
+ });
138
+
139
+ async function run() {
140
+ const result = await greenSecurity.webhooks.getWebhookEndpoint({
141
+ id: 304761,
142
+ });
143
+
144
+ console.log(result);
145
+ }
146
+
147
+ run();
148
+ ```
149
+
150
+ ### Standalone function
151
+
152
+ The standalone function version of this method:
153
+
154
+ ```typescript
155
+ import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
156
+ import { webhooksGetWebhookEndpoint } from "@greensecurity/javascript-sdk/funcs/webhooksGetWebhookEndpoint.js";
157
+
158
+ // Use `GreenSecurityCore` for best tree-shaking performance.
159
+ // You can create one instance of it to use across an application.
160
+ const greenSecurity = new GreenSecurityCore({
161
+ security: {
162
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
163
+ },
164
+ });
165
+
166
+ async function run() {
167
+ const res = await webhooksGetWebhookEndpoint(greenSecurity, {
168
+ id: 304761,
169
+ });
170
+ if (res.ok) {
171
+ const { value: result } = res;
172
+ console.log(result);
173
+ } else {
174
+ console.log("webhooksGetWebhookEndpoint failed:", res.error);
175
+ }
176
+ }
177
+
178
+ run();
179
+ ```
180
+
181
+ ### React hooks and utilities
182
+
183
+ This method can be used in React components through the following hooks and
184
+ associated utilities.
185
+
186
+ > Check out [this guide][hook-guide] for information about each of the utilities
187
+ > below and how to get started using React hooks.
188
+
189
+ [hook-guide]: ../../../REACT_QUERY.md
190
+
191
+ ```tsx
192
+ import {
193
+ // Query hooks for fetching data.
194
+ useWebhooksGetWebhookEndpoint,
195
+ useWebhooksGetWebhookEndpointSuspense,
196
+
197
+ // Utility for prefetching data during server-side rendering and in React
198
+ // Server Components that will be immediately available to client components
199
+ // using the hooks.
200
+ prefetchWebhooksGetWebhookEndpoint,
201
+
202
+ // Utilities to invalidate the query cache for this query in response to
203
+ // mutations and other user actions.
204
+ invalidateWebhooksGetWebhookEndpoint,
205
+ invalidateAllWebhooksGetWebhookEndpoint,
206
+ } from "@greensecurity/javascript-sdk/react-query/webhooksGetWebhookEndpoint.js";
207
+ ```
208
+
209
+ ### Parameters
210
+
211
+ | Parameter | Type | Required | Description |
212
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
213
+ | `request` | [operations.GetWebhookEndpointRequest](../../models/operations/getwebhookendpointrequest.md) | :heavy_check_mark: | The request object to use for the request. |
214
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
215
+ | `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. |
216
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
217
+
218
+ ### Response
219
+
220
+ **Promise\<[components.WebhookEndpoint](../../models/components/webhookendpoint.md)\>**
221
+
222
+ ### Errors
223
+
224
+ | Error Type | Status Code | Content Type |
225
+ | ----------------------- | ----------------------- | ----------------------- |
226
+ | errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
227
+ | errors.ApiErrorResponse | 500 | application/json |
228
+ | errors.APIError | 4XX, 5XX | \*/\* |
229
+
230
+ ## updatesTheWebhookEndpointWithTheGivenId
231
+
232
+ Updates the webhook endpoint with the given ID.
233
+
234
+ ### Example Usage
235
+
236
+ <!-- UsageSnippet language="typescript" operationID="updatesTheWebhookEndpointWithTheGivenId" method="put" path="/webhooks/{id}" -->
237
+ ```typescript
238
+ import { GreenSecurity } from "@greensecurity/javascript-sdk";
239
+
240
+ const greenSecurity = new GreenSecurity({
241
+ security: {
242
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
243
+ },
244
+ });
245
+
246
+ async function run() {
247
+ const result = await greenSecurity.webhooks.updatesTheWebhookEndpointWithTheGivenId({
248
+ id: 220782,
249
+ webhookEndpoint: {
250
+ id: 1,
251
+ webhookUrl: "https://example.com/webhook/incoming",
252
+ subscriptions: [
253
+ "<value 1>",
254
+ "<value 2>",
255
+ ],
256
+ consumers: {
257
+ systemId: 1,
258
+ facilityId: 1,
259
+ companyId: 1,
260
+ userId: 1,
261
+ },
262
+ },
263
+ });
264
+
265
+ console.log(result);
266
+ }
267
+
268
+ run();
269
+ ```
270
+
271
+ ### Standalone function
272
+
273
+ The standalone function version of this method:
274
+
275
+ ```typescript
276
+ import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
277
+ import { webhooksUpdatesTheWebhookEndpointWithTheGivenId } from "@greensecurity/javascript-sdk/funcs/webhooksUpdatesTheWebhookEndpointWithTheGivenId.js";
278
+
279
+ // Use `GreenSecurityCore` for best tree-shaking performance.
280
+ // You can create one instance of it to use across an application.
281
+ const greenSecurity = new GreenSecurityCore({
282
+ security: {
283
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
284
+ },
285
+ });
286
+
287
+ async function run() {
288
+ const res = await webhooksUpdatesTheWebhookEndpointWithTheGivenId(greenSecurity, {
289
+ id: 220782,
290
+ webhookEndpoint: {
291
+ id: 1,
292
+ webhookUrl: "https://example.com/webhook/incoming",
293
+ subscriptions: [
294
+ "<value 1>",
295
+ "<value 2>",
296
+ ],
297
+ consumers: {
298
+ systemId: 1,
299
+ facilityId: 1,
300
+ companyId: 1,
301
+ userId: 1,
302
+ },
303
+ },
304
+ });
305
+ if (res.ok) {
306
+ const { value: result } = res;
307
+ console.log(result);
308
+ } else {
309
+ console.log("webhooksUpdatesTheWebhookEndpointWithTheGivenId failed:", res.error);
310
+ }
311
+ }
312
+
313
+ run();
314
+ ```
315
+
316
+ ### React hooks and utilities
317
+
318
+ This method can be used in React components through the following hooks and
319
+ associated utilities.
320
+
321
+ > Check out [this guide][hook-guide] for information about each of the utilities
322
+ > below and how to get started using React hooks.
323
+
324
+ [hook-guide]: ../../../REACT_QUERY.md
325
+
326
+ ```tsx
327
+ import {
328
+ // Mutation hook for triggering the API call.
329
+ useWebhooksUpdatesTheWebhookEndpointWithTheGivenIdMutation
330
+ } from "@greensecurity/javascript-sdk/react-query/webhooksUpdatesTheWebhookEndpointWithTheGivenId.js";
331
+ ```
332
+
333
+ ### Parameters
334
+
335
+ | Parameter | Type | Required | Description |
336
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
337
+ | `request` | [operations.UpdatesTheWebhookEndpointWithTheGivenIdRequest](../../models/operations/updatesthewebhookendpointwiththegivenidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
338
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
339
+ | `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. |
340
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
341
+
342
+ ### Response
343
+
344
+ **Promise\<[components.WebhookEndpoint](../../models/components/webhookendpoint.md)\>**
345
+
346
+ ### Errors
347
+
348
+ | Error Type | Status Code | Content Type |
349
+ | ----------------------- | ----------------------- | ----------------------- |
350
+ | errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
351
+ | errors.ApiErrorResponse | 500 | application/json |
352
+ | errors.APIError | 4XX, 5XX | \*/\* |