@greensecurity/javascript-sdk 0.43.1-beta.84 → 0.43.1-beta.88

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/README.md +3 -0
  2. package/dist/commonjs/__tests__/users.test.js +21 -0
  3. package/dist/commonjs/__tests__/users.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +19 -5
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/usersGetLinkedUsers.d.ts +23 -0
  9. package/dist/commonjs/funcs/usersGetLinkedUsers.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/usersGetLinkedUsers.js +125 -0
  11. package/dist/commonjs/funcs/usersGetLinkedUsers.js.map +1 -0
  12. package/dist/commonjs/funcs/vendorsGetVendorsDetails.d.ts +1 -0
  13. package/dist/commonjs/funcs/vendorsGetVendorsDetails.d.ts.map +1 -1
  14. package/dist/commonjs/funcs/vendorsGetVendorsDetails.js +1 -0
  15. package/dist/commonjs/funcs/vendorsGetVendorsDetails.js.map +1 -1
  16. package/dist/commonjs/lib/config.d.ts +2 -2
  17. package/dist/commonjs/lib/config.js +2 -2
  18. package/dist/commonjs/models/components/expand.d.ts +1 -0
  19. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/expand.js +1 -0
  21. package/dist/commonjs/models/components/expand.js.map +1 -1
  22. package/dist/commonjs/models/components/subscription.d.ts +1 -1
  23. package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/subscription.js +1 -1
  25. package/dist/commonjs/models/components/subscription.js.map +1 -1
  26. package/dist/commonjs/models/components/vendor.d.ts +7 -0
  27. package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/vendor.js +16 -1
  29. package/dist/commonjs/models/components/vendor.js.map +1 -1
  30. package/dist/commonjs/models/components/vendorcredentialsummary.d.ts +1 -0
  31. package/dist/commonjs/models/components/vendorcredentialsummary.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/vendorcredentialsummary.js +2 -0
  33. package/dist/commonjs/models/components/vendorcredentialsummary.js.map +1 -1
  34. package/dist/commonjs/models/operations/getlinkedusers.d.ts +36 -0
  35. package/dist/commonjs/models/operations/getlinkedusers.d.ts.map +1 -0
  36. package/dist/commonjs/models/operations/getlinkedusers.js +86 -0
  37. package/dist/commonjs/models/operations/getlinkedusers.js.map +1 -0
  38. package/dist/commonjs/models/operations/index.d.ts +1 -0
  39. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/index.js +1 -0
  41. package/dist/commonjs/models/operations/index.js.map +1 -1
  42. package/dist/commonjs/models/operations/updatevendordetails.d.ts +15 -0
  43. package/dist/commonjs/models/operations/updatevendordetails.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/updatevendordetails.js +15 -1
  45. package/dist/commonjs/models/operations/updatevendordetails.js.map +1 -1
  46. package/dist/commonjs/react-query/index.d.ts +1 -0
  47. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  48. package/dist/commonjs/react-query/index.js +1 -0
  49. package/dist/commonjs/react-query/index.js.map +1 -1
  50. package/dist/commonjs/react-query/usersGetLinkedUsers.core.d.ts +14 -0
  51. package/dist/commonjs/react-query/usersGetLinkedUsers.core.d.ts.map +1 -0
  52. package/dist/commonjs/react-query/usersGetLinkedUsers.core.js +39 -0
  53. package/dist/commonjs/react-query/usersGetLinkedUsers.core.js.map +1 -0
  54. package/dist/commonjs/react-query/usersGetLinkedUsers.d.ts +37 -0
  55. package/dist/commonjs/react-query/usersGetLinkedUsers.d.ts.map +1 -0
  56. package/dist/commonjs/react-query/usersGetLinkedUsers.js +75 -0
  57. package/dist/commonjs/react-query/usersGetLinkedUsers.js.map +1 -0
  58. package/dist/commonjs/react-query/vendorsGetVendorsDetails.d.ts +2 -0
  59. package/dist/commonjs/react-query/vendorsGetVendorsDetails.d.ts.map +1 -1
  60. package/dist/commonjs/react-query/vendorsGetVendorsDetails.js +2 -0
  61. package/dist/commonjs/react-query/vendorsGetVendorsDetails.js.map +1 -1
  62. package/dist/commonjs/sdk/users.d.ts +12 -0
  63. package/dist/commonjs/sdk/users.d.ts.map +1 -1
  64. package/dist/commonjs/sdk/users.js +15 -0
  65. package/dist/commonjs/sdk/users.js.map +1 -1
  66. package/dist/commonjs/sdk/vendors.d.ts +1 -0
  67. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  68. package/dist/commonjs/sdk/vendors.js +1 -0
  69. package/dist/commonjs/sdk/vendors.js.map +1 -1
  70. package/dist/esm/__tests__/users.test.js +21 -0
  71. package/dist/esm/__tests__/users.test.js.map +1 -1
  72. package/dist/esm/__tests__/webhooks.test.js +1 -1
  73. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  74. package/dist/esm/__tests__/zones.test.js +19 -5
  75. package/dist/esm/__tests__/zones.test.js.map +1 -1
  76. package/dist/esm/funcs/usersGetLinkedUsers.d.ts +23 -0
  77. package/dist/esm/funcs/usersGetLinkedUsers.d.ts.map +1 -0
  78. package/dist/esm/funcs/usersGetLinkedUsers.js +89 -0
  79. package/dist/esm/funcs/usersGetLinkedUsers.js.map +1 -0
  80. package/dist/esm/funcs/vendorsGetVendorsDetails.d.ts +1 -0
  81. package/dist/esm/funcs/vendorsGetVendorsDetails.d.ts.map +1 -1
  82. package/dist/esm/funcs/vendorsGetVendorsDetails.js +1 -0
  83. package/dist/esm/funcs/vendorsGetVendorsDetails.js.map +1 -1
  84. package/dist/esm/lib/config.d.ts +2 -2
  85. package/dist/esm/lib/config.js +2 -2
  86. package/dist/esm/models/components/expand.d.ts +1 -0
  87. package/dist/esm/models/components/expand.d.ts.map +1 -1
  88. package/dist/esm/models/components/expand.js +1 -0
  89. package/dist/esm/models/components/expand.js.map +1 -1
  90. package/dist/esm/models/components/subscription.d.ts +1 -1
  91. package/dist/esm/models/components/subscription.d.ts.map +1 -1
  92. package/dist/esm/models/components/subscription.js +1 -1
  93. package/dist/esm/models/components/subscription.js.map +1 -1
  94. package/dist/esm/models/components/vendor.d.ts +7 -0
  95. package/dist/esm/models/components/vendor.d.ts.map +1 -1
  96. package/dist/esm/models/components/vendor.js +14 -0
  97. package/dist/esm/models/components/vendor.js.map +1 -1
  98. package/dist/esm/models/components/vendorcredentialsummary.d.ts +1 -0
  99. package/dist/esm/models/components/vendorcredentialsummary.d.ts.map +1 -1
  100. package/dist/esm/models/components/vendorcredentialsummary.js +2 -0
  101. package/dist/esm/models/components/vendorcredentialsummary.js.map +1 -1
  102. package/dist/esm/models/operations/getlinkedusers.d.ts +36 -0
  103. package/dist/esm/models/operations/getlinkedusers.d.ts.map +1 -0
  104. package/dist/esm/models/operations/getlinkedusers.js +47 -0
  105. package/dist/esm/models/operations/getlinkedusers.js.map +1 -0
  106. package/dist/esm/models/operations/index.d.ts +1 -0
  107. package/dist/esm/models/operations/index.d.ts.map +1 -1
  108. package/dist/esm/models/operations/index.js +1 -0
  109. package/dist/esm/models/operations/index.js.map +1 -1
  110. package/dist/esm/models/operations/updatevendordetails.d.ts +15 -0
  111. package/dist/esm/models/operations/updatevendordetails.d.ts.map +1 -1
  112. package/dist/esm/models/operations/updatevendordetails.js +13 -0
  113. package/dist/esm/models/operations/updatevendordetails.js.map +1 -1
  114. package/dist/esm/react-query/index.d.ts +1 -0
  115. package/dist/esm/react-query/index.d.ts.map +1 -1
  116. package/dist/esm/react-query/index.js +1 -0
  117. package/dist/esm/react-query/index.js.map +1 -1
  118. package/dist/esm/react-query/usersGetLinkedUsers.core.d.ts +14 -0
  119. package/dist/esm/react-query/usersGetLinkedUsers.core.d.ts.map +1 -0
  120. package/dist/esm/react-query/usersGetLinkedUsers.core.js +34 -0
  121. package/dist/esm/react-query/usersGetLinkedUsers.core.js.map +1 -0
  122. package/dist/esm/react-query/usersGetLinkedUsers.d.ts +37 -0
  123. package/dist/esm/react-query/usersGetLinkedUsers.d.ts.map +1 -0
  124. package/dist/esm/react-query/usersGetLinkedUsers.js +65 -0
  125. package/dist/esm/react-query/usersGetLinkedUsers.js.map +1 -0
  126. package/dist/esm/react-query/vendorsGetVendorsDetails.d.ts +2 -0
  127. package/dist/esm/react-query/vendorsGetVendorsDetails.d.ts.map +1 -1
  128. package/dist/esm/react-query/vendorsGetVendorsDetails.js +2 -0
  129. package/dist/esm/react-query/vendorsGetVendorsDetails.js.map +1 -1
  130. package/dist/esm/sdk/users.d.ts +12 -0
  131. package/dist/esm/sdk/users.d.ts.map +1 -1
  132. package/dist/esm/sdk/users.js +15 -0
  133. package/dist/esm/sdk/users.js.map +1 -1
  134. package/dist/esm/sdk/vendors.d.ts +1 -0
  135. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  136. package/dist/esm/sdk/vendors.js +1 -0
  137. package/dist/esm/sdk/vendors.js.map +1 -1
  138. package/examples/package-lock.json +1 -1
  139. package/jsr.json +1 -1
  140. package/package.json +1 -1
  141. package/src/__tests__/users.test.ts +24 -0
  142. package/src/__tests__/webhooks.test.ts +1 -1
  143. package/src/__tests__/zones.test.ts +19 -5
  144. package/src/funcs/usersGetLinkedUsers.ts +177 -0
  145. package/src/funcs/vendorsGetVendorsDetails.ts +1 -0
  146. package/src/lib/config.ts +2 -2
  147. package/src/models/components/expand.ts +1 -0
  148. package/src/models/components/subscription.ts +2 -2
  149. package/src/models/components/vendor.ts +31 -0
  150. package/src/models/components/vendorcredentialsummary.ts +3 -0
  151. package/src/models/operations/getlinkedusers.ts +110 -0
  152. package/src/models/operations/index.ts +1 -0
  153. package/src/models/operations/updatevendordetails.ts +35 -0
  154. package/src/react-query/index.ts +1 -0
  155. package/src/react-query/usersGetLinkedUsers.core.ts +78 -0
  156. package/src/react-query/usersGetLinkedUsers.ts +119 -0
  157. package/src/react-query/vendorsGetVendorsDetails.ts +2 -0
  158. package/src/sdk/users.ts +23 -0
  159. package/src/sdk/vendors.ts +1 -0
@@ -0,0 +1,177 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.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
+ * Get linked users
30
+ *
31
+ * @remarks
32
+ * Returns a list of users linked to the authenticated user.
33
+ *
34
+ * For regular users, returns their own linked users.
35
+ *
36
+ * For API users, the `user_id` parameter is required. The API user must
37
+ * have an active app activation for the requested user.
38
+ */
39
+ export function usersGetLinkedUsers(
40
+ client: GreenSecurityCore,
41
+ request: operations.GetLinkedUsersRequest,
42
+ options?: RequestOptions,
43
+ ): APIPromise<
44
+ Result<
45
+ operations.GetLinkedUsersGetLinkedUsersOk,
46
+ | errors.ApiErrorResponse
47
+ | GreenSecurityError
48
+ | ResponseValidationError
49
+ | ConnectionError
50
+ | RequestAbortedError
51
+ | RequestTimeoutError
52
+ | InvalidRequestError
53
+ | UnexpectedClientError
54
+ | SDKValidationError
55
+ >
56
+ > {
57
+ return new APIPromise($do(
58
+ client,
59
+ request,
60
+ options,
61
+ ));
62
+ }
63
+
64
+ async function $do(
65
+ client: GreenSecurityCore,
66
+ request: operations.GetLinkedUsersRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ operations.GetLinkedUsersGetLinkedUsersOk,
72
+ | errors.ApiErrorResponse
73
+ | GreenSecurityError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) => operations.GetLinkedUsersRequest$outboundSchema.parse(value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const path = pathToFunc("/users/linked-users")();
97
+
98
+ const query = encodeFormQuery({
99
+ "user_id": payload.user_id,
100
+ });
101
+
102
+ const headers = new Headers(compactMap({
103
+ Accept: "application/json",
104
+ }));
105
+
106
+ const securityInput = await extractSecurity(client._options.security);
107
+ const requestSecurity = resolveGlobalSecurity(securityInput);
108
+
109
+ const context = {
110
+ options: client._options,
111
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
112
+ operationID: "getLinkedUsers",
113
+ oAuth2Scopes: null,
114
+
115
+ resolvedSecurity: requestSecurity,
116
+
117
+ securitySource: client._options.security,
118
+ retryConfig: options?.retries
119
+ || client._options.retryConfig
120
+ || { strategy: "none" },
121
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
122
+ };
123
+
124
+ const requestRes = client._createRequest(context, {
125
+ security: requestSecurity,
126
+ method: "GET",
127
+ baseURL: options?.serverURL,
128
+ path: path,
129
+ headers: headers,
130
+ query: query,
131
+ body: body,
132
+ userAgent: client._options.userAgent,
133
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
134
+ }, options);
135
+ if (!requestRes.ok) {
136
+ return [requestRes, { status: "invalid" }];
137
+ }
138
+ const req = requestRes.value;
139
+
140
+ const doResult = await client._do(req, {
141
+ context,
142
+ errorCodes: ["400", "401", "403", "422", "4XX", "500", "5XX"],
143
+ retryConfig: context.retryConfig,
144
+ retryCodes: context.retryCodes,
145
+ });
146
+ if (!doResult.ok) {
147
+ return [doResult, { status: "request-error", request: req }];
148
+ }
149
+ const response = doResult.value;
150
+
151
+ const responseFields = {
152
+ HttpMeta: { Response: response, Request: req },
153
+ };
154
+
155
+ const [result] = await M.match<
156
+ operations.GetLinkedUsersGetLinkedUsersOk,
157
+ | errors.ApiErrorResponse
158
+ | GreenSecurityError
159
+ | ResponseValidationError
160
+ | ConnectionError
161
+ | RequestAbortedError
162
+ | RequestTimeoutError
163
+ | InvalidRequestError
164
+ | UnexpectedClientError
165
+ | SDKValidationError
166
+ >(
167
+ M.json(200, operations.GetLinkedUsersGetLinkedUsersOk$inboundSchema),
168
+ M.jsonErr([400, 401, 403, 422], errors.ApiErrorResponse$inboundSchema),
169
+ M.fail("4XX"),
170
+ M.fail([500, "5XX"]),
171
+ )(response, req, { extraFields: responseFields });
172
+ if (!result.ok) {
173
+ return [result, { status: "complete", request: req, response }];
174
+ }
175
+
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
@@ -55,6 +55,7 @@ import { Result } from "../types/fp.js";
55
55
  * vendor.vendor_groups
56
56
  * vendor.has_credentialed_facilities
57
57
  * vendor.has_emerald_status
58
+ * vendor.client_app_config
58
59
  */
59
60
  export function vendorsGetVendorsDetails(
60
61
  client: GreenSecurityCore,
package/src/lib/config.ts CHANGED
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
82
  openapiDocVersion: "0.0.11",
83
- sdkVersion: "0.43.1-beta.82",
83
+ sdkVersion: "0.43.1-beta.86",
84
84
  genVersion: "2.794.1",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.43.1-beta.82 2.794.1 0.0.11 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.43.1-beta.86 2.794.1 0.0.11 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -43,6 +43,7 @@ export const Expand = {
43
43
  VendorRegistrationData: "vendor.registration_data",
44
44
  VendorRegistrationFinished: "vendor.registration_finished",
45
45
  VendorRequiredBadgeType: "vendor.required_badge_type",
46
+ VendorClientAppConfig: "vendor.client_app_config",
46
47
  VendorTargetFacilities: "vendor.target_facilities",
47
48
  VendorUser: "vendor.user",
48
49
  VendorVendorGroups: "vendor.vendor_groups",
@@ -27,7 +27,7 @@ export type Subscription = {
27
27
  dateEnds?: string | null | undefined;
28
28
  status?: string | null | undefined;
29
29
  locked?: boolean | null | undefined;
30
- variantTitle?: string | null | undefined;
30
+ variantTitle?: string | undefined;
31
31
  /**
32
32
  * Reduced list of attributes of the Invoice line item record
33
33
  */
@@ -52,7 +52,7 @@ export const Subscription$inboundSchema: z.ZodType<
52
52
  date_ends: z.nullable(types.string()).optional(),
53
53
  status: z.nullable(types.string()).optional(),
54
54
  locked: z.nullable(types.boolean()).optional(),
55
- variant_title: z.nullable(types.string()).optional(),
55
+ variant_title: types.optional(types.string()),
56
56
  current_line_item: z.nullable(InvoiceItem$inboundSchema).optional(),
57
57
  next_line_item: z.nullable(InvoiceItem$inboundSchema).optional(),
58
58
  current_financial_status: z.nullable(FinancialStatus$inboundSchema)
@@ -60,6 +60,10 @@ export type One = {
60
60
 
61
61
  export type VendorUser = One | number;
62
62
 
63
+ export type ClientAppConfig = {
64
+ showNewAppVersionDetails?: boolean | null | undefined;
65
+ };
66
+
63
67
  export type VendorJob = VendorJobTitle | number;
64
68
 
65
69
  export type VendorVendorType = VendorType | number;
@@ -132,6 +136,7 @@ export type Vendor = {
132
136
  user?: One | number | undefined;
133
137
  registrationData?: { [k: string]: any } | null | undefined;
134
138
  registrationFinished?: boolean | null | undefined;
139
+ clientAppConfig?: ClientAppConfig | null | undefined;
135
140
  vendorJob?: VendorJobTitle | number | null | undefined;
136
141
  vendorType?: VendorType | number | null | undefined;
137
142
  /**
@@ -264,6 +269,29 @@ export function vendorUserFromJSON(
264
269
  );
265
270
  }
266
271
 
272
+ /** @internal */
273
+ export const ClientAppConfig$inboundSchema: z.ZodType<
274
+ ClientAppConfig,
275
+ z.ZodTypeDef,
276
+ unknown
277
+ > = z.object({
278
+ show_new_app_version_details: z.nullable(types.boolean()).optional(),
279
+ }).transform((v) => {
280
+ return remap$(v, {
281
+ "show_new_app_version_details": "showNewAppVersionDetails",
282
+ });
283
+ });
284
+
285
+ export function clientAppConfigFromJSON(
286
+ jsonString: string,
287
+ ): SafeParseResult<ClientAppConfig, SDKValidationError> {
288
+ return safeParse(
289
+ jsonString,
290
+ (x) => ClientAppConfig$inboundSchema.parse(JSON.parse(x)),
291
+ `Failed to parse 'ClientAppConfig' from JSON`,
292
+ );
293
+ }
294
+
267
295
  /** @internal */
268
296
  export const VendorJob$inboundSchema: z.ZodType<
269
297
  VendorJob,
@@ -530,6 +558,8 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
530
558
  ),
531
559
  registration_data: z.nullable(z.record(z.any())).optional(),
532
560
  registration_finished: z.nullable(types.boolean()).optional(),
561
+ client_app_config: z.nullable(z.lazy(() => ClientAppConfig$inboundSchema))
562
+ .optional(),
533
563
  vendor_job: z.nullable(
534
564
  smartUnion([VendorJobTitle$inboundSchema, types.number()]),
535
565
  ).optional(),
@@ -589,6 +619,7 @@ export const Vendor$inboundSchema: z.ZodType<Vendor, z.ZodTypeDef, unknown> = z
589
619
  "has_emerald_status": "hasEmeraldStatus",
590
620
  "registration_data": "registrationData",
591
621
  "registration_finished": "registrationFinished",
622
+ "client_app_config": "clientAppConfig",
592
623
  "vendor_job": "vendorJob",
593
624
  "vendor_type": "vendorType",
594
625
  "qr_code": "qrCode",
@@ -75,6 +75,7 @@ export type VendorCredentialSummary = {
75
75
  jsonData?: string | null | undefined;
76
76
  filename?: string | null | undefined;
77
77
  alternateId?: number | null | undefined;
78
+ appliesToCompany?: boolean | null | undefined;
78
79
  credential?: Credential | number | null | undefined;
79
80
  vendor?: Vendor | number | null | undefined;
80
81
  invoice?: Invoice | number | null | undefined;
@@ -257,6 +258,7 @@ export const VendorCredentialSummary$inboundSchema: z.ZodType<
257
258
  json_data: z.nullable(types.string()).optional(),
258
259
  filename: z.nullable(types.string()).optional(),
259
260
  alternate_id: z.nullable(types.number()).optional(),
261
+ applies_to_company: z.nullable(types.boolean()).optional(),
260
262
  credential: z.nullable(smartUnion([Credential$inboundSchema, types.number()]))
261
263
  .optional(),
262
264
  vendor: z.nullable(smartUnion([Vendor$inboundSchema, types.number()]))
@@ -301,6 +303,7 @@ export const VendorCredentialSummary$inboundSchema: z.ZodType<
301
303
  "date_valid": "dateValid",
302
304
  "json_data": "jsonData",
303
305
  "alternate_id": "alternateId",
306
+ "applies_to_company": "appliesToCompany",
304
307
  "vendor_credential_files": "vendorCredentialFiles",
305
308
  "latest_vendor_credential_id": "latestVendorCredentialId",
306
309
  "previously_approved": "previouslyApproved",
@@ -0,0 +1,110 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type GetLinkedUsersRequest = {
13
+ /**
14
+ * The ID of the user to fetch linked users for. Required for API users.
15
+ */
16
+ userId?: number | undefined;
17
+ };
18
+
19
+ export type LinkedUsers = {
20
+ id: number;
21
+ firstName?: string | null | undefined;
22
+ lastName?: string | null | undefined;
23
+ email: string;
24
+ userType: string;
25
+ };
26
+
27
+ /**
28
+ * The request was successful, and the server has returned the requested resource in the response body.
29
+ */
30
+ export type GetLinkedUsersGetLinkedUsersOk = {
31
+ linkedUsers: Array<LinkedUsers>;
32
+ };
33
+
34
+ /** @internal */
35
+ export type GetLinkedUsersRequest$Outbound = {
36
+ user_id?: number | undefined;
37
+ };
38
+
39
+ /** @internal */
40
+ export const GetLinkedUsersRequest$outboundSchema: z.ZodType<
41
+ GetLinkedUsersRequest$Outbound,
42
+ z.ZodTypeDef,
43
+ GetLinkedUsersRequest
44
+ > = z.object({
45
+ userId: z.number().int().optional(),
46
+ }).transform((v) => {
47
+ return remap$(v, {
48
+ userId: "user_id",
49
+ });
50
+ });
51
+
52
+ export function getLinkedUsersRequestToJSON(
53
+ getLinkedUsersRequest: GetLinkedUsersRequest,
54
+ ): string {
55
+ return JSON.stringify(
56
+ GetLinkedUsersRequest$outboundSchema.parse(getLinkedUsersRequest),
57
+ );
58
+ }
59
+
60
+ /** @internal */
61
+ export const LinkedUsers$inboundSchema: z.ZodType<
62
+ LinkedUsers,
63
+ z.ZodTypeDef,
64
+ unknown
65
+ > = z.object({
66
+ id: types.number(),
67
+ first_name: z.nullable(types.string()).optional(),
68
+ last_name: z.nullable(types.string()).optional(),
69
+ email: types.string(),
70
+ user_type: types.string(),
71
+ }).transform((v) => {
72
+ return remap$(v, {
73
+ "first_name": "firstName",
74
+ "last_name": "lastName",
75
+ "user_type": "userType",
76
+ });
77
+ });
78
+
79
+ export function linkedUsersFromJSON(
80
+ jsonString: string,
81
+ ): SafeParseResult<LinkedUsers, SDKValidationError> {
82
+ return safeParse(
83
+ jsonString,
84
+ (x) => LinkedUsers$inboundSchema.parse(JSON.parse(x)),
85
+ `Failed to parse 'LinkedUsers' from JSON`,
86
+ );
87
+ }
88
+
89
+ /** @internal */
90
+ export const GetLinkedUsersGetLinkedUsersOk$inboundSchema: z.ZodType<
91
+ GetLinkedUsersGetLinkedUsersOk,
92
+ z.ZodTypeDef,
93
+ unknown
94
+ > = z.object({
95
+ linked_users: z.array(z.lazy(() => LinkedUsers$inboundSchema)),
96
+ }).transform((v) => {
97
+ return remap$(v, {
98
+ "linked_users": "linkedUsers",
99
+ });
100
+ });
101
+
102
+ export function getLinkedUsersGetLinkedUsersOkFromJSON(
103
+ jsonString: string,
104
+ ): SafeParseResult<GetLinkedUsersGetLinkedUsersOk, SDKValidationError> {
105
+ return safeParse(
106
+ jsonString,
107
+ (x) => GetLinkedUsersGetLinkedUsersOk$inboundSchema.parse(JSON.parse(x)),
108
+ `Failed to parse 'GetLinkedUsersGetLinkedUsersOk' from JSON`,
109
+ );
110
+ }
@@ -29,6 +29,7 @@ export * from "./expeditetimeremaining.js";
29
29
  export * from "./getcompany.js";
30
30
  export * from "./getfacility.js";
31
31
  export * from "./getfhirconfig.js";
32
+ export * from "./getlinkedusers.js";
32
33
  export * from "./getnextscreeningquestion.js";
33
34
  export * from "./getnextunansweredscreeningquestion.js";
34
35
  export * from "./getsecurityzone.js";
@@ -21,6 +21,13 @@ export const EmailRecepient = {
21
21
  */
22
22
  export type EmailRecepient = ClosedEnum<typeof EmailRecepient>;
23
23
 
24
+ export type ClientAppConfig = {
25
+ /**
26
+ * The vendor's show_new_app_version_details value to update
27
+ */
28
+ showNewAppVersionDetails?: boolean | undefined;
29
+ };
30
+
24
31
  export type UpdateVendorDetailsRequestBody = {
25
32
  /**
26
33
  * The QR code value
@@ -30,6 +37,7 @@ export type UpdateVendorDetailsRequestBody = {
30
37
  * The vendor's email_recepient value to update
31
38
  */
32
39
  emailRecepient?: EmailRecepient | undefined;
40
+ clientAppConfig?: ClientAppConfig | undefined;
33
41
  /**
34
42
  * The vendor's send_weekly_summary_email value to update
35
43
  */
@@ -65,10 +73,35 @@ export const EmailRecepient$outboundSchema: z.ZodNativeEnum<
65
73
  typeof EmailRecepient
66
74
  > = z.nativeEnum(EmailRecepient);
67
75
 
76
+ /** @internal */
77
+ export type ClientAppConfig$Outbound = {
78
+ show_new_app_version_details?: boolean | undefined;
79
+ };
80
+
81
+ /** @internal */
82
+ export const ClientAppConfig$outboundSchema: z.ZodType<
83
+ ClientAppConfig$Outbound,
84
+ z.ZodTypeDef,
85
+ ClientAppConfig
86
+ > = z.object({
87
+ showNewAppVersionDetails: z.boolean().optional(),
88
+ }).transform((v) => {
89
+ return remap$(v, {
90
+ showNewAppVersionDetails: "show_new_app_version_details",
91
+ });
92
+ });
93
+
94
+ export function clientAppConfigToJSON(
95
+ clientAppConfig: ClientAppConfig,
96
+ ): string {
97
+ return JSON.stringify(ClientAppConfig$outboundSchema.parse(clientAppConfig));
98
+ }
99
+
68
100
  /** @internal */
69
101
  export type UpdateVendorDetailsRequestBody$Outbound = {
70
102
  qr_code?: string | undefined;
71
103
  email_recepient?: string | undefined;
104
+ client_app_config?: ClientAppConfig$Outbound | undefined;
72
105
  send_weekly_summary_email?: boolean | undefined;
73
106
  title?: string | undefined;
74
107
  location?: components.UserLocation$Outbound | null | undefined;
@@ -84,6 +117,7 @@ export const UpdateVendorDetailsRequestBody$outboundSchema: z.ZodType<
84
117
  > = z.object({
85
118
  qrCode: z.string().optional(),
86
119
  emailRecepient: EmailRecepient$outboundSchema.optional(),
120
+ clientAppConfig: z.lazy(() => ClientAppConfig$outboundSchema).optional(),
87
121
  sendWeeklySummaryEmail: z.boolean().optional(),
88
122
  title: z.string().optional(),
89
123
  location: z.nullable(components.UserLocation$outboundSchema).optional(),
@@ -93,6 +127,7 @@ export const UpdateVendorDetailsRequestBody$outboundSchema: z.ZodType<
93
127
  return remap$(v, {
94
128
  qrCode: "qr_code",
95
129
  emailRecepient: "email_recepient",
130
+ clientAppConfig: "client_app_config",
96
131
  sendWeeklySummaryEmail: "send_weekly_summary_email",
97
132
  primaryDepartmentId: "primary_department_id",
98
133
  });
@@ -42,6 +42,7 @@ export * from "./supportArticlesListOrSearchSupportArticles.js";
42
42
  export * from "./systemsListSystems.js";
43
43
  export * from "./usersChangePassword.js";
44
44
  export * from "./usersGetCurrentUser.js";
45
+ export * from "./usersGetLinkedUsers.js";
45
46
  export * from "./usersGetUserById.js";
46
47
  export * from "./usersMagiclink.js";
47
48
  export * from "./usersPassword.js";
@@ -0,0 +1,78 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ QueryClient,
7
+ QueryFunctionContext,
8
+ QueryKey,
9
+ } from "@tanstack/react-query";
10
+ import { GreenSecurityCore } from "../core.js";
11
+ import { usersGetLinkedUsers } from "../funcs/usersGetLinkedUsers.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { unwrapAsync } from "../types/fp.js";
16
+ export type UsersGetLinkedUsersQueryData =
17
+ operations.GetLinkedUsersGetLinkedUsersOk;
18
+
19
+ export function prefetchUsersGetLinkedUsers(
20
+ queryClient: QueryClient,
21
+ client$: GreenSecurityCore,
22
+ request: operations.GetLinkedUsersRequest,
23
+ options?: RequestOptions,
24
+ ): Promise<void> {
25
+ return queryClient.prefetchQuery({
26
+ ...buildUsersGetLinkedUsersQuery(
27
+ client$,
28
+ request,
29
+ options,
30
+ ),
31
+ });
32
+ }
33
+
34
+ export function buildUsersGetLinkedUsersQuery(
35
+ client$: GreenSecurityCore,
36
+ request: operations.GetLinkedUsersRequest,
37
+ options?: RequestOptions,
38
+ ): {
39
+ queryKey: QueryKey;
40
+ queryFn: (
41
+ context: QueryFunctionContext,
42
+ ) => Promise<UsersGetLinkedUsersQueryData>;
43
+ } {
44
+ return {
45
+ queryKey: queryKeyUsersGetLinkedUsers({ userId: request.userId }),
46
+ queryFn: async function usersGetLinkedUsersQueryFn(
47
+ ctx,
48
+ ): Promise<UsersGetLinkedUsersQueryData> {
49
+ const sig = combineSignals(
50
+ ctx.signal,
51
+ options?.signal,
52
+ options?.fetchOptions?.signal,
53
+ );
54
+ const mergedOptions = {
55
+ ...options?.fetchOptions,
56
+ ...options,
57
+ signal: sig,
58
+ };
59
+
60
+ return unwrapAsync(usersGetLinkedUsers(
61
+ client$,
62
+ request,
63
+ mergedOptions,
64
+ ));
65
+ },
66
+ };
67
+ }
68
+
69
+ export function queryKeyUsersGetLinkedUsers(
70
+ parameters: { userId?: number | undefined },
71
+ ): QueryKey {
72
+ return [
73
+ "@greensecurity/javascript-sdk",
74
+ "users",
75
+ "getLinkedUsers",
76
+ parameters,
77
+ ];
78
+ }