@scout9/admin 1.0.1 → 1.0.3

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 (122) hide show
  1. package/package.json +12 -3
  2. package/src/api.ts +3735 -95
  3. package/src/base.ts +34 -17
  4. package/src/common.ts +73 -59
  5. package/src/configuration.ts +92 -115
  6. package/src/index.ts +16 -0
  7. package/tsconfig.tsbuildinfo +1 -1
  8. package/build/api-openai.d.ts +0 -2992
  9. package/build/api-openai.js +0 -1968
  10. package/build/api.d.ts +0 -78
  11. package/build/api.js +0 -90
  12. package/build/base.d.ts +0 -43
  13. package/build/base.js +0 -52
  14. package/build/common.d.ts +0 -54
  15. package/build/common.js +0 -132
  16. package/build/configuration.d.ts +0 -84
  17. package/build/configuration.js +0 -106
  18. package/build/index.d.ts +0 -2
  19. package/build/index.js +0 -18
  20. package/build/schemas/common/algolia.d.ts +0 -20
  21. package/build/schemas/common/algolia.js +0 -2
  22. package/build/schemas/common/contact-map.d.ts +0 -33
  23. package/build/schemas/common/contact-map.js +0 -2
  24. package/build/schemas/common/currency.d.ts +0 -1
  25. package/build/schemas/common/currency.js +0 -2
  26. package/build/schemas/common/index.d.ts +0 -6
  27. package/build/schemas/common/index.js +0 -22
  28. package/build/schemas/common/location.d.ts +0 -5
  29. package/build/schemas/common/location.js +0 -2
  30. package/build/schemas/common/task.d.ts +0 -20
  31. package/build/schemas/common/task.js +0 -2
  32. package/build/schemas/common/time.d.ts +0 -14
  33. package/build/schemas/common/time.js +0 -2
  34. package/build/schemas/common.d.ts +0 -77
  35. package/build/schemas/common.js +0 -8
  36. package/build/schemas/conversations/context.d.ts +0 -55
  37. package/build/schemas/conversations/context.js +0 -2
  38. package/build/schemas/conversations/conversation.d.ts +0 -53
  39. package/build/schemas/conversations/conversation.js +0 -2
  40. package/build/schemas/conversations/index.d.ts +0 -6
  41. package/build/schemas/conversations/index.js +0 -22
  42. package/build/schemas/conversations/message.d.ts +0 -62
  43. package/build/schemas/conversations/message.js +0 -2
  44. package/build/schemas/conversations/parsed.d.ts +0 -7
  45. package/build/schemas/conversations/parsed.js +0 -2
  46. package/build/schemas/conversations/scheduled-conversation.d.ts +0 -31
  47. package/build/schemas/conversations/scheduled-conversation.js +0 -2
  48. package/build/schemas/conversations/webhook.d.ts +0 -8
  49. package/build/schemas/conversations/webhook.js +0 -2
  50. package/build/schemas/index.d.ts +0 -3
  51. package/build/schemas/index.js +0 -19
  52. package/build/schemas/users/businesses/agents/agent.d.ts +0 -76
  53. package/build/schemas/users/businesses/agents/agent.js +0 -2
  54. package/build/schemas/users/businesses/agents/auth.d.ts +0 -7
  55. package/build/schemas/users/businesses/agents/auth.js +0 -2
  56. package/build/schemas/users/businesses/agents/index.d.ts +0 -2
  57. package/build/schemas/users/businesses/agents/index.js +0 -18
  58. package/build/schemas/users/businesses/business-location.d.ts +0 -10
  59. package/build/schemas/users/businesses/business-location.js +0 -2
  60. package/build/schemas/users/businesses/business.d.ts +0 -32
  61. package/build/schemas/users/businesses/business.js +0 -2
  62. package/build/schemas/users/businesses/context/context-indexed.d.ts +0 -9
  63. package/build/schemas/users/businesses/context/context-indexed.js +0 -2
  64. package/build/schemas/users/businesses/context/context-saves.d.ts +0 -12
  65. package/build/schemas/users/businesses/context/context-saves.js +0 -2
  66. package/build/schemas/users/businesses/context/context.d.ts +0 -64
  67. package/build/schemas/users/businesses/context/context.js +0 -2
  68. package/build/schemas/users/businesses/context/index.d.ts +0 -2
  69. package/build/schemas/users/businesses/context/index.js +0 -18
  70. package/build/schemas/users/businesses/index.d.ts +0 -5
  71. package/build/schemas/users/businesses/index.js +0 -21
  72. package/build/schemas/users/businesses/notifications.d.ts +0 -7
  73. package/build/schemas/users/businesses/notifications.js +0 -2
  74. package/build/schemas/users/businesses/offerings/index.d.ts +0 -2
  75. package/build/schemas/users/businesses/offerings/index.js +0 -18
  76. package/build/schemas/users/businesses/offerings/offer-indexed.d.ts +0 -34
  77. package/build/schemas/users/businesses/offerings/offer-indexed.js +0 -2
  78. package/build/schemas/users/businesses/offerings/offer.d.ts +0 -29
  79. package/build/schemas/users/businesses/offerings/offer.js +0 -2
  80. package/build/schemas/users/businesses/thread.d.ts +0 -44
  81. package/build/schemas/users/businesses/thread.js +0 -2
  82. package/build/schemas/users/customers/customer.d.ts +0 -35
  83. package/build/schemas/users/customers/customer.js +0 -2
  84. package/build/schemas/users/customers/index.d.ts +0 -1
  85. package/build/schemas/users/customers/index.js +0 -17
  86. package/build/schemas/users/index.d.ts +0 -2
  87. package/build/schemas/users/index.js +0 -18
  88. package/src/api-openai.txt +0 -4117
  89. package/src/schemas/common/algolia.ts +0 -24
  90. package/src/schemas/common/contact-map.ts +0 -35
  91. package/src/schemas/common/currency.ts +0 -1
  92. package/src/schemas/common/index.ts +0 -6
  93. package/src/schemas/common/location.ts +0 -6
  94. package/src/schemas/common/task.ts +0 -26
  95. package/src/schemas/common/time.ts +0 -15
  96. package/src/schemas/common.ts +0 -94
  97. package/src/schemas/conversations/context.ts +0 -64
  98. package/src/schemas/conversations/conversation.ts +0 -68
  99. package/src/schemas/conversations/index.ts +0 -6
  100. package/src/schemas/conversations/message.ts +0 -78
  101. package/src/schemas/conversations/parsed.ts +0 -5
  102. package/src/schemas/conversations/scheduled-conversation.ts +0 -35
  103. package/src/schemas/conversations/webhook.ts +0 -10
  104. package/src/schemas/index.ts +0 -3
  105. package/src/schemas/users/businesses/agents/agent.ts +0 -107
  106. package/src/schemas/users/businesses/agents/auth.ts +0 -8
  107. package/src/schemas/users/businesses/agents/index.ts +0 -2
  108. package/src/schemas/users/businesses/business-location.ts +0 -15
  109. package/src/schemas/users/businesses/business.ts +0 -43
  110. package/src/schemas/users/businesses/context/context-indexed.ts +0 -11
  111. package/src/schemas/users/businesses/context/context-saves.ts +0 -14
  112. package/src/schemas/users/businesses/context/context.ts +0 -76
  113. package/src/schemas/users/businesses/context/index.ts +0 -2
  114. package/src/schemas/users/businesses/index.ts +0 -6
  115. package/src/schemas/users/businesses/notifications.ts +0 -12
  116. package/src/schemas/users/businesses/offerings/index.ts +0 -2
  117. package/src/schemas/users/businesses/offerings/offer-indexed.ts +0 -42
  118. package/src/schemas/users/businesses/offerings/offer.ts +0 -39
  119. package/src/schemas/users/businesses/thread.ts +0 -55
  120. package/src/schemas/users/customers/customer.ts +0 -46
  121. package/src/schemas/users/customers/index.ts +0 -1
  122. package/src/schemas/users/index.ts +0 -2
@@ -1,32 +0,0 @@
1
- /**
2
- * scout9-businesses/{businessId}
3
- */
4
- export interface IBusiness {
5
- name: string;
6
- logo?: string;
7
- icon?: string;
8
- /**
9
- * User id of the owner of this account
10
- */
11
- $owner: string;
12
- phone: string;
13
- email: string;
14
- /**
15
- * 1 sentence what does this business do?
16
- */
17
- context: string;
18
- apiKey?: string;
19
- website?: string;
20
- webhookUrl?: string;
21
- /**
22
- * Stripe customer ids for charging subscriptions
23
- */
24
- stripeCustomer?: string;
25
- stripeCustomerDev?: string;
26
- /**
27
- * Stripe connect ids for charging customers on behalf of Scout9
28
- */
29
- stripeConnect?: string;
30
- stripeConnectDev?: string;
31
- twilioAddressSid?: string;
32
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- import { IAlgoliaIndexedObject } from '../../../common';
2
- import { IContext } from './context';
3
- /**
4
- * scout9-businesses/{businessId}/context-indexed/{context}
5
- * An auto generated context, when a context category is created it will be indexed in a collection, resolving all stripe and
6
- * algolia references.
7
- */
8
- export interface IContextIndexed extends IContext, IAlgoliaIndexedObject {
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- import { Timestamp } from '../../../common';
2
- /**
3
- * When a context field receives uploaded bulk data (csv/excel/json)
4
- * scout9-businesses/{businessId}/context/{context}/saves/{save_time}
5
- */
6
- export interface IContextSaves {
7
- /**
8
- * Where the file was saved
9
- */
10
- ref: string;
11
- time: Timestamp;
12
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,64 +0,0 @@
1
- import { ThreadLanguage } from '../thread';
2
- /**
3
- * Used to build NLP models to detect context invocation
4
- */
5
- export interface IContextDetectionParams {
6
- /**
7
- * Key word entities to detect in a contacts message
8
- */
9
- entities: {
10
- /**
11
- * @deprecated
12
- */
13
- utteranceId?: string;
14
- option: string;
15
- languages: ThreadLanguage[];
16
- text: string[];
17
- }[];
18
- /**
19
- * Documents or phrases to train the model
20
- */
21
- documents: {
22
- language: ThreadLanguage;
23
- text: string;
24
- id: string;
25
- }[];
26
- }
27
- /**
28
- * scout9-businesses/{businessId}/context/{$id}
29
- *
30
- * Context field to be used for conversation context and workflows
31
- */
32
- export interface IContext {
33
- /**
34
- * Context $id - this is used to store the context data under the given collection
35
- * scout9-businesses/{businessId}/{$id}/{row}
36
- */
37
- $id: string;
38
- /**
39
- * Name of the context
40
- */
41
- name: string;
42
- modifiable: boolean;
43
- /**
44
- * Description of the context
45
- */
46
- description?: string;
47
- /**
48
- * If provided, this can be used to detect if a given message is invoking this context
49
- */
50
- detection?: IContextDetectionParams;
51
- /**
52
- * The column that represents the id of a given context row
53
- */
54
- idColumn: string;
55
- /**
56
- * Column fields that could exist in the context
57
- */
58
- columns: string[];
59
- /**
60
- * If provided this will enforce that the given columns are required
61
- * NOTE: idColumn by default is required
62
- */
63
- requiredColumns?: string[];
64
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- export * from './context';
2
- export * from './context-indexed';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./context"), exports);
18
- __exportStar(require("./context-indexed"), exports);
@@ -1,5 +0,0 @@
1
- export * from './business';
2
- export * from './business-location';
3
- export * from './agents';
4
- export * from './thread';
5
- export * from './notifications';
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./business"), exports);
18
- __exportStar(require("./business-location"), exports);
19
- __exportStar(require("./agents"), exports);
20
- __exportStar(require("./thread"), exports);
21
- __exportStar(require("./notifications"), exports);
@@ -1,7 +0,0 @@
1
- import { Timestamp } from '../../common';
2
- export interface INotification {
3
- time: Timestamp;
4
- read?: Timestamp;
5
- content: string;
6
- href: string;
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- export * from './offer';
2
- export * from './offer-indexed';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./offer"), exports);
18
- __exportStar(require("./offer-indexed"), exports);
@@ -1,34 +0,0 @@
1
- /**
2
- * scout9-businesses/{businessId}/offers-indexed/{offerId}
3
- * An auto generated offer, when an offer is created it will be indexed in a collection, resolving all stripe and
4
- * algolia references.
5
- */
6
- import { IOffer } from './offer';
7
- /**
8
- * @deprecated - use Context
9
- */
10
- export interface IOfferIndexed extends IOffer {
11
- /**
12
- * scout9-businesses/{businessId}/offers/{parent}
13
- */
14
- parent: string;
15
- /**
16
- * Algolia objectID
17
- */
18
- objectID: string;
19
- /**
20
- * Stripe product ID
21
- */
22
- stripe?: string;
23
- /**
24
- * Stripe product ID for dev
25
- */
26
- stripeDev?: string;
27
- /**
28
- * Algolia geolocation for the offer, offer is limited to this location at some distance
29
- */
30
- _geoloc?: {
31
- lat: number;
32
- lng: number;
33
- };
34
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,29 +0,0 @@
1
- import { Currency } from '../../../common/currency';
2
- /**
3
- * scout9-businesses/{businessId}/offers/{offerId}
4
- *
5
- * What do you offer to your customers? How can your agents help them?
6
- * @deprecated - use Context
7
- */
8
- export interface IOffer {
9
- name: string;
10
- description: string;
11
- /**
12
- * Tags for the offer to be captured by the AI
13
- */
14
- tags: string[];
15
- /**
16
- * The price of the offer is either a fixed price or an estimated price range
17
- */
18
- price: number | [number, number];
19
- currency: Currency;
20
- /**
21
- * Media urls for the offer
22
- */
23
- media?: string[];
24
- /**
25
- * scout9-businesses/{businessId}/locations/{locationId}
26
- * If provided, the offer is only limited to these locations.
27
- */
28
- locations?: string[];
29
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,44 +0,0 @@
1
- import { IConversationContextField } from '../../conversations';
2
- import { IContextDetectionParams } from './context';
3
- /**
4
- * Languages we support
5
- */
6
- export type ThreadLanguage = 'en' | 'es';
7
- /**
8
- * Used to initiate conversations
9
- * scout9-businesses/{businessId}/threads/{threadId}
10
- */
11
- export interface IThread {
12
- /**
13
- * Name of the thread
14
- */
15
- name: string;
16
- /**
17
- * Metadata to be used to detect when this conversation should be initiated
18
- */
19
- initiators: IContextDetectionParams;
20
- /**
21
- * Fields to be loaded to a conversation
22
- */
23
- fields: IConversationContextField[];
24
- /**
25
- * About this conversation - used as initial context
26
- */
27
- context: string;
28
- /**
29
- * Public webhook when thread is created
30
- */
31
- onCreated?: string;
32
- /**
33
- * Public webhook when thread is updated
34
- */
35
- onUpdated?: string;
36
- /**
37
- * Public webhook when thread is deleted
38
- */
39
- onDeleted?: string;
40
- /**
41
- * Public webhook when thread has an error
42
- */
43
- onError?: string;
44
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,35 +0,0 @@
1
- /**
2
- * If user is blocked, we can't send messages to them, this could happen if the customer has unsubscribed from the business
3
- */
4
- import { Stripe, Timestamp } from '../../common';
5
- export interface IBlockInfo {
6
- message: string;
7
- time: Timestamp;
8
- }
9
- /**
10
- * scout9-businesses/{$business}/customers/{customerId}
11
- *
12
- * Any information that is specific to a customer (not a businesses), the customerId can be used to get the auth details
13
- * (email/phone)
14
- */
15
- export interface ICustomer extends Partial<Stripe.Address> {
16
- firstName: string;
17
- lastName: string;
18
- img?: string;
19
- /**
20
- * If this is a temp user, delete them after x days
21
- */
22
- temp?: boolean;
23
- neighborhood?: string;
24
- neighborhoodName?: string;
25
- address?: string;
26
- addressStr?: string;
27
- blocked?: IBlockInfo;
28
- phone?: string;
29
- phoneBlocked?: IBlockInfo;
30
- email?: string;
31
- emailBlocked?: IBlockInfo;
32
- joined?: Timestamp;
33
- stripe?: string;
34
- stripeDev?: string;
35
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from './customer';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./customer"), exports);
@@ -1,2 +0,0 @@
1
- export * from './customers';
2
- export * from './businesses';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./customers"), exports);
18
- __exportStar(require("./businesses"), exports);