@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.
- package/README.md +1 -1
- package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts +1 -1
- package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts.map +1 -1
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js +24 -1
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -1
- package/dist/host/layout/layoutGenerator.d.ts.map +1 -1
- package/dist/host/layout/layoutGenerator.js +45 -20
- package/dist/host/layout/layoutGenerator.js.map +1 -1
- package/dist/host/layout/templates/auth/adapter.js +1 -1
- package/dist/host/layout/templates/auth/adapter.js.map +1 -1
- package/dist/host/layout/templates/auth/callback.d.ts.map +1 -1
- package/dist/host/layout/templates/auth/callback.js +80 -42
- package/dist/host/layout/templates/auth/callback.js.map +1 -1
- package/dist/host/layout/templates/auth/form.d.ts +2 -0
- package/dist/host/layout/templates/auth/form.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/form.js +238 -0
- package/dist/host/layout/templates/auth/form.js.map +1 -0
- package/dist/host/layout/templates/auth/navigation.d.ts +10 -0
- package/dist/host/layout/templates/auth/navigation.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/navigation.js +183 -0
- package/dist/host/layout/templates/auth/navigation.js.map +1 -0
- package/dist/host/layout/templates/auth/oauth.d.ts.map +1 -1
- package/dist/host/layout/templates/auth/oauth.js +146 -217
- package/dist/host/layout/templates/auth/oauth.js.map +1 -1
- package/dist/host/layout/templates/auth/oauthCompletion.d.ts +6 -0
- package/dist/host/layout/templates/auth/oauthCompletion.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/oauthCompletion.js +147 -0
- package/dist/host/layout/templates/auth/oauthCompletion.js.map +1 -0
- package/dist/host/layout/templates/auth/oauthState.d.ts +2 -0
- package/dist/host/layout/templates/auth/oauthState.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/oauthState.js +45 -0
- package/dist/host/layout/templates/auth/oauthState.js.map +1 -0
- package/dist/host/layout/templates/auth/screen.d.ts +5 -2
- package/dist/host/layout/templates/auth/screen.d.ts.map +1 -1
- package/dist/host/layout/templates/auth/screen.js +296 -531
- package/dist/host/layout/templates/auth/screen.js.map +1 -1
- package/dist/host/layout/templates/auth/session.js +6 -6
- package/dist/host/layout/templates/auth/signOut.d.ts.map +1 -1
- package/dist/host/layout/templates/auth/signOut.js +10 -9
- package/dist/host/layout/templates/auth/signOut.js.map +1 -1
- package/dist/host/layout/templates/index.d.ts +5 -1
- package/dist/host/layout/templates/index.d.ts.map +1 -1
- package/dist/host/layout/templates/index.js +5 -1
- package/dist/host/layout/templates/index.js.map +1 -1
- package/dist/host/layout/templates/rootLayout.d.ts.map +1 -1
- package/dist/host/layout/templates/rootLayout.js +9 -149
- package/dist/host/layout/templates/rootLayout.js.map +1 -1
- package/dist/host/orchestrator/generatedAppFiles.d.ts.map +1 -1
- package/dist/host/orchestrator/generatedAppFiles.js +6 -4
- package/dist/host/orchestrator/generatedAppFiles.js.map +1 -1
- package/dist/host/orchestrator/generatedRouteCleanup.js +1 -1
- package/dist/host/orchestrator/generatedRouteCleanup.js.map +1 -1
- package/dist/host/orchestrator/scaffolder.js +3 -3
- package/dist/host/orchestrator/scaffolder.js.map +1 -1
- package/dist/host/orchestrator/templates.d.ts.map +1 -1
- package/dist/host/orchestrator/templates.js +54 -52
- package/dist/host/orchestrator/templates.js.map +1 -1
- package/dist/projectDeployAssetPicker.d.ts +2 -1
- package/dist/projectDeployAssetPicker.d.ts.map +1 -1
- package/dist/projectDeployAssetPicker.js +27 -21
- package/dist/projectDeployAssetPicker.js.map +1 -1
- 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
|
-
|
|
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
|
-
}
|
|
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;
|
|
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;AASnF,UAAU,sBAAsB;IAC9B,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;CACxD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,UAQ5D;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,IAAI,CAAC,sBAAsB,EAAE,aAAa,GAAG,YAAY,GAAG,OAAO,CAAC,UAkU3E"}
|