@greensecurity/javascript-sdk 0.30.23 → 0.30.27
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 +3103 -2872
- package/bin/mcp-server.js.map +25 -22
- package/dist/commonjs/__tests__/companies.test.d.ts +2 -0
- package/dist/commonjs/__tests__/companies.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/companies.test.js +51 -0
- package/dist/commonjs/__tests__/companies.test.js.map +1 -0
- package/dist/commonjs/__tests__/vendors.test.js +2 -2
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.d.ts +20 -0
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.js +155 -0
- package/dist/commonjs/funcs/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js +1 -0
- package/dist/commonjs/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/commonjs/funcs/vendorsListVendorInvoices.js +1 -1
- package/dist/commonjs/funcs/vendorsListVendorInvoices.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/matchers.d.ts +3 -1
- package/dist/commonjs/lib/matchers.d.ts.map +1 -1
- package/dist/commonjs/lib/matchers.js +12 -0
- package/dist/commonjs/lib/matchers.js.map +1 -1
- package/dist/commonjs/lib/sdks.js +7 -2
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.js +64 -0
- package/dist/commonjs/mcp-server/tools/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listorsearchcompanies.d.ts +111 -0
- package/dist/commonjs/models/operations/listorsearchcompanies.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listorsearchcompanies.js +153 -0
- package/dist/commonjs/models/operations/listorsearchcompanies.js.map +1 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts +5 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.js +4 -0
- package/dist/commonjs/models/operations/listvendorfacilitystatuses.js.map +1 -1
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts +57 -27
- package/dist/commonjs/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listvendorinvoices.js +31 -21
- package/dist/commonjs/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.d.ts +78 -0
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.js +161 -0
- package/dist/commonjs/react-query/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js +2 -0
- package/dist/commonjs/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts +3 -3
- package/dist/commonjs/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsListVendorInvoices.js +2 -2
- package/dist/commonjs/react-query/vendorsListVendorInvoices.js.map +1 -1
- package/dist/commonjs/sdk/companies.d.ts +15 -0
- package/dist/commonjs/sdk/companies.d.ts.map +1 -0
- package/dist/commonjs/sdk/companies.js +22 -0
- package/dist/commonjs/sdk/companies.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/__tests__/companies.test.d.ts +2 -0
- package/dist/esm/__tests__/companies.test.d.ts.map +1 -0
- package/dist/esm/__tests__/companies.test.js +49 -0
- package/dist/esm/__tests__/companies.test.js.map +1 -0
- package/dist/esm/__tests__/vendors.test.js +2 -2
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/funcs/companiesListOrSearchCompanies.d.ts +20 -0
- package/dist/esm/funcs/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/esm/funcs/companiesListOrSearchCompanies.js +119 -0
- package/dist/esm/funcs/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js +1 -0
- package/dist/esm/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/esm/funcs/vendorsListVendorInvoices.js +1 -1
- package/dist/esm/funcs/vendorsListVendorInvoices.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/matchers.d.ts +3 -1
- package/dist/esm/lib/matchers.d.ts.map +1 -1
- package/dist/esm/lib/matchers.js +10 -0
- package/dist/esm/lib/matchers.js.map +1 -1
- package/dist/esm/lib/sdks.js +7 -2
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.d.ts +8 -0
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.js +28 -0
- package/dist/esm/mcp-server/tools/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listorsearchcompanies.d.ts +111 -0
- package/dist/esm/models/operations/listorsearchcompanies.d.ts.map +1 -0
- package/dist/esm/models/operations/listorsearchcompanies.js +111 -0
- package/dist/esm/models/operations/listorsearchcompanies.js.map +1 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts +5 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorfacilitystatuses.js +4 -0
- package/dist/esm/models/operations/listvendorfacilitystatuses.js.map +1 -1
- package/dist/esm/models/operations/listvendorinvoices.d.ts +57 -27
- package/dist/esm/models/operations/listvendorinvoices.d.ts.map +1 -1
- package/dist/esm/models/operations/listvendorinvoices.js +30 -20
- package/dist/esm/models/operations/listvendorinvoices.js.map +1 -1
- package/dist/esm/react-query/companiesListOrSearchCompanies.d.ts +78 -0
- package/dist/esm/react-query/companiesListOrSearchCompanies.d.ts.map +1 -0
- package/dist/esm/react-query/companiesListOrSearchCompanies.js +148 -0
- package/dist/esm/react-query/companiesListOrSearchCompanies.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js +2 -0
- package/dist/esm/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/dist/esm/react-query/vendorsListVendorInvoices.d.ts +3 -3
- package/dist/esm/react-query/vendorsListVendorInvoices.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsListVendorInvoices.js +2 -2
- package/dist/esm/react-query/vendorsListVendorInvoices.js.map +1 -1
- package/dist/esm/sdk/companies.d.ts +15 -0
- package/dist/esm/sdk/companies.d.ts.map +1 -0
- package/dist/esm/sdk/companies.js +18 -0
- package/dist/esm/sdk/companies.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/companies.test.ts +52 -0
- package/src/__tests__/vendors.test.ts +2 -2
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/funcs/companiesListOrSearchCompanies.ts +246 -0
- package/src/funcs/vendorsListVendorFacilityStatuses.ts +1 -0
- package/src/funcs/vendorsListVendorInvoices.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/matchers.ts +20 -0
- package/src/lib/sdks.ts +8 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/companiesListOrSearchCompanies.ts +38 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listorsearchcompanies.ts +264 -0
- package/src/models/operations/listvendorfacilitystatuses.ts +9 -0
- package/src/models/operations/listvendorinvoices.ts +37 -27
- package/src/react-query/companiesListOrSearchCompanies.ts +345 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/vendorsListVendorFacilityStatuses.ts +5 -0
- package/src/react-query/vendorsListVendorInvoices.ts +5 -5
- package/src/sdk/companies.ts +29 -0
- package/src/sdk/sdk.ts +6 -0
package/src/mcp-server/server.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "./resources.js";
|
|
14
14
|
import { MCPScope } from "./scopes.js";
|
|
15
15
|
import { createRegisterTool } from "./tools.js";
|
|
16
|
+
import { tool$companiesListOrSearchCompanies } from "./tools/companiesListOrSearchCompanies.js";
|
|
16
17
|
import { tool$organizationsGetFacility } from "./tools/organizationsGetFacility.js";
|
|
17
18
|
import { tool$organizationsListOrSearchFacilities } from "./tools/organizationsListOrSearchFacilities.js";
|
|
18
19
|
import { tool$supportArticlesGetSupportArticle } from "./tools/supportArticlesGetSupportArticle.js";
|
|
@@ -57,7 +58,7 @@ export function createMCPServer(deps: {
|
|
|
57
58
|
}) {
|
|
58
59
|
const server = new McpServer({
|
|
59
60
|
name: "GreenSecurity",
|
|
60
|
-
version: "0.30.
|
|
61
|
+
version: "0.30.27",
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
const client = new GreenSecurityCore({
|
|
@@ -120,6 +121,7 @@ export function createMCPServer(deps: {
|
|
|
120
121
|
tool(tool$webhooksListAllWebhookEndpoints);
|
|
121
122
|
tool(tool$webhooksGetWebhookEndpoint);
|
|
122
123
|
tool(tool$vendorScansVendorScanOut);
|
|
124
|
+
tool(tool$companiesListOrSearchCompanies);
|
|
123
125
|
|
|
124
126
|
return server;
|
|
125
127
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { companiesListOrSearchCompanies } from "../../funcs/companiesListOrSearchCompanies.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListOrSearchCompaniesRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$companiesListOrSearchCompanies: ToolDefinition<typeof args> =
|
|
14
|
+
{
|
|
15
|
+
name: "companies-list-or-search-companies",
|
|
16
|
+
description: `List or search companies
|
|
17
|
+
|
|
18
|
+
List or search companies.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await companiesListOrSearchCompanies(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -14,6 +14,7 @@ export * from "./getvendorinvoicedetails.js";
|
|
|
14
14
|
export * from "./getvendorsdetails.js";
|
|
15
15
|
export * from "./getwebhookendpoint.js";
|
|
16
16
|
export * from "./listallwebhookendpoints.js";
|
|
17
|
+
export * from "./listorsearchcompanies.js";
|
|
17
18
|
export * from "./listorsearchfacilities.js";
|
|
18
19
|
export * from "./listorsearchsupportarticles.js";
|
|
19
20
|
export * from "./listvendoradditionalfacilityfields.js";
|
|
@@ -0,0 +1,264 @@
|
|
|
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 ListOrSearchCompaniesRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* A comma-separated list of object attributes to sort on.
|
|
15
|
+
*/
|
|
16
|
+
sort?: string | null | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Sort desc
|
|
19
|
+
*/
|
|
20
|
+
desc?: components.Desc | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* A 1-based offset for which page to request (defaults to 1)
|
|
23
|
+
*/
|
|
24
|
+
page?: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Number of items to show in a given page
|
|
27
|
+
*/
|
|
28
|
+
itemsPerPage?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* A partial string to search in the object name. Do not include any wildcard characters. Searches are not case-sensitive by default.
|
|
31
|
+
*/
|
|
32
|
+
nameLike?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The request was successful, and the server has returned the requested resource in the response body.
|
|
37
|
+
*/
|
|
38
|
+
export type ListOrSearchCompaniesListOrSearchCompaniesOK = {
|
|
39
|
+
/**
|
|
40
|
+
* Pagination information for a pageable list
|
|
41
|
+
*/
|
|
42
|
+
pager: components.Pager;
|
|
43
|
+
items: Array<components.Company | null>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ListOrSearchCompaniesResponse = {
|
|
47
|
+
result: ListOrSearchCompaniesListOrSearchCompaniesOK;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const ListOrSearchCompaniesRequest$inboundSchema: z.ZodType<
|
|
52
|
+
ListOrSearchCompaniesRequest,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
unknown
|
|
55
|
+
> = z.object({
|
|
56
|
+
sort: z.nullable(z.string()).optional(),
|
|
57
|
+
desc: components.Desc$inboundSchema.optional(),
|
|
58
|
+
page: z.number().int().optional(),
|
|
59
|
+
items_per_page: z.number().int().optional(),
|
|
60
|
+
name_like: z.string().optional(),
|
|
61
|
+
}).transform((v) => {
|
|
62
|
+
return remap$(v, {
|
|
63
|
+
"items_per_page": "itemsPerPage",
|
|
64
|
+
"name_like": "nameLike",
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type ListOrSearchCompaniesRequest$Outbound = {
|
|
70
|
+
sort?: string | null | undefined;
|
|
71
|
+
desc?: components.Desc$Outbound | undefined;
|
|
72
|
+
page?: number | undefined;
|
|
73
|
+
items_per_page?: number | undefined;
|
|
74
|
+
name_like?: string | undefined;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const ListOrSearchCompaniesRequest$outboundSchema: z.ZodType<
|
|
79
|
+
ListOrSearchCompaniesRequest$Outbound,
|
|
80
|
+
z.ZodTypeDef,
|
|
81
|
+
ListOrSearchCompaniesRequest
|
|
82
|
+
> = z.object({
|
|
83
|
+
sort: z.nullable(z.string()).optional(),
|
|
84
|
+
desc: components.Desc$outboundSchema.optional(),
|
|
85
|
+
page: z.number().int().optional(),
|
|
86
|
+
itemsPerPage: z.number().int().optional(),
|
|
87
|
+
nameLike: z.string().optional(),
|
|
88
|
+
}).transform((v) => {
|
|
89
|
+
return remap$(v, {
|
|
90
|
+
itemsPerPage: "items_per_page",
|
|
91
|
+
nameLike: "name_like",
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
98
|
+
*/
|
|
99
|
+
export namespace ListOrSearchCompaniesRequest$ {
|
|
100
|
+
/** @deprecated use `ListOrSearchCompaniesRequest$inboundSchema` instead. */
|
|
101
|
+
export const inboundSchema = ListOrSearchCompaniesRequest$inboundSchema;
|
|
102
|
+
/** @deprecated use `ListOrSearchCompaniesRequest$outboundSchema` instead. */
|
|
103
|
+
export const outboundSchema = ListOrSearchCompaniesRequest$outboundSchema;
|
|
104
|
+
/** @deprecated use `ListOrSearchCompaniesRequest$Outbound` instead. */
|
|
105
|
+
export type Outbound = ListOrSearchCompaniesRequest$Outbound;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function listOrSearchCompaniesRequestToJSON(
|
|
109
|
+
listOrSearchCompaniesRequest: ListOrSearchCompaniesRequest,
|
|
110
|
+
): string {
|
|
111
|
+
return JSON.stringify(
|
|
112
|
+
ListOrSearchCompaniesRequest$outboundSchema.parse(
|
|
113
|
+
listOrSearchCompaniesRequest,
|
|
114
|
+
),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function listOrSearchCompaniesRequestFromJSON(
|
|
119
|
+
jsonString: string,
|
|
120
|
+
): SafeParseResult<ListOrSearchCompaniesRequest, SDKValidationError> {
|
|
121
|
+
return safeParse(
|
|
122
|
+
jsonString,
|
|
123
|
+
(x) => ListOrSearchCompaniesRequest$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'ListOrSearchCompaniesRequest' from JSON`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** @internal */
|
|
129
|
+
export const ListOrSearchCompaniesListOrSearchCompaniesOK$inboundSchema:
|
|
130
|
+
z.ZodType<
|
|
131
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK,
|
|
132
|
+
z.ZodTypeDef,
|
|
133
|
+
unknown
|
|
134
|
+
> = z.object({
|
|
135
|
+
pager: components.Pager$inboundSchema,
|
|
136
|
+
items: z.array(z.nullable(components.Company$inboundSchema)),
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
/** @internal */
|
|
140
|
+
export type ListOrSearchCompaniesListOrSearchCompaniesOK$Outbound = {
|
|
141
|
+
pager: components.Pager$Outbound;
|
|
142
|
+
items: Array<components.Company$Outbound | null>;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/** @internal */
|
|
146
|
+
export const ListOrSearchCompaniesListOrSearchCompaniesOK$outboundSchema:
|
|
147
|
+
z.ZodType<
|
|
148
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK$Outbound,
|
|
149
|
+
z.ZodTypeDef,
|
|
150
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK
|
|
151
|
+
> = z.object({
|
|
152
|
+
pager: components.Pager$outboundSchema,
|
|
153
|
+
items: z.array(z.nullable(components.Company$outboundSchema)),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @internal
|
|
158
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
159
|
+
*/
|
|
160
|
+
export namespace ListOrSearchCompaniesListOrSearchCompaniesOK$ {
|
|
161
|
+
/** @deprecated use `ListOrSearchCompaniesListOrSearchCompaniesOK$inboundSchema` instead. */
|
|
162
|
+
export const inboundSchema =
|
|
163
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK$inboundSchema;
|
|
164
|
+
/** @deprecated use `ListOrSearchCompaniesListOrSearchCompaniesOK$outboundSchema` instead. */
|
|
165
|
+
export const outboundSchema =
|
|
166
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK$outboundSchema;
|
|
167
|
+
/** @deprecated use `ListOrSearchCompaniesListOrSearchCompaniesOK$Outbound` instead. */
|
|
168
|
+
export type Outbound = ListOrSearchCompaniesListOrSearchCompaniesOK$Outbound;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function listOrSearchCompaniesListOrSearchCompaniesOKToJSON(
|
|
172
|
+
listOrSearchCompaniesListOrSearchCompaniesOK:
|
|
173
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK,
|
|
174
|
+
): string {
|
|
175
|
+
return JSON.stringify(
|
|
176
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK$outboundSchema.parse(
|
|
177
|
+
listOrSearchCompaniesListOrSearchCompaniesOK,
|
|
178
|
+
),
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function listOrSearchCompaniesListOrSearchCompaniesOKFromJSON(
|
|
183
|
+
jsonString: string,
|
|
184
|
+
): SafeParseResult<
|
|
185
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK,
|
|
186
|
+
SDKValidationError
|
|
187
|
+
> {
|
|
188
|
+
return safeParse(
|
|
189
|
+
jsonString,
|
|
190
|
+
(x) =>
|
|
191
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK$inboundSchema.parse(
|
|
192
|
+
JSON.parse(x),
|
|
193
|
+
),
|
|
194
|
+
`Failed to parse 'ListOrSearchCompaniesListOrSearchCompaniesOK' from JSON`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** @internal */
|
|
199
|
+
export const ListOrSearchCompaniesResponse$inboundSchema: z.ZodType<
|
|
200
|
+
ListOrSearchCompaniesResponse,
|
|
201
|
+
z.ZodTypeDef,
|
|
202
|
+
unknown
|
|
203
|
+
> = z.object({
|
|
204
|
+
Result: z.lazy(() =>
|
|
205
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK$inboundSchema
|
|
206
|
+
),
|
|
207
|
+
}).transform((v) => {
|
|
208
|
+
return remap$(v, {
|
|
209
|
+
"Result": "result",
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
/** @internal */
|
|
214
|
+
export type ListOrSearchCompaniesResponse$Outbound = {
|
|
215
|
+
Result: ListOrSearchCompaniesListOrSearchCompaniesOK$Outbound;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/** @internal */
|
|
219
|
+
export const ListOrSearchCompaniesResponse$outboundSchema: z.ZodType<
|
|
220
|
+
ListOrSearchCompaniesResponse$Outbound,
|
|
221
|
+
z.ZodTypeDef,
|
|
222
|
+
ListOrSearchCompaniesResponse
|
|
223
|
+
> = z.object({
|
|
224
|
+
result: z.lazy(() =>
|
|
225
|
+
ListOrSearchCompaniesListOrSearchCompaniesOK$outboundSchema
|
|
226
|
+
),
|
|
227
|
+
}).transform((v) => {
|
|
228
|
+
return remap$(v, {
|
|
229
|
+
result: "Result",
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @internal
|
|
235
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
236
|
+
*/
|
|
237
|
+
export namespace ListOrSearchCompaniesResponse$ {
|
|
238
|
+
/** @deprecated use `ListOrSearchCompaniesResponse$inboundSchema` instead. */
|
|
239
|
+
export const inboundSchema = ListOrSearchCompaniesResponse$inboundSchema;
|
|
240
|
+
/** @deprecated use `ListOrSearchCompaniesResponse$outboundSchema` instead. */
|
|
241
|
+
export const outboundSchema = ListOrSearchCompaniesResponse$outboundSchema;
|
|
242
|
+
/** @deprecated use `ListOrSearchCompaniesResponse$Outbound` instead. */
|
|
243
|
+
export type Outbound = ListOrSearchCompaniesResponse$Outbound;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function listOrSearchCompaniesResponseToJSON(
|
|
247
|
+
listOrSearchCompaniesResponse: ListOrSearchCompaniesResponse,
|
|
248
|
+
): string {
|
|
249
|
+
return JSON.stringify(
|
|
250
|
+
ListOrSearchCompaniesResponse$outboundSchema.parse(
|
|
251
|
+
listOrSearchCompaniesResponse,
|
|
252
|
+
),
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function listOrSearchCompaniesResponseFromJSON(
|
|
257
|
+
jsonString: string,
|
|
258
|
+
): SafeParseResult<ListOrSearchCompaniesResponse, SDKValidationError> {
|
|
259
|
+
return safeParse(
|
|
260
|
+
jsonString,
|
|
261
|
+
(x) => ListOrSearchCompaniesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
262
|
+
`Failed to parse 'ListOrSearchCompaniesResponse' from JSON`,
|
|
263
|
+
);
|
|
264
|
+
}
|
|
@@ -30,6 +30,10 @@ export type ListVendorFacilityStatusesRequest = {
|
|
|
30
30
|
* Search for objects in the same scan_type as the search string
|
|
31
31
|
*/
|
|
32
32
|
scanType?: components.ScanType | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* A partial string to search in the facility name. Do not include any wildcard characters. Searches are not case-sensitive by default.
|
|
35
|
+
*/
|
|
36
|
+
facilityNameLike?: string | undefined;
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
/**
|
|
@@ -58,10 +62,12 @@ export const ListVendorFacilityStatusesRequest$inboundSchema: z.ZodType<
|
|
|
58
62
|
page: z.number().int().optional(),
|
|
59
63
|
items_per_page: z.number().int().optional(),
|
|
60
64
|
scan_type: components.ScanType$inboundSchema.optional(),
|
|
65
|
+
facility_name_like: z.string().optional(),
|
|
61
66
|
}).transform((v) => {
|
|
62
67
|
return remap$(v, {
|
|
63
68
|
"items_per_page": "itemsPerPage",
|
|
64
69
|
"scan_type": "scanType",
|
|
70
|
+
"facility_name_like": "facilityNameLike",
|
|
65
71
|
});
|
|
66
72
|
});
|
|
67
73
|
|
|
@@ -72,6 +78,7 @@ export type ListVendorFacilityStatusesRequest$Outbound = {
|
|
|
72
78
|
page?: number | undefined;
|
|
73
79
|
items_per_page?: number | undefined;
|
|
74
80
|
scan_type?: string | undefined;
|
|
81
|
+
facility_name_like?: string | undefined;
|
|
75
82
|
};
|
|
76
83
|
|
|
77
84
|
/** @internal */
|
|
@@ -85,10 +92,12 @@ export const ListVendorFacilityStatusesRequest$outboundSchema: z.ZodType<
|
|
|
85
92
|
page: z.number().int().optional(),
|
|
86
93
|
itemsPerPage: z.number().int().optional(),
|
|
87
94
|
scanType: components.ScanType$outboundSchema.optional(),
|
|
95
|
+
facilityNameLike: z.string().optional(),
|
|
88
96
|
}).transform((v) => {
|
|
89
97
|
return remap$(v, {
|
|
90
98
|
itemsPerPage: "items_per_page",
|
|
91
99
|
scanType: "scan_type",
|
|
100
|
+
facilityNameLike: "facility_name_like",
|
|
92
101
|
});
|
|
93
102
|
});
|
|
94
103
|
|
|
@@ -11,20 +11,30 @@ import * as components from "../components/index.js";
|
|
|
11
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Filter invoices by
|
|
14
|
+
* Filter invoices by financial_status
|
|
15
15
|
*/
|
|
16
|
-
export const
|
|
17
|
-
Cart: "cart",
|
|
16
|
+
export const InvoiceFinancialStatus = {
|
|
18
17
|
Pending: "pending",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
Authorized: "authorized",
|
|
19
|
+
Captured: "captured",
|
|
20
|
+
Refunded: "refunded",
|
|
21
|
+
RefundedToCredits: "refunded to credits",
|
|
22
|
+
Voided: "voided",
|
|
23
|
+
Waived: "waived",
|
|
24
|
+
Overdue: "overdue",
|
|
25
|
+
Paid: "paid",
|
|
26
|
+
PaidByCredits: "paid by credits",
|
|
27
|
+
PaidByCreditCard: "paid by credit card",
|
|
28
|
+
PaidByCheck: "paid by check",
|
|
29
|
+
PaidByShareback: "paid by shareback",
|
|
30
|
+
PaidByPo: "paid by po",
|
|
31
|
+
PaidByOtherMeans: "paid by other means",
|
|
32
|
+
Credited: "credited",
|
|
23
33
|
} as const;
|
|
24
34
|
/**
|
|
25
|
-
* Filter invoices by
|
|
35
|
+
* Filter invoices by financial_status
|
|
26
36
|
*/
|
|
27
|
-
export type
|
|
37
|
+
export type InvoiceFinancialStatus = ClosedEnum<typeof InvoiceFinancialStatus>;
|
|
28
38
|
|
|
29
39
|
export type ListVendorInvoicesRequest = {
|
|
30
40
|
/**
|
|
@@ -56,9 +66,9 @@ export type ListVendorInvoicesRequest = {
|
|
|
56
66
|
*/
|
|
57
67
|
invoiceNumber?: string | undefined;
|
|
58
68
|
/**
|
|
59
|
-
* Filter invoices by
|
|
69
|
+
* Filter invoices by financial_status
|
|
60
70
|
*/
|
|
61
|
-
|
|
71
|
+
invoiceFinancialStatus?: InvoiceFinancialStatus | undefined;
|
|
62
72
|
};
|
|
63
73
|
|
|
64
74
|
/**
|
|
@@ -77,24 +87,24 @@ export type ListVendorInvoicesResponse = {
|
|
|
77
87
|
};
|
|
78
88
|
|
|
79
89
|
/** @internal */
|
|
80
|
-
export const
|
|
81
|
-
typeof
|
|
82
|
-
> = z.nativeEnum(
|
|
90
|
+
export const InvoiceFinancialStatus$inboundSchema: z.ZodNativeEnum<
|
|
91
|
+
typeof InvoiceFinancialStatus
|
|
92
|
+
> = z.nativeEnum(InvoiceFinancialStatus);
|
|
83
93
|
|
|
84
94
|
/** @internal */
|
|
85
|
-
export const
|
|
86
|
-
typeof
|
|
87
|
-
> =
|
|
95
|
+
export const InvoiceFinancialStatus$outboundSchema: z.ZodNativeEnum<
|
|
96
|
+
typeof InvoiceFinancialStatus
|
|
97
|
+
> = InvoiceFinancialStatus$inboundSchema;
|
|
88
98
|
|
|
89
99
|
/**
|
|
90
100
|
* @internal
|
|
91
101
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
92
102
|
*/
|
|
93
|
-
export namespace
|
|
94
|
-
/** @deprecated use `
|
|
95
|
-
export const inboundSchema =
|
|
96
|
-
/** @deprecated use `
|
|
97
|
-
export const outboundSchema =
|
|
103
|
+
export namespace InvoiceFinancialStatus$ {
|
|
104
|
+
/** @deprecated use `InvoiceFinancialStatus$inboundSchema` instead. */
|
|
105
|
+
export const inboundSchema = InvoiceFinancialStatus$inboundSchema;
|
|
106
|
+
/** @deprecated use `InvoiceFinancialStatus$outboundSchema` instead. */
|
|
107
|
+
export const outboundSchema = InvoiceFinancialStatus$outboundSchema;
|
|
98
108
|
}
|
|
99
109
|
|
|
100
110
|
/** @internal */
|
|
@@ -110,13 +120,13 @@ export const ListVendorInvoicesRequest$inboundSchema: z.ZodType<
|
|
|
110
120
|
expand: z.array(components.Expand$inboundSchema).optional(),
|
|
111
121
|
vendor_id_or_me: z.string(),
|
|
112
122
|
invoice_number: z.string().optional(),
|
|
113
|
-
|
|
123
|
+
invoice_financial_status: InvoiceFinancialStatus$inboundSchema.optional(),
|
|
114
124
|
}).transform((v) => {
|
|
115
125
|
return remap$(v, {
|
|
116
126
|
"items_per_page": "itemsPerPage",
|
|
117
127
|
"vendor_id_or_me": "vendorIdOrMe",
|
|
118
128
|
"invoice_number": "invoiceNumber",
|
|
119
|
-
"
|
|
129
|
+
"invoice_financial_status": "invoiceFinancialStatus",
|
|
120
130
|
});
|
|
121
131
|
});
|
|
122
132
|
|
|
@@ -129,7 +139,7 @@ export type ListVendorInvoicesRequest$Outbound = {
|
|
|
129
139
|
expand?: Array<string> | undefined;
|
|
130
140
|
vendor_id_or_me: string;
|
|
131
141
|
invoice_number?: string | undefined;
|
|
132
|
-
|
|
142
|
+
invoice_financial_status?: string | undefined;
|
|
133
143
|
};
|
|
134
144
|
|
|
135
145
|
/** @internal */
|
|
@@ -145,13 +155,13 @@ export const ListVendorInvoicesRequest$outboundSchema: z.ZodType<
|
|
|
145
155
|
expand: z.array(components.Expand$outboundSchema).optional(),
|
|
146
156
|
vendorIdOrMe: z.string(),
|
|
147
157
|
invoiceNumber: z.string().optional(),
|
|
148
|
-
|
|
158
|
+
invoiceFinancialStatus: InvoiceFinancialStatus$outboundSchema.optional(),
|
|
149
159
|
}).transform((v) => {
|
|
150
160
|
return remap$(v, {
|
|
151
161
|
itemsPerPage: "items_per_page",
|
|
152
162
|
vendorIdOrMe: "vendor_id_or_me",
|
|
153
163
|
invoiceNumber: "invoice_number",
|
|
154
|
-
|
|
164
|
+
invoiceFinancialStatus: "invoice_financial_status",
|
|
155
165
|
});
|
|
156
166
|
});
|
|
157
167
|
|