@bigfootai/bigfoot-types 4.6.18 → 4.7.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.
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Opportunity = void 0;
4
+ const model_1 = require("../../model");
5
+ exports.Opportunity = {
6
+ _id: '',
7
+ dateCreated: 0,
8
+ dateUpdated: 0,
9
+ label: 'Opportunity',
10
+ description: 'Represents an opportunity, which is a sale or pending deal.',
11
+ recordType: 'opportunity',
12
+ references: [
13
+ 'https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm',
14
+ ],
15
+ fields: [
16
+ {
17
+ label: 'Name',
18
+ name: 'Name',
19
+ description: 'A name for this opportunity.',
20
+ fieldType: model_1.FieldType.Text,
21
+ maximumCharacters: 120,
22
+ readOnly: false,
23
+ important: true,
24
+ status: false,
25
+ },
26
+ {
27
+ label: 'Account',
28
+ name: 'Account.Name',
29
+ description: 'Name of the account associated with this opportunity.',
30
+ fieldType: model_1.FieldType.Text,
31
+ readOnly: false,
32
+ important: true,
33
+ status: false,
34
+ },
35
+ {
36
+ label: 'Amount',
37
+ name: 'Amount',
38
+ description: 'Estimated total sale amount.',
39
+ fieldType: model_1.FieldType.Text,
40
+ fieldVariation: model_1.FieldVariation.Currency,
41
+ readOnly: false,
42
+ important: true,
43
+ status: false,
44
+ },
45
+ {
46
+ label: 'Close Date',
47
+ name: 'CloseDate',
48
+ description: 'Date when the opportunity is expected to close.',
49
+ fieldType: model_1.FieldType.Text,
50
+ fieldVariation: model_1.FieldVariation.Date,
51
+ readOnly: false,
52
+ important: true,
53
+ status: false,
54
+ },
55
+ {
56
+ label: 'Stage',
57
+ name: 'StageName',
58
+ description: 'Current stage of this opportunity.',
59
+ fieldType: model_1.FieldType.Select,
60
+ readOnly: false,
61
+ options: [
62
+ {
63
+ label: 'Prospecting',
64
+ value: 'Prospecting',
65
+ status: model_1.TaskStatus.NotStarted,
66
+ },
67
+ {
68
+ label: 'Qualification',
69
+ value: 'Qualification',
70
+ status: model_1.TaskStatus.InProgress,
71
+ },
72
+ {
73
+ label: 'Needs Analysis',
74
+ value: 'Needs Analysis',
75
+ status: model_1.TaskStatus.InProgress,
76
+ },
77
+ {
78
+ label: 'Value Proposition',
79
+ value: 'Value Proposition',
80
+ status: model_1.TaskStatus.InProgress,
81
+ },
82
+ {
83
+ label: 'Id. Decision Makers',
84
+ value: 'Id. Decision Makers',
85
+ status: model_1.TaskStatus.InProgress,
86
+ },
87
+ {
88
+ label: 'Perception Analysis',
89
+ value: 'Perception Analysis',
90
+ status: model_1.TaskStatus.InProgress,
91
+ },
92
+ {
93
+ label: 'Proposal/Price Quote',
94
+ value: 'Proposal/Price Quote',
95
+ status: model_1.TaskStatus.InProgress,
96
+ },
97
+ {
98
+ label: 'Negotiation/Review',
99
+ value: 'Negotiation/Review',
100
+ status: model_1.TaskStatus.InProgress,
101
+ },
102
+ {
103
+ label: 'Closed Won',
104
+ value: 'Closed Won',
105
+ status: model_1.TaskStatus.Completed,
106
+ },
107
+ {
108
+ label: 'Closed Lost',
109
+ value: 'Closed Lost',
110
+ status: model_1.TaskStatus.Completed,
111
+ },
112
+ ],
113
+ important: true,
114
+ status: true,
115
+ },
116
+ {
117
+ label: 'Owner',
118
+ name: 'Owner.Name',
119
+ description: 'Name of the User who has been assigned to work on this opportunity.',
120
+ fieldType: model_1.FieldType.Text,
121
+ readOnly: false,
122
+ important: true,
123
+ status: false,
124
+ },
125
+ {
126
+ label: 'Next Step',
127
+ name: 'NextStep',
128
+ description: 'A short description of next task in closing opportunity.',
129
+ fieldType: model_1.FieldType.Text,
130
+ maximumCharacters: 250,
131
+ readOnly: false,
132
+ important: true,
133
+ status: false,
134
+ },
135
+ {
136
+ label: 'Description',
137
+ name: 'Description',
138
+ description: 'Text description of the opportunity.',
139
+ fieldType: model_1.FieldType.Text,
140
+ fieldVariation: model_1.FieldVariation.Multi,
141
+ maximumCharacters: 32000,
142
+ readOnly: false,
143
+ important: false,
144
+ status: false,
145
+ },
146
+ ],
147
+ classifiers: [
148
+ 'interested in purchasing',
149
+ 'new opportunity',
150
+ 'interested in moving forward',
151
+ 'followup with sales',
152
+ ],
153
+ };
@@ -0,0 +1,159 @@
1
+ import {
2
+ FieldType,
3
+ FieldVariation,
4
+ TableMetadata,
5
+ TaskStatus,
6
+ } from '../../model';
7
+
8
+ export const Opportunity: TableMetadata = {
9
+ _id: '',
10
+ dateCreated: 0,
11
+ dateUpdated: 0,
12
+ label: 'Opportunity',
13
+ description: 'Represents an opportunity, which is a sale or pending deal.',
14
+ recordType: 'opportunity',
15
+ references: [
16
+ 'https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm',
17
+ ],
18
+ fields: [
19
+ {
20
+ label: 'Name',
21
+ name: 'Name',
22
+ description: 'A name for this opportunity.',
23
+ fieldType: FieldType.Text,
24
+ maximumCharacters: 120,
25
+ readOnly: false,
26
+ important: true,
27
+ status: false,
28
+ },
29
+ {
30
+ label: 'Account',
31
+ name: 'Account.Name',
32
+ description:
33
+ 'Name of the account associated with this opportunity.',
34
+ fieldType: FieldType.Text,
35
+ readOnly: false,
36
+ important: true,
37
+ status: false,
38
+ },
39
+ {
40
+ label: 'Amount',
41
+ name: 'Amount',
42
+ description: 'Estimated total sale amount.',
43
+ fieldType: FieldType.Text,
44
+ fieldVariation: FieldVariation.Currency,
45
+ readOnly: false,
46
+ important: true,
47
+ status: false,
48
+ },
49
+ {
50
+ label: 'Close Date',
51
+ name: 'CloseDate',
52
+ description: 'Date when the opportunity is expected to close.',
53
+ fieldType: FieldType.Text,
54
+ fieldVariation: FieldVariation.Date,
55
+ readOnly: false,
56
+ important: true,
57
+ status: false,
58
+ },
59
+ {
60
+ label: 'Stage',
61
+ name: 'StageName',
62
+ description: 'Current stage of this opportunity.',
63
+ fieldType: FieldType.Select,
64
+ readOnly: false,
65
+ options: [
66
+ {
67
+ label: 'Prospecting',
68
+ value: 'Prospecting',
69
+ status: TaskStatus.NotStarted,
70
+ },
71
+ {
72
+ label: 'Qualification',
73
+ value: 'Qualification',
74
+ status: TaskStatus.InProgress,
75
+ },
76
+ {
77
+ label: 'Needs Analysis',
78
+ value: 'Needs Analysis',
79
+ status: TaskStatus.InProgress,
80
+ },
81
+ {
82
+ label: 'Value Proposition',
83
+ value: 'Value Proposition',
84
+ status: TaskStatus.InProgress,
85
+ },
86
+ {
87
+ label: 'Id. Decision Makers',
88
+ value: 'Id. Decision Makers',
89
+ status: TaskStatus.InProgress,
90
+ },
91
+ {
92
+ label: 'Perception Analysis',
93
+ value: 'Perception Analysis',
94
+ status: TaskStatus.InProgress,
95
+ },
96
+ {
97
+ label: 'Proposal/Price Quote',
98
+ value: 'Proposal/Price Quote',
99
+ status: TaskStatus.InProgress,
100
+ },
101
+ {
102
+ label: 'Negotiation/Review',
103
+ value: 'Negotiation/Review',
104
+ status: TaskStatus.InProgress,
105
+ },
106
+ {
107
+ label: 'Closed Won',
108
+ value: 'Closed Won',
109
+ status: TaskStatus.Completed,
110
+ },
111
+ {
112
+ label: 'Closed Lost',
113
+ value: 'Closed Lost',
114
+ status: TaskStatus.Completed,
115
+ },
116
+ ],
117
+ important: true,
118
+ status: true,
119
+ },
120
+ {
121
+ label: 'Owner',
122
+ name: 'Owner.Name',
123
+ description:
124
+ 'Name of the User who has been assigned to work on this opportunity.',
125
+ fieldType: FieldType.Text,
126
+ readOnly: false,
127
+ important: true,
128
+ status: false,
129
+ },
130
+ {
131
+ label: 'Next Step',
132
+ name: 'NextStep',
133
+ description:
134
+ 'A short description of next task in closing opportunity.',
135
+ fieldType: FieldType.Text,
136
+ maximumCharacters: 250,
137
+ readOnly: false,
138
+ important: true,
139
+ status: false,
140
+ },
141
+ {
142
+ label: 'Description',
143
+ name: 'Description',
144
+ description: 'Text description of the opportunity.',
145
+ fieldType: FieldType.Text,
146
+ fieldVariation: FieldVariation.Multi,
147
+ maximumCharacters: 32000,
148
+ readOnly: false,
149
+ important: false,
150
+ status: false,
151
+ },
152
+ ],
153
+ classifiers: [
154
+ 'interested in purchasing',
155
+ 'new opportunity',
156
+ 'interested in moving forward',
157
+ 'followup with sales',
158
+ ],
159
+ };
package/model.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReferenceBlockQL = exports.ReferenceBlockInputQL = exports.ConnectedProviderQL = exports.CredentialQL = exports.StandardObjectsQL = exports.ProviderResponseQL = exports.ProviderRequestQL = exports.ProviderInfoQL = exports.DateEntityEntryQL = exports.EntityEntryQL = exports.EntityEntryFields = exports.RelationEntryQL = exports.ArgumentEntryQL = exports.EntityReferenceQL = exports.DocumentSentimentQL = exports.TaskStepQL = exports.TaskStepInputQL = exports.ReactionQL = exports.ReactionSkinToneQL = exports.BusinessObjectLinkQL = exports.BusinessObjectLinkInputQL = exports.SharingTenantQL = exports.SharingDomainQL = exports.SharingTagQL = exports.SharingTagInputQL = exports.InviteSharingTagInputQL = exports.EditorQL = exports.EditorInputQL = exports.HighlightQL = exports.RelationType = exports.EntityType = exports.RecordType = exports.ProcessingStage = exports.MutationType = exports.MarkType = exports.DocumentType = exports.RecurrenceRFC = exports.TagRecommendationVariation = exports.TagRecommendationType = exports.InviteStatus = exports.OrderByDirection = exports.SharingApproach = exports.StepStatus = exports.TaskStatus = exports.TaskPriority = exports.SharingLevel = exports.ClientType = exports.TagType = exports.NotificationType = exports.BlockType = void 0;
4
- exports.TranscriptionEntryQL = exports.Task = exports.TaskQL = exports.TaskFields = exports.Note = exports.NoteQL = exports.BusinessObject = exports.BusinessObjectQL = exports.BusinessObjectFields = exports.BusinessObjectIngestionRequest = exports.IngestionNotification = exports.Notification = exports.History = exports.BlockProcessingResponse = exports.BlockProcessingRequest = exports.Block = exports.BlockFields = exports.Article = exports.ArticleQL = exports.Person = exports.Organization = exports.Domain = exports.DomainQL = exports.Tenant = exports.TenantQL = exports.ProviderRecommendationQL = exports.TagRecommendationQL = exports.Tag = exports.TagQL = exports.TagFieldsJustSharing = exports.TagFieldsWithoutSharing = exports.Provider = exports.ProviderQL = exports.ProviderApplicationQL = exports.Sync = exports.SyncQL = exports.Search = exports.SearchQL = exports.Folder = exports.FolderQL = exports.Metadata = exports.MetadataFields = exports.SharedPrimitive = exports.SharedPrimitiveFields = exports.Primitive = exports.PrimitiveFields = exports.PersonReferenceQL = exports.PersonReferenceFields = exports.ChangesQL = exports.ChangesInputQL = void 0;
5
- exports.FindTagInputQL = exports.UpsertTagInputQL = exports.SharingTenantInputQL = exports.SharingDomainInputQL = exports.FindSyncInputQL = exports.FindProviderInputQL = exports.ArchiveNoteOutputQL = exports.ArchiveNoteInputQL = exports.FindNotesInputQL = exports.FindNoteInputQL = exports.UpsertNoteInputQL = exports.FindEventInputQL = exports.FindCalendarInputQL = exports.FindArticlesInputQL = exports.FindArticleInputQL = exports.FindDomainInputQL = exports.FindTenantInputQL = exports.Table = exports.TableQL = exports.Record = exports.RecordQL = exports.TableMetadata = exports.TableMetadataQL = exports.FieldValueQL = exports.FieldQL = exports.OptionQL = exports.FieldVariation = exports.FieldType = exports.Template = exports.TemplateQL = exports.DocumentMetadata = exports.DocumentMetadataQL = exports.BlockDescriptionQL = exports.Website = exports.WebsiteQL = exports.Document = exports.DocumentQL = exports.Thread = exports.Todo = exports.Calendar = exports.CalendarQL = exports.Event = exports.EventQL = exports.PersonAcceptanceQL = exports.ResponseStatus = exports.EventStatus = exports.Conference = exports.ConferenceQL = exports.ConferenceEntrypointQL = exports.TranscriptionQL = void 0;
6
- exports.GraphQLTypes = exports.SearchInputQL = exports.SearchTagsInputQL = exports.ArchiveSearchOutputQL = exports.ArchiveSearchInputQL = exports.FindSearchesInputQL = exports.FindSearchInputQL = exports.UpsertSearchInputQL = exports.ArchiveFolderOutputQL = exports.ArchiveFolderInputQL = exports.FindFoldersInputQL = exports.FindFolderInputQL = exports.UpsertFolderInputQL = exports.ArchiveTaskOutputQL = exports.ArchiveTaskInputQL = exports.FindTasksInputQL = exports.FindTaskInputQL = exports.UpdateTaskInputQL = exports.DeleteSharingTagInputQL = exports.SetSharingTagInputQL = exports.MergeTagInputQL = exports.ArchiveTagOutputQL = exports.ArchiveTagInputQL = exports.FindTagsInputQL = void 0;
3
+ exports.ReferenceBlockInputQL = exports.ConnectedProviderQL = exports.CredentialQL = exports.StandardObjectsQL = exports.ProviderResponseQL = exports.ProviderRequestQL = exports.ProviderInfoQL = exports.DateEntityEntryQL = exports.EntityEntryQL = exports.EntityEntryFields = exports.RelationEntryQL = exports.ArgumentEntryQL = exports.EntityReferenceQL = exports.DocumentSentimentQL = exports.TaskStepQL = exports.TaskStepInputQL = exports.ReactionQL = exports.ReactionSkinToneQL = exports.BusinessObjectLinkQL = exports.BusinessObjectLinkInputQL = exports.SharingTenantQL = exports.SharingDomainQL = exports.SharingTagQL = exports.SharingTagInputQL = exports.InviteSharingTagInputQL = exports.EditorQL = exports.EditorInputQL = exports.HighlightQL = exports.RelationType = exports.EntityType = exports.RecordType = exports.ProcessingStage = exports.MutationType = exports.MarkType = exports.DocumentType = exports.RecurrenceRFC = exports.TagRecommendationVariation = exports.TagRecommendationType = exports.InviteStatus = exports.OrderByDirection = exports.SharingApproach = exports.StepStatus = exports.TaskStatus = exports.TaskPriority = exports.SharingLevel = exports.ClientType = exports.TagType = exports.UpsertType = exports.RecommendationType = exports.BlockType = void 0;
4
+ exports.Task = exports.TaskQL = exports.TaskFields = exports.Note = exports.NoteQL = exports.BusinessObject = exports.BusinessObjectQL = exports.BusinessObjectFields = exports.BusinessObjectIngestionRequest = exports.History = exports.BlockProcessingResponse = exports.BlockProcessingRequest = exports.Block = exports.BlockFields = exports.Article = exports.ArticleQL = exports.Person = exports.Organization = exports.Domain = exports.DomainQL = exports.Tenant = exports.TenantQL = exports.Recommendation = exports.UpsertRecommendationQL = exports.ConnectRecommendationQL = exports.TagRecommendationQL = exports.Tag = exports.TagQL = exports.TagFieldsJustSharing = exports.TagFieldsWithoutSharing = exports.Provider = exports.ProviderQL = exports.ProviderApplicationQL = exports.Sync = exports.SyncQL = exports.Search = exports.SearchQL = exports.Folder = exports.FolderQL = exports.Metadata = exports.MetadataFields = exports.SharedPrimitive = exports.SharedPrimitiveFields = exports.Primitive = exports.PrimitiveFields = exports.PersonReferenceQL = exports.PersonReferenceFields = exports.ChangesQL = exports.ChangesInputQL = exports.ReferenceBlockQL = void 0;
5
+ exports.UpsertTagInputQL = exports.SharingTenantInputQL = exports.SharingDomainInputQL = exports.FindSyncInputQL = exports.FindProviderInputQL = exports.ArchiveNoteOutputQL = exports.ArchiveNoteInputQL = exports.FindNotesInputQL = exports.FindNoteInputQL = exports.UpsertNoteInputQL = exports.FindEventInputQL = exports.FindCalendarInputQL = exports.FindArticlesInputQL = exports.FindArticleInputQL = exports.FindDomainInputQL = exports.FindTenantInputQL = exports.Table = exports.TableQL = exports.Record = exports.RecordQL = exports.TableMetadata = exports.TableMetadataQL = exports.FieldValueQL = exports.FieldQL = exports.OptionQL = exports.FieldVariation = exports.FieldType = exports.Template = exports.TemplateQL = exports.DocumentMetadata = exports.DocumentMetadataQL = exports.BlockDescriptionQL = exports.Website = exports.WebsiteQL = exports.Document = exports.DocumentQL = exports.Thread = exports.Todo = exports.Calendar = exports.CalendarQL = exports.Event = exports.EventQL = exports.PersonAcceptanceQL = exports.ResponseStatus = exports.EventStatus = exports.Conference = exports.ConferenceQL = exports.ConferenceEntrypointQL = exports.TranscriptionQL = exports.TranscriptionEntryQL = void 0;
6
+ exports.GraphQLTypes = exports.SearchInputQL = exports.SearchTagsInputQL = exports.ArchiveSearchOutputQL = exports.ArchiveSearchInputQL = exports.FindSearchesInputQL = exports.FindSearchInputQL = exports.UpsertSearchInputQL = exports.ArchiveFolderOutputQL = exports.ArchiveFolderInputQL = exports.FindFoldersInputQL = exports.FindFolderInputQL = exports.UpsertFolderInputQL = exports.ArchiveTaskOutputQL = exports.ArchiveTaskInputQL = exports.FindTasksInputQL = exports.FindTaskInputQL = exports.UpdateTaskInputQL = exports.DeleteSharingTagInputQL = exports.SetSharingTagInputQL = exports.MergeTagInputQL = exports.ArchiveTagOutputQL = exports.ArchiveTagInputQL = exports.FindTagsInputQL = exports.FindTagInputQL = void 0;
7
7
  const uuid_1 = require("uuid");
8
8
  /*
9
9
  These are the core primitives of our model. These represent the entities that show
@@ -27,13 +27,16 @@ var BlockType;
27
27
  BlockType["Template"] = "template";
28
28
  BlockType["Table"] = "table";
29
29
  })(BlockType || (exports.BlockType = BlockType = {}));
30
- var NotificationType;
31
- (function (NotificationType) {
32
- NotificationType["Ingestion"] = "ingestion";
33
- NotificationType["Sync"] = "sync";
34
- NotificationType["Shared"] = "shared";
35
- NotificationType["Record"] = "record";
36
- })(NotificationType || (exports.NotificationType = NotificationType = {}));
30
+ var RecommendationType;
31
+ (function (RecommendationType) {
32
+ RecommendationType["Connect"] = "connect";
33
+ RecommendationType["Upsert"] = "upsert";
34
+ })(RecommendationType || (exports.RecommendationType = RecommendationType = {}));
35
+ var UpsertType;
36
+ (function (UpsertType) {
37
+ UpsertType["Insert"] = "insert";
38
+ UpsertType["Update"] = "update";
39
+ })(UpsertType || (exports.UpsertType = UpsertType = {}));
37
40
  var TagType;
38
41
  (function (TagType) {
39
42
  TagType["Person"] = "person";
@@ -611,14 +614,45 @@ type TagRecommendation {
611
614
  entity: EntityEntry!
612
615
  variation: String
613
616
  }`;
614
- exports.ProviderRecommendationQL = `
615
- type ProviderRecommendation {
616
- tagRecommendationIds: [String]
617
+ // We make recommendations/notifications for a variety of reasons
618
+ // - Recommend integrating calendar based on dates in the note
619
+ // - Recommend integrating salesforce based on links in the note
620
+ // - Recommend creating an issue based on intelligence from the note
621
+ // - Recommend creating a healthcheck based on intelligence from the note
622
+ // - Recommend reading a note or task that has just been shared
623
+ // All of these should be available in the note context, but also continue
624
+ // to be available outside of the note context - and for certain things (like recommending an integration)
625
+ // should not repeat - equally - should be ignored if we say we don't want to do it and ideally not re-appear
626
+ // if the user x's it out. In addition, some recommendation/notifications are scoped to the user while others
627
+ // are global to anyone who can see it any should only be done once
628
+ exports.ConnectRecommendationQL = `
629
+ type ConnectRecommendation {
630
+ tagType: String
617
631
  linkUrl: String
618
632
  provider: Provider!
619
633
  providerResponse: ProviderResponse
620
634
  providerInfo: ProviderInfo!
621
635
  }`;
636
+ exports.UpsertRecommendationQL = `
637
+ type UpsertRecommendation {
638
+ table: Table!
639
+ record: Record!
640
+ upsertType: String!
641
+ connectRecommendations: [ConnectRecommendation]
642
+ }`;
643
+ class Recommendation extends SharedPrimitive {
644
+ constructor(sharingTags, referenceBlock, tenantIdCreated, recommendationType) {
645
+ // For the sharing tags, we do it a little differently depending on the global nature of the recommendation. If theirs
646
+ // a recommendation for each tenant, the sharing tags should just include the tenant. Otherwise the sharing tags should
647
+ // copy that of the block at time of recommendation
648
+ super(sharingTags);
649
+ // These are applicable for all recommendations
650
+ this.referenceBlock = referenceBlock;
651
+ this.tenantIdCreated = tenantIdCreated;
652
+ this.recommendationType = recommendationType;
653
+ }
654
+ }
655
+ exports.Recommendation = Recommendation;
622
656
  exports.TenantQL = `
623
657
  type Tenant {${exports.PrimitiveFields}
624
658
  domainMemberships: [String]!
@@ -675,7 +709,7 @@ type Article {${exports.PrimitiveFields}
675
709
  businessObjects: [BusinessObjectLink]
676
710
  sharingTags: [SharingTag]
677
711
  tagRecommendations: [TagRecommendation]
678
- providerRecommendations: [ProviderRecommendation]
712
+ connectRecommendations: [ConnectRecommendation]
679
713
  relations: [RelationEntry]
680
714
  archived: Boolean!
681
715
  favorite: Boolean!
@@ -744,20 +778,6 @@ class History extends Primitive {
744
778
  }
745
779
  }
746
780
  exports.History = History;
747
- class Notification extends SharedPrimitive {
748
- constructor(tenantIdCreated, sharingTags, notificationType) {
749
- super(sharingTags);
750
- this.notificationType = notificationType;
751
- this.tenantIdCreated = tenantIdCreated;
752
- }
753
- }
754
- exports.Notification = Notification;
755
- class IngestionNotification extends Notification {
756
- constructor(tenantIdCreated, sharingTags) {
757
- super(tenantIdCreated, sharingTags, NotificationType.Ingestion);
758
- }
759
- }
760
- exports.IngestionNotification = IngestionNotification;
761
781
  class BusinessObjectIngestionRequest extends Primitive {
762
782
  constructor(tenantIdCreated, originReferenceBlock, uri) {
763
783
  super();
@@ -1415,7 +1435,7 @@ ${exports.ProviderApplicationQL}
1415
1435
  ${exports.ProviderQL}
1416
1436
  ${exports.TagQL}
1417
1437
  ${exports.TagRecommendationQL}
1418
- ${exports.ProviderRecommendationQL}
1438
+ ${exports.ConnectRecommendationQL}
1419
1439
  ${exports.ConnectedProviderQL}
1420
1440
  ${exports.ReferenceBlockInputQL}
1421
1441
  ${exports.ReferenceBlockQL}
package/model.ts CHANGED
@@ -22,11 +22,14 @@ export enum BlockType {
22
22
  Table = 'table',
23
23
  }
24
24
 
25
- export enum NotificationType {
26
- Ingestion = 'ingestion',
27
- Sync = 'sync',
28
- Shared = 'shared',
29
- Record = 'record',
25
+ export enum RecommendationType {
26
+ Connect = 'connect',
27
+ Upsert = 'upsert',
28
+ }
29
+
30
+ export enum UpsertType {
31
+ Insert = 'insert',
32
+ Update = 'update',
30
33
  }
31
34
 
32
35
  export enum TagType {
@@ -927,22 +930,72 @@ export interface TagRecommendation {
927
930
  variation?: TagRecommendationVariation;
928
931
  }
929
932
 
930
- export const ProviderRecommendationQL = `
931
- type ProviderRecommendation {
932
- tagRecommendationIds: [String]
933
+ // We make recommendations/notifications for a variety of reasons
934
+ // - Recommend integrating calendar based on dates in the note
935
+ // - Recommend integrating salesforce based on links in the note
936
+ // - Recommend creating an issue based on intelligence from the note
937
+ // - Recommend creating a healthcheck based on intelligence from the note
938
+ // - Recommend reading a note or task that has just been shared
939
+ // All of these should be available in the note context, but also continue
940
+ // to be available outside of the note context - and for certain things (like recommending an integration)
941
+ // should not repeat - equally - should be ignored if we say we don't want to do it and ideally not re-appear
942
+ // if the user x's it out. In addition, some recommendation/notifications are scoped to the user while others
943
+ // are global to anyone who can see it any should only be done once
944
+ export const ConnectRecommendationQL = `
945
+ type ConnectRecommendation {
946
+ tagType: String
933
947
  linkUrl: String
934
948
  provider: Provider!
935
949
  providerResponse: ProviderResponse
936
950
  providerInfo: ProviderInfo!
937
951
  }`;
938
- export interface ProviderRecommendation {
939
- tagRecommendationIds?: string[];
940
- linkUrl?: string;
952
+ export interface ConnectRecommendation {
953
+ tagType?: string; // The type of tag that triggered the connection recommendation
954
+ linkUrl?: string; // The link that triggered the recommendation
941
955
  provider: Provider;
942
956
  providerResponse?: ProviderResponse;
943
957
  providerInfo: ProviderInfo;
944
958
  }
945
959
 
960
+ export const UpsertRecommendationQL = `
961
+ type UpsertRecommendation {
962
+ table: Table!
963
+ record: Record!
964
+ upsertType: String!
965
+ connectRecommendations: [ConnectRecommendation]
966
+ }`;
967
+ export interface UpsertRecommendation {
968
+ table: Table;
969
+ record: Record;
970
+ upsertType: UpsertType;
971
+ connectRecommendations: ConnectRecommendation[]; // Lists out any recommended providers that could be used to perform the data update
972
+ }
973
+
974
+ export class Recommendation extends SharedPrimitive {
975
+ referenceBlock: ReferenceBlock; // This is the block that caused the recommendation to happen
976
+ tenantIdCreated: string;
977
+ recommendationType: RecommendationType;
978
+ connectRecommendation?: ConnectRecommendation; // For provider recommendations, we use this field
979
+ upsertRecommendation?: UpsertRecommendation; // For data upsert recommendations, we use this field
980
+
981
+ constructor(
982
+ sharingTags: SharingTag[],
983
+ referenceBlock: ReferenceBlock,
984
+ tenantIdCreated: string,
985
+ recommendationType: RecommendationType
986
+ ) {
987
+ // For the sharing tags, we do it a little differently depending on the global nature of the recommendation. If theirs
988
+ // a recommendation for each tenant, the sharing tags should just include the tenant. Otherwise the sharing tags should
989
+ // copy that of the block at time of recommendation
990
+ super(sharingTags);
991
+
992
+ // These are applicable for all recommendations
993
+ this.referenceBlock = referenceBlock;
994
+ this.tenantIdCreated = tenantIdCreated;
995
+ this.recommendationType = recommendationType;
996
+ }
997
+ }
998
+
946
999
  export const TenantQL = `
947
1000
  type Tenant {${PrimitiveFields}
948
1001
  domainMemberships: [String]!
@@ -1021,7 +1074,7 @@ type Article {${PrimitiveFields}
1021
1074
  businessObjects: [BusinessObjectLink]
1022
1075
  sharingTags: [SharingTag]
1023
1076
  tagRecommendations: [TagRecommendation]
1024
- providerRecommendations: [ProviderRecommendation]
1077
+ connectRecommendations: [ConnectRecommendation]
1025
1078
  relations: [RelationEntry]
1026
1079
  archived: Boolean!
1027
1080
  favorite: Boolean!
@@ -1045,11 +1098,11 @@ export class Article extends Primitive {
1045
1098
  businessObjects?: BusinessObjectLink[];
1046
1099
  sharingTags?: SharingTag[];
1047
1100
  tagRecommendations?: TagRecommendation[];
1048
- providerRecommendations?: ProviderRecommendation[];
1101
+ connectRecommendations?: ConnectRecommendation[];
1049
1102
  relations?: RelationEntry[];
1050
1103
  archived: boolean;
1051
1104
  favorite: boolean;
1052
- snoozed?: boolean;
1105
+ snoozed: boolean;
1053
1106
  status?: TaskStatus;
1054
1107
  originNoteId?: string;
1055
1108
  editorId?: string;
@@ -1169,30 +1222,6 @@ export class History extends Primitive {
1169
1222
  }
1170
1223
  }
1171
1224
 
1172
- export class Notification extends SharedPrimitive {
1173
- notificationType: NotificationType;
1174
- referenceBlock?: ReferenceBlock;
1175
-
1176
- constructor(
1177
- tenantIdCreated: string,
1178
- sharingTags: SharingTag[],
1179
- notificationType: NotificationType
1180
- ) {
1181
- super(sharingTags);
1182
-
1183
- this.notificationType = notificationType;
1184
- this.tenantIdCreated = tenantIdCreated;
1185
- }
1186
- }
1187
-
1188
- export class IngestionNotification extends Notification {
1189
- connectedProvider?: ConnectedProvider;
1190
-
1191
- constructor(tenantIdCreated: string, sharingTags: SharingTag[]) {
1192
- super(tenantIdCreated, sharingTags, NotificationType.Ingestion);
1193
- }
1194
- }
1195
-
1196
1225
  export interface SubscribingProviderApplication {
1197
1226
  provider: Provider;
1198
1227
  application: ProviderApplication;
@@ -2557,7 +2586,7 @@ ${ProviderApplicationQL}
2557
2586
  ${ProviderQL}
2558
2587
  ${TagQL}
2559
2588
  ${TagRecommendationQL}
2560
- ${ProviderRecommendationQL}
2589
+ ${ConnectRecommendationQL}
2561
2590
  ${ConnectedProviderQL}
2562
2591
  ${ReferenceBlockInputQL}
2563
2592
  ${ReferenceBlockQL}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bigfoot",
3
3
  "name": "@bigfootai/bigfoot-types",
4
- "version": "4.6.18",
4
+ "version": "4.7.0",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",