@greensecurity/javascript-sdk 0.35.13 → 0.35.17

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 (56) hide show
  1. package/bin/mcp-server.js +126 -53
  2. package/bin/mcp-server.js.map +10 -9
  3. package/dist/commonjs/__tests__/zones.test.js +2 -5
  4. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  5. package/dist/commonjs/lib/config.d.ts +2 -2
  6. package/dist/commonjs/lib/config.js +2 -2
  7. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  8. package/dist/commonjs/mcp-server/server.js +1 -1
  9. package/dist/commonjs/models/components/index.d.ts +1 -0
  10. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  11. package/dist/commonjs/models/components/index.js +1 -0
  12. package/dist/commonjs/models/components/index.js.map +1 -1
  13. package/dist/commonjs/models/components/invoicetransaction.d.ts +24 -4
  14. package/dist/commonjs/models/components/invoicetransaction.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/invoicetransaction.js +29 -7
  16. package/dist/commonjs/models/components/invoicetransaction.js.map +1 -1
  17. package/dist/commonjs/models/components/paymentprofile.d.ts +105 -0
  18. package/dist/commonjs/models/components/paymentprofile.d.ts.map +1 -0
  19. package/dist/commonjs/models/components/paymentprofile.js +172 -0
  20. package/dist/commonjs/models/components/paymentprofile.js.map +1 -0
  21. package/dist/commonjs/models/components/vendor.d.ts +56 -56
  22. package/dist/commonjs/models/components/vendor.d.ts.map +1 -1
  23. package/dist/commonjs/models/components/vendor.js +73 -74
  24. package/dist/commonjs/models/components/vendor.js.map +1 -1
  25. package/dist/esm/__tests__/zones.test.js +2 -5
  26. package/dist/esm/__tests__/zones.test.js.map +1 -1
  27. package/dist/esm/lib/config.d.ts +2 -2
  28. package/dist/esm/lib/config.js +2 -2
  29. package/dist/esm/mcp-server/mcp-server.js +1 -1
  30. package/dist/esm/mcp-server/server.js +1 -1
  31. package/dist/esm/models/components/index.d.ts +1 -0
  32. package/dist/esm/models/components/index.d.ts.map +1 -1
  33. package/dist/esm/models/components/index.js +1 -0
  34. package/dist/esm/models/components/index.js.map +1 -1
  35. package/dist/esm/models/components/invoicetransaction.d.ts +24 -4
  36. package/dist/esm/models/components/invoicetransaction.d.ts.map +1 -1
  37. package/dist/esm/models/components/invoicetransaction.js +26 -6
  38. package/dist/esm/models/components/invoicetransaction.js.map +1 -1
  39. package/dist/esm/models/components/paymentprofile.d.ts +105 -0
  40. package/dist/esm/models/components/paymentprofile.d.ts.map +1 -0
  41. package/dist/esm/models/components/paymentprofile.js +128 -0
  42. package/dist/esm/models/components/paymentprofile.js.map +1 -0
  43. package/dist/esm/models/components/vendor.d.ts +56 -56
  44. package/dist/esm/models/components/vendor.d.ts.map +1 -1
  45. package/dist/esm/models/components/vendor.js +64 -65
  46. package/dist/esm/models/components/vendor.js.map +1 -1
  47. package/jsr.json +1 -1
  48. package/package.json +1 -1
  49. package/src/__tests__/zones.test.ts +2 -5
  50. package/src/lib/config.ts +2 -2
  51. package/src/mcp-server/mcp-server.ts +1 -1
  52. package/src/mcp-server/server.ts +1 -1
  53. package/src/models/components/index.ts +1 -0
  54. package/src/models/components/invoicetransaction.ts +70 -10
  55. package/src/models/components/paymentprofile.ts +247 -0
  56. package/src/models/components/vendor.ts +130 -103
package/src/lib/config.ts CHANGED
@@ -76,8 +76,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
76
76
  export const SDK_METADATA = {
77
77
  language: "typescript",
78
78
  openapiDocVersion: "0.0.3",
79
- sdkVersion: "0.35.13",
79
+ sdkVersion: "0.35.17",
80
80
  genVersion: "2.620.2",
81
81
  userAgent:
82
- "speakeasy-sdk/typescript 0.35.13 2.620.2 0.0.3 @greensecurity/javascript-sdk",
82
+ "speakeasy-sdk/typescript 0.35.17 2.620.2 0.0.3 @greensecurity/javascript-sdk",
83
83
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.35.13",
22
+ currentVersion: "0.35.17",
23
23
  },
24
24
  });
25
25
 
@@ -83,7 +83,7 @@ export function createMCPServer(deps: {
83
83
  }) {
84
84
  const server = new McpServer({
85
85
  name: "GreenSecurity",
86
- version: "0.35.13",
86
+ version: "0.35.17",
87
87
  });
88
88
 
89
89
  const client = new GreenSecurityCore({
@@ -29,6 +29,7 @@ export * from "./loginrequirementsfromemail.js";
29
29
  export * from "./mfarequiredresponse.js";
30
30
  export * from "./pager.js";
31
31
  export * from "./passwordrequiredresponse.js";
32
+ export * from "./paymentprofile.js";
32
33
  export * from "./product.js";
33
34
  export * from "./productvariant.js";
34
35
  export * from "./samlloginrequiredresponse.js";
@@ -7,20 +7,79 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ PaymentProfile,
12
+ PaymentProfile$inboundSchema,
13
+ PaymentProfile$Outbound,
14
+ PaymentProfile$outboundSchema,
15
+ } from "./paymentprofile.js";
16
+
17
+ export type InvoiceTransactionPaymentProfile = PaymentProfile | number;
10
18
 
11
19
  /**
12
20
  * Reduced list of attributes of the Invoice transaction record
13
21
  */
14
22
  export type InvoiceTransaction = {
15
23
  dateProcessed?: string | null | undefined;
16
- payee?: string | null | undefined;
24
+ paymentProfile?: PaymentProfile | number | null | undefined;
17
25
  amount?: number | null | undefined;
18
26
  creditId?: number | null | undefined;
19
27
  transactionId?: string | null | undefined;
20
28
  success?: boolean | null | undefined;
21
- cardLast4?: string | null | undefined;
22
29
  };
23
30
 
31
+ /** @internal */
32
+ export const InvoiceTransactionPaymentProfile$inboundSchema: z.ZodType<
33
+ InvoiceTransactionPaymentProfile,
34
+ z.ZodTypeDef,
35
+ unknown
36
+ > = z.union([PaymentProfile$inboundSchema, z.number().int()]);
37
+
38
+ /** @internal */
39
+ export type InvoiceTransactionPaymentProfile$Outbound =
40
+ | PaymentProfile$Outbound
41
+ | number;
42
+
43
+ /** @internal */
44
+ export const InvoiceTransactionPaymentProfile$outboundSchema: z.ZodType<
45
+ InvoiceTransactionPaymentProfile$Outbound,
46
+ z.ZodTypeDef,
47
+ InvoiceTransactionPaymentProfile
48
+ > = z.union([PaymentProfile$outboundSchema, z.number().int()]);
49
+
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export namespace InvoiceTransactionPaymentProfile$ {
55
+ /** @deprecated use `InvoiceTransactionPaymentProfile$inboundSchema` instead. */
56
+ export const inboundSchema = InvoiceTransactionPaymentProfile$inboundSchema;
57
+ /** @deprecated use `InvoiceTransactionPaymentProfile$outboundSchema` instead. */
58
+ export const outboundSchema = InvoiceTransactionPaymentProfile$outboundSchema;
59
+ /** @deprecated use `InvoiceTransactionPaymentProfile$Outbound` instead. */
60
+ export type Outbound = InvoiceTransactionPaymentProfile$Outbound;
61
+ }
62
+
63
+ export function invoiceTransactionPaymentProfileToJSON(
64
+ invoiceTransactionPaymentProfile: InvoiceTransactionPaymentProfile,
65
+ ): string {
66
+ return JSON.stringify(
67
+ InvoiceTransactionPaymentProfile$outboundSchema.parse(
68
+ invoiceTransactionPaymentProfile,
69
+ ),
70
+ );
71
+ }
72
+
73
+ export function invoiceTransactionPaymentProfileFromJSON(
74
+ jsonString: string,
75
+ ): SafeParseResult<InvoiceTransactionPaymentProfile, SDKValidationError> {
76
+ return safeParse(
77
+ jsonString,
78
+ (x) => InvoiceTransactionPaymentProfile$inboundSchema.parse(JSON.parse(x)),
79
+ `Failed to parse 'InvoiceTransactionPaymentProfile' from JSON`,
80
+ );
81
+ }
82
+
24
83
  /** @internal */
25
84
  export const InvoiceTransaction$inboundSchema: z.ZodType<
26
85
  InvoiceTransaction,
@@ -28,30 +87,30 @@ export const InvoiceTransaction$inboundSchema: z.ZodType<
28
87
  unknown
29
88
  > = z.object({
30
89
  date_processed: z.nullable(z.string()).optional(),
31
- payee: z.nullable(z.string()).optional(),
90
+ payment_profile: z.nullable(
91
+ z.union([PaymentProfile$inboundSchema, z.number().int()]),
92
+ ).optional(),
32
93
  amount: z.nullable(z.number().int()).optional(),
33
94
  credit_id: z.nullable(z.number().int()).optional(),
34
95
  transaction_id: z.nullable(z.string()).optional(),
35
96
  success: z.nullable(z.boolean()).optional(),
36
- card_last4: z.nullable(z.string()).optional(),
37
97
  }).transform((v) => {
38
98
  return remap$(v, {
39
99
  "date_processed": "dateProcessed",
100
+ "payment_profile": "paymentProfile",
40
101
  "credit_id": "creditId",
41
102
  "transaction_id": "transactionId",
42
- "card_last4": "cardLast4",
43
103
  });
44
104
  });
45
105
 
46
106
  /** @internal */
47
107
  export type InvoiceTransaction$Outbound = {
48
108
  date_processed?: string | null | undefined;
49
- payee?: string | null | undefined;
109
+ payment_profile?: PaymentProfile$Outbound | number | null | undefined;
50
110
  amount?: number | null | undefined;
51
111
  credit_id?: number | null | undefined;
52
112
  transaction_id?: string | null | undefined;
53
113
  success?: boolean | null | undefined;
54
- card_last4?: string | null | undefined;
55
114
  };
56
115
 
57
116
  /** @internal */
@@ -61,18 +120,19 @@ export const InvoiceTransaction$outboundSchema: z.ZodType<
61
120
  InvoiceTransaction
62
121
  > = z.object({
63
122
  dateProcessed: z.nullable(z.string()).optional(),
64
- payee: z.nullable(z.string()).optional(),
123
+ paymentProfile: z.nullable(
124
+ z.union([PaymentProfile$outboundSchema, z.number().int()]),
125
+ ).optional(),
65
126
  amount: z.nullable(z.number().int()).optional(),
66
127
  creditId: z.nullable(z.number().int()).optional(),
67
128
  transactionId: z.nullable(z.string()).optional(),
68
129
  success: z.nullable(z.boolean()).optional(),
69
- cardLast4: z.nullable(z.string()).optional(),
70
130
  }).transform((v) => {
71
131
  return remap$(v, {
72
132
  dateProcessed: "date_processed",
133
+ paymentProfile: "payment_profile",
73
134
  creditId: "credit_id",
74
135
  transactionId: "transaction_id",
75
- cardLast4: "card_last4",
76
136
  });
77
137
  });
78
138
 
@@ -0,0 +1,247 @@
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 Two2 = {};
12
+
13
+ export type PaymentProfile2 = Two2 | number;
14
+
15
+ export type PaymentProfile1 = {
16
+ id?: number | undefined;
17
+ isValid?: boolean | null | undefined;
18
+ cardType?: string | null | undefined;
19
+ cardLast4?: string | null | undefined;
20
+ isDummy?: boolean | null | undefined;
21
+ profileType?: string | null | undefined;
22
+ };
23
+
24
+ /**
25
+ * Reduced list of attributes of the Payment Profile record
26
+ */
27
+ export type PaymentProfile = PaymentProfile1 | Two2 | number;
28
+
29
+ /** @internal */
30
+ export const Two2$inboundSchema: z.ZodType<Two2, z.ZodTypeDef, unknown> = z
31
+ .object({});
32
+
33
+ /** @internal */
34
+ export type Two2$Outbound = {};
35
+
36
+ /** @internal */
37
+ export const Two2$outboundSchema: z.ZodType<Two2$Outbound, z.ZodTypeDef, Two2> =
38
+ z.object({});
39
+
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export namespace Two2$ {
45
+ /** @deprecated use `Two2$inboundSchema` instead. */
46
+ export const inboundSchema = Two2$inboundSchema;
47
+ /** @deprecated use `Two2$outboundSchema` instead. */
48
+ export const outboundSchema = Two2$outboundSchema;
49
+ /** @deprecated use `Two2$Outbound` instead. */
50
+ export type Outbound = Two2$Outbound;
51
+ }
52
+
53
+ export function two2ToJSON(two2: Two2): string {
54
+ return JSON.stringify(Two2$outboundSchema.parse(two2));
55
+ }
56
+
57
+ export function two2FromJSON(
58
+ jsonString: string,
59
+ ): SafeParseResult<Two2, SDKValidationError> {
60
+ return safeParse(
61
+ jsonString,
62
+ (x) => Two2$inboundSchema.parse(JSON.parse(x)),
63
+ `Failed to parse 'Two2' from JSON`,
64
+ );
65
+ }
66
+
67
+ /** @internal */
68
+ export const PaymentProfile2$inboundSchema: z.ZodType<
69
+ PaymentProfile2,
70
+ z.ZodTypeDef,
71
+ unknown
72
+ > = z.union([z.lazy(() => Two2$inboundSchema), z.number().int()]);
73
+
74
+ /** @internal */
75
+ export type PaymentProfile2$Outbound = Two2$Outbound | number;
76
+
77
+ /** @internal */
78
+ export const PaymentProfile2$outboundSchema: z.ZodType<
79
+ PaymentProfile2$Outbound,
80
+ z.ZodTypeDef,
81
+ PaymentProfile2
82
+ > = z.union([z.lazy(() => Two2$outboundSchema), z.number().int()]);
83
+
84
+ /**
85
+ * @internal
86
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
87
+ */
88
+ export namespace PaymentProfile2$ {
89
+ /** @deprecated use `PaymentProfile2$inboundSchema` instead. */
90
+ export const inboundSchema = PaymentProfile2$inboundSchema;
91
+ /** @deprecated use `PaymentProfile2$outboundSchema` instead. */
92
+ export const outboundSchema = PaymentProfile2$outboundSchema;
93
+ /** @deprecated use `PaymentProfile2$Outbound` instead. */
94
+ export type Outbound = PaymentProfile2$Outbound;
95
+ }
96
+
97
+ export function paymentProfile2ToJSON(
98
+ paymentProfile2: PaymentProfile2,
99
+ ): string {
100
+ return JSON.stringify(PaymentProfile2$outboundSchema.parse(paymentProfile2));
101
+ }
102
+
103
+ export function paymentProfile2FromJSON(
104
+ jsonString: string,
105
+ ): SafeParseResult<PaymentProfile2, SDKValidationError> {
106
+ return safeParse(
107
+ jsonString,
108
+ (x) => PaymentProfile2$inboundSchema.parse(JSON.parse(x)),
109
+ `Failed to parse 'PaymentProfile2' from JSON`,
110
+ );
111
+ }
112
+
113
+ /** @internal */
114
+ export const PaymentProfile1$inboundSchema: z.ZodType<
115
+ PaymentProfile1,
116
+ z.ZodTypeDef,
117
+ unknown
118
+ > = z.object({
119
+ id: z.number().int().optional(),
120
+ is_valid: z.nullable(z.boolean()).optional(),
121
+ card_type: z.nullable(z.string()).optional(),
122
+ card_last4: z.nullable(z.string()).optional(),
123
+ is_dummy: z.nullable(z.boolean()).optional(),
124
+ profile_type: z.nullable(z.string()).optional(),
125
+ }).transform((v) => {
126
+ return remap$(v, {
127
+ "is_valid": "isValid",
128
+ "card_type": "cardType",
129
+ "card_last4": "cardLast4",
130
+ "is_dummy": "isDummy",
131
+ "profile_type": "profileType",
132
+ });
133
+ });
134
+
135
+ /** @internal */
136
+ export type PaymentProfile1$Outbound = {
137
+ id?: number | undefined;
138
+ is_valid?: boolean | null | undefined;
139
+ card_type?: string | null | undefined;
140
+ card_last4?: string | null | undefined;
141
+ is_dummy?: boolean | null | undefined;
142
+ profile_type?: string | null | undefined;
143
+ };
144
+
145
+ /** @internal */
146
+ export const PaymentProfile1$outboundSchema: z.ZodType<
147
+ PaymentProfile1$Outbound,
148
+ z.ZodTypeDef,
149
+ PaymentProfile1
150
+ > = z.object({
151
+ id: z.number().int().optional(),
152
+ isValid: z.nullable(z.boolean()).optional(),
153
+ cardType: z.nullable(z.string()).optional(),
154
+ cardLast4: z.nullable(z.string()).optional(),
155
+ isDummy: z.nullable(z.boolean()).optional(),
156
+ profileType: z.nullable(z.string()).optional(),
157
+ }).transform((v) => {
158
+ return remap$(v, {
159
+ isValid: "is_valid",
160
+ cardType: "card_type",
161
+ cardLast4: "card_last4",
162
+ isDummy: "is_dummy",
163
+ profileType: "profile_type",
164
+ });
165
+ });
166
+
167
+ /**
168
+ * @internal
169
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
170
+ */
171
+ export namespace PaymentProfile1$ {
172
+ /** @deprecated use `PaymentProfile1$inboundSchema` instead. */
173
+ export const inboundSchema = PaymentProfile1$inboundSchema;
174
+ /** @deprecated use `PaymentProfile1$outboundSchema` instead. */
175
+ export const outboundSchema = PaymentProfile1$outboundSchema;
176
+ /** @deprecated use `PaymentProfile1$Outbound` instead. */
177
+ export type Outbound = PaymentProfile1$Outbound;
178
+ }
179
+
180
+ export function paymentProfile1ToJSON(
181
+ paymentProfile1: PaymentProfile1,
182
+ ): string {
183
+ return JSON.stringify(PaymentProfile1$outboundSchema.parse(paymentProfile1));
184
+ }
185
+
186
+ export function paymentProfile1FromJSON(
187
+ jsonString: string,
188
+ ): SafeParseResult<PaymentProfile1, SDKValidationError> {
189
+ return safeParse(
190
+ jsonString,
191
+ (x) => PaymentProfile1$inboundSchema.parse(JSON.parse(x)),
192
+ `Failed to parse 'PaymentProfile1' from JSON`,
193
+ );
194
+ }
195
+
196
+ /** @internal */
197
+ export const PaymentProfile$inboundSchema: z.ZodType<
198
+ PaymentProfile,
199
+ z.ZodTypeDef,
200
+ unknown
201
+ > = z.union([
202
+ z.lazy(() => PaymentProfile1$inboundSchema),
203
+ z.union([z.lazy(() => Two2$inboundSchema), z.number().int()]),
204
+ ]);
205
+
206
+ /** @internal */
207
+ export type PaymentProfile$Outbound =
208
+ | PaymentProfile1$Outbound
209
+ | Two2$Outbound
210
+ | number;
211
+
212
+ /** @internal */
213
+ export const PaymentProfile$outboundSchema: z.ZodType<
214
+ PaymentProfile$Outbound,
215
+ z.ZodTypeDef,
216
+ PaymentProfile
217
+ > = z.union([
218
+ z.lazy(() => PaymentProfile1$outboundSchema),
219
+ z.union([z.lazy(() => Two2$outboundSchema), z.number().int()]),
220
+ ]);
221
+
222
+ /**
223
+ * @internal
224
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
225
+ */
226
+ export namespace PaymentProfile$ {
227
+ /** @deprecated use `PaymentProfile$inboundSchema` instead. */
228
+ export const inboundSchema = PaymentProfile$inboundSchema;
229
+ /** @deprecated use `PaymentProfile$outboundSchema` instead. */
230
+ export const outboundSchema = PaymentProfile$outboundSchema;
231
+ /** @deprecated use `PaymentProfile$Outbound` instead. */
232
+ export type Outbound = PaymentProfile$Outbound;
233
+ }
234
+
235
+ export function paymentProfileToJSON(paymentProfile: PaymentProfile): string {
236
+ return JSON.stringify(PaymentProfile$outboundSchema.parse(paymentProfile));
237
+ }
238
+
239
+ export function paymentProfileFromJSON(
240
+ jsonString: string,
241
+ ): SafeParseResult<PaymentProfile, SDKValidationError> {
242
+ return safeParse(
243
+ jsonString,
244
+ (x) => PaymentProfile$inboundSchema.parse(JSON.parse(x)),
245
+ `Failed to parse 'PaymentProfile' from JSON`,
246
+ );
247
+ }