credentialcore 0.0.1 → 0.0.3

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/dist/index.d.ts CHANGED
@@ -1,2 +1,9 @@
1
- /** The first stable surface of the package. */
2
- export declare const credentialcore = "0.0.1";
1
+ export type CredentialKind = "password" | "passkey" | "magic-link" | "oauth" | "recovery-code" | "api-key";
2
+ export interface Credential {
3
+ id: string;
4
+ principalId: string;
5
+ kind: CredentialKind;
6
+ createdAt: number;
7
+ lastUsedAt?: number;
8
+ }
9
+ export declare function createCredential(credential: Credential): Readonly<Credential>;
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- /** The first stable surface of the package. */
2
- export const credentialcore = "0.0.1";
1
+ function e(r){if(!r.id||!r.principalId)throw new TypeError("Credential id and principal id are required.");return Object.freeze({...r})}export{e as createCredential};
package/package.json CHANGED
@@ -1,20 +1,48 @@
1
1
  {
2
2
  "name": "credentialcore",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Framework-neutral credential primitives for identity systems.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
- "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js", "default": "./dist/index.js" } },
9
- "files": ["dist", "README.md"],
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
10
19
  "sideEffects": false,
11
- "scripts": { "build": "tsc --project tsconfig.json", "prepublishOnly": "npm run build" },
12
- "keywords": ["identity", "credentials", "auth"],
20
+ "scripts": {
21
+ "build": "tsc --project tsconfig.json",
22
+ "postbuild": "npm run dist --prefix \"$npm_config_local_prefix\" -- \"$PWD\"",
23
+ "prepack": "npm run build",
24
+ "prepublishOnly": "npm run build"
25
+ },
26
+ "keywords": [
27
+ "identity",
28
+ "credentials",
29
+ "auth"
30
+ ],
13
31
  "homepage": "https://signway.dev/",
14
32
  "author": "Mosanic <dev@mosanic.io>",
15
33
  "license": "MIT",
16
- "engines": { "node": ">=20" },
17
- "publishConfig": { "access": "public" },
18
- "devDependencies": { "typescript": "^5.9.3" },
19
- "repository": { "type": "git", "url": "git+https://github.com/mosanic/mosa-platform.git", "directory": "packages/credentialcore" }
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "devDependencies": {
41
+ "typescript": "^5.9.3"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/mosanic/mosa-platform.git",
46
+ "directory": "packages/credentialcore"
47
+ }
20
48
  }