@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
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 134674f5a536
4
+ */
5
+
6
+ import * as z from "zod/v3";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * The request was successful and the payment profile has been deleted.
13
+ */
14
+ export type DeletePaymentProfileDeletePaymentProfileOk = {};
15
+
16
+ /** @internal */
17
+ export const DeletePaymentProfileDeletePaymentProfileOk$inboundSchema:
18
+ z.ZodType<DeletePaymentProfileDeletePaymentProfileOk, z.ZodTypeDef, unknown> =
19
+ z.object({});
20
+
21
+ export function deletePaymentProfileDeletePaymentProfileOkFromJSON(
22
+ jsonString: string,
23
+ ): SafeParseResult<
24
+ DeletePaymentProfileDeletePaymentProfileOk,
25
+ SDKValidationError
26
+ > {
27
+ return safeParse(
28
+ jsonString,
29
+ (x) =>
30
+ DeletePaymentProfileDeletePaymentProfileOk$inboundSchema.parse(
31
+ JSON.parse(x),
32
+ ),
33
+ `Failed to parse 'DeletePaymentProfileDeletePaymentProfileOk' from JSON`,
34
+ );
35
+ }
@@ -28,6 +28,7 @@ export * from "./declinevendorcredential.js";
28
28
  export * from "./deletedatarequestfile.js";
29
29
  export * from "./deleteevent.js";
30
30
  export * from "./deletefhirconfigbyid.js";
31
+ export * from "./deletepaymentprofile.js";
31
32
  export * from "./deletevendorcredentialfile.js";
32
33
  export * from "./deletevendormanagedbycompany.js";
33
34
  export * from "./downloadinvoicesexport.js";
@@ -42,7 +42,7 @@ export type ListLocationsRequest = {
42
42
  eventId?: number | undefined;
43
43
  };
44
44
 
45
- export type Items = {
45
+ export type ListLocationsItems = {
46
46
  id?: string | undefined;
47
47
  label?: string | undefined;
48
48
  };
@@ -51,7 +51,7 @@ export type Items = {
51
51
  * The request was successful, and the server has returned the requested resource in the response body.
52
52
  */
53
53
  export type ListLocationsListLocationsOk = {
54
- items: Array<Items>;
54
+ items: Array<ListLocationsItems>;
55
55
  /**
56
56
  * Pagination information for a pageable list
57
57
  */
@@ -104,19 +104,22 @@ export function listLocationsRequestToJSON(
104
104
  }
105
105
 
106
106
  /** @internal */
107
- export const Items$inboundSchema: z.ZodType<Items, z.ZodTypeDef, unknown> = z
108
- .object({
109
- id: types.optional(types.string()),
110
- label: types.optional(types.string()),
111
- });
107
+ export const ListLocationsItems$inboundSchema: z.ZodType<
108
+ ListLocationsItems,
109
+ z.ZodTypeDef,
110
+ unknown
111
+ > = z.object({
112
+ id: types.optional(types.string()),
113
+ label: types.optional(types.string()),
114
+ });
112
115
 
113
- export function itemsFromJSON(
116
+ export function listLocationsItemsFromJSON(
114
117
  jsonString: string,
115
- ): SafeParseResult<Items, SDKValidationError> {
118
+ ): SafeParseResult<ListLocationsItems, SDKValidationError> {
116
119
  return safeParse(
117
120
  jsonString,
118
- (x) => Items$inboundSchema.parse(JSON.parse(x)),
119
- `Failed to parse 'Items' from JSON`,
121
+ (x) => ListLocationsItems$inboundSchema.parse(JSON.parse(x)),
122
+ `Failed to parse 'ListLocationsItems' from JSON`,
120
123
  );
121
124
  }
122
125
 
@@ -126,7 +129,7 @@ export const ListLocationsListLocationsOk$inboundSchema: z.ZodType<
126
129
  z.ZodTypeDef,
127
130
  unknown
128
131
  > = z.object({
129
- items: z.array(z.lazy(() => Items$inboundSchema)),
132
+ items: z.array(z.lazy(() => ListLocationsItems$inboundSchema)),
130
133
  pager: components.Pager$inboundSchema,
131
134
  });
132
135
 
@@ -12,6 +12,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
12
 
13
13
  export const Expand = {
14
14
  SystemFacilities: "system.facilities",
15
+ SystemLocation: "system.location",
15
16
  } as const;
16
17
  export type Expand = ClosedEnum<typeof Expand>;
17
18
 
@@ -29,7 +30,7 @@ export type Use = ClosedEnum<typeof Use>;
29
30
 
30
31
  export type ListLookupSystemsRequest = {
31
32
  /**
32
- * Expand values to include in the response. Allowed: `system.facilities`
33
+ * Expand values to include in the response. Allowed: `system.facilities`, `system.location`
33
34
  */
34
35
  expand?: Array<Expand> | undefined;
35
36
  /**
@@ -7,10 +7,27 @@ import * as z from "zod/v3";
7
7
  import { remap as remap$ } from "../../lib/primitives.js";
8
8
  import { safeParse } from "../../lib/schemas.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as types from "../../types/primitives.js";
10
11
  import * as components from "../components/index.js";
11
12
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
13
 
13
14
  export type ListVendorAdditionalFacilityFieldsRequest = {
15
+ /**
16
+ * A comma-separated list of object attributes to sort on.
17
+ */
18
+ sort?: string | null | undefined;
19
+ /**
20
+ * Sort desc
21
+ */
22
+ desc?: components.Desc | undefined;
23
+ /**
24
+ * A 1-based offset for which page to request (defaults to 1)
25
+ */
26
+ page?: number | undefined;
27
+ /**
28
+ * Number of items to show in a given page
29
+ */
30
+ itemsPerPage?: number | undefined;
14
31
  /**
15
32
  * Vendor identifier. Depending on the endpoint, accepts one or more of:
16
33
  *
@@ -23,16 +40,46 @@ export type ListVendorAdditionalFacilityFieldsRequest = {
23
40
  vendorIdOrMe: string;
24
41
  };
25
42
 
43
+ /**
44
+ * Legacy VendorFieldValue row (deprecated shape).
45
+ */
46
+ export type Items = {
47
+ /**
48
+ * VendorFieldValue id
49
+ */
50
+ id?: number | undefined;
51
+ system?: string | null | undefined;
52
+ facility?: string | null | undefined;
53
+ /**
54
+ * Display name of the underlying VendorField
55
+ */
56
+ field?: string | null | undefined;
57
+ value?: string | null | undefined;
58
+ };
59
+
26
60
  /**
27
61
  * The request was successful.
28
62
  */
29
63
  export type ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk =
30
64
  {
31
- items: Array<components.VendorCustomFields>;
65
+ items: Array<Items>;
66
+ /**
67
+ * Pagination information for a pageable list
68
+ */
69
+ pager: components.Pager;
32
70
  };
33
71
 
72
+ export type ListVendorAdditionalFacilityFieldsResponse = {
73
+ result:
74
+ ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk;
75
+ };
76
+
34
77
  /** @internal */
35
78
  export type ListVendorAdditionalFacilityFieldsRequest$Outbound = {
79
+ sort?: string | null | undefined;
80
+ desc?: components.Desc$Outbound | undefined;
81
+ page?: number | undefined;
82
+ items_per_page?: number | undefined;
36
83
  vendor_id_or_me: string;
37
84
  };
38
85
 
@@ -43,9 +90,14 @@ export const ListVendorAdditionalFacilityFieldsRequest$outboundSchema:
43
90
  z.ZodTypeDef,
44
91
  ListVendorAdditionalFacilityFieldsRequest
45
92
  > = z.object({
93
+ sort: z.nullable(z.string()).optional(),
94
+ desc: components.Desc$outboundSchema.optional(),
95
+ page: z.number().int().optional(),
96
+ itemsPerPage: z.number().int().optional(),
46
97
  vendorIdOrMe: z.string(),
47
98
  }).transform((v) => {
48
99
  return remap$(v, {
100
+ itemsPerPage: "items_per_page",
49
101
  vendorIdOrMe: "vendor_id_or_me",
50
102
  });
51
103
  });
@@ -61,6 +113,26 @@ export function listVendorAdditionalFacilityFieldsRequestToJSON(
61
113
  );
62
114
  }
63
115
 
116
+ /** @internal */
117
+ export const Items$inboundSchema: z.ZodType<Items, z.ZodTypeDef, unknown> = z
118
+ .object({
119
+ id: types.optional(types.number()),
120
+ system: z.nullable(types.string()).optional(),
121
+ facility: z.nullable(types.string()).optional(),
122
+ field: z.nullable(types.string()).optional(),
123
+ value: z.nullable(types.string()).optional(),
124
+ });
125
+
126
+ export function itemsFromJSON(
127
+ jsonString: string,
128
+ ): SafeParseResult<Items, SDKValidationError> {
129
+ return safeParse(
130
+ jsonString,
131
+ (x) => Items$inboundSchema.parse(JSON.parse(x)),
132
+ `Failed to parse 'Items' from JSON`,
133
+ );
134
+ }
135
+
64
136
  /** @internal */
65
137
  export const ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk$inboundSchema:
66
138
  z.ZodType<
@@ -68,7 +140,8 @@ export const ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityField
68
140
  z.ZodTypeDef,
69
141
  unknown
70
142
  > = z.object({
71
- items: z.array(components.VendorCustomFields$inboundSchema),
143
+ items: z.array(z.lazy(() => Items$inboundSchema)),
144
+ pager: components.Pager$inboundSchema,
72
145
  });
73
146
 
74
147
  export function listVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOkFromJSON(
@@ -85,3 +158,32 @@ export function listVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFi
85
158
  `Failed to parse 'ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk' from JSON`,
86
159
  );
87
160
  }
161
+
162
+ /** @internal */
163
+ export const ListVendorAdditionalFacilityFieldsResponse$inboundSchema:
164
+ z.ZodType<ListVendorAdditionalFacilityFieldsResponse, z.ZodTypeDef, unknown> =
165
+ z.object({
166
+ Result: z.lazy(() =>
167
+ ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk$inboundSchema
168
+ ),
169
+ }).transform((v) => {
170
+ return remap$(v, {
171
+ "Result": "result",
172
+ });
173
+ });
174
+
175
+ export function listVendorAdditionalFacilityFieldsResponseFromJSON(
176
+ jsonString: string,
177
+ ): SafeParseResult<
178
+ ListVendorAdditionalFacilityFieldsResponse,
179
+ SDKValidationError
180
+ > {
181
+ return safeParse(
182
+ jsonString,
183
+ (x) =>
184
+ ListVendorAdditionalFacilityFieldsResponse$inboundSchema.parse(
185
+ JSON.parse(x),
186
+ ),
187
+ `Failed to parse 'ListVendorAdditionalFacilityFieldsResponse' from JSON`,
188
+ );
189
+ }
@@ -49,13 +49,17 @@ export type UpdateUserProfilePictureRequest = {
49
49
  };
50
50
 
51
51
  /**
52
- * Metadata registered. Upload the file directly to S3 at user_profile_image/{id}.{ext}.
52
+ * Metadata registered. Upload the file to the returned presigned S3 URL using HTTP PUT with the same Content-Type as image_content_type.
53
53
  */
54
54
  export type UpdateUserProfilePictureUpdateUserProfilePictureOk = {
55
55
  /**
56
- * User ID to use as the S3 upload key
56
+ * User ID associated with the profile picture
57
57
  */
58
58
  id: number;
59
+ /**
60
+ * Presigned S3 URL for uploading the image file via HTTP PUT. The URL is short-lived and tied to the image_content_type submitted in the request.
61
+ */
62
+ uploadUrl: string;
59
63
  };
60
64
 
61
65
  /** @internal */
@@ -136,6 +140,11 @@ export const UpdateUserProfilePictureUpdateUserProfilePictureOk$inboundSchema:
136
140
  unknown
137
141
  > = z.object({
138
142
  id: types.number(),
143
+ upload_url: types.string(),
144
+ }).transform((v) => {
145
+ return remap$(v, {
146
+ "upload_url": "uploadUrl",
147
+ });
139
148
  });
140
149
 
141
150
  export function updateUserProfilePictureUpdateUserProfilePictureOkFromJSON(
@@ -46,6 +46,7 @@ export * from "./organizationsGetFacility.js";
46
46
  export * from "./organizationsListOrSearchDepartmentContacts.js";
47
47
  export * from "./organizationsListOrSearchDepartments.js";
48
48
  export * from "./organizationsListOrSearchFacilities.js";
49
+ export * from "./paymentProfileDeletePaymentProfile.js";
49
50
  export * from "./paymentProfileGetPaymentProfile.js";
50
51
  export * from "./supportArticlesGetSupportArticle.js";
51
52
  export * from "./supportArticlesListOrSearchSupportArticles.js";
@@ -0,0 +1,115 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: fdcb791aabc9
4
+ */
5
+
6
+ import {
7
+ MutationKey,
8
+ useMutation,
9
+ UseMutationResult,
10
+ } from "@tanstack/react-query";
11
+ import { GreenSecurityCore } from "../core.js";
12
+ import { paymentProfileDeletePaymentProfile } from "../funcs/paymentProfileDeletePaymentProfile.js";
13
+ import { combineSignals } from "../lib/primitives.js";
14
+ import { RequestOptions } from "../lib/sdks.js";
15
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { unwrapAsync } from "../types/fp.js";
28
+ import { useGreenSecurityContext } from "./_context.js";
29
+ import { MutationHookOptions } from "./_types.js";
30
+
31
+ export type PaymentProfileDeletePaymentProfileMutationVariables = {
32
+ options?: RequestOptions;
33
+ };
34
+
35
+ export type PaymentProfileDeletePaymentProfileMutationData =
36
+ operations.DeletePaymentProfileDeletePaymentProfileOk;
37
+
38
+ export type PaymentProfileDeletePaymentProfileMutationError =
39
+ | errors.ApiErrorResponse
40
+ | GreenSecurityError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError;
48
+
49
+ /**
50
+ * Delete payment profile
51
+ *
52
+ * @remarks
53
+ * Deletes the payment profile for the logged-in user (vendor or company manager).
54
+ *
55
+ * Only vendors and company managers can access this endpoint.
56
+ */
57
+ export function usePaymentProfileDeletePaymentProfileMutation(
58
+ options?: MutationHookOptions<
59
+ PaymentProfileDeletePaymentProfileMutationData,
60
+ PaymentProfileDeletePaymentProfileMutationError,
61
+ PaymentProfileDeletePaymentProfileMutationVariables
62
+ >,
63
+ ): UseMutationResult<
64
+ PaymentProfileDeletePaymentProfileMutationData,
65
+ PaymentProfileDeletePaymentProfileMutationError,
66
+ PaymentProfileDeletePaymentProfileMutationVariables
67
+ > {
68
+ const client = useGreenSecurityContext();
69
+ return useMutation({
70
+ ...buildPaymentProfileDeletePaymentProfileMutation(client, options),
71
+ ...options,
72
+ });
73
+ }
74
+
75
+ export function mutationKeyPaymentProfileDeletePaymentProfile(): MutationKey {
76
+ return [
77
+ "@greensecurity/javascript-sdk",
78
+ "payment-profile",
79
+ "deletePaymentProfile",
80
+ ];
81
+ }
82
+
83
+ export function buildPaymentProfileDeletePaymentProfileMutation(
84
+ client$: GreenSecurityCore,
85
+ hookOptions?: RequestOptions,
86
+ ): {
87
+ mutationKey: MutationKey;
88
+ mutationFn: (
89
+ variables: PaymentProfileDeletePaymentProfileMutationVariables,
90
+ ) => Promise<PaymentProfileDeletePaymentProfileMutationData>;
91
+ } {
92
+ return {
93
+ mutationKey: mutationKeyPaymentProfileDeletePaymentProfile(),
94
+ mutationFn: function paymentProfileDeletePaymentProfileMutationFn({
95
+ options,
96
+ }): Promise<PaymentProfileDeletePaymentProfileMutationData> {
97
+ const mergedOptions = {
98
+ ...hookOptions,
99
+ ...options,
100
+ fetchOptions: {
101
+ ...hookOptions?.fetchOptions,
102
+ ...options?.fetchOptions,
103
+ signal: combineSignals(
104
+ hookOptions?.fetchOptions?.signal,
105
+ options?.fetchOptions?.signal,
106
+ ),
107
+ },
108
+ };
109
+ return unwrapAsync(paymentProfileDeletePaymentProfile(
110
+ client$,
111
+ mergedOptions,
112
+ ));
113
+ },
114
+ };
115
+ }
@@ -51,7 +51,7 @@ export type UsersUpdateUserProfilePictureMutationError =
51
51
  * Register profile picture metadata for S3 direct upload
52
52
  *
53
53
  * @remarks
54
- * 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.
54
+ * 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.
55
55
  */
56
56
  export function useUsersUpdateUserProfilePictureMutation(
57
57
  options?: MutationHookOptions<
@@ -12,10 +12,24 @@ import { GreenSecurityCore } from "../core.js";
12
12
  import { vendorsListVendorAdditionalFacilityFields } from "../funcs/vendorsListVendorAdditionalFacilityFields.js";
13
13
  import { combineSignals } from "../lib/primitives.js";
14
14
  import { RequestOptions } from "../lib/sdks.js";
15
+ import * as components from "../models/components/index.js";
15
16
  import * as operations from "../models/operations/index.js";
16
17
  import { unwrapAsync } from "../types/fp.js";
18
+ import { PageIterator, unwrapResultIterator } from "../types/operations.js";
19
+ import { pageIteratorToJSON } from "./_types.js";
17
20
  export type VendorsListVendorAdditionalFacilityFieldsQueryData =
18
- operations.ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk;
21
+ operations.ListVendorAdditionalFacilityFieldsResponse;
22
+
23
+ export type VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData =
24
+ PageIterator<
25
+ operations.ListVendorAdditionalFacilityFieldsResponse,
26
+ { page: number }
27
+ >;
28
+
29
+ export type VendorsListVendorAdditionalFacilityFieldsPageParams = PageIterator<
30
+ operations.ListVendorAdditionalFacilityFieldsResponse,
31
+ { page: number }
32
+ >["~next"];
19
33
 
20
34
  export function prefetchVendorsListVendorAdditionalFacilityFields(
21
35
  queryClient: QueryClient,
@@ -32,6 +46,26 @@ export function prefetchVendorsListVendorAdditionalFacilityFields(
32
46
  });
33
47
  }
34
48
 
49
+ export function prefetchVendorsListVendorAdditionalFacilityFieldsInfinite(
50
+ queryClient: QueryClient,
51
+ client$: GreenSecurityCore,
52
+ request: operations.ListVendorAdditionalFacilityFieldsRequest,
53
+ options?: RequestOptions,
54
+ ): Promise<void> {
55
+ return queryClient.prefetchInfiniteQuery({
56
+ ...buildVendorsListVendorAdditionalFacilityFieldsInfiniteQuery(
57
+ client$,
58
+ request,
59
+ options,
60
+ ),
61
+ initialPageParam:
62
+ undefined as VendorsListVendorAdditionalFacilityFieldsPageParams,
63
+ getNextPageParam: (
64
+ previousPage: VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
65
+ ) => previousPage["~next"],
66
+ });
67
+ }
68
+
35
69
  export function buildVendorsListVendorAdditionalFacilityFieldsQuery(
36
70
  client$: GreenSecurityCore,
37
71
  request: operations.ListVendorAdditionalFacilityFieldsRequest,
@@ -45,6 +79,12 @@ export function buildVendorsListVendorAdditionalFacilityFieldsQuery(
45
79
  return {
46
80
  queryKey: queryKeyVendorsListVendorAdditionalFacilityFields(
47
81
  request.vendorIdOrMe,
82
+ {
83
+ sort: request.sort,
84
+ desc: request.desc,
85
+ page: request.page,
86
+ itemsPerPage: request.itemsPerPage,
87
+ },
48
88
  ),
49
89
  queryFn: async function vendorsListVendorAdditionalFacilityFieldsQueryFn(
50
90
  ctx,
@@ -69,13 +109,96 @@ export function buildVendorsListVendorAdditionalFacilityFieldsQuery(
69
109
  };
70
110
  }
71
111
 
112
+ export function buildVendorsListVendorAdditionalFacilityFieldsInfiniteQuery(
113
+ client$: GreenSecurityCore,
114
+ request: operations.ListVendorAdditionalFacilityFieldsRequest,
115
+ options?: RequestOptions,
116
+ ): {
117
+ queryKey: QueryKey;
118
+ queryFn: (
119
+ context: QueryFunctionContext<
120
+ QueryKey,
121
+ VendorsListVendorAdditionalFacilityFieldsPageParams
122
+ >,
123
+ ) => Promise<VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData>;
124
+ } {
125
+ return {
126
+ queryKey: queryKeyVendorsListVendorAdditionalFacilityFieldsInfinite(
127
+ request.vendorIdOrMe,
128
+ {
129
+ sort: request.sort,
130
+ desc: request.desc,
131
+ page: request.page,
132
+ itemsPerPage: request.itemsPerPage,
133
+ },
134
+ ),
135
+ queryFn: async function vendorsListVendorAdditionalFacilityFieldsQuery(
136
+ ctx,
137
+ ): Promise<VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData> {
138
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
139
+ const mergedOptions = {
140
+ ...options,
141
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
142
+ };
143
+
144
+ if (!ctx.pageParam) {
145
+ const pageResult = await unwrapResultIterator(
146
+ vendorsListVendorAdditionalFacilityFields(
147
+ client$,
148
+ request,
149
+ mergedOptions,
150
+ ),
151
+ );
152
+ return pageIteratorToJSON(pageResult);
153
+ }
154
+ const pageResult = await unwrapResultIterator(
155
+ vendorsListVendorAdditionalFacilityFields(
156
+ client$,
157
+ {
158
+ ...request,
159
+ page: ctx.pageParam.page,
160
+ },
161
+ mergedOptions,
162
+ ),
163
+ );
164
+ return pageIteratorToJSON(pageResult);
165
+ },
166
+ };
167
+ }
168
+
72
169
  export function queryKeyVendorsListVendorAdditionalFacilityFields(
73
170
  vendorIdOrMe: string,
171
+ parameters: {
172
+ sort?: string | null | undefined;
173
+ desc?: components.Desc | undefined;
174
+ page?: number | undefined;
175
+ itemsPerPage?: number | undefined;
176
+ },
177
+ ): QueryKey {
178
+ return [
179
+ "@greensecurity/javascript-sdk",
180
+ "vendors",
181
+ "listVendorAdditionalFacilityFields",
182
+ vendorIdOrMe,
183
+ parameters,
184
+ ];
185
+ }
186
+
187
+ export function queryKeyVendorsListVendorAdditionalFacilityFieldsInfinite(
188
+ vendorIdOrMe: string,
189
+ parameters: {
190
+ sort?: string | null | undefined;
191
+ desc?: components.Desc | undefined;
192
+ page?: number | undefined;
193
+ itemsPerPage?: number | undefined;
194
+ },
74
195
  ): QueryKey {
75
196
  return [
76
197
  "@greensecurity/javascript-sdk",
77
198
  "vendors",
78
199
  "listVendorAdditionalFacilityFields",
200
+ "infinite",
79
201
  vendorIdOrMe,
202
+ parameters,
80
203
  ];
81
204
  }