@greensecurity/javascript-sdk 0.43.1-beta.112 → 0.43.1-beta.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/commonjs/__tests__/invoices.test.js +21 -0
- package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +17 -0
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +9 -8
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/invoicesGetInvoice.d.ts +25 -0
- package/dist/commonjs/funcs/invoicesGetInvoice.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesGetInvoice.js +133 -0
- package/dist/commonjs/funcs/invoicesGetInvoice.js.map +1 -0
- package/dist/commonjs/funcs/vendorsCancelHandoff.d.ts +20 -0
- package/dist/commonjs/funcs/vendorsCancelHandoff.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsCancelHandoff.js +119 -0
- package/dist/commonjs/funcs/vendorsCancelHandoff.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/alert.d.ts +0 -1
- package/dist/commonjs/models/components/alert.d.ts.map +1 -1
- package/dist/commonjs/models/components/alert.js +0 -2
- package/dist/commonjs/models/components/alert.js.map +1 -1
- package/dist/commonjs/models/operations/cancelhandoff.d.ts +23 -0
- package/dist/commonjs/models/operations/cancelhandoff.d.ts.map +1 -0
- package/dist/commonjs/models/operations/cancelhandoff.js +64 -0
- package/dist/commonjs/models/operations/cancelhandoff.js.map +1 -0
- package/dist/commonjs/models/operations/getinvoice.d.ts +75 -0
- package/dist/commonjs/models/operations/getinvoice.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getinvoice.js +93 -0
- package/dist/commonjs/models/operations/getinvoice.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/invoicesGetInvoice.core.d.ts +20 -0
- package/dist/commonjs/react-query/invoicesGetInvoice.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/invoicesGetInvoice.core.js +46 -0
- package/dist/commonjs/react-query/invoicesGetInvoice.core.js.map +1 -0
- package/dist/commonjs/react-query/invoicesGetInvoice.d.ts +55 -0
- package/dist/commonjs/react-query/invoicesGetInvoice.d.ts.map +1 -0
- package/dist/commonjs/react-query/invoicesGetInvoice.js +73 -0
- package/dist/commonjs/react-query/invoicesGetInvoice.js.map +1 -0
- package/dist/commonjs/react-query/vendorsCancelHandoff.d.ts +29 -0
- package/dist/commonjs/react-query/vendorsCancelHandoff.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsCancelHandoff.js +47 -0
- package/dist/commonjs/react-query/vendorsCancelHandoff.js.map +1 -0
- package/dist/commonjs/sdk/invoices.d.ts +12 -0
- package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
- package/dist/commonjs/sdk/invoices.js +14 -0
- package/dist/commonjs/sdk/invoices.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +7 -0
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +10 -0
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/invoices.test.js +21 -0
- package/dist/esm/__tests__/invoices.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +17 -0
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +9 -8
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/invoicesGetInvoice.d.ts +25 -0
- package/dist/esm/funcs/invoicesGetInvoice.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesGetInvoice.js +97 -0
- package/dist/esm/funcs/invoicesGetInvoice.js.map +1 -0
- package/dist/esm/funcs/vendorsCancelHandoff.d.ts +20 -0
- package/dist/esm/funcs/vendorsCancelHandoff.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsCancelHandoff.js +83 -0
- package/dist/esm/funcs/vendorsCancelHandoff.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/alert.d.ts +0 -1
- package/dist/esm/models/components/alert.d.ts.map +1 -1
- package/dist/esm/models/components/alert.js +0 -2
- package/dist/esm/models/components/alert.js.map +1 -1
- package/dist/esm/models/operations/cancelhandoff.d.ts +23 -0
- package/dist/esm/models/operations/cancelhandoff.d.ts.map +1 -0
- package/dist/esm/models/operations/cancelhandoff.js +26 -0
- package/dist/esm/models/operations/cancelhandoff.js.map +1 -0
- package/dist/esm/models/operations/getinvoice.d.ts +75 -0
- package/dist/esm/models/operations/getinvoice.d.ts.map +1 -0
- package/dist/esm/models/operations/getinvoice.js +56 -0
- package/dist/esm/models/operations/getinvoice.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/invoicesGetInvoice.core.d.ts +20 -0
- package/dist/esm/react-query/invoicesGetInvoice.core.d.ts.map +1 -0
- package/dist/esm/react-query/invoicesGetInvoice.core.js +41 -0
- package/dist/esm/react-query/invoicesGetInvoice.core.js.map +1 -0
- package/dist/esm/react-query/invoicesGetInvoice.d.ts +55 -0
- package/dist/esm/react-query/invoicesGetInvoice.d.ts.map +1 -0
- package/dist/esm/react-query/invoicesGetInvoice.js +63 -0
- package/dist/esm/react-query/invoicesGetInvoice.js.map +1 -0
- package/dist/esm/react-query/vendorsCancelHandoff.d.ts +29 -0
- package/dist/esm/react-query/vendorsCancelHandoff.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsCancelHandoff.js +42 -0
- package/dist/esm/react-query/vendorsCancelHandoff.js.map +1 -0
- package/dist/esm/sdk/invoices.d.ts +12 -0
- package/dist/esm/sdk/invoices.d.ts.map +1 -1
- package/dist/esm/sdk/invoices.js +14 -0
- package/dist/esm/sdk/invoices.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +7 -0
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +10 -0
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/invoices.test.ts +24 -0
- package/src/__tests__/vendors.test.ts +20 -0
- package/src/__tests__/zones.test.ts +9 -8
- package/src/funcs/invoicesGetInvoice.ts +188 -0
- package/src/funcs/vendorsCancelHandoff.ts +170 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/alert.ts +0 -3
- package/src/models/operations/cancelhandoff.ts +66 -0
- package/src/models/operations/getinvoice.ts +115 -0
- package/src/models/operations/index.ts +2 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/invoicesGetInvoice.core.ts +92 -0
- package/src/react-query/invoicesGetInvoice.ts +166 -0
- package/src/react-query/vendorsCancelHandoff.ts +111 -0
- package/src/sdk/invoices.ts +23 -0
- package/src/sdk/vendors.ts +18 -0
|
@@ -40,27 +40,27 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
40
40
|
contacts: {
|
|
41
41
|
contact: {
|
|
42
42
|
status: "Active",
|
|
43
|
-
department:
|
|
43
|
+
department: 123,
|
|
44
44
|
},
|
|
45
45
|
adminContact: {
|
|
46
|
-
status: "
|
|
47
|
-
department:
|
|
46
|
+
status: "Active",
|
|
47
|
+
department: 123,
|
|
48
48
|
},
|
|
49
49
|
techContact: {
|
|
50
50
|
status: "Inactive",
|
|
51
51
|
department: 123,
|
|
52
52
|
},
|
|
53
53
|
greenSecurityCsm: {
|
|
54
|
-
status: "
|
|
54
|
+
status: "Deleted",
|
|
55
55
|
department: 123,
|
|
56
56
|
},
|
|
57
57
|
accountManager: {
|
|
58
|
-
status: "
|
|
58
|
+
status: "Inactive",
|
|
59
59
|
department: 123,
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
vendorGuestPolicy: {
|
|
63
|
-
enabled:
|
|
63
|
+
enabled: true,
|
|
64
64
|
vendorGuestLimitAndOr: "and",
|
|
65
65
|
vendorGuestRequireEmail: false,
|
|
66
66
|
},
|
|
@@ -85,8 +85,9 @@ test("Zones Security Zone Checkin", async () => {
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
const result = await greenSecurity.zones.securityZoneCheckin({
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
longitude: 8706.45,
|
|
89
|
+
latitude: 7315.87,
|
|
90
|
+
zoneId: 944641,
|
|
90
91
|
});
|
|
91
92
|
expect(result).toBeDefined();
|
|
92
93
|
expect(result).toEqual({});
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GreenSecurityCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, queryJoin } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get a single invoice
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns the newest invoice in the caller's authorized scope matching the
|
|
34
|
+
* requested financial statuses. Use `product_type=credentialing` to limit
|
|
35
|
+
* results to invoices that include a credentialing product line item. At
|
|
36
|
+
* most one of `vendor_id`, `company_id`, `facility_id`, or `system_id`
|
|
37
|
+
* may be provided.
|
|
38
|
+
*
|
|
39
|
+
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
40
|
+
*/
|
|
41
|
+
export function invoicesGetInvoice(
|
|
42
|
+
client: GreenSecurityCore,
|
|
43
|
+
request: operations.GetInvoiceRequest,
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<
|
|
46
|
+
Result<
|
|
47
|
+
components.Invoice,
|
|
48
|
+
| errors.ApiErrorResponse
|
|
49
|
+
| GreenSecurityError
|
|
50
|
+
| ResponseValidationError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| UnexpectedClientError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
>
|
|
58
|
+
> {
|
|
59
|
+
return new APIPromise($do(
|
|
60
|
+
client,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: GreenSecurityCore,
|
|
68
|
+
request: operations.GetInvoiceRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
components.Invoice,
|
|
74
|
+
| errors.ApiErrorResponse
|
|
75
|
+
| GreenSecurityError
|
|
76
|
+
| ResponseValidationError
|
|
77
|
+
| ConnectionError
|
|
78
|
+
| RequestAbortedError
|
|
79
|
+
| RequestTimeoutError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const parsed = safeParse(
|
|
88
|
+
request,
|
|
89
|
+
(value) => operations.GetInvoiceRequest$outboundSchema.parse(value),
|
|
90
|
+
"Input validation failed",
|
|
91
|
+
);
|
|
92
|
+
if (!parsed.ok) {
|
|
93
|
+
return [parsed, { status: "invalid" }];
|
|
94
|
+
}
|
|
95
|
+
const payload = parsed.value;
|
|
96
|
+
const body = null;
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/invoice")();
|
|
99
|
+
|
|
100
|
+
const query = queryJoin(
|
|
101
|
+
encodeFormQuery({
|
|
102
|
+
"status": payload.status,
|
|
103
|
+
}, { explode: false }),
|
|
104
|
+
encodeFormQuery({
|
|
105
|
+
"company_id": payload.company_id,
|
|
106
|
+
"facility_id": payload.facility_id,
|
|
107
|
+
"product_type": payload.product_type,
|
|
108
|
+
"system_id": payload.system_id,
|
|
109
|
+
"vendor_id": payload.vendor_id,
|
|
110
|
+
}),
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const headers = new Headers(compactMap({
|
|
114
|
+
Accept: "application/json",
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
118
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
|
|
119
|
+
|
|
120
|
+
const context = {
|
|
121
|
+
options: client._options,
|
|
122
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
123
|
+
operationID: "getInvoice",
|
|
124
|
+
oAuth2Scopes: null,
|
|
125
|
+
|
|
126
|
+
resolvedSecurity: requestSecurity,
|
|
127
|
+
|
|
128
|
+
securitySource: client._options.security,
|
|
129
|
+
retryConfig: options?.retries
|
|
130
|
+
|| client._options.retryConfig
|
|
131
|
+
|| { strategy: "none" },
|
|
132
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const requestRes = client._createRequest(context, {
|
|
136
|
+
security: requestSecurity,
|
|
137
|
+
method: "GET",
|
|
138
|
+
baseURL: options?.serverURL,
|
|
139
|
+
path: path,
|
|
140
|
+
headers: headers,
|
|
141
|
+
query: query,
|
|
142
|
+
body: body,
|
|
143
|
+
userAgent: client._options.userAgent,
|
|
144
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
145
|
+
}, options);
|
|
146
|
+
if (!requestRes.ok) {
|
|
147
|
+
return [requestRes, { status: "invalid" }];
|
|
148
|
+
}
|
|
149
|
+
const req = requestRes.value;
|
|
150
|
+
|
|
151
|
+
const doResult = await client._do(req, {
|
|
152
|
+
context,
|
|
153
|
+
errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
|
154
|
+
retryConfig: context.retryConfig,
|
|
155
|
+
retryCodes: context.retryCodes,
|
|
156
|
+
});
|
|
157
|
+
if (!doResult.ok) {
|
|
158
|
+
return [doResult, { status: "request-error", request: req }];
|
|
159
|
+
}
|
|
160
|
+
const response = doResult.value;
|
|
161
|
+
|
|
162
|
+
const responseFields = {
|
|
163
|
+
HttpMeta: { Response: response, Request: req },
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const [result] = await M.match<
|
|
167
|
+
components.Invoice,
|
|
168
|
+
| errors.ApiErrorResponse
|
|
169
|
+
| GreenSecurityError
|
|
170
|
+
| ResponseValidationError
|
|
171
|
+
| ConnectionError
|
|
172
|
+
| RequestAbortedError
|
|
173
|
+
| RequestTimeoutError
|
|
174
|
+
| InvalidRequestError
|
|
175
|
+
| UnexpectedClientError
|
|
176
|
+
| SDKValidationError
|
|
177
|
+
>(
|
|
178
|
+
M.json(200, components.Invoice$inboundSchema),
|
|
179
|
+
M.jsonErr([400, 401, 403, 404, 422], errors.ApiErrorResponse$inboundSchema),
|
|
180
|
+
M.fail("4XX"),
|
|
181
|
+
M.fail([500, "5XX"]),
|
|
182
|
+
)(response, req, { extraFields: responseFields });
|
|
183
|
+
if (!result.ok) {
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GreenSecurityCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Cancels an existing handoff
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Cancels an existing handoff with the given QR code.
|
|
33
|
+
*
|
|
34
|
+
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
35
|
+
*/
|
|
36
|
+
export function vendorsCancelHandoff(
|
|
37
|
+
client: GreenSecurityCore,
|
|
38
|
+
request: operations.CancelHandoffRequestBody,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.CancelHandoffVendorCancelOk,
|
|
43
|
+
| errors.ApiErrorResponse
|
|
44
|
+
| GreenSecurityError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: GreenSecurityCore,
|
|
63
|
+
request: operations.CancelHandoffRequestBody,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
operations.CancelHandoffVendorCancelOk,
|
|
69
|
+
| errors.ApiErrorResponse
|
|
70
|
+
| GreenSecurityError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) => operations.CancelHandoffRequestBody$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
92
|
+
|
|
93
|
+
const path = pathToFunc("/vendors/handoffs/cancel")();
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
"Content-Type": "application/json",
|
|
97
|
+
Accept: "application/json",
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
options: client._options,
|
|
105
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
106
|
+
operationID: "cancelHandoff",
|
|
107
|
+
oAuth2Scopes: null,
|
|
108
|
+
|
|
109
|
+
resolvedSecurity: requestSecurity,
|
|
110
|
+
|
|
111
|
+
securitySource: client._options.security,
|
|
112
|
+
retryConfig: options?.retries
|
|
113
|
+
|| client._options.retryConfig
|
|
114
|
+
|| { strategy: "none" },
|
|
115
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const requestRes = client._createRequest(context, {
|
|
119
|
+
security: requestSecurity,
|
|
120
|
+
method: "POST",
|
|
121
|
+
baseURL: options?.serverURL,
|
|
122
|
+
path: path,
|
|
123
|
+
headers: headers,
|
|
124
|
+
body: body,
|
|
125
|
+
userAgent: client._options.userAgent,
|
|
126
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
127
|
+
}, options);
|
|
128
|
+
if (!requestRes.ok) {
|
|
129
|
+
return [requestRes, { status: "invalid" }];
|
|
130
|
+
}
|
|
131
|
+
const req = requestRes.value;
|
|
132
|
+
|
|
133
|
+
const doResult = await client._do(req, {
|
|
134
|
+
context,
|
|
135
|
+
errorCodes: ["400", "401", "422", "4XX", "500", "5XX"],
|
|
136
|
+
retryConfig: context.retryConfig,
|
|
137
|
+
retryCodes: context.retryCodes,
|
|
138
|
+
});
|
|
139
|
+
if (!doResult.ok) {
|
|
140
|
+
return [doResult, { status: "request-error", request: req }];
|
|
141
|
+
}
|
|
142
|
+
const response = doResult.value;
|
|
143
|
+
|
|
144
|
+
const responseFields = {
|
|
145
|
+
HttpMeta: { Response: response, Request: req },
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const [result] = await M.match<
|
|
149
|
+
operations.CancelHandoffVendorCancelOk,
|
|
150
|
+
| errors.ApiErrorResponse
|
|
151
|
+
| GreenSecurityError
|
|
152
|
+
| ResponseValidationError
|
|
153
|
+
| ConnectionError
|
|
154
|
+
| RequestAbortedError
|
|
155
|
+
| RequestTimeoutError
|
|
156
|
+
| InvalidRequestError
|
|
157
|
+
| UnexpectedClientError
|
|
158
|
+
| SDKValidationError
|
|
159
|
+
>(
|
|
160
|
+
M.json(200, operations.CancelHandoffVendorCancelOk$inboundSchema),
|
|
161
|
+
M.jsonErr([400, 401, 422], errors.ApiErrorResponse$inboundSchema),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail([500, "5XX"]),
|
|
164
|
+
)(response, req, { extraFields: responseFields });
|
|
165
|
+
if (!result.ok) {
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "0.0.11",
|
|
83
|
-
sdkVersion: "0.43.1-beta.
|
|
84
|
-
genVersion: "2.879.
|
|
83
|
+
sdkVersion: "0.43.1-beta.112",
|
|
84
|
+
genVersion: "2.879.6",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.43.1-beta.
|
|
86
|
+
"speakeasy-sdk/typescript 0.43.1-beta.112 2.879.6 0.0.11 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|
|
@@ -33,7 +33,6 @@ export type Alert = {
|
|
|
33
33
|
plainText?: string | null | undefined;
|
|
34
34
|
viewed?: boolean | null | undefined;
|
|
35
35
|
dateViewed?: string | null | undefined;
|
|
36
|
-
closeButtonText?: string | null | undefined;
|
|
37
36
|
};
|
|
38
37
|
|
|
39
38
|
/** @internal */
|
|
@@ -54,7 +53,6 @@ export const Alert$inboundSchema: z.ZodType<Alert, z.ZodTypeDef, unknown> = z
|
|
|
54
53
|
plain_text: z.nullable(types.string()).optional(),
|
|
55
54
|
viewed: z.nullable(types.boolean()).optional(),
|
|
56
55
|
date_viewed: z.nullable(types.string()).optional(),
|
|
57
|
-
close_button_text: z.nullable(types.string()).optional(),
|
|
58
56
|
}).transform((v) => {
|
|
59
57
|
return remap$(v, {
|
|
60
58
|
"alert_target_id": "alertTargetId",
|
|
@@ -62,7 +60,6 @@ export const Alert$inboundSchema: z.ZodType<Alert, z.ZodTypeDef, unknown> = z
|
|
|
62
60
|
"date_starts": "dateStarts",
|
|
63
61
|
"plain_text": "plainText",
|
|
64
62
|
"date_viewed": "dateViewed",
|
|
65
|
-
"close_button_text": "closeButtonText",
|
|
66
63
|
});
|
|
67
64
|
});
|
|
68
65
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type CancelHandoffRequestBody = {
|
|
13
|
+
qrCode: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The request was successful.
|
|
18
|
+
*/
|
|
19
|
+
export type CancelHandoffVendorCancelOk = {
|
|
20
|
+
success: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type CancelHandoffRequestBody$Outbound = {
|
|
25
|
+
qr_code: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const CancelHandoffRequestBody$outboundSchema: z.ZodType<
|
|
30
|
+
CancelHandoffRequestBody$Outbound,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
CancelHandoffRequestBody
|
|
33
|
+
> = z.object({
|
|
34
|
+
qrCode: z.string(),
|
|
35
|
+
}).transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
qrCode: "qr_code",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export function cancelHandoffRequestBodyToJSON(
|
|
42
|
+
cancelHandoffRequestBody: CancelHandoffRequestBody,
|
|
43
|
+
): string {
|
|
44
|
+
return JSON.stringify(
|
|
45
|
+
CancelHandoffRequestBody$outboundSchema.parse(cancelHandoffRequestBody),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const CancelHandoffVendorCancelOk$inboundSchema: z.ZodType<
|
|
51
|
+
CancelHandoffVendorCancelOk,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
unknown
|
|
54
|
+
> = z.object({
|
|
55
|
+
success: types.boolean(),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function cancelHandoffVendorCancelOkFromJSON(
|
|
59
|
+
jsonString: string,
|
|
60
|
+
): SafeParseResult<CancelHandoffVendorCancelOk, SDKValidationError> {
|
|
61
|
+
return safeParse(
|
|
62
|
+
jsonString,
|
|
63
|
+
(x) => CancelHandoffVendorCancelOk$inboundSchema.parse(JSON.parse(x)),
|
|
64
|
+
`Failed to parse 'CancelHandoffVendorCancelOk' from JSON`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const QueryParamStatus = {
|
|
10
|
+
Pending: "pending",
|
|
11
|
+
Authorized: "authorized",
|
|
12
|
+
Captured: "captured",
|
|
13
|
+
Refunded: "refunded",
|
|
14
|
+
RefundedToCredits: "refunded to credits",
|
|
15
|
+
Voided: "voided",
|
|
16
|
+
Waived: "waived",
|
|
17
|
+
Overdue: "overdue",
|
|
18
|
+
Paid: "paid",
|
|
19
|
+
Unpaid: "unpaid",
|
|
20
|
+
PaidByCredits: "paid by credits",
|
|
21
|
+
PaidByCreditCard: "paid by credit card",
|
|
22
|
+
PaidByCheck: "paid by check",
|
|
23
|
+
PaidByShareback: "paid by shareback",
|
|
24
|
+
PaidByPo: "paid by po",
|
|
25
|
+
PaidByOtherMeans: "paid by other means",
|
|
26
|
+
Credited: "credited",
|
|
27
|
+
} as const;
|
|
28
|
+
export type QueryParamStatus = ClosedEnum<typeof QueryParamStatus>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* When set to `credentialing`, only invoices with a credentialing product line item are considered.
|
|
32
|
+
*/
|
|
33
|
+
export const ProductType = {
|
|
34
|
+
Credentialing: "credentialing",
|
|
35
|
+
} as const;
|
|
36
|
+
/**
|
|
37
|
+
* When set to `credentialing`, only invoices with a credentialing product line item are considered.
|
|
38
|
+
*/
|
|
39
|
+
export type ProductType = ClosedEnum<typeof ProductType>;
|
|
40
|
+
|
|
41
|
+
export type GetInvoiceRequest = {
|
|
42
|
+
/**
|
|
43
|
+
* Comma-separated list of invoice financial statuses to match.
|
|
44
|
+
*/
|
|
45
|
+
status: Array<QueryParamStatus>;
|
|
46
|
+
/**
|
|
47
|
+
* When set to `credentialing`, only invoices with a credentialing product line item are considered.
|
|
48
|
+
*/
|
|
49
|
+
productType?: ProductType | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Scope to a specific vendor ID. Use `me` for the authenticated vendor. Cannot be combined with `company_id`, `facility_id`, or `system_id`.
|
|
52
|
+
*/
|
|
53
|
+
vendorId?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Scope to a specific authorized company ID. Cannot be combined with `vendor_id`, `facility_id`, or `system_id`.
|
|
56
|
+
*/
|
|
57
|
+
companyId?: number | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Scope to a specific authorized facility ID. Cannot be combined with `vendor_id`, `company_id`, or `system_id`.
|
|
60
|
+
*/
|
|
61
|
+
facilityId?: number | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Scope to a specific authorized system ID. Cannot be combined with `vendor_id`, `company_id`, or `facility_id`.
|
|
64
|
+
*/
|
|
65
|
+
systemId?: number | undefined;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const QueryParamStatus$outboundSchema: z.ZodNativeEnum<
|
|
70
|
+
typeof QueryParamStatus
|
|
71
|
+
> = z.nativeEnum(QueryParamStatus);
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const ProductType$outboundSchema: z.ZodNativeEnum<typeof ProductType> = z
|
|
75
|
+
.nativeEnum(ProductType);
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export type GetInvoiceRequest$Outbound = {
|
|
79
|
+
status: Array<string>;
|
|
80
|
+
product_type?: string | undefined;
|
|
81
|
+
vendor_id?: string | undefined;
|
|
82
|
+
company_id?: number | undefined;
|
|
83
|
+
facility_id?: number | undefined;
|
|
84
|
+
system_id?: number | undefined;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const GetInvoiceRequest$outboundSchema: z.ZodType<
|
|
89
|
+
GetInvoiceRequest$Outbound,
|
|
90
|
+
z.ZodTypeDef,
|
|
91
|
+
GetInvoiceRequest
|
|
92
|
+
> = z.object({
|
|
93
|
+
status: z.array(QueryParamStatus$outboundSchema),
|
|
94
|
+
productType: ProductType$outboundSchema.optional(),
|
|
95
|
+
vendorId: z.string().optional(),
|
|
96
|
+
companyId: z.number().int().optional(),
|
|
97
|
+
facilityId: z.number().int().optional(),
|
|
98
|
+
systemId: z.number().int().optional(),
|
|
99
|
+
}).transform((v) => {
|
|
100
|
+
return remap$(v, {
|
|
101
|
+
productType: "product_type",
|
|
102
|
+
vendorId: "vendor_id",
|
|
103
|
+
companyId: "company_id",
|
|
104
|
+
facilityId: "facility_id",
|
|
105
|
+
systemId: "system_id",
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
export function getInvoiceRequestToJSON(
|
|
110
|
+
getInvoiceRequest: GetInvoiceRequest,
|
|
111
|
+
): string {
|
|
112
|
+
return JSON.stringify(
|
|
113
|
+
GetInvoiceRequest$outboundSchema.parse(getInvoiceRequest),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -10,6 +10,7 @@ export * from "./addmobiledevice.js";
|
|
|
10
10
|
export * from "./addvendorcredentialfile.js";
|
|
11
11
|
export * from "./addvendormanagedbycompany.js";
|
|
12
12
|
export * from "./calculatesubscriptionprice.js";
|
|
13
|
+
export * from "./cancelhandoff.js";
|
|
13
14
|
export * from "./changepassword.js";
|
|
14
15
|
export * from "./changesubscription.js";
|
|
15
16
|
export * from "./checkdownloadcode.js";
|
|
@@ -33,6 +34,7 @@ export * from "./getcompany.js";
|
|
|
33
34
|
export * from "./getcurrentuser.js";
|
|
34
35
|
export * from "./getfacility.js";
|
|
35
36
|
export * from "./getfhirconfig.js";
|
|
37
|
+
export * from "./getinvoice.js";
|
|
36
38
|
export * from "./getinvoicesexportstatus.js";
|
|
37
39
|
export * from "./getlinkedusers.js";
|
|
38
40
|
export * from "./getnextscreeningquestion.js";
|
package/src/react-query/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * from "./fhirConfigsListOfFhirConfigurations.js";
|
|
|
31
31
|
export * from "./fhirConfigsUpdateFhirConfigById.js";
|
|
32
32
|
export * from "./invoicesCreateInvoice.js";
|
|
33
33
|
export * from "./invoicesDownloadInvoicesExport.js";
|
|
34
|
+
export * from "./invoicesGetInvoice.js";
|
|
34
35
|
export * from "./invoicesGetInvoicesExportStatus.js";
|
|
35
36
|
export * from "./invoicesInvoicesExport.js";
|
|
36
37
|
export * from "./invoicesListInvoices.js";
|
|
@@ -61,6 +62,7 @@ export * from "./vendorsAcceptVendorCredential.js";
|
|
|
61
62
|
export * from "./vendorsAddVendorCredentialFile.js";
|
|
62
63
|
export * from "./vendorsAddVendorManagedByCompany.js";
|
|
63
64
|
export * from "./vendorsCalculateSubscriptionPrice.js";
|
|
65
|
+
export * from "./vendorsCancelHandoff.js";
|
|
64
66
|
export * from "./vendorScansGetNextScreeningQuestion.js";
|
|
65
67
|
export * from "./vendorScansSubmitScreeningResponse.js";
|
|
66
68
|
export * from "./vendorScansVendorScanOut.js";
|