You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build outputs dual formats via Rollup: `dist/cjs/` (CommonJS), `dist/esm/` (ESM), and `dist/types/` (declarations). Rollup preserves module structure (`preserveModules: true`). Axios and axios-retry are external dependencies (not bundled).
32
30
33
31
## Architecture
34
32
35
-
This is the official JavaScript SDK for Smarty address validation APIs. It supports both Node.js (CommonJS/ESM) and browser environments.
33
+
This is the official JavaScript SDK for Smarty address validation APIs. It supports both Node.js (CommonJS/ESM) and browser environments. The entire codebase is TypeScript.
36
34
37
35
### Sender Chain Pattern
38
36
@@ -51,46 +49,49 @@ All senders implement the `Sender` interface from `src/types.ts`, which also def
51
49
52
50
-**ClientBuilder**: Fluent API for configuring and building API-specific clients. Accepts either `StaticCredentials` (server-side: auth-id + auth-token) or `SharedCredentials` (client-side: embedded key).
53
51
54
-
-**Lookup classes**: Each API has a `Lookup` that holds both input parameters and results after the API call. Located in `src/<api_name>/Lookup.js`.
52
+
-**Lookup classes**: Each API has a `Lookup` that holds both input parameters and results after the API call. Located in `src/<api_name>/Lookup.ts`.
55
53
56
54
-**Batch**: Container for up to 100 lookups. Single lookups use GET requests; batches with 2+ lookups use POST.
57
55
58
-
-**Client classes**: Each API has a `Client` in `src/<api_name>/Client.js` that handles domain-specific request building and response parsing.
56
+
-**Client classes**: Each API has a `Client` in `src/<api_name>/Client.ts` that handles domain-specific request building and response parsing.
59
57
60
58
### API Modules
61
59
62
60
Each API follows the same structure in `src/<api_name>/`:
63
-
-`Lookup.js` - Input/output container
64
-
-`Client.js` - Request/response handling
65
-
-`Candidate.js`, `Result.js`, or `Suggestion.js` - Response data structures
61
+
62
+
-`Lookup.ts` - Input/output container
63
+
-`Client.ts` - Request/response handling
64
+
-`Candidate.ts`, `Result.ts`, or `Suggestion.ts` - Response data structures
0 commit comments