@atcute/identity 1.1.4 → 1.1.5

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/did.d.ts CHANGED
@@ -1,10 +1,11 @@
1
+ import type { AtprotoAudience, AtprotoDid, Did } from '@atcute/lexicons/syntax';
1
2
  /**
2
3
  * checks if it's a DID identifier that is supported by atproto
3
4
  */
4
- export declare const isAtprotoDid: (input: string) => input is `did:plc:${string}` | `did:web:${string}`;
5
- export declare const isAtprotoAudience: (input: string) => input is `did:plc:${string}#${string}` | `did:web:${string}#${string}`;
5
+ export declare const isAtprotoDid: (input: string) => input is AtprotoDid;
6
+ export declare const isAtprotoAudience: (input: string) => input is AtprotoAudience;
6
7
  /**
7
8
  * returns the DID's method
8
9
  */
9
- export declare const extractDidMethod: <M extends string>(did: `did:${M}:${string}`) => M;
10
+ export declare const extractDidMethod: <M extends string>(did: Did<M>) => M;
10
11
  //# sourceMappingURL=did.d.ts.map
package/dist/did.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"did.d.ts","sourceRoot":"","sources":["../lib/did.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,YAAY,uEAExB,CAAC;AAEF,eAAO,MAAM,iBAAiB,2FAY7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,gDAIjC,CAAC"}
1
+ {"version":3,"file":"did.d.ts","sourceRoot":"","sources":["../lib/did.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAOhF;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,KAAK,IAAI,UAErD,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,MAAM,KAAG,KAAK,IAAI,eAY1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,KAAG,CAIhE,CAAC"}
@@ -1,5 +1,6 @@
1
+ import type { Did } from '@atcute/lexicons';
1
2
  /**
2
3
  * checks if input is a did:key identifier
3
4
  */
4
- export declare const isKeyDid: (input: string) => input is `did:key:${string}`;
5
+ export declare const isKeyDid: (input: string) => input is Did<'key'>;
5
6
  //# sourceMappingURL=key.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../lib/methods/key.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,QAAQ,iDAEpB,CAAC"}
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../lib/methods/key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAW,MAAM,KAAG,KAAK,IAAI,GAAG,CAAC,KAAK,CAE1D,CAAC"}
@@ -1,7 +1,8 @@
1
+ import type { Did } from '@atcute/lexicons/syntax';
1
2
  /** @deprecated use `isPlcDid` instead */
2
3
  export declare const PLC_DID_RE: RegExp;
3
4
  /**
4
5
  * checks if input is a did:plc identifier
5
6
  */
6
- export declare const isPlcDid: (input: string) => input is `did:plc:${string}`;
7
+ export declare const isPlcDid: (input: string) => input is Did<'plc'>;
7
8
  //# sourceMappingURL=plc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plc.d.ts","sourceRoot":"","sources":["../../lib/methods/plc.ts"],"names":[],"mappings":"AAEA,yCAAyC;AACzC,eAAO,MAAM,UAAU,QAA6B,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,QAAQ,iDAEpB,CAAC"}
1
+ {"version":3,"file":"plc.d.ts","sourceRoot":"","sources":["../../lib/methods/plc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAEnD,yCAAyC;AACzC,eAAO,MAAM,UAAU,QAA6B,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAW,MAAM,KAAG,KAAK,IAAI,GAAG,CAAC,KAAK,CAE1D,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { Did } from '@atcute/lexicons/syntax';
1
2
  /** @deprecated use `isWebDid` instead */
2
3
  export declare const WEB_DID_RE: RegExp;
3
4
  /** @deprecated use `isAtprotoWebDid` instead */
@@ -7,17 +8,17 @@ export declare const ATPROTO_WEB_DID_RE: RegExp;
7
8
  * `isAtprotoWebDid` for atproto-related cases as atproto only supports a subset
8
9
  * of the did:web specification (namely, no custom paths)
9
10
  */
10
- export declare const isWebDid: (input: string) => input is `did:web:${string}`;
11
+ export declare const isWebDid: (input: string) => input is Did<'web'>;
11
12
  /**
12
13
  * checks if input is a did:web identifier that is supported by atproto
13
14
  */
14
- export declare const isAtprotoWebDid: (input: string) => input is `did:web:${string}`;
15
+ export declare const isAtprotoWebDid: (input: string) => input is Did<'web'>;
15
16
  /**
16
17
  * normalize a did:web identifier
17
18
  */
18
- export declare const normalizeWebDid: (did: `did:web:${string}`) => `did:web:${string}`;
19
+ export declare const normalizeWebDid: (did: Did<'web'>) => Did<'web'>;
19
20
  /**
20
21
  * converts did:web identifier into the DID document's URL
21
22
  */
22
- export declare const webDidToDocumentUrl: (did: `did:web:${string}`) => URL;
23
+ export declare const webDidToDocumentUrl: (did: Did<'web'>) => URL;
23
24
  //# sourceMappingURL=web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../lib/methods/web.ts"],"names":[],"mappings":"AAEA,yCAAyC;AACzC,eAAO,MAAM,UAAU,QAC4E,CAAC;AAEpG,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,QAC2D,CAAC;AAE3F;;;;GAIG;AACH,eAAO,MAAM,QAAQ,iDAEpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,iDAE3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,mDAS3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,mCAgB/B,CAAC"}
1
+ {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../lib/methods/web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAEnD,yCAAyC;AACzC,eAAO,MAAM,UAAU,QAC4E,CAAC;AAEpG,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,QAC2D,CAAC;AAE3F;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAW,MAAM,KAAG,KAAK,IAAI,GAAG,CAAC,KAAK,CAE1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,UAAW,MAAM,KAAG,KAAK,IAAI,GAAG,CAAC,KAAK,CAEjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,QAAS,GAAG,CAAC,KAAK,CAAC,KAAG,GAAG,CAAC,KAAK,CAS1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAS,GAAG,CAAC,KAAK,CAAC,KAAG,GAgBrD,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Handle } from '@atcute/lexicons';
1
2
  import * as t from './types.ts';
2
3
  export interface VerificationMaterial {
3
4
  type: string;
@@ -7,10 +8,10 @@ export declare const isAtprotoServiceEndpoint: (input: string) => boolean;
7
8
  export declare const getVerificationMaterial: (doc: t.DidDocument, id: `#${string}`) => VerificationMaterial | undefined;
8
9
  export declare const getAtprotoVerificationMaterial: (doc: t.DidDocument) => VerificationMaterial | undefined;
9
10
  export declare const getAtprotoLabelerVerificationMaterial: (doc: t.DidDocument) => VerificationMaterial | undefined;
10
- export declare const getAtprotoHandle: (doc: t.DidDocument) => `${string}.${string}` | null | undefined;
11
+ export declare const getAtprotoHandle: (doc: t.DidDocument) => Handle | null | undefined;
11
12
  export declare const getAtprotoServiceEndpoint: (doc: t.DidDocument, predicate: {
12
13
  id: `#${string}`;
13
- type?: string | undefined;
14
+ type?: string;
14
15
  }) => string | undefined;
15
16
  export declare const getPdsEndpoint: (doc: t.DidDocument) => string | undefined;
16
17
  export declare const getLabelerEndpoint: (doc: t.DidDocument) => string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../lib/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,YAAY,CAAC;AAEhC,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAID,eAAO,MAAM,wBAAwB,4BAiBpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,4EAwBnC,CAAC;AAEF,eAAO,MAAM,8BAA8B,0DAE1C,CAAC;AAEF,eAAO,MAAM,qCAAqC,0DAIjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,kEAyB5B,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;wBAkCrC,CAAC;AAEF,eAAO,MAAM,cAAc,4CAK1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,4CAK9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,4CAKlC,CAAC;AAEF,eAAO,MAAM,yBAAyB,4CAKrC,CAAC;AAEF,eAAO,MAAM,8BAA8B,4CAK1C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,KAAK,CAAC,MAAM,YAAY,CAAC;AAEhC,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAID,eAAO,MAAM,wBAAwB,UAAW,MAAM,KAAG,OAiBxD,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAC9B,CAAC,CAAC,WAAW,MACd,IAAI,MAAM,EAAE,KACd,oBAAoB,GAAG,SAqBzB,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAAS,CAAC,CAAC,WAAW,KAAG,oBAAoB,GAAG,SAE1F,CAAC;AAEF,eAAO,MAAM,qCAAqC,QAC5C,CAAC,CAAC,WAAW,KAChB,oBAAoB,GAAG,SAEzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAS,CAAC,CAAC,WAAW,KAAG,MAAM,GAAG,IAAI,GAAG,SAyBrE,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAChC,CAAC,CAAC,WAAW,aACP;IAAE,EAAE,EAAE,IAAI,MAAM,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5C,MAAM,GAAG,SA+BX,CAAC;AAEF,eAAO,MAAM,cAAc,QAAS,CAAC,CAAC,WAAW,KAAG,MAAM,GAAG,SAK5D,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAS,CAAC,CAAC,WAAW,KAAG,MAAM,GAAG,SAKhE,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAS,CAAC,CAAC,WAAW,KAAG,MAAM,GAAG,SAKpE,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAS,CAAC,CAAC,WAAW,KAAG,MAAM,GAAG,SAKvE,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAAS,CAAC,CAAC,WAAW,KAAG,MAAM,GAAG,SAK5E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atcute/identity",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "syntax, type definitions and schemas for atproto handles, DIDs and DID documents",
5
5
  "keywords": [
6
6
  "atproto",
@@ -15,7 +15,8 @@
15
15
  "dist/",
16
16
  "lib/",
17
17
  "!lib/**/*.bench.ts",
18
- "!lib/**/*.test.ts"
18
+ "!lib/**/*.test.ts",
19
+ "!dist/**/*.{test,bench}.*"
19
20
  ],
20
21
  "type": "module",
21
22
  "sideEffects": false,
@@ -27,14 +28,17 @@
27
28
  },
28
29
  "dependencies": {
29
30
  "@badrap/valita": "^0.4.6",
30
- "@atcute/lexicons": "^1.2.9"
31
+ "@atcute/lexicons": "^1.3.1"
31
32
  },
32
33
  "devDependencies": {
33
- "@vitest/coverage-v8": "^4.1.0",
34
- "vitest": "^4.1.0"
34
+ "@vitest/coverage-v8": "^4.1.5",
35
+ "vitest": "^4.1.5"
36
+ },
37
+ "peerDependencies": {
38
+ "@atcute/lexicons": "^1.0.0"
35
39
  },
36
40
  "scripts": {
37
- "build": "tsgo --project tsconfig.build.json",
41
+ "build": "tsgo",
38
42
  "test": "vitest",
39
43
  "prepublish": "rm -rf dist; pnpm run build"
40
44
  }