@bigfootai/bigfoot-types 2.10.12 → 2.11.1

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 (3) hide show
  1. package/model.js +44 -41
  2. package/model.ts +169 -53
  3. package/package.json +1 -1
package/model.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Table = exports.FieldVariation = exports.FieldType = exports.Template = exports.Thread = exports.ExternalTask = exports.Event = exports.Calendar = exports.ResponseStatus = exports.EventStatus = exports.Conference = exports.Task = exports.Note = exports.Block = exports.Article = exports.Person = exports.Domain = exports.Tenant = exports.BusinessObject = exports.Tag = exports.Provider = exports.Sync = exports.Primitive = exports.RelationType = exports.EntityType = exports.ProcessingStage = exports.MutationType = exports.MarkType = exports.DocumentType = exports.RecurrenceRFC = exports.InviteStatus = exports.SharingApproach = exports.StepStatus = exports.TaskStatus = exports.SharingLevel = exports.ClientType = exports.TagType = exports.BlockType = exports.BusinessObjectType = void 0;
3
+ exports.Table = exports.FieldVariation = exports.FieldType = exports.Template = exports.Website = exports.Thread = exports.ExternalTask = exports.Event = exports.Calendar = exports.ResponseStatus = exports.EventStatus = exports.Conference = exports.Task = exports.Note = exports.BusinessObject = exports.Block = exports.Article = exports.Person = exports.Domain = exports.Tenant = exports.Tag = exports.Provider = exports.Sync = exports.Primitive = exports.RelationType = exports.EntityType = exports.ProcessingStage = exports.MutationType = exports.MarkType = exports.DocumentType = exports.RecurrenceRFC = exports.InviteStatus = exports.SharingApproach = exports.StepStatus = exports.TaskStatus = exports.SharingLevel = exports.ClientType = exports.TagType = exports.BlockType = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  /*
6
6
  These are the core primitives of our model. These represent the entities that show
@@ -8,25 +8,20 @@ up in our Graph QL CRUD operations and set out the fundamental building blocks o
8
8
  the platform.
9
9
  */
10
10
  // CORE START
11
- var BusinessObjectType;
12
- (function (BusinessObjectType) {
13
- BusinessObjectType["Calendar"] = "calendar";
14
- BusinessObjectType["Event"] = "event";
15
- BusinessObjectType["Task"] = "task";
16
- BusinessObjectType["Document"] = "document";
17
- BusinessObjectType["Record"] = "record";
18
- BusinessObjectType["Conference"] = "conference";
19
- BusinessObjectType["Thread"] = "thread";
20
- BusinessObjectType["Website"] = "website";
21
- BusinessObjectType["Template"] = "template";
22
- BusinessObjectType["Table"] = "table";
23
- })(BusinessObjectType || (exports.BusinessObjectType = BusinessObjectType = {}));
24
11
  var BlockType;
25
12
  (function (BlockType) {
26
13
  BlockType["Note"] = "note";
27
14
  BlockType["Section"] = "section";
15
+ BlockType["Calendar"] = "calendar";
16
+ BlockType["Event"] = "event";
28
17
  BlockType["Task"] = "task";
29
- BlockType["Data"] = "data";
18
+ BlockType["Document"] = "document";
19
+ BlockType["Record"] = "record";
20
+ BlockType["Conference"] = "conference";
21
+ BlockType["Thread"] = "thread";
22
+ BlockType["Website"] = "website";
23
+ BlockType["Template"] = "template";
24
+ BlockType["Table"] = "table";
30
25
  })(BlockType || (exports.BlockType = BlockType = {}));
31
26
  var TagType;
32
27
  (function (TagType) {
@@ -217,18 +212,6 @@ class Tag extends Primitive {
217
212
  }
218
213
  }
219
214
  exports.Tag = Tag;
220
- class BusinessObject extends Primitive {
221
- constructor(provider, application, uri) {
222
- super();
223
- this.processingStage = ProcessingStage.NotProcessed;
224
- this.processingAttempts = 0;
225
- this.dateProcessed = 0;
226
- this.provider = provider;
227
- this.application = application;
228
- this.uri = uri;
229
- }
230
- }
231
- exports.BusinessObject = BusinessObject;
232
215
  class Tenant extends Primitive {
233
216
  constructor(domainMemberships, email, emailVerified, domainIdEmail, tagId) {
234
217
  super();
@@ -275,6 +258,18 @@ class Block extends Primitive {
275
258
  }
276
259
  }
277
260
  exports.Block = Block;
261
+ class BusinessObject extends Block {
262
+ constructor(tenantIdCreated, editors, sharingTags, version, blockType, provider, application, uri) {
263
+ super(tenantIdCreated, editors, sharingTags, version, blockType);
264
+ this.processingStage = ProcessingStage.NotProcessed;
265
+ this.processingAttempts = 0;
266
+ this.dateProcessed = 0;
267
+ this.provider = provider;
268
+ this.application = application;
269
+ this.uri = uri;
270
+ }
271
+ }
272
+ exports.BusinessObject = BusinessObject;
278
273
  class Note extends Block {
279
274
  constructor(tenantIdCreated, editors, sharingTags, version) {
280
275
  super(tenantIdCreated, editors, sharingTags, version, BlockType.Note);
@@ -291,8 +286,8 @@ class Task extends Block {
291
286
  }
292
287
  exports.Task = Task;
293
288
  class Conference extends BusinessObject {
294
- constructor(provider, application, uri, entryPoints) {
295
- super(provider, application, uri);
289
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, entryPoints) {
290
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Conference, provider, application, uri);
296
291
  this.entryPoints = entryPoints;
297
292
  }
298
293
  }
@@ -313,15 +308,15 @@ var ResponseStatus;
313
308
  ResponseStatus["Accepted"] = "accepted";
314
309
  })(ResponseStatus || (exports.ResponseStatus = ResponseStatus = {}));
315
310
  class Calendar extends BusinessObject {
316
- constructor(provider, application, uri, timeZone) {
317
- super(provider, application, uri);
311
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, timeZone) {
312
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Calendar, provider, application, uri);
318
313
  this.timeZone = timeZone;
319
314
  }
320
315
  }
321
316
  exports.Calendar = Calendar;
322
317
  class Event extends BusinessObject {
323
- constructor(provider, application, uri, calendarId, status, dateStart, organizedBy) {
324
- super(provider, application, uri);
318
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, calendarId, status, dateStart, organizedBy) {
319
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Event, provider, application, uri);
325
320
  this.calendarId = calendarId;
326
321
  this.status = status;
327
322
  this.dateStart = dateStart;
@@ -332,8 +327,8 @@ exports.Event = Event;
332
327
  //// EVENT END
333
328
  //// EXTERNAL TASK START
334
329
  class ExternalTask extends BusinessObject {
335
- constructor(provider, application, uri, status, dateDue) {
336
- super(provider, application, uri);
330
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, status, dateDue) {
331
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Task, provider, application, uri);
337
332
  this.status = status;
338
333
  this.dateDue = dateDue;
339
334
  }
@@ -342,14 +337,22 @@ exports.ExternalTask = ExternalTask;
342
337
  //// EXTERNAL TASK END
343
338
  //// MESSAGING START
344
339
  class Thread extends BusinessObject {
345
- constructor(provider, application, uri) {
346
- super(provider, application, uri);
340
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri) {
341
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Thread, provider, application, uri);
347
342
  }
348
343
  }
349
344
  exports.Thread = Thread;
345
+ //// MESSAGING END
346
+ //// WEBSITE START
347
+ class Website extends BusinessObject {
348
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri) {
349
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Website, provider, application, uri);
350
+ }
351
+ }
352
+ exports.Website = Website;
350
353
  class Template extends BusinessObject {
351
- constructor(provider, application, uri, metadata) {
352
- super(provider, application, uri);
354
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, metadata) {
355
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Template, provider, application, uri);
353
356
  this.metadata = metadata;
354
357
  }
355
358
  }
@@ -375,8 +378,8 @@ var FieldVariation;
375
378
  FieldVariation["Url"] = "url";
376
379
  })(FieldVariation || (exports.FieldVariation = FieldVariation = {}));
377
380
  class Table extends BusinessObject {
378
- constructor(provider, application, uri, recordType, metadata, values) {
379
- super(provider, application, uri);
381
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, recordType, metadata, values) {
382
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Table, provider, application, uri);
380
383
  this.recordType = recordType;
381
384
  this.metadata = metadata;
382
385
  this.values = values;
package/model.ts CHANGED
@@ -6,7 +6,9 @@ up in our Graph QL CRUD operations and set out the fundamental building blocks o
6
6
  the platform.
7
7
  */
8
8
  // CORE START
9
- export enum BusinessObjectType {
9
+ export enum BlockType {
10
+ Note = 'note',
11
+ Section = 'section',
10
12
  Calendar = 'calendar',
11
13
  Event = 'event',
12
14
  Task = 'task',
@@ -19,13 +21,6 @@ export enum BusinessObjectType {
19
21
  Table = 'table',
20
22
  }
21
23
 
22
- export enum BlockType {
23
- Note = 'note', // It's a full note
24
- Section = 'section', // It's a fragment of content
25
- Task = 'task', // It's a task
26
- Data = 'data', // It's a record or set of records belonging to a specific metadata definition
27
- }
28
-
29
24
  export enum TagType {
30
25
  Person = 'person',
31
26
  Topic = 'topic',
@@ -294,14 +289,6 @@ export interface ProviderResponse {
294
289
  providerUrl: string;
295
290
  }
296
291
 
297
- export interface BusinessObjectRequest {
298
- businessObjectId: string;
299
- linkUrl: string;
300
- credential?: Credential;
301
- application?: string;
302
- provider?: Provider;
303
- }
304
-
305
292
  export interface StandardObjects {
306
293
  task: boolean;
307
294
  calendar: boolean;
@@ -415,34 +402,6 @@ export class Tag extends Primitive {
415
402
  }
416
403
  }
417
404
 
418
- export class BusinessObject extends Primitive {
419
- provider: string; // A unique string representing the provider e.g. "salesforce", "atlassian", etc
420
- application: string; // A unique string representing the provider application e.g. "service", "jira", etc
421
- uri: string; // A uri to locate the specific instance of the business object
422
- processingStage: ProcessingStage; // Indicates if the business object has been processed yet
423
- processingAttempts: number; // Indicates the number of attempts made to process this business object
424
- dateProcessed: number; // The date this document was last processed
425
- processingReason: string; // The reason the processing is at this stage
426
- externalId?: string; // An identifier that allows us to do entity resolution
427
- businessObjectType?: BusinessObjectType;
428
- externalResponse?: any; // The full response from the external system that created this object
429
- iconUrl?: string | null; // The url of an icon that represents the business object
430
- document?: any | null; // The business object formatted as a document for ML to ingest
431
- parentId?: string | null; // The business object that is the parent of this business object
432
-
433
- constructor(provider: string, application: string, uri: string) {
434
- super();
435
-
436
- this.processingStage = ProcessingStage.NotProcessed;
437
- this.processingAttempts = 0;
438
- this.dateProcessed = 0;
439
-
440
- this.provider = provider;
441
- this.application = application;
442
- this.uri = uri;
443
- }
444
- }
445
-
446
405
  export class Tenant extends Primitive {
447
406
  domainMemberships: string[]; // The list of all domains this tenant belongs
448
407
  email: string;
@@ -556,6 +515,43 @@ export class Block extends Primitive {
556
515
  }
557
516
  }
558
517
 
518
+ export class BusinessObject extends Block {
519
+ provider: string; // A unique string representing the provider e.g. "salesforce", "atlassian", etc
520
+ application: string; // A unique string representing the provider application e.g. "service", "jira", etc
521
+ uri: string; // A uri to locate the specific instance of the business object
522
+ processingStage: ProcessingStage; // Indicates if the business object has been processed yet
523
+ processingAttempts: number; // Indicates the number of attempts made to process this business object
524
+ dateProcessed: number; // The date this document was last processed
525
+ processingReason: string; // The reason the processing is at this stage
526
+ externalResponse?: any; // The full response from the external system that created this object
527
+ iconUrl?: string | null; // The url of an icon that represents the business object
528
+ document?: any | null; // The business object formatted as a document for ML to ingest
529
+ parentId?: string | null; // The business object that is the parent of this business object
530
+ linkUrls?: string[]; // Any links in the business object which can be used to understand relationships between objects
531
+ credential?: Credential; // Only sent for processing requests
532
+
533
+ constructor(
534
+ tenantIdCreated: string,
535
+ editors: Editor[],
536
+ sharingTags: SharingTag[],
537
+ version: number,
538
+ blockType: BlockType,
539
+ provider: string,
540
+ application: string,
541
+ uri: string
542
+ ) {
543
+ super(tenantIdCreated, editors, sharingTags, version, blockType);
544
+
545
+ this.processingStage = ProcessingStage.NotProcessed;
546
+ this.processingAttempts = 0;
547
+ this.dateProcessed = 0;
548
+
549
+ this.provider = provider;
550
+ this.application = application;
551
+ this.uri = uri;
552
+ }
553
+ }
554
+
559
555
  export class Note extends Block {
560
556
  constructor(
561
557
  tenantIdCreated: string,
@@ -631,12 +627,25 @@ export class Conference extends BusinessObject {
631
627
  transcription?: Transcription | null;
632
628
 
633
629
  constructor(
630
+ tenantIdCreated: string,
631
+ editors: Editor[],
632
+ sharingTags: SharingTag[],
633
+ version: number,
634
634
  provider: string,
635
635
  application: string,
636
636
  uri: string,
637
637
  entryPoints: ConferenceEntrypoint[]
638
638
  ) {
639
- super(provider, application, uri);
639
+ super(
640
+ tenantIdCreated,
641
+ editors,
642
+ sharingTags,
643
+ version,
644
+ BlockType.Conference,
645
+ provider,
646
+ application,
647
+ uri
648
+ );
640
649
 
641
650
  this.entryPoints = entryPoints;
642
651
  }
@@ -687,12 +696,25 @@ export class Calendar extends BusinessObject {
687
696
  events?: Event[] | null;
688
697
 
689
698
  constructor(
699
+ tenantIdCreated: string,
700
+ editors: Editor[],
701
+ sharingTags: SharingTag[],
702
+ version: number,
690
703
  provider: string,
691
704
  application: string,
692
705
  uri: string,
693
706
  timeZone: string
694
707
  ) {
695
- super(provider, application, uri);
708
+ super(
709
+ tenantIdCreated,
710
+ editors,
711
+ sharingTags,
712
+ version,
713
+ BlockType.Calendar,
714
+ provider,
715
+ application,
716
+ uri
717
+ );
696
718
 
697
719
  this.timeZone = timeZone;
698
720
  }
@@ -714,6 +736,10 @@ export class Event extends BusinessObject {
714
736
  attachments?: Attachment[] | null;
715
737
 
716
738
  constructor(
739
+ tenantIdCreated: string,
740
+ editors: Editor[],
741
+ sharingTags: SharingTag[],
742
+ version: number,
717
743
  provider: string,
718
744
  application: string,
719
745
  uri: string,
@@ -722,7 +748,16 @@ export class Event extends BusinessObject {
722
748
  dateStart: number,
723
749
  organizedBy: PersonReference
724
750
  ) {
725
- super(provider, application, uri);
751
+ super(
752
+ tenantIdCreated,
753
+ editors,
754
+ sharingTags,
755
+ version,
756
+ BlockType.Event,
757
+ provider,
758
+ application,
759
+ uri
760
+ );
726
761
 
727
762
  this.calendarId = calendarId;
728
763
  this.status = status;
@@ -741,13 +776,26 @@ export class ExternalTask extends BusinessObject {
741
776
  recurrence?: RecurrenceRFC[];
742
777
 
743
778
  constructor(
779
+ tenantIdCreated: string,
780
+ editors: Editor[],
781
+ sharingTags: SharingTag[],
782
+ version: number,
744
783
  provider: string,
745
784
  application: string,
746
785
  uri: string,
747
786
  status: TaskStatus,
748
787
  dateDue: number
749
788
  ) {
750
- super(provider, application, uri);
789
+ super(
790
+ tenantIdCreated,
791
+ editors,
792
+ sharingTags,
793
+ version,
794
+ BlockType.Task,
795
+ provider,
796
+ application,
797
+ uri
798
+ );
751
799
 
752
800
  this.status = status;
753
801
  this.dateDue = dateDue;
@@ -757,14 +805,56 @@ export class ExternalTask extends BusinessObject {
757
805
 
758
806
  //// MESSAGING START
759
807
  export class Thread extends BusinessObject {
760
- constructor(provider: string, application: string, uri: string) {
761
- super(provider, application, uri);
808
+ constructor(
809
+ tenantIdCreated: string,
810
+ editors: Editor[],
811
+ sharingTags: SharingTag[],
812
+ version: number,
813
+ provider: string,
814
+ application: string,
815
+ uri: string
816
+ ) {
817
+ super(
818
+ tenantIdCreated,
819
+ editors,
820
+ sharingTags,
821
+ version,
822
+ BlockType.Thread,
823
+ provider,
824
+ application,
825
+ uri
826
+ );
762
827
  }
763
828
  }
764
829
  //// MESSAGING END
765
830
 
766
831
  //// WEBSITE START
767
- export interface Website extends BusinessObject {}
832
+ export class Website extends BusinessObject {
833
+ title?: string;
834
+ description?: string;
835
+ bannerImage?: string;
836
+
837
+ constructor(
838
+ tenantIdCreated: string,
839
+ editors: Editor[],
840
+ sharingTags: SharingTag[],
841
+ version: number,
842
+ provider: string,
843
+ application: string,
844
+ uri: string
845
+ ) {
846
+ super(
847
+ tenantIdCreated,
848
+ editors,
849
+ sharingTags,
850
+ version,
851
+ BlockType.Website,
852
+ provider,
853
+ application,
854
+ uri
855
+ );
856
+ }
857
+ }
768
858
  //// WEBSITE END
769
859
 
770
860
  // BUSINESS OBJECTS END
@@ -787,12 +877,25 @@ export class Template extends BusinessObject {
787
877
  metadata: DocumentMetadata;
788
878
 
789
879
  constructor(
880
+ tenantIdCreated: string,
881
+ editors: Editor[],
882
+ sharingTags: SharingTag[],
883
+ version: number,
790
884
  provider: string,
791
885
  application: string,
792
886
  uri: string,
793
887
  metadata: DocumentMetadata
794
888
  ) {
795
- super(provider, application, uri);
889
+ super(
890
+ tenantIdCreated,
891
+ editors,
892
+ sharingTags,
893
+ version,
894
+ BlockType.Template,
895
+ provider,
896
+ application,
897
+ uri
898
+ );
796
899
 
797
900
  this.metadata = metadata;
798
901
  }
@@ -857,6 +960,10 @@ export class Table extends BusinessObject {
857
960
  values: FieldValue[];
858
961
 
859
962
  constructor(
963
+ tenantIdCreated: string,
964
+ editors: Editor[],
965
+ sharingTags: SharingTag[],
966
+ version: number,
860
967
  provider: string,
861
968
  application: string,
862
969
  uri: string,
@@ -864,7 +971,16 @@ export class Table extends BusinessObject {
864
971
  metadata: TableMetadata,
865
972
  values: FieldValue[]
866
973
  ) {
867
- super(provider, application, uri);
974
+ super(
975
+ tenantIdCreated,
976
+ editors,
977
+ sharingTags,
978
+ version,
979
+ BlockType.Table,
980
+ provider,
981
+ application,
982
+ uri
983
+ );
868
984
 
869
985
  this.recordType = recordType;
870
986
  this.metadata = metadata;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bigfoot",
3
3
  "name": "@bigfootai/bigfoot-types",
4
- "version": "2.10.12",
4
+ "version": "2.11.1",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",