@atproto/oauth-provider 0.10.1 → 0.11.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/constants.d.ts +2 -0
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +3 -1
  5. package/dist/constants.js.map +1 -1
  6. package/dist/customization/branding.d.ts +5 -19
  7. package/dist/customization/branding.d.ts.map +1 -1
  8. package/dist/customization/customization.d.ts +7 -25
  9. package/dist/customization/customization.d.ts.map +1 -1
  10. package/dist/customization/links.d.ts +3 -13
  11. package/dist/customization/links.d.ts.map +1 -1
  12. package/dist/customization/links.js +1 -1
  13. package/dist/customization/links.js.map +1 -1
  14. package/dist/lexicon/lexicon-data.d.ts +9 -0
  15. package/dist/lexicon/lexicon-data.d.ts.map +1 -0
  16. package/dist/lexicon/lexicon-data.js +3 -0
  17. package/dist/lexicon/lexicon-data.js.map +1 -0
  18. package/dist/lexicon/lexicon-getter.d.ts +15 -0
  19. package/dist/lexicon/lexicon-getter.d.ts.map +1 -0
  20. package/dist/lexicon/lexicon-getter.js +55 -0
  21. package/dist/lexicon/lexicon-getter.js.map +1 -0
  22. package/dist/lexicon/lexicon-manager.d.ts +60 -0
  23. package/dist/lexicon/lexicon-manager.d.ts.map +1 -0
  24. package/dist/lexicon/lexicon-manager.js +105 -0
  25. package/dist/lexicon/lexicon-manager.js.map +1 -0
  26. package/dist/lexicon/lexicon-store.d.ts +13 -0
  27. package/dist/lexicon/lexicon-store.d.ts.map +1 -0
  28. package/dist/lexicon/lexicon-store.js +24 -0
  29. package/dist/lexicon/lexicon-store.js.map +1 -0
  30. package/dist/lib/html/hydration-data.d.ts.map +1 -1
  31. package/dist/lib/html/hydration-data.js +1 -2
  32. package/dist/lib/html/hydration-data.js.map +1 -1
  33. package/dist/lib/nsid.d.ts +4 -0
  34. package/dist/lib/nsid.d.ts.map +1 -0
  35. package/dist/lib/nsid.js +15 -0
  36. package/dist/lib/nsid.js.map +1 -0
  37. package/dist/lib/util/locale.d.ts +1 -15
  38. package/dist/lib/util/locale.d.ts.map +1 -1
  39. package/dist/lib/util/locale.js +2 -7
  40. package/dist/lib/util/locale.js.map +1 -1
  41. package/dist/oauth-provider.d.ts +14 -9
  42. package/dist/oauth-provider.d.ts.map +1 -1
  43. package/dist/oauth-provider.js +15 -6
  44. package/dist/oauth-provider.js.map +1 -1
  45. package/dist/oauth-store.d.ts +1 -0
  46. package/dist/oauth-store.d.ts.map +1 -1
  47. package/dist/oauth-store.js +1 -0
  48. package/dist/oauth-store.js.map +1 -1
  49. package/dist/request/request-manager.d.ts +3 -1
  50. package/dist/request/request-manager.d.ts.map +1 -1
  51. package/dist/request/request-manager.js +19 -4
  52. package/dist/request/request-manager.js.map +1 -1
  53. package/dist/result/authorization-result-authorize-page.d.ts +5 -3
  54. package/dist/result/authorization-result-authorize-page.d.ts.map +1 -1
  55. package/dist/router/assets/send-authorization-page.d.ts.map +1 -1
  56. package/dist/router/assets/send-authorization-page.js +1 -0
  57. package/dist/router/assets/send-authorization-page.js.map +1 -1
  58. package/dist/signer/api-token-payload.d.ts +60 -630
  59. package/dist/signer/api-token-payload.d.ts.map +1 -1
  60. package/dist/signer/signed-token-payload.d.ts +60 -630
  61. package/dist/signer/signed-token-payload.d.ts.map +1 -1
  62. package/dist/signer/signer.d.ts +11 -11
  63. package/dist/signer/signer.d.ts.map +1 -1
  64. package/dist/token/token-data.d.ts +7 -0
  65. package/dist/token/token-data.d.ts.map +1 -1
  66. package/dist/token/token-manager.d.ts +5 -6
  67. package/dist/token/token-manager.d.ts.map +1 -1
  68. package/dist/token/token-manager.js +37 -13
  69. package/dist/token/token-manager.js.map +1 -1
  70. package/dist/token/token-store.d.ts +16 -2
  71. package/dist/token/token-store.d.ts.map +1 -1
  72. package/dist/token/token-store.js.map +1 -1
  73. package/package.json +15 -13
  74. package/src/constants.ts +3 -0
  75. package/src/customization/links.ts +2 -2
  76. package/src/lexicon/lexicon-data.ts +9 -0
  77. package/src/lexicon/lexicon-getter.ts +62 -0
  78. package/src/lexicon/lexicon-manager.ts +116 -0
  79. package/src/lexicon/lexicon-store.ts +36 -0
  80. package/src/lib/html/hydration-data.ts +1 -2
  81. package/src/lib/nsid.ts +10 -0
  82. package/src/lib/util/locale.ts +3 -9
  83. package/src/oauth-provider.ts +30 -9
  84. package/src/oauth-store.ts +1 -0
  85. package/src/request/request-manager.ts +26 -7
  86. package/src/result/authorization-result-authorize-page.ts +5 -3
  87. package/src/router/assets/send-authorization-page.ts +1 -0
  88. package/src/token/token-data.ts +8 -0
  89. package/src/token/token-manager.ts +68 -34
  90. package/src/token/token-store.ts +17 -5
  91. package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @atproto/oauth-provider
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#4108](https://github.com/bluesky-social/atproto/pull/4108) [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add support for `include:<nsid>` scopes
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d), [`f9dc9aa4c`](https://github.com/bluesky-social/atproto/commit/f9dc9aa4c9eaf2f82d140fbf011a9015e7f1a00d)]:
12
+ - @atproto/lexicon@0.5.0
13
+ - @atproto/syntax@0.4.1
14
+ - @atproto/oauth-scopes@0.1.0
15
+ - @atproto/lexicon-resolver@0.2.0
16
+ - @atproto/did@0.2.0
17
+ - @atproto-labs/simple-store@0.3.0
18
+ - @atproto-labs/fetch-node@0.1.10
19
+ - @atproto/oauth-provider-frontend@0.1.12
20
+ - @atproto/oauth-provider-ui@0.2.1
21
+ - @atproto-labs/simple-store-memory@0.1.4
22
+
23
+ ## 0.10.2
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [[`8a88e2c15`](https://github.com/bluesky-social/atproto/commit/8a88e2c15451f5e8239400eeb277ad31d178b8e6), [`8a88e2c15`](https://github.com/bluesky-social/atproto/commit/8a88e2c15451f5e8239400eeb277ad31d178b8e6)]:
28
+ - @atproto/jwk@0.5.0
29
+ - @atproto/jwk-jose@0.1.10
30
+ - @atproto/oauth-provider-api@0.2.1
31
+ - @atproto/oauth-types@0.4.1
32
+ - @atproto/oauth-provider-frontend@0.1.12
33
+ - @atproto/oauth-provider-ui@0.2.1
34
+
3
35
  ## 0.10.1
4
36
 
5
37
  ### Patch Changes
@@ -44,5 +44,7 @@ export declare const DPOP_NONCE_MAX_AGE: number;
44
44
  export declare const SESSION_FIXATION_MAX_AGE: number;
45
45
  /** 1 day */
46
46
  export declare const CODE_CHALLENGE_REPLAY_TIMEFRAME: number;
47
+ /** 5 minutes */
48
+ export declare const LEXICON_REFRESH_FREQUENCY: number;
47
49
  export declare const NODE_ENV: string;
48
50
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,SAAS,CAAA;AACtC,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAExC,eAAO,MAAM,iBAAiB,SAAS,CAAA;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAA;AAEzC,eAAO,MAAM,o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";
2
2
  // The purpose of the prefix is to provide type safety
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.NODE_ENV = exports.CODE_CHALLENGE_REPLAY_TIMEFRAME = exports.SESSION_FIXATION_MAX_AGE = exports.DPOP_NONCE_MAX_AGE = exports.CLIENT_ASSERTION_MAX_AGE = exports.JAR_MAX_AGE = exports.PAR_EXPIRES_IN = exports.CONFIDENTIAL_CLIENT_REFRESH_LIFETIME = exports.CONFIDENTIAL_CLIENT_SESSION_LIFETIME = exports.PUBLIC_CLIENT_REFRESH_LIFETIME = exports.PUBLIC_CLIENT_SESSION_LIFETIME = exports.AUTHORIZATION_INACTIVITY_TIMEOUT = exports.TOKEN_MAX_AGE = exports.EPHEMERAL_SESSION_MAX_AGE = exports.AUTHENTICATION_MAX_AGE = exports.CODE_BYTES_LENGTH = exports.CODE_PREFIX = exports.REQUEST_ID_BYTES_LENGTH = exports.REQUEST_ID_PREFIX = exports.TOKEN_ID_BYTES_LENGTH = exports.TOKEN_ID_PREFIX = exports.REFRESH_TOKEN_BYTES_LENGTH = exports.REFRESH_TOKEN_PREFIX = exports.SESSION_ID_BYTES_LENGTH = exports.SESSION_ID_PREFIX = exports.DEVICE_ID_BYTES_LENGTH = exports.DEVICE_ID_PREFIX = void 0;
4
+ exports.NODE_ENV = exports.LEXICON_REFRESH_FREQUENCY = exports.CODE_CHALLENGE_REPLAY_TIMEFRAME = exports.SESSION_FIXATION_MAX_AGE = exports.DPOP_NONCE_MAX_AGE = exports.CLIENT_ASSERTION_MAX_AGE = exports.JAR_MAX_AGE = exports.PAR_EXPIRES_IN = exports.CONFIDENTIAL_CLIENT_REFRESH_LIFETIME = exports.CONFIDENTIAL_CLIENT_SESSION_LIFETIME = exports.PUBLIC_CLIENT_REFRESH_LIFETIME = exports.PUBLIC_CLIENT_SESSION_LIFETIME = exports.AUTHORIZATION_INACTIVITY_TIMEOUT = exports.TOKEN_MAX_AGE = exports.EPHEMERAL_SESSION_MAX_AGE = exports.AUTHENTICATION_MAX_AGE = exports.CODE_BYTES_LENGTH = exports.CODE_PREFIX = exports.REQUEST_ID_BYTES_LENGTH = exports.REQUEST_ID_PREFIX = exports.TOKEN_ID_BYTES_LENGTH = exports.TOKEN_ID_PREFIX = exports.REFRESH_TOKEN_BYTES_LENGTH = exports.REFRESH_TOKEN_PREFIX = exports.SESSION_ID_BYTES_LENGTH = exports.SESSION_ID_PREFIX = exports.DEVICE_ID_BYTES_LENGTH = exports.DEVICE_ID_PREFIX = void 0;
5
5
  exports.DEVICE_ID_PREFIX = 'dev-';
6
6
  exports.DEVICE_ID_BYTES_LENGTH = 16; // 128 bits
7
7
  exports.SESSION_ID_PREFIX = 'ses-';
@@ -55,5 +55,7 @@ exports.DPOP_NONCE_MAX_AGE = 3 * MINUTE;
55
55
  exports.SESSION_FIXATION_MAX_AGE = 5 * SECOND;
56
56
  /** 1 day */
57
57
  exports.CODE_CHALLENGE_REPLAY_TIMEFRAME = 1 * DAY;
58
+ /** 5 minutes */
59
+ exports.LEXICON_REFRESH_FREQUENCY = 5 * MINUTE;
58
60
  exports.NODE_ENV = process.env.NODE_ENV || 'production';
59
61
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;AAEzC,QAAA,gBAAgB,GAAG,MAAM,CAAA;AACzB,QAAA,sBAAsB,GAAG,EAAE,CAAA,CAAC,WAAW;AAEvC,QAAA,iBAAiB,GAAG,MAAM,CAAA;AAC1B,QAAA,uBAAuB,GAAG,EAAE,CAAA,CAAC,8CAA8C;AAE3E,QAAA,oBAAoB,GAAG,MAAM,CAAA;AAC7B,QAAA,0BAA0B,GAAG,EAAE,CAAA,CAAC,WAAW;AAE3C,QAAA,eAAe,GAAG,MAAM,CAAA;AACxB,QAAA,qBAAqB,GAAG,EAAE,CAAA,CAAC,sDAAsD;AAEjF,QAAA,iBAAiB,GAAG,MAAM,CAAA;AAC1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MAAM,CAAA;AAEpD,iBAAiB;AACJ,QAAA,aAAa,GAAG,EAAE,GAAG,MAAM,CAAA;AAExC,gBAAgB;AACH,QAAA,gCAAgC,GAAG,CAAC,GAAG,MAAM,CAAA;AAE1D,aAAa;AACA,QAAA,8BAA8B,GAAG,CAAC,GAAG,IAAI,CAAA;AAEtD,kDAAkD;AACrC,QAAA,8BAA8B,GAAG,sCAA8B,CAAA;AAE5E,cAAc;AACD,QAAA,oCAAoC,GAAG,CAAC,GAAG,IAAI,CAAA;AAE5D,eAAe;AACF,QAAA,oCAAoC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE7D,gBAAgB;AACH,QAAA,cAAc,GAAG,CAAC,GAAG,MAAM,CAAA;AAExC;;;;;;GAMG;AACU,QAAA,WAAW,GAAG,EAAE,GAAG,MAAM,CAAA;AAEtC,eAAe;AACF,QAAA,wBAAwB,GAAG,CAAC,GAAG,MAAM,CAAA;AAElD,gBAAgB;AACH,QAAA,kBAAkB,GAAG,CAAC,GAAG,MAAM,CAAA;AAE5C,gBAAgB;AACH,QAAA,wBAAwB,GAAG,CAAC,GAAG,MAAM,CAAA;AAElD,YAAY;AACC,QAAA,+BAA+B,GAAG,CAAC,GAAG,GAAG,CAAA;AAEtD,gBAAgB;AACH,QAAA,yBAAyB,GAAG,CAAC,GAAG,MAAM,CAAA;AAEtC,QAAA,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAA"}
@@ -37,26 +37,16 @@ export declare const brandingSchema: z.ZodObject<{
37
37
  primaryHue?: number | undefined;
38
38
  }>>;
39
39
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
- title: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
41
- en: z.ZodString;
42
- }, "strip", z.ZodTypeAny, {
43
- en: string;
44
- }, {
45
- en: string;
46
- }>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>]>;
40
+ title: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>]>;
47
41
  href: z.ZodString;
48
42
  rel: z.ZodOptional<z.ZodEffects<z.ZodString, "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service", string>>;
49
43
  }, "strip", z.ZodTypeAny, {
50
44
  href: string;
51
- title: string | ({
52
- en: string;
53
- } & Record<string, string | undefined>);
45
+ title: string | Record<string, string | undefined>;
54
46
  rel?: "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service" | undefined;
55
47
  }, {
56
48
  href: string;
57
- title: string | ({
58
- en: string;
59
- } & Record<string, string | undefined>);
49
+ title: string | Record<string, string | undefined>;
60
50
  rel?: string | undefined;
61
51
  }>, "many">>;
62
52
  }, "strip", z.ZodTypeAny, {
@@ -80,9 +70,7 @@ export declare const brandingSchema: z.ZodObject<{
80
70
  } | undefined;
81
71
  links?: {
82
72
  href: string;
83
- title: string | ({
84
- en: string;
85
- } & Record<string, string | undefined>);
73
+ title: string | Record<string, string | undefined>;
86
74
  rel?: "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service" | undefined;
87
75
  }[] | undefined;
88
76
  }, {
@@ -106,9 +94,7 @@ export declare const brandingSchema: z.ZodObject<{
106
94
  } | undefined;
107
95
  links?: {
108
96
  href: string;
109
- title: string | ({
110
- en: string;
111
- } & Record<string, string | undefined>);
97
+ title: string | Record<string, string | undefined>;
112
98
  rel?: string | undefined;
113
99
  }[] | undefined;
114
100
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"branding.d.ts","sourceRoot":"","sources":["../../src/customization/branding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKzB,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAC1D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"branding.d.ts","sourceRoot":"","sources":["../../src/customization/branding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKzB,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAC1D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
@@ -46,26 +46,16 @@ export declare const customizationSchema: z.ZodObject<{
46
46
  primaryHue?: number | undefined;
47
47
  }>>;
48
48
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
- title: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
50
- en: z.ZodString;
51
- }, "strip", z.ZodTypeAny, {
52
- en: string;
53
- }, {
54
- en: string;
55
- }>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>]>;
49
+ title: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>]>;
56
50
  href: z.ZodString;
57
51
  rel: z.ZodOptional<z.ZodEffects<z.ZodString, "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service", string>>;
58
52
  }, "strip", z.ZodTypeAny, {
59
53
  href: string;
60
- title: string | ({
61
- en: string;
62
- } & Record<string, string | undefined>);
54
+ title: string | Record<string, string | undefined>;
63
55
  rel?: "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service" | undefined;
64
56
  }, {
65
57
  href: string;
66
- title: string | ({
67
- en: string;
68
- } & Record<string, string | undefined>);
58
+ title: string | Record<string, string | undefined>;
69
59
  rel?: string | undefined;
70
60
  }>, "many">>;
71
61
  }, "strip", z.ZodTypeAny, {
@@ -89,9 +79,7 @@ export declare const customizationSchema: z.ZodObject<{
89
79
  } | undefined;
90
80
  links?: {
91
81
  href: string;
92
- title: string | ({
93
- en: string;
94
- } & Record<string, string | undefined>);
82
+ title: string | Record<string, string | undefined>;
95
83
  rel?: "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service" | undefined;
96
84
  }[] | undefined;
97
85
  }, {
@@ -115,9 +103,7 @@ export declare const customizationSchema: z.ZodObject<{
115
103
  } | undefined;
116
104
  links?: {
117
105
  href: string;
118
- title: string | ({
119
- en: string;
120
- } & Record<string, string | undefined>);
106
+ title: string | Record<string, string | undefined>;
121
107
  rel?: string | undefined;
122
108
  }[] | undefined;
123
109
  }>>;
@@ -167,9 +153,7 @@ export declare const customizationSchema: z.ZodObject<{
167
153
  } | undefined;
168
154
  links?: {
169
155
  href: string;
170
- title: string | ({
171
- en: string;
172
- } & Record<string, string | undefined>);
156
+ title: string | Record<string, string | undefined>;
173
157
  rel?: "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service" | undefined;
174
158
  }[] | undefined;
175
159
  } | undefined;
@@ -203,9 +187,7 @@ export declare const customizationSchema: z.ZodObject<{
203
187
  } | undefined;
204
188
  links?: {
205
189
  href: string;
206
- title: string | ({
207
- en: string;
208
- } & Record<string, string | undefined>);
190
+ title: string | Record<string, string | undefined>;
209
191
  rel?: string | undefined;
210
192
  }[] | undefined;
211
193
  } | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"customization.d.ts","sourceRoot":"","sources":["../../src/customization/customization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,mBAAmB;IAC9B;;;OAGG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AACpE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
1
+ {"version":3,"file":"customization.d.ts","sourceRoot":"","sources":["../../src/customization/customization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,mBAAmB;IAC9B;;;OAGG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AACpE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -1,25 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  export declare const linksSchema: z.ZodObject<{
3
- title: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
4
- en: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- en: string;
7
- }, {
8
- en: string;
9
- }>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>]>;
3
+ title: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>]>;
10
4
  href: z.ZodString;
11
5
  rel: z.ZodOptional<z.ZodEffects<z.ZodString, "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service", string>>;
12
6
  }, "strip", z.ZodTypeAny, {
13
7
  href: string;
14
- title: string | ({
15
- en: string;
16
- } & Record<string, string | undefined>);
8
+ title: string | Record<string, string | undefined>;
17
9
  rel?: "search" | "expect" | "manifest" | "alternate" | "author" | "canonical" | "dns-prefetch" | "external" | "help" | "icon" | "license" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "stylesheet" | "terms-of-service" | undefined;
18
10
  }, {
19
11
  href: string;
20
- title: string | ({
21
- en: string;
22
- } & Record<string, string | undefined>);
12
+ title: string | Record<string, string | undefined>;
23
13
  rel?: string | undefined;
24
14
  }>;
25
15
  export type Links = z.infer<typeof linksSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/customization/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;EAItB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA"}
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/customization/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,WAAW;;;;;;;;;;;;EAItB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA"}
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
5
5
  const build_document_js_1 = require("../lib/html/build-document.js");
6
6
  const locale_js_1 = require("../lib/util/locale.js");
7
7
  exports.linksSchema = zod_1.z.object({
8
- title: locale_js_1.localizedStringSchema,
8
+ title: zod_1.z.union([zod_1.z.string(), locale_js_1.multiLangStringSchema]),
9
9
  href: zod_1.z.string().url(),
10
10
  rel: zod_1.z.string().refine(build_document_js_1.isLinkRel, 'Invalid link rel').optional(),
11
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/customization/links.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,qEAAyD;AACzD,qDAA6D;AAEhD,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,iCAAqB;IAC5B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACtB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,6BAAS,EAAE,kBAAkB,CAAC,CAAC,QAAQ,EAAE;CACjE,CAAC,CAAA"}
1
+ {"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/customization/links.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,qEAAyD;AACzD,qDAA6D;AAEhD,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,iCAAqB,CAAC,CAAC;IACnD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACtB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,6BAAS,EAAE,kBAAkB,CAAC,CAAC,QAAQ,EAAE;CACjE,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { LexiconDoc } from '@atproto/lexicon';
2
+ export type LexiconData = {
3
+ createdAt: Date;
4
+ updatedAt: Date;
5
+ lastSucceededAt: null | Date;
6
+ uri: null | string;
7
+ lexicon: null | LexiconDoc;
8
+ };
9
+ //# sourceMappingURL=lexicon-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-data.d.ts","sourceRoot":"","sources":["../../src/lexicon/lexicon-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,eAAe,EAAE,IAAI,GAAG,IAAI,CAAA;IAC5B,GAAG,EAAE,IAAI,GAAG,MAAM,CAAA;IAClB,OAAO,EAAE,IAAI,GAAG,UAAU,CAAA;CAC3B,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=lexicon-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-data.js","sourceRoot":"","sources":["../../src/lexicon/lexicon-data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { LexiconResolver } from '@atproto/lexicon-resolver';
2
+ import { Nsid } from '@atproto/oauth-scopes';
3
+ import { CachedGetter } from '@atproto-labs/simple-store';
4
+ import { LexiconData, LexiconStore } from './lexicon-store.js';
5
+ /**
6
+ * This utility class handles the retrieval and caching of lexicon
7
+ * data. In particular, it handles failed retrieval attempts by returning cached
8
+ * data.
9
+ *
10
+ * @private
11
+ */
12
+ export declare class LexiconGetter extends CachedGetter<Nsid, LexiconData> {
13
+ constructor(store: LexiconStore, resolver?: LexiconResolver);
14
+ }
15
+ //# sourceMappingURL=lexicon-getter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-getter.d.ts","sourceRoot":"","sources":["../../src/lexicon/lexicon-getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE9D;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC;gBACpD,KAAK,EAAE,YAAY,EAAE,QAAQ,GAAE,eAAgC;CA2C5E"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LexiconGetter = void 0;
4
+ const lexicon_resolver_1 = require("@atproto/lexicon-resolver");
5
+ const simple_store_1 = require("@atproto-labs/simple-store");
6
+ const constants_js_1 = require("../constants.js");
7
+ /**
8
+ * This utility class handles the retrieval and caching of lexicon
9
+ * data. In particular, it handles failed retrieval attempts by returning cached
10
+ * data.
11
+ *
12
+ * @private
13
+ */
14
+ class LexiconGetter extends simple_store_1.CachedGetter {
15
+ constructor(store, resolver = lexicon_resolver_1.resolveLexicon) {
16
+ super(async (input, options, storedData) => {
17
+ const now = new Date();
18
+ // @TODO We would want to be able to explicit that the Lexicon needs
19
+ // to be fresh, which is not possible yet with the current interface
20
+ // of LexiconResolver.
21
+ const result = await resolver(input).catch((err) => {
22
+ // We swallow LexiconResolutionError errors, returning potentially
23
+ // "null" values here to avoid hammering the resolver with requests
24
+ // for the same lexicon that is known to be unavailable. The getter
25
+ // should be called again based on the isStale() function below.
26
+ if (err instanceof lexicon_resolver_1.LexiconResolutionError)
27
+ return undefined;
28
+ // Unexpected error are propagated
29
+ throw err;
30
+ });
31
+ return {
32
+ // Keep original createdAt, if available
33
+ createdAt: storedData?.createdAt ?? now,
34
+ // Always update updatedAt
35
+ updatedAt: now,
36
+ // Update the data with fresh data, if available, or keep cached
37
+ // values (if any) otherwise.
38
+ lastSucceededAt: result ? now : storedData?.lastSucceededAt ?? null,
39
+ uri: result ? result.uri.toString() : storedData?.uri ?? null,
40
+ lexicon: result ? result.lexicon : storedData?.lexicon ?? null,
41
+ };
42
+ }, {
43
+ set: async (nsid, data) => store.storeLexicon(nsid, data),
44
+ get: async (nsid) => (await store.findLexicon(nsid)) ?? undefined,
45
+ del: async (nsid) => store.deleteLexicon(nsid),
46
+ }, {
47
+ isStale: (nsid, data) => {
48
+ const timeSinceLastUpdate = Date.now() - data.updatedAt.getTime();
49
+ return timeSinceLastUpdate >= constants_js_1.LEXICON_REFRESH_FREQUENCY;
50
+ },
51
+ });
52
+ }
53
+ }
54
+ exports.LexiconGetter = LexiconGetter;
55
+ //# sourceMappingURL=lexicon-getter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-getter.js","sourceRoot":"","sources":["../../src/lexicon/lexicon-getter.ts"],"names":[],"mappings":";;;AAAA,gEAIkC;AAElC,6DAAyD;AACzD,kDAA2D;AAG3D;;;;;;GAMG;AACH,MAAa,aAAc,SAAQ,2BAA+B;IAChE,YAAY,KAAmB,EAAE,WAA4B,iCAAc;QACzE,KAAK,CACH,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE;YACnC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;YACtB,oEAAoE;YACpE,oEAAoE;YACpE,sBAAsB;YACtB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACjD,kEAAkE;gBAClE,mEAAmE;gBACnE,mEAAmE;gBACnE,gEAAgE;gBAChE,IAAI,GAAG,YAAY,yCAAsB;oBAAE,OAAO,SAAS,CAAA;gBAE3D,kCAAkC;gBAClC,MAAM,GAAG,CAAA;YACX,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,wCAAwC;gBACxC,SAAS,EAAE,UAAU,EAAE,SAAS,IAAI,GAAG;gBACvC,0BAA0B;gBAC1B,SAAS,EAAE,GAAG;gBACd,gEAAgE;gBAChE,6BAA6B;gBAC7B,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,eAAe,IAAI,IAAI;gBACnE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,IAAI,IAAI;gBAC7D,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI;aAC/D,CAAA;QACH,CAAC,EACD;YACE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC;YACzD,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,SAAS;YACjE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC;SAC/C,EACD;YACE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;gBACtB,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;gBACjE,OAAO,mBAAmB,IAAI,wCAAyB,CAAA;YACzD,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AA5CD,sCA4CC"}
@@ -0,0 +1,60 @@
1
+ import { LexPermissionSet } from '@atproto/lexicon';
2
+ import { LexiconResolver } from '@atproto/lexicon-resolver';
3
+ import { IncludeScope, Nsid } from '@atproto/oauth-scopes';
4
+ import { LexiconGetter } from './lexicon-getter.js';
5
+ import { LexiconStore } from './lexicon-store.js';
6
+ export * from './lexicon-store.js';
7
+ export declare class LexiconManager {
8
+ protected readonly lexiconGetter: LexiconGetter;
9
+ constructor(store: LexiconStore, resolveLexicon?: LexiconResolver);
10
+ getPermissionSetsFromScope(scope?: string): Promise<Map<string, {
11
+ type: "permission-set";
12
+ permissions: ({
13
+ type: "permission";
14
+ resource: string;
15
+ } & Record<string, string | number | boolean | (string | number | boolean)[] | undefined>)[];
16
+ description?: string | undefined;
17
+ title?: string | undefined;
18
+ 'title:lang'?: Record<string, string | undefined> | undefined;
19
+ detail?: string | undefined;
20
+ 'detail:lang'?: Record<string, string | undefined> | undefined;
21
+ }>>;
22
+ /**
23
+ * Transforms a scope string from an authorization request into a scope
24
+ * composed solely of granular permission scopes, transforming any NSID
25
+ * into its corresponding permission scopes.
26
+ */
27
+ buildTokenScope(scope: string): Promise<string>;
28
+ /**
29
+ * Given a list of scope values, extract those that are NSIDs and return their
30
+ * corresponding permission sets.
31
+ */
32
+ protected extractPermissionSets(includeScopes: IncludeScope[]): Promise<Map<string, {
33
+ type: "permission-set";
34
+ permissions: ({
35
+ type: "permission";
36
+ resource: string;
37
+ } & Record<string, string | number | boolean | (string | number | boolean)[] | undefined>)[];
38
+ description?: string | undefined;
39
+ title?: string | undefined;
40
+ 'title:lang'?: Record<string, string | undefined> | undefined;
41
+ detail?: string | undefined;
42
+ 'detail:lang'?: Record<string, string | undefined> | undefined;
43
+ }>>;
44
+ protected getPermissionSets(nsids: Set<Nsid>): Promise<Map<string, {
45
+ type: "permission-set";
46
+ permissions: ({
47
+ type: "permission";
48
+ resource: string;
49
+ } & Record<string, string | number | boolean | (string | number | boolean)[] | undefined>)[];
50
+ description?: string | undefined;
51
+ title?: string | undefined;
52
+ 'title:lang'?: Record<string, string | undefined> | undefined;
53
+ detail?: string | undefined;
54
+ 'detail:lang'?: Record<string, string | undefined> | undefined;
55
+ }>>;
56
+ protected getPermissionSetEntry(nsid: Nsid): Promise<[nsid: Nsid, permissionSet: LexPermissionSet]>;
57
+ protected getPermissionSet(nsid: Nsid): Promise<LexPermissionSet>;
58
+ }
59
+ export declare function nsidToPermissionScopes(this: Map<string, LexPermissionSet>, includeScope: IncludeScope): string[];
60
+ //# sourceMappingURL=lexicon-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-manager.d.ts","sourceRoot":"","sources":["../../src/lexicon/lexicon-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAEL,eAAe,EAChB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,cAAc,oBAAoB,CAAA;AAElC,qBAAa,cAAc;IACzB,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;gBAEnC,KAAK,EAAE,YAAY,EAAE,cAAc,CAAC,EAAE,eAAe;IAIpD,0BAA0B,CAAC,KAAK,CAAC,EAAE,MAAM;;;;;;;;;;;;IAKtD;;;;OAIG;IACU,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAc5D;;;OAGG;cACa,qBAAqB,CAAC,aAAa,EAAE,YAAY,EAAE;;;;;;;;;;;;cAKnD,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC;;;;;;;;;;;;cAMlC,qBAAqB,CACnC,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAC;cAKzC,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAcxE;AA+BD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACnC,YAAY,EAAE,YAAY,GACzB,MAAM,EAAE,CAGV"}
@@ -0,0 +1,105 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.LexiconManager = void 0;
18
+ exports.nsidToPermissionScopes = nsidToPermissionScopes;
19
+ const lexicon_resolver_1 = require("@atproto/lexicon-resolver");
20
+ const oauth_scopes_1 = require("@atproto/oauth-scopes");
21
+ const lexicon_getter_js_1 = require("./lexicon-getter.js");
22
+ __exportStar(require("./lexicon-store.js"), exports);
23
+ class LexiconManager {
24
+ lexiconGetter;
25
+ constructor(store, resolveLexicon) {
26
+ this.lexiconGetter = new lexicon_getter_js_1.LexiconGetter(store, resolveLexicon);
27
+ }
28
+ async getPermissionSetsFromScope(scope) {
29
+ const { includeScopes } = parseScope(scope);
30
+ return this.extractPermissionSets(includeScopes);
31
+ }
32
+ /**
33
+ * Transforms a scope string from an authorization request into a scope
34
+ * composed solely of granular permission scopes, transforming any NSID
35
+ * into its corresponding permission scopes.
36
+ */
37
+ async buildTokenScope(scope) {
38
+ const { includeScopes, otherScopes } = parseScope(scope);
39
+ // If the scope does not contain any "include:<nsid>" scopes, return it as-is.
40
+ if (!includeScopes.length)
41
+ return scope;
42
+ const permissionSets = await this.extractPermissionSets(includeScopes);
43
+ return Array.from(includeScopes)
44
+ .flatMap(nsidToPermissionScopes, permissionSets)
45
+ .concat(otherScopes)
46
+ .join(' ');
47
+ }
48
+ /**
49
+ * Given a list of scope values, extract those that are NSIDs and return their
50
+ * corresponding permission sets.
51
+ */
52
+ async extractPermissionSets(includeScopes) {
53
+ const nsids = extractNsids(includeScopes);
54
+ return this.getPermissionSets(nsids);
55
+ }
56
+ async getPermissionSets(nsids) {
57
+ return new Map(await Promise.all(Array.from(nsids, this.getPermissionSetEntry, this)));
58
+ }
59
+ async getPermissionSetEntry(nsid) {
60
+ const permissionSet = await this.getPermissionSet(nsid);
61
+ return [nsid, permissionSet];
62
+ }
63
+ async getPermissionSet(nsid) {
64
+ const { lexicon } = await this.lexiconGetter.get(nsid);
65
+ if (!lexicon) {
66
+ throw lexicon_resolver_1.LexiconResolutionError.from(nsid);
67
+ }
68
+ if (lexicon.defs.main?.type !== 'permission-set') {
69
+ const description = 'Lexicon document is not a permission set';
70
+ throw lexicon_resolver_1.LexiconResolutionError.from(nsid, description);
71
+ }
72
+ return lexicon.defs.main;
73
+ }
74
+ }
75
+ exports.LexiconManager = LexiconManager;
76
+ function parseScope(scope) {
77
+ const includeScopes = [];
78
+ const otherScopes = [];
79
+ if (scope) {
80
+ for (const scopeValue of scope.split(' ')) {
81
+ const parsed = oauth_scopes_1.IncludeScope.fromString(scopeValue);
82
+ if (parsed) {
83
+ includeScopes.push(parsed);
84
+ }
85
+ else {
86
+ otherScopes.push(scopeValue);
87
+ }
88
+ }
89
+ }
90
+ return {
91
+ includeScopes,
92
+ otherScopes,
93
+ };
94
+ }
95
+ function extractNsids(includeScopes) {
96
+ return new Set(Array.from(includeScopes, extractNsid));
97
+ }
98
+ function extractNsid(nsidScope) {
99
+ return nsidScope.nsid;
100
+ }
101
+ function nsidToPermissionScopes(includeScope) {
102
+ const permissionSet = this.get(includeScope.nsid);
103
+ return includeScope.toPermissions(permissionSet).map(String);
104
+ }
105
+ //# sourceMappingURL=lexicon-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-manager.js","sourceRoot":"","sources":["../../src/lexicon/lexicon-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA6GA,wDAMC;AAlHD,gEAGkC;AAClC,wDAA0D;AAC1D,2DAAmD;AAGnD,qDAAkC;AAElC,MAAa,cAAc;IACN,aAAa,CAAe;IAE/C,YAAY,KAAmB,EAAE,cAAgC;QAC/D,IAAI,CAAC,aAAa,GAAG,IAAI,iCAAa,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;IAC/D,CAAC;I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E1B,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAE,CAAA;IAClD,OAAO,YAAY,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AAC9D,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { LexiconDoc } from '@atproto/lexicon';
2
+ import { Awaitable } from '../lib/util/type.js';
3
+ import { LexiconData } from './lexicon-data.js';
4
+ export type { Awaitable, LexiconData, LexiconDoc };
5
+ export interface LexiconStore {
6
+ findLexicon(nsid: string): Awaitable<LexiconData | null>;
7
+ storeLexicon(nsid: string, data: LexiconData): Awaitable<void>;
8
+ deleteLexicon(nsid: string): Awaitable<void>;
9
+ }
10
+ export declare const isLexiconStore: <V extends Partial<LexiconStore>>(value: V) => value is V & import("../lib/util/type.js").RequiredDefined<LexiconStore>;
11
+ export declare function ifLexiconStore<V extends Partial<LexiconStore>>(implementation?: V): (V & LexiconStore) | undefined;
12
+ export declare function asLexiconStore<V extends Partial<LexiconStore>>(implementation?: V): V & LexiconStore;
13
+ //# sourceMappingURL=lexicon-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-store.d.ts","sourceRoot":"","sources":["../../src/lexicon/lexicon-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAyB,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,CAAA;AAElD,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACxD,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9D,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;CAC7C;AAED,eAAO,MAAM,cAAc,yHAIzB,CAAA;AAEF,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,CAAC,YAAY,CAAC,EAC5D,cAAc,CAAC,EAAE,CAAC,GACjB,CAAC,CAAC,GAAG,YAAY,CAAC,GAAG,SAAS,CAMhC;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,CAAC,YAAY,CAAC,EAC5D,cAAc,CAAC,EAAE,CAAC,GACjB,CAAC,GAAG,YAAY,CAKlB"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isLexiconStore = void 0;
4
+ exports.ifLexiconStore = ifLexiconStore;
5
+ exports.asLexiconStore = asLexiconStore;
6
+ const type_js_1 = require("../lib/util/type.js");
7
+ exports.isLexiconStore = (0, type_js_1.buildInterfaceChecker)([
8
+ 'findLexicon',
9
+ 'storeLexicon',
10
+ 'deleteLexicon',
11
+ ]);
12
+ function ifLexiconStore(implementation) {
13
+ if (implementation && (0, exports.isLexiconStore)(implementation)) {
14
+ return implementation;
15
+ }
16
+ return undefined;
17
+ }
18
+ function asLexiconStore(implementation) {
19
+ const store = ifLexiconStore(implementation);
20
+ if (store)
21
+ return store;
22
+ throw new Error('Invalid LexiconStore implementation');
23
+ }
24
+ //# sourceMappingURL=lexicon-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicon-store.js","sourceRoot":"","sources":["../../src/lexicon/lexicon-store.ts"],"names":[],"mappings":";;;AAkBA,wCAQC;AAED,wCAOC;AAlCD,iDAAsE;AAWzD,QAAA,cAAc,GAAG,IAAA,+BAAqB,EAAe;IAChE,aAAa;IACb,cAAc;IACd,eAAe;CAChB,CAAC,CAAA;AAEF,SAAgB,cAAc,CAC5B,cAAkB;IAElB,IAAI,cAAc,IAAI,IAAA,sBAAc,EAAC,cAAc,CAAC,EAAE,CAAC;QACrD,OAAO,cAAc,CAAA;IACvB,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,cAAc,CAC5B,cAAkB;IAElB,MAAM,KAAK,GAAG,cAAc,CAAC,cAAc,CAAC,CAAA;IAC5C,IAAI,KAAK;QAAE,OAAO,KAAK,CAAA;IAEvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;AACxD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hydration-data.d.ts","sourceRoot":"","sources":["../../../src/lib/html/hydration-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAM,MAAM,YAAY,CAAA;AAErC,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,MAAM,EAAE,CAAC,GACR,IAAI,CAEN;AAED,wBAAiB,sBAAsB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,SAAS,CAAC,IAAI,CAAC,CASjB"}
1
+ {"version":3,"file":"hydration-data.d.ts","sourceRoot":"","sources":["../../../src/lib/html/hydration-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAM,MAAM,YAAY,CAAA;AAErC,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,MAAM,EAAE,CAAC,GACR,IAAI,CAEN;AAED,wBAAiB,sBAAsB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,SAAS,CAAC,IAAI,CAAC,CAQjB"}