@greensecurity/javascript-sdk 0.49.0-beta.7 → 0.49.0-beta.8

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 (102) hide show
  1. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  2. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  3. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  5. package/dist/commonjs/__tests__/zones.test.js +4 -29
  6. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  7. package/dist/commonjs/admin-funcs/registerCompanies.d.ts +16 -1
  8. package/dist/commonjs/admin-funcs/registerCompanies.d.ts.map +1 -1
  9. package/dist/commonjs/admin-funcs/registerCompanies.js +10 -0
  10. package/dist/commonjs/admin-funcs/registerCompanies.js.map +1 -1
  11. package/dist/commonjs/admin-funcs/registerGeneralInfo.d.ts +5 -4
  12. package/dist/commonjs/admin-funcs/registerGeneralInfo.d.ts.map +1 -1
  13. package/dist/commonjs/admin-funcs/registerGeneralInfo.js.map +1 -1
  14. package/dist/commonjs/admin-funcs/registerPassword.d.ts +2 -1
  15. package/dist/commonjs/admin-funcs/registerPassword.d.ts.map +1 -1
  16. package/dist/commonjs/admin-funcs/registerPassword.js.map +1 -1
  17. package/dist/commonjs/funcs/companiesLookupCompanies.js +2 -0
  18. package/dist/commonjs/funcs/companiesLookupCompanies.js.map +1 -1
  19. package/dist/commonjs/index.extras.d.ts +3 -1
  20. package/dist/commonjs/index.extras.d.ts.map +1 -1
  21. package/dist/commonjs/index.extras.js +3 -1
  22. package/dist/commonjs/index.extras.js.map +1 -1
  23. package/dist/commonjs/lib/config.d.ts +3 -3
  24. package/dist/commonjs/lib/config.js +3 -3
  25. package/dist/commonjs/models/components/companylookup.d.ts +21 -1
  26. package/dist/commonjs/models/components/companylookup.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/companylookup.js +5 -0
  28. package/dist/commonjs/models/components/companylookup.js.map +1 -1
  29. package/dist/commonjs/models/operations/createvendor.d.ts +0 -5
  30. package/dist/commonjs/models/operations/createvendor.d.ts.map +1 -1
  31. package/dist/commonjs/models/operations/createvendor.js +0 -1
  32. package/dist/commonjs/models/operations/createvendor.js.map +1 -1
  33. package/dist/commonjs/models/operations/lookupcompanies.d.ts +13 -0
  34. package/dist/commonjs/models/operations/lookupcompanies.d.ts.map +1 -1
  35. package/dist/commonjs/models/operations/lookupcompanies.js +4 -0
  36. package/dist/commonjs/models/operations/lookupcompanies.js.map +1 -1
  37. package/dist/commonjs/react-query/companiesLookupCompanies.core.d.ts +4 -0
  38. package/dist/commonjs/react-query/companiesLookupCompanies.core.d.ts.map +1 -1
  39. package/dist/commonjs/react-query/companiesLookupCompanies.core.js +4 -0
  40. package/dist/commonjs/react-query/companiesLookupCompanies.core.js.map +1 -1
  41. package/dist/commonjs/react-query/companiesLookupCompanies.d.ts +4 -0
  42. package/dist/commonjs/react-query/companiesLookupCompanies.d.ts.map +1 -1
  43. package/dist/commonjs/react-query/companiesLookupCompanies.js.map +1 -1
  44. package/dist/esm/__tests__/vendors.test.js +1 -1
  45. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  46. package/dist/esm/__tests__/webhooks.test.js +1 -1
  47. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  48. package/dist/esm/__tests__/zones.test.js +4 -29
  49. package/dist/esm/__tests__/zones.test.js.map +1 -1
  50. package/dist/esm/admin-funcs/registerCompanies.d.ts +16 -1
  51. package/dist/esm/admin-funcs/registerCompanies.d.ts.map +1 -1
  52. package/dist/esm/admin-funcs/registerCompanies.js +9 -1
  53. package/dist/esm/admin-funcs/registerCompanies.js.map +1 -1
  54. package/dist/esm/admin-funcs/registerGeneralInfo.d.ts +5 -4
  55. package/dist/esm/admin-funcs/registerGeneralInfo.d.ts.map +1 -1
  56. package/dist/esm/admin-funcs/registerGeneralInfo.js.map +1 -1
  57. package/dist/esm/admin-funcs/registerPassword.d.ts +2 -1
  58. package/dist/esm/admin-funcs/registerPassword.d.ts.map +1 -1
  59. package/dist/esm/admin-funcs/registerPassword.js.map +1 -1
  60. package/dist/esm/funcs/companiesLookupCompanies.js +2 -0
  61. package/dist/esm/funcs/companiesLookupCompanies.js.map +1 -1
  62. package/dist/esm/index.extras.d.ts +3 -1
  63. package/dist/esm/index.extras.d.ts.map +1 -1
  64. package/dist/esm/index.extras.js +4 -2
  65. package/dist/esm/index.extras.js.map +1 -1
  66. package/dist/esm/lib/config.d.ts +3 -3
  67. package/dist/esm/lib/config.js +3 -3
  68. package/dist/esm/models/components/companylookup.d.ts +21 -1
  69. package/dist/esm/models/components/companylookup.d.ts.map +1 -1
  70. package/dist/esm/models/components/companylookup.js +5 -0
  71. package/dist/esm/models/components/companylookup.js.map +1 -1
  72. package/dist/esm/models/operations/createvendor.d.ts +0 -5
  73. package/dist/esm/models/operations/createvendor.d.ts.map +1 -1
  74. package/dist/esm/models/operations/createvendor.js +0 -1
  75. package/dist/esm/models/operations/createvendor.js.map +1 -1
  76. package/dist/esm/models/operations/lookupcompanies.d.ts +13 -0
  77. package/dist/esm/models/operations/lookupcompanies.d.ts.map +1 -1
  78. package/dist/esm/models/operations/lookupcompanies.js +4 -0
  79. package/dist/esm/models/operations/lookupcompanies.js.map +1 -1
  80. package/dist/esm/react-query/companiesLookupCompanies.core.d.ts +4 -0
  81. package/dist/esm/react-query/companiesLookupCompanies.core.d.ts.map +1 -1
  82. package/dist/esm/react-query/companiesLookupCompanies.core.js +4 -0
  83. package/dist/esm/react-query/companiesLookupCompanies.core.js.map +1 -1
  84. package/dist/esm/react-query/companiesLookupCompanies.d.ts +4 -0
  85. package/dist/esm/react-query/companiesLookupCompanies.d.ts.map +1 -1
  86. package/dist/esm/react-query/companiesLookupCompanies.js.map +1 -1
  87. package/jsr.json +1 -1
  88. package/package.json +1 -1
  89. package/src/__tests__/vendors.test.ts +1 -1
  90. package/src/__tests__/webhooks.test.ts +1 -1
  91. package/src/__tests__/zones.test.ts +4 -29
  92. package/src/admin-funcs/registerCompanies.ts +22 -2
  93. package/src/admin-funcs/registerGeneralInfo.ts +5 -4
  94. package/src/admin-funcs/registerPassword.ts +2 -1
  95. package/src/funcs/companiesLookupCompanies.ts +2 -0
  96. package/src/index.extras.ts +8 -2
  97. package/src/lib/config.ts +3 -3
  98. package/src/models/components/companylookup.ts +26 -1
  99. package/src/models/operations/createvendor.ts +0 -6
  100. package/src/models/operations/lookupcompanies.ts +17 -0
  101. package/src/react-query/companiesLookupCompanies.core.ts +8 -0
  102. package/src/react-query/companiesLookupCompanies.ts +4 -0
@@ -2,7 +2,6 @@ import { APIPromise } from "../types/async.js";
2
2
  import { $doPost, internalApiResult } from "./doAdmin.js";
3
3
 
4
4
  export type formInputs = {
5
- federal: string;
6
5
  first_name: string;
7
6
  last_name: string;
8
7
  vendor_job_id: number;
@@ -11,9 +10,11 @@ export type formInputs = {
11
10
  fax: string;
12
11
  timezone: string;
13
12
  company_id: string;
14
- supervisor_name: string;
15
- supervisor_email: string;
16
- supervisor_phone: string;
13
+ /** When true the supervisor fields are omitted and cleared. */
14
+ no_supervisor?: boolean;
15
+ supervisor_name?: string;
16
+ supervisor_email?: string;
17
+ supervisor_phone?: string;
17
18
  /** Contact emails; the login stays the email the vendor registered with, which must be one of the two. */
18
19
  work_email?: string;
19
20
  personal_email?: string;
@@ -3,7 +3,8 @@ import { $doPost, internalApiResult } from "./doAdmin.js";
3
3
 
4
4
  export type passwordRegisterData = {
5
5
  password: string | null;
6
- password_confirm: string | null;
6
+ /** Omitted by the single-field form. */
7
+ password_confirm?: string | null;
7
8
  };
8
9
 
9
10
  export function submitPassword(request: passwordRegisterData): internalApiResult {
@@ -113,9 +113,11 @@ async function $do(
113
113
  const query = encodeFormQuery({
114
114
  "desc": payload.desc,
115
115
  "items_per_page": payload.items_per_page,
116
+ "match_email_domain": payload.match_email_domain,
116
117
  "name_like": payload.name_like,
117
118
  "page": payload.page,
118
119
  "sort": payload.sort,
120
+ "tax_id": payload.tax_id,
119
121
  });
120
122
 
121
123
  const headers = new Headers(compactMap({
@@ -32,7 +32,11 @@ import { handoffStayAlive } from "./admin-funcs/handoffStayAlive.js";
32
32
  import { submitEmailStep } from "./admin-funcs/registerEmail.js";
33
33
  import { submitPassword } from "./admin-funcs/registerPassword.js";
34
34
  import { submitGeneralInfo } from "./admin-funcs/registerGeneralInfo.js";
35
- import { submitCompany } from "./admin-funcs/registerCompanies.js";
35
+ import {
36
+ getCompanySupervisors,
37
+ prefillCompany,
38
+ submitCompany,
39
+ } from "./admin-funcs/registerCompanies.js";
36
40
  import {
37
41
  clearComplete,
38
42
  clearCreateSession,
@@ -134,7 +138,9 @@ export const __internal = {
134
138
  submitEmailStep,
135
139
  submitPassword,
136
140
  submitGeneralInfo,
137
- submitCompany
141
+ submitCompany,
142
+ prefillCompany,
143
+ getCompanySupervisors
138
144
  },
139
145
 
140
146
  clear: {
package/src/lib/config.ts CHANGED
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
82
  openapiDocVersion: "0.48.0",
83
- sdkVersion: "0.49.0-beta.7",
84
- genVersion: "2.960.7",
83
+ sdkVersion: "0.49.0-beta.8",
84
+ genVersion: "2.960.8",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.49.0-beta.7 2.960.7 0.48.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.49.0-beta.8 2.960.8 0.48.0 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -9,7 +9,7 @@ import * as types from "../../types/primitives.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  /**
12
- * A minimal reference to a company, used in lookups.
12
+ * A minimal reference to a company, used in lookups. Never includes the tax ID.
13
13
  */
14
14
  export type CompanyLookup = {
15
15
  /**
@@ -20,6 +20,26 @@ export type CompanyLookup = {
20
20
  * The name of the company, or `null` if none.
21
21
  */
22
22
  name: string | null;
23
+ /**
24
+ * The company status, such as `Active`, or `Inactive` while it awaits review.
25
+ */
26
+ status?: string | null | undefined;
27
+ /**
28
+ * The company's first email domain, else its website host, or `null` if neither.
29
+ */
30
+ domain?: string | null | undefined;
31
+ /**
32
+ * The company website, or `null` if none.
33
+ */
34
+ website?: string | null | undefined;
35
+ /**
36
+ * The company city, or `null` if none.
37
+ */
38
+ city?: string | null | undefined;
39
+ /**
40
+ * The company state or province, or `null` if none.
41
+ */
42
+ state?: string | null | undefined;
23
43
  };
24
44
 
25
45
  /** @internal */
@@ -30,6 +50,11 @@ export const CompanyLookup$inboundSchema: z.ZodType<
30
50
  > = z.object({
31
51
  id: types.number(),
32
52
  name: types.nullable(types.string()),
53
+ status: z.nullable(types.string()).optional(),
54
+ domain: z.nullable(types.string()).optional(),
55
+ website: z.nullable(types.string()).optional(),
56
+ city: z.nullable(types.string()).optional(),
57
+ state: z.nullable(types.string()).optional(),
33
58
  });
34
59
 
35
60
  export function companyLookupFromJSON(
@@ -49,10 +49,6 @@ export type CreateVendorRequestBody = {
49
49
  * Rails timezone name (for example, Eastern Time (US and Canada))
50
50
  */
51
51
  timezone?: string | undefined;
52
- /**
53
- * Whether a federal agency has listed the vendor as disbarred or excluded
54
- */
55
- federal?: boolean | undefined;
56
52
  /**
57
53
  * ID of the vendor's primary facility
58
54
  */
@@ -122,7 +118,6 @@ export type CreateVendorRequestBody$Outbound = {
122
118
  mobile_phone?: string | undefined;
123
119
  fax?: string | undefined;
124
120
  timezone?: string | undefined;
125
- federal?: boolean | undefined;
126
121
  primary_facility_id: number;
127
122
  supervisor_name: string;
128
123
  supervisor_email: string;
@@ -150,7 +145,6 @@ export const CreateVendorRequestBody$outboundSchema: z.ZodType<
150
145
  mobilePhone: z.string().optional(),
151
146
  fax: z.string().optional(),
152
147
  timezone: z.string().optional(),
153
- federal: z.boolean().optional(),
154
148
  primaryFacilityId: z.number().int(),
155
149
  supervisorName: z.string(),
156
150
  supervisorEmail: z.string(),
@@ -30,6 +30,17 @@ export type LookupCompaniesRequest = {
30
30
  * A partial string to search in the object name. Do not include any wildcard characters. Searches are not case-sensitive by default.
31
31
  */
32
32
  nameLike?: string | undefined;
33
+ /**
34
+ * Only the company holding this federal tax ID (EIN or SSN format, dash optional).
35
+ */
36
+ taxId?: string | undefined;
37
+ /**
38
+ * Only companies that own the caller's login email domain, or whose vendors sign in with it.
39
+ *
40
+ * @remarks
41
+ * Free-mail domains such as gmail.com match nothing.
42
+ */
43
+ matchEmailDomain?: boolean | undefined;
33
44
  };
34
45
 
35
46
  /**
@@ -54,6 +65,8 @@ export type LookupCompaniesRequest$Outbound = {
54
65
  page?: number | undefined;
55
66
  items_per_page: number;
56
67
  name_like?: string | undefined;
68
+ tax_id?: string | undefined;
69
+ match_email_domain?: boolean | undefined;
57
70
  };
58
71
 
59
72
  /** @internal */
@@ -67,10 +80,14 @@ export const LookupCompaniesRequest$outboundSchema: z.ZodType<
67
80
  page: z.number().int().optional(),
68
81
  itemsPerPage: z.number().int().default(25),
69
82
  nameLike: z.string().optional(),
83
+ taxId: z.string().optional(),
84
+ matchEmailDomain: z.boolean().optional(),
70
85
  }).transform((v) => {
71
86
  return remap$(v, {
72
87
  itemsPerPage: "items_per_page",
73
88
  nameLike: "name_like",
89
+ taxId: "tax_id",
90
+ matchEmailDomain: "match_email_domain",
74
91
  });
75
92
  });
76
93
 
@@ -80,6 +80,8 @@ export function buildCompaniesLookupCompaniesQuery(
80
80
  page: request.page,
81
81
  itemsPerPage: request.itemsPerPage,
82
82
  nameLike: request.nameLike,
83
+ taxId: request.taxId,
84
+ matchEmailDomain: request.matchEmailDomain,
83
85
  }),
84
86
  queryFn: async function companiesLookupCompaniesQueryFn(
85
87
  ctx,
@@ -121,6 +123,8 @@ export function buildCompaniesLookupCompaniesInfiniteQuery(
121
123
  page: request.page,
122
124
  itemsPerPage: request.itemsPerPage,
123
125
  nameLike: request.nameLike,
126
+ taxId: request.taxId,
127
+ matchEmailDomain: request.matchEmailDomain,
124
128
  }),
125
129
  queryFn: async function companiesLookupCompaniesQuery(
126
130
  ctx,
@@ -159,6 +163,8 @@ export function queryKeyCompaniesLookupCompanies(
159
163
  page?: number | undefined;
160
164
  itemsPerPage?: number | undefined;
161
165
  nameLike?: string | undefined;
166
+ taxId?: string | undefined;
167
+ matchEmailDomain?: boolean | undefined;
162
168
  },
163
169
  ): QueryKey {
164
170
  return [
@@ -176,6 +182,8 @@ export function queryKeyCompaniesLookupCompaniesInfinite(
176
182
  page?: number | undefined;
177
183
  itemsPerPage?: number | undefined;
178
184
  nameLike?: string | undefined;
185
+ taxId?: string | undefined;
186
+ matchEmailDomain?: boolean | undefined;
179
187
  },
180
188
  ): QueryKey {
181
189
  return [
@@ -236,6 +236,8 @@ export function setCompaniesLookupCompaniesData(
236
236
  page?: number | undefined;
237
237
  itemsPerPage?: number | undefined;
238
238
  nameLike?: string | undefined;
239
+ taxId?: string | undefined;
240
+ matchEmailDomain?: boolean | undefined;
239
241
  },
240
242
  ],
241
243
  data: CompaniesLookupCompaniesQueryData,
@@ -254,6 +256,8 @@ export function invalidateCompaniesLookupCompanies(
254
256
  page?: number | undefined;
255
257
  itemsPerPage?: number | undefined;
256
258
  nameLike?: string | undefined;
259
+ taxId?: string | undefined;
260
+ matchEmailDomain?: boolean | undefined;
257
261
  }]
258
262
  >,
259
263
  filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,