@greensecurity/javascript-sdk 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/REACT_QUERY.md +68 -30
  2. package/README.md +43 -0
  3. package/bin/mcp-server.js +731 -52
  4. package/bin/mcp-server.js.map +29 -19
  5. package/funcs/organizationsListOrSearchFacilities.d.ts +4 -1
  6. package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
  7. package/funcs/organizationsListOrSearchFacilities.js +46 -9
  8. package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  9. package/funcs/supportArticlesGetSupportArticle.js +1 -1
  10. package/funcs/supportArticlesGetSupportArticle.js.map +1 -1
  11. package/funcs/supportArticlesListOrSearchSupportArticles.d.ts +4 -1
  12. package/funcs/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -1
  13. package/funcs/supportArticlesListOrSearchSupportArticles.js +42 -7
  14. package/funcs/supportArticlesListOrSearchSupportArticles.js.map +1 -1
  15. package/funcs/vendorsExpediteTimeRemaining.d.ts +17 -0
  16. package/funcs/vendorsExpediteTimeRemaining.d.ts.map +1 -0
  17. package/funcs/vendorsExpediteTimeRemaining.js +120 -0
  18. package/funcs/vendorsExpediteTimeRemaining.js.map +1 -0
  19. package/funcs/vendorsListVendorInvoices.d.ts +24 -0
  20. package/funcs/vendorsListVendorInvoices.d.ts.map +1 -0
  21. package/funcs/vendorsListVendorInvoices.js +166 -0
  22. package/funcs/vendorsListVendorInvoices.js.map +1 -0
  23. package/funcs/vendorsListVendorJobTitles.d.ts +4 -1
  24. package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
  25. package/funcs/vendorsListVendorJobTitles.js +39 -6
  26. package/funcs/vendorsListVendorJobTitles.js.map +1 -1
  27. package/jsr.json +1 -1
  28. package/lib/config.d.ts +3 -3
  29. package/lib/config.js +3 -3
  30. package/mcp-server/extensions.d.ts +9 -0
  31. package/mcp-server/extensions.d.ts.map +1 -0
  32. package/mcp-server/extensions.js +6 -0
  33. package/mcp-server/extensions.js.map +1 -0
  34. package/mcp-server/mcp-server.js +1 -1
  35. package/mcp-server/resources.d.ts +9 -4
  36. package/mcp-server/resources.d.ts.map +1 -1
  37. package/mcp-server/resources.js +36 -9
  38. package/mcp-server/resources.js.map +1 -1
  39. package/mcp-server/server.d.ts.map +1 -1
  40. package/mcp-server/server.js +10 -1
  41. package/mcp-server/server.js.map +1 -1
  42. package/mcp-server/tools/organizationsListOrSearchFacilities.js +1 -1
  43. package/mcp-server/tools/organizationsListOrSearchFacilities.js.map +1 -1
  44. package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js +1 -1
  45. package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js.map +1 -1
  46. package/mcp-server/tools/vendorsExpediteTimeRemaining.d.ts +8 -0
  47. package/mcp-server/tools/vendorsExpediteTimeRemaining.d.ts.map +1 -0
  48. package/mcp-server/tools/vendorsExpediteTimeRemaining.js +64 -0
  49. package/mcp-server/tools/vendorsExpediteTimeRemaining.js.map +1 -0
  50. package/mcp-server/tools/vendorsListVendorInvoices.d.ts +8 -0
  51. package/mcp-server/tools/vendorsListVendorInvoices.d.ts.map +1 -0
  52. package/mcp-server/tools/vendorsListVendorInvoices.js +68 -0
  53. package/mcp-server/tools/vendorsListVendorInvoices.js.map +1 -0
  54. package/mcp-server/tools/vendorsListVendorJobTitles.js +1 -1
  55. package/mcp-server/tools/vendorsListVendorJobTitles.js.map +1 -1
  56. package/models/components/expand.d.ts +3 -0
  57. package/models/components/expand.d.ts.map +1 -1
  58. package/models/components/expand.js +1 -0
  59. package/models/components/expand.js.map +1 -1
  60. package/models/components/index.d.ts +2 -0
  61. package/models/components/index.d.ts.map +1 -1
  62. package/models/components/index.js +2 -0
  63. package/models/components/index.js.map +1 -1
  64. package/models/components/invoice.d.ts +43 -0
  65. package/models/components/invoice.d.ts.map +1 -0
  66. package/models/components/invoice.js +91 -0
  67. package/models/components/invoice.js.map +1 -0
  68. package/models/components/invoiceitem.d.ts +40 -0
  69. package/models/components/invoiceitem.d.ts.map +1 -0
  70. package/models/components/invoiceitem.js +94 -0
  71. package/models/components/invoiceitem.js.map +1 -0
  72. package/models/operations/expeditetimeremaining.d.ts +60 -0
  73. package/models/operations/expeditetimeremaining.d.ts.map +1 -0
  74. package/models/operations/expeditetimeremaining.js +113 -0
  75. package/models/operations/expeditetimeremaining.js.map +1 -0
  76. package/models/operations/index.d.ts +2 -0
  77. package/models/operations/index.d.ts.map +1 -1
  78. package/models/operations/index.js +2 -0
  79. package/models/operations/index.js.map +1 -1
  80. package/models/operations/listorsearchfacilities.d.ts +25 -0
  81. package/models/operations/listorsearchfacilities.d.ts.map +1 -1
  82. package/models/operations/listorsearchfacilities.js +36 -1
  83. package/models/operations/listorsearchfacilities.js.map +1 -1
  84. package/models/operations/listorsearchsupportarticles.d.ts +25 -0
  85. package/models/operations/listorsearchsupportarticles.d.ts.map +1 -1
  86. package/models/operations/listorsearchsupportarticles.js +36 -1
  87. package/models/operations/listorsearchsupportarticles.js.map +1 -1
  88. package/models/operations/listvendorinvoices.d.ts +116 -0
  89. package/models/operations/listvendorinvoices.d.ts.map +1 -0
  90. package/models/operations/listvendorinvoices.js +155 -0
  91. package/models/operations/listvendorinvoices.js.map +1 -0
  92. package/models/operations/listvendorjobtitles.d.ts +25 -0
  93. package/models/operations/listvendorjobtitles.d.ts.map +1 -1
  94. package/models/operations/listvendorjobtitles.js +36 -1
  95. package/models/operations/listvendorjobtitles.js.map +1 -1
  96. package/package.json +1 -1
  97. package/react-query/index.d.ts +2 -0
  98. package/react-query/index.d.ts.map +1 -1
  99. package/react-query/index.js +2 -0
  100. package/react-query/index.js.map +1 -1
  101. package/react-query/organizationsListOrSearchFacilities.d.ts +54 -3
  102. package/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
  103. package/react-query/organizationsListOrSearchFacilities.js +89 -0
  104. package/react-query/organizationsListOrSearchFacilities.js.map +1 -1
  105. package/react-query/supportArticlesListOrSearchSupportArticles.d.ts +28 -3
  106. package/react-query/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -1
  107. package/react-query/supportArticlesListOrSearchSupportArticles.js +58 -0
  108. package/react-query/supportArticlesListOrSearchSupportArticles.js.map +1 -1
  109. package/react-query/vendorsExpediteTimeRemaining.d.ts +30 -0
  110. package/react-query/vendorsExpediteTimeRemaining.d.ts.map +1 -0
  111. package/react-query/vendorsExpediteTimeRemaining.js +96 -0
  112. package/react-query/vendorsExpediteTimeRemaining.js.map +1 -0
  113. package/react-query/vendorsListVendorInvoices.d.ts +96 -0
  114. package/react-query/vendorsListVendorInvoices.d.ts.map +1 -0
  115. package/react-query/vendorsListVendorInvoices.js +178 -0
  116. package/react-query/vendorsListVendorInvoices.js.map +1 -0
  117. package/react-query/vendorsListVendorJobTitles.d.ts +28 -3
  118. package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -1
  119. package/react-query/vendorsListVendorJobTitles.js +59 -0
  120. package/react-query/vendorsListVendorJobTitles.js.map +1 -1
  121. package/sdk/organizations.d.ts +4 -1
  122. package/sdk/organizations.d.ts.map +1 -1
  123. package/sdk/organizations.js +2 -1
  124. package/sdk/organizations.js.map +1 -1
  125. package/sdk/supportarticles.d.ts +4 -1
  126. package/sdk/supportarticles.d.ts.map +1 -1
  127. package/sdk/supportarticles.js +2 -1
  128. package/sdk/supportarticles.js.map +1 -1
  129. package/sdk/vendors.d.ts +24 -1
  130. package/sdk/vendors.d.ts.map +1 -1
  131. package/sdk/vendors.js +26 -1
  132. package/sdk/vendors.js.map +1 -1
  133. package/src/__tests__/supportarticles.test.ts +2 -1
  134. package/src/__tests__/vendors.test.ts +58 -1
  135. package/src/funcs/organizationsListOrSearchFacilities.ts +116 -42
  136. package/src/funcs/supportArticlesGetSupportArticle.ts +1 -1
  137. package/src/funcs/supportArticlesListOrSearchSupportArticles.ts +100 -31
  138. package/src/funcs/vendorsExpediteTimeRemaining.ts +171 -0
  139. package/src/funcs/vendorsListVendorInvoices.ts +255 -0
  140. package/src/funcs/vendorsListVendorJobTitles.ts +101 -33
  141. package/src/lib/config.ts +3 -3
  142. package/src/mcp-server/extensions.ts +13 -0
  143. package/src/mcp-server/mcp-server.ts +1 -1
  144. package/src/mcp-server/resources.ts +75 -14
  145. package/src/mcp-server/server.ts +20 -1
  146. package/src/mcp-server/tools/organizationsListOrSearchFacilities.ts +1 -1
  147. package/src/mcp-server/tools/supportArticlesListOrSearchSupportArticles.ts +1 -1
  148. package/src/mcp-server/tools/vendorsExpediteTimeRemaining.ts +37 -0
  149. package/src/mcp-server/tools/vendorsListVendorInvoices.ts +41 -0
  150. package/src/mcp-server/tools/vendorsListVendorJobTitles.ts +1 -1
  151. package/src/models/components/expand.ts +1 -0
  152. package/src/models/components/index.ts +2 -0
  153. package/src/models/components/invoice.ts +99 -0
  154. package/src/models/components/invoiceitem.ts +98 -0
  155. package/src/models/operations/expeditetimeremaining.ts +152 -0
  156. package/src/models/operations/index.ts +2 -0
  157. package/src/models/operations/listorsearchfacilities.ts +72 -0
  158. package/src/models/operations/listorsearchsupportarticles.ts +75 -0
  159. package/src/models/operations/listvendorinvoices.ts +252 -0
  160. package/src/models/operations/listvendorjobtitles.ts +68 -0
  161. package/src/react-query/index.ts +2 -0
  162. package/src/react-query/organizationsListOrSearchFacilities.ts +179 -1
  163. package/src/react-query/supportArticlesListOrSearchSupportArticles.ts +149 -1
  164. package/src/react-query/vendorsExpediteTimeRemaining.ts +165 -0
  165. package/src/react-query/vendorsListVendorInvoices.ts +364 -0
  166. package/src/react-query/vendorsListVendorJobTitles.ts +149 -1
  167. package/src/sdk/organizations.ts +5 -2
  168. package/src/sdk/supportarticles.ts +8 -2
  169. package/src/sdk/vendors.ts +47 -2
@@ -0,0 +1,98 @@
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 line item record
13
+ */
14
+ export type InvoiceItem = {
15
+ itemId?: number | undefined;
16
+ dateStarts?: string | null | undefined;
17
+ dateEnds?: string | null | undefined;
18
+ isSubscription?: boolean | null | undefined;
19
+ productTitle?: string | null | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const InvoiceItem$inboundSchema: z.ZodType<
24
+ InvoiceItem,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ item_id: z.number().int().optional(),
29
+ date_starts: z.nullable(z.string()).optional(),
30
+ date_ends: z.nullable(z.string()).optional(),
31
+ is_subscription: z.nullable(z.boolean()).optional(),
32
+ product_title: z.nullable(z.string()).optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ "item_id": "itemId",
36
+ "date_starts": "dateStarts",
37
+ "date_ends": "dateEnds",
38
+ "is_subscription": "isSubscription",
39
+ "product_title": "productTitle",
40
+ });
41
+ });
42
+
43
+ /** @internal */
44
+ export type InvoiceItem$Outbound = {
45
+ item_id?: number | undefined;
46
+ date_starts?: string | null | undefined;
47
+ date_ends?: string | null | undefined;
48
+ is_subscription?: boolean | null | undefined;
49
+ product_title?: string | null | undefined;
50
+ };
51
+
52
+ /** @internal */
53
+ export const InvoiceItem$outboundSchema: z.ZodType<
54
+ InvoiceItem$Outbound,
55
+ z.ZodTypeDef,
56
+ InvoiceItem
57
+ > = z.object({
58
+ itemId: z.number().int().optional(),
59
+ dateStarts: z.nullable(z.string()).optional(),
60
+ dateEnds: z.nullable(z.string()).optional(),
61
+ isSubscription: z.nullable(z.boolean()).optional(),
62
+ productTitle: z.nullable(z.string()).optional(),
63
+ }).transform((v) => {
64
+ return remap$(v, {
65
+ itemId: "item_id",
66
+ dateStarts: "date_starts",
67
+ dateEnds: "date_ends",
68
+ isSubscription: "is_subscription",
69
+ productTitle: "product_title",
70
+ });
71
+ });
72
+
73
+ /**
74
+ * @internal
75
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
76
+ */
77
+ export namespace InvoiceItem$ {
78
+ /** @deprecated use `InvoiceItem$inboundSchema` instead. */
79
+ export const inboundSchema = InvoiceItem$inboundSchema;
80
+ /** @deprecated use `InvoiceItem$outboundSchema` instead. */
81
+ export const outboundSchema = InvoiceItem$outboundSchema;
82
+ /** @deprecated use `InvoiceItem$Outbound` instead. */
83
+ export type Outbound = InvoiceItem$Outbound;
84
+ }
85
+
86
+ export function invoiceItemToJSON(invoiceItem: InvoiceItem): string {
87
+ return JSON.stringify(InvoiceItem$outboundSchema.parse(invoiceItem));
88
+ }
89
+
90
+ export function invoiceItemFromJSON(
91
+ jsonString: string,
92
+ ): SafeParseResult<InvoiceItem, SDKValidationError> {
93
+ return safeParse(
94
+ jsonString,
95
+ (x) => InvoiceItem$inboundSchema.parse(JSON.parse(x)),
96
+ `Failed to parse 'InvoiceItem' from JSON`,
97
+ );
98
+ }
@@ -0,0 +1,152 @@
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
+ export type ExpediteTimeRemainingRequest = {
12
+ /**
13
+ * Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
14
+ */
15
+ vendorIdOrMe: string;
16
+ };
17
+
18
+ /**
19
+ * The request was successful, and the server has returned the requested resource in the response body.
20
+ */
21
+ export type ExpediteTimeRemainingResponseBody = {
22
+ secondsRemaining: number;
23
+ };
24
+
25
+ /** @internal */
26
+ export const ExpediteTimeRemainingRequest$inboundSchema: z.ZodType<
27
+ ExpediteTimeRemainingRequest,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ vendor_id_or_me: z.string(),
32
+ }).transform((v) => {
33
+ return remap$(v, {
34
+ "vendor_id_or_me": "vendorIdOrMe",
35
+ });
36
+ });
37
+
38
+ /** @internal */
39
+ export type ExpediteTimeRemainingRequest$Outbound = {
40
+ vendor_id_or_me: string;
41
+ };
42
+
43
+ /** @internal */
44
+ export const ExpediteTimeRemainingRequest$outboundSchema: z.ZodType<
45
+ ExpediteTimeRemainingRequest$Outbound,
46
+ z.ZodTypeDef,
47
+ ExpediteTimeRemainingRequest
48
+ > = z.object({
49
+ vendorIdOrMe: z.string(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ vendorIdOrMe: "vendor_id_or_me",
53
+ });
54
+ });
55
+
56
+ /**
57
+ * @internal
58
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
59
+ */
60
+ export namespace ExpediteTimeRemainingRequest$ {
61
+ /** @deprecated use `ExpediteTimeRemainingRequest$inboundSchema` instead. */
62
+ export const inboundSchema = ExpediteTimeRemainingRequest$inboundSchema;
63
+ /** @deprecated use `ExpediteTimeRemainingRequest$outboundSchema` instead. */
64
+ export const outboundSchema = ExpediteTimeRemainingRequest$outboundSchema;
65
+ /** @deprecated use `ExpediteTimeRemainingRequest$Outbound` instead. */
66
+ export type Outbound = ExpediteTimeRemainingRequest$Outbound;
67
+ }
68
+
69
+ export function expediteTimeRemainingRequestToJSON(
70
+ expediteTimeRemainingRequest: ExpediteTimeRemainingRequest,
71
+ ): string {
72
+ return JSON.stringify(
73
+ ExpediteTimeRemainingRequest$outboundSchema.parse(
74
+ expediteTimeRemainingRequest,
75
+ ),
76
+ );
77
+ }
78
+
79
+ export function expediteTimeRemainingRequestFromJSON(
80
+ jsonString: string,
81
+ ): SafeParseResult<ExpediteTimeRemainingRequest, SDKValidationError> {
82
+ return safeParse(
83
+ jsonString,
84
+ (x) => ExpediteTimeRemainingRequest$inboundSchema.parse(JSON.parse(x)),
85
+ `Failed to parse 'ExpediteTimeRemainingRequest' from JSON`,
86
+ );
87
+ }
88
+
89
+ /** @internal */
90
+ export const ExpediteTimeRemainingResponseBody$inboundSchema: z.ZodType<
91
+ ExpediteTimeRemainingResponseBody,
92
+ z.ZodTypeDef,
93
+ unknown
94
+ > = z.object({
95
+ seconds_remaining: z.number().int(),
96
+ }).transform((v) => {
97
+ return remap$(v, {
98
+ "seconds_remaining": "secondsRemaining",
99
+ });
100
+ });
101
+
102
+ /** @internal */
103
+ export type ExpediteTimeRemainingResponseBody$Outbound = {
104
+ seconds_remaining: number;
105
+ };
106
+
107
+ /** @internal */
108
+ export const ExpediteTimeRemainingResponseBody$outboundSchema: z.ZodType<
109
+ ExpediteTimeRemainingResponseBody$Outbound,
110
+ z.ZodTypeDef,
111
+ ExpediteTimeRemainingResponseBody
112
+ > = z.object({
113
+ secondsRemaining: z.number().int(),
114
+ }).transform((v) => {
115
+ return remap$(v, {
116
+ secondsRemaining: "seconds_remaining",
117
+ });
118
+ });
119
+
120
+ /**
121
+ * @internal
122
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
123
+ */
124
+ export namespace ExpediteTimeRemainingResponseBody$ {
125
+ /** @deprecated use `ExpediteTimeRemainingResponseBody$inboundSchema` instead. */
126
+ export const inboundSchema = ExpediteTimeRemainingResponseBody$inboundSchema;
127
+ /** @deprecated use `ExpediteTimeRemainingResponseBody$outboundSchema` instead. */
128
+ export const outboundSchema =
129
+ ExpediteTimeRemainingResponseBody$outboundSchema;
130
+ /** @deprecated use `ExpediteTimeRemainingResponseBody$Outbound` instead. */
131
+ export type Outbound = ExpediteTimeRemainingResponseBody$Outbound;
132
+ }
133
+
134
+ export function expediteTimeRemainingResponseBodyToJSON(
135
+ expediteTimeRemainingResponseBody: ExpediteTimeRemainingResponseBody,
136
+ ): string {
137
+ return JSON.stringify(
138
+ ExpediteTimeRemainingResponseBody$outboundSchema.parse(
139
+ expediteTimeRemainingResponseBody,
140
+ ),
141
+ );
142
+ }
143
+
144
+ export function expediteTimeRemainingResponseBodyFromJSON(
145
+ jsonString: string,
146
+ ): SafeParseResult<ExpediteTimeRemainingResponseBody, SDKValidationError> {
147
+ return safeParse(
148
+ jsonString,
149
+ (x) => ExpediteTimeRemainingResponseBody$inboundSchema.parse(JSON.parse(x)),
150
+ `Failed to parse 'ExpediteTimeRemainingResponseBody' from JSON`,
151
+ );
152
+ }
@@ -3,12 +3,14 @@
3
3
  */
4
4
 
5
5
  export * from "./createvendorregistration.js";
6
+ export * from "./expeditetimeremaining.js";
6
7
  export * from "./getfacility.js";
7
8
  export * from "./getsupportarticle.js";
8
9
  export * from "./getuserbyid.js";
9
10
  export * from "./listorsearchfacilities.js";
10
11
  export * from "./listorsearchsupportarticles.js";
11
12
  export * from "./listvendorcredentials.js";
13
+ export * from "./listvendorinvoices.js";
12
14
  export * from "./listvendorjobtitles.js";
13
15
  export * from "./logsuserintothesystem.js";
14
16
  export * from "./magiclink.js";
@@ -63,6 +63,10 @@ export type ListOrSearchFacilitiesListOrSearchFacilitiesOk = {
63
63
  items: Array<components.Facility>;
64
64
  };
65
65
 
66
+ export type ListOrSearchFacilitiesResponse = {
67
+ result: ListOrSearchFacilitiesListOrSearchFacilitiesOk;
68
+ };
69
+
66
70
  /** @internal */
67
71
  export const ListOrSearchFacilitiesRequest$inboundSchema: z.ZodType<
68
72
  ListOrSearchFacilitiesRequest,
@@ -229,3 +233,71 @@ export function listOrSearchFacilitiesListOrSearchFacilitiesOkFromJSON(
229
233
  `Failed to parse 'ListOrSearchFacilitiesListOrSearchFacilitiesOk' from JSON`,
230
234
  );
231
235
  }
236
+
237
+ /** @internal */
238
+ export const ListOrSearchFacilitiesResponse$inboundSchema: z.ZodType<
239
+ ListOrSearchFacilitiesResponse,
240
+ z.ZodTypeDef,
241
+ unknown
242
+ > = z.object({
243
+ Result: z.lazy(() =>
244
+ ListOrSearchFacilitiesListOrSearchFacilitiesOk$inboundSchema
245
+ ),
246
+ }).transform((v) => {
247
+ return remap$(v, {
248
+ "Result": "result",
249
+ });
250
+ });
251
+
252
+ /** @internal */
253
+ export type ListOrSearchFacilitiesResponse$Outbound = {
254
+ Result: ListOrSearchFacilitiesListOrSearchFacilitiesOk$Outbound;
255
+ };
256
+
257
+ /** @internal */
258
+ export const ListOrSearchFacilitiesResponse$outboundSchema: z.ZodType<
259
+ ListOrSearchFacilitiesResponse$Outbound,
260
+ z.ZodTypeDef,
261
+ ListOrSearchFacilitiesResponse
262
+ > = z.object({
263
+ result: z.lazy(() =>
264
+ ListOrSearchFacilitiesListOrSearchFacilitiesOk$outboundSchema
265
+ ),
266
+ }).transform((v) => {
267
+ return remap$(v, {
268
+ result: "Result",
269
+ });
270
+ });
271
+
272
+ /**
273
+ * @internal
274
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
275
+ */
276
+ export namespace ListOrSearchFacilitiesResponse$ {
277
+ /** @deprecated use `ListOrSearchFacilitiesResponse$inboundSchema` instead. */
278
+ export const inboundSchema = ListOrSearchFacilitiesResponse$inboundSchema;
279
+ /** @deprecated use `ListOrSearchFacilitiesResponse$outboundSchema` instead. */
280
+ export const outboundSchema = ListOrSearchFacilitiesResponse$outboundSchema;
281
+ /** @deprecated use `ListOrSearchFacilitiesResponse$Outbound` instead. */
282
+ export type Outbound = ListOrSearchFacilitiesResponse$Outbound;
283
+ }
284
+
285
+ export function listOrSearchFacilitiesResponseToJSON(
286
+ listOrSearchFacilitiesResponse: ListOrSearchFacilitiesResponse,
287
+ ): string {
288
+ return JSON.stringify(
289
+ ListOrSearchFacilitiesResponse$outboundSchema.parse(
290
+ listOrSearchFacilitiesResponse,
291
+ ),
292
+ );
293
+ }
294
+
295
+ export function listOrSearchFacilitiesResponseFromJSON(
296
+ jsonString: string,
297
+ ): SafeParseResult<ListOrSearchFacilitiesResponse, SDKValidationError> {
298
+ return safeParse(
299
+ jsonString,
300
+ (x) => ListOrSearchFacilitiesResponse$inboundSchema.parse(JSON.parse(x)),
301
+ `Failed to parse 'ListOrSearchFacilitiesResponse' from JSON`,
302
+ );
303
+ }
@@ -39,6 +39,10 @@ export type ListOrSearchSupportArticlesListOrSearchArticlesOk = {
39
39
  items: Array<components.SupportArticle>;
40
40
  };
41
41
 
42
+ export type ListOrSearchSupportArticlesResponse = {
43
+ result: ListOrSearchSupportArticlesListOrSearchArticlesOk;
44
+ };
45
+
42
46
  /** @internal */
43
47
  export const ListOrSearchSupportArticlesRequest$inboundSchema: z.ZodType<
44
48
  ListOrSearchSupportArticlesRequest,
@@ -184,3 +188,74 @@ export function listOrSearchSupportArticlesListOrSearchArticlesOkFromJSON(
184
188
  `Failed to parse 'ListOrSearchSupportArticlesListOrSearchArticlesOk' from JSON`,
185
189
  );
186
190
  }
191
+
192
+ /** @internal */
193
+ export const ListOrSearchSupportArticlesResponse$inboundSchema: z.ZodType<
194
+ ListOrSearchSupportArticlesResponse,
195
+ z.ZodTypeDef,
196
+ unknown
197
+ > = z.object({
198
+ Result: z.lazy(() =>
199
+ ListOrSearchSupportArticlesListOrSearchArticlesOk$inboundSchema
200
+ ),
201
+ }).transform((v) => {
202
+ return remap$(v, {
203
+ "Result": "result",
204
+ });
205
+ });
206
+
207
+ /** @internal */
208
+ export type ListOrSearchSupportArticlesResponse$Outbound = {
209
+ Result: ListOrSearchSupportArticlesListOrSearchArticlesOk$Outbound;
210
+ };
211
+
212
+ /** @internal */
213
+ export const ListOrSearchSupportArticlesResponse$outboundSchema: z.ZodType<
214
+ ListOrSearchSupportArticlesResponse$Outbound,
215
+ z.ZodTypeDef,
216
+ ListOrSearchSupportArticlesResponse
217
+ > = z.object({
218
+ result: z.lazy(() =>
219
+ ListOrSearchSupportArticlesListOrSearchArticlesOk$outboundSchema
220
+ ),
221
+ }).transform((v) => {
222
+ return remap$(v, {
223
+ result: "Result",
224
+ });
225
+ });
226
+
227
+ /**
228
+ * @internal
229
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
230
+ */
231
+ export namespace ListOrSearchSupportArticlesResponse$ {
232
+ /** @deprecated use `ListOrSearchSupportArticlesResponse$inboundSchema` instead. */
233
+ export const inboundSchema =
234
+ ListOrSearchSupportArticlesResponse$inboundSchema;
235
+ /** @deprecated use `ListOrSearchSupportArticlesResponse$outboundSchema` instead. */
236
+ export const outboundSchema =
237
+ ListOrSearchSupportArticlesResponse$outboundSchema;
238
+ /** @deprecated use `ListOrSearchSupportArticlesResponse$Outbound` instead. */
239
+ export type Outbound = ListOrSearchSupportArticlesResponse$Outbound;
240
+ }
241
+
242
+ export function listOrSearchSupportArticlesResponseToJSON(
243
+ listOrSearchSupportArticlesResponse: ListOrSearchSupportArticlesResponse,
244
+ ): string {
245
+ return JSON.stringify(
246
+ ListOrSearchSupportArticlesResponse$outboundSchema.parse(
247
+ listOrSearchSupportArticlesResponse,
248
+ ),
249
+ );
250
+ }
251
+
252
+ export function listOrSearchSupportArticlesResponseFromJSON(
253
+ jsonString: string,
254
+ ): SafeParseResult<ListOrSearchSupportArticlesResponse, SDKValidationError> {
255
+ return safeParse(
256
+ jsonString,
257
+ (x) =>
258
+ ListOrSearchSupportArticlesResponse$inboundSchema.parse(JSON.parse(x)),
259
+ `Failed to parse 'ListOrSearchSupportArticlesResponse' from JSON`,
260
+ );
261
+ }
@@ -0,0 +1,252 @@
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 ListVendorInvoicesRequest = {
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
+ * 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.
31
+ */
32
+ expand?: Array<components.Expand> | undefined;
33
+ /**
34
+ * Either the ID of the vendor rep or the keyword "me" to represent the current vendor.
35
+ */
36
+ vendorIdOrMe: string;
37
+ };
38
+
39
+ /**
40
+ * The request was successful, and the server has returned the requested resource in the response body.
41
+ */
42
+ export type ListVendorInvoicesResponseBody = {
43
+ items: Array<components.Invoice>;
44
+ /**
45
+ * Pagination information for a pageable list
46
+ */
47
+ pager: components.Pager;
48
+ };
49
+
50
+ export type ListVendorInvoicesResponse = {
51
+ result: ListVendorInvoicesResponseBody;
52
+ };
53
+
54
+ /** @internal */
55
+ export const ListVendorInvoicesRequest$inboundSchema: z.ZodType<
56
+ ListVendorInvoicesRequest,
57
+ z.ZodTypeDef,
58
+ unknown
59
+ > = z.object({
60
+ sort: z.nullable(z.string()).optional(),
61
+ desc: components.Desc$inboundSchema.optional(),
62
+ page: z.number().int().optional(),
63
+ items_per_page: z.number().int().optional(),
64
+ expand: z.array(components.Expand$inboundSchema).optional(),
65
+ vendor_id_or_me: z.string(),
66
+ }).transform((v) => {
67
+ return remap$(v, {
68
+ "items_per_page": "itemsPerPage",
69
+ "vendor_id_or_me": "vendorIdOrMe",
70
+ });
71
+ });
72
+
73
+ /** @internal */
74
+ export type ListVendorInvoicesRequest$Outbound = {
75
+ sort?: string | null | undefined;
76
+ desc?: components.Desc$Outbound | undefined;
77
+ page?: number | undefined;
78
+ items_per_page?: number | undefined;
79
+ expand?: Array<string> | undefined;
80
+ vendor_id_or_me: string;
81
+ };
82
+
83
+ /** @internal */
84
+ export const ListVendorInvoicesRequest$outboundSchema: z.ZodType<
85
+ ListVendorInvoicesRequest$Outbound,
86
+ z.ZodTypeDef,
87
+ ListVendorInvoicesRequest
88
+ > = z.object({
89
+ sort: z.nullable(z.string()).optional(),
90
+ desc: components.Desc$outboundSchema.optional(),
91
+ page: z.number().int().optional(),
92
+ itemsPerPage: z.number().int().optional(),
93
+ expand: z.array(components.Expand$outboundSchema).optional(),
94
+ vendorIdOrMe: z.string(),
95
+ }).transform((v) => {
96
+ return remap$(v, {
97
+ itemsPerPage: "items_per_page",
98
+ vendorIdOrMe: "vendor_id_or_me",
99
+ });
100
+ });
101
+
102
+ /**
103
+ * @internal
104
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
105
+ */
106
+ export namespace ListVendorInvoicesRequest$ {
107
+ /** @deprecated use `ListVendorInvoicesRequest$inboundSchema` instead. */
108
+ export const inboundSchema = ListVendorInvoicesRequest$inboundSchema;
109
+ /** @deprecated use `ListVendorInvoicesRequest$outboundSchema` instead. */
110
+ export const outboundSchema = ListVendorInvoicesRequest$outboundSchema;
111
+ /** @deprecated use `ListVendorInvoicesRequest$Outbound` instead. */
112
+ export type Outbound = ListVendorInvoicesRequest$Outbound;
113
+ }
114
+
115
+ export function listVendorInvoicesRequestToJSON(
116
+ listVendorInvoicesRequest: ListVendorInvoicesRequest,
117
+ ): string {
118
+ return JSON.stringify(
119
+ ListVendorInvoicesRequest$outboundSchema.parse(listVendorInvoicesRequest),
120
+ );
121
+ }
122
+
123
+ export function listVendorInvoicesRequestFromJSON(
124
+ jsonString: string,
125
+ ): SafeParseResult<ListVendorInvoicesRequest, SDKValidationError> {
126
+ return safeParse(
127
+ jsonString,
128
+ (x) => ListVendorInvoicesRequest$inboundSchema.parse(JSON.parse(x)),
129
+ `Failed to parse 'ListVendorInvoicesRequest' from JSON`,
130
+ );
131
+ }
132
+
133
+ /** @internal */
134
+ export const ListVendorInvoicesResponseBody$inboundSchema: z.ZodType<
135
+ ListVendorInvoicesResponseBody,
136
+ z.ZodTypeDef,
137
+ unknown
138
+ > = z.object({
139
+ items: z.array(components.Invoice$inboundSchema),
140
+ pager: components.Pager$inboundSchema,
141
+ });
142
+
143
+ /** @internal */
144
+ export type ListVendorInvoicesResponseBody$Outbound = {
145
+ items: Array<components.Invoice$Outbound>;
146
+ pager: components.Pager$Outbound;
147
+ };
148
+
149
+ /** @internal */
150
+ export const ListVendorInvoicesResponseBody$outboundSchema: z.ZodType<
151
+ ListVendorInvoicesResponseBody$Outbound,
152
+ z.ZodTypeDef,
153
+ ListVendorInvoicesResponseBody
154
+ > = z.object({
155
+ items: z.array(components.Invoice$outboundSchema),
156
+ pager: components.Pager$outboundSchema,
157
+ });
158
+
159
+ /**
160
+ * @internal
161
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
162
+ */
163
+ export namespace ListVendorInvoicesResponseBody$ {
164
+ /** @deprecated use `ListVendorInvoicesResponseBody$inboundSchema` instead. */
165
+ export const inboundSchema = ListVendorInvoicesResponseBody$inboundSchema;
166
+ /** @deprecated use `ListVendorInvoicesResponseBody$outboundSchema` instead. */
167
+ export const outboundSchema = ListVendorInvoicesResponseBody$outboundSchema;
168
+ /** @deprecated use `ListVendorInvoicesResponseBody$Outbound` instead. */
169
+ export type Outbound = ListVendorInvoicesResponseBody$Outbound;
170
+ }
171
+
172
+ export function listVendorInvoicesResponseBodyToJSON(
173
+ listVendorInvoicesResponseBody: ListVendorInvoicesResponseBody,
174
+ ): string {
175
+ return JSON.stringify(
176
+ ListVendorInvoicesResponseBody$outboundSchema.parse(
177
+ listVendorInvoicesResponseBody,
178
+ ),
179
+ );
180
+ }
181
+
182
+ export function listVendorInvoicesResponseBodyFromJSON(
183
+ jsonString: string,
184
+ ): SafeParseResult<ListVendorInvoicesResponseBody, SDKValidationError> {
185
+ return safeParse(
186
+ jsonString,
187
+ (x) => ListVendorInvoicesResponseBody$inboundSchema.parse(JSON.parse(x)),
188
+ `Failed to parse 'ListVendorInvoicesResponseBody' from JSON`,
189
+ );
190
+ }
191
+
192
+ /** @internal */
193
+ export const ListVendorInvoicesResponse$inboundSchema: z.ZodType<
194
+ ListVendorInvoicesResponse,
195
+ z.ZodTypeDef,
196
+ unknown
197
+ > = z.object({
198
+ Result: z.lazy(() => ListVendorInvoicesResponseBody$inboundSchema),
199
+ }).transform((v) => {
200
+ return remap$(v, {
201
+ "Result": "result",
202
+ });
203
+ });
204
+
205
+ /** @internal */
206
+ export type ListVendorInvoicesResponse$Outbound = {
207
+ Result: ListVendorInvoicesResponseBody$Outbound;
208
+ };
209
+
210
+ /** @internal */
211
+ export const ListVendorInvoicesResponse$outboundSchema: z.ZodType<
212
+ ListVendorInvoicesResponse$Outbound,
213
+ z.ZodTypeDef,
214
+ ListVendorInvoicesResponse
215
+ > = z.object({
216
+ result: z.lazy(() => ListVendorInvoicesResponseBody$outboundSchema),
217
+ }).transform((v) => {
218
+ return remap$(v, {
219
+ result: "Result",
220
+ });
221
+ });
222
+
223
+ /**
224
+ * @internal
225
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
226
+ */
227
+ export namespace ListVendorInvoicesResponse$ {
228
+ /** @deprecated use `ListVendorInvoicesResponse$inboundSchema` instead. */
229
+ export const inboundSchema = ListVendorInvoicesResponse$inboundSchema;
230
+ /** @deprecated use `ListVendorInvoicesResponse$outboundSchema` instead. */
231
+ export const outboundSchema = ListVendorInvoicesResponse$outboundSchema;
232
+ /** @deprecated use `ListVendorInvoicesResponse$Outbound` instead. */
233
+ export type Outbound = ListVendorInvoicesResponse$Outbound;
234
+ }
235
+
236
+ export function listVendorInvoicesResponseToJSON(
237
+ listVendorInvoicesResponse: ListVendorInvoicesResponse,
238
+ ): string {
239
+ return JSON.stringify(
240
+ ListVendorInvoicesResponse$outboundSchema.parse(listVendorInvoicesResponse),
241
+ );
242
+ }
243
+
244
+ export function listVendorInvoicesResponseFromJSON(
245
+ jsonString: string,
246
+ ): SafeParseResult<ListVendorInvoicesResponse, SDKValidationError> {
247
+ return safeParse(
248
+ jsonString,
249
+ (x) => ListVendorInvoicesResponse$inboundSchema.parse(JSON.parse(x)),
250
+ `Failed to parse 'ListVendorInvoicesResponse' from JSON`,
251
+ );
252
+ }