@scout9/admin 1.0.0 → 1.0.2
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/README.md +58 -1
- package/build/api.d.ts +1116 -32
- package/build/api.js +475 -12
- package/build/base.d.ts +11 -0
- package/build/base.js +14 -0
- package/build/common.d.ts +11 -0
- package/build/common.js +13 -0
- package/build/configuration.d.ts +11 -12
- package/build/configuration.js +13 -28
- package/build/index.d.ts +11 -0
- package/build/index.js +13 -0
- package/package.json +6 -2
- package/src/.openapi-generator/FILES +9 -0
- package/src/.openapi-generator/VERSION +1 -0
- package/src/api.ts +1417 -95
- package/src/base.ts +34 -17
- package/src/common.ts +73 -59
- package/src/configuration.ts +92 -115
- package/src/index.ts +16 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/api-openai.txt +0 -4117
- package/src/schemas/common/algolia.ts +0 -24
- package/src/schemas/common/contact-map.ts +0 -35
- package/src/schemas/common/currency.ts +0 -1
- package/src/schemas/common/index.ts +0 -6
- package/src/schemas/common/location.ts +0 -6
- package/src/schemas/common/task.ts +0 -26
- package/src/schemas/common/time.ts +0 -15
- package/src/schemas/common.ts +0 -94
- package/src/schemas/conversations/context.ts +0 -64
- package/src/schemas/conversations/conversation.ts +0 -68
- package/src/schemas/conversations/index.ts +0 -6
- package/src/schemas/conversations/message.ts +0 -78
- package/src/schemas/conversations/parsed.ts +0 -5
- package/src/schemas/conversations/scheduled-conversation.ts +0 -35
- package/src/schemas/conversations/webhook.ts +0 -10
- package/src/schemas/index.ts +0 -3
- package/src/schemas/users/businesses/agents/agent.ts +0 -107
- package/src/schemas/users/businesses/agents/auth.ts +0 -8
- package/src/schemas/users/businesses/agents/index.ts +0 -2
- package/src/schemas/users/businesses/business-location.ts +0 -15
- package/src/schemas/users/businesses/business.ts +0 -43
- package/src/schemas/users/businesses/context/context-indexed.ts +0 -11
- package/src/schemas/users/businesses/context/context-saves.ts +0 -14
- package/src/schemas/users/businesses/context/context.ts +0 -76
- package/src/schemas/users/businesses/context/index.ts +0 -2
- package/src/schemas/users/businesses/index.ts +0 -6
- package/src/schemas/users/businesses/notifications.ts +0 -12
- package/src/schemas/users/businesses/offerings/index.ts +0 -2
- package/src/schemas/users/businesses/offerings/offer-indexed.ts +0 -42
- package/src/schemas/users/businesses/offerings/offer.ts +0 -39
- package/src/schemas/users/businesses/thread.ts +0 -55
- package/src/schemas/users/customers/customer.ts +0 -46
- package/src/schemas/users/customers/index.ts +0 -1
- package/src/schemas/users/index.ts +0 -2
package/README.md
CHANGED
|
@@ -1 +1,58 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scout9 API
|
|
2
|
+
|
|
3
|
+
Node.js API for [Scout9](https://www.scout9.com)
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @scout9/admin --save
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Configuration, Scout9Api } from '@scout9/admin';
|
|
11
|
+
|
|
12
|
+
const configuration = new Configuration({
|
|
13
|
+
apiKey: '', // Your API key
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const scout9 = new Scout9Api(configuration);
|
|
17
|
+
|
|
18
|
+
const customer = scout9.createCustomer({
|
|
19
|
+
firstName: 'Hi',
|
|
20
|
+
lastName: 'Jack',
|
|
21
|
+
email: 'hi@example.com',
|
|
22
|
+
phone: '+15555555555',
|
|
23
|
+
})
|
|
24
|
+
.then((res) => {
|
|
25
|
+
console.log('Success', res);
|
|
26
|
+
})
|
|
27
|
+
.catch((err) => {
|
|
28
|
+
console.error('Error', err);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const agent = scout9.createAgent({
|
|
33
|
+
firstName: 'Bye',
|
|
34
|
+
lastName: 'Jack',
|
|
35
|
+
email: 'jack@company.com',
|
|
36
|
+
phone: '+15555555552',
|
|
37
|
+
})
|
|
38
|
+
.then((res) => {
|
|
39
|
+
console.log('Success', res);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
console.error('Error', err);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
const conversation = await scout9.startConversation({
|
|
47
|
+
customer: customer.id,
|
|
48
|
+
agent: agent.id,
|
|
49
|
+
channel: 'sms',
|
|
50
|
+
message: 'Hello, how can I help you?',
|
|
51
|
+
})
|
|
52
|
+
.then((res) => {
|
|
53
|
+
console.log('Success', res);
|
|
54
|
+
})
|
|
55
|
+
.catch((err) => {
|
|
56
|
+
console.error('Error', err);
|
|
57
|
+
});
|
|
58
|
+
```
|