@insignia-education/api-sdk-js 0.15.129 → 0.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.15.129",
3
+ "version": "0.16.0",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- /** Admin-only: IP blocks (the blocks table — ip-scoped only, see App\Models\Block). */
1
+ /** Sales-and-above: IP blocks (the blocks table — ip-scoped only, see App\Models\Block). */
2
2
  export default class Blocks {
3
3
  #client;
4
4
 
@@ -6,7 +6,11 @@ export default class Blocks {
6
6
  this.#client = client;
7
7
  }
8
8
 
9
- get(id = null) { return id ? this.#client.get(`/blocks/${id}`) : this.#client.get('/blocks'); }
10
- create(data) { return this.#client.put('/blocks', data); }
11
- delete(id) { return this.#client.del(`/blocks/${id}`); }
9
+ /** `id` fetches one block; omitted fetches the paginated list — `{ page, perPage }` control that page. */
10
+ get(id = null, { page, perPage } = {}) {
11
+ return id ? this.#client.get(`/blocks/${id}`) : this.#client.get('/blocks', { page, per_page: perPage });
12
+ }
13
+ create(data) { return this.#client.put('/blocks', data); }
14
+ edit(id, data) { return this.#client.patch(`/blocks/${id}`, data); }
15
+ delete(id) { return this.#client.del(`/blocks/${id}`); }
12
16
  }