@greensecurity/javascript-sdk 0.36.5 → 0.37.3

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 (170) hide show
  1. package/README.md +4 -1
  2. package/bin/mcp-server.js +923 -760
  3. package/bin/mcp-server.js.map +18 -15
  4. package/dist/commonjs/__tests__/organizations.test.d.ts +2 -0
  5. package/dist/commonjs/__tests__/organizations.test.d.ts.map +1 -0
  6. package/dist/commonjs/__tests__/organizations.test.js +39 -0
  7. package/dist/commonjs/__tests__/organizations.test.js.map +1 -0
  8. package/dist/commonjs/__tests__/zones.test.js +2 -5
  9. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  10. package/dist/commonjs/funcs/organizationsListOrSearchDepartments.d.ts +21 -0
  11. package/dist/commonjs/funcs/organizationsListOrSearchDepartments.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/organizationsListOrSearchDepartments.js +163 -0
  13. package/dist/commonjs/funcs/organizationsListOrSearchDepartments.js.map +1 -0
  14. package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js +1 -0
  15. package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
  16. package/dist/commonjs/lib/config.d.ts +3 -3
  17. package/dist/commonjs/lib/config.js +3 -3
  18. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
  19. package/dist/commonjs/mcp-server/cli/start/command.js +0 -12
  20. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
  21. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +0 -2
  22. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
  23. package/dist/commonjs/mcp-server/cli/start/impl.js +0 -2
  24. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  25. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  26. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  27. package/dist/commonjs/mcp-server/server.js +3 -1
  28. package/dist/commonjs/mcp-server/server.js.map +1 -1
  29. package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartments.d.ts +8 -0
  30. package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartments.d.ts.map +1 -0
  31. package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartments.js +64 -0
  32. package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartments.js.map +1 -0
  33. package/dist/commonjs/models/components/facilitystatus.d.ts +31 -0
  34. package/dist/commonjs/models/components/facilitystatus.d.ts.map +1 -0
  35. package/dist/commonjs/models/components/facilitystatus.js +61 -0
  36. package/dist/commonjs/models/components/facilitystatus.js.map +1 -0
  37. package/dist/commonjs/models/components/index.d.ts +1 -0
  38. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  39. package/dist/commonjs/models/components/index.js +1 -0
  40. package/dist/commonjs/models/components/index.js.map +1 -1
  41. package/dist/commonjs/models/errors/apierror.d.ts.map +1 -1
  42. package/dist/commonjs/models/errors/apierror.js +8 -2
  43. package/dist/commonjs/models/errors/apierror.js.map +1 -1
  44. package/dist/commonjs/models/operations/index.d.ts +1 -0
  45. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  46. package/dist/commonjs/models/operations/index.js +1 -0
  47. package/dist/commonjs/models/operations/index.js.map +1 -1
  48. package/dist/commonjs/models/operations/listorsearchdepartments.d.ts +116 -0
  49. package/dist/commonjs/models/operations/listorsearchdepartments.d.ts.map +1 -0
  50. package/dist/commonjs/models/operations/listorsearchdepartments.js +155 -0
  51. package/dist/commonjs/models/operations/listorsearchdepartments.js.map +1 -0
  52. package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts +5 -0
  53. package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
  54. package/dist/commonjs/models/operations/listvendorfacilitystatuses.js +4 -0
  55. package/dist/commonjs/models/operations/listvendorfacilitystatuses.js.map +1 -1
  56. package/dist/commonjs/models/operations/updatevendordetails.d.ts +5 -0
  57. package/dist/commonjs/models/operations/updatevendordetails.d.ts.map +1 -1
  58. package/dist/commonjs/models/operations/updatevendordetails.js +4 -0
  59. package/dist/commonjs/models/operations/updatevendordetails.js.map +1 -1
  60. package/dist/commonjs/react-query/index.d.ts +1 -0
  61. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  62. package/dist/commonjs/react-query/index.js +1 -0
  63. package/dist/commonjs/react-query/index.js.map +1 -1
  64. package/dist/commonjs/react-query/organizationsListOrSearchDepartments.d.ts +80 -0
  65. package/dist/commonjs/react-query/organizationsListOrSearchDepartments.d.ts.map +1 -0
  66. package/dist/commonjs/react-query/organizationsListOrSearchDepartments.js +162 -0
  67. package/dist/commonjs/react-query/organizationsListOrSearchDepartments.js.map +1 -0
  68. package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
  69. package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
  70. package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js +2 -0
  71. package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
  72. package/dist/commonjs/sdk/organizations.d.ts +9 -0
  73. package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
  74. package/dist/commonjs/sdk/organizations.js +10 -0
  75. package/dist/commonjs/sdk/organizations.js.map +1 -1
  76. package/dist/esm/__tests__/organizations.test.d.ts +2 -0
  77. package/dist/esm/__tests__/organizations.test.d.ts.map +1 -0
  78. package/dist/esm/__tests__/organizations.test.js +37 -0
  79. package/dist/esm/__tests__/organizations.test.js.map +1 -0
  80. package/dist/esm/__tests__/zones.test.js +2 -5
  81. package/dist/esm/__tests__/zones.test.js.map +1 -1
  82. package/dist/esm/funcs/organizationsListOrSearchDepartments.d.ts +21 -0
  83. package/dist/esm/funcs/organizationsListOrSearchDepartments.d.ts.map +1 -0
  84. package/dist/esm/funcs/organizationsListOrSearchDepartments.js +127 -0
  85. package/dist/esm/funcs/organizationsListOrSearchDepartments.js.map +1 -0
  86. package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js +1 -0
  87. package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
  88. package/dist/esm/lib/config.d.ts +3 -3
  89. package/dist/esm/lib/config.js +3 -3
  90. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
  91. package/dist/esm/mcp-server/cli/start/command.js +0 -12
  92. package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
  93. package/dist/esm/mcp-server/cli/start/impl.d.ts +0 -2
  94. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
  95. package/dist/esm/mcp-server/cli/start/impl.js +0 -2
  96. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  97. package/dist/esm/mcp-server/mcp-server.js +1 -1
  98. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  99. package/dist/esm/mcp-server/server.js +3 -1
  100. package/dist/esm/mcp-server/server.js.map +1 -1
  101. package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartments.d.ts +8 -0
  102. package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartments.d.ts.map +1 -0
  103. package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartments.js +28 -0
  104. package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartments.js.map +1 -0
  105. package/dist/esm/models/components/facilitystatus.d.ts +31 -0
  106. package/dist/esm/models/components/facilitystatus.d.ts.map +1 -0
  107. package/dist/esm/models/components/facilitystatus.js +25 -0
  108. package/dist/esm/models/components/facilitystatus.js.map +1 -0
  109. package/dist/esm/models/components/index.d.ts +1 -0
  110. package/dist/esm/models/components/index.d.ts.map +1 -1
  111. package/dist/esm/models/components/index.js +1 -0
  112. package/dist/esm/models/components/index.js.map +1 -1
  113. package/dist/esm/models/errors/apierror.d.ts.map +1 -1
  114. package/dist/esm/models/errors/apierror.js +8 -2
  115. package/dist/esm/models/errors/apierror.js.map +1 -1
  116. package/dist/esm/models/operations/index.d.ts +1 -0
  117. package/dist/esm/models/operations/index.d.ts.map +1 -1
  118. package/dist/esm/models/operations/index.js +1 -0
  119. package/dist/esm/models/operations/index.js.map +1 -1
  120. package/dist/esm/models/operations/listorsearchdepartments.d.ts +116 -0
  121. package/dist/esm/models/operations/listorsearchdepartments.d.ts.map +1 -0
  122. package/dist/esm/models/operations/listorsearchdepartments.js +113 -0
  123. package/dist/esm/models/operations/listorsearchdepartments.js.map +1 -0
  124. package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts +5 -0
  125. package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
  126. package/dist/esm/models/operations/listvendorfacilitystatuses.js +4 -0
  127. package/dist/esm/models/operations/listvendorfacilitystatuses.js.map +1 -1
  128. package/dist/esm/models/operations/updatevendordetails.d.ts +5 -0
  129. package/dist/esm/models/operations/updatevendordetails.d.ts.map +1 -1
  130. package/dist/esm/models/operations/updatevendordetails.js +4 -0
  131. package/dist/esm/models/operations/updatevendordetails.js.map +1 -1
  132. package/dist/esm/react-query/index.d.ts +1 -0
  133. package/dist/esm/react-query/index.d.ts.map +1 -1
  134. package/dist/esm/react-query/index.js +1 -0
  135. package/dist/esm/react-query/index.js.map +1 -1
  136. package/dist/esm/react-query/organizationsListOrSearchDepartments.d.ts +80 -0
  137. package/dist/esm/react-query/organizationsListOrSearchDepartments.d.ts.map +1 -0
  138. package/dist/esm/react-query/organizationsListOrSearchDepartments.js +149 -0
  139. package/dist/esm/react-query/organizationsListOrSearchDepartments.js.map +1 -0
  140. package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
  141. package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
  142. package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js +2 -0
  143. package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
  144. package/dist/esm/sdk/organizations.d.ts +9 -0
  145. package/dist/esm/sdk/organizations.d.ts.map +1 -1
  146. package/dist/esm/sdk/organizations.js +10 -0
  147. package/dist/esm/sdk/organizations.js.map +1 -1
  148. package/jsr.json +1 -1
  149. package/package.json +3 -3
  150. package/src/__tests__/organizations.test.ts +40 -0
  151. package/src/__tests__/zones.test.ts +2 -5
  152. package/src/funcs/organizationsListOrSearchDepartments.ts +256 -0
  153. package/src/funcs/vendorsListVendorFacilityStatuses.ts +1 -0
  154. package/src/lib/config.ts +3 -3
  155. package/src/mcp-server/cli/start/command.ts +0 -13
  156. package/src/mcp-server/cli/start/impl.ts +0 -4
  157. package/src/mcp-server/mcp-server.ts +1 -1
  158. package/src/mcp-server/server.ts +3 -1
  159. package/src/mcp-server/tools/organizationsListOrSearchDepartments.ts +39 -0
  160. package/src/models/components/facilitystatus.ts +34 -0
  161. package/src/models/components/index.ts +1 -0
  162. package/src/models/errors/apierror.ts +8 -2
  163. package/src/models/operations/index.ts +1 -0
  164. package/src/models/operations/listorsearchdepartments.ts +259 -0
  165. package/src/models/operations/listvendorfacilitystatuses.ts +9 -0
  166. package/src/models/operations/updatevendordetails.ts +9 -0
  167. package/src/react-query/index.ts +1 -0
  168. package/src/react-query/organizationsListOrSearchDepartments.ts +354 -0
  169. package/src/react-query/vendorsListVendorFacilityStatuses.ts +5 -0
  170. package/src/sdk/organizations.ts +20 -0
@@ -6,7 +6,6 @@ import { buildCommand } from "@stricli/core";
6
6
  import { numberParser } from "@stricli/core";
7
7
  import * as z from "zod";
8
8
  import { consoleLoggerLevels } from "../../console-logger.js";
9
- import { mcpScopes } from "../../scopes.js";
10
9
 
11
10
  export const startCommand = buildCommand({
12
11
  loader: async () => {
@@ -37,18 +36,6 @@ export const startCommand = buildCommand({
37
36
  return z.string().parse(value);
38
37
  },
39
38
  },
40
- ...(mcpScopes.length
41
- ? {
42
- scope: {
43
- kind: "enum",
44
- brief:
45
- "Mount tools/resources that match given scope (repeatable flag)",
46
- values: mcpScopes,
47
- variadic: true,
48
- optional: true,
49
- },
50
- }
51
- : {}),
52
39
  "api-token": {
53
40
  kind: "parsed",
54
41
  brief: "Sets the token auth field for the API",
@@ -11,14 +11,12 @@ import {
11
11
  ConsoleLoggerLevel,
12
12
  createConsoleLogger,
13
13
  } from "../../console-logger.js";
14
- import { MCPScope } from "../../scopes.js";
15
14
  import { createMCPServer } from "../../server.js";
16
15
 
17
16
  interface StartCommandFlags {
18
17
  readonly transport: "stdio" | "sse";
19
18
  readonly port: number;
20
19
  readonly tool?: string[];
21
- readonly scope?: MCPScope[];
22
20
  readonly "api-token"?: string | undefined;
23
21
  readonly "bearer-jwt"?: string | undefined;
24
22
  readonly "server-url"?: string;
@@ -50,7 +48,6 @@ async function startStdio(flags: StartCommandFlags) {
50
48
  const server = createMCPServer({
51
49
  logger,
52
50
  allowedTools: flags.tool,
53
- scopes: flags.scope,
54
51
  security: {
55
52
  token: flags["api-token"] ?? "",
56
53
  bearerJwt: flags["bearer-jwt"] ?? "",
@@ -74,7 +71,6 @@ async function startSSE(flags: StartCommandFlags) {
74
71
  const mcpServer = createMCPServer({
75
72
  logger,
76
73
  allowedTools: flags.tool,
77
- scopes: flags.scope,
78
74
  security: {
79
75
  token: flags["api-token"] ?? "",
80
76
  bearerJwt: flags["bearer-jwt"] ?? "",
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.36.5",
22
+ currentVersion: "0.37.3",
23
23
  },
24
24
  });
25
25
 
@@ -21,6 +21,7 @@ import { tool$invoicesCreateInvoice } from "./tools/invoicesCreateInvoice.js";
21
21
  import { tool$invoicesMakePayment } from "./tools/invoicesMakePayment.js";
22
22
  import { tool$invoicesUpdateInvoice } from "./tools/invoicesUpdateInvoice.js";
23
23
  import { tool$organizationsGetFacility } from "./tools/organizationsGetFacility.js";
24
+ import { tool$organizationsListOrSearchDepartments } from "./tools/organizationsListOrSearchDepartments.js";
24
25
  import { tool$organizationsListOrSearchFacilities } from "./tools/organizationsListOrSearchFacilities.js";
25
26
  import { tool$supportArticlesGetSupportArticle } from "./tools/supportArticlesGetSupportArticle.js";
26
27
  import { tool$supportArticlesListOrSearchSupportArticles } from "./tools/supportArticlesListOrSearchSupportArticles.js";
@@ -88,7 +89,7 @@ export function createMCPServer(deps: {
88
89
  }) {
89
90
  const server = new McpServer({
90
91
  name: "GreenSecurity",
91
- version: "0.36.5",
92
+ version: "0.37.3",
92
93
  });
93
94
 
94
95
  const client = new GreenSecurityCore({
@@ -166,6 +167,7 @@ export function createMCPServer(deps: {
166
167
  tool(tool$usersChangePassword);
167
168
  tool(tool$organizationsListOrSearchFacilities);
168
169
  tool(tool$organizationsGetFacility);
170
+ tool(tool$organizationsListOrSearchDepartments);
169
171
  tool(tool$supportArticlesListOrSearchSupportArticles);
170
172
  tool(tool$supportArticlesGetSupportArticle);
171
173
  tool(tool$webhooksListAllWebhookEndpoints);
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { organizationsListOrSearchDepartments } from "../../funcs/organizationsListOrSearchDepartments.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.ListOrSearchDepartmentsRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$organizationsListOrSearchDepartments: ToolDefinition<
14
+ typeof args
15
+ > = {
16
+ name: "organizations-list-or-search-departments",
17
+ description: `List or search departments
18
+
19
+ List or search departments.`,
20
+ args,
21
+ tool: async (client, args, ctx) => {
22
+ const [result, apiCall] = await organizationsListOrSearchDepartments(
23
+ client,
24
+ args.request,
25
+ { fetchOptions: { signal: ctx.signal } },
26
+ ).$inspect();
27
+
28
+ if (!result.ok) {
29
+ return {
30
+ content: [{ type: "text", text: result.error.message }],
31
+ isError: true,
32
+ };
33
+ }
34
+
35
+ const value = result.value.result;
36
+
37
+ return formatResult(value, apiCall);
38
+ },
39
+ };
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const FacilityStatus = {
9
+ Denied: "Denied",
10
+ Approved: "Approved",
11
+ Pending: "Pending",
12
+ } as const;
13
+ export type FacilityStatus = ClosedEnum<typeof FacilityStatus>;
14
+
15
+ /** @internal */
16
+ export const FacilityStatus$inboundSchema: z.ZodNativeEnum<
17
+ typeof FacilityStatus
18
+ > = z.nativeEnum(FacilityStatus);
19
+
20
+ /** @internal */
21
+ export const FacilityStatus$outboundSchema: z.ZodNativeEnum<
22
+ typeof FacilityStatus
23
+ > = FacilityStatus$inboundSchema;
24
+
25
+ /**
26
+ * @internal
27
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
28
+ */
29
+ export namespace FacilityStatus$ {
30
+ /** @deprecated use `FacilityStatus$inboundSchema` instead. */
31
+ export const inboundSchema = FacilityStatus$inboundSchema;
32
+ /** @deprecated use `FacilityStatus$outboundSchema` instead. */
33
+ export const outboundSchema = FacilityStatus$outboundSchema;
34
+ }
@@ -17,6 +17,7 @@ export * from "./departmentsummary.js";
17
17
  export * from "./desc.js";
18
18
  export * from "./expand.js";
19
19
  export * from "./facility.js";
20
+ export * from "./facilitystatus.js";
20
21
  export * from "./facilitysummary.js";
21
22
  export * from "./financialstatus.js";
22
23
  export * from "./handoff.js";
@@ -25,8 +25,14 @@ export class APIError extends GreenSecurityError {
25
25
  }`;
26
26
  }
27
27
  const body = httpMeta.body || `""`;
28
- message += body.length > 100 ? "\n" : " ";
29
- message += `Body ${body}`;
28
+ message += body.length > 100 ? "\n" : ". ";
29
+ let bodyDisplay = body;
30
+ if (body.length > 10000) {
31
+ const truncated = body.substring(0, 10000);
32
+ const remaining = body.length - 10000;
33
+ bodyDisplay = `${truncated}...and ${remaining} more chars`;
34
+ }
35
+ message += `Body: ${bodyDisplay}`;
30
36
  message = message.trim();
31
37
  super(message, httpMeta);
32
38
  this.name = "APIError";
@@ -30,6 +30,7 @@ export * from "./getvendorsdetails.js";
30
30
  export * from "./getwebhookendpoint.js";
31
31
  export * from "./listallwebhookendpoints.js";
32
32
  export * from "./listorsearchcompanies.js";
33
+ export * from "./listorsearchdepartments.js";
33
34
  export * from "./listorsearchfacilities.js";
34
35
  export * from "./listorsearchsecurityzones.js";
35
36
  export * from "./listorsearchsupportarticles.js";
@@ -0,0 +1,259 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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 components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ListOrSearchDepartmentsRequest = {
13
+ /**
14
+ * The identifier of the object
15
+ */
16
+ id: number;
17
+ /**
18
+ * A comma-separated list of object attributes to sort on.
19
+ */
20
+ sort?: string | null | undefined;
21
+ /**
22
+ * Sort desc
23
+ */
24
+ desc?: components.Desc | undefined;
25
+ /**
26
+ * A 1-based offset for which page to request (defaults to 1)
27
+ */
28
+ page?: number | undefined;
29
+ /**
30
+ * Number of items to show in a given page
31
+ */
32
+ itemsPerPage?: number | undefined;
33
+ /**
34
+ * A partial string to search in the object name. Do not include any wildcard characters. Searches are not case-sensitive by default.
35
+ */
36
+ nameLike?: string | undefined;
37
+ };
38
+
39
+ /**
40
+ * The request was successful, and the server has returned the requested resource in the response body.
41
+ */
42
+ export type ListOrSearchDepartmentsResponseBody = {
43
+ /**
44
+ * Pagination information for a pageable list
45
+ */
46
+ pager: components.Pager;
47
+ items: Array<components.Department | null>;
48
+ };
49
+
50
+ export type ListOrSearchDepartmentsResponse = {
51
+ result: ListOrSearchDepartmentsResponseBody;
52
+ };
53
+
54
+ /** @internal */
55
+ export const ListOrSearchDepartmentsRequest$inboundSchema: z.ZodType<
56
+ ListOrSearchDepartmentsRequest,
57
+ z.ZodTypeDef,
58
+ unknown
59
+ > = z.object({
60
+ id: z.number().int(),
61
+ sort: z.nullable(z.string()).optional(),
62
+ desc: components.Desc$inboundSchema.optional(),
63
+ page: z.number().int().optional(),
64
+ items_per_page: z.number().int().optional(),
65
+ name_like: z.string().optional(),
66
+ }).transform((v) => {
67
+ return remap$(v, {
68
+ "items_per_page": "itemsPerPage",
69
+ "name_like": "nameLike",
70
+ });
71
+ });
72
+
73
+ /** @internal */
74
+ export type ListOrSearchDepartmentsRequest$Outbound = {
75
+ id: number;
76
+ sort?: string | null | undefined;
77
+ desc?: components.Desc$Outbound | undefined;
78
+ page?: number | undefined;
79
+ items_per_page?: number | undefined;
80
+ name_like?: string | undefined;
81
+ };
82
+
83
+ /** @internal */
84
+ export const ListOrSearchDepartmentsRequest$outboundSchema: z.ZodType<
85
+ ListOrSearchDepartmentsRequest$Outbound,
86
+ z.ZodTypeDef,
87
+ ListOrSearchDepartmentsRequest
88
+ > = z.object({
89
+ id: z.number().int(),
90
+ sort: z.nullable(z.string()).optional(),
91
+ desc: components.Desc$outboundSchema.optional(),
92
+ page: z.number().int().optional(),
93
+ itemsPerPage: z.number().int().optional(),
94
+ nameLike: z.string().optional(),
95
+ }).transform((v) => {
96
+ return remap$(v, {
97
+ itemsPerPage: "items_per_page",
98
+ nameLike: "name_like",
99
+ });
100
+ });
101
+
102
+ /**
103
+ * @internal
104
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
105
+ */
106
+ export namespace ListOrSearchDepartmentsRequest$ {
107
+ /** @deprecated use `ListOrSearchDepartmentsRequest$inboundSchema` instead. */
108
+ export const inboundSchema = ListOrSearchDepartmentsRequest$inboundSchema;
109
+ /** @deprecated use `ListOrSearchDepartmentsRequest$outboundSchema` instead. */
110
+ export const outboundSchema = ListOrSearchDepartmentsRequest$outboundSchema;
111
+ /** @deprecated use `ListOrSearchDepartmentsRequest$Outbound` instead. */
112
+ export type Outbound = ListOrSearchDepartmentsRequest$Outbound;
113
+ }
114
+
115
+ export function listOrSearchDepartmentsRequestToJSON(
116
+ listOrSearchDepartmentsRequest: ListOrSearchDepartmentsRequest,
117
+ ): string {
118
+ return JSON.stringify(
119
+ ListOrSearchDepartmentsRequest$outboundSchema.parse(
120
+ listOrSearchDepartmentsRequest,
121
+ ),
122
+ );
123
+ }
124
+
125
+ export function listOrSearchDepartmentsRequestFromJSON(
126
+ jsonString: string,
127
+ ): SafeParseResult<ListOrSearchDepartmentsRequest, SDKValidationError> {
128
+ return safeParse(
129
+ jsonString,
130
+ (x) => ListOrSearchDepartmentsRequest$inboundSchema.parse(JSON.parse(x)),
131
+ `Failed to parse 'ListOrSearchDepartmentsRequest' from JSON`,
132
+ );
133
+ }
134
+
135
+ /** @internal */
136
+ export const ListOrSearchDepartmentsResponseBody$inboundSchema: z.ZodType<
137
+ ListOrSearchDepartmentsResponseBody,
138
+ z.ZodTypeDef,
139
+ unknown
140
+ > = z.object({
141
+ pager: components.Pager$inboundSchema,
142
+ items: z.array(z.nullable(components.Department$inboundSchema)),
143
+ });
144
+
145
+ /** @internal */
146
+ export type ListOrSearchDepartmentsResponseBody$Outbound = {
147
+ pager: components.Pager$Outbound;
148
+ items: Array<components.Department$Outbound | null>;
149
+ };
150
+
151
+ /** @internal */
152
+ export const ListOrSearchDepartmentsResponseBody$outboundSchema: z.ZodType<
153
+ ListOrSearchDepartmentsResponseBody$Outbound,
154
+ z.ZodTypeDef,
155
+ ListOrSearchDepartmentsResponseBody
156
+ > = z.object({
157
+ pager: components.Pager$outboundSchema,
158
+ items: z.array(z.nullable(components.Department$outboundSchema)),
159
+ });
160
+
161
+ /**
162
+ * @internal
163
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
164
+ */
165
+ export namespace ListOrSearchDepartmentsResponseBody$ {
166
+ /** @deprecated use `ListOrSearchDepartmentsResponseBody$inboundSchema` instead. */
167
+ export const inboundSchema =
168
+ ListOrSearchDepartmentsResponseBody$inboundSchema;
169
+ /** @deprecated use `ListOrSearchDepartmentsResponseBody$outboundSchema` instead. */
170
+ export const outboundSchema =
171
+ ListOrSearchDepartmentsResponseBody$outboundSchema;
172
+ /** @deprecated use `ListOrSearchDepartmentsResponseBody$Outbound` instead. */
173
+ export type Outbound = ListOrSearchDepartmentsResponseBody$Outbound;
174
+ }
175
+
176
+ export function listOrSearchDepartmentsResponseBodyToJSON(
177
+ listOrSearchDepartmentsResponseBody: ListOrSearchDepartmentsResponseBody,
178
+ ): string {
179
+ return JSON.stringify(
180
+ ListOrSearchDepartmentsResponseBody$outboundSchema.parse(
181
+ listOrSearchDepartmentsResponseBody,
182
+ ),
183
+ );
184
+ }
185
+
186
+ export function listOrSearchDepartmentsResponseBodyFromJSON(
187
+ jsonString: string,
188
+ ): SafeParseResult<ListOrSearchDepartmentsResponseBody, SDKValidationError> {
189
+ return safeParse(
190
+ jsonString,
191
+ (x) =>
192
+ ListOrSearchDepartmentsResponseBody$inboundSchema.parse(JSON.parse(x)),
193
+ `Failed to parse 'ListOrSearchDepartmentsResponseBody' from JSON`,
194
+ );
195
+ }
196
+
197
+ /** @internal */
198
+ export const ListOrSearchDepartmentsResponse$inboundSchema: z.ZodType<
199
+ ListOrSearchDepartmentsResponse,
200
+ z.ZodTypeDef,
201
+ unknown
202
+ > = z.object({
203
+ Result: z.lazy(() => ListOrSearchDepartmentsResponseBody$inboundSchema),
204
+ }).transform((v) => {
205
+ return remap$(v, {
206
+ "Result": "result",
207
+ });
208
+ });
209
+
210
+ /** @internal */
211
+ export type ListOrSearchDepartmentsResponse$Outbound = {
212
+ Result: ListOrSearchDepartmentsResponseBody$Outbound;
213
+ };
214
+
215
+ /** @internal */
216
+ export const ListOrSearchDepartmentsResponse$outboundSchema: z.ZodType<
217
+ ListOrSearchDepartmentsResponse$Outbound,
218
+ z.ZodTypeDef,
219
+ ListOrSearchDepartmentsResponse
220
+ > = z.object({
221
+ result: z.lazy(() => ListOrSearchDepartmentsResponseBody$outboundSchema),
222
+ }).transform((v) => {
223
+ return remap$(v, {
224
+ result: "Result",
225
+ });
226
+ });
227
+
228
+ /**
229
+ * @internal
230
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
231
+ */
232
+ export namespace ListOrSearchDepartmentsResponse$ {
233
+ /** @deprecated use `ListOrSearchDepartmentsResponse$inboundSchema` instead. */
234
+ export const inboundSchema = ListOrSearchDepartmentsResponse$inboundSchema;
235
+ /** @deprecated use `ListOrSearchDepartmentsResponse$outboundSchema` instead. */
236
+ export const outboundSchema = ListOrSearchDepartmentsResponse$outboundSchema;
237
+ /** @deprecated use `ListOrSearchDepartmentsResponse$Outbound` instead. */
238
+ export type Outbound = ListOrSearchDepartmentsResponse$Outbound;
239
+ }
240
+
241
+ export function listOrSearchDepartmentsResponseToJSON(
242
+ listOrSearchDepartmentsResponse: ListOrSearchDepartmentsResponse,
243
+ ): string {
244
+ return JSON.stringify(
245
+ ListOrSearchDepartmentsResponse$outboundSchema.parse(
246
+ listOrSearchDepartmentsResponse,
247
+ ),
248
+ );
249
+ }
250
+
251
+ export function listOrSearchDepartmentsResponseFromJSON(
252
+ jsonString: string,
253
+ ): SafeParseResult<ListOrSearchDepartmentsResponse, SDKValidationError> {
254
+ return safeParse(
255
+ jsonString,
256
+ (x) => ListOrSearchDepartmentsResponse$inboundSchema.parse(JSON.parse(x)),
257
+ `Failed to parse 'ListOrSearchDepartmentsResponse' from JSON`,
258
+ );
259
+ }
@@ -42,6 +42,10 @@ export type ListVendorFacilityStatusesRequest = {
42
42
  * An ID representing a Hospital
43
43
  */
44
44
  facilityId?: number | undefined;
45
+ /**
46
+ * Status from the target_facility
47
+ */
48
+ facilityStatus?: components.FacilityStatus | undefined;
45
49
  };
46
50
 
47
51
  /**
@@ -73,6 +77,7 @@ export const ListVendorFacilityStatusesRequest$inboundSchema: z.ZodType<
73
77
  scan_type: components.ScanType$inboundSchema.optional(),
74
78
  facility_name_like: z.string().optional(),
75
79
  facility_id: z.number().int().optional(),
80
+ facility_status: components.FacilityStatus$inboundSchema.optional(),
76
81
  }).transform((v) => {
77
82
  return remap$(v, {
78
83
  "vendor_id_or_me": "vendorIdOrMe",
@@ -80,6 +85,7 @@ export const ListVendorFacilityStatusesRequest$inboundSchema: z.ZodType<
80
85
  "scan_type": "scanType",
81
86
  "facility_name_like": "facilityNameLike",
82
87
  "facility_id": "facilityId",
88
+ "facility_status": "facilityStatus",
83
89
  });
84
90
  });
85
91
 
@@ -93,6 +99,7 @@ export type ListVendorFacilityStatusesRequest$Outbound = {
93
99
  scan_type?: string | undefined;
94
100
  facility_name_like?: string | undefined;
95
101
  facility_id?: number | undefined;
102
+ facility_status?: string | undefined;
96
103
  };
97
104
 
98
105
  /** @internal */
@@ -109,6 +116,7 @@ export const ListVendorFacilityStatusesRequest$outboundSchema: z.ZodType<
109
116
  scanType: components.ScanType$outboundSchema.optional(),
110
117
  facilityNameLike: z.string().optional(),
111
118
  facilityId: z.number().int().optional(),
119
+ facilityStatus: components.FacilityStatus$outboundSchema.optional(),
112
120
  }).transform((v) => {
113
121
  return remap$(v, {
114
122
  vendorIdOrMe: "vendor_id_or_me",
@@ -116,6 +124,7 @@ export const ListVendorFacilityStatusesRequest$outboundSchema: z.ZodType<
116
124
  scanType: "scan_type",
117
125
  facilityNameLike: "facility_name_like",
118
126
  facilityId: "facility_id",
127
+ facilityStatus: "facility_status",
119
128
  });
120
129
  });
121
130
 
@@ -49,6 +49,10 @@ export type UpdateVendorDetailsRequestBody = {
49
49
  * list of the vendor supervisor attributes
50
50
  */
51
51
  supervisor?: components.Supervisor | null | undefined;
52
+ /**
53
+ * The vendor's primary department id value to set
54
+ */
55
+ primaryDepartmentId?: number | undefined;
52
56
  };
53
57
 
54
58
  export type UpdateVendorDetailsRequest = {
@@ -92,11 +96,13 @@ export const UpdateVendorDetailsRequestBody$inboundSchema: z.ZodType<
92
96
  title: z.string().optional(),
93
97
  location: z.nullable(components.UserLocation$inboundSchema).optional(),
94
98
  supervisor: z.nullable(components.Supervisor$inboundSchema).optional(),
99
+ primary_department_id: z.number().int().optional(),
95
100
  }).transform((v) => {
96
101
  return remap$(v, {
97
102
  "qr_code": "qrCode",
98
103
  "email_recepient": "emailRecepient",
99
104
  "send_weekly_summary_email": "sendWeeklySummaryEmail",
105
+ "primary_department_id": "primaryDepartmentId",
100
106
  });
101
107
  });
102
108
 
@@ -108,6 +114,7 @@ export type UpdateVendorDetailsRequestBody$Outbound = {
108
114
  title?: string | undefined;
109
115
  location?: components.UserLocation$Outbound | null | undefined;
110
116
  supervisor?: components.Supervisor$Outbound | null | undefined;
117
+ primary_department_id?: number | undefined;
111
118
  };
112
119
 
113
120
  /** @internal */
@@ -122,11 +129,13 @@ export const UpdateVendorDetailsRequestBody$outboundSchema: z.ZodType<
122
129
  title: z.string().optional(),
123
130
  location: z.nullable(components.UserLocation$outboundSchema).optional(),
124
131
  supervisor: z.nullable(components.Supervisor$outboundSchema).optional(),
132
+ primaryDepartmentId: z.number().int().optional(),
125
133
  }).transform((v) => {
126
134
  return remap$(v, {
127
135
  qrCode: "qr_code",
128
136
  emailRecepient: "email_recepient",
129
137
  sendWeeklySummaryEmail: "send_weekly_summary_email",
138
+ primaryDepartmentId: "primary_department_id",
130
139
  });
131
140
  });
132
141
 
@@ -13,6 +13,7 @@ export * from "./invoicesCreateInvoice.js";
13
13
  export * from "./invoicesMakePayment.js";
14
14
  export * from "./invoicesUpdateInvoice.js";
15
15
  export * from "./organizationsGetFacility.js";
16
+ export * from "./organizationsListOrSearchDepartments.js";
16
17
  export * from "./organizationsListOrSearchFacilities.js";
17
18
  export * from "./supportArticlesGetSupportArticle.js";
18
19
  export * from "./supportArticlesListOrSearchSupportArticles.js";