@ankhorage/studio 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts +1 -1
  3. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts.map +1 -1
  4. package/dist/host/layout/auth/resolveAuthLayoutPlan.js +24 -1
  5. package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -1
  6. package/dist/host/layout/layoutGenerator.d.ts.map +1 -1
  7. package/dist/host/layout/layoutGenerator.js +45 -20
  8. package/dist/host/layout/layoutGenerator.js.map +1 -1
  9. package/dist/host/layout/templates/auth/adapter.js +1 -1
  10. package/dist/host/layout/templates/auth/adapter.js.map +1 -1
  11. package/dist/host/layout/templates/auth/callback.d.ts.map +1 -1
  12. package/dist/host/layout/templates/auth/callback.js +80 -42
  13. package/dist/host/layout/templates/auth/callback.js.map +1 -1
  14. package/dist/host/layout/templates/auth/form.d.ts +2 -0
  15. package/dist/host/layout/templates/auth/form.d.ts.map +1 -0
  16. package/dist/host/layout/templates/auth/form.js +238 -0
  17. package/dist/host/layout/templates/auth/form.js.map +1 -0
  18. package/dist/host/layout/templates/auth/navigation.d.ts +10 -0
  19. package/dist/host/layout/templates/auth/navigation.d.ts.map +1 -0
  20. package/dist/host/layout/templates/auth/navigation.js +183 -0
  21. package/dist/host/layout/templates/auth/navigation.js.map +1 -0
  22. package/dist/host/layout/templates/auth/oauth.d.ts.map +1 -1
  23. package/dist/host/layout/templates/auth/oauth.js +146 -217
  24. package/dist/host/layout/templates/auth/oauth.js.map +1 -1
  25. package/dist/host/layout/templates/auth/oauthCompletion.d.ts +6 -0
  26. package/dist/host/layout/templates/auth/oauthCompletion.d.ts.map +1 -0
  27. package/dist/host/layout/templates/auth/oauthCompletion.js +147 -0
  28. package/dist/host/layout/templates/auth/oauthCompletion.js.map +1 -0
  29. package/dist/host/layout/templates/auth/oauthState.d.ts +2 -0
  30. package/dist/host/layout/templates/auth/oauthState.d.ts.map +1 -0
  31. package/dist/host/layout/templates/auth/oauthState.js +45 -0
  32. package/dist/host/layout/templates/auth/oauthState.js.map +1 -0
  33. package/dist/host/layout/templates/auth/screen.d.ts +5 -2
  34. package/dist/host/layout/templates/auth/screen.d.ts.map +1 -1
  35. package/dist/host/layout/templates/auth/screen.js +296 -531
  36. package/dist/host/layout/templates/auth/screen.js.map +1 -1
  37. package/dist/host/layout/templates/auth/session.js +6 -6
  38. package/dist/host/layout/templates/auth/signOut.d.ts.map +1 -1
  39. package/dist/host/layout/templates/auth/signOut.js +10 -9
  40. package/dist/host/layout/templates/auth/signOut.js.map +1 -1
  41. package/dist/host/layout/templates/index.d.ts +5 -1
  42. package/dist/host/layout/templates/index.d.ts.map +1 -1
  43. package/dist/host/layout/templates/index.js +5 -1
  44. package/dist/host/layout/templates/index.js.map +1 -1
  45. package/dist/host/layout/templates/rootLayout.d.ts.map +1 -1
  46. package/dist/host/layout/templates/rootLayout.js +9 -149
  47. package/dist/host/layout/templates/rootLayout.js.map +1 -1
  48. package/dist/host/orchestrator/generatedAppFiles.d.ts.map +1 -1
  49. package/dist/host/orchestrator/generatedAppFiles.js +6 -4
  50. package/dist/host/orchestrator/generatedAppFiles.js.map +1 -1
  51. package/dist/host/orchestrator/generatedRouteCleanup.js +1 -1
  52. package/dist/host/orchestrator/generatedRouteCleanup.js.map +1 -1
  53. package/dist/host/orchestrator/scaffolder.js +3 -3
  54. package/dist/host/orchestrator/scaffolder.js.map +1 -1
  55. package/dist/host/orchestrator/templates.d.ts.map +1 -1
  56. package/dist/host/orchestrator/templates.js +54 -52
  57. package/dist/host/orchestrator/templates.js.map +1 -1
  58. package/dist/projectDeployAssetPicker.d.ts +2 -1
  59. package/dist/projectDeployAssetPicker.d.ts.map +1 -1
  60. package/dist/projectDeployAssetPicker.js +27 -21
  61. package/dist/projectDeployAssetPicker.js.map +1 -1
  62. package/package.json +5 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauthState.d.ts","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/oauthState.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,WA2ClC"}
@@ -0,0 +1,45 @@
1
+ export function getAuthOAuthStateTs() {
2
+ return `import { authSessionStorage } from './session';
3
+
4
+ const OAUTH_TRANSPORT_ATTEMPT_KEY = 'ankh.auth.oauth.transport';
5
+
6
+ interface StoredTransportAttempt {
7
+ attemptId: string;
8
+ }
9
+
10
+ export async function clearTransportAttempt(): Promise<void> {
11
+ try {
12
+ await authSessionStorage.removeItem(OAUTH_TRANSPORT_ATTEMPT_KEY);
13
+ } catch {
14
+ // Cleanup failures are intentionally not surfaced with persisted state.
15
+ }
16
+ }
17
+
18
+ export async function readTransportAttempt(): Promise<StoredTransportAttempt | null> {
19
+ const raw = await authSessionStorage.getItem(OAUTH_TRANSPORT_ATTEMPT_KEY);
20
+ if (!raw) return null;
21
+ try {
22
+ const value: unknown = JSON.parse(raw);
23
+ if (isRecord(value)) {
24
+ const attemptId: unknown = Reflect.get(value, 'attemptId');
25
+ if (typeof attemptId === 'string' && attemptId.trim().length > 0) {
26
+ return { attemptId };
27
+ }
28
+ }
29
+ } catch {
30
+ // Invalid transport state is cleaned below without exposing its contents.
31
+ }
32
+ await clearTransportAttempt();
33
+ return null;
34
+ }
35
+
36
+ export async function writeTransportAttempt(attempt: StoredTransportAttempt): Promise<void> {
37
+ await authSessionStorage.setItem(OAUTH_TRANSPORT_ATTEMPT_KEY, JSON.stringify(attempt));
38
+ }
39
+
40
+ function isRecord(value: unknown): value is Record<string, unknown> {
41
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
42
+ }
43
+ `;
44
+ }
45
+ //# sourceMappingURL=oauthState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauthState.js","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/oauthState.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB;IACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCR,CAAC;AACF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { GeneratedOAuthProviderPlan } from '../../auth/resolveAuthLayoutPlan';
2
- export declare function getAuthScreenTsx(args: {
2
+ interface AuthScreenTemplateArgs {
3
3
  initialMode: 'signIn' | 'signUp';
4
4
  screenName: string;
5
5
  title?: string;
@@ -11,5 +11,8 @@ export declare function getAuthScreenTsx(args: {
11
11
  signUpOptionalFields: string[];
12
12
  signUpPolicy: 'autoSignIn' | 'requireVerification';
13
13
  oauthProviders?: readonly GeneratedOAuthProviderPlan[];
14
- }): string;
14
+ }
15
+ export declare function getAuthScreenTsx(args: AuthScreenTemplateArgs): string;
16
+ export declare function getAuthScreenRuntimeTsx(args: Omit<AuthScreenTemplateArgs, 'initialMode' | 'screenName' | 'title'>): string;
17
+ export {};
15
18
  //# sourceMappingURL=screen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAYnF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,WAAW,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,YAAY,EAAE,YAAY,GAAG,qBAAqB,CAAC;IACnD,cAAc,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACx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