@bigfootai/bigfoot-types 2.6.4 → 2.6.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.
Files changed (3) hide show
  1. package/model.js +79 -13
  2. package/model.ts +248 -35
  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.EventStatus = exports.Conference = exports.Task = exports.Block = exports.Note = exports.Changes = exports.Article = exports.Person = exports.Domain = exports.Tenant = exports.ConnectedProvider = exports.ConnectedProviderRegistration = exports.BusinessObject = exports.Tag = exports.Provider = exports.Primitive = 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.Thread = exports.ExternalTask = exports.EventStatus = exports.Conference = exports.Task = exports.Block = exports.Note = exports.Article = exports.Person = exports.Domain = exports.Tenant = exports.BusinessObject = exports.Tag = exports.Provider = exports.Primitive = 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;
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
@@ -117,46 +117,94 @@ class Primitive {
117
117
  }
118
118
  exports.Primitive = Primitive;
119
119
  class Provider extends Primitive {
120
+ constructor(provider, name, description, instanceUrl, applications) {
121
+ super();
122
+ this.provider = provider;
123
+ this.name = name;
124
+ this.description = description;
125
+ this.instanceUrl = instanceUrl;
126
+ this.applications = applications;
127
+ }
120
128
  }
121
129
  exports.Provider = Provider;
122
130
  class Tag extends Primitive {
131
+ constructor(tenantIdCreated, alias, tagType) {
132
+ super();
133
+ this.tenantIdCreated = tenantIdCreated;
134
+ this.alias = alias;
135
+ this.tagType = tagType;
136
+ }
123
137
  }
124
138
  exports.Tag = Tag;
125
139
  class BusinessObject extends Primitive {
140
+ constructor(provider, uri, externalId, businessObjectType, externalResponse, document) {
141
+ super();
142
+ this.provider = provider;
143
+ this.uri = uri;
144
+ this.externalId = externalId;
145
+ this.businessObjectType = businessObjectType;
146
+ this.externalResponse = externalResponse;
147
+ this.document = document;
148
+ }
126
149
  }
127
150
  exports.BusinessObject = BusinessObject;
128
- class ConnectedProviderRegistration {
129
- }
130
- exports.ConnectedProviderRegistration = ConnectedProviderRegistration;
131
- class ConnectedProvider {
132
- }
133
- exports.ConnectedProvider = ConnectedProvider;
134
151
  class Tenant extends Primitive {
152
+ constructor(domainMemberships, email, emailVerified, domainIdEmail, tagId) {
153
+ super();
154
+ this.domainMemberships = domainMemberships;
155
+ this.email = email;
156
+ this.emailVerified = emailVerified;
157
+ this.domainIdEmail = domainIdEmail;
158
+ this.tagId = tagId;
159
+ }
135
160
  }
136
161
  exports.Tenant = Tenant;
137
162
  class Domain extends Primitive {
163
+ constructor(domain, isPublic) {
164
+ super();
165
+ this.domain = domain;
166
+ this.isPublic = isPublic;
167
+ }
138
168
  }
139
169
  exports.Domain = Domain;
140
170
  class Person extends Tag {
171
+ constructor(tenantIdCreated, alias, tagType, tenantIdVerified, email) {
172
+ super(tenantIdCreated, alias, tagType);
173
+ this.tenantIdVerified = tenantIdVerified;
174
+ this.email = email;
175
+ }
141
176
  }
142
177
  exports.Person = Person;
143
178
  class Article extends Primitive {
179
+ constructor(referenceNote) {
180
+ super();
181
+ this.referenceNote = referenceNote;
182
+ }
144
183
  }
145
184
  exports.Article = Article;
146
- class Changes {
147
- }
148
- exports.Changes = Changes;
149
185
  class Note extends Primitive {
186
+ constructor(tenantIdCreated, document, editors, sharingTags) {
187
+ super();
188
+ this.tenantIdCreated = tenantIdCreated;
189
+ this.document = document;
190
+ this.editors = editors;
191
+ this.sharingTags = sharingTags;
192
+ }
150
193
  }
151
194
  exports.Note = Note;
152
195
  class Block extends Note {
196
+ constructor(tenantIdCreated, document, editors, sharingTags, blockType, originNoteId) {
197
+ super(tenantIdCreated, document, editors, sharingTags);
198
+ this.blockType = blockType;
199
+ this.originNoteId = originNoteId;
200
+ }
153
201
  }
154
202
  exports.Block = Block;
155
203
  class Task extends Block {
156
- constructor() {
157
- super();
158
- this.blockType = BlockType.Task;
204
+ constructor(tenantIdCreated, document, editors, sharingTags, originNoteId, dateDue) {
205
+ super(tenantIdCreated, document, editors, sharingTags, BlockType.Task, originNoteId);
159
206
  this.status = TaskStatus.NotStarted;
207
+ this.dateDue = dateDue;
160
208
  }
161
209
  }
162
210
  exports.Task = Task;
@@ -174,14 +222,26 @@ var EventStatus;
174
222
  //// EVENT END
175
223
  //// EXTERNAL TASK START
176
224
  class ExternalTask extends BusinessObject {
225
+ constructor(provider, uri, externalId, businessObjectType, externalResponse, document, status, dateDue) {
226
+ super(provider, uri, externalId, businessObjectType, externalResponse, document);
227
+ this.status = status;
228
+ this.dateDue = dateDue;
229
+ }
177
230
  }
178
231
  exports.ExternalTask = ExternalTask;
179
232
  //// EXTERNAL TASK END
180
233
  //// MESSAGING START
181
234
  class Thread extends BusinessObject {
235
+ constructor(provider, uri, externalId, businessObjectType, externalResponse, document) {
236
+ super(provider, uri, externalId, businessObjectType, externalResponse, document);
237
+ }
182
238
  }
183
239
  exports.Thread = Thread;
184
240
  class Template extends BusinessObject {
241
+ constructor(provider, uri, externalId, businessObjectType, externalResponse, document, metadata) {
242
+ super(provider, uri, externalId, businessObjectType, externalResponse, document);
243
+ this.metadata = metadata;
244
+ }
185
245
  }
186
246
  exports.Template = Template;
187
247
  //// FOR DOCUMENTS END
@@ -205,6 +265,12 @@ var FieldVariation;
205
265
  FieldVariation["Url"] = "url";
206
266
  })(FieldVariation || (exports.FieldVariation = FieldVariation = {}));
207
267
  class Table extends BusinessObject {
268
+ constructor(provider, uri, externalId, businessObjectType, externalResponse, document, recordType, metadata, values) {
269
+ super(provider, uri, externalId, businessObjectType, externalResponse, document);
270
+ this.recordType = recordType;
271
+ this.metadata = metadata;
272
+ this.values = values;
273
+ }
208
274
  }
209
275
  exports.Table = Table;
210
276
  //// FOR RECORDS END
package/model.ts CHANGED
@@ -192,6 +192,38 @@ export interface Subscriptions {
192
192
  linkDomains: string[];
193
193
  }
194
194
 
195
+ export interface ConnectedProviderRegistration {
196
+ email: string;
197
+ profile: any;
198
+ accessToken: string;
199
+ refreshToken?: string;
200
+ instanceUrl?: string;
201
+ }
202
+
203
+ export interface ConnectedProvider {
204
+ providerId: string;
205
+ application: string;
206
+ bigfootAccessToken: string;
207
+ email?: string;
208
+ instanceUrl?: string;
209
+ profile?: any;
210
+ accessToken?: string;
211
+ refreshToken?: string;
212
+ dateCreated: number;
213
+ dateUpdated: number;
214
+ }
215
+
216
+ export interface ReferenceNote {
217
+ id: string;
218
+ version: number;
219
+ text: string;
220
+ }
221
+
222
+ export interface Changes {
223
+ steps: any[];
224
+ clientIds: string[];
225
+ }
226
+
195
227
  export class Primitive {
196
228
  _id: string;
197
229
  dateCreated: number;
@@ -212,6 +244,22 @@ export class Provider extends Primitive {
212
244
  description: string;
213
245
  instanceUrl: string;
214
246
  applications: any;
247
+
248
+ constructor(
249
+ provider: string,
250
+ name: string,
251
+ description: string,
252
+ instanceUrl: string,
253
+ applications: any
254
+ ) {
255
+ super();
256
+
257
+ this.provider = provider;
258
+ this.name = name;
259
+ this.description = description;
260
+ this.instanceUrl = instanceUrl;
261
+ this.applications = applications;
262
+ }
215
263
  }
216
264
 
217
265
  export class Tag extends Primitive {
@@ -221,6 +269,14 @@ export class Tag extends Primitive {
221
269
  sharingDomains?: SharingDomain[]; // The domains this tag is shared with plus domain settings for the tag
222
270
  sharingTenants?: SharingTenant[]; // The tenants this tag is shared with plus tenant settings for the tag
223
271
  tagType: TagType;
272
+
273
+ constructor(tenantIdCreated: string, alias: string, tagType: TagType) {
274
+ super();
275
+
276
+ this.tenantIdCreated = tenantIdCreated;
277
+ this.alias = alias;
278
+ this.tagType = tagType;
279
+ }
224
280
  }
225
281
 
226
282
  export class BusinessObject extends Primitive {
@@ -231,27 +287,24 @@ export class BusinessObject extends Primitive {
231
287
  businessObjectType: BusinessObjectType;
232
288
  externalResponse: string; // The full response from the external system that created this object
233
289
  document: Document; // The business object formatted as a document for ML to ingest
234
- }
235
290
 
236
- export class ConnectedProviderRegistration {
237
- email: string;
238
- profile: any;
239
- accessToken: string;
240
- refreshToken?: string;
241
- instanceUrl?: string;
242
- }
291
+ constructor(
292
+ provider: string,
293
+ uri: string,
294
+ externalId: string,
295
+ businessObjectType: BusinessObjectType,
296
+ externalResponse: string,
297
+ document: Document
298
+ ) {
299
+ super();
243
300
 
244
- export class ConnectedProvider {
245
- providerId: string;
246
- application: string;
247
- bigfootAccessToken: string;
248
- email?: string;
249
- instanceUrl?: string;
250
- profile?: any;
251
- accessToken?: string;
252
- refreshToken?: string;
253
- dateCreated: number;
254
- dateUpdated: number;
301
+ this.provider = provider;
302
+ this.uri = uri;
303
+ this.externalId = externalId;
304
+ this.businessObjectType = businessObjectType;
305
+ this.externalResponse = externalResponse;
306
+ this.document = document;
307
+ }
255
308
  }
256
309
 
257
310
  export class Tenant extends Primitive {
@@ -264,23 +317,53 @@ export class Tenant extends Primitive {
264
317
  familyName?: string;
265
318
  givenName?: string;
266
319
  connectedProviders?: ConnectedProvider[];
320
+
321
+ constructor(
322
+ domainMemberships: string[],
323
+ email: string,
324
+ emailVerified: boolean,
325
+ domainIdEmail: string,
326
+ tagId: string
327
+ ) {
328
+ super();
329
+
330
+ this.domainMemberships = domainMemberships;
331
+ this.email = email;
332
+ this.emailVerified = emailVerified;
333
+ this.domainIdEmail = domainIdEmail;
334
+ this.tagId = tagId;
335
+ }
267
336
  }
268
337
 
269
338
  export class Domain extends Primitive {
270
339
  domain: string;
271
340
  isPublic: boolean;
341
+
342
+ constructor(domain: string, isPublic: boolean) {
343
+ super();
344
+
345
+ this.domain = domain;
346
+ this.isPublic = isPublic;
347
+ }
272
348
  }
273
349
 
274
350
  export class Person extends Tag {
275
351
  tenantIdVerified: string; // The tenant._id that claimed/verified this tag as being them
276
352
  email: string;
277
353
  inviteStatus?: InviteStatus;
278
- }
279
354
 
280
- export interface ReferenceNote {
281
- id: string;
282
- version: number;
283
- text: string;
355
+ constructor(
356
+ tenantIdCreated: string,
357
+ alias: string,
358
+ tagType: TagType,
359
+ tenantIdVerified: string,
360
+ email: string
361
+ ) {
362
+ super(tenantIdCreated, alias, tagType);
363
+
364
+ this.tenantIdVerified = tenantIdVerified;
365
+ this.email = email;
366
+ }
284
367
  }
285
368
 
286
369
  export class Article extends Primitive {
@@ -290,42 +373,85 @@ export class Article extends Primitive {
290
373
  organizations?: EntityEntry[];
291
374
  names?: EntityEntry[];
292
375
  sentiments?: EntityEntry[];
293
- }
294
376
 
295
- export class Changes {
296
- steps: any[];
297
- clientIds: string[];
377
+ constructor(referenceNote: ReferenceNote) {
378
+ super();
379
+
380
+ this.referenceNote = referenceNote;
381
+ }
298
382
  }
299
383
 
300
384
  export class Note extends Primitive {
301
385
  tenantIdCreated: string;
302
386
  document: string;
303
- changes?: Changes;
304
387
  editors: Editor[];
305
388
  sharingTags: SharingTag[];
389
+ changes?: Changes;
306
390
  _sharedTags?: string[];
307
391
  reactions?: Reaction[];
308
392
  linkUrls?: string[];
309
393
  version: number;
394
+
395
+ constructor(
396
+ tenantIdCreated: string,
397
+ document: string,
398
+ editors: Editor[],
399
+ sharingTags: SharingTag[]
400
+ ) {
401
+ super();
402
+
403
+ this.tenantIdCreated = tenantIdCreated;
404
+ this.document = document;
405
+ this.editors = editors;
406
+ this.sharingTags = sharingTags;
407
+ }
310
408
  }
311
409
 
312
410
  export class Block extends Note {
313
411
  blockType: BlockType;
314
412
  originNoteId: string;
413
+
414
+ constructor(
415
+ tenantIdCreated: string,
416
+ document: string,
417
+ editors: Editor[],
418
+ sharingTags: SharingTag[],
419
+ blockType: BlockType,
420
+ originNoteId: string
421
+ ) {
422
+ super(tenantIdCreated, document, editors, sharingTags);
423
+
424
+ this.blockType = blockType;
425
+ this.originNoteId = originNoteId;
426
+ }
315
427
  }
316
428
 
317
429
  export class Task extends Block {
318
430
  status: TaskStatus;
431
+ dateDue: number;
319
432
  steps?: Step[];
320
433
  dateRemindMe?: number;
321
- dateDue: number;
322
434
  recurrence?: RecurrenceRFC[];
323
435
 
324
- constructor() {
325
- super();
436
+ constructor(
437
+ tenantIdCreated: string,
438
+ document: string,
439
+ editors: Editor[],
440
+ sharingTags: SharingTag[],
441
+ originNoteId: string,
442
+ dateDue: number
443
+ ) {
444
+ super(
445
+ tenantIdCreated,
446
+ document,
447
+ editors,
448
+ sharingTags,
449
+ BlockType.Task,
450
+ originNoteId
451
+ );
326
452
 
327
- this.blockType = BlockType.Task;
328
453
  this.status = TaskStatus.NotStarted;
454
+ this.dateDue = dateDue;
329
455
  }
330
456
  }
331
457
  // CORE END
@@ -405,15 +531,56 @@ export interface Event extends BusinessObject {
405
531
  //// EXTERNAL TASK START
406
532
  export class ExternalTask extends BusinessObject {
407
533
  status: TaskStatus;
534
+ dateDue: number;
408
535
  steps?: Step[];
409
536
  dateRemindMe?: number;
410
- dateDue: number;
411
537
  recurrence?: RecurrenceRFC[];
538
+
539
+ constructor(
540
+ provider: string,
541
+ uri: string,
542
+ externalId: string,
543
+ businessObjectType: BusinessObjectType,
544
+ externalResponse: string,
545
+ document: Document,
546
+ status: TaskStatus,
547
+ dateDue: number
548
+ ) {
549
+ super(
550
+ provider,
551
+ uri,
552
+ externalId,
553
+ businessObjectType,
554
+ externalResponse,
555
+ document
556
+ );
557
+
558
+ this.status = status;
559
+ this.dateDue = dateDue;
560
+ }
412
561
  }
413
562
  //// EXTERNAL TASK END
414
563
 
415
564
  //// MESSAGING START
416
- export class Thread extends BusinessObject {}
565
+ export class Thread extends BusinessObject {
566
+ constructor(
567
+ provider: string,
568
+ uri: string,
569
+ externalId: string,
570
+ businessObjectType: BusinessObjectType,
571
+ externalResponse: string,
572
+ document: Document
573
+ ) {
574
+ super(
575
+ provider,
576
+ uri,
577
+ externalId,
578
+ businessObjectType,
579
+ externalResponse,
580
+ document
581
+ );
582
+ }
583
+ }
417
584
  //// MESSAGING END
418
585
 
419
586
  //// WEBSITE START
@@ -438,6 +605,27 @@ export interface DocumentMetadata {
438
605
 
439
606
  export class Template extends BusinessObject {
440
607
  metadata: DocumentMetadata;
608
+
609
+ constructor(
610
+ provider: string,
611
+ uri: string,
612
+ externalId: string,
613
+ businessObjectType: BusinessObjectType,
614
+ externalResponse: string,
615
+ document: Document,
616
+ metadata: DocumentMetadata
617
+ ) {
618
+ super(
619
+ provider,
620
+ uri,
621
+ externalId,
622
+ businessObjectType,
623
+ externalResponse,
624
+ document
625
+ );
626
+
627
+ this.metadata = metadata;
628
+ }
441
629
  }
442
630
  //// FOR DOCUMENTS END
443
631
 
@@ -497,6 +685,31 @@ export class Table extends BusinessObject {
497
685
  recordType: string;
498
686
  metadata: TableMetadata;
499
687
  values: FieldValue[];
688
+
689
+ constructor(
690
+ provider: string,
691
+ uri: string,
692
+ externalId: string,
693
+ businessObjectType: BusinessObjectType,
694
+ externalResponse: string,
695
+ document: Document,
696
+ recordType: string,
697
+ metadata: TableMetadata,
698
+ values: FieldValue[]
699
+ ) {
700
+ super(
701
+ provider,
702
+ uri,
703
+ externalId,
704
+ businessObjectType,
705
+ externalResponse,
706
+ document
707
+ );
708
+
709
+ this.recordType = recordType;
710
+ this.metadata = metadata;
711
+ this.values = values;
712
+ }
500
713
  }
501
714
  //// FOR RECORDS END
502
715
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bigfoot",
3
3
  "name": "@bigfootai/bigfoot-types",
4
- "version": "2.6.4",
4
+ "version": "2.6.5",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",