@bigfootai/bigfoot-types 2.3.3 → 2.4.0

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 +6 -2
  2. package/model.ts +72 -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.Thread = exports.ExternalTask = exports.EventStatus = exports.Conference = exports.Task = exports.Block = exports.Note = exports.Person = exports.Domain = exports.Tenant = exports.BusinessObject = exports.Tag = exports.Primitive = exports.RecurrenceRFC = exports.InviteStatus = exports.SharingApproach = exports.StepStatus = exports.TaskStatus = exports.SharingLevel = 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.Person = exports.Domain = exports.Tenant = exports.BusinessObject = exports.Tag = exports.Primitive = 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
@@ -29,6 +29,11 @@ var TagType;
29
29
  TagType["Person"] = "person";
30
30
  TagType["Topic"] = "topic";
31
31
  })(TagType || (exports.TagType = TagType = {}));
32
+ var ClientType;
33
+ (function (ClientType) {
34
+ ClientType["Web"] = "web";
35
+ ClientType["Mobile"] = "mobile";
36
+ })(ClientType || (exports.ClientType = ClientType = {}));
32
37
  var SharingLevel;
33
38
  (function (SharingLevel) {
34
39
  SharingLevel[SharingLevel["ReadOnly"] = 0] = "ReadOnly";
@@ -50,7 +55,6 @@ var SharingApproach;
50
55
  (function (SharingApproach) {
51
56
  SharingApproach[SharingApproach["Inline"] = 0] = "Inline";
52
57
  SharingApproach[SharingApproach["Explicit"] = 1] = "Explicit";
53
- SharingApproach[SharingApproach["Automated"] = 2] = "Automated";
54
58
  })(SharingApproach || (exports.SharingApproach = SharingApproach = {}));
55
59
  var InviteStatus;
56
60
  (function (InviteStatus) {
package/model.ts CHANGED
@@ -82,16 +82,38 @@ export enum RecurrenceRFC {
82
82
  SUNDAY = 'SU',
83
83
  }
84
84
 
85
+ export enum DocumentType {
86
+ BlockQuote = 'blockquote',
87
+ Image = 'image',
88
+ Text = 'text',
89
+ Doc = 'doc',
90
+ Paragraph = 'paragraph',
91
+ HorizontalRule = 'horizontal_rule',
92
+ Heading = 'heading',
93
+ CodeBlock = 'code_block',
94
+ HardBreak = 'hard_break',
95
+ }
96
+
97
+ export enum MarkType {
98
+ Link = 'link',
99
+ }
100
+
85
101
  export interface Mark {
86
102
  type: string;
103
+ attrs?: Map<string, string>;
104
+ }
105
+
106
+ export interface Highlight {
107
+ indexStart: number;
108
+ indexEnd: number;
87
109
  }
88
110
 
89
111
  export interface Document {
90
- attrs: Map<string, string>;
91
- content: Document;
92
- text: string;
112
+ attrs?: Map<string, string>;
113
+ content?: Document[];
114
+ text?: string;
93
115
  type: string;
94
- marks: Mark[];
116
+ marks?: Mark[];
95
117
  }
96
118
 
97
119
  export interface Editor {
@@ -135,6 +157,19 @@ export interface Step {
135
157
  status: StepStatus;
136
158
  }
137
159
 
160
+ export interface DateEntry extends MachineLearningEntry {
161
+ dateStart: number;
162
+ dateEnd: number;
163
+ }
164
+
165
+ export interface EntityEntry extends MachineLearningEntry {
166
+ name: string;
167
+ }
168
+
169
+ export interface MachineLearningEntry {
170
+ highlights: Highlight[];
171
+ }
172
+
138
173
  export class Primitive {
139
174
  _id: string;
140
175
  dateCreated: number;
@@ -181,7 +216,7 @@ export class Tenant extends Primitive {
181
216
 
182
217
  export class Domain extends Primitive {
183
218
  domain: string;
184
- public: boolean;
219
+ isPublic: boolean;
185
220
  }
186
221
 
187
222
  export class Person extends Tag {
@@ -190,9 +225,24 @@ export class Person extends Tag {
190
225
  inviteStatus?: InviteStatus;
191
226
  }
192
227
 
228
+ export interface ReferenceNote {
229
+ id: string;
230
+ version: number;
231
+ text: string;
232
+ }
233
+
234
+ export class Article extends Primitive {
235
+ referenceNote: ReferenceNote;
236
+ dates?: DateEntry[];
237
+ locations?: EntityEntry[];
238
+ organizations?: EntityEntry[];
239
+ names?: EntityEntry[];
240
+ sentiments?: EntityEntry[];
241
+ }
242
+
193
243
  export class Note extends Primitive {
194
244
  tenantIdCreated: string; // The tenant._id that created the note initially
195
- document: Document;
245
+ document: string; // The note serialized as a JSON string
196
246
  editors: Editor[]; // The list of people/devices that were used in creating this note
197
247
  sharingTags: SharingTag[]; // The list of tags that this note is shared with
198
248
  _sharedTags?: string[]; // The list of tags that have sharing equal to true
@@ -207,9 +257,16 @@ export class Block extends Note {
207
257
  export class Task extends Block {
208
258
  status: TaskStatus;
209
259
  steps?: Step[];
210
- dateRemindMe?: Date;
211
- dateDue: Date;
260
+ dateRemindMe?: number;
261
+ dateDue: number;
212
262
  recurrence?: RecurrenceRFC[];
263
+
264
+ constructor() {
265
+ super();
266
+
267
+ this.blockType = BlockType.Task;
268
+ this.status = TaskStatus.NotStarted;
269
+ }
213
270
  }
214
271
  // CORE END
215
272
 
@@ -225,8 +282,8 @@ export interface TranscriptionEntry {
225
282
  person: Person;
226
283
  text: string;
227
284
  language: string;
228
- startDate: Date;
229
- endDate: Date;
285
+ startDate: number;
286
+ endDate: number;
230
287
  }
231
288
 
232
289
  export interface Transcription {
@@ -274,10 +331,10 @@ export interface Event extends BusinessObject {
274
331
  subject?: string;
275
332
  description?: string;
276
333
  location: string;
277
- startDate: Date;
278
- endDate?: Date;
334
+ startDate: number;
335
+ endDate?: number;
279
336
  recurrence: RecurrenceRFC[];
280
- originalStartDate: Date;
337
+ originalStartDate: number;
281
338
  organizedBy: Person;
282
339
  attendees?: PersonAcceptance[];
283
340
  conference?: Conference;
@@ -289,8 +346,8 @@ export interface Event extends BusinessObject {
289
346
  export class ExternalTask extends BusinessObject {
290
347
  status: TaskStatus;
291
348
  steps?: Step[];
292
- dateRemindMe?: Date;
293
- dateDue: Date;
349
+ dateRemindMe?: number;
350
+ dateDue: number;
294
351
  recurrence?: RecurrenceRFC[];
295
352
  }
296
353
  //// EXTERNAL TASK END
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bigfoot",
3
3
  "name": "@bigfootai/bigfoot-types",
4
- "version": "2.3.3",
4
+ "version": "2.4.0",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",