@greensecurity/javascript-sdk 0.43.1-beta.125 → 0.43.1-beta.127

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 (159) hide show
  1. package/dist/commonjs/__tests__/users.test.js +1 -0
  2. package/dist/commonjs/__tests__/users.test.js.map +1 -1
  3. package/dist/commonjs/__tests__/vendors.test.js +29 -2
  4. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  6. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  7. package/dist/commonjs/__tests__/zones.test.js +14 -11
  8. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  9. package/dist/commonjs/funcs/usersUpdateUserProfilePicture.d.ts +1 -1
  10. package/dist/commonjs/funcs/usersUpdateUserProfilePicture.js +1 -1
  11. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +10 -6
  12. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  13. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js +50 -12
  14. package/dist/commonjs/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  15. package/dist/commonjs/lib/config.d.ts +2 -2
  16. package/dist/commonjs/lib/config.js +2 -2
  17. package/dist/commonjs/models/components/expand.d.ts +1 -0
  18. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  19. package/dist/commonjs/models/components/expand.js +1 -0
  20. package/dist/commonjs/models/components/expand.js.map +1 -1
  21. package/dist/commonjs/models/components/facility.d.ts +4 -4
  22. package/dist/commonjs/models/components/facility.d.ts.map +1 -1
  23. package/dist/commonjs/models/components/facility.js +6 -6
  24. package/dist/commonjs/models/components/facility.js.map +1 -1
  25. package/dist/commonjs/models/components/facilitycalendarsummary.d.ts +1 -0
  26. package/dist/commonjs/models/components/facilitycalendarsummary.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/facilitycalendarsummary.js +1 -0
  28. package/dist/commonjs/models/components/facilitycalendarsummary.js.map +1 -1
  29. package/dist/commonjs/models/components/facilitysummary.d.ts +1 -0
  30. package/dist/commonjs/models/components/facilitysummary.d.ts.map +1 -1
  31. package/dist/commonjs/models/components/facilitysummary.js +1 -0
  32. package/dist/commonjs/models/components/facilitysummary.js.map +1 -1
  33. package/dist/commonjs/models/components/systemsummary.d.ts +9 -0
  34. package/dist/commonjs/models/components/systemsummary.d.ts.map +1 -1
  35. package/dist/commonjs/models/components/systemsummary.js +17 -1
  36. package/dist/commonjs/models/components/systemsummary.js.map +1 -1
  37. package/dist/commonjs/models/operations/listlocations.d.ts +4 -4
  38. package/dist/commonjs/models/operations/listlocations.d.ts.map +1 -1
  39. package/dist/commonjs/models/operations/listlocations.js +6 -7
  40. package/dist/commonjs/models/operations/listlocations.js.map +1 -1
  41. package/dist/commonjs/models/operations/listlookupsystems.d.ts +2 -1
  42. package/dist/commonjs/models/operations/listlookupsystems.d.ts.map +1 -1
  43. package/dist/commonjs/models/operations/listlookupsystems.js +1 -0
  44. package/dist/commonjs/models/operations/listlookupsystems.js.map +1 -1
  45. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts +50 -1
  46. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
  47. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js +34 -2
  48. package/dist/commonjs/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
  49. package/dist/commonjs/models/operations/updateuserprofilepicture.d.ts +6 -2
  50. package/dist/commonjs/models/operations/updateuserprofilepicture.d.ts.map +1 -1
  51. package/dist/commonjs/models/operations/updateuserprofilepicture.js +5 -0
  52. package/dist/commonjs/models/operations/updateuserprofilepicture.js.map +1 -1
  53. package/dist/commonjs/react-query/usersUpdateUserProfilePicture.d.ts +1 -1
  54. package/dist/commonjs/react-query/usersUpdateUserProfilePicture.js +1 -1
  55. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts +26 -2
  56. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts.map +1 -1
  57. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.js +56 -2
  58. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.core.js.map +1 -1
  59. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +67 -16
  60. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  61. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js +66 -11
  62. package/dist/commonjs/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  63. package/dist/commonjs/sdk/users.d.ts +1 -1
  64. package/dist/commonjs/sdk/users.js +1 -1
  65. package/dist/commonjs/sdk/vendors.d.ts +9 -6
  66. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  67. package/dist/commonjs/sdk/vendors.js +7 -6
  68. package/dist/commonjs/sdk/vendors.js.map +1 -1
  69. package/dist/esm/__tests__/users.test.js +1 -0
  70. package/dist/esm/__tests__/users.test.js.map +1 -1
  71. package/dist/esm/__tests__/vendors.test.js +29 -2
  72. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  73. package/dist/esm/__tests__/webhooks.test.js +1 -1
  74. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  75. package/dist/esm/__tests__/zones.test.js +14 -11
  76. package/dist/esm/__tests__/zones.test.js.map +1 -1
  77. package/dist/esm/funcs/usersUpdateUserProfilePicture.d.ts +1 -1
  78. package/dist/esm/funcs/usersUpdateUserProfilePicture.js +1 -1
  79. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts +10 -6
  80. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  81. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js +51 -13
  82. package/dist/esm/funcs/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  83. package/dist/esm/lib/config.d.ts +2 -2
  84. package/dist/esm/lib/config.js +2 -2
  85. package/dist/esm/models/components/expand.d.ts +1 -0
  86. package/dist/esm/models/components/expand.d.ts.map +1 -1
  87. package/dist/esm/models/components/expand.js +1 -0
  88. package/dist/esm/models/components/expand.js.map +1 -1
  89. package/dist/esm/models/components/facility.d.ts +4 -4
  90. package/dist/esm/models/components/facility.d.ts.map +1 -1
  91. package/dist/esm/models/components/facility.js +4 -4
  92. package/dist/esm/models/components/facility.js.map +1 -1
  93. package/dist/esm/models/components/facilitycalendarsummary.d.ts +1 -0
  94. package/dist/esm/models/components/facilitycalendarsummary.d.ts.map +1 -1
  95. package/dist/esm/models/components/facilitycalendarsummary.js +1 -0
  96. package/dist/esm/models/components/facilitycalendarsummary.js.map +1 -1
  97. package/dist/esm/models/components/facilitysummary.d.ts +1 -0
  98. package/dist/esm/models/components/facilitysummary.d.ts.map +1 -1
  99. package/dist/esm/models/components/facilitysummary.js +1 -0
  100. package/dist/esm/models/components/facilitysummary.js.map +1 -1
  101. package/dist/esm/models/components/systemsummary.d.ts +9 -0
  102. package/dist/esm/models/components/systemsummary.d.ts.map +1 -1
  103. package/dist/esm/models/components/systemsummary.js +15 -0
  104. package/dist/esm/models/components/systemsummary.js.map +1 -1
  105. package/dist/esm/models/operations/listlocations.d.ts +4 -4
  106. package/dist/esm/models/operations/listlocations.d.ts.map +1 -1
  107. package/dist/esm/models/operations/listlocations.js +4 -5
  108. package/dist/esm/models/operations/listlocations.js.map +1 -1
  109. package/dist/esm/models/operations/listlookupsystems.d.ts +2 -1
  110. package/dist/esm/models/operations/listlookupsystems.d.ts.map +1 -1
  111. package/dist/esm/models/operations/listlookupsystems.js +1 -0
  112. package/dist/esm/models/operations/listlookupsystems.js.map +1 -1
  113. package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts +50 -1
  114. package/dist/esm/models/operations/listvendoradditionalfacilityfields.d.ts.map +1 -1
  115. package/dist/esm/models/operations/listvendoradditionalfacilityfields.js +31 -1
  116. package/dist/esm/models/operations/listvendoradditionalfacilityfields.js.map +1 -1
  117. package/dist/esm/models/operations/updateuserprofilepicture.d.ts +6 -2
  118. package/dist/esm/models/operations/updateuserprofilepicture.d.ts.map +1 -1
  119. package/dist/esm/models/operations/updateuserprofilepicture.js +5 -0
  120. package/dist/esm/models/operations/updateuserprofilepicture.js.map +1 -1
  121. package/dist/esm/react-query/usersUpdateUserProfilePicture.d.ts +1 -1
  122. package/dist/esm/react-query/usersUpdateUserProfilePicture.js +1 -1
  123. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts +26 -2
  124. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.d.ts.map +1 -1
  125. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.js +53 -2
  126. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.core.js.map +1 -1
  127. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts +67 -16
  128. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.d.ts.map +1 -1
  129. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js +63 -13
  130. package/dist/esm/react-query/vendorsListVendorAdditionalFacilityFields.js.map +1 -1
  131. package/dist/esm/sdk/users.d.ts +1 -1
  132. package/dist/esm/sdk/users.js +1 -1
  133. package/dist/esm/sdk/vendors.d.ts +9 -6
  134. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  135. package/dist/esm/sdk/vendors.js +7 -6
  136. package/dist/esm/sdk/vendors.js.map +1 -1
  137. package/jsr.json +1 -1
  138. package/package.json +1 -1
  139. package/src/__tests__/users.test.ts +1 -0
  140. package/src/__tests__/vendors.test.ts +34 -3
  141. package/src/__tests__/webhooks.test.ts +1 -1
  142. package/src/__tests__/zones.test.ts +14 -11
  143. package/src/funcs/usersUpdateUserProfilePicture.ts +1 -1
  144. package/src/funcs/vendorsListVendorAdditionalFacilityFields.ts +115 -37
  145. package/src/lib/config.ts +2 -2
  146. package/src/models/components/expand.ts +1 -0
  147. package/src/models/components/facility.ts +9 -9
  148. package/src/models/components/facilitycalendarsummary.ts +2 -0
  149. package/src/models/components/facilitysummary.ts +2 -0
  150. package/src/models/components/systemsummary.ts +34 -0
  151. package/src/models/operations/listlocations.ts +15 -12
  152. package/src/models/operations/listlookupsystems.ts +2 -1
  153. package/src/models/operations/listvendoradditionalfacilityfields.ts +104 -2
  154. package/src/models/operations/updateuserprofilepicture.ts +11 -2
  155. package/src/react-query/usersUpdateUserProfilePicture.ts +1 -1
  156. package/src/react-query/vendorsListVendorAdditionalFacilityFields.core.ts +124 -1
  157. package/src/react-query/vendorsListVendorAdditionalFacilityFields.ts +151 -12
  158. package/src/sdk/users.ts +1 -1
  159. package/src/sdk/vendors.ts +11 -7
@@ -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(
@@ -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
  }
@@ -4,13 +4,20 @@
4
4
  */
5
5
 
6
6
  import {
7
+ InfiniteData,
7
8
  InvalidateQueryFilters,
8
9
  QueryClient,
10
+ QueryKey,
11
+ useInfiniteQuery,
12
+ UseInfiniteQueryResult,
9
13
  useQuery,
10
14
  UseQueryResult,
15
+ useSuspenseInfiniteQuery,
16
+ UseSuspenseInfiniteQueryResult,
11
17
  useSuspenseQuery,
12
18
  UseSuspenseQueryResult,
13
19
  } from "@tanstack/react-query";
20
+ import * as components from "../models/components/index.js";
14
21
  import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
15
22
  import {
16
23
  ConnectionError,
@@ -25,20 +32,32 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
32
  import * as operations from "../models/operations/index.js";
26
33
  import { useGreenSecurityContext } from "./_context.js";
27
34
  import {
35
+ InfiniteQueryHookOptions,
28
36
  QueryHookOptions,
37
+ SuspenseInfiniteQueryHookOptions,
29
38
  SuspenseQueryHookOptions,
30
39
  TupleToPrefixes,
31
40
  } from "./_types.js";
32
41
  import {
42
+ buildVendorsListVendorAdditionalFacilityFieldsInfiniteQuery,
33
43
  buildVendorsListVendorAdditionalFacilityFieldsQuery,
34
44
  prefetchVendorsListVendorAdditionalFacilityFields,
45
+ prefetchVendorsListVendorAdditionalFacilityFieldsInfinite,
35
46
  queryKeyVendorsListVendorAdditionalFacilityFields,
47
+ queryKeyVendorsListVendorAdditionalFacilityFieldsInfinite,
48
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
49
+ VendorsListVendorAdditionalFacilityFieldsPageParams,
36
50
  VendorsListVendorAdditionalFacilityFieldsQueryData,
37
51
  } from "./vendorsListVendorAdditionalFacilityFields.core.js";
38
52
  export {
53
+ buildVendorsListVendorAdditionalFacilityFieldsInfiniteQuery,
39
54
  buildVendorsListVendorAdditionalFacilityFieldsQuery,
40
55
  prefetchVendorsListVendorAdditionalFacilityFields,
56
+ prefetchVendorsListVendorAdditionalFacilityFieldsInfinite,
41
57
  queryKeyVendorsListVendorAdditionalFacilityFields,
58
+ queryKeyVendorsListVendorAdditionalFacilityFieldsInfinite,
59
+ type VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
60
+ type VendorsListVendorAdditionalFacilityFieldsPageParams,
42
61
  type VendorsListVendorAdditionalFacilityFieldsQueryData,
43
62
  };
44
63
 
@@ -59,11 +78,12 @@ export type VendorsListVendorAdditionalFacilityFieldsQueryError =
59
78
  * @remarks
60
79
  * Deprecated. Use `GET /vendors/{vendor_id_or_me}/custom-fields` instead.
61
80
  *
62
- * **Breaking change notice:** The response shape has been realigned with
63
- * `/custom-fields`. Legacy keys (`system`, `facility`, `field`) and the
64
- * `pager` envelope are no longer returned. The endpoint now returns the
65
- * full `items` array with the new `field_for` discriminator and no
66
- * pagination. Scheduled for removal after SDK consumers migrate.
81
+ * Backward-compatible shape preserved: this endpoint continues to return
82
+ * the legacy paginated envelope (`items` + `pager`) with the original
83
+ * `system` / `facility` / `field` / `value` keys per item. New consumers
84
+ * should migrate to `/custom-fields`, which returns an unpaginated array
85
+ * with the `field_for` discriminator. Scheduled for removal after SDK
86
+ * consumers migrate.
67
87
  *
68
88
  * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
69
89
  */
@@ -94,11 +114,12 @@ export function useVendorsListVendorAdditionalFacilityFields(
94
114
  * @remarks
95
115
  * Deprecated. Use `GET /vendors/{vendor_id_or_me}/custom-fields` instead.
96
116
  *
97
- * **Breaking change notice:** The response shape has been realigned with
98
- * `/custom-fields`. Legacy keys (`system`, `facility`, `field`) and the
99
- * `pager` envelope are no longer returned. The endpoint now returns the
100
- * full `items` array with the new `field_for` discriminator and no
101
- * pagination. Scheduled for removal after SDK consumers migrate.
117
+ * Backward-compatible shape preserved: this endpoint continues to return
118
+ * the legacy paginated envelope (`items` + `pager`) with the original
119
+ * `system` / `facility` / `field` / `value` keys per item. New consumers
120
+ * should migrate to `/custom-fields`, which returns an unpaginated array
121
+ * with the `field_for` discriminator. Scheduled for removal after SDK
122
+ * consumers migrate.
102
123
  *
103
124
  * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
104
125
  */
@@ -123,9 +144,117 @@ export function useVendorsListVendorAdditionalFacilityFieldsSuspense(
123
144
  });
124
145
  }
125
146
 
147
+ /**
148
+ * List of vendor's additional facility fields
149
+ *
150
+ * @remarks
151
+ * Deprecated. Use `GET /vendors/{vendor_id_or_me}/custom-fields` instead.
152
+ *
153
+ * Backward-compatible shape preserved: this endpoint continues to return
154
+ * the legacy paginated envelope (`items` + `pager`) with the original
155
+ * `system` / `facility` / `field` / `value` keys per item. New consumers
156
+ * should migrate to `/custom-fields`, which returns an unpaginated array
157
+ * with the `field_for` discriminator. Scheduled for removal after SDK
158
+ * consumers migrate.
159
+ *
160
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
161
+ */
162
+ export function useVendorsListVendorAdditionalFacilityFieldsInfinite(
163
+ request: operations.ListVendorAdditionalFacilityFieldsRequest,
164
+ options?: InfiniteQueryHookOptions<
165
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
166
+ VendorsListVendorAdditionalFacilityFieldsQueryError
167
+ >,
168
+ ): UseInfiniteQueryResult<
169
+ InfiniteData<
170
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
171
+ VendorsListVendorAdditionalFacilityFieldsPageParams
172
+ >,
173
+ VendorsListVendorAdditionalFacilityFieldsQueryError
174
+ > {
175
+ const client = useGreenSecurityContext();
176
+ return useInfiniteQuery<
177
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
178
+ VendorsListVendorAdditionalFacilityFieldsQueryError,
179
+ InfiniteData<
180
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
181
+ VendorsListVendorAdditionalFacilityFieldsPageParams
182
+ >,
183
+ QueryKey,
184
+ VendorsListVendorAdditionalFacilityFieldsPageParams
185
+ >({
186
+ ...buildVendorsListVendorAdditionalFacilityFieldsInfiniteQuery(
187
+ client,
188
+ request,
189
+ options,
190
+ ),
191
+ initialPageParam: options?.initialPageParam,
192
+ getNextPageParam: (previousPage) => previousPage["~next"],
193
+ ...options,
194
+ });
195
+ }
196
+
197
+ /**
198
+ * List of vendor's additional facility fields
199
+ *
200
+ * @remarks
201
+ * Deprecated. Use `GET /vendors/{vendor_id_or_me}/custom-fields` instead.
202
+ *
203
+ * Backward-compatible shape preserved: this endpoint continues to return
204
+ * the legacy paginated envelope (`items` + `pager`) with the original
205
+ * `system` / `facility` / `field` / `value` keys per item. New consumers
206
+ * should migrate to `/custom-fields`, which returns an unpaginated array
207
+ * with the `field_for` discriminator. Scheduled for removal after SDK
208
+ * consumers migrate.
209
+ *
210
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
211
+ */
212
+ export function useVendorsListVendorAdditionalFacilityFieldsInfiniteSuspense(
213
+ request: operations.ListVendorAdditionalFacilityFieldsRequest,
214
+ options?: SuspenseInfiniteQueryHookOptions<
215
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
216
+ VendorsListVendorAdditionalFacilityFieldsQueryError
217
+ >,
218
+ ): UseSuspenseInfiniteQueryResult<
219
+ InfiniteData<
220
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
221
+ VendorsListVendorAdditionalFacilityFieldsPageParams
222
+ >,
223
+ VendorsListVendorAdditionalFacilityFieldsQueryError
224
+ > {
225
+ const client = useGreenSecurityContext();
226
+ return useSuspenseInfiniteQuery<
227
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
228
+ VendorsListVendorAdditionalFacilityFieldsQueryError,
229
+ InfiniteData<
230
+ VendorsListVendorAdditionalFacilityFieldsInfiniteQueryData,
231
+ VendorsListVendorAdditionalFacilityFieldsPageParams
232
+ >,
233
+ QueryKey,
234
+ VendorsListVendorAdditionalFacilityFieldsPageParams
235
+ >({
236
+ ...buildVendorsListVendorAdditionalFacilityFieldsInfiniteQuery(
237
+ client,
238
+ request,
239
+ options,
240
+ ),
241
+ initialPageParam: options?.initialPageParam,
242
+ getNextPageParam: (previousPage) => previousPage["~next"],
243
+ ...options,
244
+ });
245
+ }
246
+
126
247
  export function setVendorsListVendorAdditionalFacilityFieldsData(
127
248
  client: QueryClient,
128
- queryKeyBase: [vendorIdOrMe: string],
249
+ queryKeyBase: [
250
+ vendorIdOrMe: string,
251
+ parameters: {
252
+ sort?: string | null | undefined;
253
+ desc?: components.Desc | undefined;
254
+ page?: number | undefined;
255
+ itemsPerPage?: number | undefined;
256
+ },
257
+ ],
129
258
  data: VendorsListVendorAdditionalFacilityFieldsQueryData,
130
259
  ): VendorsListVendorAdditionalFacilityFieldsQueryData | undefined {
131
260
  const key = queryKeyVendorsListVendorAdditionalFacilityFields(
@@ -139,7 +268,17 @@ export function setVendorsListVendorAdditionalFacilityFieldsData(
139
268
 
140
269
  export function invalidateVendorsListVendorAdditionalFacilityFields(
141
270
  client: QueryClient,
142
- queryKeyBase: TupleToPrefixes<[vendorIdOrMe: string]>,
271
+ queryKeyBase: TupleToPrefixes<
272
+ [
273
+ vendorIdOrMe: string,
274
+ parameters: {
275
+ sort?: string | null | undefined;
276
+ desc?: components.Desc | undefined;
277
+ page?: number | undefined;
278
+ itemsPerPage?: number | undefined;
279
+ },
280
+ ]
281
+ >,
143
282
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
144
283
  ): Promise<void> {
145
284
  return client.invalidateQueries({
package/src/sdk/users.ts CHANGED
@@ -253,7 +253,7 @@ export class Users extends ClientSDK {
253
253
  * Register profile picture metadata for S3 direct upload
254
254
  *
255
255
  * @remarks
256
- * 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.
256
+ * 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.
257
257
  */
258
258
  async updateUserProfilePicture(
259
259
  request: operations.UpdateUserProfilePictureRequest,
@@ -770,11 +770,12 @@ export class Vendors extends ClientSDK {
770
770
  * @remarks
771
771
  * Deprecated. Use `GET /vendors/{vendor_id_or_me}/custom-fields` instead.
772
772
  *
773
- * **Breaking change notice:** The response shape has been realigned with
774
- * `/custom-fields`. Legacy keys (`system`, `facility`, `field`) and the
775
- * `pager` envelope are no longer returned. The endpoint now returns the
776
- * full `items` array with the new `field_for` discriminator and no
777
- * pagination. Scheduled for removal after SDK consumers migrate.
773
+ * Backward-compatible shape preserved: this endpoint continues to return
774
+ * the legacy paginated envelope (`items` + `pager`) with the original
775
+ * `system` / `facility` / `field` / `value` keys per item. New consumers
776
+ * should migrate to `/custom-fields`, which returns an unpaginated array
777
+ * with the `field_for` discriminator. Scheduled for removal after SDK
778
+ * consumers migrate.
778
779
  *
779
780
  * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
780
781
  */
@@ -782,9 +783,12 @@ export class Vendors extends ClientSDK {
782
783
  request: operations.ListVendorAdditionalFacilityFieldsRequest,
783
784
  options?: RequestOptions,
784
785
  ): Promise<
785
- operations.ListVendorAdditionalFacilityFieldsListVendorAdditionalFacilityFieldsOk
786
+ PageIterator<
787
+ operations.ListVendorAdditionalFacilityFieldsResponse,
788
+ { page: number }
789
+ >
786
790
  > {
787
- return unwrapAsync(vendorsListVendorAdditionalFacilityFields(
791
+ return unwrapResultIterator(vendorsListVendorAdditionalFacilityFields(
788
792
  this,
789
793
  request,
790
794
  options,