@bigfootai/bigfoot-types 2.11.2 → 2.11.4

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 +33 -27
  2. package/model.ts +47 -27
  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.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;
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.BlockProcessingResponse = exports.BlockProcessingRequest = 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,17 +259,21 @@ class Block extends Primitive {
258
259
  }
259
260
  }
260
261
  exports.Block = Block;
261
- class BusinessObjectArticle extends Article {
262
- constructor(referenceBlock) {
263
- super(referenceBlock);
264
- this.processingStage = ProcessingStage.NotProcessed;
265
- this.processingAttempts = 0;
266
- this.dateProcessed = 0;
262
+ class BlockProcessingRequest {
263
+ constructor(block) {
264
+ this.block = block;
265
+ }
266
+ }
267
+ exports.BlockProcessingRequest = BlockProcessingRequest;
268
+ class BlockProcessingResponse {
269
+ constructor(block, article) {
270
+ this.block = block;
271
+ this.article = article;
267
272
  }
268
273
  }
269
- exports.BusinessObjectArticle = BusinessObjectArticle;
274
+ exports.BlockProcessingResponse = BlockProcessingResponse;
270
275
  class BusinessObject extends Block {
271
- constructor(tenantIdCreated, editors, sharingTags, version, blockType, provider, application, uri) {
276
+ constructor(tenantIdCreated, editors, sharingTags, version, blockType, provider, application, uri, externalId) {
272
277
  super(tenantIdCreated, editors, sharingTags, version, blockType);
273
278
  this.processingStage = ProcessingStage.NotProcessed;
274
279
  this.processingAttempts = 0;
@@ -276,6 +281,7 @@ class BusinessObject extends Block {
276
281
  this.provider = provider;
277
282
  this.application = application;
278
283
  this.uri = uri;
284
+ this.externalId = externalId;
279
285
  }
280
286
  }
281
287
  exports.BusinessObject = BusinessObject;
@@ -295,8 +301,8 @@ class Task extends Block {
295
301
  }
296
302
  exports.Task = Task;
297
303
  class Conference extends BusinessObject {
298
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, entryPoints) {
299
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Conference, provider, application, uri);
304
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, entryPoints) {
305
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Conference, provider, application, uri, externalId);
300
306
  this.entryPoints = entryPoints;
301
307
  }
302
308
  }
@@ -317,15 +323,15 @@ var ResponseStatus;
317
323
  ResponseStatus["Accepted"] = "accepted";
318
324
  })(ResponseStatus || (exports.ResponseStatus = ResponseStatus = {}));
319
325
  class Calendar extends BusinessObject {
320
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, timeZone) {
321
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Calendar, provider, application, uri);
326
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, timeZone) {
327
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Calendar, provider, application, uri, externalId);
322
328
  this.timeZone = timeZone;
323
329
  }
324
330
  }
325
331
  exports.Calendar = Calendar;
326
332
  class Event extends BusinessObject {
327
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, calendarId, status, dateStart, organizedBy) {
328
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Event, provider, application, uri);
333
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, calendarId, status, dateStart, organizedBy) {
334
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Event, provider, application, uri, externalId);
329
335
  this.calendarId = calendarId;
330
336
  this.status = status;
331
337
  this.dateStart = dateStart;
@@ -335,33 +341,33 @@ class Event extends BusinessObject {
335
341
  exports.Event = Event;
336
342
  //// EVENT END
337
343
  //// EXTERNAL TASK START
338
- class ExternalTask extends BusinessObject {
339
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, status, dateDue) {
340
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Task, provider, application, uri);
344
+ class Todo extends BusinessObject {
345
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, status, dateDue) {
346
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Todo, provider, application, uri, externalId);
341
347
  this.status = status;
342
348
  this.dateDue = dateDue;
343
349
  }
344
350
  }
345
- exports.ExternalTask = ExternalTask;
351
+ exports.Todo = Todo;
346
352
  //// EXTERNAL TASK END
347
353
  //// MESSAGING START
348
354
  class Thread extends BusinessObject {
349
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri) {
350
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Thread, provider, application, uri);
355
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId) {
356
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Thread, provider, application, uri, externalId);
351
357
  }
352
358
  }
353
359
  exports.Thread = Thread;
354
360
  //// MESSAGING END
355
361
  //// WEBSITE START
356
362
  class Website extends BusinessObject {
357
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri) {
358
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Website, provider, application, uri);
363
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId) {
364
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Website, provider, application, uri, externalId);
359
365
  }
360
366
  }
361
367
  exports.Website = Website;
362
368
  class Template extends BusinessObject {
363
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, metadata) {
364
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Template, provider, application, uri);
369
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, metadata) {
370
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Template, provider, application, uri, externalId);
365
371
  this.metadata = metadata;
366
372
  }
367
373
  }
@@ -387,8 +393,8 @@ var FieldVariation;
387
393
  FieldVariation["Url"] = "url";
388
394
  })(FieldVariation || (exports.FieldVariation = FieldVariation = {}));
389
395
  class Table extends BusinessObject {
390
- constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, recordType, metadata, values) {
391
- super(tenantIdCreated, editors, sharingTags, version, BlockType.Table, provider, application, uri);
396
+ constructor(tenantIdCreated, editors, sharingTags, version, provider, application, uri, externalId, recordType, metadata, values) {
397
+ super(tenantIdCreated, editors, sharingTags, version, BlockType.Table, provider, application, uri, externalId);
392
398
  this.recordType = recordType;
393
399
  this.metadata = metadata;
394
400
  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',
@@ -462,7 +463,6 @@ export class Person extends Tag {
462
463
 
463
464
  export class Article extends Primitive {
464
465
  referenceBlock: ReferenceBlock;
465
- document?: any;
466
466
  changes?: Changes;
467
467
  embedding?: any;
468
468
  text?: string;
@@ -515,21 +515,22 @@ export class Block extends Primitive {
515
515
  }
516
516
  }
517
517
 
518
- export class BusinessObjectArticle extends Article {
519
- processingStage: ProcessingStage; // Indicates if the business object has been processed yet
520
- processingAttempts: number; // Indicates the number of attempts made to process this business object
521
- dateProcessed: number; // The date this document was last processed
522
- processingReason?: string; // The reason the processing is at this stage
523
- externalResponse?: any; // The full response from the external system that created this object
524
- iconUrl?: string | null; // The url of an icon that represents the business object
525
- parentId?: string | null; // The business object that is the parent of this business object
518
+ export class BlockProcessingRequest {
519
+ block: Block;
520
+ credential?: Credential;
526
521
 
527
- constructor(referenceBlock: ReferenceBlock) {
528
- super(referenceBlock);
522
+ constructor(block: Block) {
523
+ this.block = block;
524
+ }
525
+ }
529
526
 
530
- this.processingStage = ProcessingStage.NotProcessed;
531
- this.processingAttempts = 0;
532
- this.dateProcessed = 0;
527
+ export class BlockProcessingResponse {
528
+ block: Block;
529
+ article: Article;
530
+
531
+ constructor(block: Block, article: Article) {
532
+ this.block = block;
533
+ this.article = article;
533
534
  }
534
535
  }
535
536
 
@@ -540,6 +541,7 @@ export class BusinessObject extends Block {
540
541
  processingStage: ProcessingStage; // Indicates if the business object has been processed yet
541
542
  processingAttempts: number; // Indicates the number of attempts made to process this business object
542
543
  dateProcessed: number; // The date this document was last processed
544
+ externalId: string; // An external identifier that can help us match the records
543
545
  processingReason?: string; // The reason the processing is at this stage
544
546
  externalResponse?: any; // The full response from the external system that created this object
545
547
  iconUrl?: string | null; // The url of an icon that represents the business object
@@ -555,7 +557,8 @@ export class BusinessObject extends Block {
555
557
  blockType: BlockType,
556
558
  provider: string,
557
559
  application: string,
558
- uri: string
560
+ uri: string,
561
+ externalId: string
559
562
  ) {
560
563
  super(tenantIdCreated, editors, sharingTags, version, blockType);
561
564
 
@@ -566,6 +569,7 @@ export class BusinessObject extends Block {
566
569
  this.provider = provider;
567
570
  this.application = application;
568
571
  this.uri = uri;
572
+ this.externalId = externalId;
569
573
  }
570
574
  }
571
575
 
@@ -651,6 +655,7 @@ export class Conference extends BusinessObject {
651
655
  provider: string,
652
656
  application: string,
653
657
  uri: string,
658
+ externalId: string,
654
659
  entryPoints: ConferenceEntrypoint[]
655
660
  ) {
656
661
  super(
@@ -661,7 +666,8 @@ export class Conference extends BusinessObject {
661
666
  BlockType.Conference,
662
667
  provider,
663
668
  application,
664
- uri
669
+ uri,
670
+ externalId
665
671
  );
666
672
 
667
673
  this.entryPoints = entryPoints;
@@ -720,6 +726,7 @@ export class Calendar extends BusinessObject {
720
726
  provider: string,
721
727
  application: string,
722
728
  uri: string,
729
+ externalId: string,
723
730
  timeZone: string
724
731
  ) {
725
732
  super(
@@ -730,7 +737,8 @@ export class Calendar extends BusinessObject {
730
737
  BlockType.Calendar,
731
738
  provider,
732
739
  application,
733
- uri
740
+ uri,
741
+ externalId
734
742
  );
735
743
 
736
744
  this.timeZone = timeZone;
@@ -760,6 +768,7 @@ export class Event extends BusinessObject {
760
768
  provider: string,
761
769
  application: string,
762
770
  uri: string,
771
+ externalId: string,
763
772
  calendarId: string,
764
773
  status: EventStatus,
765
774
  dateStart: number,
@@ -773,7 +782,8 @@ export class Event extends BusinessObject {
773
782
  BlockType.Event,
774
783
  provider,
775
784
  application,
776
- uri
785
+ uri,
786
+ externalId
777
787
  );
778
788
 
779
789
  this.calendarId = calendarId;
@@ -785,7 +795,7 @@ export class Event extends BusinessObject {
785
795
  //// EVENT END
786
796
 
787
797
  //// EXTERNAL TASK START
788
- export class ExternalTask extends BusinessObject {
798
+ export class Todo extends BusinessObject {
789
799
  status: TaskStatus;
790
800
  dateDue: number;
791
801
  steps?: Step[];
@@ -800,6 +810,7 @@ export class ExternalTask extends BusinessObject {
800
810
  provider: string,
801
811
  application: string,
802
812
  uri: string,
813
+ externalId: string,
803
814
  status: TaskStatus,
804
815
  dateDue: number
805
816
  ) {
@@ -808,10 +819,11 @@ export class ExternalTask extends BusinessObject {
808
819
  editors,
809
820
  sharingTags,
810
821
  version,
811
- BlockType.Task,
822
+ BlockType.Todo,
812
823
  provider,
813
824
  application,
814
- uri
825
+ uri,
826
+ externalId
815
827
  );
816
828
 
817
829
  this.status = status;
@@ -829,7 +841,8 @@ export class Thread extends BusinessObject {
829
841
  version: number,
830
842
  provider: string,
831
843
  application: string,
832
- uri: string
844
+ uri: string,
845
+ externalId: string
833
846
  ) {
834
847
  super(
835
848
  tenantIdCreated,
@@ -839,7 +852,8 @@ export class Thread extends BusinessObject {
839
852
  BlockType.Thread,
840
853
  provider,
841
854
  application,
842
- uri
855
+ uri,
856
+ externalId
843
857
  );
844
858
  }
845
859
  }
@@ -858,7 +872,8 @@ export class Website extends BusinessObject {
858
872
  version: number,
859
873
  provider: string,
860
874
  application: string,
861
- uri: string
875
+ uri: string,
876
+ externalId: string
862
877
  ) {
863
878
  super(
864
879
  tenantIdCreated,
@@ -868,7 +883,8 @@ export class Website extends BusinessObject {
868
883
  BlockType.Website,
869
884
  provider,
870
885
  application,
871
- uri
886
+ uri,
887
+ externalId
872
888
  );
873
889
  }
874
890
  }
@@ -901,6 +917,7 @@ export class Template extends BusinessObject {
901
917
  provider: string,
902
918
  application: string,
903
919
  uri: string,
920
+ externalId: string,
904
921
  metadata: DocumentMetadata
905
922
  ) {
906
923
  super(
@@ -911,7 +928,8 @@ export class Template extends BusinessObject {
911
928
  BlockType.Template,
912
929
  provider,
913
930
  application,
914
- uri
931
+ uri,
932
+ externalId
915
933
  );
916
934
 
917
935
  this.metadata = metadata;
@@ -984,6 +1002,7 @@ export class Table extends BusinessObject {
984
1002
  provider: string,
985
1003
  application: string,
986
1004
  uri: string,
1005
+ externalId: string,
987
1006
  recordType: string,
988
1007
  metadata: TableMetadata,
989
1008
  values: FieldValue[]
@@ -996,7 +1015,8 @@ export class Table extends BusinessObject {
996
1015
  BlockType.Table,
997
1016
  provider,
998
1017
  application,
999
- uri
1018
+ uri,
1019
+ externalId
1000
1020
  );
1001
1021
 
1002
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.2",
4
+ "version": "2.11.4",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",