@greensecurity/javascript-sdk 0.47.0-beta.9 → 0.48.0-beta.0

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.
Files changed (219) hide show
  1. package/README.md +1 -1
  2. package/dist/commonjs/__tests__/users.test.js +2 -0
  3. package/dist/commonjs/__tests__/users.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts +2 -0
  5. package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts.map +1 -0
  6. package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.js +30 -0
  7. package/dist/commonjs/__tests__/vendorGetCompanyCredentialsSummary.test.js.map +1 -0
  8. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  9. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  10. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  11. package/dist/commonjs/__tests__/zones.test.js +35 -7
  12. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  13. package/dist/commonjs/admin-funcs/clearVerifications.d.ts +24 -0
  14. package/dist/commonjs/admin-funcs/clearVerifications.d.ts.map +1 -0
  15. package/dist/commonjs/admin-funcs/clearVerifications.js +30 -0
  16. package/dist/commonjs/admin-funcs/clearVerifications.js.map +1 -0
  17. package/dist/commonjs/admin-funcs/companyManagerGetAutopay.d.ts +3 -0
  18. package/dist/commonjs/admin-funcs/companyManagerGetAutopay.d.ts.map +1 -0
  19. package/dist/commonjs/admin-funcs/companyManagerGetAutopay.js +9 -0
  20. package/dist/commonjs/admin-funcs/companyManagerGetAutopay.js.map +1 -0
  21. package/dist/commonjs/admin-funcs/companyManagerUpdateAutopay.d.ts +3 -0
  22. package/dist/commonjs/admin-funcs/companyManagerUpdateAutopay.d.ts.map +1 -0
  23. package/dist/commonjs/admin-funcs/companyManagerUpdateAutopay.js +12 -0
  24. package/dist/commonjs/admin-funcs/companyManagerUpdateAutopay.js.map +1 -0
  25. package/dist/commonjs/admin-funcs/registerGeneralInfo.d.ts +11 -6
  26. package/dist/commonjs/admin-funcs/registerGeneralInfo.d.ts.map +1 -1
  27. package/dist/commonjs/admin-funcs/registerGeneralInfo.js.map +1 -1
  28. package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts +1 -1
  29. package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts.map +1 -1
  30. package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.js +9 -3
  31. package/dist/commonjs/admin-funcs/vendorGetCompanyCredentialsSummary.js.map +1 -1
  32. package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.d.ts +4 -0
  33. package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
  34. package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.js +7 -0
  35. package/dist/commonjs/funcs/vendorsGetVendorTargetFacilities.js.map +1 -1
  36. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts +5 -2
  37. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
  38. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js +5 -2
  39. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js.map +1 -1
  40. package/dist/commonjs/index.extras.d.ts +12 -0
  41. package/dist/commonjs/index.extras.d.ts.map +1 -1
  42. package/dist/commonjs/index.extras.js +12 -0
  43. package/dist/commonjs/index.extras.js.map +1 -1
  44. package/dist/commonjs/lib/config.d.ts +3 -3
  45. package/dist/commonjs/lib/config.js +3 -3
  46. package/dist/commonjs/models/components/expand.d.ts +2 -0
  47. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  48. package/dist/commonjs/models/components/expand.js +2 -0
  49. package/dist/commonjs/models/components/expand.js.map +1 -1
  50. package/dist/commonjs/models/components/index.d.ts +1 -0
  51. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  52. package/dist/commonjs/models/components/index.js +1 -0
  53. package/dist/commonjs/models/components/index.js.map +1 -1
  54. package/dist/commonjs/models/components/invoice.d.ts +5 -0
  55. package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
  56. package/dist/commonjs/models/components/invoice.js +4 -0
  57. package/dist/commonjs/models/components/invoice.js.map +1 -1
  58. package/dist/commonjs/models/components/userdetails.d.ts +12 -0
  59. package/dist/commonjs/models/components/userdetails.d.ts.map +1 -1
  60. package/dist/commonjs/models/components/userdetails.js +4 -0
  61. package/dist/commonjs/models/components/userdetails.js.map +1 -1
  62. package/dist/commonjs/models/components/userlocation.d.ts +5 -0
  63. package/dist/commonjs/models/components/userlocation.d.ts.map +1 -1
  64. package/dist/commonjs/models/components/userlocation.js +4 -0
  65. package/dist/commonjs/models/components/userlocation.js.map +1 -1
  66. package/dist/commonjs/models/components/vendorpaymentresponsibilityassignments.d.ts +2 -2
  67. package/dist/commonjs/models/components/vendortargetfacility.d.ts +8 -0
  68. package/dist/commonjs/models/components/vendortargetfacility.d.ts.map +1 -1
  69. package/dist/commonjs/models/components/vendortargetfacility.js +4 -0
  70. package/dist/commonjs/models/components/vendortargetfacility.js.map +1 -1
  71. package/dist/commonjs/models/components/vendortargetfacilitystatuscounts.d.ts +24 -0
  72. package/dist/commonjs/models/components/vendortargetfacilitystatuscounts.d.ts.map +1 -0
  73. package/dist/commonjs/models/components/vendortargetfacilitystatuscounts.js +58 -0
  74. package/dist/commonjs/models/components/vendortargetfacilitystatuscounts.js.map +1 -0
  75. package/dist/commonjs/models/operations/getvendortargetfacilities.d.ts +55 -7
  76. package/dist/commonjs/models/operations/getvendortargetfacilities.d.ts.map +1 -1
  77. package/dist/commonjs/models/operations/getvendortargetfacilities.js +36 -3
  78. package/dist/commonjs/models/operations/getvendortargetfacilities.js.map +1 -1
  79. package/dist/commonjs/models/operations/updatevendorpaymentresponsibility.d.ts +2 -2
  80. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.core.d.ts +6 -0
  81. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.core.d.ts.map +1 -1
  82. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.core.js +6 -0
  83. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.core.js.map +1 -1
  84. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.d.ts +22 -0
  85. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
  86. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.js +16 -0
  87. package/dist/commonjs/react-query/vendorsGetVendorTargetFacilities.js.map +1 -1
  88. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts +5 -2
  89. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
  90. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js +4 -1
  91. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js.map +1 -1
  92. package/dist/commonjs/sdk/vendors.d.ts +8 -1
  93. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  94. package/dist/commonjs/sdk/vendors.js +8 -1
  95. package/dist/commonjs/sdk/vendors.js.map +1 -1
  96. package/dist/esm/__tests__/users.test.js +2 -0
  97. package/dist/esm/__tests__/users.test.js.map +1 -1
  98. package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts +2 -0
  99. package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.d.ts.map +1 -0
  100. package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.js +28 -0
  101. package/dist/esm/__tests__/vendorGetCompanyCredentialsSummary.test.js.map +1 -0
  102. package/dist/esm/__tests__/vendors.test.js +1 -1
  103. package/dist/esm/__tests__/webhooks.test.js +1 -1
  104. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  105. package/dist/esm/__tests__/zones.test.js +35 -7
  106. package/dist/esm/__tests__/zones.test.js.map +1 -1
  107. package/dist/esm/admin-funcs/clearVerifications.d.ts +24 -0
  108. package/dist/esm/admin-funcs/clearVerifications.d.ts.map +1 -0
  109. package/dist/esm/admin-funcs/clearVerifications.js +23 -0
  110. package/dist/esm/admin-funcs/clearVerifications.js.map +1 -0
  111. package/dist/esm/admin-funcs/companyManagerGetAutopay.d.ts +3 -0
  112. package/dist/esm/admin-funcs/companyManagerGetAutopay.d.ts.map +1 -0
  113. package/dist/esm/admin-funcs/companyManagerGetAutopay.js +6 -0
  114. package/dist/esm/admin-funcs/companyManagerGetAutopay.js.map +1 -0
  115. package/dist/esm/admin-funcs/companyManagerUpdateAutopay.d.ts +3 -0
  116. package/dist/esm/admin-funcs/companyManagerUpdateAutopay.d.ts.map +1 -0
  117. package/dist/esm/admin-funcs/companyManagerUpdateAutopay.js +9 -0
  118. package/dist/esm/admin-funcs/companyManagerUpdateAutopay.js.map +1 -0
  119. package/dist/esm/admin-funcs/registerGeneralInfo.d.ts +11 -6
  120. package/dist/esm/admin-funcs/registerGeneralInfo.d.ts.map +1 -1
  121. package/dist/esm/admin-funcs/registerGeneralInfo.js.map +1 -1
  122. package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts +1 -1
  123. package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.d.ts.map +1 -1
  124. package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.js +10 -4
  125. package/dist/esm/admin-funcs/vendorGetCompanyCredentialsSummary.js.map +1 -1
  126. package/dist/esm/funcs/vendorsGetVendorTargetFacilities.d.ts +4 -0
  127. package/dist/esm/funcs/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
  128. package/dist/esm/funcs/vendorsGetVendorTargetFacilities.js +7 -0
  129. package/dist/esm/funcs/vendorsGetVendorTargetFacilities.js.map +1 -1
  130. package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts +5 -2
  131. package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
  132. package/dist/esm/funcs/vendorsUpdateVendorDetails.js +5 -2
  133. package/dist/esm/funcs/vendorsUpdateVendorDetails.js.map +1 -1
  134. package/dist/esm/index.extras.d.ts +12 -0
  135. package/dist/esm/index.extras.d.ts.map +1 -1
  136. package/dist/esm/index.extras.js +12 -0
  137. package/dist/esm/index.extras.js.map +1 -1
  138. package/dist/esm/lib/config.d.ts +3 -3
  139. package/dist/esm/lib/config.js +3 -3
  140. package/dist/esm/models/components/expand.d.ts +2 -0
  141. package/dist/esm/models/components/expand.d.ts.map +1 -1
  142. package/dist/esm/models/components/expand.js +2 -0
  143. package/dist/esm/models/components/expand.js.map +1 -1
  144. package/dist/esm/models/components/index.d.ts +1 -0
  145. package/dist/esm/models/components/index.d.ts.map +1 -1
  146. package/dist/esm/models/components/index.js +1 -0
  147. package/dist/esm/models/components/index.js.map +1 -1
  148. package/dist/esm/models/components/invoice.d.ts +5 -0
  149. package/dist/esm/models/components/invoice.d.ts.map +1 -1
  150. package/dist/esm/models/components/invoice.js +4 -0
  151. package/dist/esm/models/components/invoice.js.map +1 -1
  152. package/dist/esm/models/components/userdetails.d.ts +12 -0
  153. package/dist/esm/models/components/userdetails.d.ts.map +1 -1
  154. package/dist/esm/models/components/userdetails.js +4 -0
  155. package/dist/esm/models/components/userdetails.js.map +1 -1
  156. package/dist/esm/models/components/userlocation.d.ts +5 -0
  157. package/dist/esm/models/components/userlocation.d.ts.map +1 -1
  158. package/dist/esm/models/components/userlocation.js +4 -0
  159. package/dist/esm/models/components/userlocation.js.map +1 -1
  160. package/dist/esm/models/components/vendorpaymentresponsibilityassignments.d.ts +2 -2
  161. package/dist/esm/models/components/vendortargetfacility.d.ts +8 -0
  162. package/dist/esm/models/components/vendortargetfacility.d.ts.map +1 -1
  163. package/dist/esm/models/components/vendortargetfacility.js +4 -0
  164. package/dist/esm/models/components/vendortargetfacility.js.map +1 -1
  165. package/dist/esm/models/components/vendortargetfacilitystatuscounts.d.ts +24 -0
  166. package/dist/esm/models/components/vendortargetfacilitystatuscounts.d.ts.map +1 -0
  167. package/dist/esm/models/components/vendortargetfacilitystatuscounts.js +21 -0
  168. package/dist/esm/models/components/vendortargetfacilitystatuscounts.js.map +1 -0
  169. package/dist/esm/models/operations/getvendortargetfacilities.d.ts +55 -7
  170. package/dist/esm/models/operations/getvendortargetfacilities.d.ts.map +1 -1
  171. package/dist/esm/models/operations/getvendortargetfacilities.js +35 -2
  172. package/dist/esm/models/operations/getvendortargetfacilities.js.map +1 -1
  173. package/dist/esm/models/operations/updatevendorpaymentresponsibility.d.ts +2 -2
  174. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.core.d.ts +6 -0
  175. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.core.d.ts.map +1 -1
  176. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.core.js +6 -0
  177. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.core.js.map +1 -1
  178. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.d.ts +22 -0
  179. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.d.ts.map +1 -1
  180. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.js +16 -0
  181. package/dist/esm/react-query/vendorsGetVendorTargetFacilities.js.map +1 -1
  182. package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts +5 -2
  183. package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
  184. package/dist/esm/react-query/vendorsUpdateVendorDetails.js +4 -1
  185. package/dist/esm/react-query/vendorsUpdateVendorDetails.js.map +1 -1
  186. package/dist/esm/sdk/vendors.d.ts +8 -1
  187. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  188. package/dist/esm/sdk/vendors.js +8 -1
  189. package/dist/esm/sdk/vendors.js.map +1 -1
  190. package/jsr.json +1 -1
  191. package/package.json +1 -1
  192. package/src/__tests__/users.test.ts +2 -0
  193. package/src/__tests__/vendorGetCompanyCredentialsSummary.test.ts +40 -0
  194. package/src/__tests__/vendors.test.ts +1 -1
  195. package/src/__tests__/webhooks.test.ts +1 -1
  196. package/src/__tests__/zones.test.ts +35 -7
  197. package/src/admin-funcs/clearVerifications.ts +42 -0
  198. package/src/admin-funcs/companyManagerGetAutopay.ts +6 -0
  199. package/src/admin-funcs/companyManagerUpdateAutopay.ts +12 -0
  200. package/src/admin-funcs/registerGeneralInfo.ts +11 -6
  201. package/src/admin-funcs/vendorGetCompanyCredentialsSummary.ts +11 -7
  202. package/src/funcs/vendorsGetVendorTargetFacilities.ts +7 -0
  203. package/src/funcs/vendorsUpdateVendorDetails.ts +8 -1
  204. package/src/index.extras.ts +19 -0
  205. package/src/lib/config.ts +3 -3
  206. package/src/models/components/expand.ts +3 -0
  207. package/src/models/components/index.ts +1 -0
  208. package/src/models/components/invoice.ts +9 -0
  209. package/src/models/components/userdetails.ts +16 -0
  210. package/src/models/components/userlocation.ts +9 -0
  211. package/src/models/components/vendorpaymentresponsibilityassignments.ts +2 -2
  212. package/src/models/components/vendortargetfacility.ts +12 -0
  213. package/src/models/components/vendortargetfacilitystatuscounts.ts +53 -0
  214. package/src/models/operations/getvendortargetfacilities.ts +77 -7
  215. package/src/models/operations/updatevendorpaymentresponsibility.ts +2 -2
  216. package/src/react-query/vendorsGetVendorTargetFacilities.core.ts +12 -0
  217. package/src/react-query/vendorsGetVendorTargetFacilities.ts +22 -0
  218. package/src/react-query/vendorsUpdateVendorDetails.ts +5 -1
  219. package/src/sdk/vendors.ts +8 -1
@@ -0,0 +1,42 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doGetSingle, $doPost, internalApiResult } from "./doAdmin.js";
3
+
4
+ export type ClearVerificationContext = "registration" | "account";
5
+ export type ClearVerificationPlatform = "web" | "native";
6
+
7
+ export type clearCreateSessionRequest = {
8
+ context: ClearVerificationContext;
9
+ platform: ClearVerificationPlatform;
10
+ /** Where CLEAR sends the vendor back; the server adds a `state` parameter. */
11
+ return_url: string;
12
+ };
13
+
14
+ export type clearCompleteRequest = {
15
+ /** The `state` CLEAR sent back on the return URL. */
16
+ state: string;
17
+ };
18
+
19
+ /** Starts a CLEAR verification for the calling vendor. Resolves to `{ verify_url }`. */
20
+ export function clearCreateSession(request: clearCreateSessionRequest): internalApiResult {
21
+ return new APIPromise($doPost("/clear-verifications", request));
22
+ }
23
+
24
+ /** Reads the outcome of the session `state` belongs to. Resolves to the vendor's CLEAR summary plus `outcome` and `context`. */
25
+ export function clearComplete(request: clearCompleteRequest): internalApiResult {
26
+ return new APIPromise($doPost("/clear-verifications/complete", request));
27
+ }
28
+
29
+ /** Records that the calling vendor continued without CLEAR. Resolves to the vendor's CLEAR summary. */
30
+ export function clearOptOut(): internalApiResult {
31
+ return new APIPromise($doPost("/clear-verifications/opt-out", {}));
32
+ }
33
+
34
+ /** The calling vendor's CLEAR summary: `{ status, prefilled_fields, personal_email }`. */
35
+ export function clearGetStatus(): internalApiResult {
36
+ return new APIPromise($doGetSingle("/clear-verifications/status", {}));
37
+ }
38
+
39
+ /** What the vendor's profile and CLEAR can fill on their background check, SSN included. */
40
+ export function clearGetBackgroundCheckPrefill(): internalApiResult {
41
+ return new APIPromise($doGetSingle("/clear-verifications/background-check-prefill", {}));
42
+ }
@@ -0,0 +1,6 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doGetSingle, internalApiResult } from "./doAdmin.js";
3
+
4
+ export function companyManagerGetAutopay(): internalApiResult {
5
+ return new APIPromise($doGetSingle("/company_managers/me/autopay", {}));
6
+ }
@@ -0,0 +1,12 @@
1
+ import { APIPromise } from "../types/async.js";
2
+ import { $doPut, internalApiResult } from "./doAdmin.js";
3
+
4
+ export function companyManagerUpdateAutopay(
5
+ enabled: boolean,
6
+ signatureName?: string,
7
+ ): internalApiResult {
8
+ return new APIPromise($doPut("/company_managers/me/autopay", {
9
+ enabled,
10
+ signature_name: signatureName,
11
+ }));
12
+ }
@@ -14,12 +14,17 @@ export type formInputs = {
14
14
  supervisor_name: string;
15
15
  supervisor_email: string;
16
16
  supervisor_phone: string;
17
- country: string;
18
- address1: string;
19
- address2: string;
20
- city: string;
21
- state: string;
22
- zip: string;
17
+ /** Becomes the login email when it differs from the one the vendor registered with. */
18
+ work_email?: string;
19
+ personal_email?: string;
20
+ work_phone?: string;
21
+ /** Registration no longer collects an address; these remain for older forms. */
22
+ country?: string;
23
+ address1?: string;
24
+ address2?: string;
25
+ city?: string;
26
+ state?: string;
27
+ zip?: string;
23
28
  };
24
29
 
25
30
  export function submitGeneralInfo(request: formInputs): internalApiResult {
@@ -1,10 +1,14 @@
1
1
  import { APIPromise } from "../types/async.js";
2
- import { $doGetSingle, internalApiResult } from "./doAdmin.js";
2
+ import { $doGetSingle, hashToQueryString, internalApiResult } from "./doAdmin.js";
3
3
 
4
- // Internal-only, not part of openapi.yaml. Vendor is resolved from the token, so no request shape.
5
- export function vendorGetCompanyCredentialsSummary(): internalApiResult {
6
- return new APIPromise($doGetSingle(
7
- "/vendors/me/company-credentials-summary",
8
- {}
9
- ));
4
+ // Internal-only, not part of openapi.yaml. Vendor is resolved from the token. Pass `facilityId` to
5
+ // summarize only the company credentials required at that facility instead of at every facility
6
+ // the vendor targets.
7
+ export function vendorGetCompanyCredentialsSummary(facilityId?: number): internalApiResult {
8
+ let route = "/vendors/me/company-credentials-summary";
9
+ if (facilityId !== undefined) {
10
+ route += `?${hashToQueryString({ facility_id: facilityId })}`;
11
+ }
12
+
13
+ return new APIPromise($doGetSingle(route, {}));
10
14
  }
@@ -44,8 +44,12 @@ import {
44
44
  *
45
45
  * - `vendor_target_facility.facility`
46
46
  * - `vendor_target_facility.has_screening_responses`
47
+ * - `vendor_target_facility.expiring_credential_count`
48
+ * - `vendor_target_facility.system_logo_url`
47
49
  *
48
50
  * The endpoint rejects any other value with `422 Unprocessable Entity`.
51
+ *
52
+ * Pass `include_status_counts=true` to also receive `status_counts`, the number of approved and not approved rows. The counts honor `active_facilities_only` and `facility_id`, and ignore the search, name, and status filters.
49
53
  */
50
54
  export function vendorsGetVendorTargetFacilities(
51
55
  client: GreenSecurityCore,
@@ -126,8 +130,11 @@ async function $do(
126
130
  "expand": payload.expand,
127
131
  }, { explode: false }),
128
132
  encodeFormQuery({
133
+ "active_facilities_only": payload.active_facilities_only,
129
134
  "desc": payload.desc,
135
+ "facility_id": payload.facility_id,
130
136
  "facility_name_like": payload.facility_name_like,
137
+ "include_status_counts": payload.include_status_counts,
131
138
  "items_per_page": payload.items_per_page,
132
139
  "page": payload.page,
133
140
  "search_like": payload.search_like,
@@ -36,12 +36,15 @@ import * as types$ from "../types/primitives.js";
36
36
  * can also remove the vendor from their company by sending `company_id: null`.
37
37
  *
38
38
  * From `location` this endpoint reads only `timezone`, `address1`, `address2`,
39
- * `city`, `state`, `zip`, `phone`, `mobile_phone` and `fax`. The `address` and
39
+ * `city`, `state`, `zip`, `phone`, `mobile_phone`, `fax` and `personal_email`. The `address` and
40
40
  * `country` properties of the shared `UserLocation` schema have no effect here, and
41
41
  * updating them is not supported. `state` accepts a US state or a Canadian
42
42
  * province—the vendor's country, set only at registration, is not editable
43
43
  * through this endpoint.
44
44
  *
45
+ * `location.personal_email` is stored lowercased, and a value that is not a valid
46
+ * email address, or is longer than 255 characters, gets a `422` response.
47
+ *
45
48
  * Submitting `location.zip` or `location.state` cross-checks the postal code
46
49
  * against the resulting state (using the vendor's existing value for whichever
47
50
  * of the two you omit from the request). The server rejects a code that is not shaped like a real
@@ -66,6 +69,7 @@ export function vendorsUpdateVendorDetails(
66
69
  Result<
67
70
  boolean,
68
71
  | errors.ApiErrorResponse
72
+ | errors.UnprocessableEntityOrValidationError
69
73
  | GreenSecurityError
70
74
  | ResponseValidationError
71
75
  | ConnectionError
@@ -92,6 +96,7 @@ async function $do(
92
96
  Result<
93
97
  boolean,
94
98
  | errors.ApiErrorResponse
99
+ | errors.UnprocessableEntityOrValidationError
95
100
  | GreenSecurityError
96
101
  | ResponseValidationError
97
102
  | ConnectionError
@@ -181,6 +186,7 @@ async function $do(
181
186
  const [result] = await M.match<
182
187
  boolean,
183
188
  | errors.ApiErrorResponse
189
+ | errors.UnprocessableEntityOrValidationError
184
190
  | GreenSecurityError
185
191
  | ResponseValidationError
186
192
  | ConnectionError
@@ -192,6 +198,7 @@ async function $do(
192
198
  >(
193
199
  M.json(200, types$.boolean()),
194
200
  M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
201
+ M.jsonErr(422, errors.UnprocessableEntityOrValidationError$inboundSchema),
195
202
  M.fail("4XX"),
196
203
  M.fail([500, "5XX"]),
197
204
  )(response, req, { extraFields: responseFields });
@@ -33,6 +33,13 @@ import { submitEmailStep } from "./admin-funcs/registerEmail.js";
33
33
  import { submitPassword } from "./admin-funcs/registerPassword.js";
34
34
  import { submitGeneralInfo } from "./admin-funcs/registerGeneralInfo.js";
35
35
  import { submitCompany } from "./admin-funcs/registerCompanies.js";
36
+ import {
37
+ clearComplete,
38
+ clearCreateSession,
39
+ clearGetBackgroundCheckPrefill,
40
+ clearGetStatus,
41
+ clearOptOut,
42
+ } from "./admin-funcs/clearVerifications.js";
36
43
 
37
44
  import { smartBadgePairBadge } from "./admin-funcs/smartBadgePairBadge.js";
38
45
  import { smartBadgeUnpairBadge } from "./admin-funcs/smartBadgeUnpairBadge.js";
@@ -43,6 +50,8 @@ import { notifyVendorCredentialFileUploaded } from "./admin-funcs/notifyVendorCr
43
50
  import { vendorCredentialGetFormLineItems } from "./admin-funcs/vendorCredentialGetFormLineItems.js";
44
51
  import { vendorCredentialCreateFormQuote } from "./admin-funcs/vendorCredentialCreateFormQuote.js";
45
52
  import { companyManagerGetPaymentForm } from "./admin-funcs/companyManagerGetPaymentForm.js";
53
+ import { companyManagerGetAutopay } from "./admin-funcs/companyManagerGetAutopay.js";
54
+ import { companyManagerUpdateAutopay } from "./admin-funcs/companyManagerUpdateAutopay.js";
46
55
  import { vendorGetPaymentForm } from "./admin-funcs/vendorGetPaymentForm.js";
47
56
  import { vendorGetSystemsRequiringSmartBadge } from "./admin-funcs/vendorGetSystemsRequiringSmartBadge.js";
48
57
  import { vendorGetCompanyCredentialsSummary } from "./admin-funcs/vendorGetCompanyCredentialsSummary.js";
@@ -124,6 +133,14 @@ export const __internal = {
124
133
  submitCompany
125
134
  },
126
135
 
136
+ clear: {
137
+ createSession: clearCreateSession,
138
+ complete: clearComplete,
139
+ optOut: clearOptOut,
140
+ getStatus: clearGetStatus,
141
+ getBackgroundCheckPrefill: clearGetBackgroundCheckPrefill
142
+ },
143
+
127
144
  smartBadge: {
128
145
  pairBadge: smartBadgePairBadge,
129
146
  unpairBadge: smartBadgeUnpairBadge,
@@ -161,6 +178,8 @@ export const __internal = {
161
178
 
162
179
  companyManager: {
163
180
  getPaymentForm: companyManagerGetPaymentForm,
181
+ getAutopay: companyManagerGetAutopay,
182
+ updateAutopay: companyManagerUpdateAutopay,
164
183
  },
165
184
 
166
185
  vendor: {
package/src/lib/config.ts CHANGED
@@ -79,9 +79,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
79
79
 
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
- openapiDocVersion: "0.46.0",
83
- sdkVersion: "0.47.0-beta.9",
82
+ openapiDocVersion: "0.47.0",
83
+ sdkVersion: "0.48.0-beta.0",
84
84
  genVersion: "2.948.4",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.47.0-beta.9 2.948.4 0.46.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.48.0-beta.0 2.948.4 0.47.0 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -19,6 +19,9 @@ export const Expand = {
19
19
  VendorTargetFacilityFacility: "vendor_target_facility.facility",
20
20
  VendorTargetFacilityHasScreeningResponses:
21
21
  "vendor_target_facility.has_screening_responses",
22
+ VendorTargetFacilityExpiringCredentialCount:
23
+ "vendor_target_facility.expiring_credential_count",
24
+ VendorTargetFacilitySystemLogoUrl: "vendor_target_facility.system_logo_url",
22
25
  ContactFacility: "contact.facility",
23
26
  ContactSystem: "contact.system",
24
27
  ContactDepartment: "contact.department",
@@ -177,6 +177,7 @@ export * from "./vendorscrubdetails.js";
177
177
  export * from "./vendorscrubpurchase.js";
178
178
  export * from "./vendortargetfacility.js";
179
179
  export * from "./vendortargetfacilityscreeningresponse.js";
180
+ export * from "./vendortargetfacilitystatuscounts.js";
180
181
  export * from "./vendortype.js";
181
182
  export * from "./visitorcheckin.js";
182
183
  export * from "./webhookconsumers.js";
@@ -103,6 +103,10 @@ export type AssociatedCredentials = {
103
103
  * The ID of the company that requested the credential. `null` if the credential has no company.
104
104
  */
105
105
  companyId: number | null;
106
+ /**
107
+ * The ID of the invoice the credential was raised on. This can be a child of the requested invoice. `null` if the credential has no invoice.
108
+ */
109
+ invoiceId: number | null;
106
110
  /**
107
111
  * Whether the vendor has paid the credential's invoice but has not submitted the required information.
108
112
  */
@@ -320,11 +324,13 @@ export const AssociatedCredentials$inboundSchema: z.ZodType<
320
324
  id: types.number(),
321
325
  vendor_id: types.nullable(types.number()),
322
326
  company_id: types.nullable(types.number()),
327
+ invoice_id: types.nullable(types.number()),
323
328
  awaiting_submission: types.boolean(),
324
329
  }).transform((v) => {
325
330
  return remap$(v, {
326
331
  "vendor_id": "vendorId",
327
332
  "company_id": "companyId",
333
+ "invoice_id": "invoiceId",
328
334
  "awaiting_submission": "awaitingSubmission",
329
335
  });
330
336
  });
@@ -333,6 +339,7 @@ export type AssociatedCredentials$Outbound = {
333
339
  id: number;
334
340
  vendor_id: number | null;
335
341
  company_id: number | null;
342
+ invoice_id: number | null;
336
343
  awaiting_submission: boolean;
337
344
  };
338
345
 
@@ -345,11 +352,13 @@ export const AssociatedCredentials$outboundSchema: z.ZodType<
345
352
  id: z.number().int(),
346
353
  vendorId: z.nullable(z.number().int()),
347
354
  companyId: z.nullable(z.number().int()),
355
+ invoiceId: z.nullable(z.number().int()),
348
356
  awaitingSubmission: z.boolean(),
349
357
  }).transform((v) => {
350
358
  return remap$(v, {
351
359
  vendorId: "vendor_id",
352
360
  companyId: "company_id",
361
+ invoiceId: "invoice_id",
353
362
  awaitingSubmission: "awaiting_submission",
354
363
  });
355
364
  });
@@ -85,6 +85,10 @@ export type UserDetails = {
85
85
  * First name of the user.
86
86
  */
87
87
  firstName?: string | null | undefined;
88
+ /**
89
+ * Middle name of the user, or `null` if not set. Returned only in the full user record (`expand=user`).
90
+ */
91
+ middleName?: string | null | undefined;
88
92
  /**
89
93
  * Last name of the user.
90
94
  */
@@ -93,6 +97,14 @@ export type UserDetails = {
93
97
  * Email address (not always valid)
94
98
  */
95
99
  email: string;
100
+ /**
101
+ * A vendor's personal email address, kept apart from `email`, which is
102
+ *
103
+ * @remarks
104
+ * the work email they sign in with. `null` if not set. Returned only in
105
+ * the full user record (`expand=user`).
106
+ */
107
+ personalEmail?: string | null | undefined;
96
108
  /**
97
109
  * The user's landline phone number, or `null` if not set.
98
110
  */
@@ -253,8 +265,10 @@ export const UserDetails$inboundSchema: z.ZodType<
253
265
  > = z.object({
254
266
  id: types.number(),
255
267
  first_name: z.nullable(types.string()).optional(),
268
+ middle_name: z.nullable(types.string()).optional(),
256
269
  last_name: z.nullable(types.string()).optional(),
257
270
  email: types.string(),
271
+ personal_email: z.nullable(types.string()).optional(),
258
272
  phone: z.nullable(types.string()).optional(),
259
273
  mobile_phone: z.nullable(types.string()).optional(),
260
274
  fax: z.nullable(types.string()).optional(),
@@ -274,7 +288,9 @@ export const UserDetails$inboundSchema: z.ZodType<
274
288
  }).transform((v) => {
275
289
  return remap$(v, {
276
290
  "first_name": "firstName",
291
+ "middle_name": "middleName",
277
292
  "last_name": "lastName",
293
+ "personal_email": "personalEmail",
278
294
  "mobile_phone": "mobilePhone",
279
295
  "phone_confirmed": "phoneConfirmed",
280
296
  "email_confirmed": "emailConfirmed",
@@ -212,6 +212,10 @@ export type UserLocation = {
212
212
  * The fax number of the location. `null` if not set.
213
213
  */
214
214
  fax?: string | null | undefined;
215
+ /**
216
+ * The vendor's personal email address. Only `PUT /vendors/{vendor_id_or_me}` reads it. `null` if not set.
217
+ */
218
+ personalEmail?: string | null | undefined;
215
219
  /**
216
220
  * The country of the location. `null` if not set.
217
221
  */
@@ -250,11 +254,13 @@ export const UserLocation$inboundSchema: z.ZodType<
250
254
  phone: z.nullable(types.string()).optional(),
251
255
  mobile_phone: z.nullable(types.string()).optional(),
252
256
  fax: z.nullable(types.string()).optional(),
257
+ personal_email: z.nullable(types.string()).optional(),
253
258
  country: z.nullable(types.string()).optional(),
254
259
  timezone: z.nullable(Timezone$inboundSchema).optional(),
255
260
  }).transform((v) => {
256
261
  return remap$(v, {
257
262
  "mobile_phone": "mobilePhone",
263
+ "personal_email": "personalEmail",
258
264
  });
259
265
  });
260
266
  /** @internal */
@@ -268,6 +274,7 @@ export type UserLocation$Outbound = {
268
274
  phone?: string | null | undefined;
269
275
  mobile_phone?: string | null | undefined;
270
276
  fax?: string | null | undefined;
277
+ personal_email?: string | null | undefined;
271
278
  country?: string | null | undefined;
272
279
  timezone?: string | null | undefined;
273
280
  };
@@ -287,11 +294,13 @@ export const UserLocation$outboundSchema: z.ZodType<
287
294
  phone: z.nullable(z.string()).optional(),
288
295
  mobilePhone: z.nullable(z.string()).optional(),
289
296
  fax: z.nullable(z.string()).optional(),
297
+ personalEmail: z.nullable(z.string()).optional(),
290
298
  country: z.nullable(z.string()).optional(),
291
299
  timezone: z.nullable(Timezone$outboundSchema).optional(),
292
300
  }).transform((v) => {
293
301
  return remap$(v, {
294
302
  mobilePhone: "mobile_phone",
303
+ personalEmail: "personal_email",
295
304
  });
296
305
  });
297
306
 
@@ -37,14 +37,14 @@ export type VendorPaymentResponsibilityAssignments = {
37
37
  */
38
38
  credentialingSubscriptionUserId?: number | null | undefined;
39
39
  /**
40
- * User ID responsible for Initial Hard Badge payments.
40
+ * User ID responsible for Badges payments (a vendor's first hard badge).
41
41
  *
42
42
  * @remarks
43
43
  * `null` means the vendor is responsible.
44
44
  */
45
45
  hardBadgeInitialUserId?: number | null | undefined;
46
46
  /**
47
- * User ID responsible for Additional Hard Badge payments.
47
+ * User ID responsible for Replacement Badges payments (any hard badge after the first).
48
48
  *
49
49
  * @remarks
50
50
  * `null` means the vendor is responsible.
@@ -40,6 +40,14 @@ export type VendorTargetFacility = {
40
40
  * Whether the vendor has answered at least one target-facility screening question for this facility. Present only when you pass `vendor_target_facility.has_screening_responses` to `expand`. Combined with `questions_answered` it distinguishes "View" (answered some) from "None" (no questions answered) in the individual's subscription view.
41
41
  */
42
42
  hasScreeningResponses?: boolean | undefined;
43
+ /**
44
+ * How many credentials the facility requires from the vendor have an approved version that expires within 30 days, with no newer version approved or waiting for approval. Company-owned credentials are left out when the caller is a vendor whose company has company managers. Present only when you pass `vendor_target_facility.expiring_credential_count` to `expand`.
45
+ */
46
+ expiringCredentialCount?: number | undefined;
47
+ /**
48
+ * The URL of the logo of the facility's system, or `null` when the system has no logo or the facility has no system. Present only when you pass `vendor_target_facility.system_logo_url` to `expand`.
49
+ */
50
+ systemLogoUrl?: string | null | undefined;
43
51
  /**
44
52
  * The date and time the target facility was added to the vendor, in ISO 8601 format, or `null` if not available.
45
53
  */
@@ -76,11 +84,15 @@ export const VendorTargetFacility$inboundSchema: z.ZodType<
76
84
  status: types.nullable(types.string()),
77
85
  questions_answered: types.nullable(types.boolean()),
78
86
  has_screening_responses: types.optional(types.boolean()),
87
+ expiring_credential_count: types.optional(types.number()),
88
+ system_logo_url: z.nullable(types.string()).optional(),
79
89
  date_created: z.nullable(types.date()).optional(),
80
90
  }).transform((v) => {
81
91
  return remap$(v, {
82
92
  "questions_answered": "questionsAnswered",
83
93
  "has_screening_responses": "hasScreeningResponses",
94
+ "expiring_credential_count": "expiringCredentialCount",
95
+ "system_logo_url": "systemLogoUrl",
84
96
  "date_created": "dateCreated",
85
97
  });
86
98
  });
@@ -0,0 +1,53 @@
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
+ /**
13
+ * How many of a vendor's target facility rows are approved and not approved. Returned when you pass `include_status_counts=true`.
14
+ */
15
+ export type VendorTargetFacilityStatusCounts = {
16
+ /**
17
+ * Rows with the `Approved` status.
18
+ */
19
+ approved: number;
20
+ /**
21
+ * Rows with any other status, including no status.
22
+ */
23
+ notApproved: number;
24
+ /**
25
+ * All rows the counts cover.
26
+ */
27
+ total: number;
28
+ };
29
+
30
+ /** @internal */
31
+ export const VendorTargetFacilityStatusCounts$inboundSchema: z.ZodType<
32
+ VendorTargetFacilityStatusCounts,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ approved: types.number(),
37
+ not_approved: types.number(),
38
+ total: types.number(),
39
+ }).transform((v) => {
40
+ return remap$(v, {
41
+ "not_approved": "notApproved",
42
+ });
43
+ });
44
+
45
+ export function vendorTargetFacilityStatusCountsFromJSON(
46
+ jsonString: string,
47
+ ): SafeParseResult<VendorTargetFacilityStatusCounts, SDKValidationError> {
48
+ return safeParse(
49
+ jsonString,
50
+ (x) => VendorTargetFacilityStatusCounts$inboundSchema.parse(JSON.parse(x)),
51
+ `Failed to parse 'VendorTargetFacilityStatusCounts' from JSON`,
52
+ );
53
+ }