@bigfootai/bigfoot-types 2.11.3 → 2.11.5
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.
- package/model.js +70 -8
- package/model.ts +76 -15
- 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.Todo = exports.Event = exports.Calendar = exports.ResponseStatus = exports.EventStatus = exports.Conference = exports.Task = exports.Note = exports.BusinessObject = exports.
|
|
3
|
+
exports.GraphQLTypes = 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.TenantFields = exports.Tag = exports.Provider = exports.Sync = exports.Primitive = exports.PrimitiveFields = exports.ConnectedProviderFields = exports.CredentialFields = exports.ProviderRequestFields = exports.ProviderInfoFields = 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
|
|
@@ -176,6 +176,39 @@ var RelationType;
|
|
|
176
176
|
RelationType["SpouseOf"] = "spouseOf";
|
|
177
177
|
RelationType["SubsidiaryOf"] = "subsidiaryOf";
|
|
178
178
|
})(RelationType || (exports.RelationType = RelationType = {}));
|
|
179
|
+
exports.ProviderInfoFields = `
|
|
180
|
+
type ProviderInfo {
|
|
181
|
+
provider: String!
|
|
182
|
+
application: String!
|
|
183
|
+
}`;
|
|
184
|
+
exports.ProviderRequestFields = `
|
|
185
|
+
type ProviderRequest {
|
|
186
|
+
providerInfo: ID!
|
|
187
|
+
connectionId: String!
|
|
188
|
+
}`;
|
|
189
|
+
exports.CredentialFields = `
|
|
190
|
+
type Credential {
|
|
191
|
+
email: String!
|
|
192
|
+
profile: String!
|
|
193
|
+
accessToken: String!
|
|
194
|
+
refreshToken: String
|
|
195
|
+
instanceUrl: String
|
|
196
|
+
dateExpiry: Float
|
|
197
|
+
}`;
|
|
198
|
+
exports.ConnectedProviderFields = `
|
|
199
|
+
type ConnectedProvider {
|
|
200
|
+
providerId: String!
|
|
201
|
+
connectionId: String!
|
|
202
|
+
application: String!
|
|
203
|
+
credential: Credential
|
|
204
|
+
dateCreated: Float
|
|
205
|
+
dateUpdated: Float
|
|
206
|
+
}`;
|
|
207
|
+
exports.PrimitiveFields = `
|
|
208
|
+
_id: ID!
|
|
209
|
+
dateCreated: Float!
|
|
210
|
+
dateUpdated: Float!
|
|
211
|
+
tenantIdCreated: String`;
|
|
179
212
|
class Primitive {
|
|
180
213
|
constructor() {
|
|
181
214
|
this._id = (0, uuid_1.v4)();
|
|
@@ -213,6 +246,19 @@ class Tag extends Primitive {
|
|
|
213
246
|
}
|
|
214
247
|
}
|
|
215
248
|
exports.Tag = Tag;
|
|
249
|
+
exports.TenantFields = `
|
|
250
|
+
type Tenant { ${exports.PrimitiveFields}
|
|
251
|
+
domainMemberships: [String]!
|
|
252
|
+
email: String!
|
|
253
|
+
emailVerified: Boolean!
|
|
254
|
+
domainIdEmail: String!
|
|
255
|
+
tagId: String!
|
|
256
|
+
picture: String
|
|
257
|
+
familyName: String
|
|
258
|
+
givenName: String
|
|
259
|
+
connectedProviders: [ConnectedProvider]
|
|
260
|
+
}
|
|
261
|
+
`;
|
|
216
262
|
class Tenant extends Primitive {
|
|
217
263
|
constructor(domainMemberships, email, emailVerified, domainIdEmail, tagId) {
|
|
218
264
|
super();
|
|
@@ -256,24 +302,30 @@ class Block extends Primitive {
|
|
|
256
302
|
this.version = version;
|
|
257
303
|
this.blockType = blockType;
|
|
258
304
|
this.archived = false;
|
|
305
|
+
this._ignoreUpdate = false;
|
|
259
306
|
}
|
|
260
307
|
}
|
|
261
308
|
exports.Block = Block;
|
|
262
|
-
class
|
|
263
|
-
constructor(
|
|
264
|
-
|
|
265
|
-
this.processingStage = ProcessingStage.NotProcessed;
|
|
266
|
-
this.processingAttempts = 0;
|
|
267
|
-
this.dateProcessed = 0;
|
|
309
|
+
class BlockProcessingRequest {
|
|
310
|
+
constructor(block) {
|
|
311
|
+
this.block = block;
|
|
268
312
|
}
|
|
269
313
|
}
|
|
270
|
-
exports.
|
|
314
|
+
exports.BlockProcessingRequest = BlockProcessingRequest;
|
|
315
|
+
class BlockProcessingResponse {
|
|
316
|
+
constructor(block, article) {
|
|
317
|
+
this.block = block;
|
|
318
|
+
this.article = article;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
exports.BlockProcessingResponse = BlockProcessingResponse;
|
|
271
322
|
class BusinessObject extends Block {
|
|
272
323
|
constructor(tenantIdCreated, editors, sharingTags, version, blockType, provider, application, uri, externalId) {
|
|
273
324
|
super(tenantIdCreated, editors, sharingTags, version, blockType);
|
|
274
325
|
this.processingStage = ProcessingStage.NotProcessed;
|
|
275
326
|
this.processingAttempts = 0;
|
|
276
327
|
this.dateProcessed = 0;
|
|
328
|
+
this.archived = false;
|
|
277
329
|
this.provider = provider;
|
|
278
330
|
this.application = application;
|
|
279
331
|
this.uri = uri;
|
|
@@ -284,6 +336,7 @@ exports.BusinessObject = BusinessObject;
|
|
|
284
336
|
class Note extends Block {
|
|
285
337
|
constructor(tenantIdCreated, editors, sharingTags, version) {
|
|
286
338
|
super(tenantIdCreated, editors, sharingTags, version, BlockType.Note);
|
|
339
|
+
this.archived = false;
|
|
287
340
|
}
|
|
288
341
|
}
|
|
289
342
|
exports.Note = Note;
|
|
@@ -291,6 +344,8 @@ class Task extends Block {
|
|
|
291
344
|
constructor(tenantIdCreated, editors, sharingTags, version, originNoteId, dateDue) {
|
|
292
345
|
super(tenantIdCreated, editors, sharingTags, version, BlockType.Task);
|
|
293
346
|
this.status = TaskStatus.NotStarted;
|
|
347
|
+
this.snoozed = false;
|
|
348
|
+
this.archived = false;
|
|
294
349
|
this.originNoteId = originNoteId;
|
|
295
350
|
this.dateDue = dateDue;
|
|
296
351
|
}
|
|
@@ -399,3 +454,10 @@ class Table extends BusinessObject {
|
|
|
399
454
|
exports.Table = Table;
|
|
400
455
|
//// FOR RECORDS END
|
|
401
456
|
// METADATA OBJECTS END
|
|
457
|
+
exports.GraphQLTypes = `
|
|
458
|
+
${exports.ProviderInfoFields}
|
|
459
|
+
${exports.ProviderRequestFields}
|
|
460
|
+
${exports.CredentialFields}
|
|
461
|
+
${exports.ConnectedProviderFields}
|
|
462
|
+
${exports.TenantFields}
|
|
463
|
+
`;
|
package/model.ts
CHANGED
|
@@ -275,11 +275,21 @@ export interface MachineLearningEntry {
|
|
|
275
275
|
highlights?: Highlight[];
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
export const ProviderInfoFields = `
|
|
279
|
+
type ProviderInfo {
|
|
280
|
+
provider: String!
|
|
281
|
+
application: String!
|
|
282
|
+
}`;
|
|
278
283
|
export interface ProviderInfo {
|
|
279
284
|
provider: string;
|
|
280
285
|
application: string;
|
|
281
286
|
}
|
|
282
287
|
|
|
288
|
+
export const ProviderRequestFields = `
|
|
289
|
+
type ProviderRequest {
|
|
290
|
+
providerInfo: ID!
|
|
291
|
+
connectionId: String!
|
|
292
|
+
}`;
|
|
283
293
|
export interface ProviderRequest {
|
|
284
294
|
providerInfo: ProviderInfo;
|
|
285
295
|
connectionId: string;
|
|
@@ -299,6 +309,15 @@ export interface Subscriptions {
|
|
|
299
309
|
linkDomains: string[];
|
|
300
310
|
}
|
|
301
311
|
|
|
312
|
+
export const CredentialFields = `
|
|
313
|
+
type Credential {
|
|
314
|
+
email: String!
|
|
315
|
+
profile: String!
|
|
316
|
+
accessToken: String!
|
|
317
|
+
refreshToken: String
|
|
318
|
+
instanceUrl: String
|
|
319
|
+
dateExpiry: Float
|
|
320
|
+
}`;
|
|
302
321
|
export interface Credential {
|
|
303
322
|
email: string;
|
|
304
323
|
profile: any;
|
|
@@ -313,6 +332,15 @@ export interface ConnectedProviderRegistration {
|
|
|
313
332
|
credential: Credential;
|
|
314
333
|
}
|
|
315
334
|
|
|
335
|
+
export const ConnectedProviderFields = `
|
|
336
|
+
type ConnectedProvider {
|
|
337
|
+
providerId: String!
|
|
338
|
+
connectionId: String!
|
|
339
|
+
application: String!
|
|
340
|
+
credential: Credential
|
|
341
|
+
dateCreated: Float
|
|
342
|
+
dateUpdated: Float
|
|
343
|
+
}`;
|
|
316
344
|
export interface ConnectedProvider {
|
|
317
345
|
providerId: string;
|
|
318
346
|
connectionId: string;
|
|
@@ -337,6 +365,11 @@ export interface PersonReference {
|
|
|
337
365
|
email: string;
|
|
338
366
|
}
|
|
339
367
|
|
|
368
|
+
export const PrimitiveFields = `
|
|
369
|
+
_id: ID!
|
|
370
|
+
dateCreated: Float!
|
|
371
|
+
dateUpdated: Float!
|
|
372
|
+
tenantIdCreated: String`;
|
|
340
373
|
export class Primitive {
|
|
341
374
|
_id: string;
|
|
342
375
|
dateCreated: number;
|
|
@@ -403,6 +436,19 @@ export class Tag extends Primitive {
|
|
|
403
436
|
}
|
|
404
437
|
}
|
|
405
438
|
|
|
439
|
+
export const TenantFields = `
|
|
440
|
+
type Tenant { ${PrimitiveFields}
|
|
441
|
+
domainMemberships: [String]!
|
|
442
|
+
email: String!
|
|
443
|
+
emailVerified: Boolean!
|
|
444
|
+
domainIdEmail: String!
|
|
445
|
+
tagId: String!
|
|
446
|
+
picture: String
|
|
447
|
+
familyName: String
|
|
448
|
+
givenName: String
|
|
449
|
+
connectedProviders: [ConnectedProvider]
|
|
450
|
+
}
|
|
451
|
+
`;
|
|
406
452
|
export class Tenant extends Primitive {
|
|
407
453
|
domainMemberships: string[]; // The list of all domains this tenant belongs
|
|
408
454
|
email: string;
|
|
@@ -463,7 +509,6 @@ export class Person extends Tag {
|
|
|
463
509
|
|
|
464
510
|
export class Article extends Primitive {
|
|
465
511
|
referenceBlock: ReferenceBlock;
|
|
466
|
-
document?: any;
|
|
467
512
|
changes?: Changes;
|
|
468
513
|
embedding?: any;
|
|
469
514
|
text?: string;
|
|
@@ -492,6 +537,7 @@ export class Block extends Primitive {
|
|
|
492
537
|
version: number;
|
|
493
538
|
blockType: BlockType;
|
|
494
539
|
archived: boolean;
|
|
540
|
+
_ignoreUpdate: boolean;
|
|
495
541
|
document?: any;
|
|
496
542
|
changes?: Changes;
|
|
497
543
|
_sharedTags?: string[];
|
|
@@ -513,24 +559,26 @@ export class Block extends Primitive {
|
|
|
513
559
|
this.blockType = blockType;
|
|
514
560
|
|
|
515
561
|
this.archived = false;
|
|
562
|
+
this._ignoreUpdate = false;
|
|
516
563
|
}
|
|
517
564
|
}
|
|
518
565
|
|
|
519
|
-
export class
|
|
520
|
-
|
|
521
|
-
|
|
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
|
|
566
|
+
export class BlockProcessingRequest {
|
|
567
|
+
block: Block;
|
|
568
|
+
credential?: Credential;
|
|
527
569
|
|
|
528
|
-
constructor(
|
|
529
|
-
|
|
570
|
+
constructor(block: Block) {
|
|
571
|
+
this.block = block;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
530
574
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
575
|
+
export class BlockProcessingResponse {
|
|
576
|
+
block: Block;
|
|
577
|
+
article: Article;
|
|
578
|
+
|
|
579
|
+
constructor(block: Block, article: Article) {
|
|
580
|
+
this.block = block;
|
|
581
|
+
this.article = article;
|
|
534
582
|
}
|
|
535
583
|
}
|
|
536
584
|
|
|
@@ -547,7 +595,6 @@ export class BusinessObject extends Block {
|
|
|
547
595
|
iconUrl?: string | null; // The url of an icon that represents the business object
|
|
548
596
|
document?: any | null; // The business object formatted as a document for ML to ingest
|
|
549
597
|
parentId?: string | null; // The business object that is the parent of this business object
|
|
550
|
-
credential?: Credential; // Only sent for processing requests
|
|
551
598
|
|
|
552
599
|
constructor(
|
|
553
600
|
tenantIdCreated: string,
|
|
@@ -565,6 +612,7 @@ export class BusinessObject extends Block {
|
|
|
565
612
|
this.processingStage = ProcessingStage.NotProcessed;
|
|
566
613
|
this.processingAttempts = 0;
|
|
567
614
|
this.dateProcessed = 0;
|
|
615
|
+
this.archived = false;
|
|
568
616
|
|
|
569
617
|
this.provider = provider;
|
|
570
618
|
this.application = application;
|
|
@@ -581,6 +629,8 @@ export class Note extends Block {
|
|
|
581
629
|
version: number
|
|
582
630
|
) {
|
|
583
631
|
super(tenantIdCreated, editors, sharingTags, version, BlockType.Note);
|
|
632
|
+
|
|
633
|
+
this.archived = false;
|
|
584
634
|
}
|
|
585
635
|
}
|
|
586
636
|
|
|
@@ -588,6 +638,7 @@ export class Task extends Block {
|
|
|
588
638
|
status: TaskStatus;
|
|
589
639
|
dateDue: number;
|
|
590
640
|
originNoteId: string;
|
|
641
|
+
snoozed: boolean;
|
|
591
642
|
steps?: Step[];
|
|
592
643
|
dateRemindMe?: number;
|
|
593
644
|
recurrence?: RecurrenceRFC[];
|
|
@@ -605,6 +656,8 @@ export class Task extends Block {
|
|
|
605
656
|
super(tenantIdCreated, editors, sharingTags, version, BlockType.Task);
|
|
606
657
|
|
|
607
658
|
this.status = TaskStatus.NotStarted;
|
|
659
|
+
this.snoozed = false;
|
|
660
|
+
this.archived = false;
|
|
608
661
|
|
|
609
662
|
this.originNoteId = originNoteId;
|
|
610
663
|
this.dateDue = dateDue;
|
|
@@ -1027,3 +1080,11 @@ export class Table extends BusinessObject {
|
|
|
1027
1080
|
//// FOR RECORDS END
|
|
1028
1081
|
|
|
1029
1082
|
// METADATA OBJECTS END
|
|
1083
|
+
|
|
1084
|
+
export const GraphQLTypes = `
|
|
1085
|
+
${ProviderInfoFields}
|
|
1086
|
+
${ProviderRequestFields}
|
|
1087
|
+
${CredentialFields}
|
|
1088
|
+
${ConnectedProviderFields}
|
|
1089
|
+
${TenantFields}
|
|
1090
|
+
`;
|