@colearn/microservices-kit
Advanced tools
Comparing version 0.0.45-beta.4 to 0.0.45-beta.5
@@ -19,2 +19,3 @@ import { SystemRole } from '../types'; | ||
getRoles(entityType: 'family' | 'school', id: string | number): RoleRecord[]; | ||
findAnyMembership(entityType: 'family' | 'school', condition: (r: RoleRecord) => boolean): RoleRecord | undefined; | ||
} |
@@ -37,4 +37,18 @@ "use strict"; | ||
} | ||
findAnyMembership(entityType, condition) { | ||
var _a, _b; | ||
if (!((_a = this.roles) === null || _a === void 0 ? void 0 : _a[entityType])) { | ||
return undefined; | ||
} | ||
const entites = this.roles[entityType]; | ||
for (const id of Object.keys(entites)) { | ||
const role = (_b = entites[id]) === null || _b === void 0 ? void 0 : _b.find(condition); | ||
if (role) { | ||
return role; | ||
} | ||
} | ||
return undefined; | ||
} | ||
} | ||
exports.AuthUser = AuthUser; | ||
//# sourceMappingURL=auth-user.js.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
CacheControlInterval[CacheControlInterval["HOUR"] = 3600] = "HOUR"; | ||
})(CacheControlInterval = exports.CacheControlInterval || (exports.CacheControlInterval = {})); | ||
})(CacheControlInterval || (exports.CacheControlInterval = CacheControlInterval = {})); | ||
function setCacheControl(res, maxAge, isPublic = true) { | ||
@@ -11,0 +11,0 @@ const value = `${isPublic ? 'public' : 'private'}, max-age=${maxAge}`; |
import { RequestInit, Response } from 'node-fetch'; | ||
export declare class MicroserviceHttpClient { | ||
private baseURL; | ||
constructor(baseURL: string); | ||
protected token?: string | undefined; | ||
constructor(baseURL: string, token?: string | undefined); | ||
protected fetch(url: string, init?: RequestInit, token?: any): Promise<Response>; | ||
} |
@@ -9,4 +9,5 @@ "use strict"; | ||
class MicroserviceHttpClient { | ||
constructor(baseURL) { | ||
constructor(baseURL, token) { | ||
this.baseURL = baseURL; | ||
this.token = token; | ||
} | ||
@@ -13,0 +14,0 @@ async fetch(url, init, token) { |
@@ -12,3 +12,3 @@ "use strict"; | ||
HttpStatusCode[HttpStatusCode["INTERNAL_SERVER"] = 500] = "INTERNAL_SERVER"; | ||
})(HttpStatusCode = exports.HttpStatusCode || (exports.HttpStatusCode = {})); | ||
})(HttpStatusCode || (exports.HttpStatusCode = HttpStatusCode = {})); | ||
class BaseError extends Error { | ||
@@ -15,0 +15,0 @@ constructor(name, httpCode, description, isOperational) { |
@@ -14,2 +14,4 @@ export { default as HttpService } from './http-service'; | ||
export * from './network'; | ||
export * from './broker/types'; | ||
export * from './broker/borker-client'; | ||
export * as arrays from './arrays'; |
@@ -47,3 +47,5 @@ "use strict"; | ||
__exportStar(require("./network"), exports); | ||
__exportStar(require("./broker/types"), exports); | ||
__exportStar(require("./broker/borker-client"), exports); | ||
exports.arrays = __importStar(require("./arrays")); | ||
//# sourceMappingURL=index.js.map |
@@ -9,3 +9,3 @@ "use strict"; | ||
SystemRole["User"] = "user"; | ||
})(SystemRole = exports.SystemRole || (exports.SystemRole = {})); | ||
})(SystemRole || (exports.SystemRole = SystemRole = {})); | ||
var Grade; | ||
@@ -29,3 +29,3 @@ (function (Grade) { | ||
Grade[Grade["Undergrad"] = 13] = "Undergrad"; | ||
})(Grade = exports.Grade || (exports.Grade = {})); | ||
})(Grade || (exports.Grade = Grade = {})); | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@colearn/microservices-kit", | ||
"version": "0.0.45-beta.4", | ||
"version": "0.0.45-beta.5", | ||
"description": "colearn microservice kit", | ||
@@ -30,3 +30,4 @@ "author": "Colearn", | ||
"/errors", | ||
"/arrays" | ||
"/arrays", | ||
"/messaging" | ||
], | ||
@@ -37,3 +38,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@sentry/node": "^7.51.2", | ||
"@sentry/node": "^7.54.0", | ||
"body-parser": "^1.20.2", | ||
@@ -47,4 +48,4 @@ "express-jwt": "^8.3.0", | ||
"@types/express-jwt": "^7.4.2", | ||
"@types/node": "^20.1.1", | ||
"eslint": "^8.40.0", | ||
"@types/node": "^20.2.5", | ||
"eslint": "^8.42.0", | ||
"express": "^4.18.2", | ||
@@ -54,3 +55,3 @@ "husky": "^8.0.3", | ||
"prettier": "^2.8.8", | ||
"typescript": "^5.0.4" | ||
"typescript": "^5.1.3" | ||
}, | ||
@@ -57,0 +58,0 @@ "lint-staged": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69421
70
1102
Updated@sentry/node@^7.54.0