apps 0.0.1-beta.2 → 0.0.1-beta.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.
@@ -1784,10 +1784,7 @@ var AppUiApi = HttpApi_exports.make("app-ui").add(
1784
1784
  );
1785
1785
 
1786
1786
  export {
1787
- HttpApiEndpoint_exports,
1788
- HttpApi_exports,
1789
1787
  HttpApiClient_exports,
1790
- HttpApiGroup_exports,
1791
1788
  UiContext,
1792
1789
  UiOperation,
1793
1790
  UiUnauthorized,
@@ -0,0 +1,39 @@
1
+ import {
2
+ appSignInCallbackPath
3
+ } from "./chunk-T2LAZCAD.js";
4
+ import {
5
+ HttpServerResponse_exports
6
+ } from "./chunk-QKHR7BMF.js";
7
+
8
+ // src/implementation/ui-auth.ts
9
+ var appPrivateHeaders = {
10
+ "cache-control": "no-store",
11
+ "referrer-policy": "no-referrer",
12
+ "x-content-type-options": "nosniff",
13
+ "content-security-policy": "frame-ancestors 'none'"
14
+ };
15
+ var appRedirect = (url) => HttpServerResponse_exports.redirect(url, { status: 302, headers: appPrivateHeaders });
16
+ var appSignInCallback = (origin, request, code) => {
17
+ const callback = new URL(appSignInCallbackPath, origin);
18
+ callback.searchParams.set("request", request);
19
+ callback.searchParams.set("code", code);
20
+ return callback.href;
21
+ };
22
+ var appSignInFailed = () => HttpServerResponse_exports.text(
23
+ `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Could not open app</title></head><body><p>Could not sign in to this app. Try opening it again.</p><a href="/">Try again</a></body></html>`,
24
+ {
25
+ status: 401,
26
+ contentType: "text/html",
27
+ headers: {
28
+ ...appPrivateHeaders,
29
+ "content-security-policy": "default-src 'none'; frame-ancestors 'none'; base-uri 'none'"
30
+ }
31
+ }
32
+ );
33
+
34
+ export {
35
+ appPrivateHeaders,
36
+ appRedirect,
37
+ appSignInCallback,
38
+ appSignInFailed
39
+ };
@@ -1,11 +1,3 @@
1
- import {
2
- HttpApiEndpoint_exports,
3
- HttpApiGroup_exports,
4
- HttpApi_exports,
5
- UiFailed,
6
- UiForbidden,
7
- UiUnauthorized
8
- } from "./chunk-OHRT55C4.js";
9
1
  import {
10
2
  Schema_exports
11
3
  } from "./chunk-FW5HBOIK.js";
@@ -31,26 +23,14 @@ var AppReturnPath = Schema_exports.String.check(
31
23
  })
32
24
  ).pipe(Schema_exports.brand("AppReturnPath"));
33
25
  var AppSignInCallback = Schema_exports.Struct({ request: AppSignInId, code: AppSignInCode });
34
- var AppSignInApi = HttpApi_exports.make("app-sign-in").add(
35
- HttpApiGroup_exports.make("appSignIn").add(
36
- HttpApiEndpoint_exports.post("start", "/_executor/auth/start", {
37
- payload: Schema_exports.Struct({ returnTo: AppReturnPath }),
38
- success: Schema_exports.Struct({ url: Schema_exports.String }),
39
- error: [UiForbidden, UiFailed]
40
- })
41
- ).add(
42
- HttpApiEndpoint_exports.post("complete", "/_executor/auth/complete", {
43
- payload: AppSignInCallback,
44
- success: Schema_exports.Struct({ returnTo: AppReturnPath }),
45
- error: [UiUnauthorized, UiForbidden, UiFailed]
46
- })
47
- )
48
- );
26
+ var appSignInCallbackPath = "/_executor/auth/callback";
27
+ var AppSignInFailure = Schema_exports.Literals(["ended", "forbidden", "unavailable"]);
49
28
 
50
29
  export {
51
30
  AppSignInId,
52
31
  AppSignInCode,
53
32
  AppReturnPath,
54
33
  AppSignInCallback,
55
- AppSignInApi
34
+ appSignInCallbackPath,
35
+ AppSignInFailure
56
36
  };
package/js/client.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  UiContext,
5
5
  UiDeploymentChanged,
6
6
  UiFailed
7
- } from "./chunk-OHRT55C4.js";
7
+ } from "./chunk-G7ZIRKMK.js";
8
8
  import {
9
9
  AsyncResult_exports,
10
10
  AtomRegistry_exports,
@@ -1,19 +1,18 @@
1
1
  import {
2
2
  AppReturnPath,
3
- AppSignInApi,
4
3
  AppSignInCallback,
5
4
  AppSignInCode,
6
- AppSignInId
7
- } from "../../chunk-4LPG6RCH.js";
8
- import "../../chunk-OHRT55C4.js";
9
- import "../../chunk-QKHR7BMF.js";
10
- import "../../chunk-SATWJKN6.js";
5
+ AppSignInFailure,
6
+ AppSignInId,
7
+ appSignInCallbackPath
8
+ } from "../../chunk-T2LAZCAD.js";
11
9
  import "../../chunk-FW5HBOIK.js";
12
10
  import "../../chunk-CZ7CSFO4.js";
13
11
  export {
14
12
  AppReturnPath,
15
- AppSignInApi,
16
13
  AppSignInCallback,
17
14
  AppSignInCode,
18
- AppSignInId
15
+ AppSignInFailure,
16
+ AppSignInId,
17
+ appSignInCallbackPath
19
18
  };
package/js/ui/auth.js CHANGED
@@ -1,28 +1,30 @@
1
1
  import {
2
2
  appPrivateHeaders,
3
- appSignInPage,
4
- appSignInScript
5
- } from "../chunk-TE4KO4HI.js";
3
+ appRedirect,
4
+ appSignInCallback,
5
+ appSignInFailed
6
+ } from "../chunk-NQ3OMCA5.js";
6
7
  import {
7
8
  AppReturnPath,
8
- AppSignInApi,
9
9
  AppSignInCallback,
10
10
  AppSignInCode,
11
- AppSignInId
12
- } from "../chunk-4LPG6RCH.js";
13
- import "../chunk-OHRT55C4.js";
11
+ AppSignInFailure,
12
+ AppSignInId,
13
+ appSignInCallbackPath
14
+ } from "../chunk-T2LAZCAD.js";
14
15
  import "../chunk-HDJH3RPR.js";
15
16
  import "../chunk-QKHR7BMF.js";
16
- import "../chunk-SATWJKN6.js";
17
17
  import "../chunk-FW5HBOIK.js";
18
18
  import "../chunk-CZ7CSFO4.js";
19
19
  export {
20
20
  AppReturnPath,
21
- AppSignInApi,
22
21
  AppSignInCallback,
23
22
  AppSignInCode,
23
+ AppSignInFailure,
24
24
  AppSignInId,
25
25
  appPrivateHeaders,
26
- appSignInPage,
27
- appSignInScript
26
+ appRedirect,
27
+ appSignInCallback,
28
+ appSignInCallbackPath,
29
+ appSignInFailed
28
30
  };
@@ -7,7 +7,7 @@ import {
7
7
  UiOperation,
8
8
  UiSnapshot,
9
9
  UiUnauthorized
10
- } from "../chunk-OHRT55C4.js";
10
+ } from "../chunk-G7ZIRKMK.js";
11
11
  import "../chunk-QKHR7BMF.js";
12
12
  import "../chunk-SATWJKN6.js";
13
13
  import "../chunk-FW5HBOIK.js";
package/js/ui/serving.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  appPrivateHeaders
3
- } from "../chunk-TE4KO4HI.js";
3
+ } from "../chunk-NQ3OMCA5.js";
4
+ import "../chunk-T2LAZCAD.js";
4
5
  import {
5
6
  UiForbidden
6
- } from "../chunk-OHRT55C4.js";
7
+ } from "../chunk-G7ZIRKMK.js";
7
8
  import {
8
9
  CurrentTelemetryConfig
9
10
  } from "../chunk-ZCAMUXSG.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.0.1-beta.3",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,