deepline 0.1.310 → 0.1.311
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/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +36 -2
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -157,7 +157,7 @@ export const SDK_RELEASE = {
|
|
|
157
157
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
158
158
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
159
159
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
160
|
-
version: '0.1.
|
|
160
|
+
version: '0.1.311',
|
|
161
161
|
contracts: {
|
|
162
162
|
api: {
|
|
163
163
|
name: 'sdk-http-api',
|
|
@@ -2,6 +2,32 @@ type FetchLike = typeof fetch;
|
|
|
2
2
|
|
|
3
3
|
const vercelProtectionCookieCache = new Map<string, Promise<string | null>>();
|
|
4
4
|
|
|
5
|
+
async function awaitWithSignal<T>(
|
|
6
|
+
promise: Promise<T>,
|
|
7
|
+
signal: AbortSignal | undefined,
|
|
8
|
+
): Promise<T> {
|
|
9
|
+
if (!signal) return await promise;
|
|
10
|
+
if (signal.aborted) throw signal.reason;
|
|
11
|
+
return await new Promise<T>((resolve, reject) => {
|
|
12
|
+
const onAbort = () => {
|
|
13
|
+
cleanup();
|
|
14
|
+
reject(signal.reason);
|
|
15
|
+
};
|
|
16
|
+
const cleanup = () => signal.removeEventListener('abort', onAbort);
|
|
17
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
18
|
+
promise.then(
|
|
19
|
+
(value) => {
|
|
20
|
+
cleanup();
|
|
21
|
+
resolve(value);
|
|
22
|
+
},
|
|
23
|
+
(error) => {
|
|
24
|
+
cleanup();
|
|
25
|
+
reject(error);
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
5
31
|
export function addVercelProtectionBypassSearchParams(
|
|
6
32
|
url: URL,
|
|
7
33
|
token: string | null | undefined,
|
|
@@ -41,6 +67,7 @@ export async function resolveVercelProtectionBypassCookie(input: {
|
|
|
41
67
|
baseUrl: string | null | undefined;
|
|
42
68
|
token: string | null | undefined;
|
|
43
69
|
fetchImpl?: FetchLike;
|
|
70
|
+
signal?: AbortSignal;
|
|
44
71
|
}): Promise<string | null> {
|
|
45
72
|
const token = input.token?.trim();
|
|
46
73
|
const baseUrl = input.baseUrl?.trim().replace(/\/$/, '');
|
|
@@ -48,7 +75,7 @@ export async function resolveVercelProtectionBypassCookie(input: {
|
|
|
48
75
|
|
|
49
76
|
const cacheKey = `${baseUrl}\n${token}`;
|
|
50
77
|
const cached = vercelProtectionCookieCache.get(cacheKey);
|
|
51
|
-
if (cached) return await cached;
|
|
78
|
+
if (cached) return await awaitWithSignal(cached, input.signal);
|
|
52
79
|
|
|
53
80
|
const promise = (async () => {
|
|
54
81
|
const url = new URL(`${baseUrl}/api/v2/health`);
|
|
@@ -59,13 +86,19 @@ export async function resolveVercelProtectionBypassCookie(input: {
|
|
|
59
86
|
return response ? cookieHeaderFromSetCookie(response.headers) : null;
|
|
60
87
|
})();
|
|
61
88
|
vercelProtectionCookieCache.set(cacheKey, promise);
|
|
62
|
-
|
|
89
|
+
void promise.catch(() => {
|
|
90
|
+
if (vercelProtectionCookieCache.get(cacheKey) === promise) {
|
|
91
|
+
vercelProtectionCookieCache.delete(cacheKey);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return await awaitWithSignal(promise, input.signal);
|
|
63
95
|
}
|
|
64
96
|
|
|
65
97
|
export async function vercelProtectionBypassHeaders(input: {
|
|
66
98
|
baseUrl: string | null | undefined;
|
|
67
99
|
token: string | null | undefined;
|
|
68
100
|
fetchImpl?: FetchLike;
|
|
101
|
+
signal?: AbortSignal;
|
|
69
102
|
}): Promise<Record<string, string>> {
|
|
70
103
|
const token = input.token?.trim();
|
|
71
104
|
if (!token) return {};
|
|
@@ -73,6 +106,7 @@ export async function vercelProtectionBypassHeaders(input: {
|
|
|
73
106
|
baseUrl: input.baseUrl,
|
|
74
107
|
token,
|
|
75
108
|
fetchImpl: input.fetchImpl,
|
|
109
|
+
signal: input.signal,
|
|
76
110
|
});
|
|
77
111
|
return {
|
|
78
112
|
...vercelProtectionBypassHeader(token),
|
package/dist/cli/index.js
CHANGED
|
@@ -1037,7 +1037,7 @@ var SDK_RELEASE = {
|
|
|
1037
1037
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
1038
1038
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
1039
1039
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
1040
|
-
version: "0.1.
|
|
1040
|
+
version: "0.1.311",
|
|
1041
1041
|
contracts: {
|
|
1042
1042
|
api: {
|
|
1043
1043
|
name: "sdk-http-api",
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1022,7 +1022,7 @@ var SDK_RELEASE = {
|
|
|
1022
1022
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
1023
1023
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
1024
1024
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
1025
|
-
version: "0.1.
|
|
1025
|
+
version: "0.1.311",
|
|
1026
1026
|
contracts: {
|
|
1027
1027
|
api: {
|
|
1028
1028
|
name: "sdk-http-api",
|
package/dist/index.js
CHANGED
|
@@ -760,7 +760,7 @@ var SDK_RELEASE = {
|
|
|
760
760
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
761
761
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
762
762
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
763
|
-
version: "0.1.
|
|
763
|
+
version: "0.1.311",
|
|
764
764
|
contracts: {
|
|
765
765
|
api: {
|
|
766
766
|
name: "sdk-http-api",
|
package/dist/index.mjs
CHANGED
|
@@ -686,7 +686,7 @@ var SDK_RELEASE = {
|
|
|
686
686
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
687
687
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
688
688
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
689
|
-
version: "0.1.
|
|
689
|
+
version: "0.1.311",
|
|
690
690
|
contracts: {
|
|
691
691
|
api: {
|
|
692
692
|
name: "sdk-http-api",
|