@myvoip/sdk 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/package.json +9 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 UponAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @myvoip/sdk
2
+
3
+ TypeScript client for the NetSapiens migration tool at https://netsapiens.uponai.com and for a NetSapiens portal. MIT © 2026 UponAI. Requires Node >=22. ESM only.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @myvoip/sdk
9
+ ```
10
+
11
+ ## Migration tool
12
+
13
+ ```ts
14
+ import { UponAI } from "@myvoip/sdk";
15
+
16
+ const upon = new UponAI({ apiToken: process.env.UPONAI_API_TOKEN! });
17
+
18
+ const mappings = await upon.mappings.list();
19
+ const run = await upon.migrations.get("RUN_ID");
20
+ ```
21
+
22
+ `apiToken` is the access token from signing in to the migration tool, and it expires. `baseUrl` defaults to `https://netsapiens.uponai.com`.
23
+
24
+ ## NetSapiens portal
25
+
26
+ ```ts
27
+ import { Netsapiens } from "@myvoip/sdk";
28
+
29
+ const portal = new Netsapiens({
30
+ apiToken: process.env.NETSAPIENS_API_TOKEN!,
31
+ baseUrl: "https://portal.example.com",
32
+ });
33
+
34
+ const trunks = await portal.connections("example.myvoip");
35
+ ```
36
+
37
+ Load credentials from your secret store and do not commit them. Fields whose names contain words such as `password`, `secret` or `token` are masked in responses.
38
+
39
+ Failed requests throw `ApiError` with `status` and `body`. An HTTP 401 throws `AuthenticationError`.
40
+
41
+ `upon.migrations.start(preflightRunId, dryRun)` runs a live migration unless `dryRun` is `true`. This SDK has no do-not-migrate or confirmation checks, so add your own before calling it.
package/package.json CHANGED
@@ -1,17 +1,23 @@
1
1
  {
2
2
  "name": "@myvoip/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "TypeScript SDK for the UponAI migration tool and the NetSapiens portal",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "engines": { "node": ">=22" },
7
+ "engines": {
8
+ "node": ">=22"
9
+ },
8
10
  "exports": {
9
11
  ".": {
10
12
  "types": "./dist/index.d.ts",
11
13
  "import": "./dist/index.js"
12
14
  }
13
15
  },
14
- "files": ["dist"],
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
15
21
  "scripts": {
16
22
  "build": "tsc -p tsconfig.json",
17
23
  "test": "node --experimental-strip-types --test src/http.test.ts"