@greensecurity/javascript-sdk 0.40.8-beta.2 → 0.40.8-beta.21
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 +9 -0
- package/dist/commonjs/__tests__/alerts.test.d.ts +2 -0
- package/dist/commonjs/__tests__/alerts.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/alerts.test.js +51 -0
- package/dist/commonjs/__tests__/alerts.test.js.map +1 -0
- package/dist/commonjs/__tests__/zones.test.js +4 -28
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/alertsListAlerts.d.ts +21 -0
- package/dist/commonjs/funcs/alertsListAlerts.d.ts.map +1 -0
- package/dist/commonjs/funcs/alertsListAlerts.js +154 -0
- package/dist/commonjs/funcs/alertsListAlerts.js.map +1 -0
- package/dist/commonjs/funcs/alertsUpdateUserAlerts.d.ts +18 -0
- package/dist/commonjs/funcs/alertsUpdateUserAlerts.d.ts.map +1 -0
- package/dist/commonjs/funcs/alertsUpdateUserAlerts.js +117 -0
- package/dist/commonjs/funcs/alertsUpdateUserAlerts.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/components/alert.d.ts +79 -0
- package/dist/commonjs/models/components/alert.d.ts.map +1 -0
- package/dist/commonjs/models/components/alert.js +123 -0
- package/dist/commonjs/models/components/alert.js.map +1 -0
- package/dist/commonjs/models/components/facilitycalendarsummary.d.ts +66 -0
- package/dist/commonjs/models/components/facilitycalendarsummary.d.ts.map +1 -0
- package/dist/commonjs/models/components/facilitycalendarsummary.js +126 -0
- package/dist/commonjs/models/components/facilitycalendarsummary.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/userlocation.d.ts +1 -5
- package/dist/commonjs/models/components/userlocation.d.ts.map +1 -1
- package/dist/commonjs/models/components/userlocation.js +2 -3
- package/dist/commonjs/models/components/userlocation.js.map +1 -1
- package/dist/commonjs/models/components/vendor.d.ts +3 -2
- package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendor.js +3 -2
- package/dist/commonjs/models/components/vendor.js.map +1 -1
- 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/models/operations/listalerts.d.ts +106 -0
- package/dist/commonjs/models/operations/listalerts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listalerts.js +149 -0
- package/dist/commonjs/models/operations/listalerts.js.map +1 -0
- package/dist/commonjs/models/operations/updateuseralerts.d.ts +57 -0
- package/dist/commonjs/models/operations/updateuseralerts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updateuseralerts.js +105 -0
- package/dist/commonjs/models/operations/updateuseralerts.js.map +1 -0
- package/dist/commonjs/react-query/alertsListAlerts.d.ts +75 -0
- package/dist/commonjs/react-query/alertsListAlerts.d.ts.map +1 -0
- package/dist/commonjs/react-query/alertsListAlerts.js +150 -0
- package/dist/commonjs/react-query/alertsListAlerts.js.map +1 -0
- package/dist/commonjs/react-query/alertsUpdateUserAlerts.d.ts +23 -0
- package/dist/commonjs/react-query/alertsUpdateUserAlerts.d.ts.map +1 -0
- package/dist/commonjs/react-query/alertsUpdateUserAlerts.js +47 -0
- package/dist/commonjs/react-query/alertsUpdateUserAlerts.js.map +1 -0
- 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/sdk/alerts.d.ts +22 -0
- package/dist/commonjs/sdk/alerts.d.ts.map +1 -0
- package/dist/commonjs/sdk/alerts.js +33 -0
- package/dist/commonjs/sdk/alerts.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/__tests__/alerts.test.d.ts +2 -0
- package/dist/esm/__tests__/alerts.test.d.ts.map +1 -0
- package/dist/esm/__tests__/alerts.test.js +49 -0
- package/dist/esm/__tests__/alerts.test.js.map +1 -0
- package/dist/esm/__tests__/zones.test.js +4 -28
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/alertsListAlerts.d.ts +21 -0
- package/dist/esm/funcs/alertsListAlerts.d.ts.map +1 -0
- package/dist/esm/funcs/alertsListAlerts.js +118 -0
- package/dist/esm/funcs/alertsListAlerts.js.map +1 -0
- package/dist/esm/funcs/alertsUpdateUserAlerts.d.ts +18 -0
- package/dist/esm/funcs/alertsUpdateUserAlerts.d.ts.map +1 -0
- package/dist/esm/funcs/alertsUpdateUserAlerts.js +81 -0
- package/dist/esm/funcs/alertsUpdateUserAlerts.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/components/alert.d.ts +79 -0
- package/dist/esm/models/components/alert.d.ts.map +1 -0
- package/dist/esm/models/components/alert.js +85 -0
- package/dist/esm/models/components/alert.js.map +1 -0
- package/dist/esm/models/components/facilitycalendarsummary.d.ts +66 -0
- package/dist/esm/models/components/facilitycalendarsummary.d.ts.map +1 -0
- package/dist/esm/models/components/facilitycalendarsummary.js +86 -0
- package/dist/esm/models/components/facilitycalendarsummary.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/userlocation.d.ts +1 -5
- package/dist/esm/models/components/userlocation.d.ts.map +1 -1
- package/dist/esm/models/components/userlocation.js +2 -3
- package/dist/esm/models/components/userlocation.js.map +1 -1
- package/dist/esm/models/components/vendor.d.ts +3 -2
- package/dist/esm/models/components/vendor.d.ts.map +1 -1
- package/dist/esm/models/components/vendor.js +3 -2
- package/dist/esm/models/components/vendor.js.map +1 -1
- 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/models/operations/listalerts.d.ts +106 -0
- package/dist/esm/models/operations/listalerts.d.ts.map +1 -0
- package/dist/esm/models/operations/listalerts.js +107 -0
- package/dist/esm/models/operations/listalerts.js.map +1 -0
- package/dist/esm/models/operations/updateuseralerts.d.ts +57 -0
- package/dist/esm/models/operations/updateuseralerts.d.ts.map +1 -0
- package/dist/esm/models/operations/updateuseralerts.js +65 -0
- package/dist/esm/models/operations/updateuseralerts.js.map +1 -0
- package/dist/esm/react-query/alertsListAlerts.d.ts +75 -0
- package/dist/esm/react-query/alertsListAlerts.d.ts.map +1 -0
- package/dist/esm/react-query/alertsListAlerts.js +137 -0
- package/dist/esm/react-query/alertsListAlerts.js.map +1 -0
- package/dist/esm/react-query/alertsUpdateUserAlerts.d.ts +23 -0
- package/dist/esm/react-query/alertsUpdateUserAlerts.d.ts.map +1 -0
- package/dist/esm/react-query/alertsUpdateUserAlerts.js +42 -0
- package/dist/esm/react-query/alertsUpdateUserAlerts.js.map +1 -0
- 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/sdk/alerts.d.ts +22 -0
- package/dist/esm/sdk/alerts.d.ts.map +1 -0
- package/dist/esm/sdk/alerts.js +29 -0
- package/dist/esm/sdk/alerts.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/examples/vendorsCreateVendorRegistration.example.ts +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/alerts.test.ts +55 -0
- package/src/__tests__/zones.test.ts +4 -28
- package/src/funcs/alertsListAlerts.ts +245 -0
- package/src/funcs/alertsUpdateUserAlerts.ts +170 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/alert.ts +141 -0
- package/src/models/components/facilitycalendarsummary.ts +182 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/userlocation.ts +3 -7
- package/src/models/components/vendor.ts +13 -4
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listalerts.ts +234 -0
- package/src/models/operations/updateuseralerts.ts +140 -0
- package/src/react-query/alertsListAlerts.ts +308 -0
- package/src/react-query/alertsUpdateUserAlerts.ts +89 -0
- package/src/react-query/index.ts +2 -0
- package/src/sdk/alerts.ts +46 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -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
|
+
* Update user alerts
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Update user alerts
|
|
33
|
+
*/
|
|
34
|
+
export function alertsUpdateUserAlerts(
|
|
35
|
+
client: GreenSecurityCore,
|
|
36
|
+
request: operations.UpdateUserAlertsRequestBody,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.UpdateUserAlertsResponseBody,
|
|
41
|
+
| errors.ApiErrorResponse
|
|
42
|
+
| GreenSecurityError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: GreenSecurityCore,
|
|
61
|
+
request: operations.UpdateUserAlertsRequestBody,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.UpdateUserAlertsResponseBody,
|
|
67
|
+
| errors.ApiErrorResponse
|
|
68
|
+
| GreenSecurityError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) =>
|
|
83
|
+
operations.UpdateUserAlertsRequestBody$outboundSchema.parse(value),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/user-alerts")();
|
|
93
|
+
|
|
94
|
+
const headers = new Headers(compactMap({
|
|
95
|
+
"Content-Type": "application/json",
|
|
96
|
+
Accept: "application/json",
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
100
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
|
+
|
|
102
|
+
const context = {
|
|
103
|
+
options: client._options,
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "updateUserAlerts",
|
|
106
|
+
oAuth2Scopes: [],
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.security,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| { strategy: "none" },
|
|
114
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "PUT",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path,
|
|
122
|
+
headers: headers,
|
|
123
|
+
body: body,
|
|
124
|
+
userAgent: client._options.userAgent,
|
|
125
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
|
+
}, options);
|
|
127
|
+
if (!requestRes.ok) {
|
|
128
|
+
return [requestRes, { status: "invalid" }];
|
|
129
|
+
}
|
|
130
|
+
const req = requestRes.value;
|
|
131
|
+
|
|
132
|
+
const doResult = await client._do(req, {
|
|
133
|
+
context,
|
|
134
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
135
|
+
retryConfig: context.retryConfig,
|
|
136
|
+
retryCodes: context.retryCodes,
|
|
137
|
+
});
|
|
138
|
+
if (!doResult.ok) {
|
|
139
|
+
return [doResult, { status: "request-error", request: req }];
|
|
140
|
+
}
|
|
141
|
+
const response = doResult.value;
|
|
142
|
+
|
|
143
|
+
const responseFields = {
|
|
144
|
+
HttpMeta: { Response: response, Request: req },
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const [result] = await M.match<
|
|
148
|
+
operations.UpdateUserAlertsResponseBody,
|
|
149
|
+
| errors.ApiErrorResponse
|
|
150
|
+
| GreenSecurityError
|
|
151
|
+
| ResponseValidationError
|
|
152
|
+
| ConnectionError
|
|
153
|
+
| RequestAbortedError
|
|
154
|
+
| RequestTimeoutError
|
|
155
|
+
| InvalidRequestError
|
|
156
|
+
| UnexpectedClientError
|
|
157
|
+
| SDKValidationError
|
|
158
|
+
>(
|
|
159
|
+
M.json(200, operations.UpdateUserAlertsResponseBody$inboundSchema),
|
|
160
|
+
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
161
|
+
M.jsonErr(500, errors.ApiErrorResponse$inboundSchema),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail("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.4",
|
|
83
|
-
sdkVersion: "0.40.8-beta.
|
|
84
|
-
genVersion: "2.
|
|
83
|
+
sdkVersion: "0.40.8-beta.20",
|
|
84
|
+
genVersion: "2.701.8",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.40.8-beta.
|
|
86
|
+
"speakeasy-sdk/typescript 0.40.8-beta.20 2.701.8 0.0.4 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const Type = {
|
|
13
|
+
Error: "Error",
|
|
14
|
+
Warning: "Warning",
|
|
15
|
+
Info: "Info",
|
|
16
|
+
} as const;
|
|
17
|
+
export type Type = ClosedEnum<typeof Type>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A simplified representation of a Alert, typically used in list views.
|
|
21
|
+
*/
|
|
22
|
+
export type Alert = {
|
|
23
|
+
id?: number | undefined;
|
|
24
|
+
dateAdded?: string | null | undefined;
|
|
25
|
+
dateStarts?: string | null | undefined;
|
|
26
|
+
message?: string | null | undefined;
|
|
27
|
+
status?: string | null | undefined;
|
|
28
|
+
type?: Type | null | undefined;
|
|
29
|
+
title?: string | null | undefined;
|
|
30
|
+
plainText?: string | null | undefined;
|
|
31
|
+
viewed?: boolean | null | undefined;
|
|
32
|
+
dateViewed?: string | null | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
37
|
+
Type,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
42
|
+
Type$inboundSchema;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
47
|
+
*/
|
|
48
|
+
export namespace Type$ {
|
|
49
|
+
/** @deprecated use `Type$inboundSchema` instead. */
|
|
50
|
+
export const inboundSchema = Type$inboundSchema;
|
|
51
|
+
/** @deprecated use `Type$outboundSchema` instead. */
|
|
52
|
+
export const outboundSchema = Type$outboundSchema;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export const Alert$inboundSchema: z.ZodType<Alert, z.ZodTypeDef, unknown> = z
|
|
57
|
+
.object({
|
|
58
|
+
id: z.number().int().optional(),
|
|
59
|
+
date_added: z.nullable(z.string()).optional(),
|
|
60
|
+
date_starts: z.nullable(z.string()).optional(),
|
|
61
|
+
message: z.nullable(z.string()).optional(),
|
|
62
|
+
status: z.nullable(z.string()).optional(),
|
|
63
|
+
type: z.nullable(Type$inboundSchema).optional(),
|
|
64
|
+
title: z.nullable(z.string()).optional(),
|
|
65
|
+
plain_text: z.nullable(z.string()).optional(),
|
|
66
|
+
viewed: z.nullable(z.boolean()).optional(),
|
|
67
|
+
date_viewed: z.nullable(z.string()).optional(),
|
|
68
|
+
}).transform((v) => {
|
|
69
|
+
return remap$(v, {
|
|
70
|
+
"date_added": "dateAdded",
|
|
71
|
+
"date_starts": "dateStarts",
|
|
72
|
+
"plain_text": "plainText",
|
|
73
|
+
"date_viewed": "dateViewed",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export type Alert$Outbound = {
|
|
79
|
+
id?: number | undefined;
|
|
80
|
+
date_added?: string | null | undefined;
|
|
81
|
+
date_starts?: string | null | undefined;
|
|
82
|
+
message?: string | null | undefined;
|
|
83
|
+
status?: string | null | undefined;
|
|
84
|
+
type?: string | null | undefined;
|
|
85
|
+
title?: string | null | undefined;
|
|
86
|
+
plain_text?: string | null | undefined;
|
|
87
|
+
viewed?: boolean | null | undefined;
|
|
88
|
+
date_viewed?: string | null | undefined;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const Alert$outboundSchema: z.ZodType<
|
|
93
|
+
Alert$Outbound,
|
|
94
|
+
z.ZodTypeDef,
|
|
95
|
+
Alert
|
|
96
|
+
> = z.object({
|
|
97
|
+
id: z.number().int().optional(),
|
|
98
|
+
dateAdded: z.nullable(z.string()).optional(),
|
|
99
|
+
dateStarts: z.nullable(z.string()).optional(),
|
|
100
|
+
message: z.nullable(z.string()).optional(),
|
|
101
|
+
status: z.nullable(z.string()).optional(),
|
|
102
|
+
type: z.nullable(Type$outboundSchema).optional(),
|
|
103
|
+
title: z.nullable(z.string()).optional(),
|
|
104
|
+
plainText: z.nullable(z.string()).optional(),
|
|
105
|
+
viewed: z.nullable(z.boolean()).optional(),
|
|
106
|
+
dateViewed: z.nullable(z.string()).optional(),
|
|
107
|
+
}).transform((v) => {
|
|
108
|
+
return remap$(v, {
|
|
109
|
+
dateAdded: "date_added",
|
|
110
|
+
dateStarts: "date_starts",
|
|
111
|
+
plainText: "plain_text",
|
|
112
|
+
dateViewed: "date_viewed",
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
119
|
+
*/
|
|
120
|
+
export namespace Alert$ {
|
|
121
|
+
/** @deprecated use `Alert$inboundSchema` instead. */
|
|
122
|
+
export const inboundSchema = Alert$inboundSchema;
|
|
123
|
+
/** @deprecated use `Alert$outboundSchema` instead. */
|
|
124
|
+
export const outboundSchema = Alert$outboundSchema;
|
|
125
|
+
/** @deprecated use `Alert$Outbound` instead. */
|
|
126
|
+
export type Outbound = Alert$Outbound;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function alertToJSON(alert: Alert): string {
|
|
130
|
+
return JSON.stringify(Alert$outboundSchema.parse(alert));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function alertFromJSON(
|
|
134
|
+
jsonString: string,
|
|
135
|
+
): SafeParseResult<Alert, SDKValidationError> {
|
|
136
|
+
return safeParse(
|
|
137
|
+
jsonString,
|
|
138
|
+
(x) => Alert$inboundSchema.parse(JSON.parse(x)),
|
|
139
|
+
`Failed to parse 'Alert' from JSON`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
FacilityVendorType,
|
|
12
|
+
FacilityVendorType$inboundSchema,
|
|
13
|
+
FacilityVendorType$Outbound,
|
|
14
|
+
FacilityVendorType$outboundSchema,
|
|
15
|
+
} from "./facilityvendortype.js";
|
|
16
|
+
|
|
17
|
+
export type FacilityCalendarSummaryVendorPolicy = {
|
|
18
|
+
vendorTypes?: Array<FacilityVendorType> | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* FacilitySummary extended with appointment options for calendaring.
|
|
23
|
+
*/
|
|
24
|
+
export type FacilityCalendarSummary = {
|
|
25
|
+
id?: number | undefined;
|
|
26
|
+
name?: string | undefined;
|
|
27
|
+
vendorPolicy?: FacilityCalendarSummaryVendorPolicy | null | undefined;
|
|
28
|
+
allowUserAppointments?: boolean | undefined;
|
|
29
|
+
allowDeptAppointments?: boolean | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const FacilityCalendarSummaryVendorPolicy$inboundSchema: z.ZodType<
|
|
34
|
+
FacilityCalendarSummaryVendorPolicy,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
unknown
|
|
37
|
+
> = z.object({
|
|
38
|
+
vendor_types: z.array(FacilityVendorType$inboundSchema).optional(),
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
"vendor_types": "vendorTypes",
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export type FacilityCalendarSummaryVendorPolicy$Outbound = {
|
|
47
|
+
vendor_types?: Array<FacilityVendorType$Outbound> | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const FacilityCalendarSummaryVendorPolicy$outboundSchema: z.ZodType<
|
|
52
|
+
FacilityCalendarSummaryVendorPolicy$Outbound,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
FacilityCalendarSummaryVendorPolicy
|
|
55
|
+
> = z.object({
|
|
56
|
+
vendorTypes: z.array(FacilityVendorType$outboundSchema).optional(),
|
|
57
|
+
}).transform((v) => {
|
|
58
|
+
return remap$(v, {
|
|
59
|
+
vendorTypes: "vendor_types",
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
66
|
+
*/
|
|
67
|
+
export namespace FacilityCalendarSummaryVendorPolicy$ {
|
|
68
|
+
/** @deprecated use `FacilityCalendarSummaryVendorPolicy$inboundSchema` instead. */
|
|
69
|
+
export const inboundSchema =
|
|
70
|
+
FacilityCalendarSummaryVendorPolicy$inboundSchema;
|
|
71
|
+
/** @deprecated use `FacilityCalendarSummaryVendorPolicy$outboundSchema` instead. */
|
|
72
|
+
export const outboundSchema =
|
|
73
|
+
FacilityCalendarSummaryVendorPolicy$outboundSchema;
|
|
74
|
+
/** @deprecated use `FacilityCalendarSummaryVendorPolicy$Outbound` instead. */
|
|
75
|
+
export type Outbound = FacilityCalendarSummaryVendorPolicy$Outbound;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function facilityCalendarSummaryVendorPolicyToJSON(
|
|
79
|
+
facilityCalendarSummaryVendorPolicy: FacilityCalendarSummaryVendorPolicy,
|
|
80
|
+
): string {
|
|
81
|
+
return JSON.stringify(
|
|
82
|
+
FacilityCalendarSummaryVendorPolicy$outboundSchema.parse(
|
|
83
|
+
facilityCalendarSummaryVendorPolicy,
|
|
84
|
+
),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function facilityCalendarSummaryVendorPolicyFromJSON(
|
|
89
|
+
jsonString: string,
|
|
90
|
+
): SafeParseResult<FacilityCalendarSummaryVendorPolicy, SDKValidationError> {
|
|
91
|
+
return safeParse(
|
|
92
|
+
jsonString,
|
|
93
|
+
(x) =>
|
|
94
|
+
FacilityCalendarSummaryVendorPolicy$inboundSchema.parse(JSON.parse(x)),
|
|
95
|
+
`Failed to parse 'FacilityCalendarSummaryVendorPolicy' from JSON`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const FacilityCalendarSummary$inboundSchema: z.ZodType<
|
|
101
|
+
FacilityCalendarSummary,
|
|
102
|
+
z.ZodTypeDef,
|
|
103
|
+
unknown
|
|
104
|
+
> = z.object({
|
|
105
|
+
id: z.number().int().optional(),
|
|
106
|
+
name: z.string().optional(),
|
|
107
|
+
vendor_policy: z.nullable(
|
|
108
|
+
z.lazy(() => FacilityCalendarSummaryVendorPolicy$inboundSchema),
|
|
109
|
+
).optional(),
|
|
110
|
+
allow_user_appointments: z.boolean().optional(),
|
|
111
|
+
allow_dept_appointments: z.boolean().optional(),
|
|
112
|
+
}).transform((v) => {
|
|
113
|
+
return remap$(v, {
|
|
114
|
+
"vendor_policy": "vendorPolicy",
|
|
115
|
+
"allow_user_appointments": "allowUserAppointments",
|
|
116
|
+
"allow_dept_appointments": "allowDeptAppointments",
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
/** @internal */
|
|
121
|
+
export type FacilityCalendarSummary$Outbound = {
|
|
122
|
+
id?: number | undefined;
|
|
123
|
+
name?: string | undefined;
|
|
124
|
+
vendor_policy?:
|
|
125
|
+
| FacilityCalendarSummaryVendorPolicy$Outbound
|
|
126
|
+
| null
|
|
127
|
+
| undefined;
|
|
128
|
+
allow_user_appointments?: boolean | undefined;
|
|
129
|
+
allow_dept_appointments?: boolean | undefined;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/** @internal */
|
|
133
|
+
export const FacilityCalendarSummary$outboundSchema: z.ZodType<
|
|
134
|
+
FacilityCalendarSummary$Outbound,
|
|
135
|
+
z.ZodTypeDef,
|
|
136
|
+
FacilityCalendarSummary
|
|
137
|
+
> = z.object({
|
|
138
|
+
id: z.number().int().optional(),
|
|
139
|
+
name: z.string().optional(),
|
|
140
|
+
vendorPolicy: z.nullable(
|
|
141
|
+
z.lazy(() => FacilityCalendarSummaryVendorPolicy$outboundSchema),
|
|
142
|
+
).optional(),
|
|
143
|
+
allowUserAppointments: z.boolean().optional(),
|
|
144
|
+
allowDeptAppointments: z.boolean().optional(),
|
|
145
|
+
}).transform((v) => {
|
|
146
|
+
return remap$(v, {
|
|
147
|
+
vendorPolicy: "vendor_policy",
|
|
148
|
+
allowUserAppointments: "allow_user_appointments",
|
|
149
|
+
allowDeptAppointments: "allow_dept_appointments",
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @internal
|
|
155
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
156
|
+
*/
|
|
157
|
+
export namespace FacilityCalendarSummary$ {
|
|
158
|
+
/** @deprecated use `FacilityCalendarSummary$inboundSchema` instead. */
|
|
159
|
+
export const inboundSchema = FacilityCalendarSummary$inboundSchema;
|
|
160
|
+
/** @deprecated use `FacilityCalendarSummary$outboundSchema` instead. */
|
|
161
|
+
export const outboundSchema = FacilityCalendarSummary$outboundSchema;
|
|
162
|
+
/** @deprecated use `FacilityCalendarSummary$Outbound` instead. */
|
|
163
|
+
export type Outbound = FacilityCalendarSummary$Outbound;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function facilityCalendarSummaryToJSON(
|
|
167
|
+
facilityCalendarSummary: FacilityCalendarSummary,
|
|
168
|
+
): string {
|
|
169
|
+
return JSON.stringify(
|
|
170
|
+
FacilityCalendarSummary$outboundSchema.parse(facilityCalendarSummary),
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function facilityCalendarSummaryFromJSON(
|
|
175
|
+
jsonString: string,
|
|
176
|
+
): SafeParseResult<FacilityCalendarSummary, SDKValidationError> {
|
|
177
|
+
return safeParse(
|
|
178
|
+
jsonString,
|
|
179
|
+
(x) => FacilityCalendarSummary$inboundSchema.parse(JSON.parse(x)),
|
|
180
|
+
`Failed to parse 'FacilityCalendarSummary' from JSON`,
|
|
181
|
+
);
|
|
182
|
+
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export * from "./activestatus.js";
|
|
6
|
+
export * from "./alert.js";
|
|
6
7
|
export * from "./backgroundcheckresult.js";
|
|
7
8
|
export * from "./company.js";
|
|
8
9
|
export * from "./companyvendortyperestriction.js";
|
|
@@ -20,6 +21,7 @@ export * from "./departmentsummary.js";
|
|
|
20
21
|
export * from "./desc.js";
|
|
21
22
|
export * from "./expand.js";
|
|
22
23
|
export * from "./facility.js";
|
|
24
|
+
export * from "./facilitycalendarsummary.js";
|
|
23
25
|
export * from "./facilitystatus.js";
|
|
24
26
|
export * from "./facilitysummary.js";
|
|
25
27
|
export * from "./facilityvendortype.js";
|
|
@@ -8,7 +8,6 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
-
import { State, State$inboundSchema, State$outboundSchema } from "./state.js";
|
|
12
11
|
|
|
13
12
|
export const Timezone = {
|
|
14
13
|
InternationalDateLineWest: "International Date Line West",
|
|
@@ -173,10 +172,7 @@ export type UserLocation = {
|
|
|
173
172
|
address1?: string | null | undefined;
|
|
174
173
|
address2?: string | null | undefined;
|
|
175
174
|
city?: string | null | undefined;
|
|
176
|
-
|
|
177
|
-
* The list of states
|
|
178
|
-
*/
|
|
179
|
-
state?: State | null | undefined;
|
|
175
|
+
state?: string | null | undefined;
|
|
180
176
|
zip?: string | null | undefined;
|
|
181
177
|
phone?: string | null | undefined;
|
|
182
178
|
mobilePhone?: string | null | undefined;
|
|
@@ -214,7 +210,7 @@ export const UserLocation$inboundSchema: z.ZodType<
|
|
|
214
210
|
address1: z.nullable(z.string()).optional(),
|
|
215
211
|
address2: z.nullable(z.string()).optional(),
|
|
216
212
|
city: z.nullable(z.string()).optional(),
|
|
217
|
-
state: z.nullable(
|
|
213
|
+
state: z.nullable(z.string()).optional(),
|
|
218
214
|
zip: z.nullable(z.string()).optional(),
|
|
219
215
|
phone: z.nullable(z.string()).optional(),
|
|
220
216
|
mobile_phone: z.nullable(z.string()).optional(),
|
|
@@ -252,7 +248,7 @@ export const UserLocation$outboundSchema: z.ZodType<
|
|
|
252
248
|
address1: z.nullable(z.string()).optional(),
|
|
253
249
|
address2: z.nullable(z.string()).optional(),
|
|
254
250
|
city: z.nullable(z.string()).optional(),
|
|
255
|
-
state: z.nullable(
|
|
251
|
+
state: z.nullable(z.string()).optional(),
|
|
256
252
|
zip: z.nullable(z.string()).optional(),
|
|
257
253
|
phone: z.nullable(z.string()).optional(),
|
|
258
254
|
mobilePhone: z.nullable(z.string()).optional(),
|
|
@@ -25,6 +25,12 @@ import {
|
|
|
25
25
|
Facility$Outbound,
|
|
26
26
|
Facility$outboundSchema,
|
|
27
27
|
} from "./facility.js";
|
|
28
|
+
import {
|
|
29
|
+
FacilityCalendarSummary,
|
|
30
|
+
FacilityCalendarSummary$inboundSchema,
|
|
31
|
+
FacilityCalendarSummary$Outbound,
|
|
32
|
+
FacilityCalendarSummary$outboundSchema,
|
|
33
|
+
} from "./facilitycalendarsummary.js";
|
|
28
34
|
import {
|
|
29
35
|
FacilitySummary,
|
|
30
36
|
FacilitySummary$inboundSchema,
|
|
@@ -220,7 +226,10 @@ export type Vendor = {
|
|
|
220
226
|
backgroundCheckDateExpires?: string | null | undefined;
|
|
221
227
|
creditBalance?: number | null | undefined;
|
|
222
228
|
targetFacilities?: Array<FacilitySummary> | null | undefined;
|
|
223
|
-
approvedCalendaringFacilities?:
|
|
229
|
+
approvedCalendaringFacilities?:
|
|
230
|
+
| Array<FacilityCalendarSummary>
|
|
231
|
+
| null
|
|
232
|
+
| undefined;
|
|
224
233
|
pendingInvoice?: Invoice | number | null | undefined;
|
|
225
234
|
vendorGroups?: Array<VendorGroup | null> | null | undefined;
|
|
226
235
|
hasCredentialedFacilities?: boolean | null | undefined;
|
|
@@ -1089,7 +1098,7 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
|
|
|
1089
1098
|
target_facilities: z.nullable(z.array(FacilitySummary$inboundSchema))
|
|
1090
1099
|
.optional(),
|
|
1091
1100
|
approved_calendaring_facilities: z.nullable(
|
|
1092
|
-
z.array(
|
|
1101
|
+
z.array(FacilityCalendarSummary$inboundSchema),
|
|
1093
1102
|
).optional(),
|
|
1094
1103
|
pending_invoice: z.nullable(
|
|
1095
1104
|
z.union([Invoice$inboundSchema, z.number().int()]),
|
|
@@ -1158,7 +1167,7 @@ export type Vendor$Outbound = {
|
|
|
1158
1167
|
credit_balance?: number | null | undefined;
|
|
1159
1168
|
target_facilities?: Array<FacilitySummary$Outbound> | null | undefined;
|
|
1160
1169
|
approved_calendaring_facilities?:
|
|
1161
|
-
| Array<
|
|
1170
|
+
| Array<FacilityCalendarSummary$Outbound>
|
|
1162
1171
|
| null
|
|
1163
1172
|
| undefined;
|
|
1164
1173
|
pending_invoice?: Invoice$Outbound | number | null | undefined;
|
|
@@ -1217,7 +1226,7 @@ export const Vendor$outboundSchema: z.ZodType<
|
|
|
1217
1226
|
targetFacilities: z.nullable(z.array(FacilitySummary$outboundSchema))
|
|
1218
1227
|
.optional(),
|
|
1219
1228
|
approvedCalendaringFacilities: z.nullable(
|
|
1220
|
-
z.array(
|
|
1229
|
+
z.array(FacilityCalendarSummary$outboundSchema),
|
|
1221
1230
|
).optional(),
|
|
1222
1231
|
pendingInvoice: z.nullable(
|
|
1223
1232
|
z.union([Invoice$outboundSchema, z.number().int()]),
|
|
@@ -39,6 +39,7 @@ export * from "./getvendorinvoicereceipt.js";
|
|
|
39
39
|
export * from "./getvendorlegalname.js";
|
|
40
40
|
export * from "./getvendorsdetails.js";
|
|
41
41
|
export * from "./getwebhookendpoint.js";
|
|
42
|
+
export * from "./listalerts.js";
|
|
42
43
|
export * from "./listallwebhookendpoints.js";
|
|
43
44
|
export * from "./listfeed.js";
|
|
44
45
|
export * from "./listlocations.js";
|
|
@@ -82,6 +83,7 @@ export * from "./updateevent.js";
|
|
|
82
83
|
export * from "./updatefhirconfigbyid.js";
|
|
83
84
|
export * from "./updateinvoice.js";
|
|
84
85
|
export * from "./updatesthewebhookendpointwiththegivenid.js";
|
|
86
|
+
export * from "./updateuseralerts.js";
|
|
85
87
|
export * from "./updatevendorcredentialdata.js";
|
|
86
88
|
export * from "./updatevendorcredentialfile.js";
|
|
87
89
|
export * from "./updatevendordetails.js";
|