@greensecurity/javascript-sdk 0.43.1-beta.80 → 0.43.1-beta.82

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 (191) hide show
  1. package/README.md +3 -3
  2. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  3. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +2 -5
  5. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  6. package/dist/commonjs/funcs/invoicesListInvoices.d.ts +7 -0
  7. package/dist/commonjs/funcs/invoicesListInvoices.d.ts.map +1 -1
  8. package/dist/commonjs/funcs/invoicesListInvoices.js +7 -0
  9. package/dist/commonjs/funcs/invoicesListInvoices.js.map +1 -1
  10. package/dist/commonjs/funcs/organizationsGetFacility.js +6 -2
  11. package/dist/commonjs/funcs/organizationsGetFacility.js.map +1 -1
  12. package/dist/commonjs/funcs/organizationsListOrSearchFacilities.js +3 -3
  13. package/dist/commonjs/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  14. package/dist/commonjs/funcs/vendorsListVendorCredentials.js +1 -0
  15. package/dist/commonjs/funcs/vendorsListVendorCredentials.js.map +1 -1
  16. package/dist/commonjs/funcs/vendorsListVendorInvoices.d.ts +5 -1
  17. package/dist/commonjs/funcs/vendorsListVendorInvoices.d.ts.map +1 -1
  18. package/dist/commonjs/funcs/vendorsListVendorInvoices.js +5 -1
  19. package/dist/commonjs/funcs/vendorsListVendorInvoices.js.map +1 -1
  20. package/dist/commonjs/lib/config.d.ts +2 -2
  21. package/dist/commonjs/lib/config.js +2 -2
  22. package/dist/commonjs/models/components/expand.d.ts +14 -12
  23. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/expand.js +14 -12
  25. package/dist/commonjs/models/components/expand.js.map +1 -1
  26. package/dist/commonjs/models/components/vendor.d.ts +8 -0
  27. package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/vendor.js +17 -1
  29. package/dist/commonjs/models/components/vendor.js.map +1 -1
  30. package/dist/commonjs/models/operations/getfacility.d.ts +6 -0
  31. package/dist/commonjs/models/operations/getfacility.d.ts.map +1 -1
  32. package/dist/commonjs/models/operations/getfacility.js +2 -0
  33. package/dist/commonjs/models/operations/getfacility.js.map +1 -1
  34. package/dist/commonjs/models/operations/listinvoices.d.ts +6 -3
  35. package/dist/commonjs/models/operations/listinvoices.d.ts.map +1 -1
  36. package/dist/commonjs/models/operations/listinvoices.js +1 -1
  37. package/dist/commonjs/models/operations/listinvoices.js.map +1 -1
  38. package/dist/commonjs/models/operations/listorsearchfacilities.d.ts +2 -2
  39. package/dist/commonjs/models/operations/listorsearchfacilities.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/listorsearchfacilities.js +1 -2
  41. package/dist/commonjs/models/operations/listorsearchfacilities.js.map +1 -1
  42. package/dist/commonjs/models/operations/listvendorcredentials.d.ts +5 -0
  43. package/dist/commonjs/models/operations/listvendorcredentials.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/listvendorcredentials.js +2 -0
  45. package/dist/commonjs/models/operations/listvendorcredentials.js.map +1 -1
  46. package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts +2 -2
  47. package/dist/commonjs/react-query/invoicesListInvoices.d.ts +30 -2
  48. package/dist/commonjs/react-query/invoicesListInvoices.d.ts.map +1 -1
  49. package/dist/commonjs/react-query/invoicesListInvoices.js +28 -0
  50. package/dist/commonjs/react-query/invoicesListInvoices.js.map +1 -1
  51. package/dist/commonjs/react-query/organizationsGetFacility.core.d.ts +3 -1
  52. package/dist/commonjs/react-query/organizationsGetFacility.core.d.ts.map +1 -1
  53. package/dist/commonjs/react-query/organizationsGetFacility.core.js +11 -3
  54. package/dist/commonjs/react-query/organizationsGetFacility.core.js.map +1 -1
  55. package/dist/commonjs/react-query/organizationsGetFacility.d.ts +13 -2
  56. package/dist/commonjs/react-query/organizationsGetFacility.d.ts.map +1 -1
  57. package/dist/commonjs/react-query/organizationsGetFacility.js.map +1 -1
  58. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.d.ts +2 -2
  59. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.d.ts.map +1 -1
  60. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.js +2 -2
  61. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.core.js.map +1 -1
  62. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.d.ts +2 -2
  63. package/dist/commonjs/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
  64. package/dist/commonjs/react-query/vendorsListVendorCredentials.core.d.ts +2 -0
  65. package/dist/commonjs/react-query/vendorsListVendorCredentials.core.d.ts.map +1 -1
  66. package/dist/commonjs/react-query/vendorsListVendorCredentials.core.js +2 -0
  67. package/dist/commonjs/react-query/vendorsListVendorCredentials.core.js.map +1 -1
  68. package/dist/commonjs/react-query/vendorsListVendorCredentials.d.ts +2 -0
  69. package/dist/commonjs/react-query/vendorsListVendorCredentials.d.ts.map +1 -1
  70. package/dist/commonjs/react-query/vendorsListVendorCredentials.js.map +1 -1
  71. package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts +20 -4
  72. package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
  73. package/dist/commonjs/react-query/vendorsListVendorInvoices.js +20 -4
  74. package/dist/commonjs/react-query/vendorsListVendorInvoices.js.map +1 -1
  75. package/dist/commonjs/sdk/invoices.d.ts +7 -0
  76. package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
  77. package/dist/commonjs/sdk/invoices.js +7 -0
  78. package/dist/commonjs/sdk/invoices.js.map +1 -1
  79. package/dist/commonjs/sdk/vendors.d.ts +5 -1
  80. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  81. package/dist/commonjs/sdk/vendors.js +5 -1
  82. package/dist/commonjs/sdk/vendors.js.map +1 -1
  83. package/dist/esm/__tests__/webhooks.test.js +1 -1
  84. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  85. package/dist/esm/__tests__/zones.test.js +2 -5
  86. package/dist/esm/__tests__/zones.test.js.map +1 -1
  87. package/dist/esm/funcs/invoicesListInvoices.d.ts +7 -0
  88. package/dist/esm/funcs/invoicesListInvoices.d.ts.map +1 -1
  89. package/dist/esm/funcs/invoicesListInvoices.js +7 -0
  90. package/dist/esm/funcs/invoicesListInvoices.js.map +1 -1
  91. package/dist/esm/funcs/organizationsGetFacility.js +7 -3
  92. package/dist/esm/funcs/organizationsGetFacility.js.map +1 -1
  93. package/dist/esm/funcs/organizationsListOrSearchFacilities.js +3 -3
  94. package/dist/esm/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  95. package/dist/esm/funcs/vendorsListVendorCredentials.js +1 -0
  96. package/dist/esm/funcs/vendorsListVendorCredentials.js.map +1 -1
  97. package/dist/esm/funcs/vendorsListVendorInvoices.d.ts +5 -1
  98. package/dist/esm/funcs/vendorsListVendorInvoices.d.ts.map +1 -1
  99. package/dist/esm/funcs/vendorsListVendorInvoices.js +5 -1
  100. package/dist/esm/funcs/vendorsListVendorInvoices.js.map +1 -1
  101. package/dist/esm/lib/config.d.ts +2 -2
  102. package/dist/esm/lib/config.js +2 -2
  103. package/dist/esm/models/components/expand.d.ts +14 -12
  104. package/dist/esm/models/components/expand.d.ts.map +1 -1
  105. package/dist/esm/models/components/expand.js +14 -12
  106. package/dist/esm/models/components/expand.js.map +1 -1
  107. package/dist/esm/models/components/vendor.d.ts +8 -0
  108. package/dist/esm/models/components/vendor.d.ts.map +1 -1
  109. package/dist/esm/models/components/vendor.js +15 -0
  110. package/dist/esm/models/components/vendor.js.map +1 -1
  111. package/dist/esm/models/operations/getfacility.d.ts +6 -0
  112. package/dist/esm/models/operations/getfacility.d.ts.map +1 -1
  113. package/dist/esm/models/operations/getfacility.js +2 -0
  114. package/dist/esm/models/operations/getfacility.js.map +1 -1
  115. package/dist/esm/models/operations/listinvoices.d.ts +6 -3
  116. package/dist/esm/models/operations/listinvoices.d.ts.map +1 -1
  117. package/dist/esm/models/operations/listinvoices.js +1 -1
  118. package/dist/esm/models/operations/listinvoices.js.map +1 -1
  119. package/dist/esm/models/operations/listorsearchfacilities.d.ts +2 -2
  120. package/dist/esm/models/operations/listorsearchfacilities.d.ts.map +1 -1
  121. package/dist/esm/models/operations/listorsearchfacilities.js +1 -2
  122. package/dist/esm/models/operations/listorsearchfacilities.js.map +1 -1
  123. package/dist/esm/models/operations/listvendorcredentials.d.ts +5 -0
  124. package/dist/esm/models/operations/listvendorcredentials.d.ts.map +1 -1
  125. package/dist/esm/models/operations/listvendorcredentials.js +2 -0
  126. package/dist/esm/models/operations/listvendorcredentials.js.map +1 -1
  127. package/dist/esm/react-query/invoicesListInvoices.core.d.ts +2 -2
  128. package/dist/esm/react-query/invoicesListInvoices.d.ts +30 -2
  129. package/dist/esm/react-query/invoicesListInvoices.d.ts.map +1 -1
  130. package/dist/esm/react-query/invoicesListInvoices.js +28 -0
  131. package/dist/esm/react-query/invoicesListInvoices.js.map +1 -1
  132. package/dist/esm/react-query/organizationsGetFacility.core.d.ts +3 -1
  133. package/dist/esm/react-query/organizationsGetFacility.core.d.ts.map +1 -1
  134. package/dist/esm/react-query/organizationsGetFacility.core.js +11 -3
  135. package/dist/esm/react-query/organizationsGetFacility.core.js.map +1 -1
  136. package/dist/esm/react-query/organizationsGetFacility.d.ts +13 -2
  137. package/dist/esm/react-query/organizationsGetFacility.d.ts.map +1 -1
  138. package/dist/esm/react-query/organizationsGetFacility.js.map +1 -1
  139. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.d.ts +2 -2
  140. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.d.ts.map +1 -1
  141. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.js +2 -2
  142. package/dist/esm/react-query/organizationsListOrSearchFacilities.core.js.map +1 -1
  143. package/dist/esm/react-query/organizationsListOrSearchFacilities.d.ts +2 -2
  144. package/dist/esm/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
  145. package/dist/esm/react-query/vendorsListVendorCredentials.core.d.ts +2 -0
  146. package/dist/esm/react-query/vendorsListVendorCredentials.core.d.ts.map +1 -1
  147. package/dist/esm/react-query/vendorsListVendorCredentials.core.js +2 -0
  148. package/dist/esm/react-query/vendorsListVendorCredentials.core.js.map +1 -1
  149. package/dist/esm/react-query/vendorsListVendorCredentials.d.ts +2 -0
  150. package/dist/esm/react-query/vendorsListVendorCredentials.d.ts.map +1 -1
  151. package/dist/esm/react-query/vendorsListVendorCredentials.js.map +1 -1
  152. package/dist/esm/react-query/vendorsListVendorInvoices.d.ts +20 -4
  153. package/dist/esm/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
  154. package/dist/esm/react-query/vendorsListVendorInvoices.js +20 -4
  155. package/dist/esm/react-query/vendorsListVendorInvoices.js.map +1 -1
  156. package/dist/esm/sdk/invoices.d.ts +7 -0
  157. package/dist/esm/sdk/invoices.d.ts.map +1 -1
  158. package/dist/esm/sdk/invoices.js +7 -0
  159. package/dist/esm/sdk/invoices.js.map +1 -1
  160. package/dist/esm/sdk/vendors.d.ts +5 -1
  161. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  162. package/dist/esm/sdk/vendors.js +5 -1
  163. package/dist/esm/sdk/vendors.js.map +1 -1
  164. package/examples/package-lock.json +1 -1
  165. package/jsr.json +1 -1
  166. package/package.json +1 -1
  167. package/src/__tests__/webhooks.test.ts +1 -1
  168. package/src/__tests__/zones.test.ts +2 -5
  169. package/src/funcs/invoicesListInvoices.ts +7 -0
  170. package/src/funcs/organizationsGetFacility.ts +8 -3
  171. package/src/funcs/organizationsListOrSearchFacilities.ts +3 -3
  172. package/src/funcs/vendorsListVendorCredentials.ts +1 -0
  173. package/src/funcs/vendorsListVendorInvoices.ts +5 -1
  174. package/src/lib/config.ts +2 -2
  175. package/src/models/components/expand.ts +14 -12
  176. package/src/models/components/vendor.ts +29 -0
  177. package/src/models/operations/getfacility.ts +7 -0
  178. package/src/models/operations/listinvoices.ts +7 -4
  179. package/src/models/operations/listorsearchfacilities.ts +3 -4
  180. package/src/models/operations/listvendorcredentials.ts +7 -0
  181. package/src/react-query/invoicesListInvoices.core.ts +2 -2
  182. package/src/react-query/invoicesListInvoices.ts +30 -2
  183. package/src/react-query/organizationsGetFacility.core.ts +14 -3
  184. package/src/react-query/organizationsGetFacility.ts +8 -2
  185. package/src/react-query/organizationsListOrSearchFacilities.core.ts +4 -4
  186. package/src/react-query/organizationsListOrSearchFacilities.ts +2 -2
  187. package/src/react-query/vendorsListVendorCredentials.core.ts +4 -0
  188. package/src/react-query/vendorsListVendorCredentials.ts +2 -0
  189. package/src/react-query/vendorsListVendorInvoices.ts +20 -4
  190. package/src/sdk/invoices.ts +7 -0
  191. package/src/sdk/vendors.ts +5 -1
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { GreenSecurityCore } from "../core.js";
6
- import { encodeSimple } from "../lib/encodings.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
7
  import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
@@ -98,6 +98,10 @@ async function $do(
98
98
 
99
99
  const path = pathToFunc("/facilities/{id}")(pathParams);
100
100
 
101
+ const query = encodeFormQuery({
102
+ "expand": payload.expand,
103
+ }, { explode: false });
104
+
101
105
  const headers = new Headers(compactMap({
102
106
  Accept: "application/json",
103
107
  }));
@@ -126,6 +130,7 @@ async function $do(
126
130
  baseURL: options?.serverURL,
127
131
  path: path,
128
132
  headers: headers,
133
+ query: query,
129
134
  body: body,
130
135
  userAgent: client._options.userAgent,
131
136
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
@@ -137,7 +142,7 @@ async function $do(
137
142
 
138
143
  const doResult = await client._do(req, {
139
144
  context,
140
- errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
145
+ errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
141
146
  retryConfig: context.retryConfig,
142
147
  retryCodes: context.retryCodes,
143
148
  });
@@ -163,7 +168,7 @@ async function $do(
163
168
  | SDKValidationError
164
169
  >(
165
170
  M.json(200, components.Facility$inboundSchema),
166
- M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
171
+ M.jsonErr([400, 401, 403, 404, 422], errors.ApiErrorResponse$inboundSchema),
167
172
  M.fail("4XX"),
168
173
  M.fail([500, "5XX"]),
169
174
  )(response, req, { extraFields: responseFields });
@@ -122,7 +122,6 @@ async function $do(
122
122
  "expand": payload.expand,
123
123
  }, { explode: false }),
124
124
  encodeFormQuery({
125
- "active_status": payload.active_status,
126
125
  "desc": payload.desc,
127
126
  "items_per_page": payload.items_per_page,
128
127
  "latitude": payload.latitude,
@@ -131,6 +130,7 @@ async function $do(
131
130
  "page": payload.page,
132
131
  "sort": payload.sort,
133
132
  "state_like": payload.state_like,
133
+ "status": payload.status,
134
134
  "system_id": payload.system_id,
135
135
  }),
136
136
  );
@@ -175,7 +175,7 @@ async function $do(
175
175
 
176
176
  const doResult = await client._do(req, {
177
177
  context,
178
- errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
178
+ errorCodes: ["400", "401", "403", "422", "4XX", "500", "5XX"],
179
179
  retryConfig: context.retryConfig,
180
180
  retryCodes: context.retryCodes,
181
181
  });
@@ -203,7 +203,7 @@ async function $do(
203
203
  M.json(200, operations.ListOrSearchFacilitiesResponse$inboundSchema, {
204
204
  key: "Result",
205
205
  }),
206
- M.jsonErr([400, 401, 403], errors.ApiErrorResponse$inboundSchema),
206
+ M.jsonErr([400, 401, 403, 422], errors.ApiErrorResponse$inboundSchema),
207
207
  M.fail("4XX"),
208
208
  M.fail([500, "5XX"]),
209
209
  )(response, req, { extraFields: responseFields });
@@ -119,6 +119,7 @@ async function $do(
119
119
  "include_cc": payload.include_cc,
120
120
  "include_vc": payload.include_vc,
121
121
  "items_per_page": payload.items_per_page,
122
+ "name_like": payload.name_like,
122
123
  "page": payload.page,
123
124
  "sort": payload.sort,
124
125
  "urgent": payload.urgent,
@@ -36,12 +36,16 @@ import {
36
36
  * List vendor invoices
37
37
  *
38
38
  * @remarks
39
- * List invoices for Vendors
39
+ * List invoices for Vendors.
40
+ *
41
+ * Deprecated: use `GET /invoices` instead, which supports both vendors and other roles through role-based scoping and the `id` query parameter for vendors.
40
42
  *
41
43
  * Available `expand` scopes are:
42
44
  *
43
45
  * invoice.line_items
44
46
  * invoice.may_pay_invoice
47
+ *
48
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
45
49
  */
46
50
  export function vendorsListVendorInvoices(
47
51
  client: GreenSecurityCore,
package/src/lib/config.ts CHANGED
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
82
  openapiDocVersion: "0.0.11",
83
- sdkVersion: "0.43.1-beta.78",
83
+ sdkVersion: "0.43.1-beta.80",
84
84
  genVersion: "2.794.1",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.43.1-beta.78 2.794.1 0.0.11 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.43.1-beta.80 2.794.1 0.0.11 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -25,27 +25,29 @@ export const Expand = {
25
25
  FacilityVendorPolicy: "facility.vendor_policy",
26
26
  FacilityVisitorPolicy: "facility.visitor_policy",
27
27
  FacilityWorkflow: "facility.workflow",
28
- VendorUser: "vendor.user",
29
- VendorVendorType: "vendor.vendor_type",
30
- VendorVendorJob: "vendor.vendor_job",
31
- VendorPaymentProfile: "vendor.payment_profile",
28
+ VendorApprovedCalendaringFacilities: "vendor.approved_calendaring_facilities",
29
+ VendorBackgroundCheckDateExpires: "vendor.background_check_date_expires",
30
+ VendorBadgeDetails: "vendor.badge_details",
31
+ VendorCompany: "vendor.company",
32
+ VendorCredentialingSubscription: "vendor.credentialing_subscription",
33
+ VendorCreditBalance: "vendor.credit_balance",
34
+ VendorHasCredentialedFacilities: "vendor.has_credentialed_facilities",
35
+ VendorHasEmeraldStatus: "vendor.has_emerald_status",
32
36
  VendorImageUrls: "vendor.image_urls",
33
37
  VendorPrimaryFacility: "vendor.primary_facility",
34
38
  VendorPrimaryDepartment: "vendor.primary_department",
35
- VendorCompany: "vendor.company",
36
- VendorCredentialingSubscription: "vendor.credentialing_subscription",
37
39
  VendorScrubsSubscription: "vendor.scrubs_subscription",
40
+ VendorPaymentProfile: "vendor.payment_profile",
38
41
  VendorPaymentResponsibility: "vendor.payment_responsibility",
39
- VendorBackgroundCheckDateExpires: "vendor.background_check_date_expires",
40
- VendorCreditBalance: "vendor.credit_balance",
42
+ VendorPendingInvoice: "vendor.pending_invoice",
41
43
  VendorRegistrationData: "vendor.registration_data",
42
44
  VendorRegistrationFinished: "vendor.registration_finished",
45
+ VendorRequiredBadgeType: "vendor.required_badge_type",
43
46
  VendorTargetFacilities: "vendor.target_facilities",
44
- VendorApprovedCalendaringFacilities: "vendor.approved_calendaring_facilities",
45
- VendorPendingInvoice: "vendor.pending_invoice",
47
+ VendorUser: "vendor.user",
46
48
  VendorVendorGroups: "vendor.vendor_groups",
47
- VendorHasCredentialedFacilities: "vendor.has_credentialed_facilities",
48
- VendorHasEmeraldStatus: "vendor.has_emerald_status",
49
+ VendorVendorJob: "vendor.vendor_job",
50
+ VendorVendorType: "vendor.vendor_type",
49
51
  SupportArticleDescription: "support_article.description",
50
52
  SupportArticlePublished: "support_article.published",
51
53
  SupportArticleNotes: "support_article.notes",
@@ -32,6 +32,11 @@ import {
32
32
  } from "./vendorjobtitle.js";
33
33
  import { VendorType, VendorType$inboundSchema } from "./vendortype.js";
34
34
 
35
+ export type Badge = {
36
+ badgeType?: string | undefined;
37
+ requiredBadgeType?: string | null | undefined;
38
+ };
39
+
35
40
  export type One = {
36
41
  id?: number | undefined;
37
42
  firstName?: string | null | undefined;
@@ -119,6 +124,7 @@ export type PendingInvoice = Invoice | number;
119
124
  */
120
125
  export type Vendor = {
121
126
  id?: number | undefined;
127
+ badge?: Badge | null | undefined;
122
128
  emailRecepient?: string | null | undefined;
123
129
  sendWeeklySummaryEmail?: boolean | null | undefined;
124
130
  title?: string | null | undefined;
@@ -183,6 +189,28 @@ export type Vendor = {
183
189
  targetFacilitiesUpdated?: string | null | undefined;
184
190
  };
185
191
 
192
+ /** @internal */
193
+ export const Badge$inboundSchema: z.ZodType<Badge, z.ZodTypeDef, unknown> = z
194
+ .object({
195
+ badge_type: types.optional(types.string()),
196
+ required_badge_type: z.nullable(types.string()).optional(),
197
+ }).transform((v) => {
198
+ return remap$(v, {
199
+ "badge_type": "badgeType",
200
+ "required_badge_type": "requiredBadgeType",
201
+ });
202
+ });
203
+
204
+ export function badgeFromJSON(
205
+ jsonString: string,
206
+ ): SafeParseResult<Badge, SDKValidationError> {
207
+ return safeParse(
208
+ jsonString,
209
+ (x) => Badge$inboundSchema.parse(JSON.parse(x)),
210
+ `Failed to parse 'Badge' from JSON`,
211
+ );
212
+ }
213
+
186
214
  /** @internal */
187
215
  export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
188
216
  .object({
@@ -492,6 +520,7 @@ export function pendingInvoiceFromJSON(
492
520
  export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
493
521
  .object({
494
522
  id: types.optional(types.number()),
523
+ badge: z.nullable(z.lazy(() => Badge$inboundSchema)).optional(),
495
524
  email_recepient: z.nullable(types.string()).optional(),
496
525
  send_weekly_summary_email: z.nullable(types.boolean()).optional(),
497
526
  title: z.nullable(types.string()).optional(),
@@ -3,17 +3,23 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import * as components from "../components/index.js";
6
7
 
7
8
  export type GetFacilityRequest = {
8
9
  /**
9
10
  * The identifier of the object
10
11
  */
11
12
  id: number;
13
+ /**
14
+ * An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
15
+ */
16
+ expand?: Array<components.Expand> | undefined;
12
17
  };
13
18
 
14
19
  /** @internal */
15
20
  export type GetFacilityRequest$Outbound = {
16
21
  id: number;
22
+ expand?: Array<string> | undefined;
17
23
  };
18
24
 
19
25
  /** @internal */
@@ -23,6 +29,7 @@ export const GetFacilityRequest$outboundSchema: z.ZodType<
23
29
  GetFacilityRequest
24
30
  > = z.object({
25
31
  id: z.number().int(),
32
+ expand: z.array(components.Expand$outboundSchema).optional(),
26
33
  });
27
34
 
28
35
  export function getFacilityRequestToJSON(
@@ -44,9 +44,12 @@ export type ListInvoicesRequest = {
44
44
  */
45
45
  representative?: string | undefined;
46
46
  /**
47
- * Filter by a specific authorized vendor ID.
47
+ * For vendors, "me" or the vendor ID to scope the request.
48
+ *
49
+ * @remarks
50
+ * For API users, the vendor ID (integer) to filter by.
48
51
  */
49
- vendorId?: number | undefined;
52
+ vendorId?: string | undefined;
50
53
  /**
51
54
  * Filter by a specific authorized company ID.
52
55
  */
@@ -86,7 +89,7 @@ export type ListInvoicesRequest$Outbound = {
86
89
  invoice_number?: string | undefined;
87
90
  invoice_financial_status?: string | undefined;
88
91
  representative?: string | undefined;
89
- vendor_id?: number | undefined;
92
+ vendor_id?: string | undefined;
90
93
  company_id?: number | undefined;
91
94
  facility_id?: number | undefined;
92
95
  system_id?: number | undefined;
@@ -107,7 +110,7 @@ export const ListInvoicesRequest$outboundSchema: z.ZodType<
107
110
  invoiceFinancialStatus: components.InvoiceFinancialStatus$outboundSchema
108
111
  .optional(),
109
112
  representative: z.string().optional(),
110
- vendorId: z.number().int().optional(),
113
+ vendorId: z.string().optional(),
111
114
  companyId: z.number().int().optional(),
112
115
  facilityId: z.number().int().optional(),
113
116
  systemId: z.number().int().optional(),
@@ -50,7 +50,7 @@ export type ListOrSearchFacilitiesRequest = {
50
50
  *
51
51
  * > NOTE: There may be times where it makes sense to show only active objects, active and inactive, or deleted. Some objects may have a separate property for `visible` which should override this state.
52
52
  */
53
- activeStatus?: components.ActiveStatus | undefined;
53
+ status?: components.ActiveStatus | undefined;
54
54
  /**
55
55
  * The latitude of the current Geo coordinates
56
56
  */
@@ -86,7 +86,7 @@ export type ListOrSearchFacilitiesRequest$Outbound = {
86
86
  system_id?: number | undefined;
87
87
  name_like?: string | undefined;
88
88
  state_like?: string | undefined;
89
- active_status: string;
89
+ status: string;
90
90
  latitude?: number | undefined;
91
91
  longitude?: number | undefined;
92
92
  };
@@ -105,7 +105,7 @@ export const ListOrSearchFacilitiesRequest$outboundSchema: z.ZodType<
105
105
  systemId: z.number().int().optional(),
106
106
  nameLike: z.string().optional(),
107
107
  stateLike: z.string().optional(),
108
- activeStatus: components.ActiveStatus$outboundSchema.default("Active"),
108
+ status: components.ActiveStatus$outboundSchema.default("Active"),
109
109
  latitude: z.number().optional(),
110
110
  longitude: z.number().optional(),
111
111
  }).transform((v) => {
@@ -114,7 +114,6 @@ export const ListOrSearchFacilitiesRequest$outboundSchema: z.ZodType<
114
114
  systemId: "system_id",
115
115
  nameLike: "name_like",
116
116
  stateLike: "state_like",
117
- activeStatus: "active_status",
118
117
  });
119
118
  });
120
119
 
@@ -31,6 +31,10 @@ export type ListVendorCredentialsRequest = {
31
31
  * Search by credential status (Pending Approval, Declined, Expired...)
32
32
  */
33
33
  credentialStatus?: components.CredentialStatus | undefined;
34
+ /**
35
+ * A partial string to search in the object name. Do not include any wildcard characters. Searches are not case-sensitive by default.
36
+ */
37
+ nameLike?: string | undefined;
34
38
  /**
35
39
  * The ID associated with a medical facility
36
40
  */
@@ -94,6 +98,7 @@ export type ListVendorCredentialsRequest$Outbound = {
94
98
  page?: number | undefined;
95
99
  items_per_page?: number | undefined;
96
100
  credential_status?: string | undefined;
101
+ name_like?: string | undefined;
97
102
  facility_id?: number | null | undefined;
98
103
  include_vc?: number | undefined;
99
104
  include_cc?: number | undefined;
@@ -113,6 +118,7 @@ export const ListVendorCredentialsRequest$outboundSchema: z.ZodType<
113
118
  page: z.number().int().optional(),
114
119
  itemsPerPage: z.number().int().optional(),
115
120
  credentialStatus: components.CredentialStatus$outboundSchema.optional(),
121
+ nameLike: z.string().optional(),
116
122
  facilityId: z.nullable(z.number()).optional(),
117
123
  includeVc: z.number().optional(),
118
124
  includeCc: z.number().optional(),
@@ -123,6 +129,7 @@ export const ListVendorCredentialsRequest$outboundSchema: z.ZodType<
123
129
  return remap$(v, {
124
130
  itemsPerPage: "items_per_page",
125
131
  credentialStatus: "credential_status",
132
+ nameLike: "name_like",
126
133
  facilityId: "facility_id",
127
134
  includeVc: "include_vc",
128
135
  includeCc: "include_cc",
@@ -174,7 +174,7 @@ export function queryKeyInvoicesListInvoices(
174
174
  invoiceNumber?: string | undefined;
175
175
  invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
176
176
  representative?: string | undefined;
177
- vendorId?: number | undefined;
177
+ vendorId?: string | undefined;
178
178
  companyId?: number | undefined;
179
179
  facilityId?: number | undefined;
180
180
  systemId?: number | undefined;
@@ -198,7 +198,7 @@ export function queryKeyInvoicesListInvoicesInfinite(
198
198
  invoiceNumber?: string | undefined;
199
199
  invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
200
200
  representative?: string | undefined;
201
- vendorId?: number | undefined;
201
+ vendorId?: string | undefined;
202
202
  companyId?: number | undefined;
203
203
  facilityId?: number | undefined;
204
204
  systemId?: number | undefined;
@@ -69,6 +69,13 @@ export {
69
69
  * - invoice.custom_fields
70
70
  * - invoice.invoice_type
71
71
  * - invoice.may_pay_invoice
72
+ *
73
+ * Available `sort` values are:
74
+ * - id (default)
75
+ * - invoice_number
76
+ * - date (processed date)
77
+ * - financial_status
78
+ * - amount
72
79
  */
73
80
  export function useInvoicesListInvoices(
74
81
  request: operations.ListInvoicesRequest,
@@ -105,6 +112,13 @@ export function useInvoicesListInvoices(
105
112
  * - invoice.custom_fields
106
113
  * - invoice.invoice_type
107
114
  * - invoice.may_pay_invoice
115
+ *
116
+ * Available `sort` values are:
117
+ * - id (default)
118
+ * - invoice_number
119
+ * - date (processed date)
120
+ * - financial_status
121
+ * - amount
108
122
  */
109
123
  export function useInvoicesListInvoicesSuspense(
110
124
  request: operations.ListInvoicesRequest,
@@ -141,6 +155,13 @@ export function useInvoicesListInvoicesSuspense(
141
155
  * - invoice.custom_fields
142
156
  * - invoice.invoice_type
143
157
  * - invoice.may_pay_invoice
158
+ *
159
+ * Available `sort` values are:
160
+ * - id (default)
161
+ * - invoice_number
162
+ * - date (processed date)
163
+ * - financial_status
164
+ * - amount
144
165
  */
145
166
  export function useInvoicesListInvoicesInfinite(
146
167
  request: operations.ListInvoicesRequest,
@@ -194,6 +215,13 @@ export function useInvoicesListInvoicesInfinite(
194
215
  * - invoice.custom_fields
195
216
  * - invoice.invoice_type
196
217
  * - invoice.may_pay_invoice
218
+ *
219
+ * Available `sort` values are:
220
+ * - id (default)
221
+ * - invoice_number
222
+ * - date (processed date)
223
+ * - financial_status
224
+ * - amount
197
225
  */
198
226
  export function useInvoicesListInvoicesInfiniteSuspense(
199
227
  request: operations.ListInvoicesRequest,
@@ -241,7 +269,7 @@ export function setInvoicesListInvoicesData(
241
269
  invoiceNumber?: string | undefined;
242
270
  invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
243
271
  representative?: string | undefined;
244
- vendorId?: number | undefined;
272
+ vendorId?: string | undefined;
245
273
  companyId?: number | undefined;
246
274
  facilityId?: number | undefined;
247
275
  systemId?: number | undefined;
@@ -266,7 +294,7 @@ export function invalidateInvoicesListInvoices(
266
294
  invoiceNumber?: string | undefined;
267
295
  invoiceFinancialStatus?: components.InvoiceFinancialStatus | undefined;
268
296
  representative?: string | undefined;
269
- vendorId?: number | undefined;
297
+ vendorId?: string | undefined;
270
298
  companyId?: number | undefined;
271
299
  facilityId?: number | undefined;
272
300
  systemId?: number | undefined;
@@ -42,7 +42,9 @@ export function buildOrganizationsGetFacilityQuery(
42
42
  ) => Promise<OrganizationsGetFacilityQueryData>;
43
43
  } {
44
44
  return {
45
- queryKey: queryKeyOrganizationsGetFacility(request.id),
45
+ queryKey: queryKeyOrganizationsGetFacility(request.id, {
46
+ expand: request.expand,
47
+ }),
46
48
  queryFn: async function organizationsGetFacilityQueryFn(
47
49
  ctx,
48
50
  ): Promise<OrganizationsGetFacilityQueryData> {
@@ -66,6 +68,15 @@ export function buildOrganizationsGetFacilityQuery(
66
68
  };
67
69
  }
68
70
 
69
- export function queryKeyOrganizationsGetFacility(id: number): QueryKey {
70
- return ["@greensecurity/javascript-sdk", "organizations", "getFacility", id];
71
+ export function queryKeyOrganizationsGetFacility(
72
+ id: number,
73
+ parameters: { expand?: Array<components.Expand> | undefined },
74
+ ): QueryKey {
75
+ return [
76
+ "@greensecurity/javascript-sdk",
77
+ "organizations",
78
+ "getFacility",
79
+ id,
80
+ parameters,
81
+ ];
71
82
  }
@@ -10,6 +10,7 @@ import {
10
10
  useSuspenseQuery,
11
11
  UseSuspenseQueryResult,
12
12
  } from "@tanstack/react-query";
13
+ import * as components from "../models/components/index.js";
13
14
  import * as operations from "../models/operations/index.js";
14
15
  import { useGreenSecurityContext } from "./_context.js";
15
16
  import {
@@ -74,7 +75,10 @@ export function useOrganizationsGetFacilitySuspense(
74
75
 
75
76
  export function setOrganizationsGetFacilityData(
76
77
  client: QueryClient,
77
- queryKeyBase: [id: number],
78
+ queryKeyBase: [
79
+ id: number,
80
+ parameters: { expand?: Array<components.Expand> | undefined },
81
+ ],
78
82
  data: OrganizationsGetFacilityQueryData,
79
83
  ): OrganizationsGetFacilityQueryData | undefined {
80
84
  const key = queryKeyOrganizationsGetFacility(...queryKeyBase);
@@ -84,7 +88,9 @@ export function setOrganizationsGetFacilityData(
84
88
 
85
89
  export function invalidateOrganizationsGetFacility(
86
90
  client: QueryClient,
87
- queryKeyBase: TupleToPrefixes<[id: number]>,
91
+ queryKeyBase: TupleToPrefixes<
92
+ [id: number, parameters: { expand?: Array<components.Expand> | undefined }]
93
+ >,
88
94
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
89
95
  ): Promise<void> {
90
96
  return client.invalidateQueries({
@@ -84,7 +84,7 @@ export function buildOrganizationsListOrSearchFacilitiesQuery(
84
84
  systemId: request.systemId,
85
85
  nameLike: request.nameLike,
86
86
  stateLike: request.stateLike,
87
- activeStatus: request.activeStatus,
87
+ status: request.status,
88
88
  latitude: request.latitude,
89
89
  longitude: request.longitude,
90
90
  }),
@@ -134,7 +134,7 @@ export function buildOrganizationsListOrSearchFacilitiesInfiniteQuery(
134
134
  systemId: request.systemId,
135
135
  nameLike: request.nameLike,
136
136
  stateLike: request.stateLike,
137
- activeStatus: request.activeStatus,
137
+ status: request.status,
138
138
  latitude: request.latitude,
139
139
  longitude: request.longitude,
140
140
  }),
@@ -182,7 +182,7 @@ export function queryKeyOrganizationsListOrSearchFacilities(
182
182
  systemId?: number | undefined;
183
183
  nameLike?: string | undefined;
184
184
  stateLike?: string | undefined;
185
- activeStatus?: components.ActiveStatus | undefined;
185
+ status?: components.ActiveStatus | undefined;
186
186
  latitude?: number | undefined;
187
187
  longitude?: number | undefined;
188
188
  },
@@ -205,7 +205,7 @@ export function queryKeyOrganizationsListOrSearchFacilitiesInfinite(
205
205
  systemId?: number | undefined;
206
206
  nameLike?: string | undefined;
207
207
  stateLike?: string | undefined;
208
- activeStatus?: components.ActiveStatus | undefined;
208
+ status?: components.ActiveStatus | undefined;
209
209
  latitude?: number | undefined;
210
210
  longitude?: number | undefined;
211
211
  },
@@ -237,7 +237,7 @@ export function setOrganizationsListOrSearchFacilitiesData(
237
237
  systemId?: number | undefined;
238
238
  nameLike?: string | undefined;
239
239
  stateLike?: string | undefined;
240
- activeStatus?: components.ActiveStatus | undefined;
240
+ status?: components.ActiveStatus | undefined;
241
241
  latitude?: number | undefined;
242
242
  longitude?: number | undefined;
243
243
  },
@@ -264,7 +264,7 @@ export function invalidateOrganizationsListOrSearchFacilities(
264
264
  systemId?: number | undefined;
265
265
  nameLike?: string | undefined;
266
266
  stateLike?: string | undefined;
267
- activeStatus?: components.ActiveStatus | undefined;
267
+ status?: components.ActiveStatus | undefined;
268
268
  latitude?: number | undefined;
269
269
  longitude?: number | undefined;
270
270
  }]
@@ -80,6 +80,7 @@ export function buildVendorsListVendorCredentialsQuery(
80
80
  page: request.page,
81
81
  itemsPerPage: request.itemsPerPage,
82
82
  credentialStatus: request.credentialStatus,
83
+ nameLike: request.nameLike,
83
84
  facilityId: request.facilityId,
84
85
  includeVc: request.includeVc,
85
86
  includeCc: request.includeCc,
@@ -129,6 +130,7 @@ export function buildVendorsListVendorCredentialsInfiniteQuery(
129
130
  page: request.page,
130
131
  itemsPerPage: request.itemsPerPage,
131
132
  credentialStatus: request.credentialStatus,
133
+ nameLike: request.nameLike,
132
134
  facilityId: request.facilityId,
133
135
  includeVc: request.includeVc,
134
136
  includeCc: request.includeCc,
@@ -177,6 +179,7 @@ export function queryKeyVendorsListVendorCredentials(
177
179
  page?: number | undefined;
178
180
  itemsPerPage?: number | undefined;
179
181
  credentialStatus?: components.CredentialStatus | undefined;
182
+ nameLike?: string | undefined;
180
183
  facilityId?: number | null | undefined;
181
184
  includeVc?: number | undefined;
182
185
  includeCc?: number | undefined;
@@ -201,6 +204,7 @@ export function queryKeyVendorsListVendorCredentialsInfinite(
201
204
  page?: number | undefined;
202
205
  itemsPerPage?: number | undefined;
203
206
  credentialStatus?: components.CredentialStatus | undefined;
207
+ nameLike?: string | undefined;
204
208
  facilityId?: number | null | undefined;
205
209
  includeVc?: number | undefined;
206
210
  includeCc?: number | undefined;
@@ -181,6 +181,7 @@ export function setVendorsListVendorCredentialsData(
181
181
  page?: number | undefined;
182
182
  itemsPerPage?: number | undefined;
183
183
  credentialStatus?: components.CredentialStatus | undefined;
184
+ nameLike?: string | undefined;
184
185
  facilityId?: number | null | undefined;
185
186
  includeVc?: number | undefined;
186
187
  includeCc?: number | undefined;
@@ -206,6 +207,7 @@ export function invalidateVendorsListVendorCredentials(
206
207
  page?: number | undefined;
207
208
  itemsPerPage?: number | undefined;
208
209
  credentialStatus?: components.CredentialStatus | undefined;
210
+ nameLike?: string | undefined;
209
211
  facilityId?: number | null | undefined;
210
212
  includeVc?: number | undefined;
211
213
  includeCc?: number | undefined;