@greensecurity/javascript-sdk 0.30.39 → 0.30.44

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 (39) hide show
  1. package/bin/mcp-server.js +33 -21
  2. package/bin/mcp-server.js.map +6 -6
  3. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  4. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +83 -3
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/lib/config.js.map +1 -1
  11. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  12. package/dist/commonjs/mcp-server/server.js +1 -1
  13. package/dist/commonjs/models/components/zone.d.ts +33 -6
  14. package/dist/commonjs/models/components/zone.d.ts.map +1 -1
  15. package/dist/commonjs/models/components/zone.js +38 -9
  16. package/dist/commonjs/models/components/zone.js.map +1 -1
  17. package/dist/esm/__tests__/vendors.test.js +1 -1
  18. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  19. package/dist/esm/__tests__/webhooks.test.js +1 -1
  20. package/dist/esm/__tests__/zones.test.js +83 -3
  21. package/dist/esm/__tests__/zones.test.js.map +1 -1
  22. package/dist/esm/lib/config.d.ts +3 -3
  23. package/dist/esm/lib/config.js +3 -3
  24. package/dist/esm/lib/config.js.map +1 -1
  25. package/dist/esm/mcp-server/mcp-server.js +1 -1
  26. package/dist/esm/mcp-server/server.js +1 -1
  27. package/dist/esm/models/components/zone.d.ts +33 -6
  28. package/dist/esm/models/components/zone.d.ts.map +1 -1
  29. package/dist/esm/models/components/zone.js +35 -8
  30. package/dist/esm/models/components/zone.js.map +1 -1
  31. package/jsr.json +1 -1
  32. package/package.json +1 -1
  33. package/src/__tests__/vendors.test.ts +1 -1
  34. package/src/__tests__/webhooks.test.ts +1 -1
  35. package/src/__tests__/zones.test.ts +83 -3
  36. package/src/lib/config.ts +3 -3
  37. package/src/mcp-server/mcp-server.ts +1 -1
  38. package/src/mcp-server/server.ts +1 -1
  39. package/src/models/components/zone.ts +68 -14
package/src/lib/config.ts CHANGED
@@ -72,8 +72,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
72
72
  export const SDK_METADATA = {
73
73
  language: "typescript",
74
74
  openapiDocVersion: "0.0.3",
75
- sdkVersion: "0.30.39",
76
- genVersion: "2.597.9",
75
+ sdkVersion: "0.30.44",
76
+ genVersion: "2.598.21",
77
77
  userAgent:
78
- "speakeasy-sdk/typescript 0.30.39 2.597.9 0.0.3 @greensecurity/javascript-sdk",
78
+ "speakeasy-sdk/typescript 0.30.44 2.598.21 0.0.3 @greensecurity/javascript-sdk",
79
79
  } 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.30.39",
22
+ currentVersion: "0.30.44",
23
23
  },
24
24
  });
25
25
 
@@ -61,7 +61,7 @@ export function createMCPServer(deps: {
61
61
  }) {
62
62
  const server = new McpServer({
63
63
  name: "GreenSecurity",
64
- version: "0.30.39",
64
+ version: "0.30.44",
65
65
  });
66
66
 
67
67
  const client = new GreenSecurityCore({
@@ -26,7 +26,12 @@ import {
26
26
  ZoneConfig$outboundSchema,
27
27
  } from "./zoneconfig.js";
28
28
 
29
- export type ZoneFacility = Facility | number;
29
+ export type Two = {
30
+ id?: number | undefined;
31
+ name?: string | undefined;
32
+ };
33
+
34
+ export type ZoneFacility = Two | Facility;
30
35
 
31
36
  export type ZoneDepartment = Department | number;
32
37
 
@@ -78,7 +83,7 @@ export type ZoneVisitRequestPolicy = {
78
83
  export type PrinterConfig = {
79
84
  type?: string | null | undefined;
80
85
  name?: string | null | undefined;
81
- dpi?: string | null | undefined;
86
+ dpi?: number | null | undefined;
82
87
  ip?: string | null | undefined;
83
88
  port?: string | null | undefined;
84
89
  email?: string | null | undefined;
@@ -99,7 +104,7 @@ export type GpsCheckinPolicy = {
99
104
  */
100
105
  export type Zone = {
101
106
  id?: number | undefined;
102
- facility?: Facility | number | null | undefined;
107
+ facility?: Two | Facility | null | undefined;
103
108
  department?: Department | number | null | undefined;
104
109
  name?: string | null | undefined;
105
110
  shortName?: string | null | undefined;
@@ -116,22 +121,69 @@ export type Zone = {
116
121
  gpsCheckinPolicy?: GpsCheckinPolicy | undefined;
117
122
  };
118
123
 
124
+ /** @internal */
125
+ export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z
126
+ .object({
127
+ id: z.number().int().optional(),
128
+ name: z.string().optional(),
129
+ });
130
+
131
+ /** @internal */
132
+ export type Two$Outbound = {
133
+ id?: number | undefined;
134
+ name?: string | undefined;
135
+ };
136
+
137
+ /** @internal */
138
+ export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
139
+ .object({
140
+ id: z.number().int().optional(),
141
+ name: z.string().optional(),
142
+ });
143
+
144
+ /**
145
+ * @internal
146
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
147
+ */
148
+ export namespace Two$ {
149
+ /** @deprecated use `Two$inboundSchema` instead. */
150
+ export const inboundSchema = Two$inboundSchema;
151
+ /** @deprecated use `Two$outboundSchema` instead. */
152
+ export const outboundSchema = Two$outboundSchema;
153
+ /** @deprecated use `Two$Outbound` instead. */
154
+ export type Outbound = Two$Outbound;
155
+ }
156
+
157
+ export function twoToJSON(two: Two): string {
158
+ return JSON.stringify(Two$outboundSchema.parse(two));
159
+ }
160
+
161
+ export function twoFromJSON(
162
+ jsonString: string,
163
+ ): SafeParseResult<Two, SDKValidationError> {
164
+ return safeParse(
165
+ jsonString,
166
+ (x) => Two$inboundSchema.parse(JSON.parse(x)),
167
+ `Failed to parse 'Two' from JSON`,
168
+ );
169
+ }
170
+
119
171
  /** @internal */
120
172
  export const ZoneFacility$inboundSchema: z.ZodType<
121
173
  ZoneFacility,
122
174
  z.ZodTypeDef,
123
175
  unknown
124
- > = z.union([Facility$inboundSchema, z.number().int()]);
176
+ > = z.union([z.lazy(() => Two$inboundSchema), Facility$inboundSchema]);
125
177
 
126
178
  /** @internal */
127
- export type ZoneFacility$Outbound = Facility$Outbound | number;
179
+ export type ZoneFacility$Outbound = Two$Outbound | Facility$Outbound;
128
180
 
129
181
  /** @internal */
130
182
  export const ZoneFacility$outboundSchema: z.ZodType<
131
183
  ZoneFacility$Outbound,
132
184
  z.ZodTypeDef,
133
185
  ZoneFacility
134
- > = z.union([Facility$outboundSchema, z.number().int()]);
186
+ > = z.union([z.lazy(() => Two$outboundSchema), Facility$outboundSchema]);
135
187
 
136
188
  /**
137
189
  * @internal
@@ -635,7 +687,7 @@ export const PrinterConfig$inboundSchema: z.ZodType<
635
687
  > = z.object({
636
688
  type: z.nullable(z.string()).optional(),
637
689
  name: z.nullable(z.string()).optional(),
638
- dpi: z.nullable(z.string()).optional(),
690
+ dpi: z.nullable(z.number().int()).optional(),
639
691
  ip: z.nullable(z.string()).optional(),
640
692
  port: z.nullable(z.string()).optional(),
641
693
  email: z.nullable(z.string()).optional(),
@@ -652,7 +704,7 @@ export const PrinterConfig$inboundSchema: z.ZodType<
652
704
  export type PrinterConfig$Outbound = {
653
705
  type?: string | null | undefined;
654
706
  name?: string | null | undefined;
655
- dpi?: string | null | undefined;
707
+ dpi?: number | null | undefined;
656
708
  ip?: string | null | undefined;
657
709
  port?: string | null | undefined;
658
710
  email?: string | null | undefined;
@@ -669,7 +721,7 @@ export const PrinterConfig$outboundSchema: z.ZodType<
669
721
  > = z.object({
670
722
  type: z.nullable(z.string()).optional(),
671
723
  name: z.nullable(z.string()).optional(),
672
- dpi: z.nullable(z.string()).optional(),
724
+ dpi: z.nullable(z.number().int()).optional(),
673
725
  ip: z.nullable(z.string()).optional(),
674
726
  port: z.nullable(z.string()).optional(),
675
727
  email: z.nullable(z.string()).optional(),
@@ -786,8 +838,9 @@ export function gpsCheckinPolicyFromJSON(
786
838
  export const Zone$inboundSchema: z.ZodType<Zone, z.ZodTypeDef, unknown> = z
787
839
  .object({
788
840
  id: z.number().int().optional(),
789
- facility: z.nullable(z.union([Facility$inboundSchema, z.number().int()]))
790
- .optional(),
841
+ facility: z.nullable(
842
+ z.union([z.lazy(() => Two$inboundSchema), Facility$inboundSchema]),
843
+ ).optional(),
791
844
  department: z.nullable(
792
845
  z.union([Department$inboundSchema, z.number().int()]),
793
846
  ).optional(),
@@ -823,7 +876,7 @@ export const Zone$inboundSchema: z.ZodType<Zone, z.ZodTypeDef, unknown> = z
823
876
  /** @internal */
824
877
  export type Zone$Outbound = {
825
878
  id?: number | undefined;
826
- facility?: Facility$Outbound | number | null | undefined;
879
+ facility?: Two$Outbound | Facility$Outbound | null | undefined;
827
880
  department?: Department$Outbound | number | null | undefined;
828
881
  name?: string | null | undefined;
829
882
  short_name?: string | null | undefined;
@@ -844,8 +897,9 @@ export type Zone$Outbound = {
844
897
  export const Zone$outboundSchema: z.ZodType<Zone$Outbound, z.ZodTypeDef, Zone> =
845
898
  z.object({
846
899
  id: z.number().int().optional(),
847
- facility: z.nullable(z.union([Facility$outboundSchema, z.number().int()]))
848
- .optional(),
900
+ facility: z.nullable(
901
+ z.union([z.lazy(() => Two$outboundSchema), Facility$outboundSchema]),
902
+ ).optional(),
849
903
  department: z.nullable(
850
904
  z.union([Department$outboundSchema, z.number().int()]),
851
905
  ).optional(),