@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greensecurity/javascript-sdk",
3
- "version": "0.40.8-beta.31",
3
+ "version": "0.40.8-beta.32",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -1,35 +0,0 @@
1
-
2
- <div align="center">
3
- <a href="https://codespaces.new/repconnex/repconnex.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
4
- </div>
5
- <br>
6
-
7
- > **Remember to shutdown a GitHub Codespace when it is not in use!**
8
-
9
- # Dev Containers Quick Start
10
-
11
- The default location for usage snippets is the `samples` directory.
12
-
13
- ## Running a Usage Sample
14
-
15
- A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
16
-
17
- ```
18
- ts-node root.ts
19
- ```
20
-
21
- ## Generating Additional Usage Samples
22
-
23
- The speakeasy CLI allows you to generate more usage snippets. Here's how:
24
-
25
- - To generate a sample for a specific operation by providing an operation ID, use:
26
-
27
- ```
28
- speakeasy generate usage -s https://example.com/OVERWRITE_WHEN_SAMPLE_SPEC_IS_WRITTEN -l typescript -i {INPUT_OPERATION_ID} -o ./samples
29
- ```
30
-
31
- - To generate samples for an entire namespace (like a tag or group name), use:
32
-
33
- ```
34
- speakeasy generate usage -s https://example.com/OVERWRITE_WHEN_SAMPLE_SPEC_IS_WRITTEN -l typescript -n {INPUT_TAG_NAME} -o ./samples
35
- ```
@@ -1,219 +0,0 @@
1
- # Alerts
2
- (*alerts*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [listAlerts](#listalerts) - List alerts
9
- * [updateUserAlerts](#updateuseralerts) - Update user alerts
10
-
11
- ## listAlerts
12
-
13
- List alerts for user.
14
-
15
- ### Example Usage
16
-
17
- <!-- UsageSnippet language="typescript" operationID="listAlerts" method="get" path="/alerts" -->
18
- ```typescript
19
- import { GreenSecurity } from "@greensecurity/javascript-sdk";
20
-
21
- const greenSecurity = new GreenSecurity({
22
- security: {
23
- token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
24
- },
25
- });
26
-
27
- async function run() {
28
- const result = await greenSecurity.alerts.listAlerts({
29
- sort: "job",
30
- desc: true,
31
- itemsPerPage: 25,
32
- });
33
-
34
- for await (const page of result) {
35
- console.log(page);
36
- }
37
- }
38
-
39
- run();
40
- ```
41
-
42
- ### Standalone function
43
-
44
- The standalone function version of this method:
45
-
46
- ```typescript
47
- import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
48
- import { alertsListAlerts } from "@greensecurity/javascript-sdk/funcs/alertsListAlerts.js";
49
-
50
- // Use `GreenSecurityCore` for best tree-shaking performance.
51
- // You can create one instance of it to use across an application.
52
- const greenSecurity = new GreenSecurityCore({
53
- security: {
54
- token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
55
- },
56
- });
57
-
58
- async function run() {
59
- const res = await alertsListAlerts(greenSecurity, {
60
- sort: "job",
61
- desc: true,
62
- itemsPerPage: 25,
63
- });
64
- if (res.ok) {
65
- const { value: result } = res;
66
- for await (const page of result) {
67
- console.log(page);
68
- }
69
- } else {
70
- console.log("alertsListAlerts failed:", res.error);
71
- }
72
- }
73
-
74
- run();
75
- ```
76
-
77
- ### React hooks and utilities
78
-
79
- This method can be used in React components through the following hooks and
80
- associated utilities.
81
-
82
- > Check out [this guide][hook-guide] for information about each of the utilities
83
- > below and how to get started using React hooks.
84
-
85
- [hook-guide]: ../../../REACT_QUERY.md
86
-
87
- ```tsx
88
- import {
89
- // Query hooks for fetching data.
90
- useAlertsListAlerts,
91
- useAlertsListAlertsSuspense,
92
- // Query hooks suitable for building infinite scrolling or "load more" UIs.
93
- useAlertsListAlertsInfinite,
94
- useAlertsListAlertsInfiniteSuspense,
95
-
96
- // Utility for prefetching data during server-side rendering and in React
97
- // Server Components that will be immediately available to client components
98
- // using the hooks.
99
- prefetchAlertsListAlerts,
100
-
101
- // Utilities to invalidate the query cache for this query in response to
102
- // mutations and other user actions.
103
- invalidateAlertsListAlerts,
104
- invalidateAllAlertsListAlerts,
105
- } from "@greensecurity/javascript-sdk/react-query/alertsListAlerts.js";
106
- ```
107
-
108
- ### Parameters
109
-
110
- | Parameter | Type | Required | Description |
111
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
112
- | `request` | [operations.ListAlertsRequest](../../models/operations/listalertsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
113
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
114
- | `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. |
115
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
116
-
117
- ### Response
118
-
119
- **Promise\<[operations.ListAlertsResponse](../../models/operations/listalertsresponse.md)\>**
120
-
121
- ### Errors
122
-
123
- | Error Type | Status Code | Content Type |
124
- | ----------------------- | ----------------------- | ----------------------- |
125
- | errors.ApiErrorResponse | 400, 401, 403 | application/json |
126
- | errors.ApiErrorResponse | 500 | application/json |
127
- | errors.APIError | 4XX, 5XX | \*/\* |
128
-
129
- ## updateUserAlerts
130
-
131
- Update user alerts
132
-
133
- ### Example Usage
134
-
135
- <!-- UsageSnippet language="typescript" operationID="updateUserAlerts" method="put" path="/user-alerts" -->
136
- ```typescript
137
- import { GreenSecurity } from "@greensecurity/javascript-sdk";
138
-
139
- const greenSecurity = new GreenSecurity({
140
- security: {
141
- token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
142
- },
143
- });
144
-
145
- async function run() {
146
- const result = await greenSecurity.alerts.updateUserAlerts({});
147
-
148
- console.log(result);
149
- }
150
-
151
- run();
152
- ```
153
-
154
- ### Standalone function
155
-
156
- The standalone function version of this method:
157
-
158
- ```typescript
159
- import { GreenSecurityCore } from "@greensecurity/javascript-sdk/core.js";
160
- import { alertsUpdateUserAlerts } from "@greensecurity/javascript-sdk/funcs/alertsUpdateUserAlerts.js";
161
-
162
- // Use `GreenSecurityCore` for best tree-shaking performance.
163
- // You can create one instance of it to use across an application.
164
- const greenSecurity = new GreenSecurityCore({
165
- security: {
166
- token: process.env["GREEN_SECURITY_TOKEN"] ?? "",
167
- },
168
- });
169
-
170
- async function run() {
171
- const res = await alertsUpdateUserAlerts(greenSecurity, {});
172
- if (res.ok) {
173
- const { value: result } = res;
174
- console.log(result);
175
- } else {
176
- console.log("alertsUpdateUserAlerts failed:", res.error);
177
- }
178
- }
179
-
180
- run();
181
- ```
182
-
183
- ### React hooks and utilities
184
-
185
- This method can be used in React components through the following hooks and
186
- associated utilities.
187
-
188
- > Check out [this guide][hook-guide] for information about each of the utilities
189
- > below and how to get started using React hooks.
190
-
191
- [hook-guide]: ../../../REACT_QUERY.md
192
-
193
- ```tsx
194
- import {
195
- // Mutation hook for triggering the API call.
196
- useAlertsUpdateUserAlertsMutation
197
- } from "@greensecurity/javascript-sdk/react-query/alertsUpdateUserAlerts.js";
198
- ```
199
-
200
- ### Parameters
201
-
202
- | Parameter | Type | Required | Description |
203
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
204
- | `request` | [operations.UpdateUserAlertsRequestBody](../../models/operations/updateuseralertsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
205
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
206
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
207
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
208
-
209
- ### Response
210
-
211
- **Promise\<[operations.UpdateUserAlertsResponseBody](../../models/operations/updateuseralertsresponsebody.md)\>**
212
-
213
- ### Errors
214
-
215
- | Error Type | Status Code | Content Type |
216
- | ----------------------- | ----------------------- | ----------------------- |
217
- | errors.ApiErrorResponse | 400, 401, 403, 404 | application/json |
218
- | errors.ApiErrorResponse | 500 | application/json |
219
- | errors.APIError | 4XX, 5XX | \*/\* |
@@ -1,126 +0,0 @@
1
- # Companies
2
- (*companies*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [listOrSearchCompanies](#listorsearchcompanies) - List or search companies
9
-
10
- ## listOrSearchCompanies
11
-
12
- List or search companies.
13
-
14
- ### Example Usage
15
-
16
- <!-- UsageSnippet language="typescript" operationID="listOrSearchCompanies" method="get" path="/companies" -->
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.companies.listOrSearchCompanies({
28
- sort: "job",
29
- desc: true,
30
- itemsPerPage: 25,
31
- });
32
-
33
- for await (const page of result) {
34
- console.log(page);
35
- }
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 { companiesListOrSearchCompanies } from "@greensecurity/javascript-sdk/funcs/companiesListOrSearchCompanies.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 companiesListOrSearchCompanies(greenSecurity, {
59
- sort: "job",
60
- desc: true,
61
- itemsPerPage: 25,
62
- });
63
- if (res.ok) {
64
- const { value: result } = res;
65
- for await (const page of result) {
66
- console.log(page);
67
- }
68
- } else {
69
- console.log("companiesListOrSearchCompanies failed:", res.error);
70
- }
71
- }
72
-
73
- run();
74
- ```
75
-
76
- ### React hooks and utilities
77
-
78
- This method can be used in React components through the following hooks and
79
- associated utilities.
80
-
81
- > Check out [this guide][hook-guide] for information about each of the utilities
82
- > below and how to get started using React hooks.
83
-
84
- [hook-guide]: ../../../REACT_QUERY.md
85
-
86
- ```tsx
87
- import {
88
- // Query hooks for fetching data.
89
- useCompaniesListOrSearchCompanies,
90
- useCompaniesListOrSearchCompaniesSuspense,
91
- // Query hooks suitable for building infinite scrolling or "load more" UIs.
92
- useCompaniesListOrSearchCompaniesInfinite,
93
- useCompaniesListOrSearchCompaniesInfiniteSuspense,
94
-
95
- // Utility for prefetching data during server-side rendering and in React
96
- // Server Components that will be immediately available to client components
97
- // using the hooks.
98
- prefetchCompaniesListOrSearchCompanies,
99
-
100
- // Utilities to invalidate the query cache for this query in response to
101
- // mutations and other user actions.
102
- invalidateCompaniesListOrSearchCompanies,
103
- invalidateAllCompaniesListOrSearchCompanies,
104
- } from "@greensecurity/javascript-sdk/react-query/companiesListOrSearchCompanies.js";
105
- ```
106
-
107
- ### Parameters
108
-
109
- | Parameter | Type | Required | Description |
110
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
111
- | `request` | [operations.ListOrSearchCompaniesRequest](../../models/operations/listorsearchcompaniesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
112
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
113
- | `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. |
114
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
115
-
116
- ### Response
117
-
118
- **Promise\<[operations.ListOrSearchCompaniesResponse](../../models/operations/listorsearchcompaniesresponse.md)\>**
119
-
120
- ### Errors
121
-
122
- | Error Type | Status Code | Content Type |
123
- | ----------------------- | ----------------------- | ----------------------- |
124
- | errors.ApiErrorResponse | 400, 403 | application/json |
125
- | errors.ApiErrorResponse | 500 | application/json |
126
- | errors.APIError | 4XX, 5XX | \*/\* |