@greensecurity/javascript-sdk 0.18.0 → 0.18.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 +3 -0
- package/bin/mcp-server.js +253 -38
- package/bin/mcp-server.js.map +17 -13
- package/funcs/supportArticlesListOrSearchSupportArticles.js +2 -0
- package/funcs/supportArticlesListOrSearchSupportArticles.js.map +1 -1
- package/funcs/vendorsGetVendorInvoiceDetails.d.ts +23 -0
- package/funcs/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
- package/funcs/vendorsGetVendorInvoiceDetails.js +130 -0
- package/funcs/vendorsGetVendorInvoiceDetails.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +3 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.d.ts +8 -0
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.js +69 -0
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.js.map +1 -0
- package/models/components/expand.d.ts +3 -0
- package/models/components/expand.d.ts.map +1 -1
- package/models/components/expand.js +1 -0
- package/models/components/expand.js.map +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invoice.d.ts +13 -2
- package/models/components/invoice.d.ts.map +1 -1
- package/models/components/invoice.js +19 -2
- package/models/components/invoice.js.map +1 -1
- package/models/components/invoiceitem.d.ts +8 -0
- package/models/components/invoiceitem.d.ts.map +1 -1
- package/models/components/invoiceitem.js +12 -0
- package/models/components/invoiceitem.js.map +1 -1
- package/models/components/invoicetransaction.d.ts +44 -0
- package/models/components/invoicetransaction.d.ts.map +1 -0
- package/models/components/invoicetransaction.js +96 -0
- package/models/components/invoicetransaction.js.map +1 -0
- package/models/operations/getvendorinvoicedetails.d.ts +38 -0
- package/models/operations/getvendorinvoicedetails.d.ts.map +1 -0
- package/models/operations/getvendorinvoicedetails.js +72 -0
- package/models/operations/getvendorinvoicedetails.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listorsearchsupportarticles.d.ts +10 -0
- package/models/operations/listorsearchsupportarticles.d.ts.map +1 -1
- package/models/operations/listorsearchsupportarticles.js +4 -0
- package/models/operations/listorsearchsupportarticles.js.map +1 -1
- package/package.json +1 -1
- package/react-query/index.d.ts +1 -0
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +1 -0
- package/react-query/index.js.map +1 -1
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts +6 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -1
- package/react-query/supportArticlesListOrSearchSupportArticles.js +4 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.js.map +1 -1
- package/react-query/vendorsGetVendorInvoiceDetails.d.ts +53 -0
- package/react-query/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
- package/react-query/vendorsGetVendorInvoiceDetails.js +109 -0
- package/react-query/vendorsGetVendorInvoiceDetails.js.map +1 -0
- package/sdk/vendors.d.ts +13 -0
- package/sdk/vendors.d.ts.map +1 -1
- package/sdk/vendors.js +15 -0
- package/sdk/vendors.js.map +1 -1
- package/src/__tests__/vendors.test.ts +23 -0
- package/src/funcs/supportArticlesListOrSearchSupportArticles.ts +2 -0
- package/src/funcs/vendorsGetVendorInvoiceDetails.ts +180 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/vendorsGetVendorInvoiceDetails.ts +43 -0
- package/src/models/components/expand.ts +1 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/invoice.ts +36 -4
- package/src/models/components/invoiceitem.ts +20 -0
- package/src/models/components/invoicetransaction.ts +108 -0
- package/src/models/operations/getvendorinvoicedetails.ts +79 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listorsearchsupportarticles.ts +14 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/supportArticlesListOrSearchSupportArticles.ts +10 -0
- package/src/react-query/vendorsGetVendorInvoiceDetails.ts +187 -0
- package/src/sdk/vendors.ts +24 -0
|
@@ -0,0 +1,108 @@
|
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Reduced list of attributes of the Invoice transaction record
|
|
13
|
+
*/
|
|
14
|
+
export type InvoiceTransaction = {
|
|
15
|
+
dateProcessed?: string | null | undefined;
|
|
16
|
+
payee?: string | null | undefined;
|
|
17
|
+
amount?: number | null | undefined;
|
|
18
|
+
creditId?: number | null | undefined;
|
|
19
|
+
transactionId?: string | null | undefined;
|
|
20
|
+
success?: boolean | null | undefined;
|
|
21
|
+
cardLast4?: string | null | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const InvoiceTransaction$inboundSchema: z.ZodType<
|
|
26
|
+
InvoiceTransaction,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
date_processed: z.nullable(z.string()).optional(),
|
|
31
|
+
payee: z.nullable(z.string()).optional(),
|
|
32
|
+
amount: z.nullable(z.number().int()).optional(),
|
|
33
|
+
credit_id: z.nullable(z.number().int()).optional(),
|
|
34
|
+
transaction_id: z.nullable(z.string()).optional(),
|
|
35
|
+
success: z.nullable(z.boolean()).optional(),
|
|
36
|
+
card_last4: z.nullable(z.string()).optional(),
|
|
37
|
+
}).transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
"date_processed": "dateProcessed",
|
|
40
|
+
"credit_id": "creditId",
|
|
41
|
+
"transaction_id": "transactionId",
|
|
42
|
+
"card_last4": "cardLast4",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export type InvoiceTransaction$Outbound = {
|
|
48
|
+
date_processed?: string | null | undefined;
|
|
49
|
+
payee?: string | null | undefined;
|
|
50
|
+
amount?: number | null | undefined;
|
|
51
|
+
credit_id?: number | null | undefined;
|
|
52
|
+
transaction_id?: string | null | undefined;
|
|
53
|
+
success?: boolean | null | undefined;
|
|
54
|
+
card_last4?: string | null | undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const InvoiceTransaction$outboundSchema: z.ZodType<
|
|
59
|
+
InvoiceTransaction$Outbound,
|
|
60
|
+
z.ZodTypeDef,
|
|
61
|
+
InvoiceTransaction
|
|
62
|
+
> = z.object({
|
|
63
|
+
dateProcessed: z.nullable(z.string()).optional(),
|
|
64
|
+
payee: z.nullable(z.string()).optional(),
|
|
65
|
+
amount: z.nullable(z.number().int()).optional(),
|
|
66
|
+
creditId: z.nullable(z.number().int()).optional(),
|
|
67
|
+
transactionId: z.nullable(z.string()).optional(),
|
|
68
|
+
success: z.nullable(z.boolean()).optional(),
|
|
69
|
+
cardLast4: z.nullable(z.string()).optional(),
|
|
70
|
+
}).transform((v) => {
|
|
71
|
+
return remap$(v, {
|
|
72
|
+
dateProcessed: "date_processed",
|
|
73
|
+
creditId: "credit_id",
|
|
74
|
+
transactionId: "transaction_id",
|
|
75
|
+
cardLast4: "card_last4",
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
82
|
+
*/
|
|
83
|
+
export namespace InvoiceTransaction$ {
|
|
84
|
+
/** @deprecated use `InvoiceTransaction$inboundSchema` instead. */
|
|
85
|
+
export const inboundSchema = InvoiceTransaction$inboundSchema;
|
|
86
|
+
/** @deprecated use `InvoiceTransaction$outboundSchema` instead. */
|
|
87
|
+
export const outboundSchema = InvoiceTransaction$outboundSchema;
|
|
88
|
+
/** @deprecated use `InvoiceTransaction$Outbound` instead. */
|
|
89
|
+
export type Outbound = InvoiceTransaction$Outbound;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function invoiceTransactionToJSON(
|
|
93
|
+
invoiceTransaction: InvoiceTransaction,
|
|
94
|
+
): string {
|
|
95
|
+
return JSON.stringify(
|
|
96
|
+
InvoiceTransaction$outboundSchema.parse(invoiceTransaction),
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function invoiceTransactionFromJSON(
|
|
101
|
+
jsonString: string,
|
|
102
|
+
): SafeParseResult<InvoiceTransaction, SDKValidationError> {
|
|
103
|
+
return safeParse(
|
|
104
|
+
jsonString,
|
|
105
|
+
(x) => InvoiceTransaction$inboundSchema.parse(JSON.parse(x)),
|
|
106
|
+
`Failed to parse 'InvoiceTransaction' from JSON`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as components from "../components/index.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type GetVendorInvoiceDetailsRequest = {
|
|
12
|
+
/**
|
|
13
|
+
* The identifier of the object
|
|
14
|
+
*/
|
|
15
|
+
id: number;
|
|
16
|
+
/**
|
|
17
|
+
* 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.
|
|
18
|
+
*/
|
|
19
|
+
expand?: Array<components.Expand> | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const GetVendorInvoiceDetailsRequest$inboundSchema: z.ZodType<
|
|
24
|
+
GetVendorInvoiceDetailsRequest,
|
|
25
|
+
z.ZodTypeDef,
|
|
26
|
+
unknown
|
|
27
|
+
> = z.object({
|
|
28
|
+
id: z.number().int(),
|
|
29
|
+
expand: z.array(components.Expand$inboundSchema).optional(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type GetVendorInvoiceDetailsRequest$Outbound = {
|
|
34
|
+
id: number;
|
|
35
|
+
expand?: Array<string> | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const GetVendorInvoiceDetailsRequest$outboundSchema: z.ZodType<
|
|
40
|
+
GetVendorInvoiceDetailsRequest$Outbound,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
GetVendorInvoiceDetailsRequest
|
|
43
|
+
> = z.object({
|
|
44
|
+
id: z.number().int(),
|
|
45
|
+
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
51
|
+
*/
|
|
52
|
+
export namespace GetVendorInvoiceDetailsRequest$ {
|
|
53
|
+
/** @deprecated use `GetVendorInvoiceDetailsRequest$inboundSchema` instead. */
|
|
54
|
+
export const inboundSchema = GetVendorInvoiceDetailsRequest$inboundSchema;
|
|
55
|
+
/** @deprecated use `GetVendorInvoiceDetailsRequest$outboundSchema` instead. */
|
|
56
|
+
export const outboundSchema = GetVendorInvoiceDetailsRequest$outboundSchema;
|
|
57
|
+
/** @deprecated use `GetVendorInvoiceDetailsRequest$Outbound` instead. */
|
|
58
|
+
export type Outbound = GetVendorInvoiceDetailsRequest$Outbound;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function getVendorInvoiceDetailsRequestToJSON(
|
|
62
|
+
getVendorInvoiceDetailsRequest: GetVendorInvoiceDetailsRequest,
|
|
63
|
+
): string {
|
|
64
|
+
return JSON.stringify(
|
|
65
|
+
GetVendorInvoiceDetailsRequest$outboundSchema.parse(
|
|
66
|
+
getVendorInvoiceDetailsRequest,
|
|
67
|
+
),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getVendorInvoiceDetailsRequestFromJSON(
|
|
72
|
+
jsonString: string,
|
|
73
|
+
): SafeParseResult<GetVendorInvoiceDetailsRequest, SDKValidationError> {
|
|
74
|
+
return safeParse(
|
|
75
|
+
jsonString,
|
|
76
|
+
(x) => GetVendorInvoiceDetailsRequest$inboundSchema.parse(JSON.parse(x)),
|
|
77
|
+
`Failed to parse 'GetVendorInvoiceDetailsRequest' from JSON`,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -7,6 +7,7 @@ export * from "./expeditetimeremaining.js";
|
|
|
7
7
|
export * from "./getfacility.js";
|
|
8
8
|
export * from "./getsupportarticle.js";
|
|
9
9
|
export * from "./getuserbyid.js";
|
|
10
|
+
export * from "./getvendorinvoicedetails.js";
|
|
10
11
|
export * from "./listorsearchfacilities.js";
|
|
11
12
|
export * from "./listorsearchsupportarticles.js";
|
|
12
13
|
export * from "./listvendorcredentials.js";
|
|
@@ -26,6 +26,14 @@ export type ListOrSearchSupportArticlesRequest = {
|
|
|
26
26
|
* Number of items to show in a given page
|
|
27
27
|
*/
|
|
28
28
|
itemsPerPage?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Search for objects in the same category as the search string
|
|
31
|
+
*/
|
|
32
|
+
category?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Search for objects by the search string
|
|
35
|
+
*/
|
|
36
|
+
search?: string | undefined;
|
|
29
37
|
};
|
|
30
38
|
|
|
31
39
|
/**
|
|
@@ -53,6 +61,8 @@ export const ListOrSearchSupportArticlesRequest$inboundSchema: z.ZodType<
|
|
|
53
61
|
desc: components.Desc$inboundSchema.optional(),
|
|
54
62
|
page: z.number().int().optional(),
|
|
55
63
|
items_per_page: z.number().int().optional(),
|
|
64
|
+
category: z.string().optional(),
|
|
65
|
+
search: z.string().optional(),
|
|
56
66
|
}).transform((v) => {
|
|
57
67
|
return remap$(v, {
|
|
58
68
|
"items_per_page": "itemsPerPage",
|
|
@@ -65,6 +75,8 @@ export type ListOrSearchSupportArticlesRequest$Outbound = {
|
|
|
65
75
|
desc?: components.Desc$Outbound | undefined;
|
|
66
76
|
page?: number | undefined;
|
|
67
77
|
items_per_page?: number | undefined;
|
|
78
|
+
category?: string | undefined;
|
|
79
|
+
search?: string | undefined;
|
|
68
80
|
};
|
|
69
81
|
|
|
70
82
|
/** @internal */
|
|
@@ -77,6 +89,8 @@ export const ListOrSearchSupportArticlesRequest$outboundSchema: z.ZodType<
|
|
|
77
89
|
desc: components.Desc$outboundSchema.optional(),
|
|
78
90
|
page: z.number().int().optional(),
|
|
79
91
|
itemsPerPage: z.number().int().optional(),
|
|
92
|
+
category: z.string().optional(),
|
|
93
|
+
search: z.string().optional(),
|
|
80
94
|
}).transform((v) => {
|
|
81
95
|
return remap$(v, {
|
|
82
96
|
itemsPerPage: "items_per_page",
|
package/src/react-query/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./usersPassword.js";
|
|
|
17
17
|
export * from "./usersPasswordResetRequest.js";
|
|
18
18
|
export * from "./vendorsCreateVendorRegistration.js";
|
|
19
19
|
export * from "./vendorsExpediteTimeRemaining.js";
|
|
20
|
+
export * from "./vendorsGetVendorInvoiceDetails.js";
|
|
20
21
|
export * from "./vendorsListVendorCredentials.js";
|
|
21
22
|
export * from "./vendorsListVendorInvoices.js";
|
|
22
23
|
export * from "./vendorsListVendorJobTitles.js";
|
|
@@ -198,6 +198,8 @@ export function setSupportArticlesListOrSearchSupportArticlesData(
|
|
|
198
198
|
desc?: components.Desc | undefined;
|
|
199
199
|
page?: number | undefined;
|
|
200
200
|
itemsPerPage?: number | undefined;
|
|
201
|
+
category?: string | undefined;
|
|
202
|
+
search?: string | undefined;
|
|
201
203
|
},
|
|
202
204
|
],
|
|
203
205
|
data: SupportArticlesListOrSearchSupportArticlesQueryData,
|
|
@@ -219,6 +221,8 @@ export function invalidateSupportArticlesListOrSearchSupportArticles(
|
|
|
219
221
|
desc?: components.Desc | undefined;
|
|
220
222
|
page?: number | undefined;
|
|
221
223
|
itemsPerPage?: number | undefined;
|
|
224
|
+
category?: string | undefined;
|
|
225
|
+
search?: string | undefined;
|
|
222
226
|
}]
|
|
223
227
|
>,
|
|
224
228
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
@@ -264,6 +268,8 @@ export function buildSupportArticlesListOrSearchSupportArticlesQuery(
|
|
|
264
268
|
desc: request.desc,
|
|
265
269
|
page: request.page,
|
|
266
270
|
itemsPerPage: request.itemsPerPage,
|
|
271
|
+
category: request.category,
|
|
272
|
+
search: request.search,
|
|
267
273
|
}),
|
|
268
274
|
queryFn: async function supportArticlesListOrSearchSupportArticlesQueryFn(
|
|
269
275
|
ctx,
|
|
@@ -302,6 +308,8 @@ export function buildSupportArticlesListOrSearchSupportArticlesInfiniteQuery(
|
|
|
302
308
|
desc: request.desc,
|
|
303
309
|
page: request.page,
|
|
304
310
|
itemsPerPage: request.itemsPerPage,
|
|
311
|
+
category: request.category,
|
|
312
|
+
search: request.search,
|
|
305
313
|
}),
|
|
306
314
|
queryFn: async function supportArticlesListOrSearchSupportArticlesQuery(
|
|
307
315
|
ctx,
|
|
@@ -338,6 +346,8 @@ export function queryKeySupportArticlesListOrSearchSupportArticles(
|
|
|
338
346
|
desc?: components.Desc | undefined;
|
|
339
347
|
page?: number | undefined;
|
|
340
348
|
itemsPerPage?: number | undefined;
|
|
349
|
+
category?: string | undefined;
|
|
350
|
+
search?: string | undefined;
|
|
341
351
|
},
|
|
342
352
|
): QueryKey {
|
|
343
353
|
return [
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InvalidateQueryFilters,
|
|
7
|
+
QueryClient,
|
|
8
|
+
QueryFunctionContext,
|
|
9
|
+
QueryKey,
|
|
10
|
+
useQuery,
|
|
11
|
+
UseQueryResult,
|
|
12
|
+
useSuspenseQuery,
|
|
13
|
+
UseSuspenseQueryResult,
|
|
14
|
+
} from "@tanstack/react-query";
|
|
15
|
+
import { GreenSecurityCore } from "../core.js";
|
|
16
|
+
import { vendorsGetVendorInvoiceDetails } from "../funcs/vendorsGetVendorInvoiceDetails.js";
|
|
17
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
18
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
19
|
+
import * as components from "../models/components/index.js";
|
|
20
|
+
import * as operations from "../models/operations/index.js";
|
|
21
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
22
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
23
|
+
import {
|
|
24
|
+
QueryHookOptions,
|
|
25
|
+
SuspenseQueryHookOptions,
|
|
26
|
+
TupleToPrefixes,
|
|
27
|
+
} from "./_types.js";
|
|
28
|
+
|
|
29
|
+
export type VendorsGetVendorInvoiceDetailsQueryData = components.Invoice;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get vendor invoice details
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Retrieve an individual vendor invoice detais.
|
|
36
|
+
*
|
|
37
|
+
* Available `expand` scopes are:
|
|
38
|
+
*
|
|
39
|
+
* invoice.line_items
|
|
40
|
+
* invoice.invoice_transactions
|
|
41
|
+
*/
|
|
42
|
+
export function useVendorsGetVendorInvoiceDetails(
|
|
43
|
+
request: operations.GetVendorInvoiceDetailsRequest,
|
|
44
|
+
options?: QueryHookOptions<VendorsGetVendorInvoiceDetailsQueryData>,
|
|
45
|
+
): UseQueryResult<VendorsGetVendorInvoiceDetailsQueryData, Error> {
|
|
46
|
+
const client = useGreenSecurityContext();
|
|
47
|
+
return useQuery({
|
|
48
|
+
...buildVendorsGetVendorInvoiceDetailsQuery(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
),
|
|
53
|
+
...options,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get vendor invoice details
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Retrieve an individual vendor invoice detais.
|
|
62
|
+
*
|
|
63
|
+
* Available `expand` scopes are:
|
|
64
|
+
*
|
|
65
|
+
* invoice.line_items
|
|
66
|
+
* invoice.invoice_transactions
|
|
67
|
+
*/
|
|
68
|
+
export function useVendorsGetVendorInvoiceDetailsSuspense(
|
|
69
|
+
request: operations.GetVendorInvoiceDetailsRequest,
|
|
70
|
+
options?: SuspenseQueryHookOptions<VendorsGetVendorInvoiceDetailsQueryData>,
|
|
71
|
+
): UseSuspenseQueryResult<VendorsGetVendorInvoiceDetailsQueryData, Error> {
|
|
72
|
+
const client = useGreenSecurityContext();
|
|
73
|
+
return useSuspenseQuery({
|
|
74
|
+
...buildVendorsGetVendorInvoiceDetailsQuery(
|
|
75
|
+
client,
|
|
76
|
+
request,
|
|
77
|
+
options,
|
|
78
|
+
),
|
|
79
|
+
...options,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function prefetchVendorsGetVendorInvoiceDetails(
|
|
84
|
+
queryClient: QueryClient,
|
|
85
|
+
client$: GreenSecurityCore,
|
|
86
|
+
request: operations.GetVendorInvoiceDetailsRequest,
|
|
87
|
+
): Promise<void> {
|
|
88
|
+
return queryClient.prefetchQuery({
|
|
89
|
+
...buildVendorsGetVendorInvoiceDetailsQuery(
|
|
90
|
+
client$,
|
|
91
|
+
request,
|
|
92
|
+
),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function setVendorsGetVendorInvoiceDetailsData(
|
|
97
|
+
client: QueryClient,
|
|
98
|
+
queryKeyBase: [
|
|
99
|
+
id: number,
|
|
100
|
+
parameters: { expand?: Array<components.Expand> | undefined },
|
|
101
|
+
],
|
|
102
|
+
data: VendorsGetVendorInvoiceDetailsQueryData,
|
|
103
|
+
): VendorsGetVendorInvoiceDetailsQueryData | undefined {
|
|
104
|
+
const key = queryKeyVendorsGetVendorInvoiceDetails(...queryKeyBase);
|
|
105
|
+
|
|
106
|
+
return client.setQueryData<VendorsGetVendorInvoiceDetailsQueryData>(
|
|
107
|
+
key,
|
|
108
|
+
data,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function invalidateVendorsGetVendorInvoiceDetails(
|
|
113
|
+
client: QueryClient,
|
|
114
|
+
queryKeyBase: TupleToPrefixes<
|
|
115
|
+
[id: number, parameters: { expand?: Array<components.Expand> | undefined }]
|
|
116
|
+
>,
|
|
117
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
118
|
+
): Promise<void> {
|
|
119
|
+
return client.invalidateQueries({
|
|
120
|
+
...filters,
|
|
121
|
+
queryKey: [
|
|
122
|
+
"@greensecurity/javascript-sdk",
|
|
123
|
+
"vendors",
|
|
124
|
+
"getVendorInvoiceDetails",
|
|
125
|
+
...queryKeyBase,
|
|
126
|
+
],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function invalidateAllVendorsGetVendorInvoiceDetails(
|
|
131
|
+
client: QueryClient,
|
|
132
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
133
|
+
): Promise<void> {
|
|
134
|
+
return client.invalidateQueries({
|
|
135
|
+
...filters,
|
|
136
|
+
queryKey: [
|
|
137
|
+
"@greensecurity/javascript-sdk",
|
|
138
|
+
"vendors",
|
|
139
|
+
"getVendorInvoiceDetails",
|
|
140
|
+
],
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function buildVendorsGetVendorInvoiceDetailsQuery(
|
|
145
|
+
client$: GreenSecurityCore,
|
|
146
|
+
request: operations.GetVendorInvoiceDetailsRequest,
|
|
147
|
+
options?: RequestOptions,
|
|
148
|
+
): {
|
|
149
|
+
queryKey: QueryKey;
|
|
150
|
+
queryFn: (
|
|
151
|
+
context: QueryFunctionContext,
|
|
152
|
+
) => Promise<VendorsGetVendorInvoiceDetailsQueryData>;
|
|
153
|
+
} {
|
|
154
|
+
return {
|
|
155
|
+
queryKey: queryKeyVendorsGetVendorInvoiceDetails(request.id, {
|
|
156
|
+
expand: request.expand,
|
|
157
|
+
}),
|
|
158
|
+
queryFn: async function vendorsGetVendorInvoiceDetailsQueryFn(
|
|
159
|
+
ctx,
|
|
160
|
+
): Promise<VendorsGetVendorInvoiceDetailsQueryData> {
|
|
161
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
162
|
+
const mergedOptions = {
|
|
163
|
+
...options,
|
|
164
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
return unwrapAsync(vendorsGetVendorInvoiceDetails(
|
|
168
|
+
client$,
|
|
169
|
+
request,
|
|
170
|
+
mergedOptions,
|
|
171
|
+
));
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function queryKeyVendorsGetVendorInvoiceDetails(
|
|
177
|
+
id: number,
|
|
178
|
+
parameters: { expand?: Array<components.Expand> | undefined },
|
|
179
|
+
): QueryKey {
|
|
180
|
+
return [
|
|
181
|
+
"@greensecurity/javascript-sdk",
|
|
182
|
+
"vendors",
|
|
183
|
+
"getVendorInvoiceDetails",
|
|
184
|
+
id,
|
|
185
|
+
parameters,
|
|
186
|
+
];
|
|
187
|
+
}
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import { vendorsCreateVendorRegistration } from "../funcs/vendorsCreateVendorRegistration.js";
|
|
6
6
|
import { vendorsExpediteTimeRemaining } from "../funcs/vendorsExpediteTimeRemaining.js";
|
|
7
|
+
import { vendorsGetVendorInvoiceDetails } from "../funcs/vendorsGetVendorInvoiceDetails.js";
|
|
7
8
|
import { vendorsListVendorCredentials } from "../funcs/vendorsListVendorCredentials.js";
|
|
8
9
|
import { vendorsListVendorInvoices } from "../funcs/vendorsListVendorInvoices.js";
|
|
9
10
|
import { vendorsListVendorJobTitles } from "../funcs/vendorsListVendorJobTitles.js";
|
|
10
11
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import * as components from "../models/components/index.js";
|
|
11
13
|
import * as operations from "../models/operations/index.js";
|
|
12
14
|
import { unwrapAsync } from "../types/fp.js";
|
|
13
15
|
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
@@ -107,4 +109,26 @@ export class Vendors extends ClientSDK {
|
|
|
107
109
|
options,
|
|
108
110
|
));
|
|
109
111
|
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get vendor invoice details
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* Retrieve an individual vendor invoice detais.
|
|
118
|
+
*
|
|
119
|
+
* Available `expand` scopes are:
|
|
120
|
+
*
|
|
121
|
+
* invoice.line_items
|
|
122
|
+
* invoice.invoice_transactions
|
|
123
|
+
*/
|
|
124
|
+
async getVendorInvoiceDetails(
|
|
125
|
+
request: operations.GetVendorInvoiceDetailsRequest,
|
|
126
|
+
options?: RequestOptions,
|
|
127
|
+
): Promise<components.Invoice> {
|
|
128
|
+
return unwrapAsync(vendorsGetVendorInvoiceDetails(
|
|
129
|
+
this,
|
|
130
|
+
request,
|
|
131
|
+
options,
|
|
132
|
+
));
|
|
133
|
+
}
|
|
110
134
|
}
|