@bigfootai/bigfoot-types 2.1.0 → 2.3.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.
- package/README.md +1 -51
- package/model.js +164 -0
- package/model.ts +1 -2
- package/package.json +6 -3
- package/tsconfig.json +3 -6
package/README.md
CHANGED
|
@@ -1,51 +1 @@
|
|
|
1
|
-
|
|
2
|
-
https://dev.to/stanbar/writing-mongo-realm-serverless-functions-in-typescript-5fdo
|
|
3
|
-
|
|
4
|
-
Need to set up API key for Auth0
|
|
5
|
-
|
|
6
|
-
Adding environment variables to atlas.d.ts
|
|
7
|
-
|
|
8
|
-
brew install curl
|
|
9
|
-
Get the domain from here: https://manage.auth0.com/dashboard/us/dev-h40ievkvqezopsav/tenant/admins (it's bolded at the top of the page in the intro content)
|
|
10
|
-
curl -s https://dev-h40ievkvqezopsav.us.auth0.com/pem | openssl x509 -pubkey -noout
|
|
11
|
-
Paste the contents into the Public Key (Secret Name) in the Custom JWT authentication provider
|
|
12
|
-
|
|
13
|
-
You need to get an example req.oidc.idToken from index.mjs in the server part of the bigfoot project
|
|
14
|
-
Past that into this tool: https://jwt.io/#debugger-io
|
|
15
|
-
Note down the "aud" property
|
|
16
|
-
Put the value of that in the Audience (Optional) in the authentication provider config
|
|
17
|
-
|
|
18
|
-
Auth0 stuff:
|
|
19
|
-
Dev
|
|
20
|
-
AUTH0_API_KEY: GCVzRnhjtBIAg0493d4v3yWCkRirft12s1BQAcHzkkcaPFKxUD9sWYeeYpYMG8sZ
|
|
21
|
-
AUTH0_HANDLER_ENDPOINT: https://us-east-1.aws.data.mongodb-api.com/app/bigfootbackend-xblwe/endpoint/api/v1/tenant/auth
|
|
22
|
-
|
|
23
|
-
Staging
|
|
24
|
-
AUTH0_API_KEY: ADXtN68db1do3ApsdyR5EfSkLnIL2hx6NuIJEeGYB0kNlIuyKjtgeAYPIqmGyat4
|
|
25
|
-
AUTH0_HANDLER_ENDPOINT: https://us-east-1.aws.data.mongodb-api.com/app/bigfootbackend-wstbt/endpoint/api/v1/tenant/auth
|
|
26
|
-
|
|
27
|
-
Production
|
|
28
|
-
AUTH0_API_KEY: 2OYocp1S6fIvSW3S8jQPd4iDhd8Q6syV8WqokemoKhilTn1FKix0om7Ctm0SqAH4
|
|
29
|
-
AUTH0_HANDLER_ENDPOINT: https://us-east-1.aws.data.mongodb-api.com/app/bigfootbackend-gxuab/endpoint/api/v1/tenant/auth
|
|
30
|
-
|
|
31
|
-
You need to set up the authentication stuff manually despite being in the deployment configuration...
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
"collection": "notes",
|
|
35
|
-
"database": "bigfoot-dev",
|
|
36
|
-
"filters": [
|
|
37
|
-
{
|
|
38
|
-
"name": "filterDocumentsForTenant",
|
|
39
|
-
"query": {
|
|
40
|
-
"%function": {
|
|
41
|
-
"name": "filterDocumentsForTenant"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"apply_when": {
|
|
45
|
-
"%%user.data": {
|
|
46
|
-
"%exists": "%%true"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
1
|
+
Nothing to see here
|
package/model.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
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;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
/*
|
|
6
|
+
These are the core primitives of our model. These represent the entities that show
|
|
7
|
+
up in our Graph QL CRUD operations and set out the fundamental building blocks of
|
|
8
|
+
the platform.
|
|
9
|
+
*/
|
|
10
|
+
// CORE START
|
|
11
|
+
var BusinessObjectType;
|
|
12
|
+
(function (BusinessObjectType) {
|
|
13
|
+
BusinessObjectType["Event"] = "event";
|
|
14
|
+
BusinessObjectType["Task"] = "task";
|
|
15
|
+
BusinessObjectType["Document"] = "document";
|
|
16
|
+
BusinessObjectType["Record"] = "record";
|
|
17
|
+
BusinessObjectType["Conference"] = "conference";
|
|
18
|
+
BusinessObjectType["Message"] = "message";
|
|
19
|
+
BusinessObjectType["Website"] = "website";
|
|
20
|
+
})(BusinessObjectType || (exports.BusinessObjectType = BusinessObjectType = {}));
|
|
21
|
+
var BlockType;
|
|
22
|
+
(function (BlockType) {
|
|
23
|
+
BlockType["Section"] = "section";
|
|
24
|
+
BlockType["Task"] = "task";
|
|
25
|
+
BlockType["Data"] = "data";
|
|
26
|
+
})(BlockType || (exports.BlockType = BlockType = {}));
|
|
27
|
+
var TagType;
|
|
28
|
+
(function (TagType) {
|
|
29
|
+
TagType["Person"] = "person";
|
|
30
|
+
TagType["Topic"] = "topic";
|
|
31
|
+
})(TagType || (exports.TagType = TagType = {}));
|
|
32
|
+
var SharingLevel;
|
|
33
|
+
(function (SharingLevel) {
|
|
34
|
+
SharingLevel[SharingLevel["ReadOnly"] = 0] = "ReadOnly";
|
|
35
|
+
SharingLevel[SharingLevel["Editor"] = 1] = "Editor";
|
|
36
|
+
SharingLevel[SharingLevel["Owner"] = 2] = "Owner";
|
|
37
|
+
})(SharingLevel || (exports.SharingLevel = SharingLevel = {}));
|
|
38
|
+
var TaskStatus;
|
|
39
|
+
(function (TaskStatus) {
|
|
40
|
+
TaskStatus[TaskStatus["NotStarted"] = 0] = "NotStarted";
|
|
41
|
+
TaskStatus[TaskStatus["InProgress"] = 1] = "InProgress";
|
|
42
|
+
TaskStatus[TaskStatus["Completed"] = 10] = "Completed";
|
|
43
|
+
})(TaskStatus || (exports.TaskStatus = TaskStatus = {}));
|
|
44
|
+
var StepStatus;
|
|
45
|
+
(function (StepStatus) {
|
|
46
|
+
StepStatus[StepStatus["NotStarted"] = 0] = "NotStarted";
|
|
47
|
+
StepStatus[StepStatus["Completed"] = 10] = "Completed";
|
|
48
|
+
})(StepStatus || (exports.StepStatus = StepStatus = {}));
|
|
49
|
+
var SharingApproach;
|
|
50
|
+
(function (SharingApproach) {
|
|
51
|
+
SharingApproach[SharingApproach["Inline"] = 0] = "Inline";
|
|
52
|
+
SharingApproach[SharingApproach["Explicit"] = 1] = "Explicit";
|
|
53
|
+
SharingApproach[SharingApproach["Automated"] = 2] = "Automated";
|
|
54
|
+
})(SharingApproach || (exports.SharingApproach = SharingApproach = {}));
|
|
55
|
+
var InviteStatus;
|
|
56
|
+
(function (InviteStatus) {
|
|
57
|
+
InviteStatus[InviteStatus["NotInvited"] = 0] = "NotInvited";
|
|
58
|
+
InviteStatus[InviteStatus["InviteSent"] = 1] = "InviteSent";
|
|
59
|
+
InviteStatus[InviteStatus["InviteAccepted"] = 2] = "InviteAccepted";
|
|
60
|
+
})(InviteStatus || (exports.InviteStatus = InviteStatus = {}));
|
|
61
|
+
var RecurrenceRFC;
|
|
62
|
+
(function (RecurrenceRFC) {
|
|
63
|
+
RecurrenceRFC["FREQ"] = "FREQ";
|
|
64
|
+
RecurrenceRFC["UNTIL"] = "UNTIL";
|
|
65
|
+
RecurrenceRFC["COUNT"] = "COUNT";
|
|
66
|
+
RecurrenceRFC["INTERVAL"] = "INTERVAL";
|
|
67
|
+
RecurrenceRFC["BYDAY"] = "BYDAY";
|
|
68
|
+
RecurrenceRFC["BYMONTH"] = "BYMONTH";
|
|
69
|
+
RecurrenceRFC["BYMONTHDAY"] = "BYMONTHDAY";
|
|
70
|
+
RecurrenceRFC["BYYEARDAY"] = "BYYEARDAY";
|
|
71
|
+
RecurrenceRFC["BYWEEKNO"] = "BYWEEKNO";
|
|
72
|
+
RecurrenceRFC["BYHOUR"] = "BYHOUR";
|
|
73
|
+
RecurrenceRFC["BYMINUTE"] = "BYMINUTE";
|
|
74
|
+
RecurrenceRFC["BYSECOND"] = "BYSECOND";
|
|
75
|
+
RecurrenceRFC["MONDAY"] = "MO";
|
|
76
|
+
RecurrenceRFC["TUESDAY"] = "TU";
|
|
77
|
+
RecurrenceRFC["WEDNESDAY"] = "WE";
|
|
78
|
+
RecurrenceRFC["THURSDAY"] = "TH";
|
|
79
|
+
RecurrenceRFC["FRIDAY"] = "FR";
|
|
80
|
+
RecurrenceRFC["SATURDAY"] = "SA";
|
|
81
|
+
RecurrenceRFC["SUNDAY"] = "SU";
|
|
82
|
+
})(RecurrenceRFC || (exports.RecurrenceRFC = RecurrenceRFC = {}));
|
|
83
|
+
class Primitive {
|
|
84
|
+
constructor() {
|
|
85
|
+
this._id = (0, uuid_1.v4)();
|
|
86
|
+
const now = Date.now();
|
|
87
|
+
this.dateCreated = now;
|
|
88
|
+
this.dateUpdated = now;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.Primitive = Primitive;
|
|
92
|
+
class Tag extends Primitive {
|
|
93
|
+
}
|
|
94
|
+
exports.Tag = Tag;
|
|
95
|
+
class BusinessObject extends Primitive {
|
|
96
|
+
}
|
|
97
|
+
exports.BusinessObject = BusinessObject;
|
|
98
|
+
class Tenant extends Primitive {
|
|
99
|
+
}
|
|
100
|
+
exports.Tenant = Tenant;
|
|
101
|
+
class Domain extends Primitive {
|
|
102
|
+
}
|
|
103
|
+
exports.Domain = Domain;
|
|
104
|
+
class Person extends Tag {
|
|
105
|
+
}
|
|
106
|
+
exports.Person = Person;
|
|
107
|
+
class Note extends Primitive {
|
|
108
|
+
}
|
|
109
|
+
exports.Note = Note;
|
|
110
|
+
class Block extends Note {
|
|
111
|
+
}
|
|
112
|
+
exports.Block = Block;
|
|
113
|
+
class Task extends Block {
|
|
114
|
+
}
|
|
115
|
+
exports.Task = Task;
|
|
116
|
+
class Conference extends BusinessObject {
|
|
117
|
+
}
|
|
118
|
+
exports.Conference = Conference;
|
|
119
|
+
//// CONFERENCE END
|
|
120
|
+
//// EVENT START
|
|
121
|
+
var EventStatus;
|
|
122
|
+
(function (EventStatus) {
|
|
123
|
+
EventStatus["Confirmed"] = "confirmed";
|
|
124
|
+
EventStatus["Tentative"] = "tentative";
|
|
125
|
+
EventStatus["Cancelled"] = "cancelled";
|
|
126
|
+
})(EventStatus || (exports.EventStatus = EventStatus = {}));
|
|
127
|
+
//// EVENT END
|
|
128
|
+
//// EXTERNAL TASK START
|
|
129
|
+
class ExternalTask extends BusinessObject {
|
|
130
|
+
}
|
|
131
|
+
exports.ExternalTask = ExternalTask;
|
|
132
|
+
//// EXTERNAL TASK END
|
|
133
|
+
//// MESSAGING START
|
|
134
|
+
class Thread extends BusinessObject {
|
|
135
|
+
}
|
|
136
|
+
exports.Thread = Thread;
|
|
137
|
+
class Template extends BusinessObject {
|
|
138
|
+
}
|
|
139
|
+
exports.Template = Template;
|
|
140
|
+
//// FOR DOCUMENTS END
|
|
141
|
+
//// FOR RECORDS START
|
|
142
|
+
var FieldType;
|
|
143
|
+
(function (FieldType) {
|
|
144
|
+
FieldType["Text"] = "input";
|
|
145
|
+
FieldType["Select"] = "select";
|
|
146
|
+
FieldType["Checkbox"] = "checkbox";
|
|
147
|
+
FieldType["Identifier"] = "identifier";
|
|
148
|
+
})(FieldType || (exports.FieldType = FieldType = {}));
|
|
149
|
+
var FieldVariation;
|
|
150
|
+
(function (FieldVariation) {
|
|
151
|
+
FieldVariation["Multi"] = "multi";
|
|
152
|
+
FieldVariation["Password"] = "password";
|
|
153
|
+
FieldVariation["Email"] = "email";
|
|
154
|
+
FieldVariation["Date"] = "date";
|
|
155
|
+
FieldVariation["Currency"] = "currency";
|
|
156
|
+
FieldVariation["DateTime"] = "datetime";
|
|
157
|
+
FieldVariation["Phone"] = "phone";
|
|
158
|
+
FieldVariation["Url"] = "url";
|
|
159
|
+
})(FieldVariation || (exports.FieldVariation = FieldVariation = {}));
|
|
160
|
+
class Table extends BusinessObject {
|
|
161
|
+
}
|
|
162
|
+
exports.Table = Table;
|
|
163
|
+
//// FOR RECORDS END
|
|
164
|
+
// METADATA OBJECTS END
|
package/model.ts
CHANGED
|
@@ -46,8 +46,7 @@ export enum StepStatus {
|
|
|
46
46
|
|
|
47
47
|
export enum SharingApproach {
|
|
48
48
|
Inline = 0, // As in, the user has used this tag in the note
|
|
49
|
-
Explicit = 1, // The
|
|
50
|
-
Automated = 2, // The settings on the tag have caused the sharing to happen
|
|
49
|
+
Explicit = 1, // The user explicitly shared the tag, or the system did, without it being in the note
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
export enum InviteStatus {
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Bigfoot",
|
|
3
3
|
"name": "@bigfootai/bigfoot-types",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"description": "The internal library for the types used in the Bigfoot platform",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "model.js",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"repository": "Notify-AI/bigfoot-types",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"uuid": "^9.0.1"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"
|
|
13
|
+
"@types/node": "^20.11.16",
|
|
14
|
+
"ts-node": "^10.9.2",
|
|
15
|
+
"tslib": "^2.6.2",
|
|
16
|
+
"typescript": "^5.3.3"
|
|
14
17
|
}
|
|
15
18
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2020",
|
|
4
|
-
"module": "
|
|
4
|
+
"module": "Node16",
|
|
5
5
|
"skipLibCheck": true,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"noUnusedLocals": true,
|
|
9
|
-
"noUnusedParameters": true,
|
|
10
|
-
"noFallthroughCasesInSwitch": true
|
|
6
|
+
"resolveJsonModule": true,
|
|
7
|
+
"moduleResolution": "Node16"
|
|
11
8
|
}
|
|
12
9
|
}
|