@brimble/models 1.3.10 → 1.3.13
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/.turbo/turbo-build.log +1 -1
- package/dist/domain.d.ts +0 -0
- package/dist/domain.js +0 -0
- package/dist/enum/index.d.ts +5 -1
- package/dist/enum/index.js +7 -2
- package/dist/env.d.ts +0 -0
- package/dist/env.js +5 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -0
- package/dist/integration.d.ts +0 -0
- package/dist/integration.js +0 -0
- package/dist/token.d.ts +4 -0
- package/dist/token.js +30 -0
- package/dist/types/domain.d.ts +0 -0
- package/dist/types/domain.js +0 -0
- package/dist/types/env.d.ts +2 -0
- package/dist/types/env.js +0 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/integration.d.ts +0 -0
- package/dist/types/integration.js +0 -0
- package/dist/types/token.d.ts +10 -0
- package/dist/types/token.js +2 -0
- package/enum/index.ts +6 -1
- package/env.ts +5 -0
- package/index.ts +3 -1
- package/package.json +1 -1
- package/token.ts +34 -0
- package/types/env.ts +2 -0
- package/types/index.ts +1 -0
- package/types/token.ts +16 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[32m@brimble/models:build: [0mcache hit, replaying output [
|
|
1
|
+
[32m@brimble/models:build: [0mcache hit, replaying output [2m42b46fe101e599f8[0m
|
|
2
2
|
[32m@brimble/models:build: [0m$ tsc -p .
|
package/dist/domain.d.ts
CHANGED
|
File without changes
|
package/dist/domain.js
CHANGED
|
File without changes
|
package/dist/enum/index.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export declare enum INTEGRATION_TYPE {
|
|
|
7
7
|
SLACK = "SLACK",
|
|
8
8
|
ASANA = "ASANA",
|
|
9
9
|
SENTRY = "SENTRY",
|
|
10
|
-
DOPPLER = "DOPPLER",
|
|
11
10
|
CONTENTFUL = "CONTENTFUL"
|
|
12
11
|
}
|
|
12
|
+
export declare enum OAUTH_PERMISSIONS {
|
|
13
|
+
READ_USER = "read_user",
|
|
14
|
+
READ_PROJECT = "read_project",
|
|
15
|
+
UPDATE_CREDENTIALS = "update_credentials"
|
|
16
|
+
}
|
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INTEGRATION_TYPE = exports.GIT_TYPE = void 0;
|
|
3
|
+
exports.OAUTH_PERMISSIONS = exports.INTEGRATION_TYPE = exports.GIT_TYPE = void 0;
|
|
4
4
|
var GIT_TYPE;
|
|
5
5
|
(function (GIT_TYPE) {
|
|
6
6
|
GIT_TYPE["GITHUB"] = "GITHUB";
|
|
@@ -12,6 +12,11 @@ var INTEGRATION_TYPE;
|
|
|
12
12
|
INTEGRATION_TYPE["SLACK"] = "SLACK";
|
|
13
13
|
INTEGRATION_TYPE["ASANA"] = "ASANA";
|
|
14
14
|
INTEGRATION_TYPE["SENTRY"] = "SENTRY";
|
|
15
|
-
INTEGRATION_TYPE["DOPPLER"] = "DOPPLER";
|
|
16
15
|
INTEGRATION_TYPE["CONTENTFUL"] = "CONTENTFUL";
|
|
17
16
|
})(INTEGRATION_TYPE = exports.INTEGRATION_TYPE || (exports.INTEGRATION_TYPE = {}));
|
|
17
|
+
var OAUTH_PERMISSIONS;
|
|
18
|
+
(function (OAUTH_PERMISSIONS) {
|
|
19
|
+
OAUTH_PERMISSIONS["READ_USER"] = "read_user";
|
|
20
|
+
OAUTH_PERMISSIONS["READ_PROJECT"] = "read_project";
|
|
21
|
+
OAUTH_PERMISSIONS["UPDATE_CREDENTIALS"] = "update_credentials";
|
|
22
|
+
})(OAUTH_PERMISSIONS = exports.OAUTH_PERMISSIONS || (exports.OAUTH_PERMISSIONS = {}));
|
package/dist/env.d.ts
CHANGED
|
File without changes
|
package/dist/env.js
CHANGED
|
@@ -14,5 +14,10 @@ const envSchema = new mongoose_1.Schema({
|
|
|
14
14
|
type: String,
|
|
15
15
|
required: true,
|
|
16
16
|
},
|
|
17
|
+
user: {
|
|
18
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
+
ref: "User",
|
|
20
|
+
required: true,
|
|
21
|
+
}
|
|
17
22
|
}, { timestamps: true });
|
|
18
23
|
exports.default = mongoose_1.model("Env", envSchema);
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Following } from "./following";
|
|
|
4
4
|
export { default as Integration } from "./integration";
|
|
5
5
|
export { default as Domain } from "./domain";
|
|
6
6
|
export { default as Env } from "./env";
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
7
|
+
export { default as Token } from "./token";
|
|
8
|
+
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, IToken } from "./types";
|
|
9
|
+
export { GIT_TYPE, INTEGRATION_TYPE, OAUTH_PERMISSIONS } from "./enum";
|
|
9
10
|
export declare const connectToMongo: (mongoUrl: string) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -25,9 +25,12 @@ var domain_1 = require("./domain");
|
|
|
25
25
|
Object.defineProperty(exports, "Domain", { enumerable: true, get: function () { return domain_1.default; } });
|
|
26
26
|
var env_1 = require("./env");
|
|
27
27
|
Object.defineProperty(exports, "Env", { enumerable: true, get: function () { return env_1.default; } });
|
|
28
|
+
var token_1 = require("./token");
|
|
29
|
+
Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return token_1.default; } });
|
|
28
30
|
var enum_1 = require("./enum");
|
|
29
31
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
30
32
|
Object.defineProperty(exports, "INTEGRATION_TYPE", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPE; } });
|
|
33
|
+
Object.defineProperty(exports, "OAUTH_PERMISSIONS", { enumerable: true, get: function () { return enum_1.OAUTH_PERMISSIONS; } });
|
|
31
34
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
32
35
|
const utils_1 = require("@brimble/utils");
|
|
33
36
|
// Connection to Mongo
|
package/dist/integration.d.ts
CHANGED
|
File without changes
|
package/dist/integration.js
CHANGED
|
File without changes
|
package/dist/token.d.ts
ADDED
package/dist/token.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const tokenSchema = new mongoose_1.Schema({
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
unique: true,
|
|
9
|
+
},
|
|
10
|
+
apiKey: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
unique: true,
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
type: Array,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
image: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
unique: true,
|
|
23
|
+
},
|
|
24
|
+
installationUrl: String,
|
|
25
|
+
permissions: {
|
|
26
|
+
type: Array,
|
|
27
|
+
required: true
|
|
28
|
+
}
|
|
29
|
+
}, { timestamps: true });
|
|
30
|
+
exports.default = mongoose_1.model("Token", tokenSchema);
|
package/dist/types/domain.d.ts
CHANGED
|
File without changes
|
package/dist/types/domain.js
CHANGED
|
File without changes
|
package/dist/types/env.d.ts
CHANGED
package/dist/types/env.js
CHANGED
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { OAUTH_PERMISSIONS } from "../enum";
|
|
3
|
+
export interface IToken extends Document {
|
|
4
|
+
name: string;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
description: string[];
|
|
7
|
+
image: string;
|
|
8
|
+
installationUrl?: string;
|
|
9
|
+
permission: OAUTH_PERMISSIONS[];
|
|
10
|
+
}
|
package/enum/index.ts
CHANGED
|
@@ -7,6 +7,11 @@ export enum INTEGRATION_TYPE {
|
|
|
7
7
|
SLACK = "SLACK",
|
|
8
8
|
ASANA = "ASANA",
|
|
9
9
|
SENTRY = "SENTRY",
|
|
10
|
-
DOPPLER = "DOPPLER",
|
|
11
10
|
CONTENTFUL = "CONTENTFUL",
|
|
12
11
|
}
|
|
12
|
+
|
|
13
|
+
export enum OAUTH_PERMISSIONS {
|
|
14
|
+
READ_USER = "read_user",
|
|
15
|
+
READ_PROJECT = "read_project",
|
|
16
|
+
UPDATE_CREDENTIALS = "update_credentials"
|
|
17
|
+
}
|
package/env.ts
CHANGED
package/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Following } from "./following";
|
|
|
4
4
|
export { default as Integration } from "./integration";
|
|
5
5
|
export { default as Domain } from "./domain";
|
|
6
6
|
export { default as Env } from "./env";
|
|
7
|
+
export { default as Token } from "./token";
|
|
7
8
|
export {
|
|
8
9
|
IUser,
|
|
9
10
|
IGit,
|
|
@@ -12,8 +13,9 @@ export {
|
|
|
12
13
|
IIntegration,
|
|
13
14
|
IEnv,
|
|
14
15
|
IDomain,
|
|
16
|
+
IToken
|
|
15
17
|
} from "./types";
|
|
16
|
-
export { GIT_TYPE, INTEGRATION_TYPE } from "./enum";
|
|
18
|
+
export { GIT_TYPE, INTEGRATION_TYPE, OAUTH_PERMISSIONS } from "./enum";
|
|
17
19
|
|
|
18
20
|
import mongoose from "mongoose";
|
|
19
21
|
import { log } from "@brimble/utils";
|
package/package.json
CHANGED
package/token.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IToken } from "./types";
|
|
3
|
+
|
|
4
|
+
const tokenSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
unique: true,
|
|
10
|
+
},
|
|
11
|
+
apiKey: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
unique: true,
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
type: Array,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
image: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
unique: true,
|
|
24
|
+
},
|
|
25
|
+
installationUrl: String,
|
|
26
|
+
permissions: {
|
|
27
|
+
type: Array,
|
|
28
|
+
required: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{ timestamps: true },
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export default model<IToken>("Token", tokenSchema);
|
package/types/env.ts
CHANGED
package/types/index.ts
CHANGED
package/types/token.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { OAUTH_PERMISSIONS } from "../enum";
|
|
3
|
+
|
|
4
|
+
export interface IToken extends Document {
|
|
5
|
+
name: string;
|
|
6
|
+
|
|
7
|
+
apiKey: string;
|
|
8
|
+
|
|
9
|
+
description: string[];
|
|
10
|
+
|
|
11
|
+
image: string;
|
|
12
|
+
|
|
13
|
+
installationUrl?: string;
|
|
14
|
+
|
|
15
|
+
permission: OAUTH_PERMISSIONS[];
|
|
16
|
+
}
|