diff --git a/.changeset/cold-walls-poke.md b/.changeset/cold-walls-poke.md
new file mode 100644
index 000000000000..5d752da87212
--- /dev/null
+++ b/.changeset/cold-walls-poke.md
@@ -0,0 +1,8 @@
+---
+"ledger-live-desktop": minor
+"live-mobile": minor
+"@ledgerhq/live-common": minor
+---
+
+- Update WebPTXPlayer to load correct manifest
+- Remove unused LL BUY/SELL in favour of BUY/SELL Live App
diff --git a/apps/ledger-live-desktop/src/renderer/Default.tsx b/apps/ledger-live-desktop/src/renderer/Default.tsx
index 42b8c7ad0ee0..e8734f1b6045 100644
--- a/apps/ledger-live-desktop/src/renderer/Default.tsx
+++ b/apps/ledger-live-desktop/src/renderer/Default.tsx
@@ -248,7 +248,7 @@ export default function Default() {
/>
-
+
{
setTrackingSource("Page Portfolio");
history.push({
pathname: "/exchange",
- state: ptxSmartRouting?.enabled
- ? {
- mode: "buy", // buy or sell
- }
- : undefined,
+ state: {
+ mode: "buy", // buy or sell
+ },
});
- }, [history, ptxSmartRouting]);
+ }, [history]);
const onSwap = useCallback(() => {
setTrackingSource("Page Portfolio");
history.push({
diff --git a/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx b/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx
index c71065eafa33..26818e0cd1f2 100644
--- a/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx
+++ b/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx
@@ -8,34 +8,28 @@ import { Account } from "@ledgerhq/types-live";
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
import { setTrackingSource } from "~/renderer/analytics/TrackPage";
import { isCurrencySupported } from "~/renderer/screens/exchange/config";
-import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
+
const BuyButton = ({ currency, account }: { currency: CryptoCurrency; account: Account }) => {
const history = useHistory();
const dispatch = useDispatch();
- // PTX smart routing feature flag - buy sell live app flag
- const ptxSmartRouting = useFeature("ptxSmartRouting");
const onClick = useCallback(() => {
dispatch(closeAllModal());
setTrackingSource("send flow");
history.push({
pathname: "/exchange",
- state: ptxSmartRouting?.enabled
- ? {
- currency: currency.id,
- account: account.id,
- mode: "buy", // buy or sell
- }
- : {
- tab: 0,
- defaultCurrency: currency,
- defaultAccount: account,
- },
+ state: {
+ currency: currency.id,
+ account: account.id,
+ mode: "buy", // buy or sell
+ },
});
- }, [account, currency, dispatch, history, ptxSmartRouting]);
+ }, [account, currency, dispatch, history]);
+
if (!isCurrencySupported("BUY", currency)) {
return null;
}
+
return (
- }
- keyboardDismissMode="on-drag"
- />
- );
- },
- [enhancedAccounts, renderItem, onAddAccount],
- );
-
- // empty state if no accounts available for this currency
- if (!elligibleAccountsForSelectedCurrency.length) {
- return (
-
-
-
-
-
- {t("exchange.buy.emptyState.title", {
- currency: currency.name,
- })}
-
-
- {t("exchange.buy.emptyState.description", {
- currency: currency.name,
- })}
-
-
-
-
-
- );
- }
-
- return (
-
-
-
-
- (
-
-
-
-
-
- )}
- />
-
-
-
- );
-}
-const styles = StyleSheet.create({
- addAccountButton: {
- flex: 1,
- flexDirection: "row",
- paddingVertical: 16,
- alignItems: "center",
- },
- root: {
- flex: 1,
- },
- tokenCardStyle: {
- marginLeft: 26,
- paddingLeft: 7,
- borderLeftWidth: 1,
- },
- card: {
- backgroundColor: "transparent",
- },
- searchContainer: {
- padding: 16,
- flex: 1,
- },
- list: {
- paddingTop: 8,
- },
- emptyResults: {
- flex: 1,
- flexDirection: "column",
- alignItems: "center",
- justifyContent: "center",
- },
- emptyText: {
- fontSize: 16,
- },
- emptyStateBody: {
- flex: 1,
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- },
- iconContainer: {
- width: 56,
- height: 56,
- borderRadius: 50,
- marginBottom: 24,
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
- },
- title: {
- textAlign: "center",
- fontSize: 16,
- marginBottom: 16,
- },
- description: {
- textAlign: "center",
- paddingHorizontal: 16,
- fontSize: 14,
- },
- buttonContainer: {
- paddingTop: 24,
- paddingLeft: 16,
- paddingRight: 16,
- flexDirection: "row",
- },
- button: {
- flex: 1,
- },
- addButton: {
- marginTop: 16,
- paddingLeft: 8,
- alignItems: "flex-start",
- },
-});
diff --git a/apps/ledger-live-mobile/src/screens/Exchange/SelectAccountCurrency.tsx b/apps/ledger-live-mobile/src/screens/Exchange/SelectAccountCurrency.tsx
deleted file mode 100644
index f7c5f5400103..000000000000
--- a/apps/ledger-live-mobile/src/screens/Exchange/SelectAccountCurrency.tsx
+++ /dev/null
@@ -1,265 +0,0 @@
-import { isAccountEmpty } from "@ledgerhq/live-common/account/index";
-import { getAccountCurrency } from "@ledgerhq/live-common/account/helpers";
-import type { AccountLike } from "@ledgerhq/types-live";
-import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
-import { useNavigation, useTheme } from "@react-navigation/native";
-import React, { useCallback } from "react";
-import { useTranslation } from "react-i18next";
-import { Platform, StyleSheet, TouchableOpacity, View } from "react-native";
-import { useSelector } from "react-redux";
-import { track } from "../../analytics";
-import AccountCard from "../../components/AccountCard";
-import Button from "../../components/Button";
-import CurrencyRow from "../../components/CurrencyRow";
-import LText from "../../components/LText";
-import { NavigatorName, ScreenName } from "../../const";
-import DropdownArrow from "../../icons/DropdownArrow";
-import { accountsSelector } from "../../reducers/accounts";
-import { useCurrencyAccountSelect } from "./hooks";
-import { StackNavigatorNavigation } from "../../components/RootNavigator/types/helpers";
-import { BaseNavigatorStackParamList } from "../../components/RootNavigator/types/BaseNavigator";
-
-type Props = {
- flow: "buy" | "sell";
- allCurrencies: Array;
- defaultCurrencyId?: string | null | undefined;
- defaultAccountId?: string | null | undefined;
-};
-export default function SelectAccountCurrency({
- flow,
- allCurrencies,
- defaultCurrencyId,
- defaultAccountId,
-}: Props) {
- const { t } = useTranslation();
- const { colors } = useTheme();
- const navigation = useNavigation>();
- const allAccounts = useSelector(accountsSelector);
- const { availableAccounts, currency, account, subAccount, setAccount, setCurrency } =
- useCurrencyAccountSelect({
- allCurrencies: allCurrencies || [],
- allAccounts,
- defaultCurrencyId,
- defaultAccountId,
- });
- const onCurrencyChange = useCallback(
- (selectedCurrency: CryptoCurrency | TokenCurrency) => {
- setCurrency(selectedCurrency);
- },
- [setCurrency],
- );
- const onAccountChange = useCallback(
- (selectedAccount?: AccountLike) => {
- setAccount(selectedAccount);
- },
- [setAccount],
- );
- const onSelectCurrency = useCallback(() => {
- navigation.navigate(NavigatorName.ExchangeStack, {
- screen: ScreenName.ExchangeSelectCurrency,
- params: {
- mode: flow,
- onCurrencyChange,
- },
- });
- }, [navigation, flow, onCurrencyChange]);
- const onSelectAccount = useCallback(() => {
- navigation.navigate(NavigatorName.ExchangeStack, {
- screen: ScreenName.ExchangeSelectAccount,
- params: {
- currency: currency as TokenCurrency | CryptoCurrency,
- mode: flow,
- onAccountChange,
- },
- });
- }, [navigation, currency, flow, onAccountChange]);
- const onContinue = useCallback(() => {
- if (account) {
- navigation.navigate(ScreenName.ProviderList, {
- accountId: account.id,
- accountAddress: account.freshAddress,
- currency: currency as TokenCurrency | CryptoCurrency,
- type: flow === "buy" ? "onRamp" : "offRamp",
- });
- track(`${flow.charAt(0).toUpperCase()}${flow.slice(1)} Crypto Continue Button`, {
- currencyName: getAccountCurrency(account).name,
- isEmpty: isAccountEmpty(account),
- });
- }
- }, [account, currency, flow, navigation]);
- const onAddAccount = useCallback(() => {
- if (currency && currency.type === "TokenCurrency") {
- navigation.navigate(NavigatorName.AddAccounts, {
- screen: ScreenName.AddAccountsTokenCurrencyDisclaimer,
- params: {
- token: currency as TokenCurrency,
- analyticsPropertyFlow: flow,
- },
- });
- } else {
- navigation.navigate(NavigatorName.AddAccounts, {
- screen: ScreenName.AddAccountsSelectDevice,
- params: {
- currency: currency!,
- analyticsPropertyFlow: flow,
- },
- });
- }
- }, [currency, flow, navigation]);
- return (
-
-
-
- {flow === "buy" ? t("exchange.buy.wantToBuy") : t("exchange.sell.wantToSell")}
-
-
-
-
- {currency ? (
-
- {}}
- iconSize={32}
- />
-
- ) : (
- {t("exchange.buy.selectCurrency")}
- )}
-
-
-
-
- {availableAccounts.length > 0 && (
- <>
-
- {t("exchange.buy.selectAccount")}
-
-
-
- {account || subAccount ? (
-
- ) : (
- {t("exchange.buy.selectAccount")}
- )}
-
-
-
- >
- )}
-
-
- {account ? (
-
- ) : (
-
- )}
-
-
- );
-}
-const styles = StyleSheet.create({
- body: {
- flex: 1,
- display: "flex",
- alignItems: "center",
- justifyContent: "space-between",
- paddingHorizontal: 16,
- paddingTop: 16,
- },
- accountAndCurrencySelect: {
- width: "100%",
- marginTop: 8,
- borderWidth: 1,
- borderRadius: 4,
- paddingVertical: 24,
- paddingHorizontal: 16,
- },
- select: {
- height: 56,
- display: "flex",
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- borderWidth: 1,
- borderRadius: 120,
- paddingVertical: 14,
- marginTop: 12,
- paddingRight: 16,
- },
- name: {
- flex: 1,
- },
- itemMargin: {
- marginTop: 40,
- },
- placeholder: {
- marginLeft: 16,
- },
- card: {
- maxWidth: "100%",
- paddingVertical: -16,
- paddingHorizontal: 16,
- backgroundColor: "transparent",
- },
- footer: {
- paddingVertical: 16,
- },
- button: {
- alignSelf: "stretch",
- minWidth: "100%",
- },
-});
diff --git a/apps/ledger-live-mobile/src/screens/Exchange/SelectCurrency.tsx b/apps/ledger-live-mobile/src/screens/Exchange/SelectCurrency.tsx
deleted file mode 100644
index 7a3b142c51d7..000000000000
--- a/apps/ledger-live-mobile/src/screens/Exchange/SelectCurrency.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import React, { useCallback } from "react";
-import { Trans } from "react-i18next";
-import { StyleSheet, View, FlatList } from "react-native";
-import { SafeAreaView } from "react-native-safe-area-context";
-import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
-import { useCurrenciesByMarketcap } from "@ledgerhq/live-common/currencies/index";
-import { useRampCatalog } from "@ledgerhq/live-common/platform/providers/RampCatalogProvider/index";
-import { CompositeScreenProps, useTheme } from "@react-navigation/native";
-import { track } from "../../analytics/segment";
-import { TrackScreen } from "../../analytics";
-import FilteredSearchBar from "../../components/FilteredSearchBar";
-import KeyboardView from "../../components/KeyboardView";
-import CurrencyRow from "../../components/CurrencyRow";
-import LText from "../../components/LText";
-import { NavigatorName, ScreenName } from "../../const";
-import { useRampCatalogCurrencies } from "./hooks";
-import { StackNavigatorProps } from "../../components/RootNavigator/types/helpers";
-import { ExchangeStackNavigatorParamList } from "../../components/RootNavigator/types/ExchangeStackNavigator";
-import { BaseNavigatorStackParamList } from "../../components/RootNavigator/types/BaseNavigator";
-import { getEnv } from "@ledgerhq/live-common/env";
-
-type Navigation = CompositeScreenProps<
- StackNavigatorProps,
- StackNavigatorProps
->;
-
-const SEARCH_KEYS = getEnv("CRYPTO_ASSET_SEARCH_KEYS");
-type Props = Navigation;
-
-const keyExtractor = (currency: CryptoCurrency | TokenCurrency) => currency.id;
-
-const renderEmptyList = () => (
-
-
-
-
-
-);
-
-export default function ExchangeSelectCrypto({ navigation, route }: Props) {
- const { colors } = useTheme();
- const { params } = route;
- const { currency: initialCurrencySelected, mode = "buy", onCurrencyChange } = params;
- const rampCatalog = useRampCatalog();
- const cryptoCurrencies = useRampCatalogCurrencies(
- mode === "buy" ? rampCatalog!.value!.onRamp : rampCatalog!.value!.offRamp,
- );
- const sortedCryptoCurrencies = useCurrenciesByMarketcap(cryptoCurrencies);
- const onPressCurrency = useCallback(
- (currency: CryptoCurrency) => {
- if (onCurrencyChange) {
- onCurrencyChange(currency);
- }
-
- const destinationScreen = mode === "buy" ? ScreenName.ExchangeBuy : ScreenName.ExchangeSell;
- navigation.navigate(NavigatorName.Exchange, {
- screen: destinationScreen,
- });
- },
- [mode, navigation, onCurrencyChange],
- );
- const onPressToken = useCallback(
- (token: TokenCurrency) => {
- if (onCurrencyChange) {
- onCurrencyChange(token);
- }
-
- const destinationScreen = mode === "buy" ? ScreenName.ExchangeBuy : ScreenName.ExchangeSell;
- navigation.navigate(NavigatorName.Exchange, {
- screen: destinationScreen,
- });
- },
- [mode, navigation, onCurrencyChange],
- );
- const onPressItem = useCallback(
- (currencyOrToken: CryptoCurrency | TokenCurrency) => {
- track("Buy Crypto Continue Button", {
- currencyName: currencyOrToken.name,
- });
-
- if (currencyOrToken.type === "TokenCurrency") {
- onPressToken(currencyOrToken);
- } else {
- onPressCurrency(currencyOrToken);
- }
- },
- [onPressCurrency, onPressToken],
- );
-
- const renderList = (items: (CryptoCurrency | TokenCurrency)[]) => (
- }
- keyExtractor={keyExtractor}
- showsVerticalScrollIndicator={false}
- keyboardDismissMode="on-drag"
- />
- );
-
- return (
-
-
-
-
-
-
-
-
- );
-}
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
- searchContainer: {
- paddingTop: 16,
- flex: 1,
- },
- list: {
- paddingBottom: 32,
- },
- filteredSearchInputWrapperStyle: {
- marginHorizontal: 16,
- },
- emptySearch: {
- paddingHorizontal: 16,
- },
- emptySearchText: {
- textAlign: "center",
- },
- keybaordContainer: {
- flex: 1,
- },
-});
diff --git a/apps/ledger-live-mobile/src/screens/Exchange/Sell.tsx b/apps/ledger-live-mobile/src/screens/Exchange/Sell.tsx
deleted file mode 100644
index 74ae20a8bade..000000000000
--- a/apps/ledger-live-mobile/src/screens/Exchange/Sell.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { View, StyleSheet } from "react-native";
-import { SafeAreaView } from "react-native-safe-area-context";
-import { useTheme } from "@react-navigation/native";
-import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
-import { currenciesByMarketcap } from "@ledgerhq/live-common/currencies/index";
-import { useRampCatalog } from "@ledgerhq/live-common/platform/providers/RampCatalogProvider/index";
-import type { RampCatalogEntry } from "@ledgerhq/live-common/platform/providers/RampCatalogProvider/types";
-import extraStatusBarPadding from "../../logic/extraStatusBarPadding";
-import TrackScreen from "../../analytics/TrackScreen";
-import BigSpinner from "../../icons/BigSpinner";
-import { useRampCatalogCurrencies } from "./hooks";
-import SelectAccountCurrency from "./SelectAccountCurrency";
-import { StackNavigatorProps } from "../../components/RootNavigator/types/helpers";
-import { ExchangeNavigatorParamList } from "../../components/RootNavigator/types/ExchangeNavigator";
-import { ScreenName } from "../../const";
-
-type Props = StackNavigatorProps;
-
-type State = {
- sortedCurrencies: Array;
- isLoading: boolean;
-};
-// To avoid recreating a ref on each render and triggering hooks
-const emptyArray: RampCatalogEntry[] = [];
-export default function OffRamp({ route }: Props) {
- const [currencyState, setCurrencyState] = useState({
- sortedCurrencies: [],
- isLoading: true,
- });
- const { colors } = useTheme();
- const rampCatalog = useRampCatalog();
- const allCurrencies = useRampCatalogCurrencies(rampCatalog?.value?.offRamp || emptyArray);
- const { defaultAccountId, defaultCurrencyId, defaultTicker } = route.params || {};
- useEffect(() => {
- const filteredCurrencies = defaultTicker
- ? allCurrencies.filter(currency => currency.ticker === defaultTicker)
- : allCurrencies;
- currenciesByMarketcap(filteredCurrencies).then(sortedCurrencies => {
- setCurrencyState({
- sortedCurrencies,
- isLoading: false,
- });
- }); // Only get on first render
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
- return (
-
-
- {currencyState.isLoading ? (
-
-
-
- ) : (
-
- )}
-
- );
-}
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
- spinner: {
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- marginTop: 10,
- },
-});
diff --git a/apps/ledger-live-mobile/src/screens/Exchange/hooks.ts b/apps/ledger-live-mobile/src/screens/Exchange/hooks.ts
deleted file mode 100644
index d610bdcb22d7..000000000000
--- a/apps/ledger-live-mobile/src/screens/Exchange/hooks.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { makeEmptyTokenAccount } from "@ledgerhq/live-common/account/index";
-import { listCryptoCurrencies, listTokens } from "@ledgerhq/live-common/currencies/index";
-import useEnv from "@ledgerhq/live-common/hooks/useEnv";
-import { getAllSupportedCryptoCurrencyIds } from "@ledgerhq/live-common/platform/providers/RampCatalogProvider/helpers";
-import { RampCatalogEntry } from "@ledgerhq/live-common/platform/providers/RampCatalogProvider/types";
-import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
-import type { Account, AccountLike, SubAccount } from "@ledgerhq/types-live";
-import { useCallback, useEffect, useMemo, useState } from "react";
-import { useSelector } from "react-redux";
-import { blacklistedTokenIdsSelector } from "../../reducers/settings";
-
-export const useRampCatalogCurrencies = (entries: RampCatalogEntry[]) => {
- const devMode = useEnv("MANAGER_DEV_MODE");
- // fetching all live supported currencies including tokens
- const cryptoCurrencies = useMemo(
- () =>
- ([] as (CryptoCurrency | TokenCurrency)[])
- .concat(listCryptoCurrencies(devMode))
- .concat(listTokens()),
- [devMode],
- );
- const blacklistedTokenIds = useSelector(blacklistedTokenIdsSelector);
- return useMemo(() => {
- const supportedCurrenciesIds = getAllSupportedCryptoCurrencyIds(entries);
- return cryptoCurrencies.filter(
- currency =>
- supportedCurrenciesIds.includes(currency.id) && !blacklistedTokenIds.includes(currency.id),
- );
- }, [blacklistedTokenIds, cryptoCurrencies, entries]);
-};
-export type AccountTuple = {
- account: Account;
- subAccount?: SubAccount | null;
-};
-export function getAccountTuplesForCurrency(
- currency: CryptoCurrency | TokenCurrency,
- allAccounts: Account[],
- hideEmpty?: boolean | null,
-): AccountTuple[] {
- if (currency.type === "TokenCurrency") {
- return allAccounts
- .filter(account => account.currency.id === currency.parentCurrency.id)
- .map(account => ({
- account,
- subAccount:
- (account.subAccounts &&
- account.subAccounts.find(
- (subAcc: SubAccount) =>
- subAcc.type === "TokenAccount" && subAcc.token.id === currency.id,
- )) ||
- makeEmptyTokenAccount(account, currency),
- }))
- .filter(a => (hideEmpty ? a.subAccount?.balance.gt(0) : true));
- }
-
- return allAccounts
- .filter(account => account.currency.id === currency.id)
- .map(account => ({
- account,
- subAccount: null,
- }))
- .filter(a => (hideEmpty ? a.account?.balance.gt(0) : true));
-}
-
-const getIdsFromTuple = (accountTuple: AccountTuple) => ({
- accountId: accountTuple.account ? accountTuple.account.id : null,
- subAccountId: accountTuple.subAccount ? accountTuple.subAccount.id : null,
-});
-
-export type UseCurrencyAccountSelectReturnType = {
- availableAccounts: Array;
- currency?: CryptoCurrency | TokenCurrency | null;
- account?: Account | null;
- subAccount?: SubAccount | null;
- setAccount: (account?: AccountLike | null, subAccount?: SubAccount | null) => void;
- setCurrency: (_?: CryptoCurrency | TokenCurrency | null) => void;
-};
-export function useCurrencyAccountSelect({
- allCurrencies,
- allAccounts,
- defaultCurrencyId,
- defaultAccountId,
- hideEmpty,
-}: {
- allCurrencies: Array;
- allAccounts: Account[];
- defaultCurrencyId?: string | null;
- defaultAccountId?: string | null;
- hideEmpty?: boolean | null;
-}): UseCurrencyAccountSelectReturnType {
- const [state, setState] = useState<{
- currency: CryptoCurrency | TokenCurrency | null;
- accountId: string | null;
- subAccountId?: string | null;
- }>(() => {
- const currency = defaultCurrencyId
- ? allCurrencies.find(currency => currency.id === defaultCurrencyId)
- : allCurrencies.length > 0
- ? allCurrencies[0]
- : undefined;
-
- if (!currency) {
- return {
- currency: null,
- accountId: null,
- };
- }
-
- const availableAccounts = getAccountTuplesForCurrency(currency, allAccounts, hideEmpty);
- const { accountId } = defaultAccountId
- ? {
- accountId: defaultAccountId,
- }
- : availableAccounts.length
- ? getIdsFromTuple(availableAccounts[0])
- : {
- accountId: null,
- };
- return {
- currency,
- accountId,
- };
- });
- const { currency, accountId } = state;
- const setCurrency = useCallback(
- (currency?: CryptoCurrency | TokenCurrency | null) => {
- if (currency) {
- const availableAccounts = getAccountTuplesForCurrency(currency, allAccounts, hideEmpty);
- const { accountId } = availableAccounts.length
- ? getIdsFromTuple(availableAccounts[0])
- : {
- accountId: null,
- };
- return setState(currState => ({ ...currState, currency, accountId }));
- }
-
- return setState(currState => ({
- ...currState,
- currency: null,
- accountId: null,
- }));
- },
- [allAccounts, hideEmpty],
- );
- const setAccount = useCallback((account?: AccountLike | null, _?: SubAccount | null) => {
- setState(currState => ({
- ...currState,
- accountId: account ? account.id : null,
- }));
- }, []);
- const availableAccounts = useMemo(
- () => (currency ? getAccountTuplesForCurrency(currency, allAccounts, hideEmpty) : []),
- [currency, allAccounts, hideEmpty],
- );
- const { account, subAccount } = useMemo(
- () =>
- availableAccounts.find(
- tuple =>
- (tuple.account && tuple.account.id === accountId) ||
- (tuple.subAccount && tuple.subAccount.id === accountId),
- ) || {
- account: null,
- subAccount: null,
- },
- [availableAccounts, accountId],
- );
- useEffect(() => {
- if (!accountId && availableAccounts.length > 0) {
- setState(currState => ({
- ...currState,
- accountId: availableAccounts[0].account ? availableAccounts[0].account.id : null,
- subAccountId: availableAccounts[0].subAccount ? availableAccounts[0].subAccount.id : null,
- }));
- }
- }, [availableAccounts, accountId]);
- return {
- availableAccounts,
- currency,
- account,
- subAccount,
- setAccount,
- setCurrency,
- };
-}
diff --git a/apps/ledger-live-mobile/src/screens/PTX/BuyAndSell/index.tsx b/apps/ledger-live-mobile/src/screens/PTX/BuyAndSell/index.tsx
index 14846f7a0119..9201665fc5e6 100644
--- a/apps/ledger-live-mobile/src/screens/PTX/BuyAndSell/index.tsx
+++ b/apps/ledger-live-mobile/src/screens/PTX/BuyAndSell/index.tsx
@@ -23,12 +23,12 @@ const appManifestNotFoundError = new Error("App not found"); // FIXME move this
export function BuyAndSellScreen({ route }: Props) {
const { theme } = useTheme();
- const { platform: appId, ...params } = route.params || {};
+ const { platform, ...params } = route.params || {};
const searchParams = route.path
? new URL("ledgerlive://" + route.path).searchParams
: new URLSearchParams();
- const localManifest = useLocalLiveAppManifest(appId);
- const remoteManifest = useRemoteLiveAppManifest(appId);
+ const localManifest = useLocalLiveAppManifest(platform);
+ const remoteManifest = useRemoteLiveAppManifest(platform);
const { state: remoteLiveAppState } = useRemoteLiveAppContext();
const { locale } = useLocale();
const manifest = localManifest || remoteManifest;
diff --git a/libs/ledger-live-common/src/featureFlags/defaultFeatures.ts b/libs/ledger-live-common/src/featureFlags/defaultFeatures.ts
index 7238eee71a2f..348af978d61d 100644
--- a/libs/ledger-live-common/src/featureFlags/defaultFeatures.ts
+++ b/libs/ledger-live-common/src/featureFlags/defaultFeatures.ts
@@ -196,12 +196,6 @@ export const defaultFeatures = {
llmNewFirmwareUpdateUx: {
enabled: false,
},
- ptxSmartRouting: {
- enabled: false,
- },
- ptxSmartRoutingMobile: {
- enabled: false,
- },
syncOnboarding: {
enabled: false,
},
diff --git a/libs/ledger-live-common/src/wallet-api/constants.ts b/libs/ledger-live-common/src/wallet-api/constants.ts
index fde3c41146e6..5df02d93ce23 100644
--- a/libs/ledger-live-common/src/wallet-api/constants.ts
+++ b/libs/ledger-live-common/src/wallet-api/constants.ts
@@ -23,3 +23,7 @@ export const DAPP_DISCLAIMER_ID = "PlatformAppDisclaimer";
export const DISCOVER_STORE_KEY = "discover";
export const DISCOVER_INITIAL_CATEGORY = "all";
+
+export const DEFAULT_MULTIBUY_APP_ID = "multibuy";
+
+export const INTERNAL_APP_IDS = ["multibuy"];
diff --git a/libs/ledger-live-common/src/wallet-api/helpers.ts b/libs/ledger-live-common/src/wallet-api/helpers.ts
index 0ab8d418d467..69a0c9173f55 100644
--- a/libs/ledger-live-common/src/wallet-api/helpers.ts
+++ b/libs/ledger-live-common/src/wallet-api/helpers.ts
@@ -64,3 +64,51 @@ export function getClientHeaders(params: getHostHeadersParams): Record {
+ const isValid: boolean = whitelistedDomains.reduce(
+ (acc: boolean, whitelistedDomain: string) =>
+ acc ? acc : new RegExp(whitelistedDomain).test(url),
+ false,
+ );
+
+ if (!isValid) {
+ console.error("#isWhitelistedDomain:: invalid URL: url is not whitelisted");
+ }
+
+ return isValid;
+};
+
+export const getInitialURL = (inputs, manifest) => {
+ try {
+ if (inputs?.goToURL) {
+ const url = decodeURIComponent(inputs.goToURL);
+
+ if (isWhitelistedDomain(url, manifest.domains)) {
+ return url;
+ }
+ }
+
+ const url = new URL(manifest.url);
+
+ addParamsToURL(url, inputs);
+
+ if (manifest.params) {
+ url.searchParams.set("params", JSON.stringify(manifest.params));
+ }
+
+ return url.toString();
+ } catch (e) {
+ if (e instanceof Error) console.error(e.message);
+
+ return manifest.url.toString();
+ }
+};
+
+export const safeUrl = (url: string) => {
+ try {
+ return new URL(url);
+ } catch {
+ return null;
+ }
+};
diff --git a/libs/ledgerjs/packages/types-live/README.md b/libs/ledgerjs/packages/types-live/README.md
index 37f20a36b9ea..7ae7ada4702b 100644
--- a/libs/ledgerjs/packages/types-live/README.md
+++ b/libs/ledgerjs/packages/types-live/README.md
@@ -532,7 +532,7 @@ Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
Add others with union (e.g. "learn" | "market" | "foo")
-Type: (`"learn"` | `"brazePushNotifications"` | `"brazeLearn"` | `"llmNewDeviceSelection"` | `"llmNewFirmwareUpdateUx"` | `"ratingsPrompt"` | `"counterValue"` | `"deviceInitialApps"` | `"buyDeviceFromLive"` | `"ptxSmartRouting"` | `"ptxEarn"` | `"currencyAvalancheCChain"` | `"currencyStacks"` | `"currencyOptimism"` | `"currencyOptimismGoerli"` | `"currencyArbitrum"` | `"currencyArbitrumGoerli"` | `"currencyRsk"` | `"currencyBittorrent"` | `"currencyKavaEvm"` | `"currencyEvmosEvm"` | `"currencyEnergyWeb"` | `"currencyAstar"` | `"currencyMetis"` | `"currencyBoba"` | `"currencyMoonriver"` | `"currencyVelasEvm"` | `"currencySyscoin"` | `"currencyAxelar"` | `"currencySecretNetwork"` | `"currencyDesmos"` | `"currencyUmee"` | `"currencyStargaze"` | `"currencyOnomy"` | `"currencyPersistence"` | `"currencyQuicksilver"` | `"currencyInternetComputer"` | `"currencyTelosEvm"` | `"currencyCoreum"` | `"currencyPolygonZkEvm"` | `"currencyPolygonZkEvmTestnet"` | `"currencyBase"` | `"currencyBaseGoerli"` | `"currencyKlaytn"` | `"ptxSmartRoutingMobile"` | `"mockFeature"` | `"multibuyNavigation"` | `"syncOnboarding"` | `"walletConnectLiveApp"` | `"walletConnectEntryPoint"` | `"customImage"` | `"referralProgramDiscoverCard"` | `"referralProgramDesktopBanner"` | `"referralProgramDesktopSidebar"` | `"referralProgramMobile"` | `"disableNftSend"` | `"disableNftLedgerMarket"` | `"disableNftRaribleOpensea"` | `"walletNftGallery"` | `"receiveStakingFlowConfigDesktop"` | `"ethStakingProviders"` | `"storyly"` | `"staxWelcomeScreen"` | `"postOnboardingClaimNft"` | `"postOnboardingAssetsTransfer"` | `"firebaseEnvironmentReadOnly"` | `"protectServicesMobile"` | `"protectServicesDesktop"` | `"ptxServiceCtaExchangeDrawer"` | `"ptxServiceCtaScreens"` | `"swapWalletApiPartnerList"` | `"stakePrograms"` | `"portfolioExchangeBanner"` | `"objkt"` | `"editEthTx"` | `"stakeAccountBanner"` | `"newsfeedPage"` | `"domainInputResolution"` | `"discover"` | `"protectServicesDiscoverDesktop"` | `"protectServicesDesktop"` | `"transactionsAlerts"` | `"listAppsV2"` | `"editEthTx"`)
+Type: (`"learn"` | `"brazePushNotifications"` | `"brazeLearn"` | `"llmNewDeviceSelection"` | `"llmNewFirmwareUpdateUx"` | `"ratingsPrompt"` | `"counterValue"` | `"deviceInitialApps"` | `"buyDeviceFromLive"` | `"ptxEarn"` | `"currencyAvalancheCChain"` | `"currencyStacks"` | `"currencyOptimism"` | `"currencyOptimismGoerli"` | `"currencyArbitrum"` | `"currencyArbitrumGoerli"` | `"currencyRsk"` | `"currencyBittorrent"` | `"currencyKavaEvm"` | `"currencyEvmosEvm"` | `"currencyEnergyWeb"` | `"currencyAstar"` | `"currencyMetis"` | `"currencyBoba"` | `"currencyMoonriver"` | `"currencyVelasEvm"` | `"currencySyscoin"` | `"currencyAxelar"` | `"currencySecretNetwork"` | `"currencyDesmos"` | `"currencyUmee"` | `"currencyStargaze"` | `"currencyOnomy"` | `"currencyPersistence"` | `"currencyQuicksilver"` | `"currencyInternetComputer"` | `"currencyTelosEvm"` | `"currencyCoreum"` | `"currencyPolygonZkEvm"` | `"currencyPolygonZkEvmTestnet"` | `"currencyBase"` | `"currencyBaseGoerli"` | `"currencyKlaytn"` | `"mockFeature"` | `"multibuyNavigation"` | `"syncOnboarding"` | `"walletConnectLiveApp"` | `"walletConnectEntryPoint"` | `"customImage"` | `"referralProgramDiscoverCard"` | `"referralProgramDesktopBanner"` | `"referralProgramDesktopSidebar"` | `"referralProgramMobile"` | `"disableNftSend"` | `"disableNftLedgerMarket"` | `"disableNftRaribleOpensea"` | `"walletNftGallery"` | `"receiveStakingFlowConfigDesktop"` | `"ethStakingProviders"` | `"storyly"` | `"staxWelcomeScreen"` | `"postOnboardingClaimNft"` | `"postOnboardingAssetsTransfer"` | `"firebaseEnvironmentReadOnly"` | `"protectServicesMobile"` | `"protectServicesDesktop"` | `"ptxServiceCtaExchangeDrawer"` | `"ptxServiceCtaScreens"` | `"swapWalletApiPartnerList"` | `"stakePrograms"` | `"portfolioExchangeBanner"` | `"objkt"` | `"editEthTx"` | `"stakeAccountBanner"` | `"newsfeedPage"` | `"domainInputResolution"` | `"discover"` | `"protectServicesDiscoverDesktop"` | `"transactionsAlerts"` | `"listAppsV2"`)
### Feature
diff --git a/libs/ledgerjs/packages/types-live/src/feature.ts b/libs/ledgerjs/packages/types-live/src/feature.ts
index ddeaecfea5c5..80144079699e 100644
--- a/libs/ledgerjs/packages/types-live/src/feature.ts
+++ b/libs/ledgerjs/packages/types-live/src/feature.ts
@@ -9,7 +9,6 @@ export type FeatureId =
| "counterValue"
| "deviceInitialApps"
| "buyDeviceFromLive"
- | "ptxSmartRouting"
| "ptxEarn"
| "currencyAvalancheCChain"
| "currencyStacks"
@@ -44,7 +43,6 @@ export type FeatureId =
| "currencyBase"
| "currencyBaseGoerli"
| "currencyKlaytn"
- | "ptxSmartRoutingMobile"
| "mockFeature"
| "multibuyNavigation"
| "syncOnboarding"
@@ -80,10 +78,8 @@ export type FeatureId =
| "domainInputResolution"
| "discover"
| "protectServicesDiscoverDesktop"
- | "protectServicesDesktop"
| "transactionsAlerts"
- | "listAppsV2"
- | "editEthTx";
+ | "listAppsV2";
/** We use objects instead of direct booleans for potential future improvements
like feature versioning etc */
diff --git a/tools/actions/turborepo-gh-cache/build/server.js b/tools/actions/turborepo-gh-cache/build/server.js
index 2034f7a7f29f..1eac1e795575 100644
--- a/tools/actions/turborepo-gh-cache/build/server.js
+++ b/tools/actions/turborepo-gh-cache/build/server.js
@@ -691,15 +691,15 @@ var require_file_command = __commonJS({
}
exports.issueFileCommand = issueFileCommand;
function prepareKeyValueMessage(key, value) {
- const delimiter2 = `ghadelimiter_${uuid_1.v4()}`;
+ const delimiter3 = `ghadelimiter_${uuid_1.v4()}`;
const convertedValue = utils_1.toCommandValue(value);
- if (key.includes(delimiter2)) {
- throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter2}"`);
+ if (key.includes(delimiter3)) {
+ throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter3}"`);
}
- if (convertedValue.includes(delimiter2)) {
- throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter2}"`);
+ if (convertedValue.includes(delimiter3)) {
+ throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter3}"`);
}
- return `${key}<<${delimiter2}${os3.EOL}${convertedValue}${os3.EOL}${delimiter2}`;
+ return `${key}<<${delimiter3}${os3.EOL}${convertedValue}${os3.EOL}${delimiter3}`;
}
exports.prepareKeyValueMessage = prepareKeyValueMessage;
}
@@ -889,18 +889,18 @@ var require_tunnel = __commonJS({
res.statusCode
);
socket.destroy();
- var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode);
- error.code = "ECONNRESET";
- options.request.emit("error", error);
+ var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode);
+ error2.code = "ECONNRESET";
+ options.request.emit("error", error2);
self2.removeSocket(placeholder);
return;
}
if (head.length > 0) {
debug("got illegal response body from proxy");
socket.destroy();
- var error = new Error("got illegal response body from proxy");
- error.code = "ECONNRESET";
- options.request.emit("error", error);
+ var error2 = new Error("got illegal response body from proxy");
+ error2.code = "ECONNRESET";
+ options.request.emit("error", error2);
self2.removeSocket(placeholder);
return;
}
@@ -915,9 +915,9 @@ var require_tunnel = __commonJS({
cause.message,
cause.stack
);
- var error = new Error("tunneling socket could not be established, cause=" + cause.message);
- error.code = "ECONNRESET";
- options.request.emit("error", error);
+ var error2 = new Error("tunneling socket could not be established, cause=" + cause.message);
+ error2.code = "ECONNRESET";
+ options.request.emit("error", error2);
self2.removeSocket(placeholder);
}
};
@@ -1709,12 +1709,12 @@ var require_oidc_utils = __commonJS({
var _a;
return __awaiter2(this, void 0, void 0, function* () {
const httpclient = OidcClient.createHttpClient();
- const res = yield httpclient.getJson(id_token_url).catch((error) => {
+ const res = yield httpclient.getJson(id_token_url).catch((error2) => {
throw new Error(`Failed to get ID Token.
- Error Code : ${error.statusCode}
+ Error Code : ${error2.statusCode}
- Error Message: ${error.result.message}`);
+ Error Message: ${error2.result.message}`);
});
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
if (!id_token) {
@@ -1735,8 +1735,8 @@ var require_oidc_utils = __commonJS({
const id_token = yield OidcClient.getCall(id_token_url);
core_1.setSecret(id_token);
return id_token;
- } catch (error) {
- throw new Error(`Error message: ${error.message}`);
+ } catch (error2) {
+ throw new Error(`Error message: ${error2.message}`);
}
});
}
@@ -2102,7 +2102,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
exports.setCommandEcho = setCommandEcho;
function setFailed(message) {
process.exitCode = ExitCode.Failure;
- error(message);
+ error2(message);
}
exports.setFailed = setFailed;
function isDebug() {
@@ -2113,10 +2113,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
command_1.issueCommand("debug", {}, message);
}
exports.debug = debug;
- function error(message, properties = {}) {
+ function error2(message, properties = {}) {
command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
- exports.error = error;
+ exports.error = error2;
function warning(message, properties = {}) {
command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
@@ -2992,7 +2992,7 @@ var require_toolrunner = __commonJS({
this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
state.CheckComplete();
});
- state.on("done", (error, exitCode) => {
+ state.on("done", (error2, exitCode) => {
if (stdbuffer.length > 0) {
this.emit("stdline", stdbuffer);
}
@@ -3000,8 +3000,8 @@ var require_toolrunner = __commonJS({
this.emit("errline", errbuffer);
}
cp.removeAllListeners();
- if (error) {
- reject(error);
+ if (error2) {
+ reject(error2);
} else {
resolve3(exitCode);
}
@@ -3096,14 +3096,14 @@ var require_toolrunner = __commonJS({
this.emit("debug", message);
}
_setResult() {
- let error;
+ let error2;
if (this.processExited) {
if (this.processError) {
- error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
+ error2 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
} else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
- error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
+ error2 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
} else if (this.processStderr && this.options.failOnStdErr) {
- error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
+ error2 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
}
}
if (this.timeout) {
@@ -3111,7 +3111,7 @@ var require_toolrunner = __commonJS({
this.timeout = null;
}
this.done = true;
- this.emit("done", error, this.processExitCode);
+ this.emit("done", error2, this.processExitCode);
}
static HandleTimeout(state) {
if (state.done) {
@@ -7602,6 +7602,645 @@ var init_webResource = __esm({
}
});
+// ../../../node_modules/.pnpm/punycode@2.1.1/node_modules/punycode/punycode.es6.js
+var punycode_es6_exports = {};
+__export(punycode_es6_exports, {
+ decode: () => decode,
+ default: () => punycode_es6_default,
+ encode: () => encode,
+ toASCII: () => toASCII,
+ toUnicode: () => toUnicode,
+ ucs2decode: () => ucs2decode,
+ ucs2encode: () => ucs2encode
+});
+function error(type3) {
+ throw new RangeError(errors[type3]);
+}
+function map(array, fn) {
+ const result = [];
+ let length = array.length;
+ while (length--) {
+ result[length] = fn(array[length]);
+ }
+ return result;
+}
+function mapDomain(string, fn) {
+ const parts = string.split("@");
+ let result = "";
+ if (parts.length > 1) {
+ result = parts[0] + "@";
+ string = parts[1];
+ }
+ string = string.replace(regexSeparators, ".");
+ const labels = string.split(".");
+ const encoded = map(labels, fn).join(".");
+ return result + encoded;
+}
+function ucs2decode(string) {
+ const output = [];
+ let counter = 0;
+ const length = string.length;
+ while (counter < length) {
+ const value = string.charCodeAt(counter++);
+ if (value >= 55296 && value <= 56319 && counter < length) {
+ const extra = string.charCodeAt(counter++);
+ if ((extra & 64512) == 56320) {
+ output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
+ } else {
+ output.push(value);
+ counter--;
+ }
+ } else {
+ output.push(value);
+ }
+ }
+ return output;
+}
+var maxInt, base, tMin, tMax, skew, damp, initialBias, initialN, delimiter, regexPunycode, regexNonASCII, regexSeparators, errors, baseMinusTMin, floor, stringFromCharCode, ucs2encode, basicToDigit, digitToBasic, adapt, decode, encode, toUnicode, toASCII, punycode, punycode_es6_default;
+var init_punycode_es6 = __esm({
+ "../../../node_modules/.pnpm/punycode@2.1.1/node_modules/punycode/punycode.es6.js"() {
+ "use strict";
+ maxInt = 2147483647;
+ base = 36;
+ tMin = 1;
+ tMax = 26;
+ skew = 38;
+ damp = 700;
+ initialBias = 72;
+ initialN = 128;
+ delimiter = "-";
+ regexPunycode = /^xn--/;
+ regexNonASCII = /[^\0-\x7E]/;
+ regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
+ errors = {
+ "overflow": "Overflow: input needs wider integers to process",
+ "not-basic": "Illegal input >= 0x80 (not a basic code point)",
+ "invalid-input": "Invalid input"
+ };
+ baseMinusTMin = base - tMin;
+ floor = Math.floor;
+ stringFromCharCode = String.fromCharCode;
+ ucs2encode = (array) => String.fromCodePoint(...array);
+ basicToDigit = function(codePoint) {
+ if (codePoint - 48 < 10) {
+ return codePoint - 22;
+ }
+ if (codePoint - 65 < 26) {
+ return codePoint - 65;
+ }
+ if (codePoint - 97 < 26) {
+ return codePoint - 97;
+ }
+ return base;
+ };
+ digitToBasic = function(digit, flag) {
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
+ };
+ adapt = function(delta, numPoints, firstTime) {
+ let k = 0;
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
+ delta += floor(delta / numPoints);
+ for (; delta > baseMinusTMin * tMax >> 1; k += base) {
+ delta = floor(delta / baseMinusTMin);
+ }
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
+ };
+ decode = function(input) {
+ const output = [];
+ const inputLength = input.length;
+ let i = 0;
+ let n = initialN;
+ let bias = initialBias;
+ let basic = input.lastIndexOf(delimiter);
+ if (basic < 0) {
+ basic = 0;
+ }
+ for (let j = 0; j < basic; ++j) {
+ if (input.charCodeAt(j) >= 128) {
+ error("not-basic");
+ }
+ output.push(input.charCodeAt(j));
+ }
+ for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
+ let oldi = i;
+ for (let w = 1, k = base; ; k += base) {
+ if (index >= inputLength) {
+ error("invalid-input");
+ }
+ const digit = basicToDigit(input.charCodeAt(index++));
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
+ error("overflow");
+ }
+ i += digit * w;
+ const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
+ if (digit < t) {
+ break;
+ }
+ const baseMinusT = base - t;
+ if (w > floor(maxInt / baseMinusT)) {
+ error("overflow");
+ }
+ w *= baseMinusT;
+ }
+ const out = output.length + 1;
+ bias = adapt(i - oldi, out, oldi == 0);
+ if (floor(i / out) > maxInt - n) {
+ error("overflow");
+ }
+ n += floor(i / out);
+ i %= out;
+ output.splice(i++, 0, n);
+ }
+ return String.fromCodePoint(...output);
+ };
+ encode = function(input) {
+ const output = [];
+ input = ucs2decode(input);
+ let inputLength = input.length;
+ let n = initialN;
+ let delta = 0;
+ let bias = initialBias;
+ for (const currentValue of input) {
+ if (currentValue < 128) {
+ output.push(stringFromCharCode(currentValue));
+ }
+ }
+ let basicLength = output.length;
+ let handledCPCount = basicLength;
+ if (basicLength) {
+ output.push(delimiter);
+ }
+ while (handledCPCount < inputLength) {
+ let m = maxInt;
+ for (const currentValue of input) {
+ if (currentValue >= n && currentValue < m) {
+ m = currentValue;
+ }
+ }
+ const handledCPCountPlusOne = handledCPCount + 1;
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
+ error("overflow");
+ }
+ delta += (m - n) * handledCPCountPlusOne;
+ n = m;
+ for (const currentValue of input) {
+ if (currentValue < n && ++delta > maxInt) {
+ error("overflow");
+ }
+ if (currentValue == n) {
+ let q = delta;
+ for (let k = base; ; k += base) {
+ const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
+ if (q < t) {
+ break;
+ }
+ const qMinusT = q - t;
+ const baseMinusT = base - t;
+ output.push(
+ stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
+ );
+ q = floor(qMinusT / baseMinusT);
+ }
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
+ delta = 0;
+ ++handledCPCount;
+ }
+ }
+ ++delta;
+ ++n;
+ }
+ return output.join("");
+ };
+ toUnicode = function(input) {
+ return mapDomain(input, function(string) {
+ return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
+ });
+ };
+ toASCII = function(input) {
+ return mapDomain(input, function(string) {
+ return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
+ });
+ };
+ punycode = {
+ "version": "2.1.0",
+ "ucs2": {
+ "decode": ucs2decode,
+ "encode": ucs2encode
+ },
+ "decode": decode,
+ "encode": encode,
+ "toASCII": toASCII,
+ "toUnicode": toUnicode
+ };
+ punycode_es6_default = punycode;
+ }
+});
+
+// ../../../node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js
+var require_requires_port = __commonJS({
+ "../../../node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js"(exports, module2) {
+ "use strict";
+ module2.exports = function required(port, protocol) {
+ protocol = protocol.split(":")[0];
+ port = +port;
+ if (!port)
+ return false;
+ switch (protocol) {
+ case "http":
+ case "ws":
+ return port !== 80;
+ case "https":
+ case "wss":
+ return port !== 443;
+ case "ftp":
+ return port !== 21;
+ case "gopher":
+ return port !== 70;
+ case "file":
+ return false;
+ }
+ return port !== 0;
+ };
+ }
+});
+
+// ../../../node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js
+var require_querystringify = __commonJS({
+ "../../../node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js"(exports) {
+ "use strict";
+ var has = Object.prototype.hasOwnProperty;
+ var undef;
+ function decode2(input) {
+ try {
+ return decodeURIComponent(input.replace(/\+/g, " "));
+ } catch (e) {
+ return null;
+ }
+ }
+ function encode2(input) {
+ try {
+ return encodeURIComponent(input);
+ } catch (e) {
+ return null;
+ }
+ }
+ function querystring(query) {
+ var parser = /([^=?#&]+)=?([^&]*)/g, result = {}, part;
+ while (part = parser.exec(query)) {
+ var key = decode2(part[1]), value = decode2(part[2]);
+ if (key === null || value === null || key in result)
+ continue;
+ result[key] = value;
+ }
+ return result;
+ }
+ function querystringify(obj, prefix2) {
+ prefix2 = prefix2 || "";
+ var pairs = [], value, key;
+ if ("string" !== typeof prefix2)
+ prefix2 = "?";
+ for (key in obj) {
+ if (has.call(obj, key)) {
+ value = obj[key];
+ if (!value && (value === null || value === undef || isNaN(value))) {
+ value = "";
+ }
+ key = encode2(key);
+ value = encode2(value);
+ if (key === null || value === null)
+ continue;
+ pairs.push(key + "=" + value);
+ }
+ }
+ return pairs.length ? prefix2 + pairs.join("&") : "";
+ }
+ exports.stringify = querystringify;
+ exports.parse = querystring;
+ }
+});
+
+// ../../../node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js
+var require_url_parse = __commonJS({
+ "../../../node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js"(exports, module2) {
+ "use strict";
+ var required = require_requires_port();
+ var qs = require_querystringify();
+ var controlOrWhitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;
+ var CRHTLF = /[\n\r\t]/g;
+ var slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//;
+ var port = /:\d+$/;
+ var protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i;
+ var windowsDriveLetter = /^[a-zA-Z]:/;
+ function trimLeft(str) {
+ return (str ? str : "").toString().replace(controlOrWhitespace, "");
+ }
+ var rules = [
+ ["#", "hash"],
+ ["?", "query"],
+ function sanitize(address, url2) {
+ return isSpecial(url2.protocol) ? address.replace(/\\/g, "/") : address;
+ },
+ ["/", "pathname"],
+ ["@", "auth", 1],
+ [NaN, "host", void 0, 1, 1],
+ [/:(\d*)$/, "port", void 0, 1],
+ [NaN, "hostname", void 0, 1, 1]
+ ];
+ var ignore = { hash: 1, query: 1 };
+ function lolcation(loc) {
+ var globalVar;
+ if (typeof window !== "undefined")
+ globalVar = window;
+ else if (typeof global !== "undefined")
+ globalVar = global;
+ else if (typeof self !== "undefined")
+ globalVar = self;
+ else
+ globalVar = {};
+ var location = globalVar.location || {};
+ loc = loc || location;
+ var finaldestination = {}, type3 = typeof loc, key;
+ if ("blob:" === loc.protocol) {
+ finaldestination = new Url2(unescape(loc.pathname), {});
+ } else if ("string" === type3) {
+ finaldestination = new Url2(loc, {});
+ for (key in ignore)
+ delete finaldestination[key];
+ } else if ("object" === type3) {
+ for (key in loc) {
+ if (key in ignore)
+ continue;
+ finaldestination[key] = loc[key];
+ }
+ if (finaldestination.slashes === void 0) {
+ finaldestination.slashes = slashes.test(loc.href);
+ }
+ }
+ return finaldestination;
+ }
+ function isSpecial(scheme) {
+ return scheme === "file:" || scheme === "ftp:" || scheme === "http:" || scheme === "https:" || scheme === "ws:" || scheme === "wss:";
+ }
+ function extractProtocol(address, location) {
+ address = trimLeft(address);
+ address = address.replace(CRHTLF, "");
+ location = location || {};
+ var match = protocolre.exec(address);
+ var protocol = match[1] ? match[1].toLowerCase() : "";
+ var forwardSlashes = !!match[2];
+ var otherSlashes = !!match[3];
+ var slashesCount = 0;
+ var rest;
+ if (forwardSlashes) {
+ if (otherSlashes) {
+ rest = match[2] + match[3] + match[4];
+ slashesCount = match[2].length + match[3].length;
+ } else {
+ rest = match[2] + match[4];
+ slashesCount = match[2].length;
+ }
+ } else {
+ if (otherSlashes) {
+ rest = match[3] + match[4];
+ slashesCount = match[3].length;
+ } else {
+ rest = match[4];
+ }
+ }
+ if (protocol === "file:") {
+ if (slashesCount >= 2) {
+ rest = rest.slice(2);
+ }
+ } else if (isSpecial(protocol)) {
+ rest = match[4];
+ } else if (protocol) {
+ if (forwardSlashes) {
+ rest = rest.slice(2);
+ }
+ } else if (slashesCount >= 2 && isSpecial(location.protocol)) {
+ rest = match[4];
+ }
+ return {
+ protocol,
+ slashes: forwardSlashes || isSpecial(protocol),
+ slashesCount,
+ rest
+ };
+ }
+ function resolve3(relative, base2) {
+ if (relative === "")
+ return base2;
+ var path3 = (base2 || "/").split("/").slice(0, -1).concat(relative.split("/")), i = path3.length, last = path3[i - 1], unshift = false, up = 0;
+ while (i--) {
+ if (path3[i] === ".") {
+ path3.splice(i, 1);
+ } else if (path3[i] === "..") {
+ path3.splice(i, 1);
+ up++;
+ } else if (up) {
+ if (i === 0)
+ unshift = true;
+ path3.splice(i, 1);
+ up--;
+ }
+ }
+ if (unshift)
+ path3.unshift("");
+ if (last === "." || last === "..")
+ path3.push("");
+ return path3.join("/");
+ }
+ function Url2(address, location, parser) {
+ address = trimLeft(address);
+ address = address.replace(CRHTLF, "");
+ if (!(this instanceof Url2)) {
+ return new Url2(address, location, parser);
+ }
+ var relative, extracted, parse3, instruction, index, key, instructions = rules.slice(), type3 = typeof location, url2 = this, i = 0;
+ if ("object" !== type3 && "string" !== type3) {
+ parser = location;
+ location = null;
+ }
+ if (parser && "function" !== typeof parser)
+ parser = qs.parse;
+ location = lolcation(location);
+ extracted = extractProtocol(address || "", location);
+ relative = !extracted.protocol && !extracted.slashes;
+ url2.slashes = extracted.slashes || relative && location.slashes;
+ url2.protocol = extracted.protocol || location.protocol || "";
+ address = extracted.rest;
+ if (extracted.protocol === "file:" && (extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || !extracted.slashes && (extracted.protocol || extracted.slashesCount < 2 || !isSpecial(url2.protocol))) {
+ instructions[3] = [/(.*)/, "pathname"];
+ }
+ for (; i < instructions.length; i++) {
+ instruction = instructions[i];
+ if (typeof instruction === "function") {
+ address = instruction(address, url2);
+ continue;
+ }
+ parse3 = instruction[0];
+ key = instruction[1];
+ if (parse3 !== parse3) {
+ url2[key] = address;
+ } else if ("string" === typeof parse3) {
+ index = parse3 === "@" ? address.lastIndexOf(parse3) : address.indexOf(parse3);
+ if (~index) {
+ if ("number" === typeof instruction[2]) {
+ url2[key] = address.slice(0, index);
+ address = address.slice(index + instruction[2]);
+ } else {
+ url2[key] = address.slice(index);
+ address = address.slice(0, index);
+ }
+ }
+ } else if (index = parse3.exec(address)) {
+ url2[key] = index[1];
+ address = address.slice(0, index.index);
+ }
+ url2[key] = url2[key] || (relative && instruction[3] ? location[key] || "" : "");
+ if (instruction[4])
+ url2[key] = url2[key].toLowerCase();
+ }
+ if (parser)
+ url2.query = parser(url2.query);
+ if (relative && location.slashes && url2.pathname.charAt(0) !== "/" && (url2.pathname !== "" || location.pathname !== "")) {
+ url2.pathname = resolve3(url2.pathname, location.pathname);
+ }
+ if (url2.pathname.charAt(0) !== "/" && isSpecial(url2.protocol)) {
+ url2.pathname = "/" + url2.pathname;
+ }
+ if (!required(url2.port, url2.protocol)) {
+ url2.host = url2.hostname;
+ url2.port = "";
+ }
+ url2.username = url2.password = "";
+ if (url2.auth) {
+ index = url2.auth.indexOf(":");
+ if (~index) {
+ url2.username = url2.auth.slice(0, index);
+ url2.username = encodeURIComponent(decodeURIComponent(url2.username));
+ url2.password = url2.auth.slice(index + 1);
+ url2.password = encodeURIComponent(decodeURIComponent(url2.password));
+ } else {
+ url2.username = encodeURIComponent(decodeURIComponent(url2.auth));
+ }
+ url2.auth = url2.password ? url2.username + ":" + url2.password : url2.username;
+ }
+ url2.origin = url2.protocol !== "file:" && isSpecial(url2.protocol) && url2.host ? url2.protocol + "//" + url2.host : "null";
+ url2.href = url2.toString();
+ }
+ function set(part, value, fn) {
+ var url2 = this;
+ switch (part) {
+ case "query":
+ if ("string" === typeof value && value.length) {
+ value = (fn || qs.parse)(value);
+ }
+ url2[part] = value;
+ break;
+ case "port":
+ url2[part] = value;
+ if (!required(value, url2.protocol)) {
+ url2.host = url2.hostname;
+ url2[part] = "";
+ } else if (value) {
+ url2.host = url2.hostname + ":" + value;
+ }
+ break;
+ case "hostname":
+ url2[part] = value;
+ if (url2.port)
+ value += ":" + url2.port;
+ url2.host = value;
+ break;
+ case "host":
+ url2[part] = value;
+ if (port.test(value)) {
+ value = value.split(":");
+ url2.port = value.pop();
+ url2.hostname = value.join(":");
+ } else {
+ url2.hostname = value;
+ url2.port = "";
+ }
+ break;
+ case "protocol":
+ url2.protocol = value.toLowerCase();
+ url2.slashes = !fn;
+ break;
+ case "pathname":
+ case "hash":
+ if (value) {
+ var char = part === "pathname" ? "/" : "#";
+ url2[part] = value.charAt(0) !== char ? char + value : value;
+ } else {
+ url2[part] = value;
+ }
+ break;
+ case "username":
+ case "password":
+ url2[part] = encodeURIComponent(value);
+ break;
+ case "auth":
+ var index = value.indexOf(":");
+ if (~index) {
+ url2.username = value.slice(0, index);
+ url2.username = encodeURIComponent(decodeURIComponent(url2.username));
+ url2.password = value.slice(index + 1);
+ url2.password = encodeURIComponent(decodeURIComponent(url2.password));
+ } else {
+ url2.username = encodeURIComponent(decodeURIComponent(value));
+ }
+ }
+ for (var i = 0; i < rules.length; i++) {
+ var ins = rules[i];
+ if (ins[4])
+ url2[ins[1]] = url2[ins[1]].toLowerCase();
+ }
+ url2.auth = url2.password ? url2.username + ":" + url2.password : url2.username;
+ url2.origin = url2.protocol !== "file:" && isSpecial(url2.protocol) && url2.host ? url2.protocol + "//" + url2.host : "null";
+ url2.href = url2.toString();
+ return url2;
+ }
+ function toString4(stringify2) {
+ if (!stringify2 || "function" !== typeof stringify2)
+ stringify2 = qs.stringify;
+ var query, url2 = this, host = url2.host, protocol = url2.protocol;
+ if (protocol && protocol.charAt(protocol.length - 1) !== ":")
+ protocol += ":";
+ var result = protocol + (url2.protocol && url2.slashes || isSpecial(url2.protocol) ? "//" : "");
+ if (url2.username) {
+ result += url2.username;
+ if (url2.password)
+ result += ":" + url2.password;
+ result += "@";
+ } else if (url2.password) {
+ result += ":" + url2.password;
+ result += "@";
+ } else if (url2.protocol !== "file:" && isSpecial(url2.protocol) && !host && url2.pathname !== "/") {
+ result += "@";
+ }
+ if (host[host.length - 1] === ":" || port.test(url2.hostname) && !url2.port) {
+ host += ":";
+ }
+ result += host + url2.pathname;
+ query = "object" === typeof url2.query ? stringify2(url2.query) : url2.query;
+ if (query)
+ result += "?" !== query.charAt(0) ? "?" + query : query;
+ if (url2.hash)
+ result += url2.hash;
+ return result;
+ }
+ Url2.prototype = { set, toString: toString4 };
+ Url2.extractProtocol = extractProtocol;
+ Url2.location = lolcation;
+ Url2.trimLeft = trimLeft;
+ Url2.qs = qs;
+ module2.exports = Url2;
+ }
+});
+
// ../../../node_modules/.pnpm/psl@1.8.0/node_modules/psl/data/rules.json
var require_rules = __commonJS({
"../../../node_modules/.pnpm/psl@1.8.0/node_modules/psl/data/rules.json"(exports, module2) {
@@ -16518,13 +17157,13 @@ var require_psl = __commonJS({
if (domain.charAt(domain.length - 1) === ".") {
domain = domain.slice(0, domain.length - 1);
}
- var error = internals.validate(domain);
- if (error) {
+ var error2 = internals.validate(domain);
+ if (error2) {
return {
input,
error: {
- message: exports.errorCodes[error],
- code: error
+ message: exports.errorCodes[error2],
+ code: error2
}
};
}
@@ -16602,21 +17241,46 @@ var require_psl = __commonJS({
}
});
-// ../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/pubsuffix-psl.js
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/pubsuffix-psl.js
var require_pubsuffix_psl = __commonJS({
- "../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/pubsuffix-psl.js"(exports) {
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/pubsuffix-psl.js"(exports) {
"use strict";
var psl = require_psl();
- function getPublicSuffix(domain) {
+ var SPECIAL_USE_DOMAINS = [
+ "local",
+ "example",
+ "invalid",
+ "localhost",
+ "test"
+ ];
+ var SPECIAL_TREATMENT_DOMAINS = ["localhost", "invalid"];
+ function getPublicSuffix(domain, options = {}) {
+ const domainParts = domain.split(".");
+ const topLevelDomain = domainParts[domainParts.length - 1];
+ const allowSpecialUseDomain = !!options.allowSpecialUseDomain;
+ const ignoreError = !!options.ignoreError;
+ if (allowSpecialUseDomain && SPECIAL_USE_DOMAINS.includes(topLevelDomain)) {
+ if (domainParts.length > 1) {
+ const secondLevelDomain = domainParts[domainParts.length - 2];
+ return `${secondLevelDomain}.${topLevelDomain}`;
+ } else if (SPECIAL_TREATMENT_DOMAINS.includes(topLevelDomain)) {
+ return `${topLevelDomain}`;
+ }
+ }
+ if (!ignoreError && SPECIAL_USE_DOMAINS.includes(topLevelDomain)) {
+ throw new Error(
+ `Cookie has domain set to the public suffix "${topLevelDomain}" which is a special use domain. To allow this, configure your CookieJar with {allowSpecialUseDomain:true, rejectPublicSuffixes: false}.`
+ );
+ }
return psl.get(domain);
}
exports.getPublicSuffix = getPublicSuffix;
}
});
-// ../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/store.js
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/store.js
var require_store = __commonJS({
- "../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/store.js"(exports) {
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/store.js"(exports) {
"use strict";
var Store = class {
constructor() {
@@ -16653,9 +17317,9 @@ var require_store = __commonJS({
}
});
-// ../../../node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js
+// ../../../node_modules/.pnpm/universalify@0.2.0/node_modules/universalify/index.js
var require_universalify = __commonJS({
- "../../../node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js"(exports) {
+ "../../../node_modules/.pnpm/universalify@0.2.0/node_modules/universalify/index.js"(exports) {
"use strict";
exports.fromCallback = function(fn) {
return Object.defineProperty(function() {
@@ -16679,37 +17343,34 @@ var require_universalify = __commonJS({
const cb = arguments[arguments.length - 1];
if (typeof cb !== "function")
return fn.apply(this, arguments);
- else
+ else {
+ delete arguments[arguments.length - 1];
+ arguments.length--;
fn.apply(this, arguments).then((r) => cb(null, r), cb);
+ }
}, "name", { value: fn.name });
};
}
});
-// ../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/permuteDomain.js
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/permuteDomain.js
var require_permuteDomain = __commonJS({
- "../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/permuteDomain.js"(exports) {
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/permuteDomain.js"(exports) {
"use strict";
var pubsuffix = require_pubsuffix_psl();
- var SPECIAL_USE_DOMAINS = ["local"];
function permuteDomain(domain, allowSpecialUseDomain) {
- let pubSuf = null;
- if (allowSpecialUseDomain) {
- const domainParts = domain.split(".");
- if (SPECIAL_USE_DOMAINS.includes(domainParts[domainParts.length - 1])) {
- pubSuf = `${domainParts[domainParts.length - 2]}.${domainParts[domainParts.length - 1]}`;
- } else {
- pubSuf = pubsuffix.getPublicSuffix(domain);
- }
- } else {
- pubSuf = pubsuffix.getPublicSuffix(domain);
- }
+ const pubSuf = pubsuffix.getPublicSuffix(domain, {
+ allowSpecialUseDomain
+ });
if (!pubSuf) {
return null;
}
if (pubSuf == domain) {
return [domain];
}
+ if (domain.slice(-1) == ".") {
+ domain = domain.slice(0, -1);
+ }
const prefix2 = domain.slice(0, -(pubSuf.length + 1));
const parts = prefix2.split(".").reverse();
let cur = pubSuf;
@@ -16724,9 +17385,9 @@ var require_permuteDomain = __commonJS({
}
});
-// ../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/pathMatch.js
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/pathMatch.js
var require_pathMatch = __commonJS({
- "../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/pathMatch.js"(exports) {
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/pathMatch.js"(exports) {
"use strict";
function pathMatch(reqPath, cookiePath) {
if (cookiePath === reqPath) {
@@ -16747,25 +17408,59 @@ var require_pathMatch = __commonJS({
}
});
-// ../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/memstore.js
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/utilHelper.js
+var require_utilHelper = __commonJS({
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/utilHelper.js"(exports) {
+ function requireUtil() {
+ try {
+ return require("util");
+ } catch (e) {
+ return null;
+ }
+ }
+ function lookupCustomInspectSymbol() {
+ return Symbol.for("nodejs.util.inspect.custom");
+ }
+ function tryReadingCustomSymbolFromUtilInspect(options) {
+ const _requireUtil = options.requireUtil || requireUtil;
+ const util3 = _requireUtil();
+ return util3 ? util3.inspect.custom : null;
+ }
+ exports.getUtilInspect = function getUtilInspect(fallback, options = {}) {
+ const _requireUtil = options.requireUtil || requireUtil;
+ const util3 = _requireUtil();
+ return function inspect2(value, showHidden, depth) {
+ return util3 ? util3.inspect(value, showHidden, depth) : fallback(value);
+ };
+ };
+ exports.getCustomInspectSymbol = function getCustomInspectSymbol(options = {}) {
+ const _lookupCustomInspectSymbol = options.lookupCustomInspectSymbol || lookupCustomInspectSymbol;
+ return _lookupCustomInspectSymbol() || tryReadingCustomSymbolFromUtilInspect(options);
+ };
+ }
+});
+
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/memstore.js
var require_memstore = __commonJS({
- "../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/memstore.js"(exports) {
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/memstore.js"(exports) {
"use strict";
var { fromCallback } = require_universalify();
var Store = require_store().Store;
var permuteDomain = require_permuteDomain().permuteDomain;
var pathMatch = require_pathMatch().pathMatch;
- var util3 = require("util");
+ var { getCustomInspectSymbol, getUtilInspect } = require_utilHelper();
var MemoryCookieStore = class extends Store {
constructor() {
super();
this.synchronous = true;
- this.idx = {};
- if (util3.inspect.custom) {
- this[util3.inspect.custom] = this.inspect;
+ this.idx = /* @__PURE__ */ Object.create(null);
+ const customInspectSymbol = getCustomInspectSymbol();
+ if (customInspectSymbol) {
+ this[customInspectSymbol] = this.inspect;
}
}
inspect() {
+ const util3 = { inspect: getUtilInspect(inspectFallback) };
return `{ idx: ${util3.inspect(this.idx, false, 2)} }`;
}
findCookie(domain, path3, key, cb) {
@@ -16781,7 +17476,7 @@ var require_memstore = __commonJS({
const results = [];
if (typeof allowSpecialUseDomain === "function") {
cb = allowSpecialUseDomain;
- allowSpecialUseDomain = false;
+ allowSpecialUseDomain = true;
}
if (!domain) {
return cb(null, []);
@@ -16821,10 +17516,10 @@ var require_memstore = __commonJS({
}
putCookie(cookie, cb) {
if (!this.idx[cookie.domain]) {
- this.idx[cookie.domain] = {};
+ this.idx[cookie.domain] = /* @__PURE__ */ Object.create(null);
}
if (!this.idx[cookie.domain][cookie.path]) {
- this.idx[cookie.domain][cookie.path] = {};
+ this.idx[cookie.domain][cookie.path] = /* @__PURE__ */ Object.create(null);
}
this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
cb(null);
@@ -16849,7 +17544,7 @@ var require_memstore = __commonJS({
return cb(null);
}
removeAllCookies(cb) {
- this.idx = {};
+ this.idx = /* @__PURE__ */ Object.create(null);
return cb(null);
}
getAllCookies(cb) {
@@ -16883,32 +17578,144 @@ var require_memstore = __commonJS({
"removeAllCookies",
"getAllCookies"
].forEach((name) => {
- MemoryCookieStore[name] = fromCallback(MemoryCookieStore.prototype[name]);
+ MemoryCookieStore.prototype[name] = fromCallback(
+ MemoryCookieStore.prototype[name]
+ );
});
exports.MemoryCookieStore = MemoryCookieStore;
+ function inspectFallback(val) {
+ const domains = Object.keys(val);
+ if (domains.length === 0) {
+ return "[Object: null prototype] {}";
+ }
+ let result = "[Object: null prototype] {\n";
+ Object.keys(val).forEach((domain, i) => {
+ result += formatDomain(domain, val[domain]);
+ if (i < domains.length - 1) {
+ result += ",";
+ }
+ result += "\n";
+ });
+ result += "}";
+ return result;
+ }
+ function formatDomain(domainName, domainValue) {
+ const indent = " ";
+ let result = `${indent}'${domainName}': [Object: null prototype] {
+`;
+ Object.keys(domainValue).forEach((path3, i, paths) => {
+ result += formatPath(path3, domainValue[path3]);
+ if (i < paths.length - 1) {
+ result += ",";
+ }
+ result += "\n";
+ });
+ result += `${indent}}`;
+ return result;
+ }
+ function formatPath(pathName, pathValue) {
+ const indent = " ";
+ let result = `${indent}'${pathName}': [Object: null prototype] {
+`;
+ Object.keys(pathValue).forEach((cookieName, i, cookieNames) => {
+ const cookie = pathValue[cookieName];
+ result += ` ${cookieName}: ${cookie.inspect()}`;
+ if (i < cookieNames.length - 1) {
+ result += ",";
+ }
+ result += "\n";
+ });
+ result += `${indent}}`;
+ return result;
+ }
+ exports.inspectFallback = inspectFallback;
}
});
-// ../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/version.js
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/validators.js
+var require_validators = __commonJS({
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/validators.js"(exports) {
+ "use strict";
+ function isFunction(data) {
+ return typeof data === "function";
+ }
+ function isNonEmptyString(data) {
+ return isString(data) && data !== "";
+ }
+ function isDate(data) {
+ return isInstanceStrict(data, Date) && isInteger(data.getTime());
+ }
+ function isEmptyString(data) {
+ return data === "" || data instanceof String && data.toString() === "";
+ }
+ function isString(data) {
+ return typeof data === "string" || data instanceof String;
+ }
+ function isObject2(data) {
+ return toString.call(data) === "[object Object]";
+ }
+ function isInstanceStrict(data, prototype) {
+ try {
+ return data instanceof prototype;
+ } catch (error2) {
+ return false;
+ }
+ }
+ function isInteger(data) {
+ return typeof data === "number" && data % 1 === 0;
+ }
+ function validate2(bool, cb, options) {
+ if (!isFunction(cb)) {
+ options = cb;
+ cb = null;
+ }
+ if (!isObject2(options))
+ options = { Error: "Failed Check" };
+ if (!bool) {
+ if (cb) {
+ cb(new ParameterError(options));
+ } else {
+ throw new ParameterError(options);
+ }
+ }
+ }
+ var ParameterError = class extends Error {
+ constructor(...params) {
+ super(...params);
+ }
+ };
+ exports.ParameterError = ParameterError;
+ exports.isFunction = isFunction;
+ exports.isNonEmptyString = isNonEmptyString;
+ exports.isDate = isDate;
+ exports.isEmptyString = isEmptyString;
+ exports.isString = isString;
+ exports.isObject = isObject2;
+ exports.validate = validate2;
+ }
+});
+
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/version.js
var require_version2 = __commonJS({
- "../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/version.js"(exports, module2) {
- module2.exports = "4.0.0";
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/version.js"(exports, module2) {
+ module2.exports = "4.1.3";
}
});
-// ../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/cookie.js
+// ../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/cookie.js
var require_cookie = __commonJS({
- "../../../node_modules/.pnpm/tough-cookie@4.0.0/node_modules/tough-cookie/lib/cookie.js"(exports) {
+ "../../../node_modules/.pnpm/tough-cookie@4.1.3/node_modules/tough-cookie/lib/cookie.js"(exports) {
"use strict";
- var punycode = require("punycode");
- var urlParse = require("url").parse;
- var util3 = require("util");
+ var punycode2 = (init_punycode_es6(), __toCommonJS(punycode_es6_exports));
+ var urlParse = require_url_parse();
var pubsuffix = require_pubsuffix_psl();
var Store = require_store().Store;
var MemoryCookieStore = require_memstore().MemoryCookieStore;
var pathMatch = require_pathMatch().pathMatch;
+ var validators = require_validators();
var VERSION3 = require_version2();
var { fromCallback } = require_universalify();
+ var { getCustomInspectSymbol } = require_utilHelper();
var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
var CONTROL_CHARS = /[\x00-\x1F]/;
var TERMINATORS = ["\n", "\r", "\0"];
@@ -16932,6 +17739,7 @@ var require_cookie = __commonJS({
var MIN_TIME = 0;
var SAME_SITE_CONTEXT_VAL_ERR = 'Invalid sameSiteContext option for getCookies(); expected one of "strict", "lax", or "none"';
function checkSameSiteContext(value) {
+ validators.validate(validators.isNonEmptyString(value), value);
const context4 = String(value).toLowerCase();
if (context4 === "none" || context4 === "lax" || context4 === "strict") {
return context4;
@@ -16945,6 +17753,19 @@ var require_cookie = __commonJS({
DISABLED: "unsafe-disabled"
});
var IP_REGEX_LOWERCASE = /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|(?:[a-f\d]{1,4}:){1}(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|(?::(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:)))$)/;
+ var IP_V6_REGEX = `
+\\[?(?:
+(?:[a-fA-F\\d]{1,4}:){7}(?:[a-fA-F\\d]{1,4}|:)|
+(?:[a-fA-F\\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|:[a-fA-F\\d]{1,4}|:)|
+(?:[a-fA-F\\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,2}|:)|
+(?:[a-fA-F\\d]{1,4}:){4}(?:(?::[a-fA-F\\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,3}|:)|
+(?:[a-fA-F\\d]{1,4}:){3}(?:(?::[a-fA-F\\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,4}|:)|
+(?:[a-fA-F\\d]{1,4}:){2}(?:(?::[a-fA-F\\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,5}|:)|
+(?:[a-fA-F\\d]{1,4}:){1}(?:(?::[a-fA-F\\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,6}|:)|
+(?::(?:(?::[a-fA-F\\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,7}|:))
+)(?:%[0-9a-zA-Z]{1,})?\\]?
+`.replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
+ var IP_V6_REGEX_OBJECT = new RegExp(`^${IP_V6_REGEX}$`);
function parseDigits(token, minDigits, maxDigits, trailingOK) {
let count = 0;
while (count < token.length) {
@@ -17044,6 +17865,7 @@ var require_cookie = __commonJS({
return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));
}
function formatDate(date) {
+ validators.validate(validators.isDate(date), date);
return date.toUTCString();
}
function canonicalDomain(str) {
@@ -17051,8 +17873,11 @@ var require_cookie = __commonJS({
return null;
}
str = str.trim().replace(/^\./, "");
- if (punycode && /[^\u0001-\u007f]/.test(str)) {
- str = punycode.toASCII(str);
+ if (IP_V6_REGEX_OBJECT.test(str)) {
+ str = str.replace("[", "").replace("]", "");
+ }
+ if (punycode2 && /[^\u0001-\u007f]/.test(str)) {
+ str = punycode2.toASCII(str);
}
return str.toLowerCase();
}
@@ -17067,7 +17892,7 @@ var require_cookie = __commonJS({
if (str == domStr) {
return true;
}
- const idx = str.indexOf(domStr);
+ const idx = str.lastIndexOf(domStr);
if (idx <= 0) {
return false;
}
@@ -17096,6 +17921,8 @@ var require_cookie = __commonJS({
return path3.slice(0, rightSlash);
}
function trimTerminator(str) {
+ if (validators.isEmptyString(str))
+ return str;
for (let t = 0; t < TERMINATORS.length; t++) {
const terminatorIdx = str.indexOf(TERMINATORS[t]);
if (terminatorIdx !== -1) {
@@ -17106,6 +17933,7 @@ var require_cookie = __commonJS({
}
function parseCookiePair(cookiePair, looseMode) {
cookiePair = trimTerminator(cookiePair);
+ validators.validate(validators.isString(cookiePair), cookiePair);
let firstEq = cookiePair.indexOf("=");
if (looseMode) {
if (firstEq === 0) {
@@ -17137,6 +17965,9 @@ var require_cookie = __commonJS({
if (!options || typeof options !== "object") {
options = {};
}
+ if (validators.isEmptyString(str) || !validators.isString(str)) {
+ return null;
+ }
str = str.trim();
const firstSemi = str.indexOf(";");
const cookiePair = firstSemi === -1 ? str : str.substr(0, firstSemi);
@@ -17213,7 +18044,11 @@ var require_cookie = __commonJS({
case "lax":
c.sameSite = "lax";
break;
+ case "none":
+ c.sameSite = "none";
+ break;
default:
+ c.sameSite = void 0;
break;
}
break;
@@ -17226,9 +18061,11 @@ var require_cookie = __commonJS({
return c;
}
function isSecurePrefixConditionMet(cookie) {
+ validators.validate(validators.isObject(cookie), cookie);
return !cookie.key.startsWith("__Secure-") || cookie.secure;
}
function isHostPrefixConditionMet(cookie) {
+ validators.validate(validators.isObject(cookie));
return !cookie.key.startsWith("__Host-") || cookie.secure && cookie.hostOnly && cookie.path != null && cookie.path === "/";
}
function jsonParse(str) {
@@ -17241,7 +18078,7 @@ var require_cookie = __commonJS({
return obj;
}
function fromJSON(str) {
- if (!str) {
+ if (!str || validators.isEmptyString(str)) {
return null;
}
let obj;
@@ -17272,6 +18109,8 @@ var require_cookie = __commonJS({
return c;
}
function cookieCompare(a, b) {
+ validators.validate(validators.isObject(a), a);
+ validators.validate(validators.isObject(b), b);
let cmp = 0;
const aPathLen = a.path ? a.path.length : 0;
const bPathLen = b.path ? b.path.length : 0;
@@ -17289,6 +18128,7 @@ var require_cookie = __commonJS({
return cmp;
}
function permutePath(path3) {
+ validators.validate(validators.isString(path3));
if (path3 === "/") {
return ["/"];
}
@@ -17328,12 +18168,13 @@ var require_cookie = __commonJS({
pathIsDefault: null,
creation: null,
lastAccessed: null,
- sameSite: "none"
+ sameSite: void 0
};
var Cookie = class {
constructor(options = {}) {
- if (util3.inspect.custom) {
- this[util3.inspect.custom] = this.inspect;
+ const customInspectSymbol = getCustomInspectSymbol();
+ if (customInspectSymbol) {
+ this[customInspectSymbol] = this.inspect;
}
Object.assign(this, cookieDefaults, options);
this.creation = this.creation || new Date();
@@ -17542,9 +18383,10 @@ var require_cookie = __commonJS({
if (typeof options === "boolean") {
options = { rejectPublicSuffixes: options };
}
+ validators.validate(validators.isObject(options), options);
this.rejectPublicSuffixes = options.rejectPublicSuffixes;
this.enableLooseMode = !!options.looseMode;
- this.allowSpecialUseDomain = !!options.allowSpecialUseDomain;
+ this.allowSpecialUseDomain = typeof options.allowSpecialUseDomain === "boolean" ? options.allowSpecialUseDomain : true;
this.store = store || new MemoryCookieStore();
this.prefixSecurity = getNormalizedPrefixSecurity(options.prefixSecurity);
this._cloneSync = syncWrap("clone");
@@ -17557,12 +18399,21 @@ var require_cookie = __commonJS({
this.serializeSync = syncWrap("serialize");
}
setCookie(cookie, url2, options, cb) {
+ validators.validate(validators.isNonEmptyString(url2), cb, options);
let err;
+ if (validators.isFunction(url2)) {
+ cb = url2;
+ return cb(new Error("No URL was specified"));
+ }
const context4 = getCookieContext(url2);
- if (typeof options === "function") {
+ if (validators.isFunction(options)) {
cb = options;
options = {};
}
+ validators.validate(validators.isFunction(cb), cb);
+ if (!validators.isNonEmptyString(cookie) && !validators.isObject(cookie) && cookie instanceof String && cookie.length == 0) {
+ return cb(null);
+ }
const host = canonicalDomain(context4.hostname);
const loose = options.loose || this.enableLooseMode;
let sameSiteContext = null;
@@ -17586,8 +18437,11 @@ var require_cookie = __commonJS({
}
const now = options.now || new Date();
if (this.rejectPublicSuffixes && cookie.domain) {
- const suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
- if (suffix == null) {
+ const suffix = pubsuffix.getPublicSuffix(cookie.cdomain(), {
+ allowSpecialUseDomain: this.allowSpecialUseDomain,
+ ignoreError: options.ignoreError
+ });
+ if (suffix == null && !IP_V6_REGEX_OBJECT.test(cookie.domain)) {
err = new Error("Cookie has domain set to a public suffix");
return cb(options.ignoreError ? null : err);
}
@@ -17614,7 +18468,7 @@ var require_cookie = __commonJS({
err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
return cb(options.ignoreError ? null : err);
}
- if (cookie.sameSite !== "none" && sameSiteContext) {
+ if (cookie.sameSite !== "none" && cookie.sameSite !== void 0 && sameSiteContext) {
if (sameSiteContext === "none") {
err = new Error(
"Cookie is SameSite but this is a cross-origin request"
@@ -17674,11 +18528,14 @@ var require_cookie = __commonJS({
store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
}
getCookies(url2, options, cb) {
+ validators.validate(validators.isNonEmptyString(url2), cb, url2);
const context4 = getCookieContext(url2);
- if (typeof options === "function") {
+ if (validators.isFunction(options)) {
cb = options;
options = {};
}
+ validators.validate(validators.isObject(options), cb, options);
+ validators.validate(validators.isFunction(cb), cb);
const host = canonicalDomain(context4.hostname);
const path3 = context4.pathname || "/";
let secure = options.secure;
@@ -17755,6 +18612,7 @@ var require_cookie = __commonJS({
}
getCookieString(...args) {
const cb = args.pop();
+ validators.validate(validators.isFunction(cb), cb);
const next = function(err, cookies) {
if (err) {
cb(err);
@@ -17770,6 +18628,7 @@ var require_cookie = __commonJS({
}
getSetCookieStrings(...args) {
const cb = args.pop();
+ validators.validate(validators.isFunction(cb), cb);
const next = function(err, cookies) {
if (err) {
cb(err);
@@ -17786,14 +18645,18 @@ var require_cookie = __commonJS({
this.getCookies.apply(this, args);
}
serialize(cb) {
+ validators.validate(validators.isFunction(cb), cb);
let type3 = this.store.constructor.name;
- if (type3 === "Object") {
+ if (validators.isObject(type3)) {
type3 = null;
}
const serialized = {
version: `tough-cookie@${VERSION3}`,
storeType: type3,
rejectPublicSuffixes: !!this.rejectPublicSuffixes,
+ enableLooseMode: !!this.enableLooseMode,
+ allowSpecialUseDomain: !!this.allowSpecialUseDomain,
+ prefixSecurity: getNormalizedPrefixSecurity(this.prefixSecurity),
cookies: []
};
if (!(this.store.getAllCookies && typeof this.store.getAllCookies === "function")) {
@@ -17868,6 +18731,7 @@ var require_cookie = __commonJS({
return this._cloneSync(newStore);
}
removeAllCookies(cb) {
+ validators.validate(validators.isFunction(cb), cb);
const store = this.store;
if (typeof store.removeAllCookies === "function" && store.removeAllCookies !== Store.prototype.removeAllCookies) {
return store.removeAllCookies(cb);
@@ -17905,6 +18769,7 @@ var require_cookie = __commonJS({
cb = store;
store = null;
}
+ validators.validate(validators.isFunction(cb), cb);
let serialized;
if (typeof strOrObj === "string") {
serialized = jsonParse(strOrObj);
@@ -17914,7 +18779,12 @@ var require_cookie = __commonJS({
} else {
serialized = strOrObj;
}
- const jar = new CookieJar2(store, serialized.rejectPublicSuffixes);
+ const jar = new CookieJar2(store, {
+ rejectPublicSuffixes: serialized.rejectPublicSuffixes,
+ looseMode: serialized.enableLooseMode,
+ allowSpecialUseDomain: serialized.allowSpecialUseDomain,
+ prefixSecurity: serialized.prefixSecurity
+ });
jar._importCookies(serialized, (err) => {
if (err) {
return cb(err);
@@ -17924,7 +18794,10 @@ var require_cookie = __commonJS({
}
static deserializeSync(strOrObj, store) {
const serialized = typeof strOrObj === "string" ? JSON.parse(strOrObj) : strOrObj;
- const jar = new CookieJar2(store, serialized.rejectPublicSuffixes);
+ const jar = new CookieJar2(store, {
+ rejectPublicSuffixes: serialized.rejectPublicSuffixes,
+ looseMode: serialized.enableLooseMode
+ });
if (!jar.store.synchronous) {
throw new Error(
"CookieJar store is not synchronous; use async API instead."
@@ -17984,6 +18857,7 @@ var require_cookie = __commonJS({
exports.permutePath = permutePath;
exports.canonicalDomain = canonicalDomain;
exports.PrefixSecurityEnum = PrefixSecurityEnum;
+ exports.ParameterError = validators.ParameterError;
}
});
@@ -27554,17 +28428,17 @@ var require_iterate = __commonJS({
module2.exports = iterate;
function iterate(list, iterator, state, callback) {
var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
- state.jobs[key] = runJob(iterator, key, list[key], function(error, output) {
+ state.jobs[key] = runJob(iterator, key, list[key], function(error2, output) {
if (!(key in state.jobs)) {
return;
}
delete state.jobs[key];
- if (error) {
+ if (error2) {
abort(state);
} else {
state.results[key] = output;
}
- callback(error, state.results);
+ callback(error2, state.results);
});
}
function runJob(iterator, key, item, callback) {
@@ -27628,9 +28502,9 @@ var require_parallel = __commonJS({
function parallel(list, iterator, callback) {
var state = initState(list);
while (state.index < (state["keyedList"] || list).length) {
- iterate(list, iterator, state, function(error, result) {
- if (error) {
- callback(error, result);
+ iterate(list, iterator, state, function(error2, result) {
+ if (error2) {
+ callback(error2, result);
return;
}
if (Object.keys(state.jobs).length === 0) {
@@ -27656,9 +28530,9 @@ var require_serialOrdered = __commonJS({
module2.exports.descending = descending;
function serialOrdered(list, iterator, sortMethod, callback) {
var state = initState(list, sortMethod);
- iterate(list, iterator, state, function iteratorHandler(error, result) {
- if (error) {
- callback(error, result);
+ iterate(list, iterator, state, function iteratorHandler(error2, result) {
+ if (error2) {
+ callback(error2, result);
return;
}
state.index++;
@@ -28001,10 +28875,10 @@ var require_form_data = __commonJS({
this.pipe(request);
if (cb) {
var onResponse;
- var callback = function(error, responce) {
+ var callback = function(error2, responce) {
request.removeListener("error", callback);
request.removeListener("response", onResponse);
- return cb.call(this, error, responce);
+ return cb.call(this, error2, responce);
};
onResponse = callback.bind(this, null);
request.on("error", callback);
@@ -28570,7 +29444,7 @@ var require_mappingTable = __commonJS({
var require_tr46 = __commonJS({
"../../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/index.js"(exports, module2) {
"use strict";
- var punycode = require("punycode");
+ var punycode2 = require("punycode");
var mappingTable = require_mappingTable();
var PROCESSING_OPTIONS = {
TRANSITIONAL: 0,
@@ -28652,24 +29526,24 @@ var require_tr46 = __commonJS({
var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;
function validateLabel(label, processing_option) {
if (label.substr(0, 4) === "xn--") {
- label = punycode.toUnicode(label);
+ label = punycode2.toUnicode(label);
processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;
}
- var error = false;
+ var error2 = false;
if (normalize(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) {
- error = true;
+ error2 = true;
}
var len = countSymbols(label);
for (var i = 0; i < len; ++i) {
var status = findStatus(label.codePointAt(i));
if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") {
- error = true;
+ error2 = true;
break;
}
}
return {
label,
- error
+ error: error2
};
}
function processing(domain_name, useSTD3, processing_option) {
@@ -28695,7 +29569,7 @@ var require_tr46 = __commonJS({
var labels = result.string.split(".");
labels = labels.map(function(l) {
try {
- return punycode.toASCII(l);
+ return punycode2.toASCII(l);
} catch (e) {
result.error = true;
return l;
@@ -28732,7 +29606,7 @@ var require_tr46 = __commonJS({
var require_url_state_machine = __commonJS({
"../../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/url-state-machine.js"(exports, module2) {
"use strict";
- var punycode = require("punycode");
+ var punycode2 = require("punycode");
var tr46 = require_tr46();
var specialSchemes = {
ftp: 21,
@@ -28745,7 +29619,7 @@ var require_url_state_machine = __commonJS({
};
var failure = Symbol("failure");
function countSymbols(str) {
- return punycode.ucs2.decode(str).length;
+ return punycode2.ucs2.decode(str).length;
}
function at(input, idx) {
const c = input[idx];
@@ -28914,7 +29788,7 @@ var require_url_state_machine = __commonJS({
let pieceIndex = 0;
let compress = null;
let pointer = 0;
- input = punycode.ucs2.decode(input);
+ input = punycode2.ucs2.decode(input);
if (input[pointer] === 58) {
if (input[pointer + 1] !== 58) {
return failure;
@@ -29067,7 +29941,7 @@ var require_url_state_machine = __commonJS({
return failure;
}
let output = "";
- const decoded = punycode.ucs2.decode(input);
+ const decoded = punycode2.ucs2.decode(input);
for (let i = 0; i < decoded.length; ++i) {
output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
}
@@ -29136,10 +30010,10 @@ var require_url_state_machine = __commonJS({
function isNormalizedWindowsDriveLetter(string) {
return /^[A-Za-z]:$/.test(string);
}
- function URLStateMachine(input, base, encodingOverride, url2, stateOverride) {
+ function URLStateMachine(input, base2, encodingOverride, url2, stateOverride) {
this.pointer = 0;
this.input = input;
- this.base = base || null;
+ this.base = base2 || null;
this.encodingOverride = encodingOverride || "utf-8";
this.stateOverride = stateOverride;
this.url = url2;
@@ -29173,7 +30047,7 @@ var require_url_state_machine = __commonJS({
this.atFlag = false;
this.arrFlag = false;
this.passwordTokenSeenFlag = false;
- this.input = punycode.ucs2.decode(this.input);
+ this.input = punycode2.ucs2.decode(this.input);
for (; this.pointer <= this.input.length; ++this.pointer) {
const c = this.input[this.pointer];
const cStr = isNaN(c) ? void 0 : String.fromCodePoint(c);
@@ -29772,14 +30646,14 @@ var require_url_state_machine = __commonJS({
};
module2.exports.setTheUsername = function(url2, username) {
url2.username = "";
- const decoded = punycode.ucs2.decode(username);
+ const decoded = punycode2.ucs2.decode(username);
for (let i = 0; i < decoded.length; ++i) {
url2.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
}
};
module2.exports.setThePassword = function(url2, password) {
url2.password = "";
- const decoded = punycode.ucs2.decode(password);
+ const decoded = punycode2.ucs2.decode(password);
for (let i = 0; i < decoded.length; ++i) {
url2.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
}
@@ -29806,10 +30680,10 @@ var require_URL_impl = __commonJS({
exports.implementation = class URLImpl {
constructor(constructorArgs) {
const url2 = constructorArgs[0];
- const base = constructorArgs[1];
+ const base2 = constructorArgs[1];
let parsedBase = null;
- if (base !== void 0) {
- parsedBase = usm.basicURLParse(base);
+ if (base2 !== void 0) {
+ parsedBase = usm.basicURLParse(base2);
if (parsedBase === "failure") {
throw new TypeError("Invalid base URL");
}
@@ -30196,8 +31070,8 @@ function Body(body2) {
this.timeout = timeout;
if (body2 instanceof import_stream.default) {
body2.on("error", function(err) {
- const error = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err);
- _this[INTERNALS].error = error;
+ const error2 = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err);
+ _this[INTERNALS].error = error2;
});
}
}
@@ -30394,9 +31268,9 @@ function validateValue(value) {
throw new TypeError(`${value} is not a legal HTTP header value`);
}
}
-function find(map, name) {
+function find(map2, name) {
name = name.toLowerCase();
- for (const key in map) {
+ for (const key in map2) {
if (key.toLowerCase() === name) {
return key;
}
@@ -30532,14 +31406,14 @@ function fetch(url2, opts) {
const signal = request.signal;
let response = null;
const abort = function abort2() {
- let error = new AbortError2("The user aborted a request.");
- reject(error);
+ let error2 = new AbortError2("The user aborted a request.");
+ reject(error2);
if (request.body && request.body instanceof import_stream.default.Readable) {
- destroyStream(request.body, error);
+ destroyStream(request.body, error2);
}
if (!response || !response.body)
return;
- response.body.emit("error", error);
+ response.body.emit("error", error2);
};
if (signal && signal.aborted) {
abort();
@@ -31434,8 +32308,8 @@ var init_nodeFetchHttpClient = __esm({
}
await this.processRequest(operationResponse);
return operationResponse;
- } catch (error) {
- const fetchError = error;
+ } catch (error2) {
+ const fetchError = error2;
if (fetchError.code === "ENOTFOUND") {
throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, void 0, httpRequest);
} else if (fetchError.type === "aborted") {
@@ -31877,8 +32751,8 @@ var require_tslib = __commonJS({
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
ar.push(r.value);
- } catch (error) {
- e = { error };
+ } catch (error2) {
+ e = { error: error2 };
} finally {
try {
if (r && !r.done && (m = i["return"]))
@@ -32345,8 +33219,8 @@ var require_XMLDOMErrorHandler = __commonJS({
module2.exports = XMLDOMErrorHandler = function() {
function XMLDOMErrorHandler2() {
}
- XMLDOMErrorHandler2.prototype.handleError = function(error) {
- throw new Error(error);
+ XMLDOMErrorHandler2.prototype.handleError = function(error2) {
+ throw new Error(error2);
};
return XMLDOMErrorHandler2;
}();
@@ -36272,7 +37146,7 @@ var require_sax = __commonJS({
parser.script = "";
break;
default:
- error(parser, "Max buffer length exceeded: " + buffers[i]);
+ error2(parser, "Max buffer length exceeded: " + buffers[i]);
}
}
maxActual = Math.max(maxActual, len);
@@ -36750,7 +37624,7 @@ var require_sax = __commonJS({
text = text.replace(/\s+/g, " ");
return text;
}
- function error(parser, er) {
+ function error2(parser, er) {
closeText(parser);
if (parser.trackPosition) {
er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c;
@@ -36764,7 +37638,7 @@ var require_sax = __commonJS({
if (parser.sawRoot && !parser.closedRoot)
strictFail(parser, "Unclosed root tag");
if (parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT) {
- error(parser, "Unexpected end");
+ error2(parser, "Unexpected end");
}
closeText(parser);
parser.c = "";
@@ -36778,7 +37652,7 @@ var require_sax = __commonJS({
throw new Error("bad call to strictFail");
}
if (parser.strict) {
- error(parser, message);
+ error2(parser, message);
}
}
function newTag(parser) {
@@ -37019,7 +37893,7 @@ var require_sax = __commonJS({
throw this.error;
}
if (parser.closed) {
- return error(
+ return error2(
parser,
"Cannot write after close. Assign an onready handler."
);
@@ -37515,8 +38389,8 @@ var require_sax = __commonJS({
}
if (!String.fromCodePoint) {
(function() {
- var stringFromCharCode = String.fromCharCode;
- var floor = Math.floor;
+ var stringFromCharCode2 = String.fromCharCode;
+ var floor2 = Math.floor;
var fromCodePoint = function() {
var MAX_SIZE = 16384;
var codeUnits = [];
@@ -37530,7 +38404,7 @@ var require_sax = __commonJS({
var result = "";
while (++index < length) {
var codePoint = Number(arguments[index]);
- if (!isFinite(codePoint) || codePoint < 0 || codePoint > 1114111 || floor(codePoint) !== codePoint) {
+ if (!isFinite(codePoint) || codePoint < 0 || codePoint > 1114111 || floor2(codePoint) !== codePoint) {
throw RangeError("Invalid code point: " + codePoint);
}
if (codePoint <= 65535) {
@@ -37542,7 +38416,7 @@ var require_sax = __commonJS({
codeUnits.push(highSurrogate, lowSurrogate);
}
if (index + 1 === length || codeUnits.length > MAX_SIZE) {
- result += stringFromCharCode.apply(null, codeUnits);
+ result += stringFromCharCode2.apply(null, codeUnits);
codeUnits.length = 0;
}
}
@@ -37733,11 +38607,11 @@ var require_parser = __commonJS({
});
this.saxParser.errThrown = false;
this.saxParser.onerror = function(_this) {
- return function(error) {
+ return function(error2) {
_this.saxParser.resume();
if (!_this.saxParser.errThrown) {
_this.saxParser.errThrown = true;
- return _this.emit("error", error);
+ return _this.emit("error", error2);
}
};
}(this);
@@ -38165,9 +39039,9 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
return parsedResponse;
}
const responseSpec = getOperationResponse(parsedResponse);
- const { error, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec);
- if (error) {
- throw error;
+ const { error: error2, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec);
+ if (error2) {
+ throw error2;
} else if (shouldReturnResponse) {
return parsedResponse;
}
@@ -38213,9 +39087,9 @@ function handleErrorResponse(parsedResponse, operationSpec, responseSpec) {
const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default;
const streaming = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) || parsedResponse.request.streamResponseBody;
const initialErrorMessage = streaming ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText;
- const error = new RestError(initialErrorMessage, void 0, parsedResponse.status, parsedResponse.request, parsedResponse);
+ const error2 = new RestError(initialErrorMessage, void 0, parsedResponse.status, parsedResponse.request, parsedResponse);
if (!errorResponseSpec) {
- throw error;
+ throw error2;
}
const defaultBodyMapper = errorResponseSpec.bodyMapper;
const defaultHeadersMapper = errorResponseSpec.headersMapper;
@@ -38231,21 +39105,21 @@ function handleErrorResponse(parsedResponse, operationSpec, responseSpec) {
parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody");
}
const internalError = parsedBody.error || parsedError || parsedBody;
- error.code = internalError.code;
+ error2.code = internalError.code;
if (internalError.message) {
- error.message = internalError.message;
+ error2.message = internalError.message;
}
if (defaultBodyMapper) {
- error.response.parsedBody = parsedError;
+ error2.response.parsedBody = parsedError;
}
}
if (parsedResponse.headers && defaultHeadersMapper) {
- error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
+ error2.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
}
} catch (defaultError) {
- error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`;
+ error2.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`;
}
- return { error, shouldReturnResponse: false };
+ return { error: error2, shouldReturnResponse: false };
}
function parse2(jsonContentTypes, xmlContentTypes, operationResponse, opts) {
var _a;
@@ -38374,8 +39248,8 @@ var init_redirectPolicy = __esm({
function isNumber(n) {
return typeof n === "number";
}
-function shouldRetry(retryLimit, predicate, retryData, response, error) {
- if (!predicate(response, error)) {
+function shouldRetry(retryLimit, predicate, retryData, response, error2) {
+ if (!predicate(response, error2)) {
return false;
}
return retryData.retryCount < retryLimit;
@@ -38515,7 +39389,7 @@ var init_exponentialRetryPolicy = __esm({
this.maxRetryInterval = isNumber(maxRetryInterval) ? maxRetryInterval : DEFAULT_CLIENT_MAX_RETRY_INTERVAL;
}
sendRequest(request) {
- return this._nextPolicy.sendRequest(request.clone()).then((response) => retry(this, request, response)).catch((error) => retry(this, request, error.response, void 0, error));
+ return this._nextPolicy.sendRequest(request.clone()).then((response) => retry(this, request, response)).catch((error2) => retry(this, request, error2.response, void 0, error2));
}
};
}
@@ -39157,8 +40031,8 @@ function systemErrorRetryPolicy(retryCount, retryInterval, minRetryInterval, max
}
async function retry2(policy, request, operationResponse, err, retryData) {
retryData = updateRetryData(policy, retryData, err);
- function shouldPolicyRetry(_response, error) {
- if (error && error.code && (error.code === "ETIMEDOUT" || error.code === "ESOCKETTIMEDOUT" || error.code === "ECONNREFUSED" || error.code === "ECONNRESET" || error.code === "ENOENT")) {
+ function shouldPolicyRetry(_response, error2) {
+ if (error2 && error2.code && (error2.code === "ETIMEDOUT" || error2.code === "ESOCKETTIMEDOUT" || error2.code === "ECONNREFUSED" || error2.code === "ECONNRESET" || error2.code === "ENOENT")) {
return true;
}
return false;
@@ -39192,7 +40066,7 @@ var init_systemErrorRetryPolicy = __esm({
this.maxRetryInterval = isNumber(maxRetryInterval) ? maxRetryInterval : DEFAULT_CLIENT_MAX_RETRY_INTERVAL;
}
sendRequest(request) {
- return this._nextPolicy.sendRequest(request.clone()).catch((error) => retry2(this, request, error.response, error));
+ return this._nextPolicy.sendRequest(request.clone()).catch((error2) => retry2(this, request, error2.response, error2));
}
};
}
@@ -39275,7 +40149,7 @@ var init_throttlingRetryPolicy = __esm({
const date = Date.parse(headerValue);
const diff = date - now;
return Number.isNaN(diff) ? void 0 : diff;
- } catch (error) {
+ } catch (error2) {
return void 0;
}
}
@@ -40722,8 +41596,8 @@ var init_tracingPolicy = __esm({
}
}
return span;
- } catch (error) {
- logger.warning(`Skipping creating a tracing span due to an error: ${error.message}`);
+ } catch (error2) {
+ logger.warning(`Skipping creating a tracing span due to an error: ${error2.message}`);
return void 0;
}
}
@@ -40737,8 +41611,8 @@ var init_tracingPolicy = __esm({
span.setAttribute("http.status_code", err.statusCode);
}
span.end();
- } catch (error) {
- logger.warning(`Skipping tracing span processing due to an error: ${error.message}`);
+ } catch (error2) {
+ logger.warning(`Skipping tracing span processing due to an error: ${error2.message}`);
}
}
tryProcessResponse(span, response) {
@@ -40752,8 +41626,8 @@ var init_tracingPolicy = __esm({
code: SpanStatusCode2.OK
});
span.end();
- } catch (error) {
- logger.warning(`Skipping tracing span processing due to an error: ${error.message}`);
+ } catch (error2) {
+ logger.warning(`Skipping tracing span processing due to an error: ${error2.message}`);
}
}
};
@@ -40800,8 +41674,8 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op
httpRequest.body = JSON.stringify(httpRequest.body);
}
}
- } catch (error) {
- throw new Error(`Error "${error.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`);
+ } catch (error2) {
+ throw new Error(`Error "${error2.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`);
}
} else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) {
httpRequest.formData = {};
@@ -41069,8 +41943,8 @@ var init_serviceClient = __esm({
httpRequest = new WebResource();
httpRequest = httpRequest.prepare(options);
}
- } catch (error) {
- return Promise.reject(error);
+ } catch (error2) {
+ return Promise.reject(error2);
}
let httpPipeline = this._httpClient;
if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) {
@@ -41206,8 +42080,8 @@ var init_serviceClient = __esm({
let sendRequestError;
try {
rawResponse = await this.sendRequest(httpRequest);
- } catch (error) {
- sendRequestError = error;
+ } catch (error2) {
+ sendRequestError = error2;
}
if (sendRequestError) {
if (sendRequestError.response) {
@@ -41217,8 +42091,8 @@ var init_serviceClient = __esm({
} else {
result = Promise.resolve(flattenResponse(rawResponse, operationSpec.responses[rawResponse.status]));
}
- } catch (error) {
- result = Promise.reject(error);
+ } catch (error2) {
+ result = Promise.reject(error2);
}
const cb = callback;
if (cb) {
@@ -49632,7 +50506,7 @@ var init_mappers = __esm({
});
// ../../../node_modules/.pnpm/@azure+storage-blob@12.11.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/parameters.js
-var contentType, blobServiceProperties, accept, url, restype, comp, timeoutInSeconds, version2, requestId, accept1, comp1, comp2, prefix, marker, maxPageSize, include, keyInfo, comp3, restype1, body, comp4, contentLength, multipartContentType, comp5, where, restype2, metadata, access, defaultEncryptionScope, preventEncryptionScopeOverride, leaseId, ifModifiedSince, ifUnmodifiedSince, comp6, comp7, containerAcl, comp8, deletedContainerName, deletedContainerVersion, comp9, sourceContainerName, sourceLeaseId, comp10, action, duration, proposedLeaseId, action1, leaseId1, action2, action3, breakPeriod, action4, proposedLeaseId1, include1, delimiter, snapshot, versionId, range, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifMatch, ifNoneMatch, ifTags, deleteSnapshots, blobDeleteType, comp11, expiryOptions, expiresOn, blobCacheControl, blobContentType, blobContentMD5, blobContentEncoding, blobContentLanguage, blobContentDisposition, comp12, immutabilityPolicyExpiry, immutabilityPolicyMode, comp13, legalHold, encryptionScope, comp14, tier, rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, copySource, blobTagsString, sealBlob, legalHold1, xMsRequiresSync, sourceContentMD5, copySourceAuthorization, copySourceTags, comp15, copyActionAbortConstant, copyId, comp16, tier1, queryRequest, comp17, comp18, tags, transactionalContentMD5, transactionalContentCrc64, blobType, blobContentLength, blobSequenceNumber, contentType1, body1, accept2, comp19, pageWrite, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, pageWrite1, sourceUrl, sourceRange, sourceContentCrc64, range1, comp20, prevsnapshot, prevSnapshotUrl, sequenceNumberAction, comp21, blobType1, comp22, maxSize, appendPosition, sourceRange1, comp23, blobType2, copySourceBlobProperties, comp24, blockId, blocks, comp25, listType;
+var contentType, blobServiceProperties, accept, url, restype, comp, timeoutInSeconds, version2, requestId, accept1, comp1, comp2, prefix, marker, maxPageSize, include, keyInfo, comp3, restype1, body, comp4, contentLength, multipartContentType, comp5, where, restype2, metadata, access, defaultEncryptionScope, preventEncryptionScopeOverride, leaseId, ifModifiedSince, ifUnmodifiedSince, comp6, comp7, containerAcl, comp8, deletedContainerName, deletedContainerVersion, comp9, sourceContainerName, sourceLeaseId, comp10, action, duration, proposedLeaseId, action1, leaseId1, action2, action3, breakPeriod, action4, proposedLeaseId1, include1, delimiter2, snapshot, versionId, range, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifMatch, ifNoneMatch, ifTags, deleteSnapshots, blobDeleteType, comp11, expiryOptions, expiresOn, blobCacheControl, blobContentType, blobContentMD5, blobContentEncoding, blobContentLanguage, blobContentDisposition, comp12, immutabilityPolicyExpiry, immutabilityPolicyMode, comp13, legalHold, encryptionScope, comp14, tier, rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, copySource, blobTagsString, sealBlob, legalHold1, xMsRequiresSync, sourceContentMD5, copySourceAuthorization, copySourceTags, comp15, copyActionAbortConstant, copyId, comp16, tier1, queryRequest, comp17, comp18, tags, transactionalContentMD5, transactionalContentCrc64, blobType, blobContentLength, blobSequenceNumber, contentType1, body1, accept2, comp19, pageWrite, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, pageWrite1, sourceUrl, sourceRange, sourceContentCrc64, range1, comp20, prevsnapshot, prevSnapshotUrl, sequenceNumberAction, comp21, blobType1, comp22, maxSize, appendPosition, sourceRange1, comp23, blobType2, copySourceBlobProperties, comp24, blockId, blocks, comp25, listType;
var init_parameters = __esm({
"../../../node_modules/.pnpm/@azure+storage-blob@12.11.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/parameters.js"() {
init_coreHttp();
@@ -50248,7 +51122,7 @@ var init_parameters = __esm({
},
collectionFormat: QueryCollectionFormat.Csv
};
- delimiter = {
+ delimiter2 = {
parameterPath: "delimiter",
mapper: {
serializedName: "delimiter",
@@ -51646,9 +52520,9 @@ var init_container = __esm({
};
return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec);
}
- listBlobHierarchySegment(delimiter2, options) {
+ listBlobHierarchySegment(delimiter3, options) {
const operationArguments = {
- delimiter: delimiter2,
+ delimiter: delimiter3,
options: operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec);
@@ -52163,7 +53037,7 @@ var init_container = __esm({
maxPageSize,
restype2,
include1,
- delimiter
+ delimiter2
],
urlParameters: [url],
headerParameters: [
@@ -54523,7 +55397,7 @@ function getAccountNameFromUrl(url2) {
accountName = "";
}
return accountName;
- } catch (error) {
+ } catch (error2) {
throw new Error("Unable to extract accountName with provided information.");
}
}
@@ -56825,8 +57699,8 @@ var init_RetriableReadableStream = __esm({
this.source = newSource;
this.setSourceEventHandlers();
return;
- }).catch((error) => {
- this.destroy(error);
+ }).catch((error2) => {
+ this.destroy(error2);
});
} else {
this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));
@@ -56858,10 +57732,10 @@ var init_RetriableReadableStream = __esm({
this.source.removeListener("end", this.sourceErrorOrEndHandler);
this.source.removeListener("error", this.sourceErrorOrEndHandler);
}
- _destroy(error, callback) {
+ _destroy(error2, callback) {
this.removeSourceEventHandlers();
this.source.destroy();
- callback(error === null ? void 0 : error);
+ callback(error2 === null ? void 0 : error2);
}
};
}
@@ -57930,9 +58804,9 @@ var init_poller = __esm({
}
if (this.operation.state.isCancelled) {
this.stopped = true;
- const error = new PollerCancelledError("Poller cancelled");
- this.reject(error);
- throw error;
+ const error2 = new PollerCancelledError("Poller cancelled");
+ this.reject(error2);
+ throw error2;
} else if (this.isDone() && this.resolve) {
this.resolve(this.operation.state.result);
}
@@ -58007,11 +58881,11 @@ function makeBlobBeginCopyFromURLPollOperation(state) {
return {
state: Object.assign({}, state),
cancel,
- toString,
+ toString: toString2,
update
};
}
-var BlobBeginCopyFromUrlPoller, cancel, update, toString;
+var BlobBeginCopyFromUrlPoller, cancel, update, toString2;
var init_BlobStartCopyFromUrlPoller = __esm({
"../../../node_modules/.pnpm/@azure+storage-blob@12.11.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js"() {
init_coreHttp();
@@ -58089,7 +58963,7 @@ var init_BlobStartCopyFromUrlPoller = __esm({
}
return makeBlobBeginCopyFromURLPollOperation(state);
};
- toString = function toString2() {
+ toString2 = function toString3() {
return JSON.stringify({ state: this.state }, (key, value) => {
if (key === "blobClient") {
return void 0;
@@ -58145,8 +59019,8 @@ var init_Batch = __esm({
this.actives--;
this.completed++;
this.parallelExecute();
- } catch (error) {
- this.emitter.emit("error", error);
+ } catch (error2) {
+ this.emitter.emit("error", error2);
}
});
}
@@ -58157,9 +59031,9 @@ var init_Batch = __esm({
this.parallelExecute();
return new Promise((resolve3, reject) => {
this.emitter.on("finish", resolve3);
- this.emitter.on("error", (error) => {
+ this.emitter.on("error", (error2) => {
this.state = BatchStates.Error;
- reject(error);
+ reject(error2);
});
});
}
@@ -58982,8 +59856,8 @@ var init_Clients = __esm({
if (!buffer) {
try {
buffer = Buffer.alloc(count);
- } catch (error) {
- throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${error.message}`);
+ } catch (error2) {
+ throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${error2.message}`);
}
}
if (buffer.length < count) {
@@ -59068,7 +59942,7 @@ var init_Clients = __esm({
throw new Error("Provided containerName is invalid.");
}
return { blobName, containerName };
- } catch (error) {
+ } catch (error2) {
throw new Error("Unable to extract blobName and containerName with provided information.");
}
}
@@ -60884,11 +61758,11 @@ var init_ContainerClient = __esm({
span.end();
}
}
- async listBlobHierarchySegment(delimiter2, marker2, options = {}) {
+ async listBlobHierarchySegment(delimiter3, marker2, options = {}) {
var _a;
const { span, updatedOptions } = createSpan2("ContainerClient-listBlobHierarchySegment", options);
try {
- const response = await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), convertTracingToRequestOptionsBase(updatedOptions)));
+ const response = await this.containerContext.listBlobHierarchySegment(delimiter3, Object.assign(Object.assign({ marker: marker2 }, options), convertTracingToRequestOptionsBase(updatedOptions)));
response.segment.blobItems = [];
if (response.segment["Blob"] !== void 0) {
response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
@@ -61000,24 +61874,24 @@ var init_ContainerClient = __esm({
}
};
}
- listHierarchySegments(delimiter2, marker2, options = {}) {
+ listHierarchySegments(delimiter3, marker2, options = {}) {
return __asyncGenerator(this, arguments, function* listHierarchySegments_1() {
let listBlobsHierarchySegmentResponse;
if (!!marker2 || marker2 === void 0) {
do {
- listBlobsHierarchySegmentResponse = yield __await(this.listBlobHierarchySegment(delimiter2, marker2, options));
+ listBlobsHierarchySegmentResponse = yield __await(this.listBlobHierarchySegment(delimiter3, marker2, options));
marker2 = listBlobsHierarchySegmentResponse.continuationToken;
yield yield __await(yield __await(listBlobsHierarchySegmentResponse));
} while (marker2);
}
});
}
- listItemsByHierarchy(delimiter2, options = {}) {
+ listItemsByHierarchy(delimiter3, options = {}) {
return __asyncGenerator(this, arguments, function* listItemsByHierarchy_1() {
var e_2, _a;
let marker2;
try {
- for (var _b = __asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) {
+ for (var _b = __asyncValues(this.listHierarchySegments(delimiter3, marker2, options)), _c; _c = yield __await(_b.next()), !_c.done; ) {
const listBlobsHierarchySegmentResponse = _c.value;
const segment = listBlobsHierarchySegmentResponse.segment;
if (segment.blobPrefixes) {
@@ -61042,8 +61916,8 @@ var init_ContainerClient = __esm({
}
});
}
- listBlobsByHierarchy(delimiter2, options = {}) {
- if (delimiter2 === "") {
+ listBlobsByHierarchy(delimiter3, options = {}) {
+ if (delimiter3 === "") {
throw new RangeError("delimiter should contain one or more characters");
}
const include2 = [];
@@ -61081,7 +61955,7 @@ var init_ContainerClient = __esm({
options.prefix = void 0;
}
const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {});
- const iter = this.listItemsByHierarchy(delimiter2, updatedOptions);
+ const iter = this.listItemsByHierarchy(delimiter3, updatedOptions);
return {
async next() {
return iter.next();
@@ -61090,7 +61964,7 @@ var init_ContainerClient = __esm({
return this;
},
byPage: (settings = {}) => {
- return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
+ return this.listHierarchySegments(delimiter3, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
}
};
}
@@ -61183,7 +62057,7 @@ var init_ContainerClient = __esm({
throw new Error("Provided containerName is invalid.");
}
return containerName;
- } catch (error) {
+ } catch (error2) {
throw new Error("Unable to extract containerName with provided information.");
}
}
@@ -62096,12 +62970,12 @@ var require_requestUtils = __commonJS({
let isRetryable = false;
try {
response = yield method();
- } catch (error) {
+ } catch (error2) {
if (onError) {
- response = onError(error);
+ response = onError(error2);
}
isRetryable = true;
- errorMessage = error.message;
+ errorMessage = error2.message;
}
if (response) {
statusCode = getStatusCode(response);
@@ -62133,13 +63007,13 @@ var require_requestUtils = __commonJS({
(response) => response.statusCode,
maxAttempts,
delay3,
- (error) => {
- if (error instanceof http_client_1.HttpClientError) {
+ (error2) => {
+ if (error2 instanceof http_client_1.HttpClientError) {
return {
- statusCode: error.statusCode,
+ statusCode: error2.statusCode,
result: null,
headers: {},
- error
+ error: error2
};
} else {
return void 0;
@@ -62618,8 +63492,8 @@ var require_cacheHttpClient = __commonJS({
start,
end,
autoClose: false
- }).on("error", (error) => {
- throw new Error(`Cache upload failed because file read failed with ${error.message}`);
+ }).on("error", (error2) => {
+ throw new Error(`Cache upload failed because file read failed with ${error2.message}`);
}), start, end);
}
})));
@@ -62739,8 +63613,8 @@ var require_tar = __commonJS({
return __awaiter2(this, void 0, void 0, function* () {
try {
yield exec_1.exec(`"${yield getTarPath(args, compressionMethod)}"`, args, { cwd });
- } catch (error) {
- throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
+ } catch (error2) {
+ throw new Error(`Tar failed with error: ${error2 === null || error2 === void 0 ? void 0 : error2.message}`);
}
});
}
@@ -62944,18 +63818,18 @@ var require_cache = __commonJS({
yield tar_1.extractTar(archivePath, compressionMethod);
core.info("Cache restored successfully");
return cacheEntry.cacheKey;
- } catch (error) {
- const typedError = error;
+ } catch (error2) {
+ const typedError = error2;
if (typedError.name === ValidationError.name) {
- throw error;
+ throw error2;
} else {
- core.warning(`Failed to restore: ${error.message}`);
+ core.warning(`Failed to restore: ${error2.message}`);
}
} finally {
try {
yield utils.unlinkFile(archivePath);
- } catch (error) {
- core.debug(`Failed to delete archive: ${error}`);
+ } catch (error2) {
+ core.debug(`Failed to delete archive: ${error2}`);
}
}
return void 0;
@@ -63003,10 +63877,10 @@ var require_cache = __commonJS({
}
core.debug(`Saving Cache (ID: ${cacheId})`);
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
- } catch (error) {
- const typedError = error;
+ } catch (error2) {
+ const typedError = error2;
if (typedError.name === ValidationError.name) {
- throw error;
+ throw error2;
} else if (typedError.name === ReserveCacheError.name) {
core.info(`Failed to save: ${typedError.message}`);
} else {
@@ -63015,8 +63889,8 @@ var require_cache = __commonJS({
} finally {
try {
yield utils.unlinkFile(archivePath);
- } catch (error) {
- core.debug(`Failed to delete archive: ${error}`);
+ } catch (error2) {
+ core.debug(`Failed to delete archive: ${error2}`);
}
}
return cacheId;
@@ -63291,30 +64165,30 @@ var require_depd = __commonJS({
Object.defineProperty(obj, prop, descriptor);
}
function DeprecationError(namespace, message, stack) {
- var error = new Error();
+ var error2 = new Error();
var stackString;
- Object.defineProperty(error, "constructor", {
+ Object.defineProperty(error2, "constructor", {
value: DeprecationError
});
- Object.defineProperty(error, "message", {
+ Object.defineProperty(error2, "message", {
configurable: true,
enumerable: false,
value: message,
writable: true
});
- Object.defineProperty(error, "name", {
+ Object.defineProperty(error2, "name", {
enumerable: false,
configurable: true,
value: "DeprecationError",
writable: true
});
- Object.defineProperty(error, "namespace", {
+ Object.defineProperty(error2, "namespace", {
configurable: true,
enumerable: false,
value: namespace,
writable: true
});
- Object.defineProperty(error, "stack", {
+ Object.defineProperty(error2, "stack", {
configurable: true,
enumerable: false,
get: function() {
@@ -63327,7 +64201,7 @@ var require_depd = __commonJS({
stackString = val;
}
});
- return error;
+ return error2;
}
}
});
@@ -63341,7 +64215,7 @@ var require_bytes = __commonJS({
module2.exports.parse = parse3;
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
- var map = {
+ var map2 = {
b: 1,
kb: 1 << 10,
mb: 1 << 20,
@@ -63369,22 +64243,22 @@ var require_bytes = __commonJS({
var decimalPlaces = options && options.decimalPlaces !== void 0 ? options.decimalPlaces : 2;
var fixedDecimals = Boolean(options && options.fixedDecimals);
var unit = options && options.unit || "";
- if (!unit || !map[unit.toLowerCase()]) {
- if (mag >= map.pb) {
+ if (!unit || !map2[unit.toLowerCase()]) {
+ if (mag >= map2.pb) {
unit = "PB";
- } else if (mag >= map.tb) {
+ } else if (mag >= map2.tb) {
unit = "TB";
- } else if (mag >= map.gb) {
+ } else if (mag >= map2.gb) {
unit = "GB";
- } else if (mag >= map.mb) {
+ } else if (mag >= map2.mb) {
unit = "MB";
- } else if (mag >= map.kb) {
+ } else if (mag >= map2.kb) {
unit = "KB";
} else {
unit = "B";
}
}
- var val = value / map[unit.toLowerCase()];
+ var val = value / map2[unit.toLowerCase()];
var str = val.toFixed(decimalPlaces);
if (!fixedDecimals) {
str = str.replace(formatDecimalsRegExp, "$1");
@@ -63416,7 +64290,7 @@ var require_bytes = __commonJS({
if (isNaN(floatValue)) {
return null;
}
- return Math.floor(map[unit] * floatValue);
+ return Math.floor(map2[unit] * floatValue);
}
}
});
@@ -63645,13 +64519,13 @@ var require_statuses = __commonJS({
504: true
};
function createMessageToStatusCodeMap(codes2) {
- var map = {};
+ var map2 = {};
Object.keys(codes2).forEach(function forEachCode(code) {
var message = codes2[code];
var status2 = Number(code);
- map[message.toLowerCase()] = status2;
+ map2[message.toLowerCase()] = status2;
});
- return map;
+ return map2;
}
function createStatusCodeList(codes2) {
return Object.keys(codes2).map(function mapCode(code) {
@@ -67711,14 +68585,14 @@ var require_lib4 = __commonJS({
iconv.encodings = null;
iconv.defaultCharUnicode = "\uFFFD";
iconv.defaultCharSingleByte = "?";
- iconv.encode = function encode(str, encoding, options) {
+ iconv.encode = function encode2(str, encoding, options) {
str = "" + (str || "");
var encoder = iconv.getEncoder(encoding, options);
var res = encoder.write(str);
var trail = encoder.end();
return trail && trail.length > 0 ? Buffer2.concat([res, trail]) : res;
};
- iconv.decode = function decode(buf, encoding, options) {
+ iconv.decode = function decode2(buf, encoding, options) {
if (typeof buf === "string") {
if (!iconv.skipDecodeWarning) {
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
@@ -68122,11 +68996,11 @@ var require_on_finished = __commonJS({
var eeMsg;
var eeSocket;
var finished = false;
- function onFinish(error) {
+ function onFinish(error2) {
eeMsg.cancel();
eeSocket.cancel();
finished = true;
- callback(error);
+ callback(error2);
}
eeMsg = eeSocket = first([[msg, "end", "finish"]], onFinish);
function onSocket(socket) {
@@ -68233,16 +69107,16 @@ var require_read = __commonJS({
}));
}
debug("read body");
- getBody(stream, opts, function(error, body2) {
- if (error) {
+ getBody(stream, opts, function(error2, body2) {
+ if (error2) {
var _error;
- if (error.type === "encoding.unsupported") {
+ if (error2.type === "encoding.unsupported") {
_error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
charset: encoding.toLowerCase(),
type: "charset.unsupported"
});
} else {
- _error = createError(400, error);
+ _error = createError(400, error2);
}
if (stream !== req) {
unpipe(req);
@@ -68658,17 +69532,17 @@ var require_json = __commonJS({
return void 0;
}
}
- function normalizeJsonSyntaxError(error, obj) {
- var keys = Object.getOwnPropertyNames(error);
+ function normalizeJsonSyntaxError(error2, obj) {
+ var keys = Object.getOwnPropertyNames(error2);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key !== "stack" && key !== "message") {
- delete error[key];
+ delete error2[key];
}
}
- error.stack = obj.stack.replace(error.message, obj.message);
- error.message = obj.message;
- return error;
+ error2.stack = obj.stack.replace(error2.message, obj.message);
+ error2.message = obj.message;
+ return error2;
}
function typeChecker(type3) {
return function checkType(req) {
@@ -70052,7 +70926,7 @@ var require_utils3 = __commonJS({
return acc;
}, target);
};
- var decode = function(str, decoder, charset) {
+ var decode2 = function(str, decoder, charset) {
var strWithoutPlus = str.replace(/\+/g, " ");
if (charset === "iso-8859-1") {
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
@@ -70063,7 +70937,7 @@ var require_utils3 = __commonJS({
return strWithoutPlus;
}
};
- var encode = function encode2(str, defaultEncoder, charset, kind, format) {
+ var encode2 = function encode3(str, defaultEncoder, charset, kind, format) {
if (str.length === 0) {
return str;
}
@@ -70149,8 +71023,8 @@ var require_utils3 = __commonJS({
assign,
combine,
compact,
- decode,
- encode,
+ decode: decode2,
+ encode: encode2,
isBuffer,
isRegExp,
maybeMap,
@@ -71313,13 +72187,13 @@ var require_layer = __commonJS({
this.regexp.fast_star = path3 === "*";
this.regexp.fast_slash = path3 === "/" && opts.end === false;
}
- Layer.prototype.handle_error = function handle_error(error, req, res, next) {
+ Layer.prototype.handle_error = function handle_error(error2, req, res, next) {
var fn = this.handle;
if (fn.length !== 4) {
- return next(error);
+ return next(error2);
}
try {
- fn(error, req, res, next);
+ fn(error2, req, res, next);
} catch (err) {
next(err);
}
@@ -71439,7 +72313,7 @@ var require_route = __commonJS({
var Layer = require_layer();
var methods = require_methods();
var slice = Array.prototype.slice;
- var toString3 = Object.prototype.toString;
+ var toString4 = Object.prototype.toString;
module2.exports = Route;
function Route(path3) {
this.path = path3;
@@ -71510,7 +72384,7 @@ var require_route = __commonJS({
for (var i = 0; i < handles.length; i++) {
var handle = handles[i];
if (typeof handle !== "function") {
- var type3 = toString3.call(handle);
+ var type3 = toString4.call(handle);
var msg = "Route.all() requires a callback function but got a " + type3;
throw new TypeError(msg);
}
@@ -71527,7 +72401,7 @@ var require_route = __commonJS({
for (var i = 0; i < handles.length; i++) {
var handle = handles[i];
if (typeof handle !== "function") {
- var type3 = toString3.call(handle);
+ var type3 = toString4.call(handle);
var msg = "Route." + method + "() requires a callback function but got a " + type3;
throw new Error(msg);
}
@@ -71572,7 +72446,7 @@ var require_router = __commonJS({
var setPrototypeOf = require_setprototypeof();
var objectRegExp = /^\[object (\S+)\]$/;
var slice = Array.prototype.slice;
- var toString3 = Object.prototype.toString;
+ var toString4 = Object.prototype.toString;
var proto = module2.exports = function(options) {
var opts = options || {};
function router(req, res, next) {
@@ -71874,7 +72748,7 @@ var require_router = __commonJS({
if (type3 !== "object") {
return type3;
}
- return toString3.call(obj).replace(objectRegExp, "$1");
+ return toString4.call(obj).replace(objectRegExp, "$1");
}
function matchLayer(layer, path3) {
try {
@@ -72300,7 +73174,7 @@ var require_etag = __commonJS({
module2.exports = etag;
var crypto = require("crypto");
var Stats = require("fs").Stats;
- var toString3 = Object.prototype.toString;
+ var toString4 = Object.prototype.toString;
function entitytag(entity) {
if (entity.length === 0) {
return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"';
@@ -72325,7 +73199,7 @@ var require_etag = __commonJS({
if (typeof Stats === "function" && obj instanceof Stats) {
return true;
}
- return obj && typeof obj === "object" && "ctime" in obj && toString3.call(obj.ctime) === "[object Date]" && "mtime" in obj && toString3.call(obj.mtime) === "[object Date]" && "ino" in obj && typeof obj.ino === "number" && "size" in obj && typeof obj.size === "number";
+ return obj && typeof obj === "object" && "ctime" in obj && toString4.call(obj.ctime) === "[object Date]" && "mtime" in obj && toString4.call(obj.mtime) === "[object Date]" && "ino" in obj && typeof obj.ino === "number" && "size" in obj && typeof obj.size === "number";
}
function stattag(stat2) {
var mtime = stat2.mtime.getTime().toString(16);
@@ -72424,9 +73298,9 @@ var require_mime = __commonJS({
this.types = /* @__PURE__ */ Object.create(null);
this.extensions = /* @__PURE__ */ Object.create(null);
}
- Mime.prototype.define = function(map) {
- for (var type3 in map) {
- var exts = map[type3];
+ Mime.prototype.define = function(map2) {
+ for (var type3 in map2) {
+ var exts = map2[type3];
for (var i = 0; i < exts.length; i++) {
if (process.env.DEBUG_MIME && this.types[exts[i]]) {
console.warn((this._loading || "define()").replace(/.*\//, ""), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + " to " + type3);
@@ -72440,12 +73314,12 @@ var require_mime = __commonJS({
};
Mime.prototype.load = function(file) {
this._loading = file;
- var map = {}, content = fs3.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
+ var map2 = {}, content = fs3.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
lines.forEach(function(line) {
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
- map[fields.shift()] = fields;
+ map2[fields.shift()] = fields;
});
- this.define(map);
+ this.define(map2);
this._loading = null;
};
Mime.prototype.lookup = function(path4, fallback) {
@@ -72769,7 +73643,7 @@ var require_send = __commonJS({
debug("max-age %d", this._maxage);
return this;
}, "send.maxage: pass maxAge as option");
- SendStream.prototype.error = function error(status, err) {
+ SendStream.prototype.error = function error2(status, err) {
if (hasListeners(this, "error")) {
return this.emit("error", createHttpError(status, err));
}
@@ -72834,15 +73708,15 @@ var require_send = __commonJS({
var statusCode = this.res.statusCode;
return statusCode >= 200 && statusCode < 300 || statusCode === 304;
};
- SendStream.prototype.onStatError = function onStatError(error) {
- switch (error.code) {
+ SendStream.prototype.onStatError = function onStatError(error2) {
+ switch (error2.code) {
case "ENAMETOOLONG":
case "ENOENT":
case "ENOTDIR":
- this.error(404, error);
+ this.error(404, error2);
break;
default:
- this.error(500, error);
+ this.error(500, error2);
break;
}
};
@@ -72887,7 +73761,7 @@ var require_send = __commonJS({
SendStream.prototype.pipe = function pipe(res) {
var root = this._root;
this.res = res;
- var path4 = decode(this.path);
+ var path4 = decode2(this.path);
if (path4 === -1) {
this.error(400);
return res;
@@ -73153,7 +74027,7 @@ var require_send = __commonJS({
}
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
}
- function decode(path4) {
+ function decode2(path4) {
try {
return decodeURIComponent(path4);
} catch (err) {
@@ -73788,7 +74662,7 @@ var require_ipaddr = __commonJS({
return new this(octets);
};
ipaddr.IPv4.broadcastAddressFromCIDR = function(string) {
- var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;
+ var cidr, error2, i, ipInterfaceOctets, octets, subnetMaskOctets;
try {
cidr = this.parseCIDR(string);
ipInterfaceOctets = cidr[0].toByteArray();
@@ -73801,12 +74675,12 @@ var require_ipaddr = __commonJS({
}
return new this(octets);
} catch (error1) {
- error = error1;
+ error2 = error1;
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
}
};
ipaddr.IPv4.networkAddressFromCIDR = function(string) {
- var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;
+ var cidr, error2, i, ipInterfaceOctets, octets, subnetMaskOctets;
try {
cidr = this.parseCIDR(string);
ipInterfaceOctets = cidr[0].toByteArray();
@@ -73819,7 +74693,7 @@ var require_ipaddr = __commonJS({
}
return new this(octets);
} catch (error1) {
- error = error1;
+ error2 = error1;
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
}
};
@@ -75264,7 +76138,7 @@ var require_cookie2 = __commonJS({
}
var obj = {};
var opt = options || {};
- var dec = opt.decode || decode;
+ var dec = opt.decode || decode2;
var index = 0;
while (index < str.length) {
var eqIdx = str.indexOf("=", index);
@@ -75292,7 +76166,7 @@ var require_cookie2 = __commonJS({
}
function serialize(name, val, options) {
var opt = options || {};
- var enc = opt.encode || encode;
+ var enc = opt.encode || encode2;
if (typeof enc !== "function") {
throw new TypeError("option encode is invalid");
}
@@ -75373,18 +76247,18 @@ var require_cookie2 = __commonJS({
}
return str;
}
- function decode(str) {
+ function decode2(str) {
return str.indexOf("%") !== -1 ? decodeURIComponent(str) : str;
}
- function encode(val) {
+ function encode2(val) {
return encodeURIComponent(val);
}
function isDate(val) {
return __toString.call(val) === "[object Date]" || val instanceof Date;
}
- function tryDecode(str, decode2) {
+ function tryDecode(str, decode3) {
try {
- return decode2(str);
+ return decode3(str);
} catch (e) {
return str;
}
@@ -76066,7 +76940,7 @@ var require_serve_static = __commonJS({
forwardError = true;
});
}
- stream.on("error", function error(err) {
+ stream.on("error", function error2(err) {
if (forwardError || !(err.statusCode < 500)) {
next(err);
return;
@@ -76283,8 +77157,8 @@ async function startServer() {
fs2.writeFileSync(path2.resolve(absoluteCacheDirectory, portFileName), port);
});
}
-startServer().catch((error) => {
- console.error(error);
+startServer().catch((error2) => {
+ console.error(error2);
process.exit(1);
});
/*!
@@ -76317,6 +77191,36 @@ startServer().catch((error) => {
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+/*!
+ * Copyright (c) 2015-2020, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
/*!
* Copyright (c) 2018, Salesforce.com, Inc.
* All rights reserved.