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

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 (154) hide show
  1. package/README.md +3 -0
  2. package/dist/commonjs/__tests__/companies.test.js +30 -0
  3. package/dist/commonjs/__tests__/companies.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +5 -19
  5. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  6. package/dist/commonjs/funcs/companiesListCompanyManagers.d.ts +21 -0
  7. package/dist/commonjs/funcs/companiesListCompanyManagers.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/companiesListCompanyManagers.js +162 -0
  9. package/dist/commonjs/funcs/companiesListCompanyManagers.js.map +1 -0
  10. package/dist/commonjs/funcs/vendorsGetVendorsDetails.d.ts +0 -1
  11. package/dist/commonjs/funcs/vendorsGetVendorsDetails.d.ts.map +1 -1
  12. package/dist/commonjs/funcs/vendorsGetVendorsDetails.js +0 -1
  13. package/dist/commonjs/funcs/vendorsGetVendorsDetails.js.map +1 -1
  14. package/dist/commonjs/lib/config.d.ts +2 -2
  15. package/dist/commonjs/lib/config.js +2 -2
  16. package/dist/commonjs/models/components/companymanager.d.ts +78 -0
  17. package/dist/commonjs/models/components/companymanager.d.ts.map +1 -0
  18. package/dist/commonjs/models/components/companymanager.js +172 -0
  19. package/dist/commonjs/models/components/companymanager.js.map +1 -0
  20. package/dist/commonjs/models/components/expand.d.ts +0 -1
  21. package/dist/commonjs/models/components/expand.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/expand.js +0 -1
  23. package/dist/commonjs/models/components/expand.js.map +1 -1
  24. package/dist/commonjs/models/components/index.d.ts +1 -0
  25. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/index.js +1 -0
  27. package/dist/commonjs/models/components/index.js.map +1 -1
  28. package/dist/commonjs/models/components/vendor.d.ts +0 -7
  29. package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/vendor.js +1 -16
  31. package/dist/commonjs/models/components/vendor.js.map +1 -1
  32. package/dist/commonjs/models/operations/index.d.ts +1 -0
  33. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  34. package/dist/commonjs/models/operations/index.js +1 -0
  35. package/dist/commonjs/models/operations/index.js.map +1 -1
  36. package/dist/commonjs/models/operations/listcompanymanagers.d.ts +57 -0
  37. package/dist/commonjs/models/operations/listcompanymanagers.d.ts.map +1 -0
  38. package/dist/commonjs/models/operations/listcompanymanagers.js +82 -0
  39. package/dist/commonjs/models/operations/listcompanymanagers.js.map +1 -0
  40. package/dist/commonjs/models/operations/updatevendordetails.d.ts +0 -15
  41. package/dist/commonjs/models/operations/updatevendordetails.d.ts.map +1 -1
  42. package/dist/commonjs/models/operations/updatevendordetails.js +1 -15
  43. package/dist/commonjs/models/operations/updatevendordetails.js.map +1 -1
  44. package/dist/commonjs/react-query/companiesListCompanyManagers.core.d.ts +36 -0
  45. package/dist/commonjs/react-query/companiesListCompanyManagers.core.d.ts.map +1 -0
  46. package/dist/commonjs/react-query/companiesListCompanyManagers.core.js +93 -0
  47. package/dist/commonjs/react-query/companiesListCompanyManagers.core.js.map +1 -0
  48. package/dist/commonjs/react-query/companiesListCompanyManagers.d.ts +54 -0
  49. package/dist/commonjs/react-query/companiesListCompanyManagers.d.ts.map +1 -0
  50. package/dist/commonjs/react-query/companiesListCompanyManagers.js +104 -0
  51. package/dist/commonjs/react-query/companiesListCompanyManagers.js.map +1 -0
  52. package/dist/commonjs/react-query/index.d.ts +1 -0
  53. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  54. package/dist/commonjs/react-query/index.js +1 -0
  55. package/dist/commonjs/react-query/index.js.map +1 -1
  56. package/dist/commonjs/react-query/vendorsGetVendorsDetails.d.ts +0 -2
  57. package/dist/commonjs/react-query/vendorsGetVendorsDetails.d.ts.map +1 -1
  58. package/dist/commonjs/react-query/vendorsGetVendorsDetails.js +0 -2
  59. package/dist/commonjs/react-query/vendorsGetVendorsDetails.js.map +1 -1
  60. package/dist/commonjs/sdk/companies.d.ts +9 -0
  61. package/dist/commonjs/sdk/companies.d.ts.map +1 -1
  62. package/dist/commonjs/sdk/companies.js +10 -0
  63. package/dist/commonjs/sdk/companies.js.map +1 -1
  64. package/dist/commonjs/sdk/vendors.d.ts +0 -1
  65. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  66. package/dist/commonjs/sdk/vendors.js +0 -1
  67. package/dist/commonjs/sdk/vendors.js.map +1 -1
  68. package/dist/esm/__tests__/companies.test.js +30 -0
  69. package/dist/esm/__tests__/companies.test.js.map +1 -1
  70. package/dist/esm/__tests__/zones.test.js +5 -19
  71. package/dist/esm/__tests__/zones.test.js.map +1 -1
  72. package/dist/esm/funcs/companiesListCompanyManagers.d.ts +21 -0
  73. package/dist/esm/funcs/companiesListCompanyManagers.d.ts.map +1 -0
  74. package/dist/esm/funcs/companiesListCompanyManagers.js +126 -0
  75. package/dist/esm/funcs/companiesListCompanyManagers.js.map +1 -0
  76. package/dist/esm/funcs/vendorsGetVendorsDetails.d.ts +0 -1
  77. package/dist/esm/funcs/vendorsGetVendorsDetails.d.ts.map +1 -1
  78. package/dist/esm/funcs/vendorsGetVendorsDetails.js +0 -1
  79. package/dist/esm/funcs/vendorsGetVendorsDetails.js.map +1 -1
  80. package/dist/esm/lib/config.d.ts +2 -2
  81. package/dist/esm/lib/config.js +2 -2
  82. package/dist/esm/models/components/companymanager.d.ts +78 -0
  83. package/dist/esm/models/components/companymanager.d.ts.map +1 -0
  84. package/dist/esm/models/components/companymanager.js +127 -0
  85. package/dist/esm/models/components/companymanager.js.map +1 -0
  86. package/dist/esm/models/components/expand.d.ts +0 -1
  87. package/dist/esm/models/components/expand.d.ts.map +1 -1
  88. package/dist/esm/models/components/expand.js +0 -1
  89. package/dist/esm/models/components/expand.js.map +1 -1
  90. package/dist/esm/models/components/index.d.ts +1 -0
  91. package/dist/esm/models/components/index.d.ts.map +1 -1
  92. package/dist/esm/models/components/index.js +1 -0
  93. package/dist/esm/models/components/index.js.map +1 -1
  94. package/dist/esm/models/components/vendor.d.ts +0 -7
  95. package/dist/esm/models/components/vendor.d.ts.map +1 -1
  96. package/dist/esm/models/components/vendor.js +0 -14
  97. package/dist/esm/models/components/vendor.js.map +1 -1
  98. package/dist/esm/models/operations/index.d.ts +1 -0
  99. package/dist/esm/models/operations/index.d.ts.map +1 -1
  100. package/dist/esm/models/operations/index.js +1 -0
  101. package/dist/esm/models/operations/index.js.map +1 -1
  102. package/dist/esm/models/operations/listcompanymanagers.d.ts +57 -0
  103. package/dist/esm/models/operations/listcompanymanagers.d.ts.map +1 -0
  104. package/dist/esm/models/operations/listcompanymanagers.js +43 -0
  105. package/dist/esm/models/operations/listcompanymanagers.js.map +1 -0
  106. package/dist/esm/models/operations/updatevendordetails.d.ts +0 -15
  107. package/dist/esm/models/operations/updatevendordetails.d.ts.map +1 -1
  108. package/dist/esm/models/operations/updatevendordetails.js +0 -13
  109. package/dist/esm/models/operations/updatevendordetails.js.map +1 -1
  110. package/dist/esm/react-query/companiesListCompanyManagers.core.d.ts +36 -0
  111. package/dist/esm/react-query/companiesListCompanyManagers.core.d.ts.map +1 -0
  112. package/dist/esm/react-query/companiesListCompanyManagers.core.js +85 -0
  113. package/dist/esm/react-query/companiesListCompanyManagers.core.js.map +1 -0
  114. package/dist/esm/react-query/companiesListCompanyManagers.d.ts +54 -0
  115. package/dist/esm/react-query/companiesListCompanyManagers.d.ts.map +1 -0
  116. package/dist/esm/react-query/companiesListCompanyManagers.js +89 -0
  117. package/dist/esm/react-query/companiesListCompanyManagers.js.map +1 -0
  118. package/dist/esm/react-query/index.d.ts +1 -0
  119. package/dist/esm/react-query/index.d.ts.map +1 -1
  120. package/dist/esm/react-query/index.js +1 -0
  121. package/dist/esm/react-query/index.js.map +1 -1
  122. package/dist/esm/react-query/vendorsGetVendorsDetails.d.ts +0 -2
  123. package/dist/esm/react-query/vendorsGetVendorsDetails.d.ts.map +1 -1
  124. package/dist/esm/react-query/vendorsGetVendorsDetails.js +0 -2
  125. package/dist/esm/react-query/vendorsGetVendorsDetails.js.map +1 -1
  126. package/dist/esm/sdk/companies.d.ts +9 -0
  127. package/dist/esm/sdk/companies.d.ts.map +1 -1
  128. package/dist/esm/sdk/companies.js +10 -0
  129. package/dist/esm/sdk/companies.js.map +1 -1
  130. package/dist/esm/sdk/vendors.d.ts +0 -1
  131. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  132. package/dist/esm/sdk/vendors.js +0 -1
  133. package/dist/esm/sdk/vendors.js.map +1 -1
  134. package/examples/package-lock.json +1 -1
  135. package/jsr.json +1 -1
  136. package/package.json +1 -1
  137. package/src/__tests__/companies.test.ts +33 -0
  138. package/src/__tests__/zones.test.ts +5 -19
  139. package/src/funcs/companiesListCompanyManagers.ts +254 -0
  140. package/src/funcs/vendorsGetVendorsDetails.ts +0 -1
  141. package/src/lib/config.ts +2 -2
  142. package/src/models/components/companymanager.ts +307 -0
  143. package/src/models/components/expand.ts +0 -1
  144. package/src/models/components/index.ts +1 -0
  145. package/src/models/components/vendor.ts +0 -31
  146. package/src/models/operations/index.ts +1 -0
  147. package/src/models/operations/listcompanymanagers.ts +132 -0
  148. package/src/models/operations/updatevendordetails.ts +0 -35
  149. package/src/react-query/companiesListCompanyManagers.core.ts +195 -0
  150. package/src/react-query/companiesListCompanyManagers.ts +230 -0
  151. package/src/react-query/index.ts +1 -0
  152. package/src/react-query/vendorsGetVendorsDetails.ts +0 -2
  153. package/src/sdk/companies.ts +20 -0
  154. package/src/sdk/vendors.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greensecurity/javascript-sdk",
3
- "version": "0.43.1-beta.88",
3
+ "version": "0.43.1-beta.90",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -74,3 +74,36 @@ test("Companies Get Company", async () => {
74
74
  name: "<value>",
75
75
  });
76
76
  });
77
+
78
+ test("Companies List Company Managers", async () => {
79
+ const testHttpClient = createTestHTTPClient("listCompanyManagers");
80
+
81
+ const greenSecurity = new GreenSecurity({
82
+ serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
83
+ httpClient: testHttpClient,
84
+ security: {
85
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
86
+ },
87
+ });
88
+
89
+ const result = await greenSecurity.companies.listCompanyManagers({
90
+ id: 940061,
91
+ sort: "job",
92
+ desc: true,
93
+ itemsPerPage: 25,
94
+ });
95
+ expect(result).toBeDefined();
96
+ expect(result.result).toBeDefined();
97
+ expect(result.result).toEqual({
98
+ pager: {
99
+ baseUrl: "api/vendors/job_titles",
100
+ sort: "job,title",
101
+ desc: 0,
102
+ itemCount: 228,
103
+ itemsPerPage: 598575,
104
+ page: 1,
105
+ useUrlParams: true,
106
+ },
107
+ items: [],
108
+ });
109
+ });
@@ -36,24 +36,10 @@ test("Zones List Or Search Security Zones", async () => {
36
36
  },
37
37
  items: [
38
38
  {
39
- facility: {
40
- contacts: null,
41
- vendorGuestPolicy: {
42
- enabled: false,
43
- vendorGuestLimitAndOr: "and",
44
- vendorGuestRequireEmail: false,
45
- },
46
- },
39
+ facility: {},
47
40
  },
48
41
  {
49
- facility: {
50
- contacts: null,
51
- vendorGuestPolicy: {
52
- enabled: false,
53
- vendorGuestLimitAndOr: "and",
54
- vendorGuestRequireEmail: false,
55
- },
56
- },
42
+ facility: {},
57
43
  },
58
44
  ],
59
45
  });
@@ -71,9 +57,9 @@ test("Zones Security Zone Checkin", async () => {
71
57
  });
72
58
 
73
59
  const result = await greenSecurity.zones.securityZoneCheckin({
74
- longitude: "-35.784",
75
- latitude: "-14.5802",
76
- zoneId: 199208,
60
+ longitude: "89.6981",
61
+ latitude: "68.5943",
62
+ zoneId: 456404,
77
63
  });
78
64
  expect(result).toBeDefined();
79
65
  expect(result).toEqual({});
@@ -0,0 +1,254 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { dlv } from "../lib/dlv.js";
7
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+ import {
29
+ createPageIterator,
30
+ haltIterator,
31
+ PageIterator,
32
+ Paginator,
33
+ } from "../types/operations.js";
34
+
35
+ /**
36
+ * List or search company managers
37
+ *
38
+ * @remarks
39
+ * List or search company managers.
40
+ */
41
+ export function companiesListCompanyManagers(
42
+ client: GreenSecurityCore,
43
+ request: operations.ListCompanyManagersRequest,
44
+ options?: RequestOptions,
45
+ ): APIPromise<
46
+ PageIterator<
47
+ Result<
48
+ operations.ListCompanyManagersResponse,
49
+ | errors.ApiErrorResponse
50
+ | GreenSecurityError
51
+ | ResponseValidationError
52
+ | ConnectionError
53
+ | RequestAbortedError
54
+ | RequestTimeoutError
55
+ | InvalidRequestError
56
+ | UnexpectedClientError
57
+ | SDKValidationError
58
+ >,
59
+ { page: number }
60
+ >
61
+ > {
62
+ return new APIPromise($do(
63
+ client,
64
+ request,
65
+ options,
66
+ ));
67
+ }
68
+
69
+ async function $do(
70
+ client: GreenSecurityCore,
71
+ request: operations.ListCompanyManagersRequest,
72
+ options?: RequestOptions,
73
+ ): Promise<
74
+ [
75
+ PageIterator<
76
+ Result<
77
+ operations.ListCompanyManagersResponse,
78
+ | errors.ApiErrorResponse
79
+ | GreenSecurityError
80
+ | ResponseValidationError
81
+ | ConnectionError
82
+ | RequestAbortedError
83
+ | RequestTimeoutError
84
+ | InvalidRequestError
85
+ | UnexpectedClientError
86
+ | SDKValidationError
87
+ >,
88
+ { page: number }
89
+ >,
90
+ APICall,
91
+ ]
92
+ > {
93
+ const parsed = safeParse(
94
+ request,
95
+ (value) =>
96
+ operations.ListCompanyManagersRequest$outboundSchema.parse(value),
97
+ "Input validation failed",
98
+ );
99
+ if (!parsed.ok) {
100
+ return [haltIterator(parsed), { status: "invalid" }];
101
+ }
102
+ const payload = parsed.value;
103
+ const body = null;
104
+
105
+ const pathParams = {
106
+ id: encodeSimple("id", payload.id, {
107
+ explode: false,
108
+ charEncoding: "percent",
109
+ }),
110
+ };
111
+
112
+ const path = pathToFunc("/companies/{id}/managers")(pathParams);
113
+
114
+ const query = encodeFormQuery({
115
+ "desc": payload.desc,
116
+ "items_per_page": payload.items_per_page,
117
+ "page": payload.page,
118
+ "sort": payload.sort,
119
+ });
120
+
121
+ const headers = new Headers(compactMap({
122
+ Accept: "application/json",
123
+ }));
124
+
125
+ const securityInput = await extractSecurity(client._options.security);
126
+ const requestSecurity = resolveGlobalSecurity(securityInput);
127
+
128
+ const context = {
129
+ options: client._options,
130
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
131
+ operationID: "listCompanyManagers",
132
+ oAuth2Scopes: null,
133
+
134
+ resolvedSecurity: requestSecurity,
135
+
136
+ securitySource: client._options.security,
137
+ retryConfig: options?.retries
138
+ || client._options.retryConfig
139
+ || { strategy: "none" },
140
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
141
+ };
142
+
143
+ const requestRes = client._createRequest(context, {
144
+ security: requestSecurity,
145
+ method: "GET",
146
+ baseURL: options?.serverURL,
147
+ path: path,
148
+ headers: headers,
149
+ query: query,
150
+ body: body,
151
+ userAgent: client._options.userAgent,
152
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
153
+ }, options);
154
+ if (!requestRes.ok) {
155
+ return [haltIterator(requestRes), { status: "invalid" }];
156
+ }
157
+ const req = requestRes.value;
158
+
159
+ const doResult = await client._do(req, {
160
+ context,
161
+ errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
162
+ retryConfig: context.retryConfig,
163
+ retryCodes: context.retryCodes,
164
+ });
165
+ if (!doResult.ok) {
166
+ return [haltIterator(doResult), { status: "request-error", request: req }];
167
+ }
168
+ const response = doResult.value;
169
+
170
+ const responseFields = {
171
+ HttpMeta: { Response: response, Request: req },
172
+ };
173
+
174
+ const [result, raw] = await M.match<
175
+ operations.ListCompanyManagersResponse,
176
+ | errors.ApiErrorResponse
177
+ | GreenSecurityError
178
+ | ResponseValidationError
179
+ | ConnectionError
180
+ | RequestAbortedError
181
+ | RequestTimeoutError
182
+ | InvalidRequestError
183
+ | UnexpectedClientError
184
+ | SDKValidationError
185
+ >(
186
+ M.json(200, operations.ListCompanyManagersResponse$inboundSchema, {
187
+ key: "Result",
188
+ }),
189
+ M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
190
+ M.fail("4XX"),
191
+ M.fail([500, "5XX"]),
192
+ )(response, req, { extraFields: responseFields });
193
+ if (!result.ok) {
194
+ return [haltIterator(result), {
195
+ status: "complete",
196
+ request: req,
197
+ response,
198
+ }];
199
+ }
200
+
201
+ const nextFunc = (
202
+ responseData: unknown,
203
+ ): {
204
+ next: Paginator<
205
+ Result<
206
+ operations.ListCompanyManagersResponse,
207
+ | errors.ApiErrorResponse
208
+ | GreenSecurityError
209
+ | ResponseValidationError
210
+ | ConnectionError
211
+ | RequestAbortedError
212
+ | RequestTimeoutError
213
+ | InvalidRequestError
214
+ | UnexpectedClientError
215
+ | SDKValidationError
216
+ >
217
+ >;
218
+ "~next"?: { page: number };
219
+ } => {
220
+ const page = request?.page ?? 1;
221
+ const nextPage = page + 1;
222
+
223
+ if (!responseData) {
224
+ return { next: () => null };
225
+ }
226
+ const results = dlv(responseData, "items");
227
+ if (!Array.isArray(results) || !results.length) {
228
+ return { next: () => null };
229
+ }
230
+ const limit = request?.itemsPerPage ?? 0;
231
+ if (results.length < limit) {
232
+ return { next: () => null };
233
+ }
234
+
235
+ const nextVal = () =>
236
+ companiesListCompanyManagers(
237
+ client,
238
+ {
239
+ ...request,
240
+ page: nextPage,
241
+ },
242
+ options,
243
+ );
244
+
245
+ return { next: nextVal, "~next": { page: nextPage } };
246
+ };
247
+
248
+ const page = { ...result, ...nextFunc(raw) };
249
+ return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
250
+ status: "complete",
251
+ request: req,
252
+ response,
253
+ }];
254
+ }
@@ -55,7 +55,6 @@ 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
59
58
  */
60
59
  export function vendorsGetVendorsDetails(
61
60
  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.86",
83
+ sdkVersion: "0.43.1-beta.88",
84
84
  genVersion: "2.794.1",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.43.1-beta.86 2.794.1 0.0.11 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.43.1-beta.88 2.794.1 0.0.11 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -0,0 +1,307 @@
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 { smartUnion } from "../../types/smartUnion.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+ import { Company, Company$inboundSchema } from "./company.js";
13
+ import { ImageSet, ImageSet$inboundSchema } from "./imageset.js";
14
+ import { UserLocation, UserLocation$inboundSchema } from "./userlocation.js";
15
+
16
+ export type User1 = {
17
+ id?: number | undefined;
18
+ firstName?: string | null | undefined;
19
+ lastName?: string | null | undefined;
20
+ email?: string | null | undefined;
21
+ phone?: string | null | undefined;
22
+ mobilePhone?: string | null | undefined;
23
+ fax?: string | null | undefined;
24
+ userType?: "Company Manager" | undefined;
25
+ timezone?: string | null | undefined;
26
+ qrCode?: string | null | undefined;
27
+ /**
28
+ * A set of images in different sizes
29
+ */
30
+ imageUrls?: ImageSet | null | undefined;
31
+ /**
32
+ * Reduced list of attributes of the User Location
33
+ */
34
+ location?: UserLocation | null | undefined;
35
+ };
36
+
37
+ export type CompanyManagerUser = User1 | number;
38
+
39
+ export type CompanyManagerCompany = Company | number;
40
+
41
+ export type CompanyManager22 = {};
42
+
43
+ export type CompanyManagerPaymentProfile2 = number | CompanyManager22;
44
+
45
+ export type CompanyManagerPaymentProfile1 = {
46
+ id?: number | undefined;
47
+ isValid?: boolean | null | undefined;
48
+ cardType?: string | null | undefined;
49
+ cardLast4?: string | null | undefined;
50
+ isDummy?: boolean | null | undefined;
51
+ profileType?: string | null | undefined;
52
+ };
53
+
54
+ /**
55
+ * Reduced list of attributes of the Payment Profile record
56
+ */
57
+ export type CompanyManagerPaymentProfilePaymentProfile =
58
+ | CompanyManagerPaymentProfile1
59
+ | number
60
+ | CompanyManager22;
61
+
62
+ export type CompanyManagerPaymentProfile =
63
+ | CompanyManagerPaymentProfile1
64
+ | number
65
+ | CompanyManager22
66
+ | number;
67
+
68
+ export type CompanyManager = {
69
+ id?: number | undefined;
70
+ status?: string | null | undefined;
71
+ user?: User1 | number | undefined;
72
+ company?: Company | number | null | undefined;
73
+ paymentProfile?:
74
+ | CompanyManagerPaymentProfile1
75
+ | number
76
+ | CompanyManager22
77
+ | number
78
+ | null
79
+ | undefined;
80
+ };
81
+
82
+ /** @internal */
83
+ export const User1$inboundSchema: z.ZodType<User1, z.ZodTypeDef, unknown> = z
84
+ .object({
85
+ id: types.optional(types.number()),
86
+ first_name: z.nullable(types.string()).optional(),
87
+ last_name: z.nullable(types.string()).optional(),
88
+ email: z.nullable(types.string()).optional(),
89
+ phone: z.nullable(types.string()).optional(),
90
+ mobile_phone: z.nullable(types.string()).optional(),
91
+ fax: z.nullable(types.string()).optional(),
92
+ user_type: types.optional(types.literal("Company Manager")),
93
+ timezone: z.nullable(types.string()).optional(),
94
+ qr_code: z.nullable(types.string()).optional(),
95
+ image_urls: z.nullable(ImageSet$inboundSchema).optional(),
96
+ location: z.nullable(UserLocation$inboundSchema).optional(),
97
+ }).transform((v) => {
98
+ return remap$(v, {
99
+ "first_name": "firstName",
100
+ "last_name": "lastName",
101
+ "mobile_phone": "mobilePhone",
102
+ "user_type": "userType",
103
+ "qr_code": "qrCode",
104
+ "image_urls": "imageUrls",
105
+ });
106
+ });
107
+
108
+ export function user1FromJSON(
109
+ jsonString: string,
110
+ ): SafeParseResult<User1, SDKValidationError> {
111
+ return safeParse(
112
+ jsonString,
113
+ (x) => User1$inboundSchema.parse(JSON.parse(x)),
114
+ `Failed to parse 'User1' from JSON`,
115
+ );
116
+ }
117
+
118
+ /** @internal */
119
+ export const CompanyManagerUser$inboundSchema: z.ZodType<
120
+ CompanyManagerUser,
121
+ z.ZodTypeDef,
122
+ unknown
123
+ > = smartUnion([z.lazy(() => User1$inboundSchema), types.number()]);
124
+
125
+ export function companyManagerUserFromJSON(
126
+ jsonString: string,
127
+ ): SafeParseResult<CompanyManagerUser, SDKValidationError> {
128
+ return safeParse(
129
+ jsonString,
130
+ (x) => CompanyManagerUser$inboundSchema.parse(JSON.parse(x)),
131
+ `Failed to parse 'CompanyManagerUser' from JSON`,
132
+ );
133
+ }
134
+
135
+ /** @internal */
136
+ export const CompanyManagerCompany$inboundSchema: z.ZodType<
137
+ CompanyManagerCompany,
138
+ z.ZodTypeDef,
139
+ unknown
140
+ > = smartUnion([Company$inboundSchema, types.number()]);
141
+
142
+ export function companyManagerCompanyFromJSON(
143
+ jsonString: string,
144
+ ): SafeParseResult<CompanyManagerCompany, SDKValidationError> {
145
+ return safeParse(
146
+ jsonString,
147
+ (x) => CompanyManagerCompany$inboundSchema.parse(JSON.parse(x)),
148
+ `Failed to parse 'CompanyManagerCompany' from JSON`,
149
+ );
150
+ }
151
+
152
+ /** @internal */
153
+ export const CompanyManager22$inboundSchema: z.ZodType<
154
+ CompanyManager22,
155
+ z.ZodTypeDef,
156
+ unknown
157
+ > = z.object({});
158
+
159
+ export function companyManager22FromJSON(
160
+ jsonString: string,
161
+ ): SafeParseResult<CompanyManager22, SDKValidationError> {
162
+ return safeParse(
163
+ jsonString,
164
+ (x) => CompanyManager22$inboundSchema.parse(JSON.parse(x)),
165
+ `Failed to parse 'CompanyManager22' from JSON`,
166
+ );
167
+ }
168
+
169
+ /** @internal */
170
+ export const CompanyManagerPaymentProfile2$inboundSchema: z.ZodType<
171
+ CompanyManagerPaymentProfile2,
172
+ z.ZodTypeDef,
173
+ unknown
174
+ > = smartUnion([types.number(), z.lazy(() => CompanyManager22$inboundSchema)]);
175
+
176
+ export function companyManagerPaymentProfile2FromJSON(
177
+ jsonString: string,
178
+ ): SafeParseResult<CompanyManagerPaymentProfile2, SDKValidationError> {
179
+ return safeParse(
180
+ jsonString,
181
+ (x) => CompanyManagerPaymentProfile2$inboundSchema.parse(JSON.parse(x)),
182
+ `Failed to parse 'CompanyManagerPaymentProfile2' from JSON`,
183
+ );
184
+ }
185
+
186
+ /** @internal */
187
+ export const CompanyManagerPaymentProfile1$inboundSchema: z.ZodType<
188
+ CompanyManagerPaymentProfile1,
189
+ z.ZodTypeDef,
190
+ unknown
191
+ > = z.object({
192
+ id: types.optional(types.number()),
193
+ is_valid: z.nullable(types.boolean()).optional(),
194
+ card_type: z.nullable(types.string()).optional(),
195
+ card_last4: z.nullable(types.string()).optional(),
196
+ is_dummy: z.nullable(types.boolean()).optional(),
197
+ profile_type: z.nullable(types.string()).optional(),
198
+ }).transform((v) => {
199
+ return remap$(v, {
200
+ "is_valid": "isValid",
201
+ "card_type": "cardType",
202
+ "card_last4": "cardLast4",
203
+ "is_dummy": "isDummy",
204
+ "profile_type": "profileType",
205
+ });
206
+ });
207
+
208
+ export function companyManagerPaymentProfile1FromJSON(
209
+ jsonString: string,
210
+ ): SafeParseResult<CompanyManagerPaymentProfile1, SDKValidationError> {
211
+ return safeParse(
212
+ jsonString,
213
+ (x) => CompanyManagerPaymentProfile1$inboundSchema.parse(JSON.parse(x)),
214
+ `Failed to parse 'CompanyManagerPaymentProfile1' from JSON`,
215
+ );
216
+ }
217
+
218
+ /** @internal */
219
+ export const CompanyManagerPaymentProfilePaymentProfile$inboundSchema:
220
+ z.ZodType<CompanyManagerPaymentProfilePaymentProfile, z.ZodTypeDef, unknown> =
221
+ smartUnion([
222
+ z.lazy(() => CompanyManagerPaymentProfile1$inboundSchema),
223
+ smartUnion([
224
+ types.number(),
225
+ z.lazy(() => CompanyManager22$inboundSchema),
226
+ ]),
227
+ ]);
228
+
229
+ export function companyManagerPaymentProfilePaymentProfileFromJSON(
230
+ jsonString: string,
231
+ ): SafeParseResult<
232
+ CompanyManagerPaymentProfilePaymentProfile,
233
+ SDKValidationError
234
+ > {
235
+ return safeParse(
236
+ jsonString,
237
+ (x) =>
238
+ CompanyManagerPaymentProfilePaymentProfile$inboundSchema.parse(
239
+ JSON.parse(x),
240
+ ),
241
+ `Failed to parse 'CompanyManagerPaymentProfilePaymentProfile' from JSON`,
242
+ );
243
+ }
244
+
245
+ /** @internal */
246
+ export const CompanyManagerPaymentProfile$inboundSchema: z.ZodType<
247
+ CompanyManagerPaymentProfile,
248
+ z.ZodTypeDef,
249
+ unknown
250
+ > = smartUnion([
251
+ smartUnion([
252
+ z.lazy(() => CompanyManagerPaymentProfile1$inboundSchema),
253
+ smartUnion([types.number(), z.lazy(() => CompanyManager22$inboundSchema)]),
254
+ ]),
255
+ types.number(),
256
+ ]);
257
+
258
+ export function companyManagerPaymentProfileFromJSON(
259
+ jsonString: string,
260
+ ): SafeParseResult<CompanyManagerPaymentProfile, SDKValidationError> {
261
+ return safeParse(
262
+ jsonString,
263
+ (x) => CompanyManagerPaymentProfile$inboundSchema.parse(JSON.parse(x)),
264
+ `Failed to parse 'CompanyManagerPaymentProfile' from JSON`,
265
+ );
266
+ }
267
+
268
+ /** @internal */
269
+ export const CompanyManager$inboundSchema: z.ZodType<
270
+ CompanyManager,
271
+ z.ZodTypeDef,
272
+ unknown
273
+ > = z.object({
274
+ id: types.optional(types.number()),
275
+ status: z.nullable(types.string()).optional(),
276
+ user: types.optional(
277
+ smartUnion([z.lazy(() => User1$inboundSchema), types.number()]),
278
+ ),
279
+ company: z.nullable(smartUnion([Company$inboundSchema, types.number()]))
280
+ .optional(),
281
+ payment_profile: z.nullable(
282
+ smartUnion([
283
+ smartUnion([
284
+ z.lazy(() => CompanyManagerPaymentProfile1$inboundSchema),
285
+ smartUnion([
286
+ types.number(),
287
+ z.lazy(() => CompanyManager22$inboundSchema),
288
+ ]),
289
+ ]),
290
+ types.number(),
291
+ ]),
292
+ ).optional(),
293
+ }).transform((v) => {
294
+ return remap$(v, {
295
+ "payment_profile": "paymentProfile",
296
+ });
297
+ });
298
+
299
+ export function companyManagerFromJSON(
300
+ jsonString: string,
301
+ ): SafeParseResult<CompanyManager, SDKValidationError> {
302
+ return safeParse(
303
+ jsonString,
304
+ (x) => CompanyManager$inboundSchema.parse(JSON.parse(x)),
305
+ `Failed to parse 'CompanyManager' from JSON`,
306
+ );
307
+ }
@@ -43,7 +43,6 @@ 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",
47
46
  VendorTargetFacilities: "vendor.target_facilities",
48
47
  VendorUser: "vendor.user",
49
48
  VendorVendorGroups: "vendor.vendor_groups",
@@ -6,6 +6,7 @@ export * from "./activestatus.js";
6
6
  export * from "./alert.js";
7
7
  export * from "./backgroundcheckresult.js";
8
8
  export * from "./company.js";
9
+ export * from "./companymanager.js";
9
10
  export * from "./companyvendortyperestriction.js";
10
11
  export * from "./contact.js";
11
12
  export * from "./contenttype.js";