@scout9/admin 1.0.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.
Files changed (124) hide show
  1. package/README.md +1 -0
  2. package/build/api-openai.d.ts +2992 -0
  3. package/build/api-openai.js +1968 -0
  4. package/build/api.d.ts +78 -0
  5. package/build/api.js +90 -0
  6. package/build/base.d.ts +43 -0
  7. package/build/base.js +52 -0
  8. package/build/common.d.ts +54 -0
  9. package/build/common.js +132 -0
  10. package/build/configuration.d.ts +84 -0
  11. package/build/configuration.js +106 -0
  12. package/build/index.d.ts +2 -0
  13. package/build/index.js +18 -0
  14. package/build/schemas/common/algolia.d.ts +20 -0
  15. package/build/schemas/common/algolia.js +2 -0
  16. package/build/schemas/common/contact-map.d.ts +33 -0
  17. package/build/schemas/common/contact-map.js +2 -0
  18. package/build/schemas/common/currency.d.ts +1 -0
  19. package/build/schemas/common/currency.js +2 -0
  20. package/build/schemas/common/index.d.ts +6 -0
  21. package/build/schemas/common/index.js +22 -0
  22. package/build/schemas/common/location.d.ts +5 -0
  23. package/build/schemas/common/location.js +2 -0
  24. package/build/schemas/common/task.d.ts +20 -0
  25. package/build/schemas/common/task.js +2 -0
  26. package/build/schemas/common/time.d.ts +14 -0
  27. package/build/schemas/common/time.js +2 -0
  28. package/build/schemas/common.d.ts +77 -0
  29. package/build/schemas/common.js +8 -0
  30. package/build/schemas/conversations/context.d.ts +55 -0
  31. package/build/schemas/conversations/context.js +2 -0
  32. package/build/schemas/conversations/conversation.d.ts +53 -0
  33. package/build/schemas/conversations/conversation.js +2 -0
  34. package/build/schemas/conversations/index.d.ts +6 -0
  35. package/build/schemas/conversations/index.js +22 -0
  36. package/build/schemas/conversations/message.d.ts +62 -0
  37. package/build/schemas/conversations/message.js +2 -0
  38. package/build/schemas/conversations/parsed.d.ts +7 -0
  39. package/build/schemas/conversations/parsed.js +2 -0
  40. package/build/schemas/conversations/scheduled-conversation.d.ts +31 -0
  41. package/build/schemas/conversations/scheduled-conversation.js +2 -0
  42. package/build/schemas/conversations/webhook.d.ts +8 -0
  43. package/build/schemas/conversations/webhook.js +2 -0
  44. package/build/schemas/index.d.ts +3 -0
  45. package/build/schemas/index.js +19 -0
  46. package/build/schemas/users/businesses/agents/agent.d.ts +76 -0
  47. package/build/schemas/users/businesses/agents/agent.js +2 -0
  48. package/build/schemas/users/businesses/agents/auth.d.ts +7 -0
  49. package/build/schemas/users/businesses/agents/auth.js +2 -0
  50. package/build/schemas/users/businesses/agents/index.d.ts +2 -0
  51. package/build/schemas/users/businesses/agents/index.js +18 -0
  52. package/build/schemas/users/businesses/business-location.d.ts +10 -0
  53. package/build/schemas/users/businesses/business-location.js +2 -0
  54. package/build/schemas/users/businesses/business.d.ts +32 -0
  55. package/build/schemas/users/businesses/business.js +2 -0
  56. package/build/schemas/users/businesses/context/context-indexed.d.ts +9 -0
  57. package/build/schemas/users/businesses/context/context-indexed.js +2 -0
  58. package/build/schemas/users/businesses/context/context-saves.d.ts +12 -0
  59. package/build/schemas/users/businesses/context/context-saves.js +2 -0
  60. package/build/schemas/users/businesses/context/context.d.ts +64 -0
  61. package/build/schemas/users/businesses/context/context.js +2 -0
  62. package/build/schemas/users/businesses/context/index.d.ts +2 -0
  63. package/build/schemas/users/businesses/context/index.js +18 -0
  64. package/build/schemas/users/businesses/index.d.ts +5 -0
  65. package/build/schemas/users/businesses/index.js +21 -0
  66. package/build/schemas/users/businesses/notifications.d.ts +7 -0
  67. package/build/schemas/users/businesses/notifications.js +2 -0
  68. package/build/schemas/users/businesses/offerings/index.d.ts +2 -0
  69. package/build/schemas/users/businesses/offerings/index.js +18 -0
  70. package/build/schemas/users/businesses/offerings/offer-indexed.d.ts +34 -0
  71. package/build/schemas/users/businesses/offerings/offer-indexed.js +2 -0
  72. package/build/schemas/users/businesses/offerings/offer.d.ts +29 -0
  73. package/build/schemas/users/businesses/offerings/offer.js +2 -0
  74. package/build/schemas/users/businesses/thread.d.ts +44 -0
  75. package/build/schemas/users/businesses/thread.js +2 -0
  76. package/build/schemas/users/customers/customer.d.ts +35 -0
  77. package/build/schemas/users/customers/customer.js +2 -0
  78. package/build/schemas/users/customers/index.d.ts +1 -0
  79. package/build/schemas/users/customers/index.js +17 -0
  80. package/build/schemas/users/index.d.ts +2 -0
  81. package/build/schemas/users/index.js +18 -0
  82. package/package.json +33 -0
  83. package/src/api-openai.txt +4117 -0
  84. package/src/api.ts +141 -0
  85. package/src/base.ts +55 -0
  86. package/src/common.ts +136 -0
  87. package/src/configuration.ts +124 -0
  88. package/src/index.ts +2 -0
  89. package/src/schemas/common/algolia.ts +24 -0
  90. package/src/schemas/common/contact-map.ts +35 -0
  91. package/src/schemas/common/currency.ts +1 -0
  92. package/src/schemas/common/index.ts +6 -0
  93. package/src/schemas/common/location.ts +6 -0
  94. package/src/schemas/common/task.ts +26 -0
  95. package/src/schemas/common/time.ts +15 -0
  96. package/src/schemas/common.ts +94 -0
  97. package/src/schemas/conversations/context.ts +64 -0
  98. package/src/schemas/conversations/conversation.ts +68 -0
  99. package/src/schemas/conversations/index.ts +6 -0
  100. package/src/schemas/conversations/message.ts +78 -0
  101. package/src/schemas/conversations/parsed.ts +5 -0
  102. package/src/schemas/conversations/scheduled-conversation.ts +35 -0
  103. package/src/schemas/conversations/webhook.ts +10 -0
  104. package/src/schemas/index.ts +3 -0
  105. package/src/schemas/users/businesses/agents/agent.ts +107 -0
  106. package/src/schemas/users/businesses/agents/auth.ts +8 -0
  107. package/src/schemas/users/businesses/agents/index.ts +2 -0
  108. package/src/schemas/users/businesses/business-location.ts +15 -0
  109. package/src/schemas/users/businesses/business.ts +43 -0
  110. package/src/schemas/users/businesses/context/context-indexed.ts +11 -0
  111. package/src/schemas/users/businesses/context/context-saves.ts +14 -0
  112. package/src/schemas/users/businesses/context/context.ts +76 -0
  113. package/src/schemas/users/businesses/context/index.ts +2 -0
  114. package/src/schemas/users/businesses/index.ts +6 -0
  115. package/src/schemas/users/businesses/notifications.ts +12 -0
  116. package/src/schemas/users/businesses/offerings/index.ts +2 -0
  117. package/src/schemas/users/businesses/offerings/offer-indexed.ts +42 -0
  118. package/src/schemas/users/businesses/offerings/offer.ts +39 -0
  119. package/src/schemas/users/businesses/thread.ts +55 -0
  120. package/src/schemas/users/customers/customer.ts +46 -0
  121. package/src/schemas/users/customers/index.ts +1 -0
  122. package/src/schemas/users/index.ts +2 -0
  123. package/tsconfig.json +16 -0
  124. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,33 @@
1
+ import { EmailServiceType } from '../users';
2
+ export interface IContactPath {
3
+ id: string;
4
+ path: string;
5
+ }
6
+ /**
7
+ * A utility helper collection to map contact information to a common format.
8
+ *
9
+ * scout9-contact-map/{contact}
10
+ */
11
+ export interface IContactMap {
12
+ /**
13
+ * Can either be the formatted phone number or email address.
14
+ */
15
+ contact: string;
16
+ agentPaths: {
17
+ businessId: string;
18
+ agentId: string;
19
+ }[];
20
+ customerPaths: {
21
+ businessId: string;
22
+ customerId: string;
23
+ }[];
24
+ programmableEmailProps?: {
25
+ type: EmailServiceType;
26
+ /**
27
+ * If this email is a gmail email, then we can store the refresh token (after they O-Auth) here so that we can run gmail.contacts.watch
28
+ * @TODO - create a O-Auth flow for this, see scripts/gmail/generate-refresh-token for an example
29
+ */
30
+ gmailRefreshToken?: string;
31
+ gmailWatchExpiration?: string;
32
+ };
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type Currency = 'usd' | 'cad';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export * from './location';
2
+ export * from './currency';
3
+ export * from './time';
4
+ export * from './task';
5
+ export * from './contact-map';
6
+ export * from './algolia';
@@ -0,0 +1,22 @@
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("./location"), exports);
18
+ __exportStar(require("./currency"), exports);
19
+ __exportStar(require("./time"), exports);
20
+ __exportStar(require("./task"), exports);
21
+ __exportStar(require("./contact-map"), exports);
22
+ __exportStar(require("./algolia"), exports);
@@ -0,0 +1,5 @@
1
+ export interface ILocation {
2
+ placeId: string;
3
+ lat: number;
4
+ lng: number;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import { Timestamp } from '../common';
2
+ export interface ITask {
3
+ /**
4
+ * Unique token for processing
5
+ */
6
+ token?: string;
7
+ /**
8
+ * Time when the task was created
9
+ */
10
+ time: Timestamp;
11
+ /**
12
+ * When was the task completed
13
+ */
14
+ completed?: Timestamp;
15
+ retries?: number;
16
+ }
17
+ export interface IQueueTask {
18
+ token: string;
19
+ taskPath: string;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import moment from 'moment';
2
+ import { ISOString, Timestamp } from '../common';
3
+ export interface ITimeRange {
4
+ from: ISOString;
5
+ to: ISOString;
6
+ }
7
+ export interface ITimeRangeTimestamp {
8
+ from: Timestamp;
9
+ to: Timestamp;
10
+ }
11
+ export interface ITimeRangeMoment {
12
+ from: moment.Moment;
13
+ to: moment.Moment;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,77 @@
1
+ export type Timestamp = any;
2
+ export type ISOString = string;
3
+ export type MessageStatus = 'queued' | 'sending' | 'sent' | 'failed' | 'delivered' | 'undelivered' | 'receiving' | 'received' | 'accepted' | 'scheduled' | 'read' | 'partially_delivered' | 'canceled';
4
+ export declare const ChatCompletionRequestMessageRoleEnum: {
5
+ readonly System: "system";
6
+ readonly User: "user";
7
+ readonly Assistant: "assistant";
8
+ };
9
+ export type ChatCompletionRequestMessageRoleEnum = typeof ChatCompletionRequestMessageRoleEnum[keyof typeof ChatCompletionRequestMessageRoleEnum];
10
+ export interface ChatCompletionRequestMessage {
11
+ /**
12
+ * The role of the author of this message.
13
+ * @type {string}
14
+ * @memberof ChatCompletionRequestMessage
15
+ */
16
+ 'role': ChatCompletionRequestMessageRoleEnum;
17
+ /**
18
+ * The contents of the message
19
+ * @type {string}
20
+ * @memberof ChatCompletionRequestMessage
21
+ */
22
+ 'content': string;
23
+ /**
24
+ * The name of the user in a multi-user chat
25
+ * @type {string}
26
+ * @memberof ChatCompletionRequestMessage
27
+ */
28
+ 'name'?: string;
29
+ }
30
+ export declare module Stripe {
31
+ interface Address {
32
+ /**
33
+ * City/District/Suburb/Town/Village.
34
+ */
35
+ city: string | null;
36
+ /**
37
+ * 2-letter country code.
38
+ */
39
+ country: string | null;
40
+ /**
41
+ * Address line 1 (Street address/PO Box/Company name).
42
+ */
43
+ line1: string | null;
44
+ /**
45
+ * Address line 2 (Apartment/Suite/Unit/Building).
46
+ */
47
+ line2: string | null;
48
+ /**
49
+ * ZIP or postal code.
50
+ */
51
+ postal_code: string | null;
52
+ /**
53
+ * State/County/Province/Region.
54
+ */
55
+ state: string | null;
56
+ }
57
+ }
58
+ /**
59
+ * Helper schedule to bridge algolia records with internal db
60
+ */
61
+ export interface IAlgoliaIndexedObject {
62
+ /**
63
+ * Where this object is stored in the database
64
+ */
65
+ parent: string;
66
+ /**
67
+ * Algolia objectID required
68
+ */
69
+ objectID: string;
70
+ /**
71
+ * Algolia geolocation for a given object
72
+ */
73
+ _geoloc?: {
74
+ lat: number;
75
+ lng: number;
76
+ };
77
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatCompletionRequestMessageRoleEnum = void 0;
4
+ exports.ChatCompletionRequestMessageRoleEnum = {
5
+ System: 'system',
6
+ User: 'user',
7
+ Assistant: 'assistant'
8
+ };
@@ -0,0 +1,55 @@
1
+ import { Timestamp } from '../common';
2
+ import { ConversationParsed } from './parsed';
3
+ /**
4
+ * Used to put 'system' messages into the conversation
5
+ * scout9-conversations/{conversationId}/context/{contextId}
6
+ */
7
+ export interface IConversationContextField {
8
+ id: string;
9
+ /**
10
+ * Gets added to the message under role 'system'
11
+ */
12
+ time: Timestamp;
13
+ context: string;
14
+ note?: string;
15
+ metadata?: {
16
+ [key: string]: any;
17
+ };
18
+ /**
19
+ * Conditional that need to be met in order for this context to be apart of the conversation
20
+ */
21
+ conditions?: IConversationContextGroup[];
22
+ /**
23
+ * If all conditions are met, then it will trigger the following API keys
24
+ * If [info.triggers[i]] exists, then it should not trigger
25
+ */
26
+ triggers?: string[];
27
+ }
28
+ /**
29
+ * Used to group context fields together
30
+ */
31
+ export interface IConversationContextGroup {
32
+ conditions: IConversationContextFieldCondition[];
33
+ }
34
+ /**
35
+ * Based on the data from scout9-conversations/{uid}/conversations/{convoId}/info/default
36
+ * Checks to see if that data meets the given condition in order to release the API call
37
+ */
38
+ export interface IConversationContextFieldCondition {
39
+ /**
40
+ * What field in the conversation info is being checked
41
+ */
42
+ key: keyof ConversationParsed;
43
+ /**
44
+ * Operator to evaluate the info[key] against the conditional value
45
+ */
46
+ operator: 'eq' | '==' | 'neq' | '!=' | 'gt' | '>' | 'gte' | '>=' | 'lt' | '<' | 'lte' | '<=' | 'in' | 'nin' | 'exists' | '!!' | 'notExists' | '!' | 'contains' | 'notContains' | 'startsWith' | 'endsWith';
47
+ /**
48
+ * If provided, it will skip operator check and use the regex to check the value
49
+ */
50
+ regex?: string;
51
+ /**
52
+ * What is the value being checked
53
+ */
54
+ value: string | number | boolean | null | string[] | number[] | boolean[];
55
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,53 @@
1
+ import { Timestamp } from '../common';
2
+ import { IThread } from '../users';
3
+ import { ConversationEnvironment } from './message';
4
+ export interface IConversationEnvironmentProps {
5
+ subject?: string;
6
+ /**
7
+ * Used to sync email messages with the conversation
8
+ *
9
+ */
10
+ platformEmailThreadId?: string;
11
+ }
12
+ /**
13
+ * scout9-conversations/{conversationId}
14
+ *
15
+ * A two way conversation between a customer and a businesses agents
16
+ */
17
+ export interface IConversation extends Pick<IThread, 'onCreated' | 'onDeleted' | 'onUpdated' | 'onError'> {
18
+ /**
19
+ * Customer this conversation is with
20
+ * scout9-businesses/{$business}/customers/{$customer}
21
+ */
22
+ $customer: string;
23
+ /**
24
+ * Business this conversation is with
25
+ * scout9-businesses/{$businesses}
26
+ */
27
+ $business: string;
28
+ /**
29
+ * Agent assigned to this conversation
30
+ * scout9-businesses/{$businesses}/agents/{$agents}
31
+ */
32
+ $agent: string;
33
+ /**
34
+ * Thread this conversation is in - this determines what context to pull when loading the conversation
35
+ * scout9-businesses/{$businesses}/threads/{$threads}
36
+ */
37
+ $thread: string;
38
+ /**
39
+ * When the conversation is created, append these contexts to the conversation
40
+ */
41
+ initialContexts?: string[];
42
+ initiated: Timestamp;
43
+ /**
44
+ * What parser functions to run for this conversation, by default will parse core fields
45
+ */
46
+ parse?: string[];
47
+ /**
48
+ * What this environment is intended for
49
+ * Defaults to 'web'
50
+ */
51
+ environment?: ConversationEnvironment;
52
+ environmentProps?: IConversationEnvironmentProps;
53
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export * from './conversation';
2
+ export * from './message';
3
+ export * from './context';
4
+ export * from './parsed';
5
+ export * from './webhook';
6
+ export * from './scheduled-conversation';
@@ -0,0 +1,22 @@
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("./conversation"), exports);
18
+ __exportStar(require("./message"), exports);
19
+ __exportStar(require("./context"), exports);
20
+ __exportStar(require("./parsed"), exports);
21
+ __exportStar(require("./webhook"), exports);
22
+ __exportStar(require("./scheduled-conversation"), exports);
@@ -0,0 +1,62 @@
1
+ import { ChatCompletionRequestMessage, MessageStatus, Timestamp } from '../common';
2
+ import { IConversationContextField } from './context';
3
+ import { ConversationParsed } from './parsed';
4
+ export type ConversationEnvironment = 'phone' | 'web' | 'email';
5
+ export interface IConversationMessageEmailProps {
6
+ /**
7
+ * The platform that this message was sent from the assigned agent in the conversation
8
+ * (this is used to help with sync/identification mainly getting the global Message-ID)
9
+ */
10
+ platformMessageId?: string;
11
+ /**
12
+ * The global message id that this message states in email headers 'Message-ID'
13
+ */
14
+ globalMessageId?: string;
15
+ }
16
+ export interface IConversationMessage extends ChatCompletionRequestMessage {
17
+ time: Timestamp;
18
+ contentHtml?: string;
19
+ /**
20
+ * When the message is created we parse the message for relevant fields
21
+ */
22
+ parsed?: ConversationParsed;
23
+ /**
24
+ * Time at which the parsed information was processed
25
+ */
26
+ parsedLoaded?: Timestamp;
27
+ /**
28
+ * The message we are replying to
29
+ */
30
+ replyTo?: string;
31
+ emailEnvironmentProps?: IConversationMessageEmailProps;
32
+ smsEnvironmentProps?: {
33
+ twilioMessageId: string;
34
+ };
35
+ /**
36
+ * @TODO the existence of this field being being perceived as an indication that the message
37
+ * was recived by the client, this should be changed and handled properly
38
+ */
39
+ receipt?: IConversationMessageReceipt;
40
+ /**
41
+ * @TODO remove this in production as it will bloat the database
42
+ */
43
+ context?: IConversationContextField[];
44
+ }
45
+ export interface IConversationMessageReceipt {
46
+ environment: {
47
+ type: 'phone';
48
+ /**
49
+ * Twilio message id
50
+ */
51
+ sid: string;
52
+ status: MessageStatus;
53
+ } | {
54
+ type: 'web';
55
+ } | {
56
+ type: 'email';
57
+ status: 'sent' | 'received';
58
+ };
59
+ time: Timestamp;
60
+ error?: string;
61
+ errorCode?: string;
62
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Data gets saved in
3
+ * scout9-conversations/{conversationId}/parsed/default
4
+ */
5
+ export type ConversationParsed = {
6
+ [field: string]: any;
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import { Timestamp } from '../common';
2
+ import { IConversation } from './conversation';
3
+ import { ConversationEnvironment } from './message';
4
+ /**
5
+ * scout9-scheduled-conversations/{conversationId}
6
+ * When a conversation is scheduled to be sent at a later time
7
+ */
8
+ export interface IScheduledConversation extends IConversation {
9
+ scheduled: Timestamp;
10
+ initialMessage: string;
11
+ initialMessageHtml?: string;
12
+ sent?: Timestamp;
13
+ /**
14
+ * Attached to a schedule group
15
+ * scout9-scheduled-conversation-groups/{groupId}
16
+ */
17
+ $group?: string;
18
+ }
19
+ /**
20
+ * scout9-scheduled-conversation-groups/{groupId}
21
+ */
22
+ export interface IScheduledGroupConversation extends Omit<IScheduledConversation, '$customer' | 'environment' | '$group'> {
23
+ customers: {
24
+ environment: ConversationEnvironment;
25
+ id: string;
26
+ }[];
27
+ /**
28
+ * How much we should delay between schedules, defaults to 15000 (15 seconds)
29
+ */
30
+ delay?: number;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { IConversationMessage } from './message';
2
+ import { ConversationParsed } from './parsed';
3
+ export type MessageWebhookType = 'conversation.scheduled' | 'conversation.created' | 'conversation.updated' | 'conversation.deleted' | 'conversation.error' | 'conversation.message.created' | 'conversation.message.updated' | 'conversation.message.deleted' | 'conversation.message.error';
4
+ export interface IMessageWebhookResponse {
5
+ type: MessageWebhookType;
6
+ parsed?: ConversationParsed;
7
+ message?: IConversationMessage;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from './users';
2
+ export * from './conversations';
3
+ export * from './common';
@@ -0,0 +1,19 @@
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("./users"), exports);
18
+ __exportStar(require("./conversations"), exports);
19
+ __exportStar(require("./common"), exports);
@@ -0,0 +1,76 @@
1
+ /**
2
+ * scout9-businesses/{businessId}/agents/{agentId}
3
+ *
4
+ * An agents is a person who works for a businesses
5
+ */
6
+ export type EmailServiceType = 'sendgrid' | 'gmail' | 'outlook';
7
+ export interface IAgent {
8
+ img?: string;
9
+ firstName: string;
10
+ lastName: string;
11
+ inactive?: boolean;
12
+ /**
13
+ * Programmable phone number from Twilio
14
+ */
15
+ programmablePhoneNumber?: string;
16
+ programmablePhoneNumberSid?: string;
17
+ /**
18
+ * Email address from Scout9 gmail subdomain
19
+ */
20
+ programmableEmail?: string;
21
+ forwardEmail?: string;
22
+ /**
23
+ * All agents must have a phone number (used to login)
24
+ */
25
+ forwardPhone: string;
26
+ /**
27
+ * Whether or not this agent has been verified by the business.
28
+ */
29
+ /**
30
+ * Title of the agent, defaults to "Agent"
31
+ */
32
+ title: string;
33
+ /**
34
+ * In 1 sentence, what does this agent do for customers.
35
+ */
36
+ context: string;
37
+ /**
38
+ * If provided, this means they are part of these office locations. If not provided and excludedLocations not
39
+ * provided, we assume this agents can support all locations.
40
+ * scout9-businesses/{businessId}/locations/{...includedLocations}
41
+ */
42
+ includedLocations?: string[];
43
+ /**
44
+ * If provided, this will take precedence over includedLocations.
45
+ * scout9-businesses/{businessId}/locations/{...excludedLocations}
46
+ */
47
+ excludedLocations?: string[];
48
+ /**
49
+ * A base64 large string object of the transcript, for example if the agents name is "Jeff", then the decoded transcript would be:
50
+ *
51
+ * Format 1:
52
+ *
53
+ * Jeff: Hey Bill, so you need help with you car?
54
+ *
55
+ * Bill: Yes, I need to get my car fixed
56
+ *
57
+ * Jeff: Ok, what's the problem?
58
+ *
59
+ * Format 2:
60
+ *
61
+ * [Jeff] Hey Bill, so you need help with you car?
62
+ *
63
+ * [Bill] Yes, I need to get my car fixed
64
+ *
65
+ * [Jeff] Ok, what's the problem?
66
+ *
67
+ *
68
+ *
69
+ * The agents name "Jeff" must match exact the agents name in the database, otherwise it won't work.
70
+ */
71
+ transcript?: string;
72
+ /**
73
+ * Firebase storage reference to the audio file if available
74
+ */
75
+ audioRef?: string;
76
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { Timestamp } from '../../../common';
2
+ import { ConversationEnvironment } from '../../../conversations';
3
+ export interface IAgentReAuth {
4
+ time: Timestamp;
5
+ platform: ConversationEnvironment;
6
+ sent?: Timestamp;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './agent';
2
+ export * from './auth';
@@ -0,0 +1,18 @@
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("./agent"), exports);
18
+ __exportStar(require("./auth"), exports);
@@ -0,0 +1,10 @@
1
+ import { Stripe } from '../../common';
2
+ import { ILocation } from '../../common/location';
3
+ /**
4
+ * scout9-businesses/{businessId}/locations/{locationId}
5
+ */
6
+ export interface IBusinessLocation extends ILocation, Stripe.Address {
7
+ name: string;
8
+ areaCodes?: number[] | null;
9
+ twilioAddressSid?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });