Skip to content

Commit b248213

Browse files
committed
Added deprecation notice
1 parent 4e36143 commit b248213

File tree

1 file changed

+46
-49
lines changed

1 file changed

+46
-49
lines changed

README.md

+46-49
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1+
# ⚠️ ⚠️ ⚠️ Deprecated Package ⚠️ ⚠️ ⚠️
2+
3+
This package has been renamed, and so this version has been deprecated.
4+
5+
Development is continuing under the name [@sipcentric/pbx-client](https://www.npmjs.com/package/@sipcentric/pbx-client), please use that instead.
6+
7+
---
8+
19
# Nimvelo Node.js Client
210

311
Node.js client for the [Nimvelo/Sipcentric API](https://developer.nimvelo.com/).
412

5-
613
## Usage
714

815
```
916
npm install @nimvelo/phone-api-client
1017
```
1118

1219
```js
13-
const Nimvelo = require('@nimvelo/phone-api-client');
20+
const Nimvelo = require("@nimvelo/phone-api-client");
1421

1522
// ...
1623
```
@@ -39,12 +46,12 @@ There are further examples in the `examples/` directory. To try them, just clone
3946
#### Get all customers a user has access to
4047

4148
```js
42-
const Nimvelo = require('@nimvelo/phone-api-client');
49+
const Nimvelo = require("@nimvelo/phone-api-client");
4350

4451
(async () => {
4552
const nimvelo = new Nimvelo({
46-
username: 'myusername',
47-
password: 'mypassword'
53+
username: "myusername",
54+
password: "mypassword"
4855
});
4956

5057
const customers = await nimvelo.customers.get();
@@ -55,12 +62,12 @@ const Nimvelo = require('@nimvelo/phone-api-client');
5562
#### Get a specific customer
5663

5764
```js
58-
const Nimvelo = require('@nimvelo/phone-api-client');
65+
const Nimvelo = require("@nimvelo/phone-api-client");
5966

6067
(async () => {
6168
const nimvelo = new Nimvelo({
62-
username: 'myusername',
63-
password: 'mypassword'
69+
username: "myusername",
70+
password: "mypassword"
6471
});
6572

6673
const customerId = 1234;
@@ -73,12 +80,12 @@ const Nimvelo = require('@nimvelo/phone-api-client');
7380
#### Get a customer's phone book
7481

7582
```js
76-
const Nimvelo = require('@nimvelo/phone-api-client');
83+
const Nimvelo = require("@nimvelo/phone-api-client");
7784

7885
(async () => {
7986
const nimvelo = new Nimvelo({
80-
username: 'myusername',
81-
password: 'mypassword'
87+
username: "myusername",
88+
password: "mypassword"
8289
});
8390

8491
const customerId = 1234;
@@ -93,26 +100,24 @@ const Nimvelo = require('@nimvelo/phone-api-client');
93100
#### Create phone book entry
94101

95102
```js
96-
const Nimvelo = require('@nimvelo/phone-api-client');
103+
const Nimvelo = require("@nimvelo/phone-api-client");
97104

98105
(async () => {
99106
const nimvelo = new Nimvelo({
100-
username: 'myusername',
101-
password: 'mypassword'
107+
username: "myusername",
108+
password: "mypassword"
102109
});
103110

104111
const customerId = 1234;
105112

106113
const customer = await nimvelo.customers.get(customerId);
107114
const phonebookentry = {
108-
name: 'Nimvelo',
109-
phoneNumber: '03301200030',
110-
115+
name: "Nimvelo",
116+
phoneNumber: "03301200030",
117+
111118
};
112119

113-
const createdEntry = await customer.phonebook
114-
.create(phonebookentry)
115-
.save();
120+
const createdEntry = await customer.phonebook.create(phonebookentry).save();
116121

117122
console.log(createdEntry);
118123
})();
@@ -121,12 +126,12 @@ const Nimvelo = require('@nimvelo/phone-api-client');
121126
#### Update phone book entry
122127

123128
```js
124-
const Nimvelo = require('@nimvelo/phone-api-client');
129+
const Nimvelo = require("@nimvelo/phone-api-client");
125130

126131
(async () => {
127132
const nimvelo = new Nimvelo({
128-
username: 'myusername',
129-
password: 'mypassword'
133+
username: "myusername",
134+
password: "mypassword"
130135
});
131136

132137
const customerId = 1234;
@@ -135,24 +140,23 @@ const Nimvelo = require('@nimvelo/phone-api-client');
135140
const customer = await nimvelo.customers.get(customerId);
136141
const phonebookentry = await customer.phonebook.get(phonebookentryId);
137142

138-
phonebookentry.name = 'Updated name';
143+
phonebookentry.name = "Updated name";
139144

140145
const savedEntry = await phonebookentry.save();
141146

142147
console.log(savedEntry);
143148
})();
144149
```
145150

146-
147151
#### Delete phone book entry
148152

149153
```js
150-
const Nimvelo = require('@nimvelo/phone-api-client');
154+
const Nimvelo = require("@nimvelo/phone-api-client");
151155

152156
(async () => {
153157
const nimvelo = new Nimvelo({
154-
username: 'myusername',
155-
password: 'mypassword'
158+
username: "myusername",
159+
password: "mypassword"
156160
});
157161

158162
const customerId = 1234;
@@ -165,58 +169,52 @@ const Nimvelo = require('@nimvelo/phone-api-client');
165169
})();
166170
```
167171

168-
169172
#### Subscribe to incoming call events
170173

171174
```js
172-
const Nimvelo = require('@nimvelo/phone-api-client');
175+
const Nimvelo = require("@nimvelo/phone-api-client");
173176

174177
const nimvelo = new Nimvelo({
175-
username: 'myusername',
176-
password: 'mypassword'
178+
username: "myusername",
179+
password: "mypassword"
177180
});
178181

179-
nimvelo.stream.subscribe('incomingcall', function(call) {
180-
182+
nimvelo.stream.subscribe("incomingcall", function(call) {
181183
console.log(call);
182-
183184
});
184-
185185
```
186186

187-
188187
#### Monitor presence of an extension
189188

190189
```js
191-
const Nimvelo = require('@nimvelo/phone-api-client');
190+
const Nimvelo = require("@nimvelo/phone-api-client");
192191

193192
const nimvelo = new Nimvelo({
194-
username: 'myusername',
195-
password: 'mypassword',
193+
username: "myusername",
194+
password: "mypassword"
196195
});
197196

198197
const myCustomerId = 1; // Change this to your customer ID
199198

200199
// Returns an array of subscriptions
201200
const subscriptions = await nimvelo.presenceWatcher.subscribe({
202201
customerId: myCustomerId,
203-
targets: ['012345'], // The extensions you'd like to monitor
202+
targets: ["012345"], // The extensions you'd like to monitor
204203
onStateChange: (extension, newState) => {
205204
console.log(extension); // 012345
206205
console.log(newState); // AVAILABLE, BUSY, or RINGING
207-
},
206+
}
208207
});
209208
```
210209

211-
212210
#### Monitor presence of all extensions on an account
213211

214212
```js
215-
const Nimvelo = require('@nimvelo/phone-api-client');
213+
const Nimvelo = require("@nimvelo/phone-api-client");
216214

217215
const nimvelo = new Nimvelo({
218-
username: 'myusername',
219-
password: 'mypassword',
216+
username: "myusername",
217+
password: "mypassword"
220218
});
221219

222220
const subscribeToAll = async () => {
@@ -236,14 +234,13 @@ const subscribeToAll = async () => {
236234
onStateChange: (extension, newState) => {
237235
console.log(extension);
238236
console.log(newState);
239-
},
237+
}
240238
});
241239
};
242240

243241
try {
244242
subscribeToAll();
245243
} catch (err) {
246-
console.error('Error: ', err);
244+
console.error("Error: ", err);
247245
}
248246
```
249-

0 commit comments

Comments
 (0)