@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,64 @@
1
+ import { Timestamp } from '../common';
2
+ import { ConversationParsed } from './parsed';
3
+
4
+ /**
5
+ * Used to put 'system' messages into the conversation
6
+ * scout9-conversations/{conversationId}/context/{contextId}
7
+ */
8
+ export interface IConversationContextField {
9
+ id: string;
10
+ /**
11
+ * Gets added to the message under role 'system'
12
+ */
13
+ time: Timestamp;
14
+ context: string;
15
+ note?: string;
16
+ metadata?: {[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
+ /**
24
+ * If all conditions are met, then it will trigger the following API keys
25
+ * If [info.triggers[i]] exists, then it should not trigger
26
+ */
27
+ triggers?: string[];
28
+
29
+ }
30
+
31
+ /**
32
+ * Used to group context fields together
33
+ */
34
+ export interface IConversationContextGroup {
35
+ conditions: IConversationContextFieldCondition[];
36
+ }
37
+
38
+ /**
39
+ * Based on the data from scout9-conversations/{uid}/conversations/{convoId}/info/default
40
+ * Checks to see if that data meets the given condition in order to release the API call
41
+ */
42
+ export interface IConversationContextFieldCondition {
43
+
44
+ /**
45
+ * What field in the conversation info is being checked
46
+ */
47
+ key: keyof ConversationParsed;
48
+
49
+ /**
50
+ * Operator to evaluate the info[key] against the conditional value
51
+ */
52
+ operator: 'eq' | '==' | 'neq' | '!=' | 'gt' | '>' | 'gte' | '>=' | 'lt' | '<' | 'lte' | '<=' | 'in' | 'nin' | 'exists' | '!!' | 'notExists' | '!' | 'contains' | 'notContains' | 'startsWith' | 'endsWith';
53
+
54
+ /**
55
+ * If provided, it will skip operator check and use the regex to check the value
56
+ */
57
+ regex?: string;
58
+
59
+ /**
60
+ * What is the value being checked
61
+ */
62
+ value: string | number | boolean | null | string[] | number[] | boolean[];
63
+
64
+ }
@@ -0,0 +1,68 @@
1
+ import { Timestamp } from '../common';
2
+ import { EmailServiceType, IThread } from '../users';
3
+ import { ConversationEnvironment } from './message';
4
+
5
+ export interface IConversationEnvironmentProps {
6
+
7
+ subject?: string;
8
+
9
+ /**
10
+ * Used to sync email messages with the conversation
11
+ *
12
+ */
13
+ platformEmailThreadId?: string;
14
+
15
+ }
16
+ /**
17
+ * scout9-conversations/{conversationId}
18
+ *
19
+ * A two way conversation between a customer and a businesses agents
20
+ */
21
+ export interface IConversation extends Pick<IThread, 'onCreated' | 'onDeleted' | 'onUpdated' | 'onError'> {
22
+
23
+ /**
24
+ * Customer this conversation is with
25
+ * scout9-businesses/{$business}/customers/{$customer}
26
+ */
27
+ $customer: string;
28
+
29
+ /**
30
+ * Business this conversation is with
31
+ * scout9-businesses/{$businesses}
32
+ */
33
+ $business: string;
34
+
35
+ /**
36
+ * Agent assigned to this conversation
37
+ * scout9-businesses/{$businesses}/agents/{$agents}
38
+ */
39
+ $agent: string;
40
+
41
+ /**
42
+ * Thread this conversation is in - this determines what context to pull when loading the conversation
43
+ * scout9-businesses/{$businesses}/threads/{$threads}
44
+ */
45
+ $thread: string;
46
+
47
+ /**
48
+ * When the conversation is created, append these contexts to the conversation
49
+ */
50
+ initialContexts?: string[];
51
+
52
+
53
+ initiated: Timestamp;
54
+
55
+ /**
56
+ * What parser functions to run for this conversation, by default will parse core fields
57
+ */
58
+ parse?: string[];
59
+
60
+
61
+ /**
62
+ * What this environment is intended for
63
+ * Defaults to 'web'
64
+ */
65
+ environment?: ConversationEnvironment;
66
+ environmentProps?: IConversationEnvironmentProps;
67
+
68
+ }
@@ -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,78 @@
1
+ import { ChatCompletionRequestMessage, MessageStatus, Timestamp } from '../common';
2
+ import { IConversationContextField } from './context';
3
+ import { ConversationParsed } from './parsed';
4
+
5
+ export type ConversationEnvironment = 'phone' | 'web' | 'email';
6
+
7
+ export interface IConversationMessageEmailProps {
8
+ /**
9
+ * The platform that this message was sent from the assigned agent in the conversation
10
+ * (this is used to help with sync/identification mainly getting the global Message-ID)
11
+ */
12
+ platformMessageId?: string;
13
+
14
+ /**
15
+ * The global message id that this message states in email headers 'Message-ID'
16
+ */
17
+ globalMessageId?: string;
18
+ }
19
+
20
+
21
+ export interface IConversationMessage extends ChatCompletionRequestMessage {
22
+
23
+ time: Timestamp;
24
+
25
+ contentHtml?: string;
26
+
27
+ /**
28
+ * When the message is created we parse the message for relevant fields
29
+ */
30
+ parsed?: ConversationParsed;
31
+ /**
32
+ * Time at which the parsed information was processed
33
+ */
34
+ parsedLoaded?: Timestamp;
35
+
36
+ /**
37
+ * The message we are replying to
38
+ */
39
+ replyTo?: string;
40
+
41
+ emailEnvironmentProps?: IConversationMessageEmailProps;
42
+ smsEnvironmentProps?: {
43
+ twilioMessageId: string;
44
+ }
45
+ /**
46
+ * @TODO the existence of this field being being perceived as an indication that the message
47
+ * was recived by the client, this should be changed and handled properly
48
+ */
49
+ receipt?: IConversationMessageReceipt;
50
+
51
+ /**
52
+ * @TODO remove this in production as it will bloat the database
53
+ */
54
+ context?: IConversationContextField[];
55
+ }
56
+
57
+ export interface IConversationMessageReceipt {
58
+ environment: {
59
+ type: 'phone';
60
+
61
+ /**
62
+ * Twilio message id
63
+ */
64
+ sid: string
65
+ status: MessageStatus;
66
+ } | {
67
+ type: 'web';
68
+ } | {
69
+ type: 'email';
70
+
71
+ status: 'sent' | 'received';
72
+ };
73
+ time: Timestamp;
74
+
75
+ // Errors
76
+ error?: string;
77
+ errorCode?: string;
78
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Data gets saved in
3
+ * scout9-conversations/{conversationId}/parsed/default
4
+ */
5
+ export type ConversationParsed = {[field: string]: any}
@@ -0,0 +1,35 @@
1
+ import { Timestamp } from '../common';
2
+ import { IConversation } from './conversation';
3
+ import { ConversationEnvironment } from './message';
4
+
5
+ /**
6
+ * scout9-scheduled-conversations/{conversationId}
7
+ * When a conversation is scheduled to be sent at a later time
8
+ */
9
+ export interface IScheduledConversation extends IConversation {
10
+ scheduled: Timestamp;
11
+ initialMessage: string;
12
+ initialMessageHtml?: string;
13
+ sent?: Timestamp;
14
+
15
+ /**
16
+ * Attached to a schedule group
17
+ * scout9-scheduled-conversation-groups/{groupId}
18
+ */
19
+ $group?: string;
20
+ }
21
+
22
+ /**
23
+ * scout9-scheduled-conversation-groups/{groupId}
24
+ */
25
+ export interface IScheduledGroupConversation extends Omit<IScheduledConversation, '$customer' | 'environment' | '$group'> {
26
+ customers: {
27
+ environment: ConversationEnvironment;
28
+ id: string;
29
+ }[];
30
+
31
+ /**
32
+ * How much we should delay between schedules, defaults to 15000 (15 seconds)
33
+ */
34
+ delay?: number;
35
+ }
@@ -0,0 +1,10 @@
1
+ import { IConversationMessage } from './message';
2
+ import { ConversationParsed } from './parsed';
3
+
4
+ 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';
5
+
6
+ export interface IMessageWebhookResponse {
7
+ type: MessageWebhookType;
8
+ parsed?: ConversationParsed;
9
+ message?: IConversationMessage;
10
+ }
@@ -0,0 +1,3 @@
1
+ export * from './users';
2
+ export * from './conversations';
3
+ export * from './common';
@@ -0,0 +1,107 @@
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
+
9
+ img?: string;
10
+ firstName: string;
11
+ lastName: string;
12
+
13
+ inactive?: boolean;
14
+
15
+ /**
16
+ * Programmable phone number from Twilio
17
+ */
18
+ programmablePhoneNumber?: string;
19
+ programmablePhoneNumberSid?: string;
20
+
21
+ /**
22
+ * Email address from Scout9 gmail subdomain
23
+ */
24
+ programmableEmail?: string;
25
+ // programmableEmailProps?: {
26
+ // type: EmailServiceType;
27
+ // /**
28
+ // * 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
29
+ // * @TODO - create a O-Auth flow for this, see scripts/gmail/generate-refresh-token for an example
30
+ // */
31
+ // gmailRefreshToken?: string;
32
+ // gmailWatchExpiration?: string;
33
+ // }
34
+
35
+ forwardEmail?: string;
36
+
37
+ /**
38
+ * All agents must have a phone number (used to login)
39
+ */
40
+ forwardPhone: string;
41
+
42
+ /**
43
+ * Whether or not this agent has been verified by the business.
44
+ */
45
+ // verified?: boolean;
46
+
47
+ /**
48
+ * Title of the agent, defaults to "Agent"
49
+ */
50
+ title: string;
51
+
52
+ /**
53
+ * In 1 sentence, what does this agent do for customers.
54
+ */
55
+ context: string;
56
+
57
+ // /**
58
+ // * What business does this agents work for?
59
+ // * scout9-businesses/{$business}
60
+ // */
61
+ // $business: string;
62
+
63
+ /**
64
+ * If provided, this means they are part of these office locations. If not provided and excludedLocations not
65
+ * provided, we assume this agents can support all locations.
66
+ * scout9-businesses/{businessId}/locations/{...includedLocations}
67
+ */
68
+ includedLocations?: string[];
69
+
70
+ /**
71
+ * If provided, this will take precedence over includedLocations.
72
+ * scout9-businesses/{businessId}/locations/{...excludedLocations}
73
+ */
74
+ excludedLocations?: string[];
75
+
76
+
77
+ /**
78
+ * A base64 large string object of the transcript, for example if the agents name is "Jeff", then the decoded transcript would be:
79
+ *
80
+ * Format 1:
81
+ *
82
+ * Jeff: Hey Bill, so you need help with you car?
83
+ *
84
+ * Bill: Yes, I need to get my car fixed
85
+ *
86
+ * Jeff: Ok, what's the problem?
87
+ *
88
+ * Format 2:
89
+ *
90
+ * [Jeff] Hey Bill, so you need help with you car?
91
+ *
92
+ * [Bill] Yes, I need to get my car fixed
93
+ *
94
+ * [Jeff] Ok, what's the problem?
95
+ *
96
+ *
97
+ *
98
+ * The agents name "Jeff" must match exact the agents name in the database, otherwise it won't work.
99
+ */
100
+ transcript?: string;
101
+
102
+ /**
103
+ * Firebase storage reference to the audio file if available
104
+ */
105
+ audioRef?: string;
106
+
107
+ }
@@ -0,0 +1,8 @@
1
+ import { Timestamp } from '../../../common';
2
+ import { ConversationEnvironment } from '../../../conversations';
3
+
4
+ export interface IAgentReAuth {
5
+ time: Timestamp;
6
+ platform: ConversationEnvironment;
7
+ sent?: Timestamp;
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './agent';
2
+ export * from './auth';
@@ -0,0 +1,15 @@
1
+ import { Stripe } from '../../common';
2
+ import { ILocation } from '../../common/location';
3
+
4
+
5
+ /**
6
+ * scout9-businesses/{businessId}/locations/{locationId}
7
+ */
8
+ export interface IBusinessLocation extends ILocation, Stripe.Address {
9
+ name: string;
10
+
11
+ areaCodes?: number[] | null;
12
+
13
+ twilioAddressSid?: string;
14
+
15
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * scout9-businesses/{businessId}
3
+ */
4
+ export interface IBusiness {
5
+ name: string;
6
+
7
+ logo?: string;
8
+ icon?: string;
9
+
10
+ /**
11
+ * User id of the owner of this account
12
+ */
13
+ $owner: string;
14
+ phone: string;
15
+ email: string;
16
+
17
+ /**
18
+ * 1 sentence what does this business do?
19
+ */
20
+ context: string;
21
+
22
+ apiKey?: string;
23
+
24
+ website?: string;
25
+
26
+ webhookUrl?: string;
27
+
28
+
29
+ /**
30
+ * Stripe customer ids for charging subscriptions
31
+ */
32
+ stripeCustomer?: string;
33
+ stripeCustomerDev?: string;
34
+
35
+ /**
36
+ * Stripe connect ids for charging customers on behalf of Scout9
37
+ */
38
+ stripeConnect?: string;
39
+ stripeConnectDev?: string;
40
+
41
+ twilioAddressSid?: string;
42
+
43
+ }
@@ -0,0 +1,11 @@
1
+ import { IAlgoliaIndexedObject } from '../../../common';
2
+ import { IContext } from './context';
3
+
4
+ /**
5
+ * scout9-businesses/{businessId}/context-indexed/{context}
6
+ * An auto generated context, when a context category is created it will be indexed in a collection, resolving all stripe and
7
+ * algolia references.
8
+ */
9
+ export interface IContextIndexed extends IContext, IAlgoliaIndexedObject {
10
+
11
+ }
@@ -0,0 +1,14 @@
1
+ import { Timestamp } from '../../../common';
2
+
3
+ /**
4
+ * When a context field receives uploaded bulk data (csv/excel/json)
5
+ * scout9-businesses/{businessId}/context/{context}/saves/{save_time}
6
+ */
7
+ export interface IContextSaves {
8
+
9
+ /**
10
+ * Where the file was saved
11
+ */
12
+ ref: string;
13
+ time: Timestamp
14
+ }
@@ -0,0 +1,76 @@
1
+ import { ThreadLanguage } from '../thread';
2
+
3
+ /**
4
+ * Used to build NLP models to detect context invocation
5
+ */
6
+ export interface IContextDetectionParams {
7
+
8
+ /**
9
+ * Key word entities to detect in a contacts message
10
+ */
11
+ entities: {
12
+ /**
13
+ * @deprecated
14
+ */
15
+ utteranceId?: string;
16
+ option: string;
17
+ languages: ThreadLanguage[];
18
+ text: string[];
19
+ }[];
20
+
21
+ /**
22
+ * Documents or phrases to train the model
23
+ */
24
+ documents: {
25
+ language: ThreadLanguage;
26
+ text: string;
27
+ id: string;
28
+ }[];
29
+ }
30
+
31
+ /**
32
+ * scout9-businesses/{businessId}/context/{$id}
33
+ *
34
+ * Context field to be used for conversation context and workflows
35
+ */
36
+ export interface IContext {
37
+
38
+ /**
39
+ * Context $id - this is used to store the context data under the given collection
40
+ * scout9-businesses/{businessId}/{$id}/{row}
41
+ */
42
+ $id: string;
43
+
44
+ /**
45
+ * Name of the context
46
+ */
47
+ name: string;
48
+
49
+ modifiable: boolean;
50
+
51
+ /**
52
+ * Description of the context
53
+ */
54
+ description?: string;
55
+
56
+ /**
57
+ * If provided, this can be used to detect if a given message is invoking this context
58
+ */
59
+ detection?: IContextDetectionParams;
60
+
61
+ /**
62
+ * The column that represents the id of a given context row
63
+ */
64
+ idColumn: string;
65
+
66
+ /**
67
+ * Column fields that could exist in the context
68
+ */
69
+ columns: string[];
70
+
71
+ /**
72
+ * If provided this will enforce that the given columns are required
73
+ * NOTE: idColumn by default is required
74
+ */
75
+ requiredColumns?: string[];
76
+ }
@@ -0,0 +1,2 @@
1
+ export * from './context';
2
+ export * from './context-indexed';
@@ -0,0 +1,6 @@
1
+ export * from './business';
2
+ export * from './business-location';
3
+ export * from './agents';
4
+ export * from './thread';
5
+ export * from './notifications';
6
+
@@ -0,0 +1,12 @@
1
+ import { Timestamp } from '../../common';
2
+
3
+ export interface INotification {
4
+
5
+ time: Timestamp;
6
+ read?: Timestamp;
7
+
8
+ content: string;
9
+
10
+ href: string;
11
+
12
+ }
@@ -0,0 +1,2 @@
1
+ export * from './offer';
2
+ export * from './offer-indexed';
@@ -0,0 +1,42 @@
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
+ /**
9
+ * @deprecated - use Context
10
+ */
11
+ export interface IOfferIndexed extends IOffer {
12
+
13
+ /**
14
+ * scout9-businesses/{businessId}/offers/{parent}
15
+ */
16
+ parent: string;
17
+
18
+ /**
19
+ * Algolia objectID
20
+ */
21
+ objectID: string;
22
+
23
+
24
+ /**
25
+ * Stripe product ID
26
+ */
27
+ stripe?: string;
28
+
29
+ /**
30
+ * Stripe product ID for dev
31
+ */
32
+ stripeDev?: string;
33
+
34
+ /**
35
+ * Algolia geolocation for the offer, offer is limited to this location at some distance
36
+ */
37
+ _geoloc?: {
38
+ lat: number;
39
+ lng: number;
40
+ }
41
+
42
+ }
@@ -0,0 +1,39 @@
1
+ import { Currency } from '../../../common/currency';
2
+
3
+ /**
4
+ * scout9-businesses/{businessId}/offers/{offerId}
5
+ *
6
+ * What do you offer to your customers? How can your agents help them?
7
+ * @deprecated - use Context
8
+ */
9
+ export interface IOffer {
10
+ name: string;
11
+ description: string;
12
+
13
+ /**
14
+ * Tags for the offer to be captured by the AI
15
+ */
16
+ tags: string[];
17
+
18
+ /**
19
+ * The price of the offer is either a fixed price or an estimated price range
20
+ */
21
+ price: number | [number, number];
22
+ currency: Currency;
23
+
24
+ /**
25
+ * Media urls for the offer
26
+ */
27
+ media?: string[];
28
+
29
+ /**
30
+ * scout9-businesses/{businessId}/locations/{locationId}
31
+ * If provided, the offer is only limited to these locations.
32
+ */
33
+ locations?: string[];
34
+
35
+
36
+ // Stripe IDs for processing payments
37
+ // stripe?: string;
38
+ // stripeDev?: string;
39
+ }