@majikah/majik-slink 0.0.1 → 0.0.2

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.
@@ -25,6 +25,7 @@ export interface MajikSLinkJSON {
25
25
  version: 1;
26
26
  id: string;
27
27
  user_id: string;
28
+ muid: string;
28
29
  /** Full registered domain e.g. "youtube.com" */
29
30
  domain: string;
30
31
  /** Subdomain or null */
@@ -36,6 +36,7 @@ export declare class MajikSLink {
36
36
  private readonly _version;
37
37
  private readonly _id;
38
38
  private readonly _user_id;
39
+ private readonly _muid;
39
40
  private readonly _domain;
40
41
  private readonly _sld;
41
42
  private readonly _tld;
@@ -55,6 +56,7 @@ export declare class MajikSLink {
55
56
  get version(): 1;
56
57
  get id(): string;
57
58
  get userId(): string;
59
+ get muid(): string;
58
60
  /** Full registered domain e.g. "youtube.com" */
59
61
  get domain(): string;
60
62
  /** Second-level domain e.g. "youtube" */
@@ -113,7 +115,7 @@ export declare class MajikSLink {
113
115
  * );
114
116
  * console.log(slink.vCode); // "majik-slink:a1b2c3d4…"
115
117
  */
116
- static create(rawUrl: string, key: MajikKey, userId: string, options?: {
118
+ static create(rawUrl: string, key: MajikKey, userId: string, muid: string, options?: {
117
119
  id?: string;
118
120
  timestamp?: Date;
119
121
  status?: SLinkVerificationStatus;
@@ -38,6 +38,7 @@ export class MajikSLink {
38
38
  _version;
39
39
  _id;
40
40
  _user_id;
41
+ _muid;
41
42
  // URL parts (normalised)
42
43
  _domain; // "youtube.com"
43
44
  _sld; // "youtube"
@@ -59,6 +60,7 @@ export class MajikSLink {
59
60
  this._version = data.version;
60
61
  this._id = data.id;
61
62
  this._user_id = data.user_id;
63
+ this._muid = data.muid;
62
64
  this._domain = data.domain;
63
65
  this._sld = data.sld;
64
66
  this._tld = data.tld;
@@ -84,6 +86,9 @@ export class MajikSLink {
84
86
  get userId() {
85
87
  return this._user_id;
86
88
  }
89
+ get muid() {
90
+ return this._muid;
91
+ }
87
92
  /** Full registered domain e.g. "youtube.com" */
88
93
  get domain() {
89
94
  return this._domain;
@@ -185,10 +190,11 @@ export class MajikSLink {
185
190
  * );
186
191
  * console.log(slink.vCode); // "majik-slink:a1b2c3d4…"
187
192
  */
188
- static async create(rawUrl, key, userId, options) {
193
+ static async create(rawUrl, key, userId, muid, options) {
189
194
  // ── Validate inputs ──────────────────────────────────────────────────
190
195
  assertNonEmptyString(rawUrl, "url");
191
196
  assertNonEmptyString(userId, "userId");
197
+ assertNonEmptyString(muid, "Majik Universal ID");
192
198
  assertMajikKey(key);
193
199
  assertUnlockedKey(key);
194
200
  assertValidHttpUrl(rawUrl);
@@ -215,6 +221,7 @@ export class MajikSLink {
215
221
  version: SLINK_VERSION,
216
222
  id: options?.id ?? generateId(),
217
223
  user_id: userId,
224
+ muid: muid,
218
225
  domain: urlInfo.domain,
219
226
  sld: urlInfo.sld,
220
227
  tld: urlInfo.tld,
@@ -388,6 +395,7 @@ export class MajikSLink {
388
395
  version: this._version,
389
396
  id: this._id,
390
397
  user_id: this._user_id,
398
+ muid: this._muid,
391
399
  domain: this._domain,
392
400
  subdomain: this._subdomain,
393
401
  path: this._path,
@@ -440,6 +448,7 @@ export class MajikSLink {
440
448
  version: SLINK_VERSION,
441
449
  id: json.id,
442
450
  user_id: json.user_id,
451
+ muid: json.muid,
443
452
  domain: json.domain,
444
453
  sld,
445
454
  tld,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-slink",
3
3
  "type": "module",
4
4
  "description": "Majik SLink is a specialized TypeScript library designed for URL ownership verification and cryptographic identity linking. It provides a robust mechanism to prove that a specific digital identity (a MajikKey) controls a publicly accessible web resource (such as a YouTube channel, social media profile, or personal blog).",
5
- "version": "0.0.1",
5
+ "version": "0.0.2",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",