@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.
Files changed (219) hide show
  1. package/README.md +3 -0
  2. package/dist/commonjs/__tests__/paymentprofile.test.js +13 -0
  3. package/dist/commonjs/__tests__/paymentprofile.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/users.test.js +1 -0
  5. package/dist/commonjs/__tests__/users.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/vendors.test.js +29 -2
  7. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  8. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  9. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  10. package/dist/commonjs/__tests__/zones.test.js +4 -25
  11. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  12. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.d.ts +22 -0
  13. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
  14. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.js +113 -0
  15. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.js.map +1 -0
  16. package/dist/commonjs/funcs/usersUpdateUserProfilePicture.d.ts +1 -1
  17. package/dist/commonjs/funcs/usersUpdateUserProfilePicture.js +1 -1
  18. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +10 -6
  19. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  20. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js +50 -12
  21. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  22. package/dist/commonjs/lib/config.d.ts +2 -2
  23. package/dist/commonjs/lib/config.js +2 -2
  24. package/dist/commonjs/models/components/expand.d.ts +1 -0
  25. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/expand.js +1 -0
  27. package/dist/commonjs/models/components/expand.js.map +1 -1
  28. package/dist/commonjs/models/components/facility.d.ts +4 -4
  29. package/dist/commonjs/models/components/facility.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/facility.js +6 -6
  31. package/dist/commonjs/models/components/facility.js.map +1 -1
  32. package/dist/commonjs/models/components/facilitycalendarsummary.d.ts +1 -0
  33. package/dist/commonjs/models/components/facilitycalendarsummary.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/facilitycalendarsummary.js +1 -0
  35. package/dist/commonjs/models/components/facilitycalendarsummary.js.map +1 -1
  36. package/dist/commonjs/models/components/facilitysummary.d.ts +1 -0
  37. package/dist/commonjs/models/components/facilitysummary.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/facilitysummary.js +1 -0
  39. package/dist/commonjs/models/components/facilitysummary.js.map +1 -1
  40. package/dist/commonjs/models/components/systemsummary.d.ts +9 -0
  41. package/dist/commonjs/models/components/systemsummary.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/systemsummary.js +17 -1
  43. package/dist/commonjs/models/components/systemsummary.js.map +1 -1
  44. package/dist/commonjs/models/operations/deletepaymentprofile.d.ts +11 -0
  45. package/dist/commonjs/models/operations/deletepaymentprofile.d.ts.map +1 -0
  46. package/dist/commonjs/models/operations/deletepaymentprofile.js +49 -0
  47. package/dist/commonjs/models/operations/deletepaymentprofile.js.map +1 -0
  48. package/dist/commonjs/models/operations/index.d.ts +1 -0
  49. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  50. package/dist/commonjs/models/operations/index.js +1 -0
  51. package/dist/commonjs/models/operations/index.js.map +1 -1
  52. package/dist/commonjs/models/operations/listlocations.d.ts +4 -4
  53. package/dist/commonjs/models/operations/listlocations.d.ts.map +1 -1
  54. package/dist/commonjs/models/operations/listlocations.js +6 -7
  55. package/dist/commonjs/models/operations/listlocations.js.map +1 -1
  56. package/dist/commonjs/models/operations/listlookupsystems.d.ts +2 -1
  57. package/dist/commonjs/models/operations/listlookupsystems.d.ts.map +1 -1
  58. package/dist/commonjs/models/operations/listlookupsystems.js +1 -0
  59. package/dist/commonjs/models/operations/listlookupsystems.js.map +1 -1
  60. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts +50 -1
  61. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
  62. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js +34 -2
  63. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
  64. package/dist/commonjs/models/operations/updateuserprofilepicture.d.ts +6 -2
  65. package/dist/commonjs/models/operations/updateuserprofilepicture.d.ts.map +1 -1
  66. package/dist/commonjs/models/operations/updateuserprofilepicture.js +5 -0
  67. package/dist/commonjs/models/operations/updateuserprofilepicture.js.map +1 -1
  68. package/dist/commonjs/react-query/index.d.ts +1 -0
  69. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  70. package/dist/commonjs/react-query/index.js +1 -0
  71. package/dist/commonjs/react-query/index.js.map +1 -1
  72. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.d.ts +30 -0
  73. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
  74. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.js +54 -0
  75. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.js.map +1 -0
  76. package/dist/commonjs/react-query/usersUpdateUserProfilePicture.d.ts +1 -1
  77. package/dist/commonjs/react-query/usersUpdateUserProfilePicture.js +1 -1
  78. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts +26 -2
  79. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts.map +1 -1
  80. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.js +56 -2
  81. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.js.map +1 -1
  82. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +67 -16
  83. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  84. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js +66 -11
  85. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  86. package/dist/commonjs/sdk/paymentprofile.d.ts +10 -0
  87. package/dist/commonjs/sdk/paymentprofile.d.ts.map +1 -1
  88. package/dist/commonjs/sdk/paymentprofile.js +12 -0
  89. package/dist/commonjs/sdk/paymentprofile.js.map +1 -1
  90. package/dist/commonjs/sdk/users.d.ts +1 -1
  91. package/dist/commonjs/sdk/users.js +1 -1
  92. package/dist/commonjs/sdk/vendors.d.ts +9 -6
  93. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  94. package/dist/commonjs/sdk/vendors.js +7 -6
  95. package/dist/commonjs/sdk/vendors.js.map +1 -1
  96. package/dist/esm/__tests__/paymentprofile.test.js +13 -0
  97. package/dist/esm/__tests__/paymentprofile.test.js.map +1 -1
  98. package/dist/esm/__tests__/users.test.js +1 -0
  99. package/dist/esm/__tests__/users.test.js.map +1 -1
  100. package/dist/esm/__tests__/vendors.test.js +29 -2
  101. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  102. package/dist/esm/__tests__/webhooks.test.js +1 -1
  103. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  104. package/dist/esm/__tests__/zones.test.js +4 -25
  105. package/dist/esm/__tests__/zones.test.js.map +1 -1
  106. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.d.ts +22 -0
  107. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
  108. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.js +77 -0
  109. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.js.map +1 -0
  110. package/dist/esm/funcs/usersUpdateUserProfilePicture.d.ts +1 -1
  111. package/dist/esm/funcs/usersUpdateUserProfilePicture.js +1 -1
  112. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +10 -6
  113. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  114. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js +51 -13
  115. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  116. package/dist/esm/lib/config.d.ts +2 -2
  117. package/dist/esm/lib/config.js +2 -2
  118. package/dist/esm/models/components/expand.d.ts +1 -0
  119. package/dist/esm/models/components/expand.d.ts.map +1 -1
  120. package/dist/esm/models/components/expand.js +1 -0
  121. package/dist/esm/models/components/expand.js.map +1 -1
  122. package/dist/esm/models/components/facility.d.ts +4 -4
  123. package/dist/esm/models/components/facility.d.ts.map +1 -1
  124. package/dist/esm/models/components/facility.js +4 -4
  125. package/dist/esm/models/components/facility.js.map +1 -1
  126. package/dist/esm/models/components/facilitycalendarsummary.d.ts +1 -0
  127. package/dist/esm/models/components/facilitycalendarsummary.d.ts.map +1 -1
  128. package/dist/esm/models/components/facilitycalendarsummary.js +1 -0
  129. package/dist/esm/models/components/facilitycalendarsummary.js.map +1 -1
  130. package/dist/esm/models/components/facilitysummary.d.ts +1 -0
  131. package/dist/esm/models/components/facilitysummary.d.ts.map +1 -1
  132. package/dist/esm/models/components/facilitysummary.js +1 -0
  133. package/dist/esm/models/components/facilitysummary.js.map +1 -1
  134. package/dist/esm/models/components/systemsummary.d.ts +9 -0
  135. package/dist/esm/models/components/systemsummary.d.ts.map +1 -1
  136. package/dist/esm/models/components/systemsummary.js +15 -0
  137. package/dist/esm/models/components/systemsummary.js.map +1 -1
  138. package/dist/esm/models/operations/deletepaymentprofile.d.ts +11 -0
  139. package/dist/esm/models/operations/deletepaymentprofile.d.ts.map +1 -0
  140. package/dist/esm/models/operations/deletepaymentprofile.js +12 -0
  141. package/dist/esm/models/operations/deletepaymentprofile.js.map +1 -0
  142. package/dist/esm/models/operations/index.d.ts +1 -0
  143. package/dist/esm/models/operations/index.d.ts.map +1 -1
  144. package/dist/esm/models/operations/index.js +1 -0
  145. package/dist/esm/models/operations/index.js.map +1 -1
  146. package/dist/esm/models/operations/listlocations.d.ts +4 -4
  147. package/dist/esm/models/operations/listlocations.d.ts.map +1 -1
  148. package/dist/esm/models/operations/listlocations.js +4 -5
  149. package/dist/esm/models/operations/listlocations.js.map +1 -1
  150. package/dist/esm/models/operations/listlookupsystems.d.ts +2 -1
  151. package/dist/esm/models/operations/listlookupsystems.d.ts.map +1 -1
  152. package/dist/esm/models/operations/listlookupsystems.js +1 -0
  153. package/dist/esm/models/operations/listlookupsystems.js.map +1 -1
  154. package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts +50 -1
  155. package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
  156. package/dist/esm/models/operations/listvendoradditionalfacilityfields.js +31 -1
  157. package/dist/esm/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
  158. package/dist/esm/models/operations/updateuserprofilepicture.d.ts +6 -2
  159. package/dist/esm/models/operations/updateuserprofilepicture.d.ts.map +1 -1
  160. package/dist/esm/models/operations/updateuserprofilepicture.js +5 -0
  161. package/dist/esm/models/operations/updateuserprofilepicture.js.map +1 -1
  162. package/dist/esm/react-query/index.d.ts +1 -0
  163. package/dist/esm/react-query/index.d.ts.map +1 -1
  164. package/dist/esm/react-query/index.js +1 -0
  165. package/dist/esm/react-query/index.js.map +1 -1
  166. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.d.ts +30 -0
  167. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.d.ts.map +1 -0
  168. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.js +49 -0
  169. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.js.map +1 -0
  170. package/dist/esm/react-query/usersUpdateUserProfilePicture.d.ts +1 -1
  171. package/dist/esm/react-query/usersUpdateUserProfilePicture.js +1 -1
  172. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts +26 -2
  173. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts.map +1 -1
  174. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.js +53 -2
  175. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.js.map +1 -1
  176. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +67 -16
  177. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  178. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js +63 -13
  179. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  180. package/dist/esm/sdk/paymentprofile.d.ts +10 -0
  181. package/dist/esm/sdk/paymentprofile.d.ts.map +1 -1
  182. package/dist/esm/sdk/paymentprofile.js +12 -0
  183. package/dist/esm/sdk/paymentprofile.js.map +1 -1
  184. package/dist/esm/sdk/users.d.ts +1 -1
  185. package/dist/esm/sdk/users.js +1 -1
  186. package/dist/esm/sdk/vendors.d.ts +9 -6
  187. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  188. package/dist/esm/sdk/vendors.js +7 -6
  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__/paymentprofile.test.ts +16 -0
  193. package/src/__tests__/users.test.ts +1 -0
  194. package/src/__tests__/vendors.test.ts +34 -3
  195. package/src/__tests__/webhooks.test.ts +1 -1
  196. package/src/__tests__/zones.test.ts +4 -25
  197. package/src/funcs/paymentProfileDeletePaymentProfile.ts +160 -0
  198. package/src/funcs/usersUpdateUserProfilePicture.ts +1 -1
  199. package/src/funcs/vendorsListVendorAdditionalFacilityFields.ts +115 -37
  200. package/src/lib/config.ts +2 -2
  201. package/src/models/components/expand.ts +1 -0
  202. package/src/models/components/facility.ts +9 -9
  203. package/src/models/components/facilitycalendarsummary.ts +2 -0
  204. package/src/models/components/facilitysummary.ts +2 -0
  205. package/src/models/components/systemsummary.ts +34 -0
  206. package/src/models/operations/deletepaymentprofile.ts +35 -0
  207. package/src/models/operations/index.ts +1 -0
  208. package/src/models/operations/listlocations.ts +15 -12
  209. package/src/models/operations/listlookupsystems.ts +2 -1
  210. package/src/models/operations/listvendoradditionalfacilityfields.ts +104 -2
  211. package/src/models/operations/updateuserprofilepicture.ts +11 -2
  212. package/src/react-query/index.ts +1 -0
  213. package/src/react-query/paymentProfileDeletePaymentProfile.ts +115 -0
  214. package/src/react-query/usersUpdateUserProfilePicture.ts +1 -1
  215. package/src/react-query/vendorsListVendorAdditionalFacilityFields.core.ts +124 -1
  216. package/src/react-query/vendorsListVendorAdditionalFacilityFields.ts +151 -12
  217. package/src/sdk/paymentprofile.ts +19 -0
  218. package/src/sdk/users.ts +1 -1
  219. package/src/sdk/vendors.ts +11 -7
@@ -125,10 +125,41 @@ test("Vendors List Vendor Credits", async () => {
125
125
  });
126
126
  });
127
127
 
128
- it.skip("Vendors List Vendor Additional Facility Fields", async () => {
129
- assert.fail(
130
- "incomplete test found please make sure to address the following errors: [`workflow step listVendorAdditionalFacilityFields.test referencing operation listVendorAdditionalFacilityFields does not contain query parameter sort`, `workflow step listVendorAdditionalFacilityFields.test referencing operation listVendorAdditionalFacilityFields does not contain query parameter desc`, `workflow step listVendorAdditionalFacilityFields.test referencing operation listVendorAdditionalFacilityFields does not contain query parameter items_per_page`]",
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: true,
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
- qrCode: "<value>",
84
- zoneId: 891667,
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 client should then upload the file directly to S3 at user_profile_image/{id}.{ext}. An AWS Lambda function processes the image (resize to tiny/thumb/large) and triggers a callback. 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.
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 { encodeSimple } from "../lib/encodings.js";
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
- * **Breaking change notice:** The response shape has been realigned with
37
- * `/custom-fields`. Legacy keys (`system`, `facility`, `field`) and the
38
- * `pager` envelope are no longer returned. The endpoint now returns the
39
- * full `items` array with the new `field_for` discriminator and no
40
- * pagination. Scheduled for removal after SDK consumers migrate.
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
- Result<
52
- operations.ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk,
53
- | errors.ApiErrorResponse
54
- | GreenSecurityError
55
- | ResponseValidationError
56
- | ConnectionError
57
- | RequestAbortedError
58
- | RequestTimeoutError
59
- | InvalidRequestError
60
- | UnexpectedClientError
61
- | SDKValidationError
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
- Result<
78
- operations.ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk,
79
- | errors.ApiErrorResponse
80
- | GreenSecurityError
81
- | ResponseValidationError
82
- | ConnectionError
83
- | RequestAbortedError
84
- | RequestTimeoutError
85
- | InvalidRequestError
86
- | UnexpectedClientError
87
- | SDKValidationError
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.ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk,
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
- .ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk$inboundSchema,
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, { status: "complete", request: req, response }];
213
+ return [haltIterator(result), {
214
+ status: "complete",
215
+ request: req,
216
+ response,
217
+ }];
192
218
  }
193
219
 
194
- return [result, { status: "complete", request: req, response }];
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.125",
84
+ sdkVersion: "0.43.1-beta.126",
85
85
  genVersion: "2.881.17",
86
86
  userAgent:
87
- "speakeasy-sdk/typescript 0.43.1-beta.125 2.881.17 0.0.11 @greensecurity/javascript-sdk",
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 Location = {
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?: Location | undefined;
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 Location$inboundSchema: z.ZodType<
328
- Location,
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 locationFromJSON(
349
+ export function facilityLocationFromJSON(
350
350
  jsonString: string,
351
- ): SafeParseResult<Location, SDKValidationError> {
351
+ ): SafeParseResult<FacilityLocation, SDKValidationError> {
352
352
  return safeParse(
353
353
  jsonString,
354
- (x) => Location$inboundSchema.parse(JSON.parse(x)),
355
- `Failed to parse 'Location' from JSON`,
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(() => Location$inboundSchema)),
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(