nodecommons-rest
Advanced tools
Comparing version 7.0.2 to 7.0.3
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommonsRestKeyApi = void 0; | ||
const commons_rest_api_1 = require("./commons-rest.api"); | ||
@@ -14,0 +15,0 @@ class CommonsRestKeyApi extends commons_rest_api_1.CommonsRestApi { |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommonsRestSessionApi = void 0; | ||
const commons_rest_api_1 = require("./commons-rest.api"); | ||
@@ -14,0 +15,0 @@ class CommonsRestSessionApi extends commons_rest_api_1.CommonsRestApi { |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommonsRestUserPwHashSessionApi = void 0; | ||
const tscommons_core_1 = require("tscommons-core"); | ||
@@ -14,0 +15,0 @@ const commons_rest_user_session_api_1 = require("./commons-rest-user-session.api"); |
@@ -12,2 +12,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommonsRestUserSessionApi = void 0; | ||
const nodecommons_cli_1 = require("nodecommons-cli"); | ||
const commons_rest_session_api_1 = require("./commons-rest-session.api"); | ||
@@ -26,13 +28,20 @@ const commons_rest_api_1 = require("./commons-rest.api"); | ||
super.postHandler(`${authenticateQuery}/:username[idname]`, (req, _res) => __awaiter(this, void 0, void 0, function* () { | ||
nodecommons_cli_1.CommonsOutput.debug(`Login requested with username: ${req.strictParams.username}`); | ||
let user = yield getUserByUsername(req.strictParams.username, req); | ||
if (!user) { | ||
nodecommons_cli_1.CommonsOutput.debug('No such user exists'); | ||
if (!autoRegister) | ||
return commons_rest_api_1.CommonsRestApi.notFound('No such user exists.'); | ||
nodecommons_cli_1.CommonsOutput.debug('Attempting auto-register'); | ||
try { | ||
const registered = yield autoRegister(req.strictParams.username, req); | ||
if (!registered) | ||
if (!registered) { | ||
nodecommons_cli_1.CommonsOutput.debug('Unable to register a new user for those details.'); | ||
return commons_rest_api_1.CommonsRestApi.error('Unable to register a new user for those details.'); | ||
} | ||
nodecommons_cli_1.CommonsOutput.debug('Successfully registered new user'); | ||
user = registered; | ||
} | ||
catch (e) { | ||
nodecommons_cli_1.CommonsOutput.error(e.message); | ||
return commons_rest_api_1.CommonsRestApi.error(e.message); | ||
@@ -42,4 +51,6 @@ } | ||
const session = yield this.authenticate(user, this.sessionService, req); | ||
if (!session) | ||
if (!session) { | ||
nodecommons_cli_1.CommonsOutput.debug('Unable to authenticate with those credentials.'); | ||
return commons_rest_api_1.CommonsRestApi.forbidden('Unable to authenticate with those credentials.'); | ||
} | ||
return { sid: session.sid }; | ||
@@ -46,0 +57,0 @@ })); |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommonsRestWebhookApi = void 0; | ||
const tscommons_core_1 = require("tscommons-core"); | ||
@@ -14,0 +15,0 @@ const tscommons_core_2 = require("tscommons-core"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommonsRestApi = void 0; | ||
const tscommons_http_1 = require("tscommons-http"); | ||
@@ -4,0 +5,0 @@ class CommonsRestApi { |
"use strict"; | ||
// created from 'create-ts-index' | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./commons-rest-key.api")); | ||
__export(require("./commons-rest-session.api")); | ||
__export(require("./commons-rest-user-pw-hash-session.api")); | ||
__export(require("./commons-rest-user-session.api")); | ||
__export(require("./commons-rest-wekhook.api")); | ||
__export(require("./commons-rest.api")); | ||
__exportStar(require("./commons-rest-key.api"), exports); | ||
__exportStar(require("./commons-rest-session.api"), exports); | ||
__exportStar(require("./commons-rest-user-pw-hash-session.api"), exports); | ||
__exportStar(require("./commons-rest-user-session.api"), exports); | ||
__exportStar(require("./commons-rest-wekhook.api"), exports); | ||
__exportStar(require("./commons-rest.api"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
// created from 'create-ts-index' | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./apis")); | ||
__export(require("./servers")); | ||
__export(require("./types")); | ||
__exportStar(require("./apis"), exports); | ||
__exportStar(require("./interfaces"), exports); | ||
__exportStar(require("./servers"), exports); | ||
__exportStar(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
// created from 'create-ts-index' | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./icommons-request-with-session"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommonsRestServer = void 0; | ||
const tscommons_http_1 = require("tscommons-http"); | ||
@@ -14,0 +15,0 @@ const nodecommons_express_1 = require("nodecommons-express"); |
"use strict"; | ||
// created from 'create-ts-index' | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./commons-rest.server")); | ||
__exportStar(require("./commons-rest.server"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
// created from 'create-ts-index' | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./tcommons-content")); | ||
__exportStar(require("./tcommons-content-handler"), exports); | ||
__exportStar(require("./tcommons-content"), exports); | ||
__exportStar(require("./tcommons-http-request"), exports); | ||
__exportStar(require("./tcommons-no-content-handler"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isTCommonsContent = void 0; | ||
const tscommons_core_1 = require("tscommons-core"); | ||
@@ -4,0 +5,0 @@ function isTCommonsContent(test) { |
{ | ||
"name": "nodecommons-rest", | ||
"version": "7.0.2", | ||
"version": "7.0.3", | ||
"description": "", | ||
"scripts": { | ||
"preprepare": "rm -rf ./dist; cti ./src && tsc" | ||
"preprepare": "rm -rf ./dist; cti ./src && tsc", | ||
"publish-patch": "rm -rf dist; tsc && tslint -p . && npm run preprepare && npm version patch && npm install && npm publish && git add . && git commit -m 'publish'" | ||
}, | ||
@@ -15,7 +16,7 @@ "main": "dist/index.js", | ||
"express": "^4.17.1", | ||
"nodecommons-express": "^1.4.10", | ||
"nodecommons-security": "^3.1.1", | ||
"tscommons-core": "^2.4.1", | ||
"nodecommons-express": "^1.4.11", | ||
"nodecommons-security": "^3.1.2", | ||
"tscommons-core": "^2.4.2", | ||
"tscommons-http": "^5.1.0", | ||
"tscommons-session": "1.0.0" | ||
"tscommons-session": "1.0.1" | ||
}, | ||
@@ -22,0 +23,0 @@ "files": [ |
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
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
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
50718
8
674
+ Addedgopd@1.1.0(transitive)
+ Addedtscommons-session@1.0.1(transitive)
- Removedgopd@1.0.1(transitive)
- Removedtscommons-session@1.0.0(transitive)
Updatednodecommons-express@^1.4.11
Updatednodecommons-security@^3.1.2
Updatedtscommons-core@^2.4.2
Updatedtscommons-session@1.0.1