@greensecurity/javascript-sdk 0.45.0-beta.11 → 0.45.0-beta.12

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 (192) hide show
  1. package/README.md +1 -4
  2. package/dist/commonjs/__tests__/lookups.test.js +0 -21
  3. package/dist/commonjs/__tests__/lookups.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  5. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +9 -11
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/usersUpdateUser.d.ts +0 -6
  9. package/dist/commonjs/funcs/usersUpdateUser.d.ts.map +1 -1
  10. package/dist/commonjs/funcs/usersUpdateUser.js +0 -6
  11. package/dist/commonjs/funcs/usersUpdateUser.js.map +1 -1
  12. package/dist/commonjs/funcs/vendorsCreateVendor.d.ts +0 -4
  13. package/dist/commonjs/funcs/vendorsCreateVendor.d.ts.map +1 -1
  14. package/dist/commonjs/funcs/vendorsCreateVendor.js +0 -4
  15. package/dist/commonjs/funcs/vendorsCreateVendor.js.map +1 -1
  16. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts +1 -9
  17. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
  18. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js +1 -9
  19. package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js.map +1 -1
  20. package/dist/commonjs/index.extras.d.ts +0 -6
  21. package/dist/commonjs/index.extras.d.ts.map +1 -1
  22. package/dist/commonjs/index.extras.js +0 -6
  23. package/dist/commonjs/index.extras.js.map +1 -1
  24. package/dist/commonjs/lib/config.d.ts +4 -4
  25. package/dist/commonjs/lib/config.js +4 -4
  26. package/dist/commonjs/models/operations/createvendorcompany.d.ts +1 -7
  27. package/dist/commonjs/models/operations/createvendorcompany.d.ts.map +1 -1
  28. package/dist/commonjs/models/operations/createvendorcompany.js.map +1 -1
  29. package/dist/commonjs/models/operations/index.d.ts +0 -1
  30. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  31. package/dist/commonjs/models/operations/index.js +0 -1
  32. package/dist/commonjs/models/operations/index.js.map +1 -1
  33. package/dist/commonjs/react-query/index.d.ts +0 -1
  34. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  35. package/dist/commonjs/react-query/index.js +0 -1
  36. package/dist/commonjs/react-query/index.js.map +1 -1
  37. package/dist/commonjs/react-query/usersUpdateUser.d.ts +0 -6
  38. package/dist/commonjs/react-query/usersUpdateUser.d.ts.map +1 -1
  39. package/dist/commonjs/react-query/usersUpdateUser.js +0 -6
  40. package/dist/commonjs/react-query/usersUpdateUser.js.map +1 -1
  41. package/dist/commonjs/react-query/vendorsCreateVendor.d.ts +0 -4
  42. package/dist/commonjs/react-query/vendorsCreateVendor.d.ts.map +1 -1
  43. package/dist/commonjs/react-query/vendorsCreateVendor.js +0 -4
  44. package/dist/commonjs/react-query/vendorsCreateVendor.js.map +1 -1
  45. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts +1 -9
  46. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
  47. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js +1 -9
  48. package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js.map +1 -1
  49. package/dist/commonjs/sdk/lookups.d.ts +0 -22
  50. package/dist/commonjs/sdk/lookups.d.ts.map +1 -1
  51. package/dist/commonjs/sdk/lookups.js +0 -25
  52. package/dist/commonjs/sdk/lookups.js.map +1 -1
  53. package/dist/commonjs/sdk/users.d.ts +0 -6
  54. package/dist/commonjs/sdk/users.d.ts.map +1 -1
  55. package/dist/commonjs/sdk/users.js +0 -6
  56. package/dist/commonjs/sdk/users.js.map +1 -1
  57. package/dist/commonjs/sdk/vendors.d.ts +1 -13
  58. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  59. package/dist/commonjs/sdk/vendors.js +1 -13
  60. package/dist/commonjs/sdk/vendors.js.map +1 -1
  61. package/dist/esm/__tests__/lookups.test.js +0 -21
  62. package/dist/esm/__tests__/lookups.test.js.map +1 -1
  63. package/dist/esm/__tests__/vendors.test.js +1 -1
  64. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  65. package/dist/esm/__tests__/zones.test.js +9 -11
  66. package/dist/esm/__tests__/zones.test.js.map +1 -1
  67. package/dist/esm/funcs/usersUpdateUser.d.ts +0 -6
  68. package/dist/esm/funcs/usersUpdateUser.d.ts.map +1 -1
  69. package/dist/esm/funcs/usersUpdateUser.js +0 -6
  70. package/dist/esm/funcs/usersUpdateUser.js.map +1 -1
  71. package/dist/esm/funcs/vendorsCreateVendor.d.ts +0 -4
  72. package/dist/esm/funcs/vendorsCreateVendor.d.ts.map +1 -1
  73. package/dist/esm/funcs/vendorsCreateVendor.js +0 -4
  74. package/dist/esm/funcs/vendorsCreateVendor.js.map +1 -1
  75. package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts +1 -9
  76. package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
  77. package/dist/esm/funcs/vendorsUpdateVendorDetails.js +1 -9
  78. package/dist/esm/funcs/vendorsUpdateVendorDetails.js.map +1 -1
  79. package/dist/esm/index.extras.d.ts +0 -6
  80. package/dist/esm/index.extras.d.ts.map +1 -1
  81. package/dist/esm/index.extras.js +0 -6
  82. package/dist/esm/index.extras.js.map +1 -1
  83. package/dist/esm/lib/config.d.ts +4 -4
  84. package/dist/esm/lib/config.js +4 -4
  85. package/dist/esm/models/operations/createvendorcompany.d.ts +1 -7
  86. package/dist/esm/models/operations/createvendorcompany.d.ts.map +1 -1
  87. package/dist/esm/models/operations/createvendorcompany.js.map +1 -1
  88. package/dist/esm/models/operations/index.d.ts +0 -1
  89. package/dist/esm/models/operations/index.d.ts.map +1 -1
  90. package/dist/esm/models/operations/index.js +0 -1
  91. package/dist/esm/models/operations/index.js.map +1 -1
  92. package/dist/esm/react-query/index.d.ts +0 -1
  93. package/dist/esm/react-query/index.d.ts.map +1 -1
  94. package/dist/esm/react-query/index.js +0 -1
  95. package/dist/esm/react-query/index.js.map +1 -1
  96. package/dist/esm/react-query/usersUpdateUser.d.ts +0 -6
  97. package/dist/esm/react-query/usersUpdateUser.d.ts.map +1 -1
  98. package/dist/esm/react-query/usersUpdateUser.js +0 -6
  99. package/dist/esm/react-query/usersUpdateUser.js.map +1 -1
  100. package/dist/esm/react-query/vendorsCreateVendor.d.ts +0 -4
  101. package/dist/esm/react-query/vendorsCreateVendor.d.ts.map +1 -1
  102. package/dist/esm/react-query/vendorsCreateVendor.js +0 -4
  103. package/dist/esm/react-query/vendorsCreateVendor.js.map +1 -1
  104. package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts +1 -9
  105. package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
  106. package/dist/esm/react-query/vendorsUpdateVendorDetails.js +1 -9
  107. package/dist/esm/react-query/vendorsUpdateVendorDetails.js.map +1 -1
  108. package/dist/esm/sdk/lookups.d.ts +0 -22
  109. package/dist/esm/sdk/lookups.d.ts.map +1 -1
  110. package/dist/esm/sdk/lookups.js +0 -25
  111. package/dist/esm/sdk/lookups.js.map +1 -1
  112. package/dist/esm/sdk/users.d.ts +0 -6
  113. package/dist/esm/sdk/users.d.ts.map +1 -1
  114. package/dist/esm/sdk/users.js +0 -6
  115. package/dist/esm/sdk/users.js.map +1 -1
  116. package/dist/esm/sdk/vendors.d.ts +1 -13
  117. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  118. package/dist/esm/sdk/vendors.js +1 -13
  119. package/dist/esm/sdk/vendors.js.map +1 -1
  120. package/jsr.json +1 -1
  121. package/package.json +1 -1
  122. package/src/__tests__/lookups.test.ts +0 -24
  123. package/src/__tests__/vendors.test.ts +1 -1
  124. package/src/__tests__/zones.test.ts +9 -11
  125. package/src/funcs/usersUpdateUser.ts +0 -6
  126. package/src/funcs/vendorsCreateVendor.ts +0 -4
  127. package/src/funcs/vendorsUpdateVendorDetails.ts +1 -9
  128. package/src/index.extras.ts +0 -8
  129. package/src/lib/config.ts +4 -4
  130. package/src/models/operations/createvendorcompany.ts +1 -7
  131. package/src/models/operations/index.ts +0 -1
  132. package/src/react-query/index.ts +0 -1
  133. package/src/react-query/usersUpdateUser.ts +0 -6
  134. package/src/react-query/vendorsCreateVendor.ts +0 -4
  135. package/src/react-query/vendorsUpdateVendorDetails.ts +1 -9
  136. package/src/sdk/lookups.ts +0 -33
  137. package/src/sdk/users.ts +0 -6
  138. package/src/sdk/vendors.ts +1 -13
  139. package/dist/commonjs/admin-funcs/dismissCommunication.d.ts +0 -3
  140. package/dist/commonjs/admin-funcs/dismissCommunication.d.ts.map +0 -1
  141. package/dist/commonjs/admin-funcs/dismissCommunication.js +0 -20
  142. package/dist/commonjs/admin-funcs/dismissCommunication.js.map +0 -1
  143. package/dist/commonjs/admin-funcs/listCommunications.d.ts +0 -3
  144. package/dist/commonjs/admin-funcs/listCommunications.d.ts.map +0 -1
  145. package/dist/commonjs/admin-funcs/listCommunications.js +0 -25
  146. package/dist/commonjs/admin-funcs/listCommunications.js.map +0 -1
  147. package/dist/commonjs/funcs/lookupsLookupPostalCode.d.ts +0 -35
  148. package/dist/commonjs/funcs/lookupsLookupPostalCode.d.ts.map +0 -1
  149. package/dist/commonjs/funcs/lookupsLookupPostalCode.js +0 -140
  150. package/dist/commonjs/funcs/lookupsLookupPostalCode.js.map +0 -1
  151. package/dist/commonjs/models/operations/lookuppostalcode.d.ts +0 -59
  152. package/dist/commonjs/models/operations/lookuppostalcode.d.ts.map +0 -1
  153. package/dist/commonjs/models/operations/lookuppostalcode.js +0 -81
  154. package/dist/commonjs/models/operations/lookuppostalcode.js.map +0 -1
  155. package/dist/commonjs/react-query/lookupsLookupPostalCode.core.d.ts +0 -16
  156. package/dist/commonjs/react-query/lookupsLookupPostalCode.core.d.ts.map +0 -1
  157. package/dist/commonjs/react-query/lookupsLookupPostalCode.core.js +0 -43
  158. package/dist/commonjs/react-query/lookupsLookupPostalCode.core.js.map +0 -1
  159. package/dist/commonjs/react-query/lookupsLookupPostalCode.d.ts +0 -71
  160. package/dist/commonjs/react-query/lookupsLookupPostalCode.d.ts.map +0 -1
  161. package/dist/commonjs/react-query/lookupsLookupPostalCode.js +0 -95
  162. package/dist/commonjs/react-query/lookupsLookupPostalCode.js.map +0 -1
  163. package/dist/esm/admin-funcs/dismissCommunication.d.ts +0 -3
  164. package/dist/esm/admin-funcs/dismissCommunication.d.ts.map +0 -1
  165. package/dist/esm/admin-funcs/dismissCommunication.js +0 -17
  166. package/dist/esm/admin-funcs/dismissCommunication.js.map +0 -1
  167. package/dist/esm/admin-funcs/listCommunications.d.ts +0 -3
  168. package/dist/esm/admin-funcs/listCommunications.d.ts.map +0 -1
  169. package/dist/esm/admin-funcs/listCommunications.js +0 -22
  170. package/dist/esm/admin-funcs/listCommunications.js.map +0 -1
  171. package/dist/esm/funcs/lookupsLookupPostalCode.d.ts +0 -35
  172. package/dist/esm/funcs/lookupsLookupPostalCode.d.ts.map +0 -1
  173. package/dist/esm/funcs/lookupsLookupPostalCode.js +0 -104
  174. package/dist/esm/funcs/lookupsLookupPostalCode.js.map +0 -1
  175. package/dist/esm/models/operations/lookuppostalcode.d.ts +0 -59
  176. package/dist/esm/models/operations/lookuppostalcode.d.ts.map +0 -1
  177. package/dist/esm/models/operations/lookuppostalcode.js +0 -43
  178. package/dist/esm/models/operations/lookuppostalcode.js.map +0 -1
  179. package/dist/esm/react-query/lookupsLookupPostalCode.core.d.ts +0 -16
  180. package/dist/esm/react-query/lookupsLookupPostalCode.core.d.ts.map +0 -1
  181. package/dist/esm/react-query/lookupsLookupPostalCode.core.js +0 -38
  182. package/dist/esm/react-query/lookupsLookupPostalCode.core.js.map +0 -1
  183. package/dist/esm/react-query/lookupsLookupPostalCode.d.ts +0 -71
  184. package/dist/esm/react-query/lookupsLookupPostalCode.d.ts.map +0 -1
  185. package/dist/esm/react-query/lookupsLookupPostalCode.js +0 -85
  186. package/dist/esm/react-query/lookupsLookupPostalCode.js.map +0 -1
  187. package/src/admin-funcs/dismissCommunication.ts +0 -20
  188. package/src/admin-funcs/listCommunications.ts +0 -29
  189. package/src/funcs/lookupsLookupPostalCode.ts +0 -193
  190. package/src/models/operations/lookuppostalcode.ts +0 -118
  191. package/src/react-query/lookupsLookupPostalCode.core.ts +0 -82
  192. package/src/react-query/lookupsLookupPostalCode.ts +0 -177
@@ -1,43 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import * as z from "zod/v3";
5
- import { remap as remap$ } from "../../lib/primitives.js";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import * as openEnums from "../../types/enums.js";
8
- import * as types from "../../types/primitives.js";
9
- export const LookupPostalCodeStatus = {
10
- Ok: "ok",
11
- Invalid: "invalid",
12
- Mismatch: "mismatch",
13
- Unknown: "unknown",
14
- };
15
- /** @internal */
16
- export const LookupPostalCodeRequest$outboundSchema = z.object({
17
- postalCode: z.string(),
18
- state: z.string(),
19
- country: z.string(),
20
- }).transform((v) => {
21
- return remap$(v, {
22
- postalCode: "postal_code",
23
- });
24
- });
25
- export function lookupPostalCodeRequestToJSON(lookupPostalCodeRequest) {
26
- return JSON.stringify(LookupPostalCodeRequest$outboundSchema.parse(lookupPostalCodeRequest));
27
- }
28
- /** @internal */
29
- export const LookupPostalCodeStatus$inboundSchema = openEnums.inboundSchema(LookupPostalCodeStatus);
30
- /** @internal */
31
- export const LookupPostalCodeLookupPostalCodeOk$inboundSchema = z.object({
32
- status: LookupPostalCodeStatus$inboundSchema,
33
- expected_states: z.array(types.string()),
34
- error: types.nullable(types.string()),
35
- }).transform((v) => {
36
- return remap$(v, {
37
- "expected_states": "expectedStates",
38
- });
39
- });
40
- export function lookupPostalCodeLookupPostalCodeOkFromJSON(jsonString) {
41
- return safeParse(jsonString, (x) => LookupPostalCodeLookupPostalCodeOk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LookupPostalCodeLookupPostalCodeOk' from JSON`);
42
- }
43
- //# sourceMappingURL=lookuppostalcode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookuppostalcode.js","sourceRoot":"","sources":["../../../../src/models/operations/lookuppostalcode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAGlD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAkBnD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAC;AA8BX,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAI/C,CAAC,CAAC,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,UAAU,EAAE,aAAa;KAC1B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,6BAA6B,CAC3C,uBAAgD;IAEhD,OAAO,IAAI,CAAC,SAAS,CACnB,sCAAsC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CACtE,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAI7C,SAAS,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;AAEpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,gDAAgD,GAIzD,CAAC,CAAC,MAAM,CAAC;IACX,MAAM,EAAE,oCAAoC;IAC5C,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACxC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;CACtC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,iBAAiB,EAAE,gBAAgB;KACpC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,0CAA0C,CACxD,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,gDAAgD,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACvE,gEAAgE,CACjE,CAAC;AACJ,CAAC"}
@@ -1,16 +0,0 @@
1
- import { QueryClient, QueryFunctionContext, QueryKey } from "@tanstack/react-query";
2
- import { GreenSecurityCore } from "../core.js";
3
- import { RequestOptions } from "../lib/sdks.js";
4
- import * as operations from "../models/operations/index.js";
5
- export type LookupsLookupPostalCodeQueryData = operations.LookupPostalCodeLookupPostalCodeOk;
6
- export declare function prefetchLookupsLookupPostalCode(queryClient: QueryClient, client$: GreenSecurityCore, request: operations.LookupPostalCodeRequest, options?: RequestOptions): Promise<void>;
7
- export declare function buildLookupsLookupPostalCodeQuery(client$: GreenSecurityCore, request: operations.LookupPostalCodeRequest, options?: RequestOptions): {
8
- queryKey: QueryKey;
9
- queryFn: (context: QueryFunctionContext) => Promise<LookupsLookupPostalCodeQueryData>;
10
- };
11
- export declare function queryKeyLookupsLookupPostalCode(parameters: {
12
- postalCode: string;
13
- state: string;
14
- country: string;
15
- }): QueryKey;
16
- //# sourceMappingURL=lookupsLookupPostalCode.core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookupsLookupPostalCode.core.d.ts","sourceRoot":"","sources":["../../../src/react-query/lookupsLookupPostalCode.core.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,MAAM,MAAM,gCAAgC,GAC1C,UAAU,CAAC,kCAAkC,CAAC;AAEhD,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,CACP,OAAO,EAAE,oBAAoB,KAC1B,OAAO,CAAC,gCAAgC,CAAC,CAAC;CAChD,CA4BA;AAED,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjE,QAAQ,CAOV"}
@@ -1,38 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import { lookupsLookupPostalCode } from "../funcs/lookupsLookupPostalCode.js";
5
- import { combineSignals } from "../lib/primitives.js";
6
- import { unwrapAsync } from "../types/fp.js";
7
- export function prefetchLookupsLookupPostalCode(queryClient, client$, request, options) {
8
- return queryClient.prefetchQuery({
9
- ...buildLookupsLookupPostalCodeQuery(client$, request, options),
10
- });
11
- }
12
- export function buildLookupsLookupPostalCodeQuery(client$, request, options) {
13
- return {
14
- queryKey: queryKeyLookupsLookupPostalCode({
15
- postalCode: request.postalCode,
16
- state: request.state,
17
- country: request.country,
18
- }),
19
- queryFn: async function lookupsLookupPostalCodeQueryFn(ctx) {
20
- const sig = combineSignals(ctx.signal, options?.signal, options?.fetchOptions?.signal);
21
- const mergedOptions = {
22
- ...options?.fetchOptions,
23
- ...options,
24
- signal: sig,
25
- };
26
- return unwrapAsync(lookupsLookupPostalCode(client$, request, mergedOptions));
27
- },
28
- };
29
- }
30
- export function queryKeyLookupsLookupPostalCode(parameters) {
31
- return [
32
- "@greensecurity/javascript-sdk",
33
- "lookups",
34
- "lookupPostalCode",
35
- parameters,
36
- ];
37
- }
38
- //# sourceMappingURL=lookupsLookupPostalCode.core.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookupsLookupPostalCode.core.js","sourceRoot":"","sources":["../../../src/react-query/lookupsLookupPostalCode.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C,MAAM,UAAU,+BAA+B,CAC7C,WAAwB,EACxB,OAA0B,EAC1B,OAA2C,EAC3C,OAAwB;IAExB,OAAO,WAAW,CAAC,aAAa,CAAC;QAC/B,GAAG,iCAAiC,CAClC,OAAO,EACP,OAAO,EACP,OAAO,CACR;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,OAA0B,EAC1B,OAA2C,EAC3C,OAAwB;IAOxB,OAAO;QACL,QAAQ,EAAE,+BAA+B,CAAC;YACxC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;QACF,OAAO,EAAE,KAAK,UAAU,8BAA8B,CACpD,GAAG;YAEH,MAAM,GAAG,GAAG,cAAc,CACxB,GAAG,CAAC,MAAM,EACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B,CAAC;YACF,MAAM,aAAa,GAAG;gBACpB,GAAG,OAAO,EAAE,YAAY;gBACxB,GAAG,OAAO;gBACV,MAAM,EAAE,GAAG;aACZ,CAAC;YAEF,OAAO,WAAW,CAAC,uBAAuB,CACxC,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,UAAkE;IAElE,OAAO;QACL,+BAA+B;QAC/B,SAAS;QACT,kBAAkB;QAClB,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -1,71 +0,0 @@
1
- import { InvalidateQueryFilters, QueryClient, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
2
- import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
3
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
- import * as errors from "../models/errors/index.js";
5
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
6
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
7
- import * as operations from "../models/operations/index.js";
8
- import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes } from "./_types.js";
9
- import { buildLookupsLookupPostalCodeQuery, LookupsLookupPostalCodeQueryData, prefetchLookupsLookupPostalCode, queryKeyLookupsLookupPostalCode } from "./lookupsLookupPostalCode.core.js";
10
- export { buildLookupsLookupPostalCodeQuery, type LookupsLookupPostalCodeQueryData, prefetchLookupsLookupPostalCode, queryKeyLookupsLookupPostalCode, };
11
- export type LookupsLookupPostalCodeQueryError = errors.ApiErrorResponse | GreenSecurityError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError;
12
- /**
13
- * Check a postal code against a state and country
14
- *
15
- * @remarks
16
- * Cross-checks a postal code against a state/province and country, the same check
17
- * every write path that stores a US or Canadian address enforces server-side (e.g.
18
- * `PUT /users/{id}`, `PUT /vendors/{vendor_id_or_me}`). Useful for validating an
19
- * address before submitting it elsewhere.
20
- *
21
- * `status` is one of:
22
- * - `ok` — the postal code belongs to the given state/province.
23
- * - `invalid` — the postal code is not shaped like a real one for the given country.
24
- * - `mismatch` — the postal code is well-formed but belongs to a different state or
25
- * province. `expected_states` names the state(s) it actually maps to.
26
- * - `unknown` — nothing to check against (an unsupported country, or a postal code
27
- * absent from the US ZIP dataset). Treated as acceptable by every write path that
28
- * uses this check.
29
- *
30
- * Only the US and Canada have a real code-to-subdivision map; every other country
31
- * always returns `unknown`.
32
- */
33
- export declare function useLookupsLookupPostalCode(request: operations.LookupPostalCodeRequest, options?: QueryHookOptions<LookupsLookupPostalCodeQueryData, LookupsLookupPostalCodeQueryError>): UseQueryResult<LookupsLookupPostalCodeQueryData, LookupsLookupPostalCodeQueryError>;
34
- /**
35
- * Check a postal code against a state and country
36
- *
37
- * @remarks
38
- * Cross-checks a postal code against a state/province and country, the same check
39
- * every write path that stores a US or Canadian address enforces server-side (e.g.
40
- * `PUT /users/{id}`, `PUT /vendors/{vendor_id_or_me}`). Useful for validating an
41
- * address before submitting it elsewhere.
42
- *
43
- * `status` is one of:
44
- * - `ok` — the postal code belongs to the given state/province.
45
- * - `invalid` — the postal code is not shaped like a real one for the given country.
46
- * - `mismatch` — the postal code is well-formed but belongs to a different state or
47
- * province. `expected_states` names the state(s) it actually maps to.
48
- * - `unknown` — nothing to check against (an unsupported country, or a postal code
49
- * absent from the US ZIP dataset). Treated as acceptable by every write path that
50
- * uses this check.
51
- *
52
- * Only the US and Canada have a real code-to-subdivision map; every other country
53
- * always returns `unknown`.
54
- */
55
- export declare function useLookupsLookupPostalCodeSuspense(request: operations.LookupPostalCodeRequest, options?: SuspenseQueryHookOptions<LookupsLookupPostalCodeQueryData, LookupsLookupPostalCodeQueryError>): UseSuspenseQueryResult<LookupsLookupPostalCodeQueryData, LookupsLookupPostalCodeQueryError>;
56
- export declare function setLookupsLookupPostalCodeData(client: QueryClient, queryKeyBase: [
57
- parameters: {
58
- postalCode: string;
59
- state: string;
60
- country: string;
61
- }
62
- ], data: LookupsLookupPostalCodeQueryData): LookupsLookupPostalCodeQueryData | undefined;
63
- export declare function invalidateLookupsLookupPostalCode(client: QueryClient, queryKeyBase: TupleToPrefixes<[
64
- parameters: {
65
- postalCode: string;
66
- state: string;
67
- country: string;
68
- }
69
- ]>, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
70
- export declare function invalidateAllLookupsLookupPostalCode(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
71
- //# sourceMappingURL=lookupsLookupPostalCode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookupsLookupPostalCode.d.ts","sourceRoot":"","sources":["../../../src/react-query/lookupsLookupPostalCode.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,EACtB,WAAW,EAEX,cAAc,EAEd,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iCAAiC,EACjC,KAAK,gCAAgC,EACrC,+BAA+B,EAC/B,+BAA+B,GAChC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GACzC,MAAM,CAAC,gBAAgB,GACvB,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,gBAAgB,CACxB,gCAAgC,EAChC,iCAAiC,CAClC,GACA,cAAc,CACf,gCAAgC,EAChC,iCAAiC,CAClC,CAUA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,wBAAwB,CAChC,gCAAgC,EAChC,iCAAiC,CAClC,GACA,sBAAsB,CACvB,gCAAgC,EAChC,iCAAiC,CAClC,CAUA;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE;IACZ,UAAU,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CACnE,EACD,IAAI,EAAE,gCAAgC,GACrC,gCAAgC,GAAG,SAAS,CAI9C;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,eAAe,CAC3B;IAAC,UAAU,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAAC,CACrE,EACD,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,GACzE,OAAO,CAAC,IAAI,CAAC,CAUf;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,GACzE,OAAO,CAAC,IAAI,CAAC,CAKf"}
@@ -1,85 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import { useQuery, useSuspenseQuery, } from "@tanstack/react-query";
5
- import { useGreenSecurityContext } from "./_context.js";
6
- import { buildLookupsLookupPostalCodeQuery, prefetchLookupsLookupPostalCode, queryKeyLookupsLookupPostalCode, } from "./lookupsLookupPostalCode.core.js";
7
- export { buildLookupsLookupPostalCodeQuery, prefetchLookupsLookupPostalCode, queryKeyLookupsLookupPostalCode, };
8
- /**
9
- * Check a postal code against a state and country
10
- *
11
- * @remarks
12
- * Cross-checks a postal code against a state/province and country, the same check
13
- * every write path that stores a US or Canadian address enforces server-side (e.g.
14
- * `PUT /users/{id}`, `PUT /vendors/{vendor_id_or_me}`). Useful for validating an
15
- * address before submitting it elsewhere.
16
- *
17
- * `status` is one of:
18
- * - `ok` — the postal code belongs to the given state/province.
19
- * - `invalid` — the postal code is not shaped like a real one for the given country.
20
- * - `mismatch` — the postal code is well-formed but belongs to a different state or
21
- * province. `expected_states` names the state(s) it actually maps to.
22
- * - `unknown` — nothing to check against (an unsupported country, or a postal code
23
- * absent from the US ZIP dataset). Treated as acceptable by every write path that
24
- * uses this check.
25
- *
26
- * Only the US and Canada have a real code-to-subdivision map; every other country
27
- * always returns `unknown`.
28
- */
29
- export function useLookupsLookupPostalCode(request, options) {
30
- const client = useGreenSecurityContext();
31
- return useQuery({
32
- ...buildLookupsLookupPostalCodeQuery(client, request, options),
33
- ...options,
34
- });
35
- }
36
- /**
37
- * Check a postal code against a state and country
38
- *
39
- * @remarks
40
- * Cross-checks a postal code against a state/province and country, the same check
41
- * every write path that stores a US or Canadian address enforces server-side (e.g.
42
- * `PUT /users/{id}`, `PUT /vendors/{vendor_id_or_me}`). Useful for validating an
43
- * address before submitting it elsewhere.
44
- *
45
- * `status` is one of:
46
- * - `ok` — the postal code belongs to the given state/province.
47
- * - `invalid` — the postal code is not shaped like a real one for the given country.
48
- * - `mismatch` — the postal code is well-formed but belongs to a different state or
49
- * province. `expected_states` names the state(s) it actually maps to.
50
- * - `unknown` — nothing to check against (an unsupported country, or a postal code
51
- * absent from the US ZIP dataset). Treated as acceptable by every write path that
52
- * uses this check.
53
- *
54
- * Only the US and Canada have a real code-to-subdivision map; every other country
55
- * always returns `unknown`.
56
- */
57
- export function useLookupsLookupPostalCodeSuspense(request, options) {
58
- const client = useGreenSecurityContext();
59
- return useSuspenseQuery({
60
- ...buildLookupsLookupPostalCodeQuery(client, request, options),
61
- ...options,
62
- });
63
- }
64
- export function setLookupsLookupPostalCodeData(client, queryKeyBase, data) {
65
- const key = queryKeyLookupsLookupPostalCode(...queryKeyBase);
66
- return client.setQueryData(key, data);
67
- }
68
- export function invalidateLookupsLookupPostalCode(client, queryKeyBase, filters) {
69
- return client.invalidateQueries({
70
- ...filters,
71
- queryKey: [
72
- "@greensecurity/javascript-sdk",
73
- "lookups",
74
- "lookupPostalCode",
75
- ...queryKeyBase,
76
- ],
77
- });
78
- }
79
- export function invalidateAllLookupsLookupPostalCode(client, filters) {
80
- return client.invalidateQueries({
81
- ...filters,
82
- queryKey: ["@greensecurity/javascript-sdk", "lookups", "lookupPostalCode"],
83
- });
84
- }
85
- //# sourceMappingURL=lookupsLookupPostalCode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookupsLookupPostalCode.js","sourceRoot":"","sources":["../../../src/react-query/lookupsLookupPostalCode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,QAAQ,EAER,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC;AAa/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAMxD,OAAO,EACL,iCAAiC,EAEjC,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iCAAiC,EAEjC,+BAA+B,EAC/B,+BAA+B,GAChC,CAAC;AAaF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA2C,EAC3C,OAGC;IAKD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,QAAQ,CAAC;QACd,GAAG,iCAAiC,CAClC,MAAM,EACN,OAAO,EACP,OAAO,CACR;QACD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,kCAAkC,CAChD,OAA2C,EAC3C,OAGC;IAKD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,gBAAgB,CAAC;QACtB,GAAG,iCAAiC,CAClC,MAAM,EACN,OAAO,EACP,OAAO,CACR;QACD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,MAAmB,EACnB,YAEC,EACD,IAAsC;IAEtC,MAAM,GAAG,GAAG,+BAA+B,CAAC,GAAG,YAAY,CAAC,CAAC;IAE7D,OAAO,MAAM,CAAC,YAAY,CAAmC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,MAAmB,EACnB,YAEC,EACD,OAA0E;IAE1E,OAAO,MAAM,CAAC,iBAAiB,CAAC;QAC9B,GAAG,OAAO;QACV,QAAQ,EAAE;YACR,+BAA+B;YAC/B,SAAS;YACT,kBAAkB;YAClB,GAAG,YAAY;SAChB;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,MAAmB,EACnB,OAA0E;IAE1E,OAAO,MAAM,CAAC,iBAAiB,CAAC;QAC9B,GAAG,OAAO;QACV,QAAQ,EAAE,CAAC,+BAA+B,EAAE,SAAS,EAAE,kBAAkB,CAAC;KAC3E,CAAC,CAAC;AACL,CAAC"}
@@ -1,20 +0,0 @@
1
- import { APIPromise } from "../types/async.js";
2
- import { $doPost, internalApiResult } from "./doAdmin.js";
3
-
4
- // Records that the caller dismissed a communication (GSSD-7336).
5
- //
6
- // Internal for the same reason as listCommunications: it only means anything to our own portal.
7
- //
8
- // The durable half of a two-layer dismissal — the client suppresses locally straight away so a
9
- // banner does not flash back while this is in flight, and this row is what makes the timed
10
- // rules ("after a week", "after a month") hold on a second device. Whether a past dismissal
11
- // still suppresses anything is decided server-side on the next list call.
12
- //
13
- // The server re-checks the caller's audience before writing, so dismissing a communication that
14
- // was never aimed at you answers 404 rather than creating a row.
15
- export function dismissCommunication(communicationId: number): internalApiResult {
16
- return new APIPromise($doPost(
17
- `/communications/${communicationId}/dismiss`,
18
- {},
19
- ));
20
- }
@@ -1,29 +0,0 @@
1
- import { APIPromise } from "../types/async.js";
2
- import { $doGetSingle, hashToQueryString, internalApiResult } from "./doAdmin.js";
3
-
4
- // The banners, pop-ups and in-app notifications aimed at the signed-in user (GSSD-7336).
5
- //
6
- // Internal rather than part of the public spec: "the adverts for whoever is holding this token"
7
- // is only meaningful to our own portal, and a third-party SDK consumer has no use for it. See
8
- // the public/app-only split in AGENTS.md.
9
- //
10
- // The response is already filtered and ordered by the server — audience matched per caller,
11
- // page matched, anything still suppressed by a dismissal removed, and sorted by priority — so a
12
- // caller renders the list as it arrives.
13
- //
14
- // pageKey narrows to the communications configured for one page. Omitting it returns every
15
- // communication for the user, which is what a caller that does its own page matching wants.
16
- export function listCommunications(
17
- pageKey?: string | null,
18
- itemsPerPage: number = 100,
19
- ): internalApiResult {
20
- const query: Record<string, string | number> = { items_per_page: itemsPerPage };
21
- if (pageKey) {
22
- query["page_key"] = pageKey;
23
- }
24
-
25
- return new APIPromise($doGetSingle(
26
- `/communications?${hashToQueryString(query)}`,
27
- {},
28
- ));
29
- }
@@ -1,193 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { GreenSecurityCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
7
- import { matchStatusCode } from "../lib/http.js";
8
- import * as M from "../lib/matchers.js";
9
- import { compactMap } from "../lib/primitives.js";
10
- import { safeParse } from "../lib/schemas.js";
11
- import { RequestOptions } from "../lib/sdks.js";
12
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
- import { pathToFunc } from "../lib/url.js";
14
- import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
15
- import {
16
- ConnectionError,
17
- InvalidRequestError,
18
- RequestAbortedError,
19
- RequestTimeoutError,
20
- UnexpectedClientError,
21
- } from "../models/errors/httpclienterrors.js";
22
- import * as errors from "../models/errors/index.js";
23
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
- import * as operations from "../models/operations/index.js";
26
- import { APICall, APIPromise } from "../types/async.js";
27
- import { Result } from "../types/fp.js";
28
-
29
- /**
30
- * Check a postal code against a state and country
31
- *
32
- * @remarks
33
- * Cross-checks a postal code against a state/province and country, the same check
34
- * every write path that stores a US or Canadian address enforces server-side (e.g.
35
- * `PUT /users/{id}`, `PUT /vendors/{vendor_id_or_me}`). Useful for validating an
36
- * address before submitting it elsewhere.
37
- *
38
- * `status` is one of:
39
- * - `ok` — the postal code belongs to the given state/province.
40
- * - `invalid` — the postal code is not shaped like a real one for the given country.
41
- * - `mismatch` — the postal code is well-formed but belongs to a different state or
42
- * province. `expected_states` names the state(s) it actually maps to.
43
- * - `unknown` — nothing to check against (an unsupported country, or a postal code
44
- * absent from the US ZIP dataset). Treated as acceptable by every write path that
45
- * uses this check.
46
- *
47
- * Only the US and Canada have a real code-to-subdivision map; every other country
48
- * always returns `unknown`.
49
- *
50
- * If set, this operation will use {@link Security.bearerJwt} from the global security.
51
- */
52
- export function lookupsLookupPostalCode(
53
- client: GreenSecurityCore,
54
- request: operations.LookupPostalCodeRequest,
55
- options?: RequestOptions,
56
- ): APIPromise<
57
- Result<
58
- operations.LookupPostalCodeLookupPostalCodeOk,
59
- | errors.ApiErrorResponse
60
- | GreenSecurityError
61
- | ResponseValidationError
62
- | ConnectionError
63
- | RequestAbortedError
64
- | RequestTimeoutError
65
- | InvalidRequestError
66
- | UnexpectedClientError
67
- | SDKValidationError
68
- >
69
- > {
70
- return new APIPromise($do(
71
- client,
72
- request,
73
- options,
74
- ));
75
- }
76
-
77
- async function $do(
78
- client: GreenSecurityCore,
79
- request: operations.LookupPostalCodeRequest,
80
- options?: RequestOptions,
81
- ): Promise<
82
- [
83
- Result<
84
- operations.LookupPostalCodeLookupPostalCodeOk,
85
- | errors.ApiErrorResponse
86
- | GreenSecurityError
87
- | ResponseValidationError
88
- | ConnectionError
89
- | RequestAbortedError
90
- | RequestTimeoutError
91
- | InvalidRequestError
92
- | UnexpectedClientError
93
- | SDKValidationError
94
- >,
95
- APICall,
96
- ]
97
- > {
98
- const parsed = safeParse(
99
- request,
100
- (value) => operations.LookupPostalCodeRequest$outboundSchema.parse(value),
101
- "Input validation failed",
102
- );
103
- if (!parsed.ok) {
104
- return [parsed, { status: "invalid" }];
105
- }
106
- const payload = parsed.value;
107
- const body = null;
108
-
109
- const path = pathToFunc("/lookups/postal-code")();
110
-
111
- const query = encodeFormQuery({
112
- "country": payload.country,
113
- "postal_code": payload.postal_code,
114
- "state": payload.state,
115
- });
116
-
117
- const headers = new Headers(compactMap({
118
- Accept: "application/json",
119
- }));
120
-
121
- const securityInput = await extractSecurity(client._options.security);
122
- const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
123
-
124
- const context = {
125
- options: client._options,
126
- baseURL: options?.serverURL ?? client._baseURL ?? "",
127
- operationID: "lookupPostalCode",
128
- oAuth2Scopes: null,
129
-
130
- resolvedSecurity: requestSecurity,
131
-
132
- securitySource: client._options.security,
133
- retryConfig: options?.retries
134
- || client._options.retryConfig
135
- || { strategy: "none" },
136
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
137
- };
138
-
139
- const requestRes = client._createRequest(context, {
140
- security: requestSecurity,
141
- method: "GET",
142
- baseURL: options?.serverURL,
143
- path: path,
144
- headers: headers,
145
- query: query,
146
- body: body,
147
- userAgent: client._options.userAgent,
148
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
149
- }, options);
150
- if (!requestRes.ok) {
151
- return [requestRes, { status: "invalid" }];
152
- }
153
- const req = requestRes.value;
154
-
155
- const doResult = await client._do(req, {
156
- context,
157
- isErrorStatusCode: (statusCode: number) =>
158
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
159
- retryConfig: context.retryConfig,
160
- retryCodes: context.retryCodes,
161
- });
162
- if (!doResult.ok) {
163
- return [doResult, { status: "request-error", request: req }];
164
- }
165
- const response = doResult.value;
166
-
167
- const responseFields = {
168
- HttpMeta: { Response: response, Request: req },
169
- };
170
-
171
- const [result] = await M.match<
172
- operations.LookupPostalCodeLookupPostalCodeOk,
173
- | errors.ApiErrorResponse
174
- | GreenSecurityError
175
- | ResponseValidationError
176
- | ConnectionError
177
- | RequestAbortedError
178
- | RequestTimeoutError
179
- | InvalidRequestError
180
- | UnexpectedClientError
181
- | SDKValidationError
182
- >(
183
- M.json(200, operations.LookupPostalCodeLookupPostalCodeOk$inboundSchema),
184
- M.jsonErr([400, 401, 422], errors.ApiErrorResponse$inboundSchema),
185
- M.fail("4XX"),
186
- M.fail([500, "5XX"]),
187
- )(response, req, { extraFields: responseFields });
188
- if (!result.ok) {
189
- return [result, { status: "complete", request: req, response }];
190
- }
191
-
192
- return [result, { status: "complete", request: req, response }];
193
- }
@@ -1,118 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import * as openEnums from "../../types/enums.js";
9
- import { OpenEnum } from "../../types/enums.js";
10
- import { Result as SafeParseResult } from "../../types/fp.js";
11
- import * as types from "../../types/primitives.js";
12
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
13
-
14
- export type LookupPostalCodeRequest = {
15
- /**
16
- * The zip / postal code to check.
17
- */
18
- postalCode: string;
19
- /**
20
- * The state or province, as a code or full name, entered alongside the postal code.
21
- */
22
- state: string;
23
- /**
24
- * The country entered alongside the postal code (e.g. US, CA).
25
- */
26
- country: string;
27
- };
28
-
29
- export const LookupPostalCodeStatus = {
30
- Ok: "ok",
31
- Invalid: "invalid",
32
- Mismatch: "mismatch",
33
- Unknown: "unknown",
34
- } as const;
35
- export type LookupPostalCodeStatus = OpenEnum<typeof LookupPostalCodeStatus>;
36
-
37
- /**
38
- * The request was successful, and the server has returned the check result in the response body.
39
- */
40
- export type LookupPostalCodeLookupPostalCodeOk = {
41
- status: LookupPostalCodeStatus;
42
- /**
43
- * The state(s)/province(s) the postal code actually belongs to. Populated whenever the
44
- *
45
- * @remarks
46
- * postal code is well-formed and a state/province was checked against it — so this is
47
- * non-empty for `ok` (it names the state that matched) as well as for `mismatch`, and
48
- * empty for `invalid` and `unknown`.
49
- */
50
- expectedStates: Array<string>;
51
- /**
52
- * A human-readable explanation of the problem. `null` unless `status` is `invalid` or `mismatch`.
53
- */
54
- error: string | null;
55
- };
56
-
57
- /** @internal */
58
- export type LookupPostalCodeRequest$Outbound = {
59
- postal_code: string;
60
- state: string;
61
- country: string;
62
- };
63
-
64
- /** @internal */
65
- export const LookupPostalCodeRequest$outboundSchema: z.ZodType<
66
- LookupPostalCodeRequest$Outbound,
67
- z.ZodTypeDef,
68
- LookupPostalCodeRequest
69
- > = z.object({
70
- postalCode: z.string(),
71
- state: z.string(),
72
- country: z.string(),
73
- }).transform((v) => {
74
- return remap$(v, {
75
- postalCode: "postal_code",
76
- });
77
- });
78
-
79
- export function lookupPostalCodeRequestToJSON(
80
- lookupPostalCodeRequest: LookupPostalCodeRequest,
81
- ): string {
82
- return JSON.stringify(
83
- LookupPostalCodeRequest$outboundSchema.parse(lookupPostalCodeRequest),
84
- );
85
- }
86
-
87
- /** @internal */
88
- export const LookupPostalCodeStatus$inboundSchema: z.ZodType<
89
- LookupPostalCodeStatus,
90
- z.ZodTypeDef,
91
- unknown
92
- > = openEnums.inboundSchema(LookupPostalCodeStatus);
93
-
94
- /** @internal */
95
- export const LookupPostalCodeLookupPostalCodeOk$inboundSchema: z.ZodType<
96
- LookupPostalCodeLookupPostalCodeOk,
97
- z.ZodTypeDef,
98
- unknown
99
- > = z.object({
100
- status: LookupPostalCodeStatus$inboundSchema,
101
- expected_states: z.array(types.string()),
102
- error: types.nullable(types.string()),
103
- }).transform((v) => {
104
- return remap$(v, {
105
- "expected_states": "expectedStates",
106
- });
107
- });
108
-
109
- export function lookupPostalCodeLookupPostalCodeOkFromJSON(
110
- jsonString: string,
111
- ): SafeParseResult<LookupPostalCodeLookupPostalCodeOk, SDKValidationError> {
112
- return safeParse(
113
- jsonString,
114
- (x) =>
115
- LookupPostalCodeLookupPostalCodeOk$inboundSchema.parse(JSON.parse(x)),
116
- `Failed to parse 'LookupPostalCodeLookupPostalCodeOk' from JSON`,
117
- );
118
- }