@signalhousellc/sdk 1.0.21 → 1.0.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalhousellc/sdk",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -163,23 +163,40 @@ export class Numbers {
163
163
  * @returns {Promise<Object>} A promise that resolves to the result of the transfer operation
164
164
  */
165
165
  async transferPhoneNumbers({ phoneNumbers, newSubgroupId, options = {} }) {
166
+ this.client._require({ phoneNumbers, newSubgroupId });
166
167
  return this.client(`/number/transfer`, { method: "POST", body: { phoneNumbers, newSubgroupId }, ...options });
167
168
  }
168
169
 
169
170
  /**
170
- * Search NPA/NXX lookup data with optional filters
171
+ * Search NPA/NXX lookup data with optional filters.
172
+ * At least one search parameter is required.
173
+ * Location filters (country, state, city) cannot be combined with NPA/NXX filters.
171
174
  * @async
172
175
  * @roles api, admin, developer, billing, user
173
176
  * @param {Object} params - The parameters for searching NPA/NXX data
174
- * @param {string} params.country - Filter by country code (required)
177
+ * @param {string} [params.country] - Filter by country code
175
178
  * @param {string} [params.state] - Filter by state code (2 characters)
176
- * @param {string} [params.city] - Filter by city name (prefix match, case-insensitive)
179
+ * @param {string} [params.city] - Filter by city name (prefix match, case-insensitive; requires country and state)
180
+ * @param {string} [params.npa] - Area code filter (1-3 digits; cannot combine with location filters)
181
+ * @param {string} [params.nxx] - Central office code filter (1-3 digits; cannot combine with location filters)
177
182
  * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
178
- * @returns {Promise<Object>} A promise that resolves to matching NPA/NXX records
183
+ * @returns {Promise<Object>} A promise that resolves to matching NPA/NXX records or unique NPA/NXX arrays
179
184
  */
180
- async searchNpaNxx({ country, state, city, options = {} }) {
181
- this.client._require({ country });
182
- const queryString = this.client._getQueryString({ state, country, city });
185
+ async searchNpaNxx({ country, state, city, npa, nxx, options = {} }) {
186
+ const queryString = this.client._getQueryString({ country, state, city, npa, nxx });
183
187
  return this.client(`/number/lookup${queryString}`, { method: "GET", ...options });
184
188
  }
189
+
190
+ /**
191
+ * Batch lookup city/state for NPA/NXX pairs
192
+ * @async
193
+ * @roles api, admin, developer, billing, user
194
+ * @param {Object} params - The parameters for the lookup
195
+ * @param {Array<{npa: string, nxx: string}>} params.entries - NPA/NXX pairs to look up (max 50)
196
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
197
+ * @returns {Promise<Object>} A promise that resolves to an array of {npa, nxx, city, state} objects
198
+ */
199
+ async lookupLocations({ entries, options = {} }) {
200
+ return this.client("/number/lookup/location", { method: "POST", body: { entries }, ...options });
201
+ }
185
202
  }