@greensecurity/javascript-sdk 0.40.8-beta.31 → 0.40.8-beta.33
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/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +6 -4
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/paymentprofile.d.ts +4 -4
- package/dist/commonjs/models/components/paymentprofile.d.ts.map +1 -1
- package/dist/commonjs/models/components/paymentprofile.js +4 -4
- package/dist/commonjs/models/components/paymentprofile.js.map +1 -1
- package/dist/commonjs/models/components/vendor.d.ts +8 -8
- package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendor.js +14 -8
- package/dist/commonjs/models/components/vendor.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +6 -4
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/paymentprofile.d.ts +4 -4
- package/dist/esm/models/components/paymentprofile.d.ts.map +1 -1
- package/dist/esm/models/components/paymentprofile.js +4 -4
- package/dist/esm/models/components/paymentprofile.js.map +1 -1
- package/dist/esm/models/components/vendor.d.ts +8 -8
- package/dist/esm/models/components/vendor.d.ts.map +1 -1
- package/dist/esm/models/components/vendor.js +14 -8
- package/dist/esm/models/components/vendor.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +6 -4
- package/src/lib/config.ts +3 -3
- package/src/models/components/paymentprofile.ts +9 -9
- package/src/models/components/vendor.ts +24 -18
- 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,1126 +0,0 @@
|
|
|
1
|
-
# Events
|
|
2
|
-
(*events*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [createEvent](#createevent) - Create a new event for calendar
|
|
9
|
-
* [updateEvent](#updateevent) - Update event for calendar
|
|
10
|
-
* [deleteEvent](#deleteevent) - Delete event for calendar
|
|
11
|
-
* [acceptInvitation](#acceptinvitation) - Accept event invitation
|
|
12
|
-
* [declineInvitation](#declineinvitation) - Decline event invitation
|
|
13
|
-
* [listOrSearchVendorInvitees](#listorsearchvendorinvitees) - List or search vendor invitees
|
|
14
|
-
* [listLocations](#listlocations) - List meeting locations for invitees or an event
|
|
15
|
-
* [listPendingInvitations](#listpendinginvitations) - List pending invitations
|
|
16
|
-
* [listFeed](#listfeed) - List events feed
|
|
17
|
-
* [listStandingAppointments](#liststandingappointments) - List standing appointments
|
|
18
|
-
|
|
19
|
-
## createEvent
|
|
20
|
-
|
|
21
|
-
Create a new event for calendar
|
|
22
|
-
|
|
23
|
-
### Example Usage
|
|
24
|
-
|
|
25
|
-
<!-- UsageSnippet language="typescript" operationID="createEvent" method="post" path="/events" -->
|
|
26
|
-
```typescript
|
|
27
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
28
|
-
|
|
29
|
-
const greenSecurity = new GreenSecurity({
|
|
30
|
-
security: {
|
|
31
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
async function run() {
|
|
36
|
-
const result = await greenSecurity.events.createEvent({
|
|
37
|
-
beginTime: "10:45 am",
|
|
38
|
-
endTime: "10:45 am",
|
|
39
|
-
beginDate: "07/18/2025",
|
|
40
|
-
endDate: "07/18/2025",
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
console.log(result);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
run();
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Standalone function
|
|
50
|
-
|
|
51
|
-
The standalone function version of this method:
|
|
52
|
-
|
|
53
|
-
```typescript
|
|
54
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
55
|
-
import { eventsCreateEvent } from "@greensecurity/javascript-sdk/funcs/eventsCreateEvent.js";
|
|
56
|
-
|
|
57
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
58
|
-
// You can create one instance of it to use across an application.
|
|
59
|
-
const greenSecurity = new GreenSecurityCore({
|
|
60
|
-
security: {
|
|
61
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
async function run() {
|
|
66
|
-
const res = await eventsCreateEvent(greenSecurity, {
|
|
67
|
-
beginTime: "10:45 am",
|
|
68
|
-
endTime: "10:45 am",
|
|
69
|
-
beginDate: "07/18/2025",
|
|
70
|
-
endDate: "07/18/2025",
|
|
71
|
-
});
|
|
72
|
-
if (res.ok) {
|
|
73
|
-
const { value: result } = res;
|
|
74
|
-
console.log(result);
|
|
75
|
-
} else {
|
|
76
|
-
console.log("eventsCreateEvent failed:", res.error);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
run();
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### React hooks and utilities
|
|
84
|
-
|
|
85
|
-
This method can be used in React components through the following hooks and
|
|
86
|
-
associated utilities.
|
|
87
|
-
|
|
88
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
89
|
-
> below and how to get started using React hooks.
|
|
90
|
-
|
|
91
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
92
|
-
|
|
93
|
-
```tsx
|
|
94
|
-
import {
|
|
95
|
-
// Mutation hook for triggering the API call.
|
|
96
|
-
useEventsCreateEventMutation
|
|
97
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsCreateEvent.js";
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Parameters
|
|
101
|
-
|
|
102
|
-
| Parameter | Type | Required | Description |
|
|
103
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
104
|
-
| `request` | [operations.CreateEventRequestBody](../../models/operations/createeventrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
105
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
106
|
-
| `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. |
|
|
107
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
108
|
-
|
|
109
|
-
### Response
|
|
110
|
-
|
|
111
|
-
**Promise\<[operations.CreateEventResponseBody](../../models/operations/createeventresponsebody.md)\>**
|
|
112
|
-
|
|
113
|
-
### Errors
|
|
114
|
-
|
|
115
|
-
| Error Type | Status Code | Content Type |
|
|
116
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
117
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
118
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
119
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
120
|
-
|
|
121
|
-
## updateEvent
|
|
122
|
-
|
|
123
|
-
Update event for calendar
|
|
124
|
-
|
|
125
|
-
### Example Usage
|
|
126
|
-
|
|
127
|
-
<!-- UsageSnippet language="typescript" operationID="updateEvent" method="put" path="/events/{id}" -->
|
|
128
|
-
```typescript
|
|
129
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
130
|
-
|
|
131
|
-
const greenSecurity = new GreenSecurity({
|
|
132
|
-
security: {
|
|
133
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
async function run() {
|
|
138
|
-
const result = await greenSecurity.events.updateEvent({
|
|
139
|
-
id: 383604,
|
|
140
|
-
requestBody: {
|
|
141
|
-
beginDate: "07/18/2025 12:15 pm",
|
|
142
|
-
endDate: "07/18/2025 12:15 pm",
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
console.log(result);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
run();
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Standalone function
|
|
153
|
-
|
|
154
|
-
The standalone function version of this method:
|
|
155
|
-
|
|
156
|
-
```typescript
|
|
157
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
158
|
-
import { eventsUpdateEvent } from "@greensecurity/javascript-sdk/funcs/eventsUpdateEvent.js";
|
|
159
|
-
|
|
160
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
161
|
-
// You can create one instance of it to use across an application.
|
|
162
|
-
const greenSecurity = new GreenSecurityCore({
|
|
163
|
-
security: {
|
|
164
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
165
|
-
},
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
async function run() {
|
|
169
|
-
const res = await eventsUpdateEvent(greenSecurity, {
|
|
170
|
-
id: 383604,
|
|
171
|
-
requestBody: {
|
|
172
|
-
beginDate: "07/18/2025 12:15 pm",
|
|
173
|
-
endDate: "07/18/2025 12:15 pm",
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
if (res.ok) {
|
|
177
|
-
const { value: result } = res;
|
|
178
|
-
console.log(result);
|
|
179
|
-
} else {
|
|
180
|
-
console.log("eventsUpdateEvent failed:", res.error);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
run();
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### React hooks and utilities
|
|
188
|
-
|
|
189
|
-
This method can be used in React components through the following hooks and
|
|
190
|
-
associated utilities.
|
|
191
|
-
|
|
192
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
193
|
-
> below and how to get started using React hooks.
|
|
194
|
-
|
|
195
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
196
|
-
|
|
197
|
-
```tsx
|
|
198
|
-
import {
|
|
199
|
-
// Mutation hook for triggering the API call.
|
|
200
|
-
useEventsUpdateEventMutation
|
|
201
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsUpdateEvent.js";
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Parameters
|
|
205
|
-
|
|
206
|
-
| Parameter | Type | Required | Description |
|
|
207
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
208
|
-
| `request` | [operations.UpdateEventRequest](../../models/operations/updateeventrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
209
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
210
|
-
| `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. |
|
|
211
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
212
|
-
|
|
213
|
-
### Response
|
|
214
|
-
|
|
215
|
-
**Promise\<[operations.UpdateEventResponseBody](../../models/operations/updateeventresponsebody.md)\>**
|
|
216
|
-
|
|
217
|
-
### Errors
|
|
218
|
-
|
|
219
|
-
| Error Type | Status Code | Content Type |
|
|
220
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
221
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
222
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
223
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
224
|
-
|
|
225
|
-
## deleteEvent
|
|
226
|
-
|
|
227
|
-
Delete event for calendar
|
|
228
|
-
|
|
229
|
-
### Example Usage
|
|
230
|
-
|
|
231
|
-
<!-- UsageSnippet language="typescript" operationID="deleteEvent" method="delete" path="/events/{id}" -->
|
|
232
|
-
```typescript
|
|
233
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
234
|
-
|
|
235
|
-
const greenSecurity = new GreenSecurity({
|
|
236
|
-
security: {
|
|
237
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
238
|
-
},
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
async function run() {
|
|
242
|
-
const result = await greenSecurity.events.deleteEvent({
|
|
243
|
-
id: 454558,
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
console.log(result);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
run();
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Standalone function
|
|
253
|
-
|
|
254
|
-
The standalone function version of this method:
|
|
255
|
-
|
|
256
|
-
```typescript
|
|
257
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
258
|
-
import { eventsDeleteEvent } from "@greensecurity/javascript-sdk/funcs/eventsDeleteEvent.js";
|
|
259
|
-
|
|
260
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
261
|
-
// You can create one instance of it to use across an application.
|
|
262
|
-
const greenSecurity = new GreenSecurityCore({
|
|
263
|
-
security: {
|
|
264
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
265
|
-
},
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
async function run() {
|
|
269
|
-
const res = await eventsDeleteEvent(greenSecurity, {
|
|
270
|
-
id: 454558,
|
|
271
|
-
});
|
|
272
|
-
if (res.ok) {
|
|
273
|
-
const { value: result } = res;
|
|
274
|
-
console.log(result);
|
|
275
|
-
} else {
|
|
276
|
-
console.log("eventsDeleteEvent failed:", res.error);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
run();
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
### React hooks and utilities
|
|
284
|
-
|
|
285
|
-
This method can be used in React components through the following hooks and
|
|
286
|
-
associated utilities.
|
|
287
|
-
|
|
288
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
289
|
-
> below and how to get started using React hooks.
|
|
290
|
-
|
|
291
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
292
|
-
|
|
293
|
-
```tsx
|
|
294
|
-
import {
|
|
295
|
-
// Mutation hook for triggering the API call.
|
|
296
|
-
useEventsDeleteEventMutation
|
|
297
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsDeleteEvent.js";
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
### Parameters
|
|
301
|
-
|
|
302
|
-
| Parameter | Type | Required | Description |
|
|
303
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
304
|
-
| `request` | [operations.DeleteEventRequest](../../models/operations/deleteeventrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
305
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
306
|
-
| `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. |
|
|
307
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
308
|
-
|
|
309
|
-
### Response
|
|
310
|
-
|
|
311
|
-
**Promise\<[components.DeleteApiResponse](../../models/components/deleteapiresponse.md)\>**
|
|
312
|
-
|
|
313
|
-
### Errors
|
|
314
|
-
|
|
315
|
-
| Error Type | Status Code | Content Type |
|
|
316
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
317
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
318
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
319
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
320
|
-
|
|
321
|
-
## acceptInvitation
|
|
322
|
-
|
|
323
|
-
Accept event invitation
|
|
324
|
-
|
|
325
|
-
### Example Usage
|
|
326
|
-
|
|
327
|
-
<!-- UsageSnippet language="typescript" operationID="acceptInvitation" method="post" path="/events/{event_id}/invites/{id}/acceptance" -->
|
|
328
|
-
```typescript
|
|
329
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
330
|
-
|
|
331
|
-
const greenSecurity = new GreenSecurity({
|
|
332
|
-
security: {
|
|
333
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
334
|
-
},
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
async function run() {
|
|
338
|
-
const result = await greenSecurity.events.acceptInvitation({
|
|
339
|
-
eventId: 342108,
|
|
340
|
-
id: 86662,
|
|
341
|
-
requestBody: {},
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
console.log(result);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
run();
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
### Standalone function
|
|
351
|
-
|
|
352
|
-
The standalone function version of this method:
|
|
353
|
-
|
|
354
|
-
```typescript
|
|
355
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
356
|
-
import { eventsAcceptInvitation } from "@greensecurity/javascript-sdk/funcs/eventsAcceptInvitation.js";
|
|
357
|
-
|
|
358
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
359
|
-
// You can create one instance of it to use across an application.
|
|
360
|
-
const greenSecurity = new GreenSecurityCore({
|
|
361
|
-
security: {
|
|
362
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
363
|
-
},
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
async function run() {
|
|
367
|
-
const res = await eventsAcceptInvitation(greenSecurity, {
|
|
368
|
-
eventId: 342108,
|
|
369
|
-
id: 86662,
|
|
370
|
-
requestBody: {},
|
|
371
|
-
});
|
|
372
|
-
if (res.ok) {
|
|
373
|
-
const { value: result } = res;
|
|
374
|
-
console.log(result);
|
|
375
|
-
} else {
|
|
376
|
-
console.log("eventsAcceptInvitation failed:", res.error);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
run();
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
### React hooks and utilities
|
|
384
|
-
|
|
385
|
-
This method can be used in React components through the following hooks and
|
|
386
|
-
associated utilities.
|
|
387
|
-
|
|
388
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
389
|
-
> below and how to get started using React hooks.
|
|
390
|
-
|
|
391
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
392
|
-
|
|
393
|
-
```tsx
|
|
394
|
-
import {
|
|
395
|
-
// Mutation hook for triggering the API call.
|
|
396
|
-
useEventsAcceptInvitationMutation
|
|
397
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsAcceptInvitation.js";
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
### Parameters
|
|
401
|
-
|
|
402
|
-
| Parameter | Type | Required | Description |
|
|
403
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
404
|
-
| `request` | [operations.AcceptInvitationRequest](../../models/operations/acceptinvitationrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
405
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
406
|
-
| `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. |
|
|
407
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
408
|
-
|
|
409
|
-
### Response
|
|
410
|
-
|
|
411
|
-
**Promise\<[operations.AcceptInvitationResponseBody](../../models/operations/acceptinvitationresponsebody.md)\>**
|
|
412
|
-
|
|
413
|
-
### Errors
|
|
414
|
-
|
|
415
|
-
| Error Type | Status Code | Content Type |
|
|
416
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
417
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
418
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
419
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
420
|
-
|
|
421
|
-
## declineInvitation
|
|
422
|
-
|
|
423
|
-
Decline event invitation
|
|
424
|
-
|
|
425
|
-
### Example Usage
|
|
426
|
-
|
|
427
|
-
<!-- UsageSnippet language="typescript" operationID="declineInvitation" method="post" path="/events/{event_id}/invites/{id}/declination" -->
|
|
428
|
-
```typescript
|
|
429
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
430
|
-
|
|
431
|
-
const greenSecurity = new GreenSecurity({
|
|
432
|
-
security: {
|
|
433
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
434
|
-
},
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
async function run() {
|
|
438
|
-
const result = await greenSecurity.events.declineInvitation({
|
|
439
|
-
eventId: 466127,
|
|
440
|
-
id: 259902,
|
|
441
|
-
requestBody: {},
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
console.log(result);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
run();
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
### Standalone function
|
|
451
|
-
|
|
452
|
-
The standalone function version of this method:
|
|
453
|
-
|
|
454
|
-
```typescript
|
|
455
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
456
|
-
import { eventsDeclineInvitation } from "@greensecurity/javascript-sdk/funcs/eventsDeclineInvitation.js";
|
|
457
|
-
|
|
458
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
459
|
-
// You can create one instance of it to use across an application.
|
|
460
|
-
const greenSecurity = new GreenSecurityCore({
|
|
461
|
-
security: {
|
|
462
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
463
|
-
},
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
async function run() {
|
|
467
|
-
const res = await eventsDeclineInvitation(greenSecurity, {
|
|
468
|
-
eventId: 466127,
|
|
469
|
-
id: 259902,
|
|
470
|
-
requestBody: {},
|
|
471
|
-
});
|
|
472
|
-
if (res.ok) {
|
|
473
|
-
const { value: result } = res;
|
|
474
|
-
console.log(result);
|
|
475
|
-
} else {
|
|
476
|
-
console.log("eventsDeclineInvitation failed:", res.error);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
run();
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
### React hooks and utilities
|
|
484
|
-
|
|
485
|
-
This method can be used in React components through the following hooks and
|
|
486
|
-
associated utilities.
|
|
487
|
-
|
|
488
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
489
|
-
> below and how to get started using React hooks.
|
|
490
|
-
|
|
491
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
492
|
-
|
|
493
|
-
```tsx
|
|
494
|
-
import {
|
|
495
|
-
// Mutation hook for triggering the API call.
|
|
496
|
-
useEventsDeclineInvitationMutation
|
|
497
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsDeclineInvitation.js";
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
### Parameters
|
|
501
|
-
|
|
502
|
-
| Parameter | Type | Required | Description |
|
|
503
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
504
|
-
| `request` | [operations.DeclineInvitationRequest](../../models/operations/declineinvitationrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
505
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
506
|
-
| `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. |
|
|
507
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
508
|
-
|
|
509
|
-
### Response
|
|
510
|
-
|
|
511
|
-
**Promise\<[operations.DeclineInvitationResponseBody](../../models/operations/declineinvitationresponsebody.md)\>**
|
|
512
|
-
|
|
513
|
-
### Errors
|
|
514
|
-
|
|
515
|
-
| Error Type | Status Code | Content Type |
|
|
516
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
517
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
518
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
519
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
520
|
-
|
|
521
|
-
## listOrSearchVendorInvitees
|
|
522
|
-
|
|
523
|
-
List or search vendor invitees.
|
|
524
|
-
|
|
525
|
-
Available `expand` scopes are:
|
|
526
|
-
|
|
527
|
-
- contact.facility
|
|
528
|
-
- contact.system
|
|
529
|
-
- contact.department
|
|
530
|
-
- contact.user
|
|
531
|
-
|
|
532
|
-
### Example Usage
|
|
533
|
-
|
|
534
|
-
<!-- UsageSnippet language="typescript" operationID="listOrSearchVendorInvitees" method="get" path="/events/vendor-invitees" -->
|
|
535
|
-
```typescript
|
|
536
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
537
|
-
|
|
538
|
-
const greenSecurity = new GreenSecurity({
|
|
539
|
-
security: {
|
|
540
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
541
|
-
},
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
async function run() {
|
|
545
|
-
const result = await greenSecurity.events.listOrSearchVendorInvitees({
|
|
546
|
-
sort: "job",
|
|
547
|
-
desc: true,
|
|
548
|
-
itemsPerPage: 25,
|
|
549
|
-
expand: [
|
|
550
|
-
"facility.system",
|
|
551
|
-
],
|
|
552
|
-
});
|
|
553
|
-
|
|
554
|
-
for await (const page of result) {
|
|
555
|
-
console.log(page);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
run();
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
### Standalone function
|
|
563
|
-
|
|
564
|
-
The standalone function version of this method:
|
|
565
|
-
|
|
566
|
-
```typescript
|
|
567
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
568
|
-
import { eventsListOrSearchVendorInvitees } from "@greensecurity/javascript-sdk/funcs/eventsListOrSearchVendorInvitees.js";
|
|
569
|
-
|
|
570
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
571
|
-
// You can create one instance of it to use across an application.
|
|
572
|
-
const greenSecurity = new GreenSecurityCore({
|
|
573
|
-
security: {
|
|
574
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
575
|
-
},
|
|
576
|
-
});
|
|
577
|
-
|
|
578
|
-
async function run() {
|
|
579
|
-
const res = await eventsListOrSearchVendorInvitees(greenSecurity, {
|
|
580
|
-
sort: "job",
|
|
581
|
-
desc: true,
|
|
582
|
-
itemsPerPage: 25,
|
|
583
|
-
expand: [
|
|
584
|
-
"facility.system",
|
|
585
|
-
],
|
|
586
|
-
});
|
|
587
|
-
if (res.ok) {
|
|
588
|
-
const { value: result } = res;
|
|
589
|
-
for await (const page of result) {
|
|
590
|
-
console.log(page);
|
|
591
|
-
}
|
|
592
|
-
} else {
|
|
593
|
-
console.log("eventsListOrSearchVendorInvitees failed:", res.error);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
run();
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
### React hooks and utilities
|
|
601
|
-
|
|
602
|
-
This method can be used in React components through the following hooks and
|
|
603
|
-
associated utilities.
|
|
604
|
-
|
|
605
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
606
|
-
> below and how to get started using React hooks.
|
|
607
|
-
|
|
608
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
609
|
-
|
|
610
|
-
```tsx
|
|
611
|
-
import {
|
|
612
|
-
// Query hooks for fetching data.
|
|
613
|
-
useEventsListOrSearchVendorInvitees,
|
|
614
|
-
useEventsListOrSearchVendorInviteesSuspense,
|
|
615
|
-
// Query hooks suitable for building infinite scrolling or "load more" UIs.
|
|
616
|
-
useEventsListOrSearchVendorInviteesInfinite,
|
|
617
|
-
useEventsListOrSearchVendorInviteesInfiniteSuspense,
|
|
618
|
-
|
|
619
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
620
|
-
// Server Components that will be immediately available to client components
|
|
621
|
-
// using the hooks.
|
|
622
|
-
prefetchEventsListOrSearchVendorInvitees,
|
|
623
|
-
|
|
624
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
625
|
-
// mutations and other user actions.
|
|
626
|
-
invalidateEventsListOrSearchVendorInvitees,
|
|
627
|
-
invalidateAllEventsListOrSearchVendorInvitees,
|
|
628
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsListOrSearchVendorInvitees.js";
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
### Parameters
|
|
632
|
-
|
|
633
|
-
| Parameter | Type | Required | Description |
|
|
634
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
635
|
-
| `request` | [operations.ListOrSearchVendorInviteesRequest](../../models/operations/listorsearchvendorinviteesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
636
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
637
|
-
| `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. |
|
|
638
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
639
|
-
|
|
640
|
-
### Response
|
|
641
|
-
|
|
642
|
-
**Promise\<[operations.ListOrSearchVendorInviteesResponse](../../models/operations/listorsearchvendorinviteesresponse.md)\>**
|
|
643
|
-
|
|
644
|
-
### Errors
|
|
645
|
-
|
|
646
|
-
| Error Type | Status Code | Content Type |
|
|
647
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
648
|
-
| errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
|
|
649
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
650
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
651
|
-
|
|
652
|
-
## listLocations
|
|
653
|
-
|
|
654
|
-
List meeting locations for invitees or an event
|
|
655
|
-
|
|
656
|
-
### Example Usage
|
|
657
|
-
|
|
658
|
-
<!-- UsageSnippet language="typescript" operationID="listLocations" method="get" path="/events/locations" -->
|
|
659
|
-
```typescript
|
|
660
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
661
|
-
|
|
662
|
-
const greenSecurity = new GreenSecurity({
|
|
663
|
-
security: {
|
|
664
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
665
|
-
},
|
|
666
|
-
});
|
|
667
|
-
|
|
668
|
-
async function run() {
|
|
669
|
-
const result = await greenSecurity.events.listLocations({
|
|
670
|
-
sort: "job",
|
|
671
|
-
desc: true,
|
|
672
|
-
itemsPerPage: 25,
|
|
673
|
-
inviteeUserIds: "[5944, 12549]",
|
|
674
|
-
inviteeDepartmentIds: "[12549, 619]",
|
|
675
|
-
});
|
|
676
|
-
|
|
677
|
-
for await (const page of result) {
|
|
678
|
-
console.log(page);
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
run();
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
### Standalone function
|
|
686
|
-
|
|
687
|
-
The standalone function version of this method:
|
|
688
|
-
|
|
689
|
-
```typescript
|
|
690
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
691
|
-
import { eventsListLocations } from "@greensecurity/javascript-sdk/funcs/eventsListLocations.js";
|
|
692
|
-
|
|
693
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
694
|
-
// You can create one instance of it to use across an application.
|
|
695
|
-
const greenSecurity = new GreenSecurityCore({
|
|
696
|
-
security: {
|
|
697
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
698
|
-
},
|
|
699
|
-
});
|
|
700
|
-
|
|
701
|
-
async function run() {
|
|
702
|
-
const res = await eventsListLocations(greenSecurity, {
|
|
703
|
-
sort: "job",
|
|
704
|
-
desc: true,
|
|
705
|
-
itemsPerPage: 25,
|
|
706
|
-
inviteeUserIds: "[5944, 12549]",
|
|
707
|
-
inviteeDepartmentIds: "[12549, 619]",
|
|
708
|
-
});
|
|
709
|
-
if (res.ok) {
|
|
710
|
-
const { value: result } = res;
|
|
711
|
-
for await (const page of result) {
|
|
712
|
-
console.log(page);
|
|
713
|
-
}
|
|
714
|
-
} else {
|
|
715
|
-
console.log("eventsListLocations failed:", res.error);
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
run();
|
|
720
|
-
```
|
|
721
|
-
|
|
722
|
-
### React hooks and utilities
|
|
723
|
-
|
|
724
|
-
This method can be used in React components through the following hooks and
|
|
725
|
-
associated utilities.
|
|
726
|
-
|
|
727
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
728
|
-
> below and how to get started using React hooks.
|
|
729
|
-
|
|
730
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
731
|
-
|
|
732
|
-
```tsx
|
|
733
|
-
import {
|
|
734
|
-
// Query hooks for fetching data.
|
|
735
|
-
useEventsListLocations,
|
|
736
|
-
useEventsListLocationsSuspense,
|
|
737
|
-
// Query hooks suitable for building infinite scrolling or "load more" UIs.
|
|
738
|
-
useEventsListLocationsInfinite,
|
|
739
|
-
useEventsListLocationsInfiniteSuspense,
|
|
740
|
-
|
|
741
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
742
|
-
// Server Components that will be immediately available to client components
|
|
743
|
-
// using the hooks.
|
|
744
|
-
prefetchEventsListLocations,
|
|
745
|
-
|
|
746
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
747
|
-
// mutations and other user actions.
|
|
748
|
-
invalidateEventsListLocations,
|
|
749
|
-
invalidateAllEventsListLocations,
|
|
750
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsListLocations.js";
|
|
751
|
-
```
|
|
752
|
-
|
|
753
|
-
### Parameters
|
|
754
|
-
|
|
755
|
-
| Parameter | Type | Required | Description |
|
|
756
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
757
|
-
| `request` | [operations.ListLocationsRequest](../../models/operations/listlocationsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
758
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
759
|
-
| `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. |
|
|
760
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
761
|
-
|
|
762
|
-
### Response
|
|
763
|
-
|
|
764
|
-
**Promise\<[operations.ListLocationsResponse](../../models/operations/listlocationsresponse.md)\>**
|
|
765
|
-
|
|
766
|
-
### Errors
|
|
767
|
-
|
|
768
|
-
| Error Type | Status Code | Content Type |
|
|
769
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
770
|
-
| errors.ApiErrorResponse | 400, 401, 403 | application/json |
|
|
771
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
772
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
773
|
-
|
|
774
|
-
## listPendingInvitations
|
|
775
|
-
|
|
776
|
-
List pending invitations
|
|
777
|
-
|
|
778
|
-
### Example Usage
|
|
779
|
-
|
|
780
|
-
<!-- UsageSnippet language="typescript" operationID="listPendingInvitations" method="get" path="/events/pending-invitations" -->
|
|
781
|
-
```typescript
|
|
782
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
783
|
-
|
|
784
|
-
const greenSecurity = new GreenSecurity({
|
|
785
|
-
security: {
|
|
786
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
787
|
-
},
|
|
788
|
-
});
|
|
789
|
-
|
|
790
|
-
async function run() {
|
|
791
|
-
const result = await greenSecurity.events.listPendingInvitations({
|
|
792
|
-
sort: "job",
|
|
793
|
-
desc: true,
|
|
794
|
-
itemsPerPage: 25,
|
|
795
|
-
});
|
|
796
|
-
|
|
797
|
-
for await (const page of result) {
|
|
798
|
-
console.log(page);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
run();
|
|
803
|
-
```
|
|
804
|
-
|
|
805
|
-
### Standalone function
|
|
806
|
-
|
|
807
|
-
The standalone function version of this method:
|
|
808
|
-
|
|
809
|
-
```typescript
|
|
810
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
811
|
-
import { eventsListPendingInvitations } from "@greensecurity/javascript-sdk/funcs/eventsListPendingInvitations.js";
|
|
812
|
-
|
|
813
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
814
|
-
// You can create one instance of it to use across an application.
|
|
815
|
-
const greenSecurity = new GreenSecurityCore({
|
|
816
|
-
security: {
|
|
817
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
818
|
-
},
|
|
819
|
-
});
|
|
820
|
-
|
|
821
|
-
async function run() {
|
|
822
|
-
const res = await eventsListPendingInvitations(greenSecurity, {
|
|
823
|
-
sort: "job",
|
|
824
|
-
desc: true,
|
|
825
|
-
itemsPerPage: 25,
|
|
826
|
-
});
|
|
827
|
-
if (res.ok) {
|
|
828
|
-
const { value: result } = res;
|
|
829
|
-
for await (const page of result) {
|
|
830
|
-
console.log(page);
|
|
831
|
-
}
|
|
832
|
-
} else {
|
|
833
|
-
console.log("eventsListPendingInvitations failed:", res.error);
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
run();
|
|
838
|
-
```
|
|
839
|
-
|
|
840
|
-
### React hooks and utilities
|
|
841
|
-
|
|
842
|
-
This method can be used in React components through the following hooks and
|
|
843
|
-
associated utilities.
|
|
844
|
-
|
|
845
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
846
|
-
> below and how to get started using React hooks.
|
|
847
|
-
|
|
848
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
849
|
-
|
|
850
|
-
```tsx
|
|
851
|
-
import {
|
|
852
|
-
// Query hooks for fetching data.
|
|
853
|
-
useEventsListPendingInvitations,
|
|
854
|
-
useEventsListPendingInvitationsSuspense,
|
|
855
|
-
// Query hooks suitable for building infinite scrolling or "load more" UIs.
|
|
856
|
-
useEventsListPendingInvitationsInfinite,
|
|
857
|
-
useEventsListPendingInvitationsInfiniteSuspense,
|
|
858
|
-
|
|
859
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
860
|
-
// Server Components that will be immediately available to client components
|
|
861
|
-
// using the hooks.
|
|
862
|
-
prefetchEventsListPendingInvitations,
|
|
863
|
-
|
|
864
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
865
|
-
// mutations and other user actions.
|
|
866
|
-
invalidateEventsListPendingInvitations,
|
|
867
|
-
invalidateAllEventsListPendingInvitations,
|
|
868
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsListPendingInvitations.js";
|
|
869
|
-
```
|
|
870
|
-
|
|
871
|
-
### Parameters
|
|
872
|
-
|
|
873
|
-
| Parameter | Type | Required | Description |
|
|
874
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
875
|
-
| `request` | [operations.ListPendingInvitationsRequest](../../models/operations/listpendinginvitationsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
876
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
877
|
-
| `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. |
|
|
878
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
879
|
-
|
|
880
|
-
### Response
|
|
881
|
-
|
|
882
|
-
**Promise\<[operations.ListPendingInvitationsResponse](../../models/operations/listpendinginvitationsresponse.md)\>**
|
|
883
|
-
|
|
884
|
-
### Errors
|
|
885
|
-
|
|
886
|
-
| Error Type | Status Code | Content Type |
|
|
887
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
888
|
-
| errors.ApiErrorResponse | 400, 401, 403 | application/json |
|
|
889
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
890
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
891
|
-
|
|
892
|
-
## listFeed
|
|
893
|
-
|
|
894
|
-
List events feed
|
|
895
|
-
|
|
896
|
-
### Example Usage
|
|
897
|
-
|
|
898
|
-
<!-- UsageSnippet language="typescript" operationID="listFeed" method="get" path="/events/feed" -->
|
|
899
|
-
```typescript
|
|
900
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
901
|
-
|
|
902
|
-
const greenSecurity = new GreenSecurity({
|
|
903
|
-
security: {
|
|
904
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
905
|
-
},
|
|
906
|
-
});
|
|
907
|
-
|
|
908
|
-
async function run() {
|
|
909
|
-
const result = await greenSecurity.events.listFeed({
|
|
910
|
-
sort: "job",
|
|
911
|
-
desc: true,
|
|
912
|
-
itemsPerPage: 25,
|
|
913
|
-
});
|
|
914
|
-
|
|
915
|
-
for await (const page of result) {
|
|
916
|
-
console.log(page);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
run();
|
|
921
|
-
```
|
|
922
|
-
|
|
923
|
-
### Standalone function
|
|
924
|
-
|
|
925
|
-
The standalone function version of this method:
|
|
926
|
-
|
|
927
|
-
```typescript
|
|
928
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
929
|
-
import { eventsListFeed } from "@greensecurity/javascript-sdk/funcs/eventsListFeed.js";
|
|
930
|
-
|
|
931
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
932
|
-
// You can create one instance of it to use across an application.
|
|
933
|
-
const greenSecurity = new GreenSecurityCore({
|
|
934
|
-
security: {
|
|
935
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
936
|
-
},
|
|
937
|
-
});
|
|
938
|
-
|
|
939
|
-
async function run() {
|
|
940
|
-
const res = await eventsListFeed(greenSecurity, {
|
|
941
|
-
sort: "job",
|
|
942
|
-
desc: true,
|
|
943
|
-
itemsPerPage: 25,
|
|
944
|
-
});
|
|
945
|
-
if (res.ok) {
|
|
946
|
-
const { value: result } = res;
|
|
947
|
-
for await (const page of result) {
|
|
948
|
-
console.log(page);
|
|
949
|
-
}
|
|
950
|
-
} else {
|
|
951
|
-
console.log("eventsListFeed failed:", res.error);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
run();
|
|
956
|
-
```
|
|
957
|
-
|
|
958
|
-
### React hooks and utilities
|
|
959
|
-
|
|
960
|
-
This method can be used in React components through the following hooks and
|
|
961
|
-
associated utilities.
|
|
962
|
-
|
|
963
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
964
|
-
> below and how to get started using React hooks.
|
|
965
|
-
|
|
966
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
967
|
-
|
|
968
|
-
```tsx
|
|
969
|
-
import {
|
|
970
|
-
// Query hooks for fetching data.
|
|
971
|
-
useEventsListFeed,
|
|
972
|
-
useEventsListFeedSuspense,
|
|
973
|
-
// Query hooks suitable for building infinite scrolling or "load more" UIs.
|
|
974
|
-
useEventsListFeedInfinite,
|
|
975
|
-
useEventsListFeedInfiniteSuspense,
|
|
976
|
-
|
|
977
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
978
|
-
// Server Components that will be immediately available to client components
|
|
979
|
-
// using the hooks.
|
|
980
|
-
prefetchEventsListFeed,
|
|
981
|
-
|
|
982
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
983
|
-
// mutations and other user actions.
|
|
984
|
-
invalidateEventsListFeed,
|
|
985
|
-
invalidateAllEventsListFeed,
|
|
986
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsListFeed.js";
|
|
987
|
-
```
|
|
988
|
-
|
|
989
|
-
### Parameters
|
|
990
|
-
|
|
991
|
-
| Parameter | Type | Required | Description |
|
|
992
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
993
|
-
| `request` | [operations.ListFeedRequest](../../models/operations/listfeedrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
994
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
995
|
-
| `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. |
|
|
996
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
997
|
-
|
|
998
|
-
### Response
|
|
999
|
-
|
|
1000
|
-
**Promise\<[operations.ListFeedResponse](../../models/operations/listfeedresponse.md)\>**
|
|
1001
|
-
|
|
1002
|
-
### Errors
|
|
1003
|
-
|
|
1004
|
-
| Error Type | Status Code | Content Type |
|
|
1005
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
1006
|
-
| errors.ApiErrorResponse | 400, 401, 403 | application/json |
|
|
1007
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
1008
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
1009
|
-
|
|
1010
|
-
## listStandingAppointments
|
|
1011
|
-
|
|
1012
|
-
List standing appointment
|
|
1013
|
-
|
|
1014
|
-
### Example Usage
|
|
1015
|
-
|
|
1016
|
-
<!-- UsageSnippet language="typescript" operationID="listStandingAppointments" method="get" path="/events/standing-appointments" -->
|
|
1017
|
-
```typescript
|
|
1018
|
-
import { GreenSecurity } from "@greensecurity/javascript-sdk";
|
|
1019
|
-
|
|
1020
|
-
const greenSecurity = new GreenSecurity({
|
|
1021
|
-
security: {
|
|
1022
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
1023
|
-
},
|
|
1024
|
-
});
|
|
1025
|
-
|
|
1026
|
-
async function run() {
|
|
1027
|
-
const result = await greenSecurity.events.listStandingAppointments({
|
|
1028
|
-
sort: "job",
|
|
1029
|
-
desc: true,
|
|
1030
|
-
itemsPerPage: 25,
|
|
1031
|
-
});
|
|
1032
|
-
|
|
1033
|
-
for await (const page of result) {
|
|
1034
|
-
console.log(page);
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
run();
|
|
1039
|
-
```
|
|
1040
|
-
|
|
1041
|
-
### Standalone function
|
|
1042
|
-
|
|
1043
|
-
The standalone function version of this method:
|
|
1044
|
-
|
|
1045
|
-
```typescript
|
|
1046
|
-
import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
|
|
1047
|
-
import { eventsListStandingAppointments } from "@greensecurity/javascript-sdk/funcs/eventsListStandingAppointments.js";
|
|
1048
|
-
|
|
1049
|
-
// Use `GreenSecurityCore` for best tree-shaking performance.
|
|
1050
|
-
// You can create one instance of it to use across an application.
|
|
1051
|
-
const greenSecurity = new GreenSecurityCore({
|
|
1052
|
-
security: {
|
|
1053
|
-
token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
|
|
1054
|
-
},
|
|
1055
|
-
});
|
|
1056
|
-
|
|
1057
|
-
async function run() {
|
|
1058
|
-
const res = await eventsListStandingAppointments(greenSecurity, {
|
|
1059
|
-
sort: "job",
|
|
1060
|
-
desc: true,
|
|
1061
|
-
itemsPerPage: 25,
|
|
1062
|
-
});
|
|
1063
|
-
if (res.ok) {
|
|
1064
|
-
const { value: result } = res;
|
|
1065
|
-
for await (const page of result) {
|
|
1066
|
-
console.log(page);
|
|
1067
|
-
}
|
|
1068
|
-
} else {
|
|
1069
|
-
console.log("eventsListStandingAppointments failed:", res.error);
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
run();
|
|
1074
|
-
```
|
|
1075
|
-
|
|
1076
|
-
### React hooks and utilities
|
|
1077
|
-
|
|
1078
|
-
This method can be used in React components through the following hooks and
|
|
1079
|
-
associated utilities.
|
|
1080
|
-
|
|
1081
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
1082
|
-
> below and how to get started using React hooks.
|
|
1083
|
-
|
|
1084
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
1085
|
-
|
|
1086
|
-
```tsx
|
|
1087
|
-
import {
|
|
1088
|
-
// Query hooks for fetching data.
|
|
1089
|
-
useEventsListStandingAppointments,
|
|
1090
|
-
useEventsListStandingAppointmentsSuspense,
|
|
1091
|
-
// Query hooks suitable for building infinite scrolling or "load more" UIs.
|
|
1092
|
-
useEventsListStandingAppointmentsInfinite,
|
|
1093
|
-
useEventsListStandingAppointmentsInfiniteSuspense,
|
|
1094
|
-
|
|
1095
|
-
// Utility for prefetching data during server-side rendering and in React
|
|
1096
|
-
// Server Components that will be immediately available to client components
|
|
1097
|
-
// using the hooks.
|
|
1098
|
-
prefetchEventsListStandingAppointments,
|
|
1099
|
-
|
|
1100
|
-
// Utilities to invalidate the query cache for this query in response to
|
|
1101
|
-
// mutations and other user actions.
|
|
1102
|
-
invalidateEventsListStandingAppointments,
|
|
1103
|
-
invalidateAllEventsListStandingAppointments,
|
|
1104
|
-
} from "@greensecurity/javascript-sdk/react-query/eventsListStandingAppointments.js";
|
|
1105
|
-
```
|
|
1106
|
-
|
|
1107
|
-
### Parameters
|
|
1108
|
-
|
|
1109
|
-
| Parameter | Type | Required | Description |
|
|
1110
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1111
|
-
| `request` | [operations.ListStandingAppointmentsRequest](../../models/operations/liststandingappointmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
1112
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1113
|
-
| `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. |
|
|
1114
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
1115
|
-
|
|
1116
|
-
### Response
|
|
1117
|
-
|
|
1118
|
-
**Promise\<[operations.ListStandingAppointmentsResponse](../../models/operations/liststandingappointmentsresponse.md)\>**
|
|
1119
|
-
|
|
1120
|
-
### Errors
|
|
1121
|
-
|
|
1122
|
-
| Error Type | Status Code | Content Type |
|
|
1123
|
-
| ----------------------- | ----------------------- | ----------------------- |
|
|
1124
|
-
| errors.ApiErrorResponse | 400, 401, 403 | application/json |
|
|
1125
|
-
| errors.ApiErrorResponse | 500 | application/json |
|
|
1126
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|