@bigfootai/bigfoot-types 2.11.1 → 2.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/model.js +31 -20
  2. package/model.ts +52 -15
  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.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;
3
+ exports.Table = exports.FieldVariation = exports.FieldType = exports.Template = exports.Website = exports.Thread = exports.Todo = exports.Event = exports.Calendar = exports.ResponseStatus = exports.EventStatus = exports.Conference = exports.Task = exports.Note = exports.BusinessObject = exports.BusinessObjectArticle = 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
@@ -15,6 +15,7 @@ var BlockType;
15
15
  BlockType["Calendar"] = "calendar";
16
16
  BlockType["Event"] = "event";
17
17
  BlockType["Task"] = "task";
18
+ BlockType["Todo"] = "todo";
18
19
  BlockType["Document"] = "document";
19
20
  BlockType["Record"] = "record";
20
21
  BlockType["Conference"] = "conference";
@@ -258,8 +259,17 @@ class Block extends Primitive {
258
259
  }
259
260
  }
260
261
  exports.Block = Block;
262
+ class BusinessObjectArticle extends Article {
263
+ constructor(referenceBlock) {
264
+ super(referenceBlock);
265
+ this.processingStage = ProcessingStage.NotProcessed;
266
+ this.processingAttempts = 0;
267
+ this.dateProcessed = 0;
268
+ }
269
+ }
270
+ exports.BusinessObjectArticle = BusinessObjectArticle;
261
271
  class BusinessObject extends Block {
262
- constructor(tenantIdCreated, editors, sharingTags, version, blockType, provider, application, uri) {
272
+ constructor(tenantIdCreated, editors, sharingTags, version, blockType, provider, application, uri, externalId) {
263
273
  super(tenantIdCreated, editors, sharingTags, version, blockType);
264
274
  this.processingStage = ProcessingStage.NotProcessed;
265
275
  this.processingAttempts = 0;
@@ -267,6 +277,7 @@ class BusinessObject extends Block {
267
277
  this.provider = provider;
268
278
  this.application = application;
269
279
  this.uri = uri;
280
+ this.externalId = externalId;
270
281
  }
271
282
  }
272
283
  exports.BusinessObject = BusinessObject;
@@ -286,8 +297,8 @@ class Task extends Block {
286
297
  }
287
298
  exports.Task = Task;
288
299
  class Conference extends BusinessObject {
289
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, entryPoints) {
290
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Conference, provider, application, uri);
300
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, entryPoints) {
301
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Conference, provider, application, uri, externalId);
291
302
  this.entryPoints = entryPoints;
292
303
  }
293
304
  }
@@ -308,15 +319,15 @@ var ResponseStatus;
308
319
  ResponseStatus["Accepted"] = "accepted";
309
320
  })(ResponseStatus || (exports.ResponseStatus = ResponseStatus = {}));
310
321
  class Calendar extends BusinessObject {
311
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, timeZone) {
312
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Calendar, provider, application, uri);
322
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, timeZone) {
323
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Calendar, provider, application, uri, externalId);
313
324
  this.timeZone = timeZone;
314
325
  }
315
326
  }
316
327
  exports.Calendar = Calendar;
317
328
  class Event extends BusinessObject {
318
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, calendarId, status, dateStart, organizedBy) {
319
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Event, provider, application, uri);
329
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, calendarId, status, dateStart, organizedBy) {
330
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Event, provider, application, uri, externalId);
320
331
  this.calendarId = calendarId;
321
332
  this.status = status;
322
333
  this.dateStart = dateStart;
@@ -326,33 +337,33 @@ class Event extends BusinessObject {
326
337
  exports.Event = Event;
327
338
  //// EVENT END
328
339
  //// EXTERNAL TASK START
329
- class ExternalTask extends BusinessObject {
330
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, status, dateDue) {
331
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Task, provider, application, uri);
340
+ class Todo extends BusinessObject {
341
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, status, dateDue) {
342
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Todo, provider, application, uri, externalId);
332
343
  this.status = status;
333
344
  this.dateDue = dateDue;
334
345
  }
335
346
  }
336
- exports.ExternalTask = ExternalTask;
347
+ exports.Todo = Todo;
337
348
  //// EXTERNAL TASK END
338
349
  //// MESSAGING START
339
350
  class Thread extends BusinessObject {
340
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri) {
341
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Thread, provider, application, uri);
351
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId) {
352
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Thread, provider, application, uri, externalId);
342
353
  }
343
354
  }
344
355
  exports.Thread = Thread;
345
356
  //// MESSAGING END
346
357
  //// WEBSITE START
347
358
  class Website extends BusinessObject {
348
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri) {
349
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Website, provider, application, uri);
359
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId) {
360
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Website, provider, application, uri, externalId);
350
361
  }
351
362
  }
352
363
  exports.Website = Website;
353
364
  class Template extends BusinessObject {
354
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, metadata) {
355
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Template, provider, application, uri);
365
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, metadata) {
366
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Template, provider, application, uri, externalId);
356
367
  this.metadata = metadata;
357
368
  }
358
369
  }
@@ -378,8 +389,8 @@ var FieldVariation;
378
389
  FieldVariation["Url"] = "url";
379
390
  })(FieldVariation || (exports.FieldVariation = FieldVariation = {}));
380
391
  class Table extends BusinessObject {
381
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, recordType, metadata, values) {
382
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Table, provider, application, uri);
392
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, recordType, metadata, values) {
393
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Table, provider, application, uri, externalId);
383
394
  this.recordType = recordType;
384
395
  this.metadata = metadata;
385
396
  this.values = values;
package/model.ts CHANGED
@@ -12,6 +12,7 @@ export enum BlockType {
12
12
  Calendar = 'calendar',
13
13
  Event = 'event',
14
14
  Task = 'task',
15
+ Todo = 'todo', // A task from an external application
15
16
  Document = 'document',
16
17
  Record = 'record',
17
18
  Conference = 'conference',
@@ -515,6 +516,24 @@ export class Block extends Primitive {
515
516
  }
516
517
  }
517
518
 
519
+ export class BusinessObjectArticle extends Article {
520
+ processingStage: ProcessingStage; // Indicates if the business object has been processed yet
521
+ processingAttempts: number; // Indicates the number of attempts made to process this business object
522
+ dateProcessed: number; // The date this document was last processed
523
+ processingReason?: string; // The reason the processing is at this stage
524
+ externalResponse?: any; // The full response from the external system that created this object
525
+ iconUrl?: string | null; // The url of an icon that represents the business object
526
+ parentId?: string | null; // The business object that is the parent of this business object
527
+
528
+ constructor(referenceBlock: ReferenceBlock) {
529
+ super(referenceBlock);
530
+
531
+ this.processingStage = ProcessingStage.NotProcessed;
532
+ this.processingAttempts = 0;
533
+ this.dateProcessed = 0;
534
+ }
535
+ }
536
+
518
537
  export class BusinessObject extends Block {
519
538
  provider: string; // A unique string representing the provider e.g. "salesforce", "atlassian", etc
520
539
  application: string; // A unique string representing the provider application e.g. "service", "jira", etc
@@ -522,12 +541,12 @@ export class BusinessObject extends Block {
522
541
  processingStage: ProcessingStage; // Indicates if the business object has been processed yet
523
542
  processingAttempts: number; // Indicates the number of attempts made to process this business object
524
543
  dateProcessed: number; // The date this document was last processed
525
- processingReason: string; // The reason the processing is at this stage
544
+ externalId: string; // An external identifier that can help us match the records
545
+ processingReason?: string; // The reason the processing is at this stage
526
546
  externalResponse?: any; // The full response from the external system that created this object
527
547
  iconUrl?: string | null; // The url of an icon that represents the business object
528
548
  document?: any | null; // The business object formatted as a document for ML to ingest
529
549
  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
550
  credential?: Credential; // Only sent for processing requests
532
551
 
533
552
  constructor(
@@ -538,7 +557,8 @@ export class BusinessObject extends Block {
538
557
  blockType: BlockType,
539
558
  provider: string,
540
559
  application: string,
541
- uri: string
560
+ uri: string,
561
+ externalId: string
542
562
  ) {
543
563
  super(tenantIdCreated, editors, sharingTags, version, blockType);
544
564
 
@@ -549,6 +569,7 @@ export class BusinessObject extends Block {
549
569
  this.provider = provider;
550
570
  this.application = application;
551
571
  this.uri = uri;
572
+ this.externalId = externalId;
552
573
  }
553
574
  }
554
575
 
@@ -634,6 +655,7 @@ export class Conference extends BusinessObject {
634
655
  provider: string,
635
656
  application: string,
636
657
  uri: string,
658
+ externalId: string,
637
659
  entryPoints: ConferenceEntrypoint[]
638
660
  ) {
639
661
  super(
@@ -644,7 +666,8 @@ export class Conference extends BusinessObject {
644
666
  BlockType.Conference,
645
667
  provider,
646
668
  application,
647
- uri
669
+ uri,
670
+ externalId
648
671
  );
649
672
 
650
673
  this.entryPoints = entryPoints;
@@ -703,6 +726,7 @@ export class Calendar extends BusinessObject {
703
726
  provider: string,
704
727
  application: string,
705
728
  uri: string,
729
+ externalId: string,
706
730
  timeZone: string
707
731
  ) {
708
732
  super(
@@ -713,7 +737,8 @@ export class Calendar extends BusinessObject {
713
737
  BlockType.Calendar,
714
738
  provider,
715
739
  application,
716
- uri
740
+ uri,
741
+ externalId
717
742
  );
718
743
 
719
744
  this.timeZone = timeZone;
@@ -743,6 +768,7 @@ export class Event extends BusinessObject {
743
768
  provider: string,
744
769
  application: string,
745
770
  uri: string,
771
+ externalId: string,
746
772
  calendarId: string,
747
773
  status: EventStatus,
748
774
  dateStart: number,
@@ -756,7 +782,8 @@ export class Event extends BusinessObject {
756
782
  BlockType.Event,
757
783
  provider,
758
784
  application,
759
- uri
785
+ uri,
786
+ externalId
760
787
  );
761
788
 
762
789
  this.calendarId = calendarId;
@@ -768,7 +795,7 @@ export class Event extends BusinessObject {
768
795
  //// EVENT END
769
796
 
770
797
  //// EXTERNAL TASK START
771
- export class ExternalTask extends BusinessObject {
798
+ export class Todo extends BusinessObject {
772
799
  status: TaskStatus;
773
800
  dateDue: number;
774
801
  steps?: Step[];
@@ -783,6 +810,7 @@ export class ExternalTask extends BusinessObject {
783
810
  provider: string,
784
811
  application: string,
785
812
  uri: string,
813
+ externalId: string,
786
814
  status: TaskStatus,
787
815
  dateDue: number
788
816
  ) {
@@ -791,10 +819,11 @@ export class ExternalTask extends BusinessObject {
791
819
  editors,
792
820
  sharingTags,
793
821
  version,
794
- BlockType.Task,
822
+ BlockType.Todo,
795
823
  provider,
796
824
  application,
797
- uri
825
+ uri,
826
+ externalId
798
827
  );
799
828
 
800
829
  this.status = status;
@@ -812,7 +841,8 @@ export class Thread extends BusinessObject {
812
841
  version: number,
813
842
  provider: string,
814
843
  application: string,
815
- uri: string
844
+ uri: string,
845
+ externalId: string
816
846
  ) {
817
847
  super(
818
848
  tenantIdCreated,
@@ -822,7 +852,8 @@ export class Thread extends BusinessObject {
822
852
  BlockType.Thread,
823
853
  provider,
824
854
  application,
825
- uri
855
+ uri,
856
+ externalId
826
857
  );
827
858
  }
828
859
  }
@@ -841,7 +872,8 @@ export class Website extends BusinessObject {
841
872
  version: number,
842
873
  provider: string,
843
874
  application: string,
844
- uri: string
875
+ uri: string,
876
+ externalId: string
845
877
  ) {
846
878
  super(
847
879
  tenantIdCreated,
@@ -851,7 +883,8 @@ export class Website extends BusinessObject {
851
883
  BlockType.Website,
852
884
  provider,
853
885
  application,
854
- uri
886
+ uri,
887
+ externalId
855
888
  );
856
889
  }
857
890
  }
@@ -884,6 +917,7 @@ export class Template extends BusinessObject {
884
917
  provider: string,
885
918
  application: string,
886
919
  uri: string,
920
+ externalId: string,
887
921
  metadata: DocumentMetadata
888
922
  ) {
889
923
  super(
@@ -894,7 +928,8 @@ export class Template extends BusinessObject {
894
928
  BlockType.Template,
895
929
  provider,
896
930
  application,
897
- uri
931
+ uri,
932
+ externalId
898
933
  );
899
934
 
900
935
  this.metadata = metadata;
@@ -967,6 +1002,7 @@ export class Table extends BusinessObject {
967
1002
  provider: string,
968
1003
  application: string,
969
1004
  uri: string,
1005
+ externalId: string,
970
1006
  recordType: string,
971
1007
  metadata: TableMetadata,
972
1008
  values: FieldValue[]
@@ -979,7 +1015,8 @@ export class Table extends BusinessObject {
979
1015
  BlockType.Table,
980
1016
  provider,
981
1017
  application,
982
- uri
1018
+ uri,
1019
+ externalId
983
1020
  );
984
1021
 
985
1022
  this.recordType = recordType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bigfoot",
3
3
  "name": "@bigfootai/bigfoot-types",
4
- "version": "2.11.1",
4
+ "version": "2.11.3",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",