@greensecurity/javascript-sdk 0.11.0 → 0.12.1

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 (83) hide show
  1. package/README.md +25 -28
  2. package/bin/mcp-server.js +77 -32
  3. package/bin/mcp-server.js.map +20 -20
  4. package/funcs/organizationsGetFacility.js +1 -1
  5. package/funcs/organizationsGetFacility.js.map +1 -1
  6. package/funcs/organizationsListOrSearchFacilities.js +1 -1
  7. package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  8. package/funcs/userGetCurrentUser.js +1 -1
  9. package/funcs/userGetCurrentUser.js.map +1 -1
  10. package/funcs/userGetUserById.js +1 -1
  11. package/funcs/userGetUserById.js.map +1 -1
  12. package/funcs/userLogsUserIntoTheSystem.js +1 -1
  13. package/funcs/userLogsUserIntoTheSystem.js.map +1 -1
  14. package/funcs/userMagiclink.js +1 -1
  15. package/funcs/userMagiclink.js.map +1 -1
  16. package/funcs/userPassword.js +1 -1
  17. package/funcs/userPassword.js.map +1 -1
  18. package/funcs/userPasswordResetRequest.js +1 -1
  19. package/funcs/userPasswordResetRequest.js.map +1 -1
  20. package/funcs/vendorsCreateVendorRegistration.js +1 -1
  21. package/funcs/vendorsCreateVendorRegistration.js.map +1 -1
  22. package/funcs/vendorsListVendorJobTitles.js +1 -1
  23. package/funcs/vendorsListVendorJobTitles.js.map +1 -1
  24. package/jsr.json +1 -1
  25. package/lib/config.d.ts +4 -4
  26. package/lib/config.d.ts.map +1 -1
  27. package/lib/config.js +3 -3
  28. package/lib/config.js.map +1 -1
  29. package/lib/primitives.d.ts +3 -0
  30. package/lib/primitives.d.ts.map +1 -1
  31. package/lib/primitives.js +7 -0
  32. package/lib/primitives.js.map +1 -1
  33. package/mcp-server/cli/start/command.d.ts.map +1 -1
  34. package/mcp-server/cli/start/command.js +44 -6
  35. package/mcp-server/cli/start/command.js.map +1 -1
  36. package/mcp-server/cli/start/impl.d.ts +4 -1
  37. package/mcp-server/cli/start/impl.d.ts.map +1 -1
  38. package/mcp-server/cli/start/impl.js +5 -0
  39. package/mcp-server/cli/start/impl.js.map +1 -1
  40. package/mcp-server/mcp-server.js +1 -1
  41. package/mcp-server/server.d.ts +2 -1
  42. package/mcp-server/server.d.ts.map +1 -1
  43. package/mcp-server/server.js +2 -1
  44. package/mcp-server/server.js.map +1 -1
  45. package/models/components/facility.d.ts +0 -4
  46. package/models/components/facility.d.ts.map +1 -1
  47. package/models/components/facility.js +0 -4
  48. package/models/components/facility.js.map +1 -1
  49. package/models/components/user.d.ts +6 -0
  50. package/models/components/user.d.ts.map +1 -1
  51. package/models/components/user.js +5 -0
  52. package/models/components/user.js.map +1 -1
  53. package/package.json +5 -1
  54. package/src/__tests__/assertions.ts +13 -0
  55. package/src/__tests__/files.ts +56 -0
  56. package/src/__tests__/organizations.test.ts +244 -0
  57. package/src/__tests__/testclient.ts +48 -0
  58. package/src/__tests__/user.test.ts +200 -0
  59. package/src/__tests__/vendors.test.ts +65 -0
  60. package/src/funcs/organizationsGetFacility.ts +1 -1
  61. package/src/funcs/organizationsListOrSearchFacilities.ts +1 -1
  62. package/src/funcs/userGetCurrentUser.ts +1 -1
  63. package/src/funcs/userGetUserById.ts +1 -1
  64. package/src/funcs/userLogsUserIntoTheSystem.ts +1 -1
  65. package/src/funcs/userMagiclink.ts +1 -1
  66. package/src/funcs/userPassword.ts +1 -1
  67. package/src/funcs/userPasswordResetRequest.ts +1 -1
  68. package/src/funcs/vendorsCreateVendorRegistration.ts +1 -1
  69. package/src/funcs/vendorsListVendorJobTitles.ts +1 -1
  70. package/src/lib/config.ts +7 -4
  71. package/src/lib/primitives.ts +14 -0
  72. package/src/mcp-server/cli/start/command.ts +46 -7
  73. package/src/mcp-server/cli/start/impl.ts +10 -1
  74. package/src/mcp-server/mcp-server.ts +1 -1
  75. package/src/mcp-server/server.ts +4 -2
  76. package/src/models/components/facility.ts +0 -8
  77. package/src/models/components/user.ts +15 -0
  78. package/src/vitest.config.js +5 -0
  79. package/vitest.config.d.ts +7 -0
  80. package/vitest.config.d.ts.map +1 -0
  81. package/vitest.config.js +8 -0
  82. package/vitest.config.js.map +1 -0
  83. package/vitest.config.ts +8 -0
@@ -0,0 +1,244 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { expect, test } from "vitest";
6
+ import { GreenSecurity } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Organizations List Or Search Facilities", async () => {
10
+ const greenSecurity = new GreenSecurity({
11
+ serverURL: "https://dev.repconnex.com:3000/api",
12
+ security: {
13
+ bearerJwt: "",
14
+ },
15
+ httpClient: createTestHTTPClient("listOrSearchFacilities"),
16
+ });
17
+
18
+ const result = await greenSecurity.organizations.listOrSearchFacilities({
19
+ sort: "job",
20
+ desc: true,
21
+ itemsPerPage: 25,
22
+ expand: [
23
+ "facility.system",
24
+ ],
25
+ });
26
+ expect(result).toBeDefined();
27
+ expect(result).toEqual({
28
+ pager: {
29
+ baseUrl: "api/vendors/job_titles",
30
+ sort: "job,title",
31
+ desc: 1,
32
+ itemCount: 228,
33
+ itemsPerPage: 513604,
34
+ page: 1,
35
+ useUrlParams: true,
36
+ },
37
+ items: [
38
+ {
39
+ contacts: {
40
+ contact: {
41
+ status: "Inactive",
42
+ department: {
43
+ id: 741158,
44
+ name: "<value>",
45
+ },
46
+ },
47
+ adminContact: {
48
+ status: "Deleted",
49
+ department: 123,
50
+ },
51
+ techContact: {
52
+ status: "Deleted",
53
+ department: 123,
54
+ },
55
+ greenSecurityCsm: {
56
+ status: "Inactive",
57
+ department: 123,
58
+ },
59
+ accountManager: {
60
+ status: "Active",
61
+ department: {
62
+ id: 602669,
63
+ name: "<value>",
64
+ },
65
+ },
66
+ },
67
+ imageUrls: {
68
+ tiny:
69
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_tiny.jpeg?1538765266",
70
+ thumb:
71
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_thumb.jpeg?1538765266",
72
+ large:
73
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_large.jpeg?1538765266",
74
+ original:
75
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_original.jpeg?1538765266",
76
+ },
77
+ vendorGuestPolicy: {
78
+ enabled: true,
79
+ vendorGuestLimitAndOr: "and",
80
+ vendorGuestRequireEmail: true,
81
+ },
82
+ },
83
+ {
84
+ contacts: {
85
+ contact: {
86
+ status: "Deleted",
87
+ department: 123,
88
+ },
89
+ adminContact: {
90
+ status: "Inactive",
91
+ department: {
92
+ id: 295998,
93
+ name: "<value>",
94
+ },
95
+ },
96
+ techContact: {
97
+ status: "Inactive",
98
+ department: {
99
+ id: 344138,
100
+ name: "<value>",
101
+ },
102
+ },
103
+ greenSecurityCsm: {
104
+ status: "Inactive",
105
+ department: {
106
+ id: 499522,
107
+ name: "<value>",
108
+ },
109
+ },
110
+ accountManager: {
111
+ status: "Deleted",
112
+ department: 123,
113
+ },
114
+ },
115
+ imageUrls: {
116
+ tiny:
117
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_tiny.jpeg?1538765266",
118
+ thumb:
119
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_thumb.jpeg?1538765266",
120
+ large:
121
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_large.jpeg?1538765266",
122
+ original:
123
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_original.jpeg?1538765266",
124
+ },
125
+ vendorGuestPolicy: {
126
+ enabled: true,
127
+ vendorGuestLimitAndOr: "and",
128
+ vendorGuestRequireEmail: false,
129
+ },
130
+ },
131
+ {
132
+ contacts: {
133
+ contact: {
134
+ status: "Active",
135
+ department: {
136
+ id: 674036,
137
+ name: "<value>",
138
+ },
139
+ },
140
+ adminContact: {
141
+ status: "Deleted",
142
+ department: 123,
143
+ },
144
+ techContact: {
145
+ status: "Inactive",
146
+ department: {
147
+ id: 800811,
148
+ name: "<value>",
149
+ },
150
+ },
151
+ greenSecurityCsm: {
152
+ status: "Inactive",
153
+ department: 123,
154
+ },
155
+ accountManager: {
156
+ status: "Inactive",
157
+ department: {
158
+ id: 603414,
159
+ name: "<value>",
160
+ },
161
+ },
162
+ },
163
+ imageUrls: {
164
+ tiny:
165
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_tiny.jpeg?1538765266",
166
+ thumb:
167
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_thumb.jpeg?1538765266",
168
+ large:
169
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_large.jpeg?1538765266",
170
+ original:
171
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_original.jpeg?1538765266",
172
+ },
173
+ vendorGuestPolicy: {
174
+ enabled: true,
175
+ vendorGuestLimitAndOr: "and",
176
+ vendorGuestRequireEmail: true,
177
+ },
178
+ },
179
+ ],
180
+ });
181
+ });
182
+
183
+ test("Organizations Get Facility", async () => {
184
+ const greenSecurity = new GreenSecurity({
185
+ serverURL: "https://dev.repconnex.com:3000/api",
186
+ security: {
187
+ bearerJwt: "",
188
+ },
189
+ httpClient: createTestHTTPClient("getFacility"),
190
+ });
191
+
192
+ const result = await greenSecurity.organizations.getFacility({
193
+ id: 924512,
194
+ });
195
+ expect(result).toBeDefined();
196
+ expect(result).toEqual({
197
+ contacts: {
198
+ contact: {
199
+ status: "Inactive",
200
+ department: 123,
201
+ },
202
+ adminContact: {
203
+ status: "Deleted",
204
+ department: {
205
+ id: 97343,
206
+ name: "<value>",
207
+ },
208
+ },
209
+ techContact: {
210
+ status: "Deleted",
211
+ department: {
212
+ id: 790655,
213
+ name: "<value>",
214
+ },
215
+ },
216
+ greenSecurityCsm: {
217
+ status: "Deleted",
218
+ department: 123,
219
+ },
220
+ accountManager: {
221
+ status: "Inactive",
222
+ department: {
223
+ id: 976324,
224
+ name: "<value>",
225
+ },
226
+ },
227
+ },
228
+ imageUrls: {
229
+ tiny:
230
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_tiny.jpeg?1538765266",
231
+ thumb:
232
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_thumb.jpeg?1538765266",
233
+ large:
234
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_large.jpeg?1538765266",
235
+ original:
236
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_original.jpeg?1538765266",
237
+ },
238
+ vendorGuestPolicy: {
239
+ enabled: true,
240
+ vendorGuestLimitAndOr: "and",
241
+ vendorGuestRequireEmail: true,
242
+ },
243
+ });
244
+ });
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { getRandomValues } from "crypto";
6
+ import { HTTPClient } from "../lib/http.js";
7
+
8
+ export function createTestHTTPClient(testName: string): HTTPClient {
9
+ const httpClient = new HTTPClient({
10
+ fetcher: (request: URL | RequestInfo) => {
11
+ return fetch(request);
12
+ },
13
+ });
14
+
15
+ const testInstanceId = genTestId();
16
+
17
+ httpClient.addHook("beforeRequest", (request: Request) => {
18
+ const nextRequest = new Request(request, {
19
+ signal: request.signal || AbortSignal.timeout(5000),
20
+ });
21
+
22
+ nextRequest.headers.set("x-speakeasy-test-name", testName);
23
+ nextRequest.headers.set("x-speakeasy-test-instance-id", testInstanceId);
24
+
25
+ return nextRequest;
26
+ });
27
+
28
+ return httpClient;
29
+ }
30
+
31
+ function genTestId(): string {
32
+ const b = new Uint8Array(16);
33
+ getRandomValues(b);
34
+
35
+ return `${buf2hex(b.slice(0, 4))}-${buf2hex(b.slice(4, 6))}-${
36
+ buf2hex(
37
+ b.slice(6, 8),
38
+ )
39
+ }-${buf2hex(b.slice(8, 10))}-${buf2hex(b.slice(10))}`;
40
+ }
41
+
42
+ // Helper function to convert buffer to hex string
43
+ function buf2hex(buffer: Uint8Array): string {
44
+ return [...buffer]
45
+ .map((x) => x.toString(16).padStart(2, "0"))
46
+ .join("")
47
+ .toUpperCase();
48
+ }
@@ -0,0 +1,200 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { expect, test } from "vitest";
6
+ import { GreenSecurity } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("User Get User By Id", async () => {
10
+ const greenSecurity = new GreenSecurity({
11
+ serverURL: "https://dev.repconnex.com:3000/api",
12
+ security: {
13
+ bearerJwt: "",
14
+ },
15
+ httpClient: createTestHTTPClient("getUserById"),
16
+ });
17
+
18
+ const result = await greenSecurity.user.getUserById({
19
+ id: 13226,
20
+ });
21
+ expect(result).toBeDefined();
22
+ expect(result).toEqual({
23
+ isGatekeeper: false,
24
+ success: true,
25
+ user: {
26
+ id: 13226,
27
+ firstName: "testFirstName",
28
+ lastName: "testLastName",
29
+ email: "testemail@test.com",
30
+ phone: "112233445566",
31
+ userType: "Vendor",
32
+ timezone: "Eastern Time (US & Canada)",
33
+ imageUrls: {
34
+ tiny: "",
35
+ thumb: "",
36
+ large: "",
37
+ original: "",
38
+ },
39
+ },
40
+ userToken: {
41
+ token: "",
42
+ tokenType: "permanent",
43
+ },
44
+ contact: {
45
+ status: "Deleted",
46
+ department: {
47
+ id: 112233,
48
+ name: "<value>",
49
+ },
50
+ },
51
+ });
52
+ });
53
+
54
+ test("User Get Current User", async () => {
55
+ const greenSecurity = new GreenSecurity({
56
+ serverURL: "https://dev.repconnex.com:3000/api",
57
+ security: {
58
+ bearerJwt: "",
59
+ },
60
+ httpClient: createTestHTTPClient("getCurrentUser"),
61
+ });
62
+
63
+ const result = await greenSecurity.user.getCurrentUser();
64
+ expect(result).toBeDefined();
65
+ expect(result).toEqual({
66
+ isGatekeeper: false,
67
+ success: true,
68
+ user: {
69
+ id: 123,
70
+ firstName: "John",
71
+ lastName: "Doe",
72
+ email: "john@example.com",
73
+ phone: "5555555555",
74
+ userType: "Facility User",
75
+ timezone: "UTC",
76
+ imageUrls: {
77
+ tiny:
78
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_tiny.jpeg?1538765266",
79
+ thumb:
80
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_thumb.jpeg?1538765266",
81
+ large:
82
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_large.jpeg?1538765266",
83
+ original:
84
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_original.jpeg?1538765266",
85
+ },
86
+ },
87
+ userToken: {
88
+ token: "WDCINRKRKYQ3TUEUEUEHEGWN6WKXP7N12345C8CSHQVJD7D6I",
89
+ tokenType: "permanent",
90
+ },
91
+ contact: {
92
+ facility: {
93
+ id: 233571,
94
+ name: "<value>",
95
+ },
96
+ system: 141123,
97
+ status: "Deleted",
98
+ department: 123,
99
+ },
100
+ });
101
+ });
102
+
103
+ test("User Logs User Into The System", async () => {
104
+ const greenSecurity = new GreenSecurity({
105
+ serverURL: "https://dev.repconnex.com:3000/api",
106
+ security: {
107
+ bearerJwt: "",
108
+ },
109
+ httpClient: createTestHTTPClient("logsUserIntoTheSystem"),
110
+ });
111
+
112
+ const result = await greenSecurity.user.logsUserIntoTheSystem({
113
+ email: "user@example.com",
114
+ mfaCode: "123456",
115
+ password: "Hunter2",
116
+ });
117
+ expect(result).toBeDefined();
118
+ expect(result).toEqual({
119
+ isGatekeeper: true,
120
+ success: true,
121
+ user: {
122
+ id: 123,
123
+ firstName: "John",
124
+ lastName: "Doe",
125
+ email: "john@example.com",
126
+ phone: "5555555555",
127
+ userType: "Facility User",
128
+ timezone: "Pacific Time (US & Canada)",
129
+ imageUrls: {
130
+ tiny:
131
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_tiny.jpeg?1538765266",
132
+ thumb:
133
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_thumb.jpeg?1538765266",
134
+ large:
135
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_large.jpeg?1538765266",
136
+ original:
137
+ "https://d37hfq3t37fvvd.cloudfront.net/users/13226_original.jpeg?1538765266",
138
+ },
139
+ },
140
+ userToken: {
141
+ token: "WDCINRKRKYQ3TUEUEUEHEGWN6WKXP7N12345C8CSHQVJD7D6I",
142
+ tokenType: "permanent",
143
+ },
144
+ contact: {
145
+ facility: {
146
+ id: 128492,
147
+ name: "<value>",
148
+ },
149
+ system: 851061,
150
+ status: "Inactive",
151
+ department: 123,
152
+ },
153
+ });
154
+ });
155
+
156
+ test("User Magiclink", async () => {
157
+ const greenSecurity = new GreenSecurity({
158
+ serverURL: "https://dev.repconnex.com:3000/api",
159
+ security: {
160
+ bearerJwt: "",
161
+ },
162
+ httpClient: createTestHTTPClient("magiclink"),
163
+ });
164
+
165
+ const result = await greenSecurity.user.magiclink({
166
+ email: "Ethel.Schroeder9@yahoo.com",
167
+ });
168
+ expect(result).toBeDefined();
169
+ });
170
+
171
+ test("User Password Reset Request", async () => {
172
+ const greenSecurity = new GreenSecurity({
173
+ serverURL: "https://dev.repconnex.com:3000/api",
174
+ security: {
175
+ bearerJwt: "",
176
+ },
177
+ httpClient: createTestHTTPClient("passwordResetRequest"),
178
+ });
179
+
180
+ const result = await greenSecurity.user.passwordResetRequest({
181
+ email: "Deon76@yahoo.com",
182
+ });
183
+ expect(result).toBeDefined();
184
+ });
185
+
186
+ test("User Password", async () => {
187
+ const greenSecurity = new GreenSecurity({
188
+ serverURL: "https://dev.repconnex.com:3000/api",
189
+ security: {
190
+ bearerJwt: "",
191
+ },
192
+ httpClient: createTestHTTPClient("password"),
193
+ });
194
+
195
+ const result = await greenSecurity.user.password({
196
+ paswordResetToken: "<value>",
197
+ password: "BT_1LEAfXTRpaLs",
198
+ });
199
+ expect(result).toBeDefined();
200
+ });
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { expect, test } from "vitest";
6
+ import { GreenSecurity } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Vendors Create Vendor Registration", async () => {
10
+ const greenSecurity = new GreenSecurity({
11
+ serverURL: "https://dev.repconnex.com:3000/api",
12
+ security: {
13
+ bearerJwt: "",
14
+ },
15
+ httpClient: createTestHTTPClient("createVendorRegistration"),
16
+ });
17
+
18
+ const result = await greenSecurity.vendors.createVendorRegistration({
19
+ email: "user@example.com",
20
+ password: "Abcdef123!",
21
+ timezone: "America/Chicago",
22
+ affiliateId: 123,
23
+ vendorGroupId: 123,
24
+ managingCompanyId: 123,
25
+ });
26
+ expect(result).toBeDefined();
27
+ expect(result).toEqual({
28
+ data: {},
29
+ });
30
+ });
31
+
32
+ test("Vendors List Vendor Job Titles", async () => {
33
+ const greenSecurity = new GreenSecurity({
34
+ serverURL: "https://dev.repconnex.com:3000/api",
35
+ security: {
36
+ bearerJwt: "",
37
+ },
38
+ httpClient: createTestHTTPClient("listVendorJobTitles"),
39
+ });
40
+
41
+ const result = await greenSecurity.vendors.listVendorJobTitles({
42
+ sort: "job",
43
+ desc: true,
44
+ itemsPerPage: 25,
45
+ jobLike: "job",
46
+ });
47
+ expect(result).toBeDefined();
48
+ expect(result).toEqual({
49
+ pager: {
50
+ baseUrl: "api/vendors/job_titles",
51
+ sort: "job,title",
52
+ desc: 1,
53
+ itemCount: 228,
54
+ itemsPerPage: 307858,
55
+ page: 1,
56
+ useUrlParams: true,
57
+ },
58
+ items: [
59
+ {
60
+ id: 191114,
61
+ job: "Account Representatives/Managers|Account Executive",
62
+ },
63
+ ],
64
+ });
65
+ });
@@ -125,7 +125,7 @@ async function $do(
125
125
  path: path,
126
126
  headers: headers,
127
127
  body: body,
128
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
128
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
129
129
  }, options);
130
130
  if (!requestRes.ok) {
131
131
  return [requestRes, { status: "invalid" }];
@@ -139,7 +139,7 @@ async function $do(
139
139
  headers: headers,
140
140
  query: query,
141
141
  body: body,
142
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
142
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
143
143
  }, options);
144
144
  if (!requestRes.ok) {
145
145
  return [requestRes, { status: "invalid" }];
@@ -98,7 +98,7 @@ async function $do(
98
98
  baseURL: options?.serverURL,
99
99
  path: path,
100
100
  headers: headers,
101
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
101
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
102
102
  }, options);
103
103
  if (!requestRes.ok) {
104
104
  return [requestRes, { status: "invalid" }];
@@ -123,7 +123,7 @@ async function $do(
123
123
  path: path,
124
124
  headers: headers,
125
125
  body: body,
126
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
126
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
127
127
  }, options);
128
128
  if (!requestRes.ok) {
129
129
  return [requestRes, { status: "invalid" }];
@@ -142,7 +142,7 @@ async function $do(
142
142
  path: path,
143
143
  headers: headers,
144
144
  body: body,
145
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
145
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
146
146
  }, options);
147
147
  if (!requestRes.ok) {
148
148
  return [requestRes, { status: "invalid" }];
@@ -116,7 +116,7 @@ async function $do(
116
116
  path: path,
117
117
  headers: headers,
118
118
  body: body,
119
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
119
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
120
120
  }, options);
121
121
  if (!requestRes.ok) {
122
122
  return [requestRes, { status: "invalid" }];
@@ -117,7 +117,7 @@ async function $do(
117
117
  path: path,
118
118
  headers: headers,
119
119
  body: body,
120
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
120
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
121
121
  }, options);
122
122
  if (!requestRes.ok) {
123
123
  return [requestRes, { status: "invalid" }];
@@ -117,7 +117,7 @@ async function $do(
117
117
  path: path,
118
118
  headers: headers,
119
119
  body: body,
120
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
120
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
121
121
  }, options);
122
122
  if (!requestRes.ok) {
123
123
  return [requestRes, { status: "invalid" }];
@@ -114,7 +114,7 @@ async function $do(
114
114
  path: path,
115
115
  headers: headers,
116
116
  body: body,
117
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
117
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
118
118
  }, options);
119
119
  if (!requestRes.ok) {
120
120
  return [requestRes, { status: "invalid" }];
@@ -122,7 +122,7 @@ async function $do(
122
122
  headers: headers,
123
123
  query: query,
124
124
  body: body,
125
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
125
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000,
126
126
  }, options);
127
127
  if (!requestRes.ok) {
128
128
  return [requestRes, { status: "invalid" }];
package/src/lib/config.ts CHANGED
@@ -30,7 +30,10 @@ export type SDKOptions = {
30
30
  /**
31
31
  * The security details required to authenticate the SDK
32
32
  */
33
- security?: components.Security | (() => Promise<components.Security>);
33
+ security?:
34
+ | components.Security
35
+ | (() => Promise<components.Security>)
36
+ | undefined;
34
37
 
35
38
  httpClient?: HTTPClient;
36
39
  /**
@@ -69,8 +72,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
69
72
  export const SDK_METADATA = {
70
73
  language: "typescript",
71
74
  openapiDocVersion: "0.0.3",
72
- sdkVersion: "0.11.0",
73
- genVersion: "2.518.1",
75
+ sdkVersion: "0.12.1",
76
+ genVersion: "2.529.2",
74
77
  userAgent:
75
- "speakeasy-sdk/typescript 0.11.0 2.518.1 0.0.3 @greensecurity/javascript-sdk",
78
+ "speakeasy-sdk/typescript 0.12.1 2.529.2 0.0.3 @greensecurity/javascript-sdk",
76
79
  } as const;