@owlmeans/client-auth 0.1.18-rc.8 → 0.1.18

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 (259) hide show
  1. package/README.md +283 -37
  2. package/agent-meta/manifest.json +50 -4
  3. package/agent-meta/skills/client-auth/SKILL.md +85 -23
  4. package/agent-meta/skills/client-auth/parts/login.md +77 -0
  5. package/agent-meta/skills/client-auth/parts/manager.md +37 -0
  6. package/build/components/dispatcher/component.d.ts.map +1 -1
  7. package/build/components/dispatcher/component.js +26 -6
  8. package/build/components/dispatcher/component.js.map +1 -1
  9. package/build/components/dispatcher/types.local.d.ts +7 -0
  10. package/build/components/dispatcher/types.local.d.ts.map +1 -0
  11. package/build/components/dispatcher/types.local.js +2 -0
  12. package/build/components/dispatcher/types.local.js.map +1 -0
  13. package/build/entrypoints.d.ts +7 -0
  14. package/build/entrypoints.d.ts.map +1 -0
  15. package/build/entrypoints.js +7 -0
  16. package/build/entrypoints.js.map +1 -0
  17. package/build/helper.d.ts +2 -1
  18. package/build/helper.d.ts.map +1 -1
  19. package/build/helper.js +28 -5
  20. package/build/helper.js.map +1 -1
  21. package/build/index.d.ts +1 -1
  22. package/build/index.d.ts.map +1 -1
  23. package/build/index.js +1 -1
  24. package/build/index.js.map +1 -1
  25. package/build/login/adopt/types.d.ts +26 -0
  26. package/build/login/adopt/types.d.ts.map +1 -0
  27. package/build/login/adopt/types.js +2 -0
  28. package/build/login/adopt/types.js.map +1 -0
  29. package/build/login/adopt.d.ts +7 -12
  30. package/build/login/adopt.d.ts.map +1 -1
  31. package/build/login/adopt.js +15 -14
  32. package/build/login/adopt.js.map +1 -1
  33. package/build/login/consts.d.ts +89 -4
  34. package/build/login/consts.d.ts.map +1 -1
  35. package/build/login/consts.js +93 -5
  36. package/build/login/consts.js.map +1 -1
  37. package/build/login/consts.local.d.ts +16 -0
  38. package/build/login/consts.local.d.ts.map +1 -0
  39. package/build/login/consts.local.js +30 -0
  40. package/build/login/consts.local.js.map +1 -0
  41. package/build/login/credit/types.d.ts +7 -0
  42. package/build/login/credit/types.d.ts.map +1 -0
  43. package/build/login/credit/types.js +2 -0
  44. package/build/login/credit/types.js.map +1 -0
  45. package/build/login/credit.d.ts +19 -0
  46. package/build/login/credit.d.ts.map +1 -0
  47. package/build/login/credit.js +58 -0
  48. package/build/login/credit.js.map +1 -0
  49. package/build/login/env/types.d.ts +35 -0
  50. package/build/login/env/types.d.ts.map +1 -0
  51. package/build/login/env/types.js +2 -0
  52. package/build/login/env/types.js.map +1 -0
  53. package/build/login/env.d.ts +5 -29
  54. package/build/login/env.d.ts.map +1 -1
  55. package/build/login/env.js +63 -80
  56. package/build/login/env.js.map +1 -1
  57. package/build/login/flow.d.ts +20 -0
  58. package/build/login/flow.d.ts.map +1 -0
  59. package/build/login/flow.js +39 -0
  60. package/build/login/flow.js.map +1 -0
  61. package/build/login/hook.d.ts +30 -4
  62. package/build/login/hook.d.ts.map +1 -1
  63. package/build/login/hook.js +53 -18
  64. package/build/login/hook.js.map +1 -1
  65. package/build/login/i18n/be.json +41 -0
  66. package/build/login/i18n/de.json +41 -0
  67. package/build/login/i18n/en.json +41 -0
  68. package/build/login/i18n/es.json +41 -0
  69. package/build/login/i18n/fr.json +41 -0
  70. package/build/login/i18n/pl.json +41 -0
  71. package/build/login/i18n/ru.json +41 -0
  72. package/build/login/i18n/uk.json +41 -0
  73. package/build/login/i18n.d.ts +2 -0
  74. package/build/login/i18n.d.ts.map +1 -0
  75. package/build/login/i18n.js +27 -0
  76. package/build/login/i18n.js.map +1 -0
  77. package/build/login/index.d.ts +20 -0
  78. package/build/login/index.d.ts.map +1 -1
  79. package/build/login/index.js +11 -0
  80. package/build/login/index.js.map +1 -1
  81. package/build/login/land/types.d.ts +52 -0
  82. package/build/login/land/types.d.ts.map +1 -0
  83. package/build/login/land/types.js +2 -0
  84. package/build/login/land/types.js.map +1 -0
  85. package/build/login/land.d.ts +6 -0
  86. package/build/login/land.d.ts.map +1 -0
  87. package/build/login/land.js +122 -0
  88. package/build/login/land.js.map +1 -0
  89. package/build/login/methods/types.d.ts +30 -0
  90. package/build/login/methods/types.d.ts.map +1 -0
  91. package/build/login/methods/types.js +2 -0
  92. package/build/login/methods/types.js.map +1 -0
  93. package/build/login/methods.d.ts +7 -0
  94. package/build/login/methods.d.ts.map +1 -0
  95. package/build/login/methods.js +87 -0
  96. package/build/login/methods.js.map +1 -0
  97. package/build/login/resume/types.d.ts +24 -0
  98. package/build/login/resume/types.d.ts.map +1 -0
  99. package/build/login/resume/types.js +2 -0
  100. package/build/login/resume/types.js.map +1 -0
  101. package/build/login/resume.d.ts +9 -0
  102. package/build/login/resume.d.ts.map +1 -0
  103. package/build/login/resume.js +38 -0
  104. package/build/login/resume.js.map +1 -0
  105. package/build/login/screen.d.ts +17 -0
  106. package/build/login/screen.d.ts.map +1 -0
  107. package/build/login/screen.js +66 -0
  108. package/build/login/screen.js.map +1 -0
  109. package/build/login/service.d.ts +6 -5
  110. package/build/login/service.d.ts.map +1 -1
  111. package/build/login/service.js +141 -15
  112. package/build/login/service.js.map +1 -1
  113. package/build/login/start/types.d.ts +29 -0
  114. package/build/login/start/types.d.ts.map +1 -0
  115. package/build/login/start/types.js +2 -0
  116. package/build/login/start/types.js.map +1 -0
  117. package/build/login/start.d.ts +5 -0
  118. package/build/login/start.d.ts.map +1 -0
  119. package/build/login/start.js +36 -0
  120. package/build/login/start.js.map +1 -0
  121. package/build/login/surrogate/types.d.ts +9 -0
  122. package/build/login/surrogate/types.d.ts.map +1 -0
  123. package/build/login/surrogate/types.js +2 -0
  124. package/build/login/surrogate/types.js.map +1 -0
  125. package/build/login/surrogate.d.ts +13 -0
  126. package/build/login/surrogate.d.ts.map +1 -0
  127. package/build/login/surrogate.js +33 -0
  128. package/build/login/surrogate.js.map +1 -0
  129. package/build/login/terms/types.d.ts +112 -0
  130. package/build/login/terms/types.d.ts.map +1 -0
  131. package/build/login/terms/types.js +2 -0
  132. package/build/login/terms/types.js.map +1 -0
  133. package/build/login/terms-config.d.ts +65 -0
  134. package/build/login/terms-config.d.ts.map +1 -0
  135. package/build/login/terms-config.js +2 -0
  136. package/build/login/terms-config.js.map +1 -0
  137. package/build/login/terms.d.ts +21 -0
  138. package/build/login/terms.d.ts.map +1 -0
  139. package/build/login/terms.js +235 -0
  140. package/build/login/terms.js.map +1 -0
  141. package/build/login/types.d.ts +223 -16
  142. package/build/login/types.d.ts.map +1 -1
  143. package/build/login/types.js +1 -16
  144. package/build/login/types.js.map +1 -1
  145. package/build/manager/components/authentication/control.d.ts.map +1 -1
  146. package/build/manager/components/authentication/control.js +3 -3
  147. package/build/manager/components/authentication/control.js.map +1 -1
  148. package/build/manager/components/authentication/types.d.ts +2 -2
  149. package/build/manager/components/authentication/types.d.ts.map +1 -1
  150. package/build/manager/components/tunnel-consumer.js +2 -2
  151. package/build/manager/components/tunnel-consumer.js.map +1 -1
  152. package/build/manager/entrypoints.d.ts +11 -0
  153. package/build/manager/entrypoints.d.ts.map +1 -0
  154. package/build/manager/entrypoints.js +17 -0
  155. package/build/manager/entrypoints.js.map +1 -0
  156. package/build/manager/errors.d.ts.map +1 -1
  157. package/build/manager/errors.js.map +1 -1
  158. package/build/manager/plugins/basic-ed25519.d.ts.map +1 -1
  159. package/build/manager/plugins/basic-ed25519.js +5 -0
  160. package/build/manager/plugins/basic-ed25519.js.map +1 -1
  161. package/build/manager/plugins/exports.d.ts +3 -0
  162. package/build/manager/plugins/exports.d.ts.map +1 -1
  163. package/build/manager/plugins/exports.js +2 -0
  164. package/build/manager/plugins/exports.js.map +1 -1
  165. package/build/manager/plugins/index.d.ts +2 -5
  166. package/build/manager/plugins/index.d.ts.map +1 -1
  167. package/build/manager/plugins/index.js +9 -1
  168. package/build/manager/plugins/index.js.map +1 -1
  169. package/build/manager/plugins/methods.d.ts +6 -0
  170. package/build/manager/plugins/methods.d.ts.map +1 -0
  171. package/build/manager/plugins/methods.js +65 -0
  172. package/build/manager/plugins/methods.js.map +1 -0
  173. package/build/manager/plugins/re-captcha.d.ts.map +1 -1
  174. package/build/manager/plugins/re-captcha.js +5 -0
  175. package/build/manager/plugins/re-captcha.js.map +1 -1
  176. package/build/manager/plugins/registry/types.d.ts +10 -0
  177. package/build/manager/plugins/registry/types.d.ts.map +1 -0
  178. package/build/manager/plugins/registry/types.js +2 -0
  179. package/build/manager/plugins/registry/types.js.map +1 -0
  180. package/build/manager/plugins/registry.d.ts +20 -0
  181. package/build/manager/plugins/registry.d.ts.map +1 -0
  182. package/build/manager/plugins/registry.js +23 -0
  183. package/build/manager/plugins/registry.js.map +1 -0
  184. package/build/manager/plugins/tunnel/wallet.d.ts.map +1 -1
  185. package/build/manager/plugins/tunnel-consumer.d.ts.map +1 -1
  186. package/build/manager/plugins/tunnel-consumer.js +10 -3
  187. package/build/manager/plugins/tunnel-consumer.js.map +1 -1
  188. package/build/manager/plugins/types.d.ts +53 -0
  189. package/build/manager/plugins/types.d.ts.map +1 -1
  190. package/build/service.d.ts.map +1 -1
  191. package/build/service.js +1 -1
  192. package/build/service.js.map +1 -1
  193. package/package.json +33 -30
  194. package/src/components/dispatcher/component.tsx +37 -14
  195. package/src/components/dispatcher/types.local.ts +7 -0
  196. package/src/entrypoints.ts +10 -0
  197. package/src/helper.ts +31 -5
  198. package/src/index.ts +1 -1
  199. package/src/login/adopt/types.ts +25 -0
  200. package/src/login/adopt.ts +21 -14
  201. package/src/login/consts.local.ts +34 -0
  202. package/src/login/consts.ts +105 -5
  203. package/src/login/credit/types.ts +6 -0
  204. package/src/login/credit.ts +69 -0
  205. package/src/login/env/types.ts +35 -0
  206. package/src/login/env.ts +60 -72
  207. package/src/login/flow.ts +44 -0
  208. package/src/login/hook.ts +58 -22
  209. package/src/login/i18n/be.json +41 -0
  210. package/src/login/i18n/de.json +41 -0
  211. package/src/login/i18n/en.json +41 -0
  212. package/src/login/i18n/es.json +41 -0
  213. package/src/login/i18n/fr.json +41 -0
  214. package/src/login/i18n/pl.json +41 -0
  215. package/src/login/i18n/ru.json +41 -0
  216. package/src/login/i18n/uk.json +41 -0
  217. package/src/login/i18n.ts +29 -0
  218. package/src/login/index.ts +21 -0
  219. package/src/login/land/types.ts +54 -0
  220. package/src/login/land.ts +149 -0
  221. package/src/login/methods/types.ts +32 -0
  222. package/src/login/methods.ts +109 -0
  223. package/src/login/resume/types.ts +24 -0
  224. package/src/login/resume.ts +45 -0
  225. package/src/login/screen.tsx +140 -0
  226. package/src/login/service.ts +181 -18
  227. package/src/login/start/types.ts +30 -0
  228. package/src/login/start.ts +44 -0
  229. package/src/login/surrogate/types.ts +9 -0
  230. package/src/login/surrogate.ts +37 -0
  231. package/src/login/terms/types.ts +126 -0
  232. package/src/login/terms-config.ts +55 -0
  233. package/src/login/terms.ts +315 -0
  234. package/src/login/types.ts +233 -17
  235. package/src/manager/README.md +37 -80
  236. package/src/manager/components/authentication/control.ts +3 -3
  237. package/src/manager/components/authentication/types.ts +2 -2
  238. package/src/manager/components/tunnel-consumer.tsx +2 -2
  239. package/src/manager/entrypoints.ts +18 -0
  240. package/src/manager/plugins/basic-ed25519.tsx +7 -0
  241. package/src/manager/plugins/exports.ts +3 -0
  242. package/src/manager/plugins/index.ts +11 -4
  243. package/src/manager/plugins/methods.ts +74 -0
  244. package/src/manager/plugins/re-captcha.tsx +7 -0
  245. package/src/manager/plugins/registry/types.ts +10 -0
  246. package/src/manager/plugins/registry.ts +33 -0
  247. package/src/manager/plugins/tunnel-consumer.tsx +12 -3
  248. package/src/manager/plugins/types.ts +54 -0
  249. package/src/service.ts +1 -1
  250. package/tests/context.ts +1 -2
  251. package/tests/i18n.spec.ts +68 -0
  252. package/tests/land.spec.ts +292 -0
  253. package/tests/login.spec.ts +332 -0
  254. package/tests/target.spec.ts +210 -0
  255. package/tests/terms-deferred.spec.ts +65 -0
  256. package/tests/terms.spec.ts +314 -0
  257. package/build/.gitkeep +0 -0
  258. package/src/manager/modules.ts +0 -18
  259. package/src/modules.ts +0 -13
@@ -1,8 +1,12 @@
1
1
  import { createLazyService } from '@owlmeans/context';
2
- import { DEFAULT_ALIAS } from './consts.js';
3
- import { defaultLoginEnv } from './env.js';
4
- import { adoptToken } from './adopt.js';
5
- import { LoginOutcome } from './types.js';
2
+ import { flowLandingOf } from '@owlmeans/client-flow';
3
+ import { logger } from '@owlmeans/log';
4
+ import { DEFAULT_ALIAS, LOGIN_TARGET_TTL, LoginOutcome } from './consts.js';
5
+ import { UNSIGNED_OUTCOMES } from './consts.local.js';
6
+ import { loginEnvHelper } from './env.js';
7
+ import { loginTokenOf } from './adopt.js';
8
+ import { loginMethodsHelper } from './methods.js';
9
+ const log = logger('client-auth:login');
6
10
  /**
7
11
  * Login service = plugin host. It holds a registry of login plugins and, on every facade call,
8
12
  * resolves the active plugin by cascade (priority desc, first whose `match(env)` is truthy) and
@@ -16,13 +20,51 @@ import { LoginOutcome } from './types.js';
16
20
  * stage. `context.service()` throws for an uninitialized non-lazy service, which would make
17
21
  * `ensureLoginService` fail exactly where apps are told to call it.
18
22
  *
19
- * `begin` is deliberately NOT `async`. An async facade method defers the plugin's body past a
20
- * microtask boundary, and a `window.open` that lands after the user gesture has finished being
21
- * handled is eaten by the popup blocker. The same rule binds every plugin's own `begin`.
23
+ * `begin` and `logout` are deliberately NOT `async`. An async facade method defers the plugin's
24
+ * body past a microtask boundary, and a `window.open` that lands after the user gesture has
25
+ * finished being handled is eaten by the popup blocker. The same rule binds every plugin's own
26
+ * `begin` and `logout`, and it is why a precondition must be synchronous too.
22
27
  */
23
28
  export const makeLoginService = (alias = DEFAULT_ALIAS) => {
24
29
  const plugins = [];
30
+ const preconditions = [];
31
+ const methodSources = [];
32
+ const steps = [];
33
+ const hooks = [];
34
+ let screen = null;
35
+ let notifier = null;
25
36
  const ctx = () => service.ctx;
37
+ /**
38
+ * Park `request.target` for the post-sign-in landing, and hand back the request whose continuation
39
+ * waits for that write.
40
+ *
41
+ * The write is STARTED here and never awaited on the way in: `begin` must reach the plugin's
42
+ * `window.open` inside the gesture. Only the continuation waits — the redirect plugin's in-app hop
43
+ * to the dispatcher and the surrogate's hop after the popup has handed its token back — so the
44
+ * dispatcher that resumes the landing always finds the record, whatever the storage behind it.
45
+ * A write that fails costs the landing, never the sign-in.
46
+ */
47
+ const parkTarget = (ctx, request) => {
48
+ if (request.target == null || request.target === '') {
49
+ return [request, null];
50
+ }
51
+ const parked = flowLandingOf(ctx).suspendLanding({ entrypoint: request.target, query: {} }, { expiresAt: Date.now() + LOGIN_TARGET_TTL }).catch((error) => {
52
+ log.warn('Could not park the sign-in target; the landing falls back', {
53
+ target: request.target, error,
54
+ });
55
+ return false;
56
+ });
57
+ const navigate = request.navigate;
58
+ return [
59
+ navigate == null ? request : {
60
+ ...request, navigate: async () => {
61
+ await parked;
62
+ await navigate();
63
+ },
64
+ },
65
+ parked,
66
+ ];
67
+ };
26
68
  const service = createLazyService(alias, {
27
69
  registerPlugin: (plugin) => {
28
70
  const existing = plugins.findIndex(candidate => candidate.alias === plugin.alias);
@@ -32,32 +74,116 @@ export const makeLoginService = (alias = DEFAULT_ALIAS) => {
32
74
  plugins.push(plugin);
33
75
  plugins.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
34
76
  },
77
+ registerPrecondition: (precondition) => {
78
+ const existing = preconditions.findIndex(candidate => candidate.alias === precondition.alias);
79
+ if (existing >= 0) {
80
+ preconditions.splice(existing, 1);
81
+ }
82
+ preconditions.push(precondition);
83
+ preconditions.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
84
+ },
85
+ registerMethodSource: (source) => {
86
+ const existing = methodSources.findIndex(candidate => candidate.alias === source.alias);
87
+ if (existing >= 0) {
88
+ methodSources.splice(existing, 1);
89
+ }
90
+ methodSources.push(source);
91
+ },
92
+ methods: methodCtx => loginMethodsHelper.resolveLoginMethods(methodCtx, methodCtx.context.cfg.security?.auth?.login, methodSources),
93
+ registerScreen: value => { screen = value; },
94
+ screen: () => screen,
95
+ registerNotifier: value => { notifier = value; },
96
+ registerStep: (step) => {
97
+ const existing = steps.findIndex(candidate => candidate.alias === step.alias);
98
+ if (existing >= 0) {
99
+ steps.splice(existing, 1);
100
+ }
101
+ steps.push(step);
102
+ steps.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
103
+ },
104
+ steps: () => [...steps],
105
+ onLanded: (hook) => {
106
+ const existing = hooks.findIndex(candidate => candidate.alias === hook.alias);
107
+ if (existing >= 0) {
108
+ hooks.splice(existing, 1);
109
+ }
110
+ hooks.push(hook);
111
+ hooks.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
112
+ },
113
+ landingHooks: () => [...hooks],
35
114
  plugin: env => {
36
- const environment = env ?? defaultLoginEnv();
115
+ const environment = env ?? loginEnvHelper.defaultLoginEnv();
37
116
  const plugin = plugins.find(candidate => candidate.match?.(environment, service.ctx) ?? true);
38
117
  if (plugin == null) {
39
118
  throw new Error('login: no plugin matches the current environment');
40
119
  }
41
120
  return plugin;
42
121
  },
43
- env: () => defaultLoginEnv(),
122
+ env: () => loginEnvHelper.defaultLoginEnv(),
44
123
  enter: () => {
45
- const env = defaultLoginEnv();
124
+ const env = loginEnvHelper.defaultLoginEnv();
46
125
  service.plugin(env).enter?.(ctx(), env);
47
126
  },
48
127
  begin: request => {
49
- const env = defaultLoginEnv();
50
- return service.plugin(env).begin(ctx(), request, env);
128
+ const env = loginEnvHelper.defaultLoginEnv();
129
+ // Synchronously, before anything can open a window: a precondition that refuses leaves the
130
+ // user exactly where `Gesture` describes — unable to proceed until they act again.
131
+ for (const precondition of preconditions) {
132
+ if (!precondition.check(ctx(), request, env)) {
133
+ return Promise.resolve(LoginOutcome.Gesture);
134
+ }
135
+ }
136
+ // Parked only past the preconditions: a refused attempt leaves no landing behind for the
137
+ // next, unrelated sign-in to resume.
138
+ const [parkedRequest, parked] = parkTarget(ctx(), request);
139
+ // Notified here, in the facade, rather than by each caller: `useLogin` fires the flow and
140
+ // forgets the result, and this is the one place every caller — the header hook and the
141
+ // sign-in screen's method buttons alike — passes through on the way to a settled outcome.
142
+ return service.plugin(env).begin(ctx(), parkedRequest, env).then(outcome => {
143
+ if (parked != null && UNSIGNED_OUTCOMES.has(outcome)) {
144
+ void parked.then(async () => {
145
+ await flowLandingOf(ctx()).discardSuspendedLanding();
146
+ });
147
+ }
148
+ notifier?.(outcome, env);
149
+ return outcome;
150
+ });
51
151
  },
52
152
  authorize: async (url) => {
53
- const env = defaultLoginEnv();
153
+ const env = loginEnvHelper.defaultLoginEnv();
54
154
  return await service.plugin(env).authorize(ctx(), url, env);
55
155
  },
56
156
  complete: async (token) => {
57
- const env = defaultLoginEnv();
157
+ const env = loginEnvHelper.defaultLoginEnv();
58
158
  return await service.plugin(env).complete(ctx(), token, env);
59
159
  },
60
- adopt: async (token) => { await adoptToken(ctx(), token); },
160
+ resume: async (token) => {
161
+ const env = loginEnvHelper.defaultLoginEnv();
162
+ // Absent means "keep it and carry on" — which is what an ordinary tab has always done, and
163
+ // is why the redirect plugin implements nothing here.
164
+ return await service.plugin(env).resume?.(ctx(), token, env) ?? LoginOutcome.Passed;
165
+ },
166
+ logout: request => {
167
+ const env = loginEnvHelper.defaultLoginEnv();
168
+ const plugin = service.plugin(env);
169
+ if (plugin.logout == null) {
170
+ // A plugin with no logout mechanic still has to end the session it started.
171
+ return loginTokenOf(ctx()).revokeToken().then(async () => {
172
+ await request.navigate?.();
173
+ return LoginOutcome.Passed;
174
+ });
175
+ }
176
+ return plugin.logout(ctx(), request, env).then(outcome => {
177
+ notifier?.(outcome, env);
178
+ return outcome;
179
+ });
180
+ },
181
+ logoutComplete: async () => {
182
+ const env = loginEnvHelper.defaultLoginEnv();
183
+ return await service.plugin(env).logoutComplete?.(ctx(), env) ?? LoginOutcome.Passed;
184
+ },
185
+ adopt: async (token) => { await loginTokenOf(ctx()).adoptToken(token); },
186
+ revoke: async () => { await loginTokenOf(ctx()).revokeToken(); },
61
187
  });
62
188
  return service;
63
189
  };
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/login/service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GAA6B,CAAA;IAChD,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAe,aAAa,CAAC,CAAA;IAEjE,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { LoginOutcome } from '../consts.js';
2
+ /** What a "Log in" control hands `startLogin`: where the flow starts, where it lands, how to move. */
3
+ export interface LoginStart {
4
+ /** The resolved dispatcher path — where the login flow starts. */
5
+ url: string;
6
+ /** Entrypoint alias to land on once signed in; absent means the ordinary landing. */
7
+ target?: string;
8
+ /** The in-app navigation, supplied by a component because only a component may hold one. */
9
+ go: (alias: string) => void | Promise<void>;
10
+ }
11
+ /** The decision behind a "Log in" control, bound to the application context. */
12
+ export interface LoginStartHelper {
13
+ /**
14
+ * What a "Log in" control does when clicked — the decision behind `useLogin`, kept free of React so
15
+ * it is the same rule wherever a control is rendered.
16
+ *
17
+ * - A target and a session already here: go straight to the target — there is nobody to sign in.
18
+ * - Otherwise: begin a sign-in whose continuation is ALWAYS the dispatcher, never the target. A
19
+ * target travels as `LoginRequest.target`, which the facade parks for the landing; the
20
+ * dispatcher's own post-sign-in landing (`landAfterLogin` — landing hooks, pending steps such as a
21
+ * consent screen, then the parked target) brings the person there signed in. Navigating to a
22
+ * guarded target instead is what used to land a person on it signed out.
23
+ *
24
+ * NOT async, and nothing is awaited before `begin`: the surrogate plugin opens its window inside
25
+ * this call, and a window opened after the gesture has been handled is eaten by the popup blocker.
26
+ */
27
+ startLogin: (start: LoginStart) => Promise<LoginOutcome>;
28
+ }
29
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/start/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,sGAAsG;AACtG,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAA;IACX,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4FAA4F;IAC5F,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5C;AAED,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;OAaG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;CACzD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/start/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { LoginContext } from './types.js';
2
+ import type { LoginStartHelper } from './start/types.js';
3
+ export declare const makeLoginStartHelper: (ctx: LoginContext) => LoginStartHelper;
4
+ export declare const loginStartOf: (target: LoginContext) => LoginStartHelper;
5
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/login/start.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAA;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD,eAAO,MAAM,oBAAoB,QAAS,YAAY,KAAG,gBAiCxD,CAAA;AAED,eAAO,MAAM,YAAY,4CAA2C,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { DISPATCHER } from '@owlmeans/auth';
2
+ import { DEFAULT_ALIAS as AUTH_ALIAS } from '../consts.js';
3
+ import { LOGIN_SERVICE, LoginOutcome } from './consts.js';
4
+ import { memoHelper } from '@owlmeans/context';
5
+ export const makeLoginStartHelper = (ctx) => {
6
+ /**
7
+ * Whether this document already holds a session, answered WITHOUT awaiting anything.
8
+ *
9
+ * Read off the auth service's in-memory token, which every guard and `authenticated()` call fills.
10
+ * A session not yet read from storage answers `false` and costs nothing: the sign-in it starts finds
11
+ * the session at the dispatcher, which lands on the parked target all the same.
12
+ */
13
+ const holdsSession = () => {
14
+ if (!ctx.hasService(AUTH_ALIAS)) {
15
+ return false;
16
+ }
17
+ const token = ctx.service(AUTH_ALIAS).token;
18
+ return token != null && token !== '';
19
+ };
20
+ const startLogin = start => {
21
+ const { url, target, go } = start;
22
+ if (target != null && target !== '' && holdsSession()) {
23
+ return Promise.resolve(go(target)).then(() => LoginOutcome.Handled);
24
+ }
25
+ return ctx.service(LOGIN_SERVICE).begin({
26
+ url,
27
+ target,
28
+ // Only a component may call `useNavigate`, so the in-app continuation is handed to the
29
+ // plugin rather than reinvented by it.
30
+ navigate: () => { void go(DISPATCHER); },
31
+ });
32
+ };
33
+ return { startLogin };
34
+ };
35
+ export const loginStartOf = memoHelper.oncePer(makeLoginStartHelper);
36
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/login/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAiB,EAAoB,EAAE;IAC1E;;;;;;OAMG;IACH,MAAM,YAAY,GAAG,GAAY,EAAE;QACjC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAA;QACd,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAc,UAAU,CAAC,CAAC,KAAK,CAAA;QAExD,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAA;IACtC,CAAC,CAAA;IAED,MAAM,UAAU,GAAmC,KAAK,CAAC,EAAE;QACzD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAA;QACjC,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,EAAE,IAAI,YAAY,EAAE,EAAE,CAAC;YACtD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QACrE,CAAC;QAED,OAAO,GAAG,CAAC,OAAO,CAAe,aAAa,CAAC,CAAC,KAAK,CAAC;YACpD,GAAG;YACH,MAAM;YACN,uFAAuF;YACvF,uCAAuC;YACvC,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,UAAU,CAAC,CAAA,CAAC,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO,EAAE,UAAU,EAAE,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { LoginIntent } from '../consts.js';
2
+ export interface SurrogateTarget {
3
+ intent: LoginIntent;
4
+ /** The address the surrogate should actually run, once it is one window up. */
5
+ next?: string;
6
+ /** The method the user already chose in the opener. */
7
+ method?: string;
8
+ }
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/surrogate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAA;IACnB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/surrogate/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { LoginContext } from './types.js';
2
+ import type { SurrogateTarget } from './surrogate/types.js';
3
+ /**
4
+ * Where a surrogate window opens.
5
+ *
6
+ * Returns `null` when the application's entrypoint list predates the surrogate route — an app
7
+ * built against an older `@owlmeans/auth-common` has no such entrypoint, and the caller then falls
8
+ * back to opening the dispatcher directly, which is exactly what it used to do. That fallback is
9
+ * the whole compatibility story for already-deployed applications, so it must never be removed in
10
+ * favour of throwing.
11
+ */
12
+ export declare const surrogatePath: (ctx: LoginContext, target: SurrogateTarget) => string | null;
13
+ //# sourceMappingURL=surrogate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surrogate.d.ts","sourceRoot":"","sources":["../../src/login/surrogate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,QAAS,YAAY,UAAU,eAAe,KAAG,MAAM,GAAG,IAqBnF,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { DISPATCHER_SURROGATE } from '@owlmeans/auth';
2
+ import { LOGIN_INTENT_QUERY, LOGIN_METHOD_QUERY, LOGIN_NEXT_QUERY } from './consts.js';
3
+ /**
4
+ * Where a surrogate window opens.
5
+ *
6
+ * Returns `null` when the application's entrypoint list predates the surrogate route — an app
7
+ * built against an older `@owlmeans/auth-common` has no such entrypoint, and the caller then falls
8
+ * back to opening the dispatcher directly, which is exactly what it used to do. That fallback is
9
+ * the whole compatibility story for already-deployed applications, so it must never be removed in
10
+ * favour of throwing.
11
+ */
12
+ export const surrogatePath = (ctx, target) => {
13
+ if (!ctx.hasEntrypoint(DISPATCHER_SURROGATE)) {
14
+ return null;
15
+ }
16
+ let path;
17
+ try {
18
+ path = ctx.entrypoint(DISPATCHER_SURROGATE).path();
19
+ }
20
+ catch {
21
+ return null;
22
+ }
23
+ const query = new URLSearchParams();
24
+ query.set(LOGIN_INTENT_QUERY, target.intent);
25
+ if (target.next != null && target.next !== '') {
26
+ query.set(LOGIN_NEXT_QUERY, target.next);
27
+ }
28
+ if (target.method != null && target.method !== '') {
29
+ query.set(LOGIN_METHOD_QUERY, target.method);
30
+ }
31
+ return `${path}?${query.toString()}`;
32
+ };
33
+ //# sourceMappingURL=surrogate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surrogate.js","sourceRoot":"","sources":["../../src/login/surrogate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAItF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAiB,EAAE,MAAuB,EAAiB,EAAE;IACzF,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,IAAY,CAAA;IAChB,IAAI,CAAC;QACH,IAAI,GAAG,GAAG,CAAC,UAAU,CAAmB,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAAA;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAA;IACnC,KAAK,CAAC,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IAC5C,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,EAAE,EAAE,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAC1C,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QAClD,KAAK,CAAC,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IAC9C,CAAC;IAED,OAAO,GAAG,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAA;AACtC,CAAC,CAAA"}
@@ -0,0 +1,112 @@
1
+ import type { LoginTermsConfig } from '@owlmeans/config';
2
+ import type { LoginContext } from '../types.js';
3
+ /** One document (or notice) a sign-in screen links to. */
4
+ export interface ResolvedTermsDocument {
5
+ key: string;
6
+ href: string;
7
+ /** Published translations, selected at render/record time; `href` remains canonical. */
8
+ hrefMap?: Record<string, string>;
9
+ /** A caller's own label, already resolved to one string — only ever set for a custom document. */
10
+ label?: string;
11
+ /** A locale map for the label, when the config supplied one — resolved by the renderer, not here. */
12
+ labelMap?: Record<string, string>;
13
+ /** Translation key under `login.terms.*`, when this document has one. */
14
+ i18nKey?: string;
15
+ revisedAt?: string;
16
+ /** Extra interpolation values for `i18nKey`'s translation (e.g. `{ product: 'Acme' }`). */
17
+ params?: Record<string, string>;
18
+ }
19
+ export interface ResolvedTerms {
20
+ required: boolean;
21
+ terms: string;
22
+ privacy: string;
23
+ cookies?: string;
24
+ version: string;
25
+ /** What the checkbox agrees to — terms, then billing/product when configured, then custom. */
26
+ documents: ResolvedTermsDocument[];
27
+ /** What is merely DISCLOSED, never consented to — privacy, plus cookies per the rule below. */
28
+ notices: ResolvedTermsDocument[];
29
+ /** The latest `revisedAt` among {@link documents}. Only set when `showRevision` is true. */
30
+ revisedAt?: string;
31
+ showRevision: boolean;
32
+ }
33
+ /** One document as `@owlmeans/marketing-consent`'s `TermsDocumentRef` shape — structurally, with
34
+ * no dependency on that package (client-auth is a layer below it). */
35
+ export interface TermsAcceptanceRef {
36
+ key: string;
37
+ href: string;
38
+ revisedAt?: string;
39
+ }
40
+ /** One fragment of an interpolated terms sentence — plain text, or a link to a document. */
41
+ export interface TermsSentencePart {
42
+ text: string;
43
+ href?: string;
44
+ documentKey?: string;
45
+ }
46
+ /** What a sign-in-time terms acceptance sends the server. */
47
+ export interface LoginTermsAcceptance {
48
+ documents: TermsAcceptanceRef[];
49
+ notices: TermsAcceptanceRef[];
50
+ version: string;
51
+ locale?: string;
52
+ }
53
+ /** The documents a sign-in agrees to: their resolution, the local acceptance record and the sentence. */
54
+ export interface LoginTermsHelper {
55
+ /** The configured documents and notices, with the version acceptance is recorded against; null when terms are off. */
56
+ resolveTerms: (cfg?: LoginTermsConfig | false) => ResolvedTerms | null;
57
+ /**
58
+ * Whether this browser has already agreed to exactly these documents.
59
+ *
60
+ * `localStorage` and not a cookie: the record is a UI convenience, it never travels to a server,
61
+ * and it must be readable by the surrogate login window — which is same-origin, so it sees the
62
+ * opener's acceptance and does not ask twice. A preview iframe on a different origin gets its own
63
+ * partition and therefore its own acceptance, which is correct rather than unfortunate.
64
+ */
65
+ termsAccepted: (resolved: ResolvedTerms | null) => boolean;
66
+ /** Record (or, with `accepted: false`, forget) this browser's agreement to these documents. */
67
+ acceptTerms: (resolved: ResolvedTerms | null, accepted: boolean) => void;
68
+ /**
69
+ * A document's own label: a caller's literal `label`, else its `labelMap` for the current locale,
70
+ * else its `i18nKey` translated — each with `params` (e.g. `{ product: 'Acme' }`) interpolated
71
+ * afterwards, since the `translate` contract every renderer shares is a plain
72
+ * `(key, defaultValue) => string` with no interpolation option of its own.
73
+ *
74
+ * The one label resolver every renderer of a terms sentence uses — `FallbackLoginScreen` here, and
75
+ * `@owlmeans/web-panel`'s `LoginTerms` — so the English fallbacks and the resolution order live in
76
+ * exactly one place instead of two hand-kept copies.
77
+ */
78
+ termsLabelResolver: (translate: (key: string, defaultValue: string) => string, locale: string | undefined) => (doc: ResolvedTermsDocument) => string;
79
+ /** Explicit locale destination, then base language, then canonical href; never rewrites paths. */
80
+ termsHrefOf: (doc: ResolvedTermsDocument, locale?: string) => string;
81
+ /**
82
+ * What a sign-in-time terms acceptance sends the server — structurally
83
+ * `@owlmeans/marketing-consent`'s `TermsAcceptance`, so `client.recordTerms(termsAcceptanceOf(...))`
84
+ * type-checks with no dependency in this direction. Shared by `termsRecorder` (the sign-in screen's
85
+ * own local acceptance, copied at landing) and a Terms-mode consent screen recording the box it
86
+ * just showed.
87
+ */
88
+ termsAcceptanceOf: (resolved: Pick<ResolvedTerms, 'documents' | 'notices' | 'version'>, locale?: string) => LoginTermsAcceptance;
89
+ /**
90
+ * Whether the Terms confirmation has been moved off the sign-in screen onto a registered step.
91
+ *
92
+ * True only when a step both DECLARES `confirmsTerms` and is BOUND (`ctx.hasEntrypoint`) — an app
93
+ * that registers the step (e.g. `appendMarketingConsent({ terms: 'step' })`) but never binds its
94
+ * screen (an older target, a partial import) keeps the sign-in checkbox, fail-closed: a person must
95
+ * never find the confirmation missing from both places at once.
96
+ *
97
+ * Reads the service directly (`ctx.hasService`), never `ensureLoginService` — that registers an
98
+ * empty host as a side effect, which a render-time check must not do.
99
+ */
100
+ termsDeferred: (ctx: LoginContext) => boolean;
101
+ /**
102
+ * Interpolate a translated sentence template around its document list(s).
103
+ *
104
+ * Supports `{{documents}}` (→ `resolved.documents`) and `{{notices}}` (→ `resolved.notices`), and
105
+ * — for backward compatibility with an older template string — the legacy `{{terms}}`, `{{privacy}}`
106
+ * and `{{cookies}}` placeholders, each resolved to its one matching document. Framework-agnostic on
107
+ * purpose: it returns plain data, never JSX, so both `@owlmeans/web-panel` and the plain fallback
108
+ * screen can turn the parts into their own markup.
109
+ */
110
+ termsSentence: (template: string, resolved: Pick<ResolvedTerms, 'documents' | 'notices'>, locale: string | undefined, resolveLabel: (doc: ResolvedTermsDocument) => string) => TermsSentencePart[];
111
+ }
112
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/login/terms/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,kGAAkG;IAClG,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qGAAqG;IACrG,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,8FAA8F;IAC9F,SAAS,EAAE,qBAAqB,EAAE,CAAA;IAClC,+FAA+F;IAC/F,OAAO,EAAE,qBAAqB,EAAE,CAAA;IAChC,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;CACtB;AAED;sEACsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAA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C,GAAG,EAAE,YAAY,KAAK,OAAO,CAAA;IAC7C;;;;;;;;OAQG;IACH,aAAa,EAAE,CACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC,EACtD,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,YAAY,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,MAAM,KACjD,iBAAiB,EAAE,CAAA;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/login/terms/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Extra `LoginTermsConfig` fields, added by TypeScript module augmentation rather than by editing
3
+ * `@owlmeans/config` itself.
4
+ *
5
+ * `@owlmeans/config` has roughly 85 dependents, and every one of them sits in the same release
6
+ * closure — a config bump ripples through every package that pins a range against it, whether or
7
+ * not it touches sign-in. The fields below are needed by exactly one consumer family (the sign-in
8
+ * screen and its terms confirmation, all downstream of `@owlmeans/client-auth`), so they are
9
+ * declared here instead, merged onto the base interface by TypeScript's own declaration merging.
10
+ *
11
+ * This file must be part of whatever a consumer's own compilation actually loads, or the merge
12
+ * never happens — an ambient augmentation applies only once the compiler has read the file that
13
+ * declares it. `@owlmeans/client-auth/login`'s barrel (`./index.ts`) re-exports this module for
14
+ * exactly that reason, so ANY import from `@owlmeans/client-auth/login` — which every application
15
+ * wiring sign-in already has — pulls this augmentation into that program. An app that constructs a
16
+ * `LoginTermsConfig` literal in a file that imports NOTHING from `@owlmeans/client-auth/login`
17
+ * still benefits as long as some other file in the same `tsc` program does; if none does (an
18
+ * isolated leaf package that only ever imports `@owlmeans/config`), add
19
+ * `import type {} from '@owlmeans/client-auth/login'` to the file building the literal — an
20
+ * import with an empty type list, kept only to pull this file into that program's graph.
21
+ *
22
+ * `export {}` below is required, not decorative: without at least one top-level import/export this
23
+ * file is a SCRIPT to TypeScript, not a MODULE, and `declare module '@owlmeans/config'` inside a
24
+ * script augments the global scope instead of merging onto the named module's exports.
25
+ */
26
+ declare module '@owlmeans/config' {
27
+ interface LoginTermsConfig {
28
+ /** `documents[].key` (or a custom document's own key) → the ISO date it was last revised. */
29
+ revisions?: Record<string, string>;
30
+ /**
31
+ * Document/notice key → locale → published href. Opt-in; omitted locales use the canonical
32
+ * href. Renderers and acceptance evidence resolve the same current locale, while these
33
+ * translated destinations leave the canonical agreement version and revisions unchanged.
34
+ */
35
+ localizedHrefs?: Record<string, Record<string, string>>;
36
+ /** Off by default. A bare string is `{ href }`. */
37
+ billing?: string | {
38
+ href: string;
39
+ revisedAt?: string;
40
+ } | false;
41
+ /** Off by default. `name` is interpolated into the `login.terms.product` translation. */
42
+ product?: {
43
+ name: string;
44
+ href: string;
45
+ revisedAt?: string;
46
+ } | false;
47
+ /**
48
+ * Custom documents beyond terms/billing/product, in the order they are agreed to.
49
+ *
50
+ * `label` may be a locale map (`{ en: '...', fr: '...' }`) — resolved at RENDER time, by
51
+ * whichever renderer has the current locale, never here: this file stays locale-free.
52
+ */
53
+ documents?: Array<{
54
+ key: string;
55
+ href: string;
56
+ label?: string | Record<string, string>;
57
+ i18nKey?: string;
58
+ revisedAt?: string;
59
+ }>;
60
+ /** Show the latest revision date beneath the confirmation. Default false. */
61
+ showRevision?: boolean;
62
+ }
63
+ }
64
+ export {};
65
+ //# sourceMappingURL=terms-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms-config.d.ts","sourceRoot":"","sources":["../../src/login/terms-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,gBAAgB;QACxB,6FAA6F;QAC7F,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAClC;;;;WAIG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;QACvD,mDAAmD;QACnD,OAAO,CAAC,EAAE,MAAM,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,KAAK,CAAA;QAC/D,yFAAyF;QACzF,OAAO,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,KAAK,CAAA;QACpE;;;;;WAKG;QACH,SAAS,CAAC,EAAE,KAAK,CAAC;YAChB,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YACrF,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,CAAC,CAAA;QACF,6EAA6E;QAC7E,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB;CACF;AAED,OAAO,EAAG,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=terms-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms-config.js","sourceRoot":"","sources":["../../src/login/terms-config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { type LoginTermsConfig } from '@owlmeans/config';
2
+ import type { LoginContext } from './types.js';
3
+ import type { LoginTermsAcceptance, LoginTermsHelper, ResolvedTerms, ResolvedTermsDocument, TermsSentencePart } from './terms/types.js';
4
+ import './terms-config.js';
5
+ export declare const createLoginTermsHelper: () => LoginTermsHelper;
6
+ export declare const loginTermsHelper: LoginTermsHelper;
7
+ /** @deprecated compat:factory-refactor — use `loginTermsHelper.resolveTerms(…)` */
8
+ export declare const resolveTerms: (cfg?: LoginTermsConfig | false) => ResolvedTerms | null;
9
+ /** @deprecated compat:factory-refactor — use `loginTermsHelper.termsAccepted(…)` */
10
+ export declare const termsAccepted: (resolved: ResolvedTerms | null) => boolean;
11
+ /** @deprecated compat:factory-refactor — use `loginTermsHelper.acceptTerms(…)` */
12
+ export declare const acceptTerms: (resolved: ResolvedTerms | null, accepted: boolean) => void;
13
+ /** @deprecated compat:factory-refactor — use `loginTermsHelper.termsLabelResolver(…)` */
14
+ export declare const termsLabelResolver: (translate: (key: string, defaultValue: string) => string, locale: string | undefined) => ((doc: ResolvedTermsDocument) => string);
15
+ /** @deprecated compat:factory-refactor — use `loginTermsHelper.termsAcceptanceOf(…)` */
16
+ export declare const termsAcceptanceOf: (resolved: Pick<ResolvedTerms, 'documents' | 'notices' | 'version'>, locale?: string) => LoginTermsAcceptance;
17
+ /** @deprecated compat:factory-refactor — use `loginTermsHelper.termsDeferred(…)` */
18
+ export declare const termsDeferred: (ctx: LoginContext) => boolean;
19
+ /** @deprecated compat:factory-refactor — use `loginTermsHelper.termsSentence(…)` */
20
+ export declare const termsSentence: (template: string, resolved: Pick<ResolvedTerms, 'documents' | 'notices'>, locale: string | undefined, resolveLabel: (doc: ResolvedTermsDocument) => string) => TermsSentencePart[];
21
+ //# sourceMappingURL=terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms.d.ts","sourceRoot":"","sources":["../../src/login/terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExH,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAA;AAC5D,OAAO,KAAK,EACV,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAChG,MAAM,kBAAkB,CAAA;AACzB,OAAO,mBAAmB,CAAA;AAG1B,eAAO,MAAM,sBAAsB,QAAO,gBAgRzC,CAAA;AAED,eAAO,MAAM,gBAAgB,kBAA2B,CAAA;A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