@seanpropapp/cli 0.1.0-beta.7 → 0.1.0-beta.8
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const PROD_APP_URL = "https://
|
|
2
|
-
export declare const PAIR_BASE_URL = "https://
|
|
1
|
+
export declare const PROD_APP_URL = "https://seanpropapp.com";
|
|
2
|
+
export declare const PAIR_BASE_URL = "https://seanpropapp.com/pair";
|
|
3
3
|
/**
|
|
4
4
|
* Base URL of the SeanPropApp web app the CLI pairs against. Defaults to
|
|
5
5
|
* production. Override with the SEANPROPAPP_URL env var to point the connect /
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
|
-
|
|
2
|
+
// Canonical brand domain. New users land on seanpropapp.com, so connect/pair/
|
|
3
|
+
// sample open there. prop.seanoneill.com remains allowlisted in the bridge CORS
|
|
4
|
+
// (src/http/cors.ts) so already-paired sessions on the old domain keep working.
|
|
5
|
+
export const PROD_APP_URL = "https://seanpropapp.com";
|
|
3
6
|
export const PAIR_BASE_URL = `${PROD_APP_URL}/pair`;
|
|
4
7
|
/**
|
|
5
8
|
* Base URL of the SeanPropApp web app the CLI pairs against. Defaults to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pair-url.js","sourceRoot":"","sources":["../../src/commands/pair-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"pair-url.js","sourceRoot":"","sources":["../../src/commands/pair-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,YAAY,OAAO,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC;IACrD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,iBAAiB;IAC/B,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,GAAG,UAAU,EAAE,WAAW,KAAK,EAAE,CAAC;AAC3C,CAAC;AAED,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,KAAa;IACjD,MAAM,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC;IACtB,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,EAAE,EAAE,CAAC;AAChD,CAAC"}
|
package/dist/http/cors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MiddlewareHandler } from "hono";
|
|
2
|
-
export declare const ALLOWED_ORIGINS: readonly ["https://prop.seanoneill.com", "http://localhost:3000"];
|
|
2
|
+
export declare const ALLOWED_ORIGINS: readonly ["https://seanpropapp.com", "https://prop.seanoneill.com", "http://localhost:3000"];
|
|
3
3
|
export declare const PREFLIGHT_MAX_AGE_SECONDS = 86400;
|
|
4
4
|
export declare function isOriginAllowed(origin: string | null | undefined): boolean;
|
|
5
5
|
/**
|
|
@@ -19,7 +19,8 @@ export declare function isOriginAllowed(origin: string | null | undefined): bool
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function streamingResponseCorsHeaders(origin: string | null | undefined): Record<string, string>;
|
|
21
21
|
/**
|
|
22
|
-
* Strict CORS middleware:
|
|
22
|
+
* Strict CORS middleware: allows the brand domain (seanpropapp.com), the legacy
|
|
23
|
+
* prop.seanoneill.com origin, localhost dev, and any SEANPROPAPP_URL override.
|
|
23
24
|
* Rejects all other origins with 403. Preflights cached for 24h.
|
|
24
25
|
*/
|
|
25
26
|
export declare const corsMiddleware: MiddlewareHandler;
|
package/dist/http/cors.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export const ALLOWED_ORIGINS = [
|
|
2
|
+
// seanpropapp.com is the canonical brand domain (new users land here);
|
|
3
|
+
// prop.seanoneill.com stays allowlisted for back-compat with already-paired
|
|
4
|
+
// sessions; localhost:3000 is local dev.
|
|
5
|
+
"https://seanpropapp.com",
|
|
2
6
|
"https://prop.seanoneill.com",
|
|
3
7
|
"http://localhost:3000",
|
|
4
8
|
];
|
|
@@ -6,7 +10,23 @@ export const PREFLIGHT_MAX_AGE_SECONDS = 86400;
|
|
|
6
10
|
export function isOriginAllowed(origin) {
|
|
7
11
|
if (!origin)
|
|
8
12
|
return false;
|
|
9
|
-
|
|
13
|
+
if (ALLOWED_ORIGINS.includes(origin))
|
|
14
|
+
return true;
|
|
15
|
+
// Honor the SEANPROPAPP_URL override (preview / local dev) so the CORS allow
|
|
16
|
+
// list follows the same base URL the connect/pair flow targets. Without this,
|
|
17
|
+
// overriding SEANPROPAPP_URL repointed the pair URL but the bridge still 403'd
|
|
18
|
+
// the overridden origin (e.g. a Vercel preview domain). Compare on origin
|
|
19
|
+
// (scheme://host[:port]) only; ignore any path in the override value.
|
|
20
|
+
const override = process.env["SEANPROPAPP_URL"]?.trim();
|
|
21
|
+
if (override) {
|
|
22
|
+
try {
|
|
23
|
+
return new URL(override).origin === origin;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
10
30
|
}
|
|
11
31
|
/**
|
|
12
32
|
* Headers a streaming response must carry alongside its own Content-Type so
|
|
@@ -33,7 +53,8 @@ export function streamingResponseCorsHeaders(origin) {
|
|
|
33
53
|
};
|
|
34
54
|
}
|
|
35
55
|
/**
|
|
36
|
-
* Strict CORS middleware:
|
|
56
|
+
* Strict CORS middleware: allows the brand domain (seanpropapp.com), the legacy
|
|
57
|
+
* prop.seanoneill.com origin, localhost dev, and any SEANPROPAPP_URL override.
|
|
37
58
|
* Rejects all other origins with 403. Preflights cached for 24h.
|
|
38
59
|
*/
|
|
39
60
|
export const corsMiddleware = async (c, next) => {
|
package/dist/http/cors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/http/cors.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,6BAA6B;IAC7B,uBAAuB;CACf,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE/C,MAAM,UAAU,eAAe,CAAC,MAAiC;IAC/D,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/http/cors.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,uEAAuE;IACvE,4EAA4E;IAC5E,yCAAyC;IACzC,yBAAyB;IACzB,6BAA6B;IAC7B,uBAAuB;CACf,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE/C,MAAM,UAAU,eAAe,CAAC,MAAiC;IAC/D,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAK,eAAqC,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE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