@signalhousellc/sdk 1.0.20 → 1.0.22
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/package.json +1 -1
- package/src/domains/Numbers.js +17 -2
package/package.json
CHANGED
package/src/domains/Numbers.js
CHANGED
|
@@ -174,12 +174,27 @@ export class Numbers {
|
|
|
174
174
|
* @param {string} params.country - Filter by country code (required)
|
|
175
175
|
* @param {string} [params.state] - Filter by state code (2 characters)
|
|
176
176
|
* @param {string} [params.city] - Filter by city name (prefix match, case-insensitive)
|
|
177
|
+
* @param {string} [params.field] - Return distinct values: "npa" for unique area codes, "nxx" for unique NXXs (requires npa)
|
|
178
|
+
* @param {string} [params.npa] - Area code filter (required when field is "nxx")
|
|
177
179
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
178
180
|
* @returns {Promise<Object>} A promise that resolves to matching NPA/NXX records
|
|
179
181
|
*/
|
|
180
|
-
async searchNpaNxx({ country, state, city, options = {} }) {
|
|
182
|
+
async searchNpaNxx({ country, state, city, field, npa, options = {} }) {
|
|
181
183
|
this.client._require({ country });
|
|
182
|
-
const queryString = this.client._getQueryString({ state, country, city });
|
|
184
|
+
const queryString = this.client._getQueryString({ state, country, city, field, npa });
|
|
183
185
|
return this.client(`/number/lookup${queryString}`, { method: "GET", ...options });
|
|
184
186
|
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Batch lookup city/state for NPA/NXX pairs
|
|
190
|
+
* @async
|
|
191
|
+
* @roles api, admin, developer, billing, user
|
|
192
|
+
* @param {Object} params - The parameters for the lookup
|
|
193
|
+
* @param {Array<{npa: string, nxx: string}>} params.entries - NPA/NXX pairs to look up (max 50)
|
|
194
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
195
|
+
* @returns {Promise<Object>} A promise that resolves to an array of {npa, nxx, city, state} objects
|
|
196
|
+
*/
|
|
197
|
+
async lookupLocations({ entries, options = {} }) {
|
|
198
|
+
return this.client("/number/lookup/location", { method: "POST", body: { entries }, ...options });
|
|
199
|
+
}
|
|
185
200
|
}
|