@greensecurity/javascript-sdk 0.43.1-beta.125 → 0.43.1-beta.126
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 +3 -0
- package/dist/commonjs/__tests__/paymentprofile.test.js +13 -0
- package/dist/commonjs/__tests__/paymentprofile.test.js.map +1 -1
- package/dist/commonjs/__tests__/users.test.js +1 -0
- package/dist/commonjs/__tests__/users.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +29 -2
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- 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 +4 -25
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.d.ts +22 -0
- package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.js +113 -0
- package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.js.map +1 -0
- package/dist/commonjs/funcs/usersUpdateUserProfilePicture.d.ts +1 -1
- package/dist/commonjs/funcs/usersUpdateUserProfilePicture.js +1 -1
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +10 -6
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js +50 -12
- package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/expand.d.ts +1 -0
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +1 -0
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/facility.d.ts +4 -4
- package/dist/commonjs/models/components/facility.d.ts.map +1 -1
- package/dist/commonjs/models/components/facility.js +6 -6
- package/dist/commonjs/models/components/facility.js.map +1 -1
- package/dist/commonjs/models/components/facilitycalendarsummary.d.ts +1 -0
- package/dist/commonjs/models/components/facilitycalendarsummary.d.ts.map +1 -1
- package/dist/commonjs/models/components/facilitycalendarsummary.js +1 -0
- package/dist/commonjs/models/components/facilitycalendarsummary.js.map +1 -1
- package/dist/commonjs/models/components/facilitysummary.d.ts +1 -0
- package/dist/commonjs/models/components/facilitysummary.d.ts.map +1 -1
- package/dist/commonjs/models/components/facilitysummary.js +1 -0
- package/dist/commonjs/models/components/facilitysummary.js.map +1 -1
- package/dist/commonjs/models/components/systemsummary.d.ts +9 -0
- package/dist/commonjs/models/components/systemsummary.d.ts.map +1 -1
- package/dist/commonjs/models/components/systemsummary.js +17 -1
- package/dist/commonjs/models/components/systemsummary.js.map +1 -1
- package/dist/commonjs/models/operations/deletepaymentprofile.d.ts +11 -0
- package/dist/commonjs/models/operations/deletepaymentprofile.d.ts.map +1 -0
- package/dist/commonjs/models/operations/deletepaymentprofile.js +49 -0
- package/dist/commonjs/models/operations/deletepaymentprofile.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listlocations.d.ts +4 -4
- package/dist/commonjs/models/operations/listlocations.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listlocations.js +6 -7
- package/dist/commonjs/models/operations/listlocations.js.map +1 -1
- package/dist/commonjs/models/operations/listlookupsystems.d.ts +2 -1
- package/dist/commonjs/models/operations/listlookupsystems.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listlookupsystems.js +1 -0
- package/dist/commonjs/models/operations/listlookupsystems.js.map +1 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts +50 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js +34 -2
- package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
- package/dist/commonjs/models/operations/updateuserprofilepicture.d.ts +6 -2
- package/dist/commonjs/models/operations/updateuserprofilepicture.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateuserprofilepicture.js +5 -0
- package/dist/commonjs/models/operations/updateuserprofilepicture.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.d.ts +30 -0
- package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
- package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.js +54 -0
- package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.js.map +1 -0
- package/dist/commonjs/react-query/usersUpdateUserProfilePicture.d.ts +1 -1
- package/dist/commonjs/react-query/usersUpdateUserProfilePicture.js +1 -1
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts +26 -2
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.js +56 -2
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.js.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +67 -16
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js +66 -11
- package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/commonjs/sdk/paymentprofile.d.ts +10 -0
- package/dist/commonjs/sdk/paymentprofile.d.ts.map +1 -1
- package/dist/commonjs/sdk/paymentprofile.js +12 -0
- package/dist/commonjs/sdk/paymentprofile.js.map +1 -1
- package/dist/commonjs/sdk/users.d.ts +1 -1
- package/dist/commonjs/sdk/users.js +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +9 -6
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +7 -6
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/paymentprofile.test.js +13 -0
- package/dist/esm/__tests__/paymentprofile.test.js.map +1 -1
- package/dist/esm/__tests__/users.test.js +1 -0
- package/dist/esm/__tests__/users.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +29 -2
- package/dist/esm/__tests__/vendors.test.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 +4 -25
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/paymentProfileDeletePaymentProfile.d.ts +22 -0
- package/dist/esm/funcs/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
- package/dist/esm/funcs/paymentProfileDeletePaymentProfile.js +77 -0
- package/dist/esm/funcs/paymentProfileDeletePaymentProfile.js.map +1 -0
- package/dist/esm/funcs/usersUpdateUserProfilePicture.d.ts +1 -1
- package/dist/esm/funcs/usersUpdateUserProfilePicture.js +1 -1
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +10 -6
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js +51 -13
- package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/expand.d.ts +1 -0
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +1 -0
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/facility.d.ts +4 -4
- package/dist/esm/models/components/facility.d.ts.map +1 -1
- package/dist/esm/models/components/facility.js +4 -4
- package/dist/esm/models/components/facility.js.map +1 -1
- package/dist/esm/models/components/facilitycalendarsummary.d.ts +1 -0
- package/dist/esm/models/components/facilitycalendarsummary.d.ts.map +1 -1
- package/dist/esm/models/components/facilitycalendarsummary.js +1 -0
- package/dist/esm/models/components/facilitycalendarsummary.js.map +1 -1
- package/dist/esm/models/components/facilitysummary.d.ts +1 -0
- package/dist/esm/models/components/facilitysummary.d.ts.map +1 -1
- package/dist/esm/models/components/facilitysummary.js +1 -0
- package/dist/esm/models/components/facilitysummary.js.map +1 -1
- package/dist/esm/models/components/systemsummary.d.ts +9 -0
- package/dist/esm/models/components/systemsummary.d.ts.map +1 -1
- package/dist/esm/models/components/systemsummary.js +15 -0
- package/dist/esm/models/components/systemsummary.js.map +1 -1
- package/dist/esm/models/operations/deletepaymentprofile.d.ts +11 -0
- package/dist/esm/models/operations/deletepaymentprofile.d.ts.map +1 -0
- package/dist/esm/models/operations/deletepaymentprofile.js +12 -0
- package/dist/esm/models/operations/deletepaymentprofile.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listlocations.d.ts +4 -4
- package/dist/esm/models/operations/listlocations.d.ts.map +1 -1
- package/dist/esm/models/operations/listlocations.js +4 -5
- package/dist/esm/models/operations/listlocations.js.map +1 -1
- package/dist/esm/models/operations/listlookupsystems.d.ts +2 -1
- package/dist/esm/models/operations/listlookupsystems.d.ts.map +1 -1
- package/dist/esm/models/operations/listlookupsystems.js +1 -0
- package/dist/esm/models/operations/listlookupsystems.js.map +1 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts +50 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.js +31 -1
- package/dist/esm/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
- package/dist/esm/models/operations/updateuserprofilepicture.d.ts +6 -2
- package/dist/esm/models/operations/updateuserprofilepicture.d.ts.map +1 -1
- package/dist/esm/models/operations/updateuserprofilepicture.js +5 -0
- package/dist/esm/models/operations/updateuserprofilepicture.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/paymentProfileDeletePaymentProfile.d.ts +30 -0
- package/dist/esm/react-query/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
- package/dist/esm/react-query/paymentProfileDeletePaymentProfile.js +49 -0
- package/dist/esm/react-query/paymentProfileDeletePaymentProfile.js.map +1 -0
- package/dist/esm/react-query/usersUpdateUserProfilePicture.d.ts +1 -1
- package/dist/esm/react-query/usersUpdateUserProfilePicture.js +1 -1
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts +26 -2
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.js +53 -2
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.js.map +1 -1
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +67 -16
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js +63 -13
- package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
- package/dist/esm/sdk/paymentprofile.d.ts +10 -0
- package/dist/esm/sdk/paymentprofile.d.ts.map +1 -1
- package/dist/esm/sdk/paymentprofile.js +12 -0
- package/dist/esm/sdk/paymentprofile.js.map +1 -1
- package/dist/esm/sdk/users.d.ts +1 -1
- package/dist/esm/sdk/users.js +1 -1
- package/dist/esm/sdk/vendors.d.ts +9 -6
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +7 -6
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/paymentprofile.test.ts +16 -0
- package/src/__tests__/users.test.ts +1 -0
- package/src/__tests__/vendors.test.ts +34 -3
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +4 -25
- package/src/funcs/paymentProfileDeletePaymentProfile.ts +160 -0
- package/src/funcs/usersUpdateUserProfilePicture.ts +1 -1
- package/src/funcs/vendorsListVendorAdditionalFacilityFields.ts +115 -37
- package/src/lib/config.ts +2 -2
- package/src/models/components/expand.ts +1 -0
- package/src/models/components/facility.ts +9 -9
- package/src/models/components/facilitycalendarsummary.ts +2 -0
- package/src/models/components/facilitysummary.ts +2 -0
- package/src/models/components/systemsummary.ts +34 -0
- package/src/models/operations/deletepaymentprofile.ts +35 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listlocations.ts +15 -12
- package/src/models/operations/listlookupsystems.ts +2 -1
- package/src/models/operations/listvendoradditionalfacilityfields.ts +104 -2
- package/src/models/operations/updateuserprofilepicture.ts +11 -2
- package/src/react-query/index.ts +1 -0
- package/src/react-query/paymentProfileDeletePaymentProfile.ts +115 -0
- package/src/react-query/usersUpdateUserProfilePicture.ts +1 -1
- package/src/react-query/vendorsListVendorAdditionalFacilityFields.core.ts +124 -1
- package/src/react-query/vendorsListVendorAdditionalFacilityFields.ts +151 -12
- package/src/sdk/paymentprofile.ts +19 -0
- package/src/sdk/users.ts +1 -1
- package/src/sdk/vendors.ts +11 -7
|
@@ -125,10 +125,41 @@ test("Vendors List Vendor Credits", async () => {
|
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"
|
|
128
|
+
test("Vendors List Vendor Additional Facility Fields", async () => {
|
|
129
|
+
const testHttpClient = createTestHTTPClient(
|
|
130
|
+
"listVendorAdditionalFacilityFields",
|
|
131
131
|
);
|
|
132
|
+
|
|
133
|
+
const greenSecurity = new GreenSecurity({
|
|
134
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
|
|
135
|
+
httpClient: testHttpClient,
|
|
136
|
+
security: {
|
|
137
|
+
token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const result = await greenSecurity.vendors.listVendorAdditionalFacilityFields(
|
|
142
|
+
{
|
|
143
|
+
sort: "job",
|
|
144
|
+
desc: 0,
|
|
145
|
+
itemsPerPage: 25,
|
|
146
|
+
vendorIdOrMe: "<value>",
|
|
147
|
+
},
|
|
148
|
+
);
|
|
149
|
+
expect(result).toBeDefined();
|
|
150
|
+
expect(result!.result).toBeDefined();
|
|
151
|
+
expect(result!.result).toEqual({
|
|
152
|
+
items: [],
|
|
153
|
+
pager: {
|
|
154
|
+
baseUrl: "api/vendors/job_titles",
|
|
155
|
+
sort: "name",
|
|
156
|
+
desc: 1,
|
|
157
|
+
itemCount: 228,
|
|
158
|
+
itemsPerPage: 544311,
|
|
159
|
+
page: 1,
|
|
160
|
+
useUrlParams: true,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
132
163
|
});
|
|
133
164
|
|
|
134
165
|
test("Vendors Add Vendor Managed By Company", async () => {
|
|
@@ -21,7 +21,7 @@ test("Webhooks List All Webhook Endpoints", async () => {
|
|
|
21
21
|
const testWebhookListForVendorUserResult = await greenSecurity.webhooks
|
|
22
22
|
.listAllWebhookEndpoints({
|
|
23
23
|
itemsPerPage: 25,
|
|
24
|
-
desc:
|
|
24
|
+
desc: 0,
|
|
25
25
|
sort: "",
|
|
26
26
|
});
|
|
27
27
|
expect(testWebhookListForVendorUserResult).toBeDefined();
|
|
@@ -37,29 +37,7 @@ test("Zones List Or Search Security Zones", async () => {
|
|
|
37
37
|
},
|
|
38
38
|
items: [
|
|
39
39
|
{
|
|
40
|
-
facility: {
|
|
41
|
-
contacts: {
|
|
42
|
-
contact: {
|
|
43
|
-
status: "Active",
|
|
44
|
-
department: 123,
|
|
45
|
-
},
|
|
46
|
-
adminContact: {
|
|
47
|
-
status: "Active",
|
|
48
|
-
department: 123,
|
|
49
|
-
},
|
|
50
|
-
techContact: {
|
|
51
|
-
status: "Inactive",
|
|
52
|
-
department: 123,
|
|
53
|
-
},
|
|
54
|
-
greenSecurityCsm: null,
|
|
55
|
-
accountManager: null,
|
|
56
|
-
},
|
|
57
|
-
vendorGuestPolicy: {
|
|
58
|
-
enabled: true,
|
|
59
|
-
vendorGuestLimitAndOr: "and",
|
|
60
|
-
vendorGuestRequireEmail: false,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
40
|
+
facility: {},
|
|
63
41
|
},
|
|
64
42
|
{
|
|
65
43
|
facility: {},
|
|
@@ -80,8 +58,9 @@ test("Zones Security Zone Checkin", async () => {
|
|
|
80
58
|
});
|
|
81
59
|
|
|
82
60
|
const result = await greenSecurity.zones.securityZoneCheckin({
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
longitude: 8974.88,
|
|
62
|
+
latitude: 2359.5,
|
|
63
|
+
zoneId: 835839,
|
|
85
64
|
});
|
|
86
65
|
expect(result).toBeDefined();
|
|
87
66
|
expect(result).toEqual({});
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1e20a09b10f1
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { GreenSecurityCore } from "../core.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.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
|
+
* Delete payment profile
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Deletes the payment profile for the logged-in user (vendor or company manager).
|
|
33
|
+
*
|
|
34
|
+
* Only vendors and company managers can access this endpoint.
|
|
35
|
+
*
|
|
36
|
+
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
37
|
+
*/
|
|
38
|
+
export function paymentProfileDeletePaymentProfile(
|
|
39
|
+
client: GreenSecurityCore,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
operations.DeletePaymentProfileDeletePaymentProfileOk,
|
|
44
|
+
| errors.ApiErrorResponse
|
|
45
|
+
| GreenSecurityError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: GreenSecurityCore,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.DeletePaymentProfileDeletePaymentProfileOk,
|
|
68
|
+
| errors.ApiErrorResponse
|
|
69
|
+
| GreenSecurityError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const path = pathToFunc("/payment-profile")();
|
|
82
|
+
|
|
83
|
+
const headers = new Headers(compactMap({
|
|
84
|
+
Accept: "application/json",
|
|
85
|
+
}));
|
|
86
|
+
|
|
87
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
88
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
|
|
89
|
+
|
|
90
|
+
const context = {
|
|
91
|
+
options: client._options,
|
|
92
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
93
|
+
operationID: "deletePaymentProfile",
|
|
94
|
+
oAuth2Scopes: null,
|
|
95
|
+
|
|
96
|
+
resolvedSecurity: requestSecurity,
|
|
97
|
+
|
|
98
|
+
securitySource: client._options.security,
|
|
99
|
+
retryConfig: options?.retries
|
|
100
|
+
|| client._options.retryConfig
|
|
101
|
+
|| { strategy: "none" },
|
|
102
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const requestRes = client._createRequest(context, {
|
|
106
|
+
security: requestSecurity,
|
|
107
|
+
method: "DELETE",
|
|
108
|
+
baseURL: options?.serverURL,
|
|
109
|
+
path: path,
|
|
110
|
+
headers: headers,
|
|
111
|
+
userAgent: client._options.userAgent,
|
|
112
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
113
|
+
}, options);
|
|
114
|
+
if (!requestRes.ok) {
|
|
115
|
+
return [requestRes, { status: "invalid" }];
|
|
116
|
+
}
|
|
117
|
+
const req = requestRes.value;
|
|
118
|
+
|
|
119
|
+
const doResult = await client._do(req, {
|
|
120
|
+
context,
|
|
121
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
122
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
123
|
+
retryConfig: context.retryConfig,
|
|
124
|
+
retryCodes: context.retryCodes,
|
|
125
|
+
});
|
|
126
|
+
if (!doResult.ok) {
|
|
127
|
+
return [doResult, { status: "request-error", request: req }];
|
|
128
|
+
}
|
|
129
|
+
const response = doResult.value;
|
|
130
|
+
|
|
131
|
+
const responseFields = {
|
|
132
|
+
HttpMeta: { Response: response, Request: req },
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const [result] = await M.match<
|
|
136
|
+
operations.DeletePaymentProfileDeletePaymentProfileOk,
|
|
137
|
+
| errors.ApiErrorResponse
|
|
138
|
+
| GreenSecurityError
|
|
139
|
+
| ResponseValidationError
|
|
140
|
+
| ConnectionError
|
|
141
|
+
| RequestAbortedError
|
|
142
|
+
| RequestTimeoutError
|
|
143
|
+
| InvalidRequestError
|
|
144
|
+
| UnexpectedClientError
|
|
145
|
+
| SDKValidationError
|
|
146
|
+
>(
|
|
147
|
+
M.json(
|
|
148
|
+
200,
|
|
149
|
+
operations.DeletePaymentProfileDeletePaymentProfileOk$inboundSchema,
|
|
150
|
+
),
|
|
151
|
+
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
152
|
+
M.fail("4XX"),
|
|
153
|
+
M.fail([500, "5XX"]),
|
|
154
|
+
)(response, req, { extraFields: responseFields });
|
|
155
|
+
if (!result.ok) {
|
|
156
|
+
return [result, { status: "complete", request: req, response }];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return [result, { status: "complete", request: req, response }];
|
|
160
|
+
}
|
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Register profile picture metadata for S3 direct upload
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Register profile picture metadata for a user. The
|
|
34
|
+
* Register profile picture metadata for a user and obtain a presigned S3 upload URL. The flow is two-step: (1) call this endpoint with the image's file name, content type, and size; (2) PUT the file bytes to the returned upload_url with the matching Content-Type header. The file is stored at user_profile_image/{id}{ext} in the uploads bucket, where {ext} is derived from image_file_name and may be empty, and is processed asynchronously (resize to tiny/thumb/large variants). Use 'me' as the id for the authenticated user. Requires authentication and either self-ownership or 'users:edit' permission. API users must be authorized via MarketplaceAppActivation for the target user.
|
|
35
35
|
*
|
|
36
36
|
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
37
37
|
*/
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { GreenSecurityCore } from "../core.js";
|
|
7
|
-
import {
|
|
7
|
+
import { dlv } from "../lib/dlv.js";
|
|
8
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
9
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
10
|
import * as M from "../lib/matchers.js";
|
|
10
11
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -26,6 +27,12 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
26
27
|
import * as operations from "../models/operations/index.js";
|
|
27
28
|
import { APICall, APIPromise } from "../types/async.js";
|
|
28
29
|
import { Result } from "../types/fp.js";
|
|
30
|
+
import {
|
|
31
|
+
createPageIterator,
|
|
32
|
+
haltIterator,
|
|
33
|
+
PageIterator,
|
|
34
|
+
Paginator,
|
|
35
|
+
} from "../types/operations.js";
|
|
29
36
|
|
|
30
37
|
/**
|
|
31
38
|
* List of vendor's additional facility fields
|
|
@@ -33,11 +40,12 @@ import { Result } from "../types/fp.js";
|
|
|
33
40
|
* @remarks
|
|
34
41
|
* Deprecated. Use `GET /vendors/{vendor_id_or_me}/custom-fields` instead.
|
|
35
42
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* `
|
|
39
|
-
*
|
|
40
|
-
*
|
|
43
|
+
* Backward-compatible shape preserved: this endpoint continues to return
|
|
44
|
+
* the legacy paginated envelope (`items` + `pager`) with the original
|
|
45
|
+
* `system` / `facility` / `field` / `value` keys per item. New consumers
|
|
46
|
+
* should migrate to `/custom-fields`, which returns an unpaginated array
|
|
47
|
+
* with the `field_for` discriminator. Scheduled for removal after SDK
|
|
48
|
+
* consumers migrate.
|
|
41
49
|
*
|
|
42
50
|
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
43
51
|
*
|
|
@@ -48,17 +56,20 @@ export function vendorsListVendorAdditionalFacilityFields(
|
|
|
48
56
|
request: operations.ListVendorAdditionalFacilityFieldsRequest,
|
|
49
57
|
options?: RequestOptions,
|
|
50
58
|
): APIPromise<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
PageIterator<
|
|
60
|
+
Result<
|
|
61
|
+
operations.ListVendorAdditionalFacilityFieldsResponse,
|
|
62
|
+
| errors.ApiErrorResponse
|
|
63
|
+
| GreenSecurityError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
{ page: number }
|
|
62
73
|
>
|
|
63
74
|
> {
|
|
64
75
|
return new APIPromise($do(
|
|
@@ -74,17 +85,20 @@ async function $do(
|
|
|
74
85
|
options?: RequestOptions,
|
|
75
86
|
): Promise<
|
|
76
87
|
[
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
PageIterator<
|
|
89
|
+
Result<
|
|
90
|
+
operations.ListVendorAdditionalFacilityFieldsResponse,
|
|
91
|
+
| errors.ApiErrorResponse
|
|
92
|
+
| GreenSecurityError
|
|
93
|
+
| ResponseValidationError
|
|
94
|
+
| ConnectionError
|
|
95
|
+
| RequestAbortedError
|
|
96
|
+
| RequestTimeoutError
|
|
97
|
+
| InvalidRequestError
|
|
98
|
+
| UnexpectedClientError
|
|
99
|
+
| SDKValidationError
|
|
100
|
+
>,
|
|
101
|
+
{ page: number }
|
|
88
102
|
>,
|
|
89
103
|
APICall,
|
|
90
104
|
]
|
|
@@ -98,7 +112,7 @@ async function $do(
|
|
|
98
112
|
"Input validation failed",
|
|
99
113
|
);
|
|
100
114
|
if (!parsed.ok) {
|
|
101
|
-
return [parsed, { status: "invalid" }];
|
|
115
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
102
116
|
}
|
|
103
117
|
const payload = parsed.value;
|
|
104
118
|
const body = null;
|
|
@@ -113,6 +127,13 @@ async function $do(
|
|
|
113
127
|
"/vendors/{vendor_id_or_me}/additional-facility-fields",
|
|
114
128
|
)(pathParams);
|
|
115
129
|
|
|
130
|
+
const query = encodeFormQuery({
|
|
131
|
+
"desc": payload.desc,
|
|
132
|
+
"items_per_page": payload.items_per_page,
|
|
133
|
+
"page": payload.page,
|
|
134
|
+
"sort": payload.sort,
|
|
135
|
+
});
|
|
136
|
+
|
|
116
137
|
const headers = new Headers(compactMap({
|
|
117
138
|
Accept: "application/json",
|
|
118
139
|
}));
|
|
@@ -141,12 +162,13 @@ async function $do(
|
|
|
141
162
|
baseURL: options?.serverURL,
|
|
142
163
|
path: path,
|
|
143
164
|
headers: headers,
|
|
165
|
+
query: query,
|
|
144
166
|
body: body,
|
|
145
167
|
userAgent: client._options.userAgent,
|
|
146
168
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
147
169
|
}, options);
|
|
148
170
|
if (!requestRes.ok) {
|
|
149
|
-
return [requestRes, { status: "invalid" }];
|
|
171
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
150
172
|
}
|
|
151
173
|
const req = requestRes.value;
|
|
152
174
|
|
|
@@ -158,7 +180,7 @@ async function $do(
|
|
|
158
180
|
retryCodes: context.retryCodes,
|
|
159
181
|
});
|
|
160
182
|
if (!doResult.ok) {
|
|
161
|
-
return [doResult, { status: "request-error", request: req }];
|
|
183
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
162
184
|
}
|
|
163
185
|
const response = doResult.value;
|
|
164
186
|
|
|
@@ -166,8 +188,8 @@ async function $do(
|
|
|
166
188
|
HttpMeta: { Response: response, Request: req },
|
|
167
189
|
};
|
|
168
190
|
|
|
169
|
-
const [result] = await M.match<
|
|
170
|
-
operations.
|
|
191
|
+
const [result, raw] = await M.match<
|
|
192
|
+
operations.ListVendorAdditionalFacilityFieldsResponse,
|
|
171
193
|
| errors.ApiErrorResponse
|
|
172
194
|
| GreenSecurityError
|
|
173
195
|
| ResponseValidationError
|
|
@@ -180,16 +202,72 @@ async function $do(
|
|
|
180
202
|
>(
|
|
181
203
|
M.json(
|
|
182
204
|
200,
|
|
183
|
-
operations
|
|
184
|
-
|
|
205
|
+
operations.ListVendorAdditionalFacilityFieldsResponse$inboundSchema,
|
|
206
|
+
{ key: "Result" },
|
|
185
207
|
),
|
|
186
208
|
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
187
209
|
M.fail("4XX"),
|
|
188
210
|
M.fail([500, "5XX"]),
|
|
189
211
|
)(response, req, { extraFields: responseFields });
|
|
190
212
|
if (!result.ok) {
|
|
191
|
-
return [result, {
|
|
213
|
+
return [haltIterator(result), {
|
|
214
|
+
status: "complete",
|
|
215
|
+
request: req,
|
|
216
|
+
response,
|
|
217
|
+
}];
|
|
192
218
|
}
|
|
193
219
|
|
|
194
|
-
|
|
220
|
+
const nextFunc = (
|
|
221
|
+
responseData: unknown,
|
|
222
|
+
): {
|
|
223
|
+
next: Paginator<
|
|
224
|
+
Result<
|
|
225
|
+
operations.ListVendorAdditionalFacilityFieldsResponse,
|
|
226
|
+
| errors.ApiErrorResponse
|
|
227
|
+
| GreenSecurityError
|
|
228
|
+
| ResponseValidationError
|
|
229
|
+
| ConnectionError
|
|
230
|
+
| RequestAbortedError
|
|
231
|
+
| RequestTimeoutError
|
|
232
|
+
| InvalidRequestError
|
|
233
|
+
| UnexpectedClientError
|
|
234
|
+
| SDKValidationError
|
|
235
|
+
>
|
|
236
|
+
>;
|
|
237
|
+
"~next"?: { page: number };
|
|
238
|
+
} => {
|
|
239
|
+
const page = request?.page ?? 1;
|
|
240
|
+
const nextPage = page + 1;
|
|
241
|
+
|
|
242
|
+
if (!responseData) {
|
|
243
|
+
return { next: () => null };
|
|
244
|
+
}
|
|
245
|
+
const results = dlv(responseData, "items");
|
|
246
|
+
if (!Array.isArray(results) || !results.length) {
|
|
247
|
+
return { next: () => null };
|
|
248
|
+
}
|
|
249
|
+
const limit = request?.itemsPerPage ?? 0;
|
|
250
|
+
if (results.length < limit) {
|
|
251
|
+
return { next: () => null };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const nextVal = () =>
|
|
255
|
+
vendorsListVendorAdditionalFacilityFields(
|
|
256
|
+
client,
|
|
257
|
+
{
|
|
258
|
+
...request,
|
|
259
|
+
page: nextPage,
|
|
260
|
+
},
|
|
261
|
+
options,
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
return { next: nextVal, "~next": { page: nextPage } };
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
268
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
269
|
+
status: "complete",
|
|
270
|
+
request: req,
|
|
271
|
+
response,
|
|
272
|
+
}];
|
|
195
273
|
}
|
package/src/lib/config.ts
CHANGED
|
@@ -81,8 +81,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
81
81
|
export const SDK_METADATA = {
|
|
82
82
|
language: "typescript",
|
|
83
83
|
openapiDocVersion: "0.0.11",
|
|
84
|
-
sdkVersion: "0.43.1-beta.
|
|
84
|
+
sdkVersion: "0.43.1-beta.126",
|
|
85
85
|
genVersion: "2.881.17",
|
|
86
86
|
userAgent:
|
|
87
|
-
"speakeasy-sdk/typescript 0.43.1-beta.
|
|
87
|
+
"speakeasy-sdk/typescript 0.43.1-beta.126 2.881.17 0.0.11 @greensecurity/javascript-sdk",
|
|
88
88
|
} as const;
|
|
@@ -103,6 +103,7 @@ export const Expand = {
|
|
|
103
103
|
ZoneDepartment: "zone.department",
|
|
104
104
|
ZoneRules: "zone.rules",
|
|
105
105
|
SystemFacilities: "system.facilities",
|
|
106
|
+
SystemLocation: "system.location",
|
|
106
107
|
SubscriptionExpeditedOffer: "subscription.expedited_offer",
|
|
107
108
|
DepartmentMembershipContact: "department_membership.contact",
|
|
108
109
|
DepartmentMembershipDepartment: "department_membership.department",
|
|
@@ -72,7 +72,7 @@ export type FluCredential = {
|
|
|
72
72
|
fluDateEnds?: Date | null | undefined;
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
export type
|
|
75
|
+
export type FacilityLocation = {
|
|
76
76
|
streetAddress?: string | null | undefined;
|
|
77
77
|
city?: string | null | undefined;
|
|
78
78
|
state?: string | null | undefined;
|
|
@@ -163,7 +163,7 @@ export type Facility = {
|
|
|
163
163
|
* A set of images in different sizes
|
|
164
164
|
*/
|
|
165
165
|
imageUrls?: ImageSet | null | undefined;
|
|
166
|
-
location?:
|
|
166
|
+
location?: FacilityLocation | undefined;
|
|
167
167
|
name?: string | undefined;
|
|
168
168
|
scrubsPolicy?: ScrubsPolicy | null | undefined;
|
|
169
169
|
status?: string | undefined;
|
|
@@ -324,8 +324,8 @@ export function fluCredentialFromJSON(
|
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
/** @internal */
|
|
327
|
-
export const
|
|
328
|
-
|
|
327
|
+
export const FacilityLocation$inboundSchema: z.ZodType<
|
|
328
|
+
FacilityLocation,
|
|
329
329
|
z.ZodTypeDef,
|
|
330
330
|
unknown
|
|
331
331
|
> = z.object({
|
|
@@ -346,13 +346,13 @@ export const Location$inboundSchema: z.ZodType<
|
|
|
346
346
|
});
|
|
347
347
|
});
|
|
348
348
|
|
|
349
|
-
export function
|
|
349
|
+
export function facilityLocationFromJSON(
|
|
350
350
|
jsonString: string,
|
|
351
|
-
): SafeParseResult<
|
|
351
|
+
): SafeParseResult<FacilityLocation, SDKValidationError> {
|
|
352
352
|
return safeParse(
|
|
353
353
|
jsonString,
|
|
354
|
-
(x) =>
|
|
355
|
-
`Failed to parse '
|
|
354
|
+
(x) => FacilityLocation$inboundSchema.parse(JSON.parse(x)),
|
|
355
|
+
`Failed to parse 'FacilityLocation' from JSON`,
|
|
356
356
|
);
|
|
357
357
|
}
|
|
358
358
|
|
|
@@ -576,7 +576,7 @@ export const Facility$inboundSchema: z.ZodType<
|
|
|
576
576
|
flu_credential: types.optional(z.lazy(() => FluCredential$inboundSchema)),
|
|
577
577
|
id: types.optional(types.number()),
|
|
578
578
|
image_urls: z.nullable(ImageSet$inboundSchema).optional(),
|
|
579
|
-
location: types.optional(z.lazy(() =>
|
|
579
|
+
location: types.optional(z.lazy(() => FacilityLocation$inboundSchema)),
|
|
580
580
|
name: types.optional(types.string()),
|
|
581
581
|
scrubs_policy: z.nullable(z.lazy(() => ScrubsPolicy$inboundSchema))
|
|
582
582
|
.optional(),
|
|
@@ -25,6 +25,7 @@ export type FacilityCalendarSummary = {
|
|
|
25
25
|
id?: number | undefined;
|
|
26
26
|
name?: string | undefined;
|
|
27
27
|
systemId?: number | undefined;
|
|
28
|
+
status?: string | null | undefined;
|
|
28
29
|
vendorPolicy?: FacilityCalendarSummaryVendorPolicy | null | undefined;
|
|
29
30
|
allowUserAppointments?: boolean | undefined;
|
|
30
31
|
allowDeptAppointments?: boolean | undefined;
|
|
@@ -63,6 +64,7 @@ export const FacilityCalendarSummary$inboundSchema: z.ZodType<
|
|
|
63
64
|
id: types.optional(types.number()),
|
|
64
65
|
name: types.optional(types.string()),
|
|
65
66
|
system_id: types.optional(types.number()),
|
|
67
|
+
status: z.nullable(types.string()).optional(),
|
|
66
68
|
vendor_policy: z.nullable(
|
|
67
69
|
z.lazy(() => FacilityCalendarSummaryVendorPolicy$inboundSchema),
|
|
68
70
|
).optional(),
|
|
@@ -25,6 +25,7 @@ export type FacilitySummary = {
|
|
|
25
25
|
id?: number | undefined;
|
|
26
26
|
name?: string | undefined;
|
|
27
27
|
systemId?: number | undefined;
|
|
28
|
+
status?: string | null | undefined;
|
|
28
29
|
vendorPolicy?: VendorPolicy | null | undefined;
|
|
29
30
|
};
|
|
30
31
|
|
|
@@ -60,6 +61,7 @@ export const FacilitySummary$inboundSchema: z.ZodType<
|
|
|
60
61
|
id: types.optional(types.number()),
|
|
61
62
|
name: types.optional(types.string()),
|
|
62
63
|
system_id: types.optional(types.number()),
|
|
64
|
+
status: z.nullable(types.string()).optional(),
|
|
63
65
|
vendor_policy: z.nullable(z.lazy(() => VendorPolicy$inboundSchema))
|
|
64
66
|
.optional(),
|
|
65
67
|
}).transform((v) => {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as z from "zod/v3";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
8
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import * as types from "../../types/primitives.js";
|
|
@@ -13,15 +14,42 @@ import {
|
|
|
13
14
|
FacilitySummary$inboundSchema,
|
|
14
15
|
} from "./facilitysummary.js";
|
|
15
16
|
|
|
17
|
+
export type Location = {
|
|
18
|
+
city?: string | null | undefined;
|
|
19
|
+
state?: string | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
16
22
|
/**
|
|
17
23
|
* A simplified representation of a System, typically used in list views.
|
|
18
24
|
*/
|
|
19
25
|
export type SystemSummary = {
|
|
20
26
|
id: number;
|
|
21
27
|
name: string;
|
|
28
|
+
startDate?: string | null | undefined;
|
|
29
|
+
location?: Location | null | undefined;
|
|
22
30
|
facilities?: Array<FacilitySummary> | null | undefined;
|
|
23
31
|
};
|
|
24
32
|
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Location$inboundSchema: z.ZodType<
|
|
35
|
+
Location,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
unknown
|
|
38
|
+
> = z.object({
|
|
39
|
+
city: z.nullable(types.string()).optional(),
|
|
40
|
+
state: z.nullable(types.string()).optional(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function locationFromJSON(
|
|
44
|
+
jsonString: string,
|
|
45
|
+
): SafeParseResult<Location, SDKValidationError> {
|
|
46
|
+
return safeParse(
|
|
47
|
+
jsonString,
|
|
48
|
+
(x) => Location$inboundSchema.parse(JSON.parse(x)),
|
|
49
|
+
`Failed to parse 'Location' from JSON`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
25
53
|
/** @internal */
|
|
26
54
|
export const SystemSummary$inboundSchema: z.ZodType<
|
|
27
55
|
SystemSummary,
|
|
@@ -30,7 +58,13 @@ export const SystemSummary$inboundSchema: z.ZodType<
|
|
|
30
58
|
> = z.object({
|
|
31
59
|
id: types.number(),
|
|
32
60
|
name: types.string(),
|
|
61
|
+
start_date: z.nullable(types.string()).optional(),
|
|
62
|
+
location: z.nullable(z.lazy(() => Location$inboundSchema)).optional(),
|
|
33
63
|
facilities: z.nullable(z.array(FacilitySummary$inboundSchema)).optional(),
|
|
64
|
+
}).transform((v) => {
|
|
65
|
+
return remap$(v, {
|
|
66
|
+
"start_date": "startDate",
|
|
67
|
+
});
|
|
34
68
|
});
|
|
35
69
|
|
|
36
70
|
export function systemSummaryFromJSON(
|