@corsair-dev/addresszen 0.1.0
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.
- package/LICENSE +191 -0
- package/dist/api.test.d.ts +2 -0
- package/dist/api.test.d.ts.map +1 -0
- package/dist/client.d.ts +25 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/endpoints/autocomplete.d.ts +9 -0
- package/dist/endpoints/autocomplete.d.ts.map +1 -0
- package/dist/endpoints/index.d.ts +83 -0
- package/dist/endpoints/index.d.ts.map +1 -0
- package/dist/endpoints/key.d.ts +13 -0
- package/dist/endpoints/key.d.ts.map +1 -0
- package/dist/endpoints/resolve.d.ts +9 -0
- package/dist/endpoints/resolve.d.ts.map +1 -0
- package/dist/endpoints/types.d.ts +178 -0
- package/dist/endpoints/types.d.ts.map +1 -0
- package/dist/endpoints/verify.d.ts +9 -0
- package/dist/endpoints/verify.d.ts.map +1 -0
- package/dist/error-handlers.d.ts +36 -0
- package/dist/error-handlers.d.ts.map +1 -0
- package/dist/index.d.ts +128 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/schema/database.d.ts +38 -0
- package/dist/schema/database.d.ts.map +1 -0
- package/dist/schema/index.d.ts +38 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(which shall not include Communications that are clearly marked or
|
|
39
|
+
otherwise designated in writing by the copyright owner as "Not a Work").
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution".
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright (c) 2026 Corsair
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.test.d.ts","sourceRoot":"","sources":["../api.test.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare class AddresszenAPIError extends Error {
|
|
2
|
+
readonly code?: number | undefined;
|
|
3
|
+
readonly status?: number;
|
|
4
|
+
readonly statusText?: string;
|
|
5
|
+
readonly body?: unknown;
|
|
6
|
+
readonly retryAfter?: number;
|
|
7
|
+
constructor(message: string, code?: number | undefined, options?: {
|
|
8
|
+
cause?: Error;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Performs a request to the Addresszen API.
|
|
13
|
+
*
|
|
14
|
+
* Auth: API key passed via the Authorization header to avoid leaking credentials
|
|
15
|
+
* into URL access logs. Addresszen also supports query-string auth, but header
|
|
16
|
+
* auth is preferred per their API reference.
|
|
17
|
+
*/
|
|
18
|
+
export declare function makeAddresszenRequest<T>(endpoint: string, apiKey: string, options?: {
|
|
19
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
20
|
+
body?: Record<string, unknown>;
|
|
21
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
22
|
+
/** When false, skip Authorization (public endpoints that identify the key in the path). */
|
|
23
|
+
auth?: boolean;
|
|
24
|
+
}): Promise<T>;
|
|
25
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAGA,qBAAa,kBAAmB,SAAQ,KAAK;aAU3B,IAAI,CAAC,EAAE,MAAM;IAT9B,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpC,SAAgB,IAAI,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAGnC,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA,EAC7B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE;CAY5B;AAID;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,EAC5C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IACR,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC9D,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,CAAC;CACV,GACJ,OAAO,CAAC,CAAC,CAAC,CAuCZ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AddresszenEndpoints } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Get address autocomplete suggestions for a partial query.
|
|
4
|
+
*
|
|
5
|
+
* API: GET /autocomplete/addresses
|
|
6
|
+
* Docs: https://docs.addresszen.com/docs/api/find-address
|
|
7
|
+
*/
|
|
8
|
+
export declare const addresses: AddresszenEndpoints['autocompleteAddresses'];
|
|
9
|
+
//# sourceMappingURL=autocomplete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../endpoints/autocomplete.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,mBAAmB,CAAC,uBAAuB,CAwClE,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const Autocomplete: {
|
|
2
|
+
addresses: (ctx: import("..").AddresszenContext, args: {
|
|
3
|
+
query: string;
|
|
4
|
+
limit?: number | undefined;
|
|
5
|
+
page?: number | undefined;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
code: number;
|
|
8
|
+
message: string;
|
|
9
|
+
result: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
hits: {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
id: string;
|
|
14
|
+
suggestion: string;
|
|
15
|
+
urls?: Record<string, unknown> | null | undefined;
|
|
16
|
+
udprn?: number | undefined;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export declare const Verify: {
|
|
22
|
+
address: (ctx: import("..").AddresszenContext, args: {
|
|
23
|
+
query: string;
|
|
24
|
+
zip_code?: string | undefined;
|
|
25
|
+
city?: string | undefined;
|
|
26
|
+
state?: string | undefined;
|
|
27
|
+
context?: string | undefined;
|
|
28
|
+
}) => Promise<{
|
|
29
|
+
code: number;
|
|
30
|
+
message: string;
|
|
31
|
+
result: {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
query: string;
|
|
34
|
+
query_city?: string | undefined;
|
|
35
|
+
query_state?: string | undefined;
|
|
36
|
+
query_zip_code?: string | undefined;
|
|
37
|
+
match?: unknown;
|
|
38
|
+
count?: number | undefined;
|
|
39
|
+
fit?: number | undefined;
|
|
40
|
+
confidence?: number | undefined;
|
|
41
|
+
match_information?: unknown;
|
|
42
|
+
address_line_one?: string | undefined;
|
|
43
|
+
address_line_two?: string | undefined;
|
|
44
|
+
city?: string | undefined;
|
|
45
|
+
state?: string | undefined;
|
|
46
|
+
zip_code?: string | undefined;
|
|
47
|
+
country_iso_2?: string | undefined;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
export declare const Key: {
|
|
52
|
+
availability: (ctx: import("..").AddresszenContext, args: Record<string, never>) => Promise<{
|
|
53
|
+
code: number;
|
|
54
|
+
message: string;
|
|
55
|
+
result: {
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
available: boolean;
|
|
58
|
+
context?: string | undefined;
|
|
59
|
+
contexts?: Record<string, unknown>[] | undefined;
|
|
60
|
+
};
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
export declare const Resolve: {
|
|
64
|
+
addressUsa: (ctx: import("..").AddresszenContext, args: {
|
|
65
|
+
addressId: string;
|
|
66
|
+
}) => Promise<{
|
|
67
|
+
code: number;
|
|
68
|
+
message: string;
|
|
69
|
+
result: {
|
|
70
|
+
[x: string]: unknown;
|
|
71
|
+
id?: string | undefined;
|
|
72
|
+
line_1?: string | undefined;
|
|
73
|
+
line_2?: string | undefined;
|
|
74
|
+
city?: string | undefined;
|
|
75
|
+
state?: string | undefined;
|
|
76
|
+
state_abbreviation?: string | undefined;
|
|
77
|
+
zip_code?: string | undefined;
|
|
78
|
+
country_iso_2?: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
};
|
|
82
|
+
export * from './types';
|
|
83
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../endpoints/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;CAExB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAElB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;;;;;;;CAEf,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAEnB,CAAC;AAEF,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AddresszenEndpoints } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Get public information on an API key, including whether it is usable.
|
|
4
|
+
*
|
|
5
|
+
* API: GET /keys/:key
|
|
6
|
+
* Docs: https://docs.addresszen.com/docs/api/key-availability
|
|
7
|
+
*
|
|
8
|
+
* Addresszen requires the key as the path resource id for this public endpoint;
|
|
9
|
+
* there is no header-only variant. Auth header is omitted so the credential is
|
|
10
|
+
* not also sent in Authorization.
|
|
11
|
+
*/
|
|
12
|
+
export declare const availability: AddresszenEndpoints['keyAvailability'];
|
|
13
|
+
//# sourceMappingURL=key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../endpoints/key.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,mBAAmB,CAAC,iBAAiB,CAqC/D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AddresszenEndpoints } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve an address autocompletion by ID and return the full US-format address.
|
|
4
|
+
*
|
|
5
|
+
* API: GET /autocomplete/addresses/:address/usa
|
|
6
|
+
* Docs: https://docs.addresszen.com/docs/api/retrieve-address
|
|
7
|
+
*/
|
|
8
|
+
export declare const addressUsa: AddresszenEndpoints['resolveAddressUsa'];
|
|
9
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../endpoints/resolve.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,mBAAmB,CAAC,mBAAmB,CAqC/D,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const AddressSuggestionSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
suggestion: z.ZodString;
|
|
5
|
+
urls: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
6
|
+
udprn: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
export type AddressSuggestion = z.infer<typeof AddressSuggestionSchema>;
|
|
9
|
+
export declare const AutocompleteAddressesInputSchema: z.ZodObject<{
|
|
10
|
+
query: z.ZodString;
|
|
11
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type AutocompleteAddressesInput = z.infer<typeof AutocompleteAddressesInputSchema>;
|
|
15
|
+
export declare const AutocompleteAddressesResponseSchema: z.ZodObject<{
|
|
16
|
+
code: z.ZodNumber;
|
|
17
|
+
message: z.ZodString;
|
|
18
|
+
result: z.ZodObject<{
|
|
19
|
+
hits: z.ZodArray<z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
suggestion: z.ZodString;
|
|
22
|
+
urls: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
23
|
+
udprn: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
}, z.core.$loose>>;
|
|
25
|
+
}, z.core.$loose>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type AutocompleteAddressesResponse = z.infer<typeof AutocompleteAddressesResponseSchema>;
|
|
28
|
+
export declare const VerifyAddressInputSchema: z.ZodObject<{
|
|
29
|
+
query: z.ZodString;
|
|
30
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
31
|
+
city: z.ZodOptional<z.ZodString>;
|
|
32
|
+
state: z.ZodOptional<z.ZodString>;
|
|
33
|
+
context: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type VerifyAddressInput = z.infer<typeof VerifyAddressInputSchema>;
|
|
36
|
+
export declare const VerifyAddressResponseSchema: z.ZodObject<{
|
|
37
|
+
code: z.ZodNumber;
|
|
38
|
+
message: z.ZodString;
|
|
39
|
+
result: z.ZodObject<{
|
|
40
|
+
query: z.ZodString;
|
|
41
|
+
query_city: z.ZodOptional<z.ZodString>;
|
|
42
|
+
query_state: z.ZodOptional<z.ZodString>;
|
|
43
|
+
query_zip_code: z.ZodOptional<z.ZodString>;
|
|
44
|
+
match: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
45
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
fit: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
match_information: z.ZodOptional<z.ZodUnknown>;
|
|
49
|
+
address_line_one: z.ZodOptional<z.ZodString>;
|
|
50
|
+
address_line_two: z.ZodOptional<z.ZodString>;
|
|
51
|
+
city: z.ZodOptional<z.ZodString>;
|
|
52
|
+
state: z.ZodOptional<z.ZodString>;
|
|
53
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
54
|
+
country_iso_2: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$loose>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type VerifyAddressResponse = z.infer<typeof VerifyAddressResponseSchema>;
|
|
58
|
+
export declare const KeyAvailabilityInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
59
|
+
export type KeyAvailabilityInput = z.infer<typeof KeyAvailabilityInputSchema>;
|
|
60
|
+
export declare const KeyAvailabilityResponseSchema: z.ZodObject<{
|
|
61
|
+
code: z.ZodNumber;
|
|
62
|
+
message: z.ZodString;
|
|
63
|
+
result: z.ZodObject<{
|
|
64
|
+
available: z.ZodBoolean;
|
|
65
|
+
context: z.ZodOptional<z.ZodString>;
|
|
66
|
+
contexts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
67
|
+
}, z.core.$loose>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type KeyAvailabilityResponse = z.infer<typeof KeyAvailabilityResponseSchema>;
|
|
70
|
+
export declare const ResolveAddressUsaInputSchema: z.ZodObject<{
|
|
71
|
+
addressId: z.ZodString;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
export type ResolveAddressUsaInput = z.infer<typeof ResolveAddressUsaInputSchema>;
|
|
74
|
+
export declare const ResolveAddressUsaResponseSchema: z.ZodObject<{
|
|
75
|
+
code: z.ZodNumber;
|
|
76
|
+
message: z.ZodString;
|
|
77
|
+
result: z.ZodObject<{
|
|
78
|
+
id: z.ZodOptional<z.ZodString>;
|
|
79
|
+
line_1: z.ZodOptional<z.ZodString>;
|
|
80
|
+
line_2: z.ZodOptional<z.ZodString>;
|
|
81
|
+
city: z.ZodOptional<z.ZodString>;
|
|
82
|
+
state: z.ZodOptional<z.ZodString>;
|
|
83
|
+
state_abbreviation: z.ZodOptional<z.ZodString>;
|
|
84
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
85
|
+
country_iso_2: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$loose>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type ResolveAddressUsaResponse = z.infer<typeof ResolveAddressUsaResponseSchema>;
|
|
89
|
+
export type AddresszenEndpointInputs = {
|
|
90
|
+
autocompleteAddresses: AutocompleteAddressesInput;
|
|
91
|
+
verifyAddress: VerifyAddressInput;
|
|
92
|
+
keyAvailability: KeyAvailabilityInput;
|
|
93
|
+
resolveAddressUsa: ResolveAddressUsaInput;
|
|
94
|
+
};
|
|
95
|
+
export type AddresszenEndpointOutputs = {
|
|
96
|
+
autocompleteAddresses: AutocompleteAddressesResponse;
|
|
97
|
+
verifyAddress: VerifyAddressResponse;
|
|
98
|
+
keyAvailability: KeyAvailabilityResponse;
|
|
99
|
+
resolveAddressUsa: ResolveAddressUsaResponse;
|
|
100
|
+
};
|
|
101
|
+
export declare const AddresszenEndpointInputSchemas: {
|
|
102
|
+
readonly autocompleteAddresses: z.ZodObject<{
|
|
103
|
+
query: z.ZodString;
|
|
104
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
readonly verifyAddress: z.ZodObject<{
|
|
108
|
+
query: z.ZodString;
|
|
109
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
110
|
+
city: z.ZodOptional<z.ZodString>;
|
|
111
|
+
state: z.ZodOptional<z.ZodString>;
|
|
112
|
+
context: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
readonly keyAvailability: z.ZodObject<{}, z.core.$strip>;
|
|
115
|
+
readonly resolveAddressUsa: z.ZodObject<{
|
|
116
|
+
addressId: z.ZodString;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
};
|
|
119
|
+
export declare const AddresszenEndpointOutputSchemas: {
|
|
120
|
+
readonly autocompleteAddresses: z.ZodObject<{
|
|
121
|
+
code: z.ZodNumber;
|
|
122
|
+
message: z.ZodString;
|
|
123
|
+
result: z.ZodObject<{
|
|
124
|
+
hits: z.ZodArray<z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
suggestion: z.ZodString;
|
|
127
|
+
urls: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
128
|
+
udprn: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
}, z.core.$loose>>;
|
|
130
|
+
}, z.core.$loose>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
readonly verifyAddress: z.ZodObject<{
|
|
133
|
+
code: z.ZodNumber;
|
|
134
|
+
message: z.ZodString;
|
|
135
|
+
result: z.ZodObject<{
|
|
136
|
+
query: z.ZodString;
|
|
137
|
+
query_city: z.ZodOptional<z.ZodString>;
|
|
138
|
+
query_state: z.ZodOptional<z.ZodString>;
|
|
139
|
+
query_zip_code: z.ZodOptional<z.ZodString>;
|
|
140
|
+
match: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
141
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
fit: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
match_information: z.ZodOptional<z.ZodUnknown>;
|
|
145
|
+
address_line_one: z.ZodOptional<z.ZodString>;
|
|
146
|
+
address_line_two: z.ZodOptional<z.ZodString>;
|
|
147
|
+
city: z.ZodOptional<z.ZodString>;
|
|
148
|
+
state: z.ZodOptional<z.ZodString>;
|
|
149
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
150
|
+
country_iso_2: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, z.core.$loose>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
readonly keyAvailability: z.ZodObject<{
|
|
154
|
+
code: z.ZodNumber;
|
|
155
|
+
message: z.ZodString;
|
|
156
|
+
result: z.ZodObject<{
|
|
157
|
+
available: z.ZodBoolean;
|
|
158
|
+
context: z.ZodOptional<z.ZodString>;
|
|
159
|
+
contexts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
160
|
+
}, z.core.$loose>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
readonly resolveAddressUsa: z.ZodObject<{
|
|
163
|
+
code: z.ZodNumber;
|
|
164
|
+
message: z.ZodString;
|
|
165
|
+
result: z.ZodObject<{
|
|
166
|
+
id: z.ZodOptional<z.ZodString>;
|
|
167
|
+
line_1: z.ZodOptional<z.ZodString>;
|
|
168
|
+
line_2: z.ZodOptional<z.ZodString>;
|
|
169
|
+
city: z.ZodOptional<z.ZodString>;
|
|
170
|
+
state: z.ZodOptional<z.ZodString>;
|
|
171
|
+
state_abbreviation: z.ZodOptional<z.ZodString>;
|
|
172
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
173
|
+
country_iso_2: z.ZodOptional<z.ZodString>;
|
|
174
|
+
}, z.core.$loose>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
};
|
|
177
|
+
export {};
|
|
178
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../endpoints/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,uBAAuB;;;;;iBAQpB,CAAC;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,gCAAgC;;;;iBAQ3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,gCAAgC,CACvC,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;iBAQ9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,mCAAmC,CAC1C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;iBAcnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAwB1E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;iBAItC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B,gCAAe,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,6BAA6B;;;;;;;;iBAWxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,6BAA6B,CACpC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;iBAOvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,4BAA4B,CACnC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;iBAgB1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,+BAA+B,CACtC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,qBAAqB,EAAE,0BAA0B,CAAC;IAClD,aAAa,EAAE,kBAAkB,CAAC;IAClC,eAAe,EAAE,oBAAoB,CAAC;IACtC,iBAAiB,EAAE,sBAAsB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,qBAAqB,EAAE,6BAA6B,CAAC;IACrD,aAAa,EAAE,qBAAqB,CAAC;IACrC,eAAe,EAAE,uBAAuB,CAAC;IACzC,iBAAiB,EAAE,yBAAyB,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;CAKjC,CAAC;AAEX,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKlC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AddresszenEndpoints } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Verify and standardize a US address using USPS CASS.
|
|
4
|
+
*
|
|
5
|
+
* API: POST /verify/addresses
|
|
6
|
+
* Docs: https://docs.addresszen.com/docs/api/address-verify
|
|
7
|
+
*/
|
|
8
|
+
export declare const address: AddresszenEndpoints['verifyAddress'];
|
|
9
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../endpoints/verify.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,mBAAmB,CAAC,eAAe,CAkDxD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const errorHandlers: {
|
|
2
|
+
RATE_LIMIT_ERROR: {
|
|
3
|
+
match: (error: Error) => boolean;
|
|
4
|
+
handler: (error: Error) => Promise<{
|
|
5
|
+
maxRetries: number;
|
|
6
|
+
retryStrategy: "exponential_backoff";
|
|
7
|
+
headersRetryAfterMs: number | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
AUTH_ERROR: {
|
|
11
|
+
match: (error: Error) => boolean;
|
|
12
|
+
handler: () => Promise<{
|
|
13
|
+
maxRetries: number;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
NOT_FOUND_ERROR: {
|
|
17
|
+
match: (error: Error) => boolean;
|
|
18
|
+
handler: () => Promise<{
|
|
19
|
+
maxRetries: number;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
SERVER_ERROR: {
|
|
23
|
+
match: (error: Error) => boolean;
|
|
24
|
+
handler: () => Promise<{
|
|
25
|
+
maxRetries: number;
|
|
26
|
+
retryStrategy: "exponential_backoff";
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
DEFAULT: {
|
|
30
|
+
match: () => true;
|
|
31
|
+
handler: () => Promise<{
|
|
32
|
+
maxRetries: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=error-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handlers.d.ts","sourceRoot":"","sources":["../error-handlers.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa;;uBAET,KAAK;yBAKG,KAAK;;;;;;;uBAOb,KAAK;;;;;;uBAYL,KAAK;;;;;;uBAQL,KAAK;;;;;;;;;;;;CAeS,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { AuthTypes, BindEndpoints, CorsairEndpoint, CorsairErrorHandler, CorsairPlugin, CorsairPluginContext, KeyBuilderContext, PickAuth, PluginPermissionsConfig } from 'corsair/core';
|
|
2
|
+
import type { AddresszenEndpointInputs, AddresszenEndpointOutputs } from './endpoints/types';
|
|
3
|
+
import { AddresszenSchema } from './schema';
|
|
4
|
+
export type AddresszenPluginOptions = {
|
|
5
|
+
authType?: PickAuth<'api_key'>;
|
|
6
|
+
key?: string;
|
|
7
|
+
hooks?: InternalAddresszenPlugin['hooks'];
|
|
8
|
+
errorHandlers?: CorsairErrorHandler;
|
|
9
|
+
permissions?: PluginPermissionsConfig<typeof addresszenEndpointsNested>;
|
|
10
|
+
};
|
|
11
|
+
export type AddresszenContext = CorsairPluginContext<typeof AddresszenSchema, AddresszenPluginOptions>;
|
|
12
|
+
export type AddresszenKeyBuilderContext = KeyBuilderContext<AddresszenPluginOptions>;
|
|
13
|
+
export type AddresszenBoundEndpoints = BindEndpoints<typeof addresszenEndpointsNested>;
|
|
14
|
+
type AddresszenEndpoint<K extends keyof AddresszenEndpointOutputs> = CorsairEndpoint<AddresszenContext, AddresszenEndpointInputs[K], AddresszenEndpointOutputs[K]>;
|
|
15
|
+
export type AddresszenEndpoints = {
|
|
16
|
+
autocompleteAddresses: AddresszenEndpoint<'autocompleteAddresses'>;
|
|
17
|
+
verifyAddress: AddresszenEndpoint<'verifyAddress'>;
|
|
18
|
+
keyAvailability: AddresszenEndpoint<'keyAvailability'>;
|
|
19
|
+
resolveAddressUsa: AddresszenEndpoint<'resolveAddressUsa'>;
|
|
20
|
+
};
|
|
21
|
+
declare const addresszenEndpointsNested: {
|
|
22
|
+
readonly autocomplete: {
|
|
23
|
+
readonly addresses: AddresszenEndpoint<"autocompleteAddresses">;
|
|
24
|
+
};
|
|
25
|
+
readonly verify: {
|
|
26
|
+
readonly address: AddresszenEndpoint<"verifyAddress">;
|
|
27
|
+
};
|
|
28
|
+
readonly key: {
|
|
29
|
+
readonly availability: AddresszenEndpoint<"keyAvailability">;
|
|
30
|
+
};
|
|
31
|
+
readonly resolve: {
|
|
32
|
+
readonly addressUsa: AddresszenEndpoint<"resolveAddressUsa">;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
declare const addresszenWebhooksNested: {};
|
|
36
|
+
export declare const addresszenEndpointSchemas: {
|
|
37
|
+
readonly 'autocomplete.addresses': {
|
|
38
|
+
readonly input: import("zod").ZodObject<{
|
|
39
|
+
query: import("zod").ZodString;
|
|
40
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
41
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
42
|
+
}, import("zod/v4/core").$strip>;
|
|
43
|
+
readonly output: import("zod").ZodObject<{
|
|
44
|
+
code: import("zod").ZodNumber;
|
|
45
|
+
message: import("zod").ZodString;
|
|
46
|
+
result: import("zod").ZodObject<{
|
|
47
|
+
hits: import("zod").ZodArray<import("zod").ZodObject<{
|
|
48
|
+
id: import("zod").ZodString;
|
|
49
|
+
suggestion: import("zod").ZodString;
|
|
50
|
+
urls: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
|
|
51
|
+
udprn: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
52
|
+
}, import("zod/v4/core").$loose>>;
|
|
53
|
+
}, import("zod/v4/core").$loose>;
|
|
54
|
+
}, import("zod/v4/core").$strip>;
|
|
55
|
+
};
|
|
56
|
+
readonly 'verify.address': {
|
|
57
|
+
readonly input: import("zod").ZodObject<{
|
|
58
|
+
query: import("zod").ZodString;
|
|
59
|
+
zip_code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
city: import("zod").ZodOptional<import("zod").ZodString>;
|
|
61
|
+
state: import("zod").ZodOptional<import("zod").ZodString>;
|
|
62
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
63
|
+
}, import("zod/v4/core").$strip>;
|
|
64
|
+
readonly output: import("zod").ZodObject<{
|
|
65
|
+
code: import("zod").ZodNumber;
|
|
66
|
+
message: import("zod").ZodString;
|
|
67
|
+
result: import("zod").ZodObject<{
|
|
68
|
+
query: import("zod").ZodString;
|
|
69
|
+
query_city: import("zod").ZodOptional<import("zod").ZodString>;
|
|
70
|
+
query_state: import("zod").ZodOptional<import("zod").ZodString>;
|
|
71
|
+
query_zip_code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
72
|
+
match: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodUnknown>>;
|
|
73
|
+
count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
74
|
+
fit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
75
|
+
confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
76
|
+
match_information: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
77
|
+
address_line_one: import("zod").ZodOptional<import("zod").ZodString>;
|
|
78
|
+
address_line_two: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
city: import("zod").ZodOptional<import("zod").ZodString>;
|
|
80
|
+
state: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
zip_code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
82
|
+
country_iso_2: import("zod").ZodOptional<import("zod").ZodString>;
|
|
83
|
+
}, import("zod/v4/core").$loose>;
|
|
84
|
+
}, import("zod/v4/core").$strip>;
|
|
85
|
+
};
|
|
86
|
+
readonly 'key.availability': {
|
|
87
|
+
readonly input: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
|
|
88
|
+
readonly output: import("zod").ZodObject<{
|
|
89
|
+
code: import("zod").ZodNumber;
|
|
90
|
+
message: import("zod").ZodString;
|
|
91
|
+
result: import("zod").ZodObject<{
|
|
92
|
+
available: import("zod").ZodBoolean;
|
|
93
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
94
|
+
contexts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
|
|
95
|
+
}, import("zod/v4/core").$loose>;
|
|
96
|
+
}, import("zod/v4/core").$strip>;
|
|
97
|
+
};
|
|
98
|
+
readonly 'resolve.addressUsa': {
|
|
99
|
+
readonly input: import("zod").ZodObject<{
|
|
100
|
+
addressId: import("zod").ZodString;
|
|
101
|
+
}, import("zod/v4/core").$strip>;
|
|
102
|
+
readonly output: import("zod").ZodObject<{
|
|
103
|
+
code: import("zod").ZodNumber;
|
|
104
|
+
message: import("zod").ZodString;
|
|
105
|
+
result: import("zod").ZodObject<{
|
|
106
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
107
|
+
line_1: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
line_2: import("zod").ZodOptional<import("zod").ZodString>;
|
|
109
|
+
city: import("zod").ZodOptional<import("zod").ZodString>;
|
|
110
|
+
state: import("zod").ZodOptional<import("zod").ZodString>;
|
|
111
|
+
state_abbreviation: import("zod").ZodOptional<import("zod").ZodString>;
|
|
112
|
+
zip_code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
113
|
+
country_iso_2: import("zod").ZodOptional<import("zod").ZodString>;
|
|
114
|
+
}, import("zod/v4/core").$loose>;
|
|
115
|
+
}, import("zod/v4/core").$strip>;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
declare const defaultAuthType: AuthTypes;
|
|
119
|
+
export declare const addresszenAuthConfig: {
|
|
120
|
+
readonly api_key: {};
|
|
121
|
+
};
|
|
122
|
+
export type BaseAddresszenPlugin<T extends AddresszenPluginOptions> = CorsairPlugin<'addresszen', typeof AddresszenSchema, typeof addresszenEndpointsNested, typeof addresszenWebhooksNested, T, typeof defaultAuthType>;
|
|
123
|
+
export type InternalAddresszenPlugin = BaseAddresszenPlugin<AddresszenPluginOptions>;
|
|
124
|
+
export type ExternalAddresszenPlugin<T extends AddresszenPluginOptions> = BaseAddresszenPlugin<T>;
|
|
125
|
+
export declare function addresszen<const T extends AddresszenPluginOptions>(incomingOptions?: AddresszenPluginOptions & T): ExternalAddresszenPlugin<T>;
|
|
126
|
+
export type { AddressSuggestion, AddresszenEndpointInputs, AddresszenEndpointOutputs, AutocompleteAddressesInput, AutocompleteAddressesResponse, KeyAvailabilityInput, KeyAvailabilityResponse, ResolveAddressUsaInput, ResolveAddressUsaResponse, VerifyAddressInput, VerifyAddressResponse, } from './endpoints/types';
|
|
127
|
+
export { AddresszenEndpointInputSchemas, AddresszenEndpointOutputSchemas, AutocompleteAddressesInputSchema, AutocompleteAddressesResponseSchema, KeyAvailabilityInputSchema, KeyAvailabilityResponseSchema, ResolveAddressUsaInputSchema, ResolveAddressUsaResponseSchema, VerifyAddressInputSchema, VerifyAddressResponseSchema, } from './endpoints/types';
|
|
128
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,EACT,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,QAAQ,EAER,uBAAuB,EAGvB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EACX,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,WAAW,CAAC,EAAE,uBAAuB,CAAC,OAAO,yBAAyB,CAAC,CAAC;CACxE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CACnD,OAAO,gBAAgB,EACvB,uBAAuB,CACvB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GACtC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;AAE5C,MAAM,MAAM,wBAAwB,GAAG,aAAa,CACnD,OAAO,yBAAyB,CAChC,CAAC;AAEF,KAAK,kBAAkB,CAAC,CAAC,SAAS,MAAM,yBAAyB,IAChE,eAAe,CACd,iBAAiB,EACjB,wBAAwB,CAAC,CAAC,CAAC,EAC3B,yBAAyB,CAAC,CAAC,CAAC,CAC5B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG;IACjC,qBAAqB,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;IACnE,aAAa,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACnD,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IACvD,iBAAiB,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAC3D,CAAC;AAEF,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;CAarB,CAAC;AAEX,QAAA,MAAM,wBAAwB,IAAc,CAAC;AAE7C,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBrC,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,SAA8B,CAAC;AA2BtD,eAAO,MAAM,oBAAoB;;CAEI,CAAC;AAEtC,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,uBAAuB,IACjE,aAAa,CACZ,YAAY,EACZ,OAAO,gBAAgB,EACvB,OAAO,yBAAyB,EAChC,OAAO,wBAAwB,EAC/B,CAAC,EACD,OAAO,eAAe,CACtB,CAAC;AAEH,MAAM,MAAM,wBAAwB,GACnC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;AAE/C,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,uBAAuB,IACrE,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAEzB,wBAAgB,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,uBAAuB,EACjE,eAAe,GAAE,uBAAuB,GAAG,CACzC,GACA,wBAAwB,CAAC,CAAC,CAAC,CAqC7B;AAED,YAAY,EACX,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,6BAA6B,EAC7B,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,mCAAmC,EACnC,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,+BAA+B,EAC/B,wBAAwB,EACxB,2BAA2B,GAC3B,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AuthMissingError as j}from"corsair/core";import{logEventFromContext as F}from"corsair/core";import{ApiError as m,request as D}from"corsair/http";var c=class extends Error{constructor(o,n,d){super(o,d);this.code=n;this.name="AddresszenAPIError",d?.cause instanceof m&&(this.status=d.cause.status,this.statusText=d.cause.statusText,this.body=d.cause.body,this.retryAfter=d.cause.retryAfter)}status;statusText;body;retryAfter},L="https://api.addresszen.com/v1";async function i(t,s,o={}){let{method:n="GET",body:d,query:u={},auth:B=!0}=o,A=n==="POST"||n==="PUT"||n==="PATCH",N={BASE:L,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",TOKEN:void 0,HEADERS:{...B?{Authorization:`api_key="${s}"`}:{},...A?{"Content-Type":"application/json"}:{}}},H={method:n,url:t,body:A?d:void 0,mediaType:A?"application/json; charset=utf-8":void 0,query:u};try{return await D(N,H)}catch(a){throw a instanceof m?new c(a.message,a.status,{cause:a}):a instanceof Error?new c(a.message,void 0,{cause:a}):new c("Unknown error")}}var f=async(t,s)=>{let o=await i("autocomplete/addresses",t.key,{method:"GET",query:{q:s.query,limit:s.limit,page:s.page}});if(t.db.autocompleteResults)try{let{result:n,...d}=o;await t.db.autocompleteResults.upsertByEntityId(s.query,{...d,query:s.query,hits:n.hits,updatedAt:new Date})}catch(n){console.warn("[addresszen] Failed to save autocomplete results to database:",n)}return await F(t,"addresszen.autocomplete.addresses",{query:s.query,hitCount:o.result.hits.length},"completed"),o};import{logEventFromContext as M}from"corsair/core";var g=async(t,s)=>{let o=await i(`keys/${encodeURIComponent(t.key)}`,t.key,{method:"GET",auth:!1});if(t.db.keyAvailability)try{let n=await t.$getAccountId();await t.db.keyAvailability.upsertByEntityId(n,{available:o.result.available,context:o.result.context??null,code:o.code,message:o.message,updatedAt:new Date})}catch(n){console.warn("[addresszen] Failed to save key availability to database:",n)}return await M(t,"addresszen.key.availability",{available:o.result.available},"completed"),o};import{logEventFromContext as G}from"corsair/core";var z=async(t,s)=>{let o=await i(`autocomplete/addresses/${encodeURIComponent(s.addressId)}/usa`,t.key,{method:"GET"});if(t.db.resolvedAddresses)try{let{result:n,...d}=o;await t.db.resolvedAddresses.upsertByEntityId(s.addressId,{...d,addressId:s.addressId,address:n,updatedAt:new Date})}catch(n){console.warn("[addresszen] Failed to save resolved address to database:",n)}return await G(t,"addresszen.resolve.addressUsa",{addressId:s.addressId},"completed"),o};import{logEventFromContext as W}from"corsair/core";var b=async(t,s)=>{let{context:o,...n}=s,d=await i("verify/addresses",t.key,{method:"POST",query:o?{context:o}:void 0,body:n});if(t.db.verifiedAddresses)try{let u=JSON.stringify([s.query,s.city??null,s.state??null,s.zip_code??null,s.context??null]);await t.db.verifiedAddresses.upsertByEntityId(u,{...d,query:s.query,city:s.city??null,state:s.state??null,zipCode:s.zip_code??null,context:s.context??null,updatedAt:new Date})}catch(u){console.warn("[addresszen] Failed to save verified address to database:",u)}return await W(t,"addresszen.verify.address",{query:s.query},"completed"),d};import{z as e}from"zod";var $=e.object({id:e.string(),suggestion:e.string(),urls:e.record(e.string(),e.unknown()).nullable().optional(),udprn:e.number().optional()}).loose(),h=e.object({query:e.string().min(1).max(150).describe("Partial address string to autocomplete"),limit:e.number().int().positive().optional(),page:e.number().int().nonnegative().optional()}),v=e.object({code:e.number(),message:e.string(),result:e.object({hits:e.array($)}).loose()}),E=e.object({query:e.string().min(1).describe("Address to verify. Use a full free-form address, or only the first line when city/state or zip_code are provided separately."),zip_code:e.string().optional(),city:e.string().optional(),state:e.string().optional(),context:e.string().optional().describe("Optional metadata tag stored with the lookup")}),J=e.object({query:e.string(),query_city:e.string().optional(),query_state:e.string().optional(),query_zip_code:e.string().optional(),match:e.unknown().nullable().optional(),count:e.number().optional(),fit:e.number().optional(),confidence:e.number().optional(),match_information:e.unknown().optional(),address_line_one:e.string().optional(),address_line_two:e.string().optional(),city:e.string().optional(),state:e.string().optional(),zip_code:e.string().optional(),country_iso_2:e.string().optional()}).loose(),R=e.object({code:e.number(),message:e.string(),result:J}),x=e.object({}),k=e.object({code:e.number(),message:e.string(),result:e.object({available:e.boolean(),context:e.string().optional(),contexts:e.array(e.record(e.string(),e.unknown())).optional()}).loose()}),S=e.object({addressId:e.string().min(1).describe("Address suggestion ID from autocomplete (e.g. usps_X130125796|1600||1933)")}),I=e.object({code:e.number(),message:e.string(),result:e.object({id:e.string().optional(),line_1:e.string().optional(),line_2:e.string().optional(),city:e.string().optional(),state:e.string().optional(),state_abbreviation:e.string().optional(),zip_code:e.string().optional(),country_iso_2:e.string().optional()}).loose()}),p={autocompleteAddresses:h,verifyAddress:E,keyAvailability:x,resolveAddressUsa:S},l={autocompleteAddresses:v,verifyAddress:R,keyAvailability:k,resolveAddressUsa:I};var w={addresses:f},P={address:b},T={availability:g},C={addressUsa:z};function y(t){return t.status}function X(t){return t.retryAfter}var _={RATE_LIMIT_ERROR:{match:t=>{if(y(t)===429)return!0;let s=t.message.toLowerCase();return s.includes("429")||s.includes("rate limit")},handler:async t=>({maxRetries:3,retryStrategy:"exponential_backoff",headersRetryAfterMs:X(t)})},AUTH_ERROR:{match:t=>{if(y(t)===401)return!0;let s=t.message.toLowerCase();return s.includes("invalid key")||s.includes("unauthorized")||s.includes("401")},handler:async()=>({maxRetries:0})},NOT_FOUND_ERROR:{match:t=>{if(y(t)===404)return!0;let s=t.message.toLowerCase();return s.includes("404")||s.includes("not found")},handler:async()=>({maxRetries:0})},SERVER_ERROR:{match:t=>{let s=y(t);if(s!==void 0&&s>=500)return!0;let o=t.message.toLowerCase();return o.includes("503")||o.includes("server error")},handler:async()=>({maxRetries:2,retryStrategy:"exponential_backoff"})},DEFAULT:{match:()=>!0,handler:async()=>({maxRetries:0})}};import{z as r}from"zod";var O=r.object({query:r.string(),hits:r.array(r.record(r.string(),r.unknown())),code:r.number().optional(),message:r.string().optional(),updatedAt:r.coerce.date().nullable().optional()}),U=r.object({query:r.string(),city:r.string().nullable().optional(),state:r.string().nullable().optional(),zipCode:r.string().nullable().optional(),context:r.string().nullable().optional(),result:r.record(r.string(),r.unknown()),code:r.number().optional(),message:r.string().optional(),updatedAt:r.coerce.date().nullable().optional()}),q=r.object({available:r.boolean(),context:r.string().nullable().optional(),code:r.number().optional(),message:r.string().optional(),updatedAt:r.coerce.date().nullable().optional()}),K=r.object({addressId:r.string(),address:r.record(r.string(),r.unknown()),code:r.number().optional(),message:r.string().optional(),updatedAt:r.coerce.date().nullable().optional()});var V={version:"1.0.0",entities:{autocompleteResults:O,verifiedAddresses:U,keyAvailability:q,resolvedAddresses:K}};var Z={autocomplete:{addresses:w.addresses},verify:{address:P.address},key:{availability:T.availability},resolve:{addressUsa:C.addressUsa}},Q={},Y={"autocomplete.addresses":{input:p.autocompleteAddresses,output:l.autocompleteAddresses},"verify.address":{input:p.verifyAddress,output:l.verifyAddress},"key.availability":{input:p.keyAvailability,output:l.keyAvailability},"resolve.addressUsa":{input:p.resolveAddressUsa,output:l.resolveAddressUsa}},ee="api_key",se={"autocomplete.addresses":{riskLevel:"read",description:"Get address autocomplete suggestions for a partial address query"},"verify.address":{riskLevel:"read",description:"Verify and standardize a US address using USPS CASS validation"},"key.availability":{riskLevel:"read",description:"Get public information on an API key, including whether it is currently usable"},"resolve.addressUsa":{riskLevel:"read",description:"Resolve an address autocompletion by its address ID and return the full address in US format"}},te={api_key:{}};function qe(t={}){let s={...t,authType:t.authType??ee};return{id:"addresszen",authConfig:te,schema:V,options:s,hooks:s.hooks,webhookHooks:void 0,endpoints:Z,webhooks:Q,endpointMeta:se,endpointSchemas:Y,pluginWebhookMatcher:void 0,errorHandlers:{..._,...s.errorHandlers},keyBuilder:async(o,n)=>{if(n==="endpoint"&&s.key)return s.key;if(n==="endpoint"&&o.authType==="api_key"){let d=await o.keys.get_api_key();if(!d)throw new j("addresszen","api_key");return d}throw new j("addresszen","api_key")}}}export{p as AddresszenEndpointInputSchemas,l as AddresszenEndpointOutputSchemas,h as AutocompleteAddressesInputSchema,v as AutocompleteAddressesResponseSchema,x as KeyAvailabilityInputSchema,k as KeyAvailabilityResponseSchema,S as ResolveAddressUsaInputSchema,I as ResolveAddressUsaResponseSchema,E as VerifyAddressInputSchema,R as VerifyAddressResponseSchema,qe as addresszen,te as addresszenAuthConfig,Y as addresszenEndpointSchemas};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AddresszenAutocompleteResult: z.ZodObject<{
|
|
3
|
+
query: z.ZodString;
|
|
4
|
+
hits: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
5
|
+
code: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
message: z.ZodOptional<z.ZodString>;
|
|
7
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const AddresszenVerifiedAddress: z.ZodObject<{
|
|
10
|
+
query: z.ZodString;
|
|
11
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
zipCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
context: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
result: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
+
code: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
message: z.ZodOptional<z.ZodString>;
|
|
18
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const AddresszenKeyAvailability: z.ZodObject<{
|
|
21
|
+
available: z.ZodBoolean;
|
|
22
|
+
context: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
code: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
message: z.ZodOptional<z.ZodString>;
|
|
25
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const AddresszenResolvedAddress: z.ZodObject<{
|
|
28
|
+
addressId: z.ZodString;
|
|
29
|
+
address: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
30
|
+
code: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
message: z.ZodOptional<z.ZodString>;
|
|
32
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type AddresszenAutocompleteResult = z.infer<typeof AddresszenAutocompleteResult>;
|
|
35
|
+
export type AddresszenVerifiedAddress = z.infer<typeof AddresszenVerifiedAddress>;
|
|
36
|
+
export type AddresszenKeyAvailability = z.infer<typeof AddresszenKeyAvailability>;
|
|
37
|
+
export type AddresszenResolvedAddress = z.infer<typeof AddresszenResolvedAddress>;
|
|
38
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../schema/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,4BAA4B;;;;;;iBAOvC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;iBAWpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;iBAMpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;iBAOpC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,4BAA4B,CACnC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CAChC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CAChC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CAChC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const AddresszenSchema: {
|
|
2
|
+
readonly version: "1.0.0";
|
|
3
|
+
readonly entities: {
|
|
4
|
+
readonly autocompleteResults: import("zod").ZodObject<{
|
|
5
|
+
query: import("zod").ZodString;
|
|
6
|
+
hits: import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
7
|
+
code: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
8
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCoercedDate<unknown>>>;
|
|
10
|
+
}, import("zod/v4/core").$strip>;
|
|
11
|
+
readonly verifiedAddresses: import("zod").ZodObject<{
|
|
12
|
+
query: import("zod").ZodString;
|
|
13
|
+
city: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
14
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
15
|
+
zipCode: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
16
|
+
context: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
17
|
+
result: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
18
|
+
code: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
19
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCoercedDate<unknown>>>;
|
|
21
|
+
}, import("zod/v4/core").$strip>;
|
|
22
|
+
readonly keyAvailability: import("zod").ZodObject<{
|
|
23
|
+
available: import("zod").ZodBoolean;
|
|
24
|
+
context: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
25
|
+
code: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
26
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
27
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCoercedDate<unknown>>>;
|
|
28
|
+
}, import("zod/v4/core").$strip>;
|
|
29
|
+
readonly resolvedAddresses: import("zod").ZodObject<{
|
|
30
|
+
addressId: import("zod").ZodString;
|
|
31
|
+
address: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
32
|
+
code: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
33
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
34
|
+
updatedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCoercedDate<unknown>>>;
|
|
35
|
+
}, import("zod/v4/core").$strip>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schema/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQnB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=tsup.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,wBAYG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@corsair-dev/addresszen",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Addresszen plugin for Corsair",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"dev-source": "./index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"corsair": ">=0.1.0",
|
|
18
|
+
"zod": "^4.1.13"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/jest": "^29.5.14",
|
|
22
|
+
"dotenv": "^17.2.3",
|
|
23
|
+
"jest": "^29.7.0",
|
|
24
|
+
"ts-jest": "^29.4.9",
|
|
25
|
+
"tsup": "^8.0.1",
|
|
26
|
+
"typescript": "^5.9.3",
|
|
27
|
+
"zod": "^4.1.13",
|
|
28
|
+
"corsair": "0.1.111"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"corsair",
|
|
32
|
+
"addresszen",
|
|
33
|
+
"plugin"
|
|
34
|
+
],
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "Apache-2.0",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "rm -rf dist && tsc --build --force && tsup",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"test": "jest"
|
|
44
|
+
}
|
|
45
|
+
}
|