@bigfootai/bigfoot-types 2.11.4 → 2.11.6

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 +107 -1
  2. package/model.ts +114 -6
  3. package/package.json +1 -1
package/model.js CHANGED
@@ -1,6 +1,7 @@
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.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;
3
+ exports.Website = exports.Thread = exports.Todo = exports.Event = exports.Calendar = exports.ResponseStatus = exports.EventStatus = exports.Conference = exports.Task = exports.Note = exports.NoteQL = exports.BusinessObject = exports.BlockProcessingResponse = exports.BlockProcessingRequest = exports.Block = exports.BlockFields = exports.Article = exports.Person = exports.Domain = exports.Tenant = exports.TenantQL = exports.Tag = exports.Provider = exports.Sync = exports.Primitive = exports.PrimitiveFields = exports.ChangesQL = exports.ConnectedProviderQL = exports.CredentialQL = exports.ProviderRequestQL = exports.ProviderInfoQL = exports.ReactionQL = exports.ReactionSkinToneQL = exports.SharingTagQL = exports.EditorQL = 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
+ exports.GraphQLTypes = exports.Table = exports.FieldVariation = exports.FieldType = exports.Template = void 0;
4
5
  const uuid_1 = require("uuid");
5
6
  /*
6
7
  These are the core primitives of our model. These represent the entities that show
@@ -176,6 +177,67 @@ var RelationType;
176
177
  RelationType["SpouseOf"] = "spouseOf";
177
178
  RelationType["SubsidiaryOf"] = "subsidiaryOf";
178
179
  })(RelationType || (exports.RelationType = RelationType = {}));
180
+ exports.EditorQL = `
181
+ type Editor {
182
+ clientType: String!
183
+ clientId: String!
184
+ tenantId: String
185
+ }`;
186
+ exports.SharingTagQL = `
187
+ type SharingTag {
188
+ tagId: String!
189
+ isShared: Boolean!
190
+ sharingApproach: String!
191
+ sharingLevel: String!
192
+ }`;
193
+ exports.ReactionSkinToneQL = `
194
+ type ReactionSkinTone {
195
+ skinTone: String!
196
+ tenantIds: [String]!
197
+ }`;
198
+ exports.ReactionQL = `
199
+ type Reaction {
200
+ skinTones: [ReactionSkinTone]!
201
+ unified: String!
202
+ }`;
203
+ exports.ProviderInfoQL = `
204
+ type ProviderInfo {
205
+ provider: String!
206
+ application: String!
207
+ }`;
208
+ exports.ProviderRequestQL = `
209
+ type ProviderRequest {
210
+ providerInfo: ID!
211
+ connectionId: String!
212
+ }`;
213
+ exports.CredentialQL = `
214
+ type Credential {
215
+ email: String!
216
+ profile: String!
217
+ accessToken: String!
218
+ refreshToken: String
219
+ instanceUrl: String
220
+ dateExpiry: Float
221
+ }`;
222
+ exports.ConnectedProviderQL = `
223
+ type ConnectedProvider {
224
+ providerId: String!
225
+ connectionId: String!
226
+ application: String!
227
+ credential: Credential
228
+ dateCreated: Float
229
+ dateUpdated: Float
230
+ }`;
231
+ exports.ChangesQL = `
232
+ type Changes {
233
+ steps: [String]!
234
+ clientIds: [String]!
235
+ }`;
236
+ exports.PrimitiveFields = `
237
+ _id: ID!
238
+ dateCreated: Float!
239
+ dateUpdated: Float!
240
+ tenantIdCreated: String`;
179
241
  class Primitive {
180
242
  constructor() {
181
243
  this._id = (0, uuid_1.v4)();
@@ -213,6 +275,18 @@ class Tag extends Primitive {
213
275
  }
214
276
  }
215
277
  exports.Tag = Tag;
278
+ exports.TenantQL = `
279
+ type Tenant { ${exports.PrimitiveFields}
280
+ domainMemberships: [String]!
281
+ email: String!
282
+ emailVerified: Boolean!
283
+ domainIdEmail: String!
284
+ tagId: String!
285
+ picture: String
286
+ familyName: String
287
+ givenName: String
288
+ connectedProviders: [ConnectedProvider]
289
+ }`;
216
290
  class Tenant extends Primitive {
217
291
  constructor(domainMemberships, email, emailVerified, domainIdEmail, tagId) {
218
292
  super();
@@ -247,6 +321,17 @@ class Article extends Primitive {
247
321
  }
248
322
  }
249
323
  exports.Article = Article;
324
+ exports.BlockFields = `
325
+ editors: [Editor]!
326
+ sharingTags: [SharingTag]!
327
+ version: Float!
328
+ blockType: String!
329
+ archived: Boolean!
330
+ _ignoreUpdate: Boolean!
331
+ document: String
332
+ changes: Changes
333
+ _sharedTags: [String]
334
+ reactions: [Reaction]`;
250
335
  class Block extends Primitive {
251
336
  constructor(tenantIdCreated, editors, sharingTags, version, blockType) {
252
337
  super();
@@ -256,6 +341,7 @@ class Block extends Primitive {
256
341
  this.version = version;
257
342
  this.blockType = blockType;
258
343
  this.archived = false;
344
+ this._ignoreUpdate = false;
259
345
  }
260
346
  }
261
347
  exports.Block = Block;
@@ -278,6 +364,7 @@ class BusinessObject extends Block {
278
364
  this.processingStage = ProcessingStage.NotProcessed;
279
365
  this.processingAttempts = 0;
280
366
  this.dateProcessed = 0;
367
+ this.archived = false;
281
368
  this.provider = provider;
282
369
  this.application = application;
283
370
  this.uri = uri;
@@ -285,9 +372,13 @@ class BusinessObject extends Block {
285
372
  }
286
373
  }
287
374
  exports.BusinessObject = BusinessObject;
375
+ exports.NoteQL = `
376
+ type Note { ${exports.BlockFields}
377
+ }`;
288
378
  class Note extends Block {
289
379
  constructor(tenantIdCreated, editors, sharingTags, version) {
290
380
  super(tenantIdCreated, editors, sharingTags, version, BlockType.Note);
381
+ this.archived = false;
291
382
  }
292
383
  }
293
384
  exports.Note = Note;
@@ -295,6 +386,8 @@ class Task extends Block {
295
386
  constructor(tenantIdCreated, editors, sharingTags, version, originNoteId, dateDue) {
296
387
  super(tenantIdCreated, editors, sharingTags, version, BlockType.Task);
297
388
  this.status = TaskStatus.NotStarted;
389
+ this.snoozed = false;
390
+ this.archived = false;
298
391
  this.originNoteId = originNoteId;
299
392
  this.dateDue = dateDue;
300
393
  }
@@ -403,3 +496,16 @@ class Table extends BusinessObject {
403
496
  exports.Table = Table;
404
497
  //// FOR RECORDS END
405
498
  // METADATA OBJECTS END
499
+ exports.GraphQLTypes = `
500
+ ${exports.EditorQL}
501
+ ${exports.SharingTagQL}
502
+ ${exports.ReactionSkinToneQL}
503
+ ${exports.ReactionQL}
504
+ ${exports.ProviderInfoQL}
505
+ ${exports.ProviderRequestQL}
506
+ ${exports.CredentialQL}
507
+ ${exports.ChangesQL}
508
+ ${exports.ConnectedProviderQL}
509
+ ${exports.TenantQL}
510
+ ${exports.NoteQL}
511
+ `;
package/model.ts CHANGED
@@ -197,12 +197,25 @@ export interface Document {
197
197
  marks?: Mark[];
198
198
  }
199
199
 
200
+ export const EditorQL = `
201
+ type Editor {
202
+ clientType: String!
203
+ clientId: String!
204
+ tenantId: String
205
+ }`;
200
206
  export interface Editor {
201
207
  clientType: ClientType;
202
208
  clientId: string;
203
209
  tenantId?: string;
204
210
  }
205
211
 
212
+ export const SharingTagQL = `
213
+ type SharingTag {
214
+ tagId: String!
215
+ isShared: Boolean!
216
+ sharingApproach: String!
217
+ sharingLevel: String!
218
+ }`;
206
219
  export interface SharingTag {
207
220
  tagId: string;
208
221
  isShared: boolean;
@@ -223,16 +236,26 @@ export interface SharingTenant {
223
236
  sharingLevel: SharingLevel; // Determines what tenants can do with the tag beyond tenant specific settings above
224
237
  }
225
238
 
226
- export interface Reaction {
227
- skinTones: ReactionSkinTone[];
228
- unified: string;
229
- }
230
-
239
+ export const ReactionSkinToneQL = `
240
+ type ReactionSkinTone {
241
+ skinTone: String!
242
+ tenantIds: [String]!
243
+ }`;
231
244
  export interface ReactionSkinTone {
232
245
  skinTone: string;
233
246
  tenantIds: string[];
234
247
  }
235
248
 
249
+ export const ReactionQL = `
250
+ type Reaction {
251
+ skinTones: [ReactionSkinTone]!
252
+ unified: String!
253
+ }`;
254
+ export interface Reaction {
255
+ skinTones: ReactionSkinTone[];
256
+ unified: string;
257
+ }
258
+
236
259
  export interface Step {
237
260
  content: string;
238
261
  status: StepStatus;
@@ -275,11 +298,21 @@ export interface MachineLearningEntry {
275
298
  highlights?: Highlight[];
276
299
  }
277
300
 
301
+ export const ProviderInfoQL = `
302
+ type ProviderInfo {
303
+ provider: String!
304
+ application: String!
305
+ }`;
278
306
  export interface ProviderInfo {
279
307
  provider: string;
280
308
  application: string;
281
309
  }
282
310
 
311
+ export const ProviderRequestQL = `
312
+ type ProviderRequest {
313
+ providerInfo: ID!
314
+ connectionId: String!
315
+ }`;
283
316
  export interface ProviderRequest {
284
317
  providerInfo: ProviderInfo;
285
318
  connectionId: string;
@@ -299,6 +332,15 @@ export interface Subscriptions {
299
332
  linkDomains: string[];
300
333
  }
301
334
 
335
+ export const CredentialQL = `
336
+ type Credential {
337
+ email: String!
338
+ profile: String!
339
+ accessToken: String!
340
+ refreshToken: String
341
+ instanceUrl: String
342
+ dateExpiry: Float
343
+ }`;
302
344
  export interface Credential {
303
345
  email: string;
304
346
  profile: any;
@@ -313,6 +355,15 @@ export interface ConnectedProviderRegistration {
313
355
  credential: Credential;
314
356
  }
315
357
 
358
+ export const ConnectedProviderQL = `
359
+ type ConnectedProvider {
360
+ providerId: String!
361
+ connectionId: String!
362
+ application: String!
363
+ credential: Credential
364
+ dateCreated: Float
365
+ dateUpdated: Float
366
+ }`;
316
367
  export interface ConnectedProvider {
317
368
  providerId: string;
318
369
  connectionId: string;
@@ -328,6 +379,11 @@ export interface ReferenceBlock {
328
379
  type: BlockType;
329
380
  }
330
381
 
382
+ export const ChangesQL = `
383
+ type Changes {
384
+ steps: [String]!
385
+ clientIds: [String]!
386
+ }`;
331
387
  export interface Changes {
332
388
  steps: any[];
333
389
  clientIds: string[];
@@ -337,6 +393,11 @@ export interface PersonReference {
337
393
  email: string;
338
394
  }
339
395
 
396
+ export const PrimitiveFields = `
397
+ _id: ID!
398
+ dateCreated: Float!
399
+ dateUpdated: Float!
400
+ tenantIdCreated: String`;
340
401
  export class Primitive {
341
402
  _id: string;
342
403
  dateCreated: number;
@@ -403,6 +464,18 @@ export class Tag extends Primitive {
403
464
  }
404
465
  }
405
466
 
467
+ export const TenantQL = `
468
+ type Tenant { ${PrimitiveFields}
469
+ domainMemberships: [String]!
470
+ email: String!
471
+ emailVerified: Boolean!
472
+ domainIdEmail: String!
473
+ tagId: String!
474
+ picture: String
475
+ familyName: String
476
+ givenName: String
477
+ connectedProviders: [ConnectedProvider]
478
+ }`;
406
479
  export class Tenant extends Primitive {
407
480
  domainMemberships: string[]; // The list of all domains this tenant belongs
408
481
  email: string;
@@ -485,12 +558,24 @@ export class Article extends Primitive {
485
558
  }
486
559
  }
487
560
 
561
+ export const BlockFields = `
562
+ editors: [Editor]!
563
+ sharingTags: [SharingTag]!
564
+ version: Float!
565
+ blockType: String!
566
+ archived: Boolean!
567
+ _ignoreUpdate: Boolean!
568
+ document: String
569
+ changes: Changes
570
+ _sharedTags: [String]
571
+ reactions: [Reaction]`;
488
572
  export class Block extends Primitive {
489
573
  editors: Editor[];
490
574
  sharingTags: SharingTag[];
491
575
  version: number;
492
576
  blockType: BlockType;
493
577
  archived: boolean;
578
+ _ignoreUpdate: boolean;
494
579
  document?: any;
495
580
  changes?: Changes;
496
581
  _sharedTags?: string[];
@@ -512,6 +597,7 @@ export class Block extends Primitive {
512
597
  this.blockType = blockType;
513
598
 
514
599
  this.archived = false;
600
+ this._ignoreUpdate = false;
515
601
  }
516
602
  }
517
603
 
@@ -547,7 +633,6 @@ export class BusinessObject extends Block {
547
633
  iconUrl?: string | null; // The url of an icon that represents the business object
548
634
  document?: any | null; // The business object formatted as a document for ML to ingest
549
635
  parentId?: string | null; // The business object that is the parent of this business object
550
- credential?: Credential; // Only sent for processing requests
551
636
 
552
637
  constructor(
553
638
  tenantIdCreated: string,
@@ -565,6 +650,7 @@ export class BusinessObject extends Block {
565
650
  this.processingStage = ProcessingStage.NotProcessed;
566
651
  this.processingAttempts = 0;
567
652
  this.dateProcessed = 0;
653
+ this.archived = false;
568
654
 
569
655
  this.provider = provider;
570
656
  this.application = application;
@@ -573,6 +659,9 @@ export class BusinessObject extends Block {
573
659
  }
574
660
  }
575
661
 
662
+ export const NoteQL = `
663
+ type Note { ${BlockFields}
664
+ }`;
576
665
  export class Note extends Block {
577
666
  constructor(
578
667
  tenantIdCreated: string,
@@ -581,6 +670,8 @@ export class Note extends Block {
581
670
  version: number
582
671
  ) {
583
672
  super(tenantIdCreated, editors, sharingTags, version, BlockType.Note);
673
+
674
+ this.archived = false;
584
675
  }
585
676
  }
586
677
 
@@ -588,6 +679,7 @@ export class Task extends Block {
588
679
  status: TaskStatus;
589
680
  dateDue: number;
590
681
  originNoteId: string;
682
+ snoozed: boolean;
591
683
  steps?: Step[];
592
684
  dateRemindMe?: number;
593
685
  recurrence?: RecurrenceRFC[];
@@ -605,6 +697,8 @@ export class Task extends Block {
605
697
  super(tenantIdCreated, editors, sharingTags, version, BlockType.Task);
606
698
 
607
699
  this.status = TaskStatus.NotStarted;
700
+ this.snoozed = false;
701
+ this.archived = false;
608
702
 
609
703
  this.originNoteId = originNoteId;
610
704
  this.dateDue = dateDue;
@@ -1027,3 +1121,17 @@ export class Table extends BusinessObject {
1027
1121
  //// FOR RECORDS END
1028
1122
 
1029
1123
  // METADATA OBJECTS END
1124
+
1125
+ export const GraphQLTypes = `
1126
+ ${EditorQL}
1127
+ ${SharingTagQL}
1128
+ ${ReactionSkinToneQL}
1129
+ ${ReactionQL}
1130
+ ${ProviderInfoQL}
1131
+ ${ProviderRequestQL}
1132
+ ${CredentialQL}
1133
+ ${ChangesQL}
1134
+ ${ConnectedProviderQL}
1135
+ ${TenantQL}
1136
+ ${NoteQL}
1137
+ `;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bigfoot",
3
3
  "name": "@bigfootai/bigfoot-types",
4
- "version": "2.11.4",
4
+ "version": "2.11.6",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",