@greensecurity/javascript-sdk 0.37.12 → 0.38.2
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.
- package/README.md +6 -0
- package/bin/mcp-server.js +858 -436
- package/bin/mcp-server.js.map +18 -10
- package/dist/commonjs/__tests__/organizations.test.js +42 -0
- package/dist/commonjs/__tests__/organizations.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +16 -0
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +4 -19
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.d.ts +26 -0
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.js +168 -0
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.d.ts +18 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.js +125 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js.map +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js +69 -0
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js +64 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/commonjs/models/components/contact.d.ts +30 -4
- package/dist/commonjs/models/components/contact.d.ts.map +1 -1
- package/dist/commonjs/models/components/contact.js +35 -5
- package/dist/commonjs/models/components/contact.js.map +1 -1
- package/dist/commonjs/models/components/departmentmembership.d.ts +80 -0
- package/dist/commonjs/models/components/departmentmembership.d.ts.map +1 -0
- package/dist/commonjs/models/components/departmentmembership.js +123 -0
- package/dist/commonjs/models/components/departmentmembership.js.map +1 -0
- package/dist/commonjs/models/components/expand.d.ts +6 -0
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +2 -0
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/usersummary.d.ts +34 -0
- package/dist/commonjs/models/components/usersummary.d.ts.map +1 -0
- package/dist/commonjs/models/components/usersummary.js +71 -0
- package/dist/commonjs/models/components/usersummary.js.map +1 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.d.ts +32 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.js +69 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.d.ts +121 -0
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.js +155 -0
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.d.ts +103 -0
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.js +184 -0
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.d.ts +30 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.js +96 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/commonjs/sdk/organizations.d.ts +14 -0
- package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
- package/dist/commonjs/sdk/organizations.js +15 -0
- package/dist/commonjs/sdk/organizations.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +7 -0
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +10 -0
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/organizations.test.js +42 -0
- package/dist/esm/__tests__/organizations.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +16 -0
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +4 -19
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.d.ts +26 -0
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.js +132 -0
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.d.ts +18 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.js +89 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/mcp-server.js.map +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts +8 -0
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js +33 -0
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js +28 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/esm/models/components/contact.d.ts +30 -4
- package/dist/esm/models/components/contact.d.ts.map +1 -1
- package/dist/esm/models/components/contact.js +32 -4
- package/dist/esm/models/components/contact.js.map +1 -1
- package/dist/esm/models/components/departmentmembership.d.ts +80 -0
- package/dist/esm/models/components/departmentmembership.d.ts.map +1 -0
- package/dist/esm/models/components/departmentmembership.js +81 -0
- package/dist/esm/models/components/departmentmembership.js.map +1 -0
- package/dist/esm/models/components/expand.d.ts +6 -0
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +2 -0
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/usersummary.d.ts +34 -0
- package/dist/esm/models/components/usersummary.d.ts.map +1 -0
- package/dist/esm/models/components/usersummary.js +33 -0
- package/dist/esm/models/components/usersummary.js.map +1 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.d.ts +32 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.d.ts.map +1 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.js +31 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.d.ts +121 -0
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.d.ts.map +1 -0
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.js +113 -0
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.d.ts +103 -0
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.js +171 -0
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.d.ts +30 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.js +86 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/esm/sdk/organizations.d.ts +14 -0
- package/dist/esm/sdk/organizations.d.ts.map +1 -1
- package/dist/esm/sdk/organizations.js +15 -0
- package/dist/esm/sdk/organizations.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +7 -0
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +10 -0
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/examples/vendorsCreateVendorRegistration.example.ts +2 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/organizations.test.ts +45 -0
- package/src/__tests__/vendors.test.ts +21 -0
- package/src/__tests__/zones.test.ts +4 -19
- package/src/funcs/organizationsListOrSearchDepartmentContacts.ts +270 -0
- package/src/funcs/vendorsGetVendorInvoiceReceipt.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/organizationsListOrSearchDepartmentContacts.ts +44 -0
- package/src/mcp-server/tools/vendorsGetVendorInvoiceReceipt.ts +38 -0
- package/src/models/components/contact.ts +74 -8
- package/src/models/components/departmentmembership.ts +201 -0
- package/src/models/components/expand.ts +2 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/usersummary.ts +69 -0
- package/src/models/operations/getvendorinvoicereceipt.ts +71 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listorsearchdepartmentcontacts.ts +280 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/organizationsListOrSearchDepartmentContacts.ts +386 -0
- package/src/react-query/vendorsGetVendorInvoiceReceipt.ts +167 -0
- package/src/sdk/organizations.ts +28 -0
- package/src/sdk/vendors.ts +18 -0
|
@@ -0,0 +1,280 @@
|
|
|
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 ListOrSearchDepartmentContactsRequest = {
|
|
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
|
+
* Search for objects by the search string
|
|
35
|
+
*/
|
|
36
|
+
search?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* An array-style parameter to identify which sections of an object to expand. See documentation for the endpoint for a list of valid expansion values.
|
|
39
|
+
*/
|
|
40
|
+
expand?: Array<components.Expand> | undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
45
|
+
*/
|
|
46
|
+
export type ListOrSearchDepartmentContactsResponseBody = {
|
|
47
|
+
/**
|
|
48
|
+
* Pagination information for a pageable list
|
|
49
|
+
*/
|
|
50
|
+
pager: components.Pager;
|
|
51
|
+
items: Array<components.DepartmentMembership | null>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type ListOrSearchDepartmentContactsResponse = {
|
|
55
|
+
result: ListOrSearchDepartmentContactsResponseBody;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const ListOrSearchDepartmentContactsRequest$inboundSchema: z.ZodType<
|
|
60
|
+
ListOrSearchDepartmentContactsRequest,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
unknown
|
|
63
|
+
> = z.object({
|
|
64
|
+
id: z.number().int(),
|
|
65
|
+
sort: z.nullable(z.string()).optional(),
|
|
66
|
+
desc: components.Desc$inboundSchema.optional(),
|
|
67
|
+
page: z.number().int().optional(),
|
|
68
|
+
items_per_page: z.number().int().optional(),
|
|
69
|
+
search: z.string().optional(),
|
|
70
|
+
expand: z.array(components.Expand$inboundSchema).optional(),
|
|
71
|
+
}).transform((v) => {
|
|
72
|
+
return remap$(v, {
|
|
73
|
+
"items_per_page": "itemsPerPage",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export type ListOrSearchDepartmentContactsRequest$Outbound = {
|
|
79
|
+
id: number;
|
|
80
|
+
sort?: string | null | undefined;
|
|
81
|
+
desc?: components.Desc$Outbound | undefined;
|
|
82
|
+
page?: number | undefined;
|
|
83
|
+
items_per_page?: number | undefined;
|
|
84
|
+
search?: string | undefined;
|
|
85
|
+
expand?: Array<string> | undefined;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const ListOrSearchDepartmentContactsRequest$outboundSchema: z.ZodType<
|
|
90
|
+
ListOrSearchDepartmentContactsRequest$Outbound,
|
|
91
|
+
z.ZodTypeDef,
|
|
92
|
+
ListOrSearchDepartmentContactsRequest
|
|
93
|
+
> = z.object({
|
|
94
|
+
id: z.number().int(),
|
|
95
|
+
sort: z.nullable(z.string()).optional(),
|
|
96
|
+
desc: components.Desc$outboundSchema.optional(),
|
|
97
|
+
page: z.number().int().optional(),
|
|
98
|
+
itemsPerPage: z.number().int().optional(),
|
|
99
|
+
search: z.string().optional(),
|
|
100
|
+
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
101
|
+
}).transform((v) => {
|
|
102
|
+
return remap$(v, {
|
|
103
|
+
itemsPerPage: "items_per_page",
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
110
|
+
*/
|
|
111
|
+
export namespace ListOrSearchDepartmentContactsRequest$ {
|
|
112
|
+
/** @deprecated use `ListOrSearchDepartmentContactsRequest$inboundSchema` instead. */
|
|
113
|
+
export const inboundSchema =
|
|
114
|
+
ListOrSearchDepartmentContactsRequest$inboundSchema;
|
|
115
|
+
/** @deprecated use `ListOrSearchDepartmentContactsRequest$outboundSchema` instead. */
|
|
116
|
+
export const outboundSchema =
|
|
117
|
+
ListOrSearchDepartmentContactsRequest$outboundSchema;
|
|
118
|
+
/** @deprecated use `ListOrSearchDepartmentContactsRequest$Outbound` instead. */
|
|
119
|
+
export type Outbound = ListOrSearchDepartmentContactsRequest$Outbound;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function listOrSearchDepartmentContactsRequestToJSON(
|
|
123
|
+
listOrSearchDepartmentContactsRequest: ListOrSearchDepartmentContactsRequest,
|
|
124
|
+
): string {
|
|
125
|
+
return JSON.stringify(
|
|
126
|
+
ListOrSearchDepartmentContactsRequest$outboundSchema.parse(
|
|
127
|
+
listOrSearchDepartmentContactsRequest,
|
|
128
|
+
),
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function listOrSearchDepartmentContactsRequestFromJSON(
|
|
133
|
+
jsonString: string,
|
|
134
|
+
): SafeParseResult<ListOrSearchDepartmentContactsRequest, SDKValidationError> {
|
|
135
|
+
return safeParse(
|
|
136
|
+
jsonString,
|
|
137
|
+
(x) =>
|
|
138
|
+
ListOrSearchDepartmentContactsRequest$inboundSchema.parse(JSON.parse(x)),
|
|
139
|
+
`Failed to parse 'ListOrSearchDepartmentContactsRequest' from JSON`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** @internal */
|
|
144
|
+
export const ListOrSearchDepartmentContactsResponseBody$inboundSchema:
|
|
145
|
+
z.ZodType<ListOrSearchDepartmentContactsResponseBody, z.ZodTypeDef, unknown> =
|
|
146
|
+
z.object({
|
|
147
|
+
pager: components.Pager$inboundSchema,
|
|
148
|
+
items: z.array(z.nullable(components.DepartmentMembership$inboundSchema)),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
/** @internal */
|
|
152
|
+
export type ListOrSearchDepartmentContactsResponseBody$Outbound = {
|
|
153
|
+
pager: components.Pager$Outbound;
|
|
154
|
+
items: Array<components.DepartmentMembership$Outbound | null>;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** @internal */
|
|
158
|
+
export const ListOrSearchDepartmentContactsResponseBody$outboundSchema:
|
|
159
|
+
z.ZodType<
|
|
160
|
+
ListOrSearchDepartmentContactsResponseBody$Outbound,
|
|
161
|
+
z.ZodTypeDef,
|
|
162
|
+
ListOrSearchDepartmentContactsResponseBody
|
|
163
|
+
> = z.object({
|
|
164
|
+
pager: components.Pager$outboundSchema,
|
|
165
|
+
items: z.array(z.nullable(components.DepartmentMembership$outboundSchema)),
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @internal
|
|
170
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
171
|
+
*/
|
|
172
|
+
export namespace ListOrSearchDepartmentContactsResponseBody$ {
|
|
173
|
+
/** @deprecated use `ListOrSearchDepartmentContactsResponseBody$inboundSchema` instead. */
|
|
174
|
+
export const inboundSchema =
|
|
175
|
+
ListOrSearchDepartmentContactsResponseBody$inboundSchema;
|
|
176
|
+
/** @deprecated use `ListOrSearchDepartmentContactsResponseBody$outboundSchema` instead. */
|
|
177
|
+
export const outboundSchema =
|
|
178
|
+
ListOrSearchDepartmentContactsResponseBody$outboundSchema;
|
|
179
|
+
/** @deprecated use `ListOrSearchDepartmentContactsResponseBody$Outbound` instead. */
|
|
180
|
+
export type Outbound = ListOrSearchDepartmentContactsResponseBody$Outbound;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function listOrSearchDepartmentContactsResponseBodyToJSON(
|
|
184
|
+
listOrSearchDepartmentContactsResponseBody:
|
|
185
|
+
ListOrSearchDepartmentContactsResponseBody,
|
|
186
|
+
): string {
|
|
187
|
+
return JSON.stringify(
|
|
188
|
+
ListOrSearchDepartmentContactsResponseBody$outboundSchema.parse(
|
|
189
|
+
listOrSearchDepartmentContactsResponseBody,
|
|
190
|
+
),
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function listOrSearchDepartmentContactsResponseBodyFromJSON(
|
|
195
|
+
jsonString: string,
|
|
196
|
+
): SafeParseResult<
|
|
197
|
+
ListOrSearchDepartmentContactsResponseBody,
|
|
198
|
+
SDKValidationError
|
|
199
|
+
> {
|
|
200
|
+
return safeParse(
|
|
201
|
+
jsonString,
|
|
202
|
+
(x) =>
|
|
203
|
+
ListOrSearchDepartmentContactsResponseBody$inboundSchema.parse(
|
|
204
|
+
JSON.parse(x),
|
|
205
|
+
),
|
|
206
|
+
`Failed to parse 'ListOrSearchDepartmentContactsResponseBody' from JSON`,
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** @internal */
|
|
211
|
+
export const ListOrSearchDepartmentContactsResponse$inboundSchema: z.ZodType<
|
|
212
|
+
ListOrSearchDepartmentContactsResponse,
|
|
213
|
+
z.ZodTypeDef,
|
|
214
|
+
unknown
|
|
215
|
+
> = z.object({
|
|
216
|
+
Result: z.lazy(() =>
|
|
217
|
+
ListOrSearchDepartmentContactsResponseBody$inboundSchema
|
|
218
|
+
),
|
|
219
|
+
}).transform((v) => {
|
|
220
|
+
return remap$(v, {
|
|
221
|
+
"Result": "result",
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
/** @internal */
|
|
226
|
+
export type ListOrSearchDepartmentContactsResponse$Outbound = {
|
|
227
|
+
Result: ListOrSearchDepartmentContactsResponseBody$Outbound;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/** @internal */
|
|
231
|
+
export const ListOrSearchDepartmentContactsResponse$outboundSchema: z.ZodType<
|
|
232
|
+
ListOrSearchDepartmentContactsResponse$Outbound,
|
|
233
|
+
z.ZodTypeDef,
|
|
234
|
+
ListOrSearchDepartmentContactsResponse
|
|
235
|
+
> = z.object({
|
|
236
|
+
result: z.lazy(() =>
|
|
237
|
+
ListOrSearchDepartmentContactsResponseBody$outboundSchema
|
|
238
|
+
),
|
|
239
|
+
}).transform((v) => {
|
|
240
|
+
return remap$(v, {
|
|
241
|
+
result: "Result",
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* @internal
|
|
247
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
248
|
+
*/
|
|
249
|
+
export namespace ListOrSearchDepartmentContactsResponse$ {
|
|
250
|
+
/** @deprecated use `ListOrSearchDepartmentContactsResponse$inboundSchema` instead. */
|
|
251
|
+
export const inboundSchema =
|
|
252
|
+
ListOrSearchDepartmentContactsResponse$inboundSchema;
|
|
253
|
+
/** @deprecated use `ListOrSearchDepartmentContactsResponse$outboundSchema` instead. */
|
|
254
|
+
export const outboundSchema =
|
|
255
|
+
ListOrSearchDepartmentContactsResponse$outboundSchema;
|
|
256
|
+
/** @deprecated use `ListOrSearchDepartmentContactsResponse$Outbound` instead. */
|
|
257
|
+
export type Outbound = ListOrSearchDepartmentContactsResponse$Outbound;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function listOrSearchDepartmentContactsResponseToJSON(
|
|
261
|
+
listOrSearchDepartmentContactsResponse:
|
|
262
|
+
ListOrSearchDepartmentContactsResponse,
|
|
263
|
+
): string {
|
|
264
|
+
return JSON.stringify(
|
|
265
|
+
ListOrSearchDepartmentContactsResponse$outboundSchema.parse(
|
|
266
|
+
listOrSearchDepartmentContactsResponse,
|
|
267
|
+
),
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function listOrSearchDepartmentContactsResponseFromJSON(
|
|
272
|
+
jsonString: string,
|
|
273
|
+
): SafeParseResult<ListOrSearchDepartmentContactsResponse, SDKValidationError> {
|
|
274
|
+
return safeParse(
|
|
275
|
+
jsonString,
|
|
276
|
+
(x) =>
|
|
277
|
+
ListOrSearchDepartmentContactsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
278
|
+
`Failed to parse 'ListOrSearchDepartmentContactsResponse' from JSON`,
|
|
279
|
+
);
|
|
280
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -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 "./organizationsListOrSearchDepartmentContacts.js";
|
|
16
17
|
export * from "./organizationsListOrSearchDepartments.js";
|
|
17
18
|
export * from "./organizationsListOrSearchFacilities.js";
|
|
18
19
|
export * from "./supportArticlesGetSupportArticle.js";
|
|
@@ -45,6 +46,7 @@ export * from "./vendorsGetSubscription.js";
|
|
|
45
46
|
export * from "./vendorsGetVendorCredentialDetails.js";
|
|
46
47
|
export * from "./vendorsGetVendorCredentialFile.js";
|
|
47
48
|
export * from "./vendorsGetVendorInvoiceDetails.js";
|
|
49
|
+
export * from "./vendorsGetVendorInvoiceReceipt.js";
|
|
48
50
|
export * from "./vendorsGetVendorLegalName.js";
|
|
49
51
|
export * from "./vendorsGetVendorsDetails.js";
|
|
50
52
|
export * from "./vendorsListVendorAdditionalFacilityFields.js";
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InfiniteData,
|
|
7
|
+
InvalidateQueryFilters,
|
|
8
|
+
QueryClient,
|
|
9
|
+
QueryFunctionContext,
|
|
10
|
+
QueryKey,
|
|
11
|
+
useInfiniteQuery,
|
|
12
|
+
UseInfiniteQueryResult,
|
|
13
|
+
useQuery,
|
|
14
|
+
UseQueryResult,
|
|
15
|
+
useSuspenseInfiniteQuery,
|
|
16
|
+
UseSuspenseInfiniteQueryResult,
|
|
17
|
+
useSuspenseQuery,
|
|
18
|
+
UseSuspenseQueryResult,
|
|
19
|
+
} from "@tanstack/react-query";
|
|
20
|
+
import { GreenSecurityCore } from "../core.js";
|
|
21
|
+
import { organizationsListOrSearchDepartmentContacts } from "../funcs/organizationsListOrSearchDepartmentContacts.js";
|
|
22
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
23
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
24
|
+
import * as components from "../models/components/index.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
27
|
+
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
28
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
29
|
+
import {
|
|
30
|
+
InfiniteQueryHookOptions,
|
|
31
|
+
QueryHookOptions,
|
|
32
|
+
SuspenseInfiniteQueryHookOptions,
|
|
33
|
+
SuspenseQueryHookOptions,
|
|
34
|
+
TupleToPrefixes,
|
|
35
|
+
} from "./_types.js";
|
|
36
|
+
|
|
37
|
+
export type OrganizationsListOrSearchDepartmentContactsQueryData =
|
|
38
|
+
operations.ListOrSearchDepartmentContactsResponse;
|
|
39
|
+
|
|
40
|
+
export type OrganizationsListOrSearchDepartmentContactsInfiniteQueryData =
|
|
41
|
+
PageIterator<
|
|
42
|
+
operations.ListOrSearchDepartmentContactsResponse,
|
|
43
|
+
{ page: number }
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
export type OrganizationsListOrSearchDepartmentContactsPageParams =
|
|
47
|
+
PageIterator<
|
|
48
|
+
operations.ListOrSearchDepartmentContactsResponse,
|
|
49
|
+
{ page: number }
|
|
50
|
+
>["~next"];
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* List or search department contacts
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* List or search department contacts.
|
|
57
|
+
*
|
|
58
|
+
* Available `expand` scopes are:
|
|
59
|
+
*
|
|
60
|
+
* - department_membership.contact
|
|
61
|
+
* - department_membership.department
|
|
62
|
+
*/
|
|
63
|
+
export function useOrganizationsListOrSearchDepartmentContacts(
|
|
64
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
65
|
+
options?: QueryHookOptions<
|
|
66
|
+
OrganizationsListOrSearchDepartmentContactsQueryData
|
|
67
|
+
>,
|
|
68
|
+
): UseQueryResult<OrganizationsListOrSearchDepartmentContactsQueryData, Error> {
|
|
69
|
+
const client = useGreenSecurityContext();
|
|
70
|
+
return useQuery({
|
|
71
|
+
...buildOrganizationsListOrSearchDepartmentContactsQuery(
|
|
72
|
+
client,
|
|
73
|
+
request,
|
|
74
|
+
options,
|
|
75
|
+
),
|
|
76
|
+
...options,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* List or search department contacts
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* List or search department contacts.
|
|
85
|
+
*
|
|
86
|
+
* Available `expand` scopes are:
|
|
87
|
+
*
|
|
88
|
+
* - department_membership.contact
|
|
89
|
+
* - department_membership.department
|
|
90
|
+
*/
|
|
91
|
+
export function useOrganizationsListOrSearchDepartmentContactsSuspense(
|
|
92
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
93
|
+
options?: SuspenseQueryHookOptions<
|
|
94
|
+
OrganizationsListOrSearchDepartmentContactsQueryData
|
|
95
|
+
>,
|
|
96
|
+
): UseSuspenseQueryResult<
|
|
97
|
+
OrganizationsListOrSearchDepartmentContactsQueryData,
|
|
98
|
+
Error
|
|
99
|
+
> {
|
|
100
|
+
const client = useGreenSecurityContext();
|
|
101
|
+
return useSuspenseQuery({
|
|
102
|
+
...buildOrganizationsListOrSearchDepartmentContactsQuery(
|
|
103
|
+
client,
|
|
104
|
+
request,
|
|
105
|
+
options,
|
|
106
|
+
),
|
|
107
|
+
...options,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* List or search department contacts
|
|
113
|
+
*
|
|
114
|
+
* @remarks
|
|
115
|
+
* List or search department contacts.
|
|
116
|
+
*
|
|
117
|
+
* Available `expand` scopes are:
|
|
118
|
+
*
|
|
119
|
+
* - department_membership.contact
|
|
120
|
+
* - department_membership.department
|
|
121
|
+
*/
|
|
122
|
+
export function useOrganizationsListOrSearchDepartmentContactsInfinite(
|
|
123
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
124
|
+
options?: InfiniteQueryHookOptions<
|
|
125
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData
|
|
126
|
+
>,
|
|
127
|
+
): UseInfiniteQueryResult<
|
|
128
|
+
InfiniteData<
|
|
129
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData,
|
|
130
|
+
OrganizationsListOrSearchDepartmentContactsPageParams
|
|
131
|
+
>,
|
|
132
|
+
Error
|
|
133
|
+
> {
|
|
134
|
+
const client = useGreenSecurityContext();
|
|
135
|
+
return useInfiniteQuery<
|
|
136
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData,
|
|
137
|
+
Error,
|
|
138
|
+
InfiniteData<
|
|
139
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData,
|
|
140
|
+
OrganizationsListOrSearchDepartmentContactsPageParams
|
|
141
|
+
>,
|
|
142
|
+
QueryKey,
|
|
143
|
+
OrganizationsListOrSearchDepartmentContactsPageParams
|
|
144
|
+
>({
|
|
145
|
+
...buildOrganizationsListOrSearchDepartmentContactsInfiniteQuery(
|
|
146
|
+
client,
|
|
147
|
+
request,
|
|
148
|
+
options,
|
|
149
|
+
),
|
|
150
|
+
initialPageParam: options?.initialPageParam,
|
|
151
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
152
|
+
...options,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* List or search department contacts
|
|
158
|
+
*
|
|
159
|
+
* @remarks
|
|
160
|
+
* List or search department contacts.
|
|
161
|
+
*
|
|
162
|
+
* Available `expand` scopes are:
|
|
163
|
+
*
|
|
164
|
+
* - department_membership.contact
|
|
165
|
+
* - department_membership.department
|
|
166
|
+
*/
|
|
167
|
+
export function useOrganizationsListOrSearchDepartmentContactsInfiniteSuspense(
|
|
168
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
169
|
+
options?: SuspenseInfiniteQueryHookOptions<
|
|
170
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData
|
|
171
|
+
>,
|
|
172
|
+
): UseSuspenseInfiniteQueryResult<
|
|
173
|
+
InfiniteData<
|
|
174
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData,
|
|
175
|
+
OrganizationsListOrSearchDepartmentContactsPageParams
|
|
176
|
+
>,
|
|
177
|
+
Error
|
|
178
|
+
> {
|
|
179
|
+
const client = useGreenSecurityContext();
|
|
180
|
+
return useSuspenseInfiniteQuery<
|
|
181
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData,
|
|
182
|
+
Error,
|
|
183
|
+
InfiniteData<
|
|
184
|
+
OrganizationsListOrSearchDepartmentContactsInfiniteQueryData,
|
|
185
|
+
OrganizationsListOrSearchDepartmentContactsPageParams
|
|
186
|
+
>,
|
|
187
|
+
QueryKey,
|
|
188
|
+
OrganizationsListOrSearchDepartmentContactsPageParams
|
|
189
|
+
>({
|
|
190
|
+
...buildOrganizationsListOrSearchDepartmentContactsInfiniteQuery(
|
|
191
|
+
client,
|
|
192
|
+
request,
|
|
193
|
+
options,
|
|
194
|
+
),
|
|
195
|
+
initialPageParam: options?.initialPageParam,
|
|
196
|
+
getNextPageParam: (previousPage) => previousPage["~next"],
|
|
197
|
+
...options,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export function prefetchOrganizationsListOrSearchDepartmentContacts(
|
|
202
|
+
queryClient: QueryClient,
|
|
203
|
+
client$: GreenSecurityCore,
|
|
204
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
205
|
+
): Promise<void> {
|
|
206
|
+
return queryClient.prefetchQuery({
|
|
207
|
+
...buildOrganizationsListOrSearchDepartmentContactsQuery(
|
|
208
|
+
client$,
|
|
209
|
+
request,
|
|
210
|
+
),
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function setOrganizationsListOrSearchDepartmentContactsData(
|
|
215
|
+
client: QueryClient,
|
|
216
|
+
queryKeyBase: [
|
|
217
|
+
id: number,
|
|
218
|
+
parameters: {
|
|
219
|
+
sort?: string | null | undefined;
|
|
220
|
+
desc?: components.Desc | undefined;
|
|
221
|
+
page?: number | undefined;
|
|
222
|
+
itemsPerPage?: number | undefined;
|
|
223
|
+
search?: string | undefined;
|
|
224
|
+
expand?: Array<components.Expand> | undefined;
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
data: OrganizationsListOrSearchDepartmentContactsQueryData,
|
|
228
|
+
): OrganizationsListOrSearchDepartmentContactsQueryData | undefined {
|
|
229
|
+
const key = queryKeyOrganizationsListOrSearchDepartmentContacts(
|
|
230
|
+
...queryKeyBase,
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
return client.setQueryData<
|
|
234
|
+
OrganizationsListOrSearchDepartmentContactsQueryData
|
|
235
|
+
>(key, data);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function invalidateOrganizationsListOrSearchDepartmentContacts(
|
|
239
|
+
client: QueryClient,
|
|
240
|
+
queryKeyBase: TupleToPrefixes<
|
|
241
|
+
[
|
|
242
|
+
id: number,
|
|
243
|
+
parameters: {
|
|
244
|
+
sort?: string | null | undefined;
|
|
245
|
+
desc?: components.Desc | undefined;
|
|
246
|
+
page?: number | undefined;
|
|
247
|
+
itemsPerPage?: number | undefined;
|
|
248
|
+
search?: string | undefined;
|
|
249
|
+
expand?: Array<components.Expand> | undefined;
|
|
250
|
+
},
|
|
251
|
+
]
|
|
252
|
+
>,
|
|
253
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
254
|
+
): Promise<void> {
|
|
255
|
+
return client.invalidateQueries({
|
|
256
|
+
...filters,
|
|
257
|
+
queryKey: [
|
|
258
|
+
"@greensecurity/javascript-sdk",
|
|
259
|
+
"organizations",
|
|
260
|
+
"listOrSearchDepartmentContacts",
|
|
261
|
+
...queryKeyBase,
|
|
262
|
+
],
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function invalidateAllOrganizationsListOrSearchDepartmentContacts(
|
|
267
|
+
client: QueryClient,
|
|
268
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
269
|
+
): Promise<void> {
|
|
270
|
+
return client.invalidateQueries({
|
|
271
|
+
...filters,
|
|
272
|
+
queryKey: [
|
|
273
|
+
"@greensecurity/javascript-sdk",
|
|
274
|
+
"organizations",
|
|
275
|
+
"listOrSearchDepartmentContacts",
|
|
276
|
+
],
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function buildOrganizationsListOrSearchDepartmentContactsQuery(
|
|
281
|
+
client$: GreenSecurityCore,
|
|
282
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
283
|
+
options?: RequestOptions,
|
|
284
|
+
): {
|
|
285
|
+
queryKey: QueryKey;
|
|
286
|
+
queryFn: (
|
|
287
|
+
context: QueryFunctionContext,
|
|
288
|
+
) => Promise<OrganizationsListOrSearchDepartmentContactsQueryData>;
|
|
289
|
+
} {
|
|
290
|
+
return {
|
|
291
|
+
queryKey: queryKeyOrganizationsListOrSearchDepartmentContacts(request.id, {
|
|
292
|
+
sort: request.sort,
|
|
293
|
+
desc: request.desc,
|
|
294
|
+
page: request.page,
|
|
295
|
+
itemsPerPage: request.itemsPerPage,
|
|
296
|
+
search: request.search,
|
|
297
|
+
expand: request.expand,
|
|
298
|
+
}),
|
|
299
|
+
queryFn: async function organizationsListOrSearchDepartmentContactsQueryFn(
|
|
300
|
+
ctx,
|
|
301
|
+
): Promise<OrganizationsListOrSearchDepartmentContactsQueryData> {
|
|
302
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
303
|
+
const mergedOptions = {
|
|
304
|
+
...options,
|
|
305
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
return unwrapAsync(organizationsListOrSearchDepartmentContacts(
|
|
309
|
+
client$,
|
|
310
|
+
request,
|
|
311
|
+
mergedOptions,
|
|
312
|
+
));
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export function buildOrganizationsListOrSearchDepartmentContactsInfiniteQuery(
|
|
318
|
+
client$: GreenSecurityCore,
|
|
319
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
320
|
+
options?: RequestOptions,
|
|
321
|
+
): {
|
|
322
|
+
queryKey: QueryKey;
|
|
323
|
+
queryFn: (
|
|
324
|
+
context: QueryFunctionContext<
|
|
325
|
+
QueryKey,
|
|
326
|
+
OrganizationsListOrSearchDepartmentContactsPageParams
|
|
327
|
+
>,
|
|
328
|
+
) => Promise<OrganizationsListOrSearchDepartmentContactsInfiniteQueryData>;
|
|
329
|
+
} {
|
|
330
|
+
return {
|
|
331
|
+
queryKey: queryKeyOrganizationsListOrSearchDepartmentContacts(request.id, {
|
|
332
|
+
sort: request.sort,
|
|
333
|
+
desc: request.desc,
|
|
334
|
+
page: request.page,
|
|
335
|
+
itemsPerPage: request.itemsPerPage,
|
|
336
|
+
search: request.search,
|
|
337
|
+
expand: request.expand,
|
|
338
|
+
}),
|
|
339
|
+
queryFn: async function organizationsListOrSearchDepartmentContactsQuery(
|
|
340
|
+
ctx,
|
|
341
|
+
): Promise<OrganizationsListOrSearchDepartmentContactsInfiniteQueryData> {
|
|
342
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
343
|
+
const mergedOptions = {
|
|
344
|
+
...options,
|
|
345
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
if (!ctx.pageParam) {
|
|
349
|
+
return unwrapResultIterator(organizationsListOrSearchDepartmentContacts(
|
|
350
|
+
client$,
|
|
351
|
+
request,
|
|
352
|
+
mergedOptions,
|
|
353
|
+
));
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return unwrapResultIterator(organizationsListOrSearchDepartmentContacts(
|
|
357
|
+
client$,
|
|
358
|
+
{
|
|
359
|
+
...request,
|
|
360
|
+
page: ctx.pageParam.page,
|
|
361
|
+
},
|
|
362
|
+
mergedOptions,
|
|
363
|
+
));
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function queryKeyOrganizationsListOrSearchDepartmentContacts(
|
|
369
|
+
id: number,
|
|
370
|
+
parameters: {
|
|
371
|
+
sort?: string | null | undefined;
|
|
372
|
+
desc?: components.Desc | undefined;
|
|
373
|
+
page?: number | undefined;
|
|
374
|
+
itemsPerPage?: number | undefined;
|
|
375
|
+
search?: string | undefined;
|
|
376
|
+
expand?: Array<components.Expand> | undefined;
|
|
377
|
+
},
|
|
378
|
+
): QueryKey {
|
|
379
|
+
return [
|
|
380
|
+
"@greensecurity/javascript-sdk",
|
|
381
|
+
"organizations",
|
|
382
|
+
"listOrSearchDepartmentContacts",
|
|
383
|
+
id,
|
|
384
|
+
parameters,
|
|
385
|
+
];
|
|
386
|
+
}
|