@nauth-toolkit/core 0.2.6 → 0.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/LICENSE +21 -91
- package/README.md +8 -8
- package/dist/bootstrap.d.ts +3 -0
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +10 -0
- package/dist/bootstrap.js.map +1 -1
- package/dist/interfaces/config.interface.d.ts +39 -1
- package/dist/interfaces/config.interface.d.ts.map +1 -1
- package/dist/internal.d.ts +7 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +8 -1
- package/dist/internal.js.map +1 -1
- package/dist/schemas/auth-config.schema.d.ts +26 -0
- package/dist/schemas/auth-config.schema.d.ts.map +1 -1
- package/dist/schemas/auth-config.schema.js +6 -0
- package/dist/schemas/auth-config.schema.js.map +1 -1
- package/dist/services/telemetry.service.d.ts +154 -0
- package/dist/services/telemetry.service.d.ts.map +1 -0
- package/dist/services/telemetry.service.js +345 -0
- package/dist/services/telemetry.service.js.map +1 -0
- package/dist/storage/memory-storage.adapter.d.ts +2 -2
- package/dist/storage/memory-storage.adapter.js +2 -2
- package/dist/utils/get-package-version.d.ts +15 -0
- package/dist/utils/get-package-version.d.ts.map +1 -0
- package/dist/utils/get-package-version.js +84 -0
- package/dist/utils/get-package-version.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the installed @nauth-toolkit/core version at runtime.
|
|
3
|
+
*
|
|
4
|
+
* Walks up from the compiled file location (dist/utils at runtime, src/utils
|
|
5
|
+
* under ts-jest) for up to three levels looking for the package's own
|
|
6
|
+
* package.json. Reading at runtime keeps the reported version in sync with
|
|
7
|
+
* the published package — a compiled-in constant would go stale because the
|
|
8
|
+
* release script bumps versions outside the TypeScript build.
|
|
9
|
+
*
|
|
10
|
+
* Never throws; returns 'unknown' when the manifest cannot be found or read.
|
|
11
|
+
*
|
|
12
|
+
* @returns The semver version string of @nauth-toolkit/core, or 'unknown'
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCoreVersion(): string;
|
|
15
|
+
//# sourceMappingURL=get-package-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-package-version.d.ts","sourceRoot":"","sources":["../../src/utils/get-package-version.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,IAAI,MAAM,CA6BvC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getCoreVersion = getCoreVersion;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
/**
|
|
40
|
+
* Memoized result of the package.json version lookup.
|
|
41
|
+
* `undefined` means "not yet resolved"; a string (possibly 'unknown') is final.
|
|
42
|
+
*/
|
|
43
|
+
let cachedVersion;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the installed @nauth-toolkit/core version at runtime.
|
|
46
|
+
*
|
|
47
|
+
* Walks up from the compiled file location (dist/utils at runtime, src/utils
|
|
48
|
+
* under ts-jest) for up to three levels looking for the package's own
|
|
49
|
+
* package.json. Reading at runtime keeps the reported version in sync with
|
|
50
|
+
* the published package — a compiled-in constant would go stale because the
|
|
51
|
+
* release script bumps versions outside the TypeScript build.
|
|
52
|
+
*
|
|
53
|
+
* Never throws; returns 'unknown' when the manifest cannot be found or read.
|
|
54
|
+
*
|
|
55
|
+
* @returns The semver version string of @nauth-toolkit/core, or 'unknown'
|
|
56
|
+
*/
|
|
57
|
+
function getCoreVersion() {
|
|
58
|
+
if (cachedVersion !== undefined) {
|
|
59
|
+
return cachedVersion;
|
|
60
|
+
}
|
|
61
|
+
let dir = __dirname;
|
|
62
|
+
for (let i = 0; i < 3; i++) {
|
|
63
|
+
dir = path.dirname(dir);
|
|
64
|
+
try {
|
|
65
|
+
const manifestPath = path.join(dir, 'package.json');
|
|
66
|
+
if (fs.existsSync(manifestPath)) {
|
|
67
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
68
|
+
if (typeof manifest === 'object' &&
|
|
69
|
+
manifest !== null &&
|
|
70
|
+
manifest.name === '@nauth-toolkit/core' &&
|
|
71
|
+
typeof manifest.version === 'string') {
|
|
72
|
+
cachedVersion = manifest.version;
|
|
73
|
+
return cachedVersion;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Unreadable or malformed manifest — keep walking up, fall through to 'unknown'.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
cachedVersion = 'unknown';
|
|
82
|
+
return cachedVersion;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=get-package-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-package-version.js","sourceRoot":"","sources":["../../src/utils/get-package-version.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,wCA6BC;AAnDD,uCAAyB;AACzB,2CAA6B;AAE7B;;;GAGG;AACH,IAAI,aAAiC,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,SAAgB,cAAc;IAC5B,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,GAAG,GAAG,SAAS,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YACpD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBAChC,MAAM,QAAQ,GAAY,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;gBAC5E,IACE,OAAO,QAAQ,KAAK,QAAQ;oBAC5B,QAAQ,KAAK,IAAI;oBAChB,QAA+B,CAAC,IAAI,KAAK,qBAAqB;oBAC/D,OAAQ,QAAkC,CAAC,OAAO,KAAK,QAAQ,EAC/D,CAAC;oBACD,aAAa,GAAI,QAAgC,CAAC,OAAO,CAAC;oBAC1D,OAAO,aAAa,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,iFAAiF;QACnF,CAAC;IACH,CAAC;IAED,aAAa,GAAG,SAAS,CAAC;IAC1B,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nauth-toolkit/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Embedded authentication engine for Node.js — NestJS, Express, Fastify",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@maxmind/geoip2-node": "^4.0.0 || ^5.0.0 || ^6.0.0",
|
|
52
|
-
"@nauth-toolkit/recaptcha": "^0.
|
|
52
|
+
"@nauth-toolkit/recaptcha": "^0.3.0",
|
|
53
53
|
"typeorm": "^0.3.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"access": "public",
|
|
77
77
|
"tag": "latest"
|
|
78
78
|
},
|
|
79
|
-
"license": "
|
|
79
|
+
"license": "MIT",
|
|
80
80
|
"keywords": [
|
|
81
81
|
"nauth",
|
|
82
82
|
"authentication",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"sideEffects": false,
|
|
116
116
|
"repository": {
|
|
117
117
|
"type": "git",
|
|
118
|
-
"url": "https://github.com/noorixorg/nauth"
|
|
118
|
+
"url": "https://github.com/noorixorg/nauth-toolkit"
|
|
119
119
|
},
|
|
120
120
|
"homepage": "https://nauth.dev"
|
|
121
121
|
}
|