dineway 0.1.33 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/dist/api/route-utils.d.mts +2 -2
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/{api-DnIb1m5Z.mjs → api-Ow6RbraA.mjs} +1 -1
- package/dist/astro/index.d.mts +2 -2
- package/dist/astro/index.mjs +1 -1
- package/dist/astro/middleware/auth.d.mts +2 -2
- package/dist/astro/middleware.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +1 -1
- package/dist/astro/routes/api/health.mjs +1 -1
- package/dist/astro/routes/api/manifest.mjs +1 -1
- package/dist/astro/routes/api/mcp.mjs +1 -1
- package/dist/astro/routes/api/openapi.json.mjs +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +1 -1
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- package/dist/astro/types.d.mts +2 -2
- package/dist/{bylines-XqeN4fIs.d.mts → bylines-CtD_p_1z.d.mts} +26 -26
- package/dist/cli/index.mjs +316 -87
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +2 -2
- package/dist/plugins/adapt-sandbox-entry.d.mts +2 -2
- package/dist/{runtime-BM9sqnzO.d.mts → runtime-CP8eY2L-.d.mts} +2 -2
- package/dist/runtime.d.mts +2 -2
- package/dist/version-q9Wd8cwL.mjs +6 -0
- package/package.json +3 -3
- package/dist/version-Bc25r6K8.mjs +0 -6
package/dist/cli/index.mjs
CHANGED
|
@@ -1637,7 +1637,7 @@ async function writeForgewayCredentials(credentials, cwd) {
|
|
|
1637
1637
|
await writeStore(store, cwd);
|
|
1638
1638
|
}
|
|
1639
1639
|
function shadowGrantKey(platformApiUrl, placeId) {
|
|
1640
|
-
return `${platformApiUrl.replace(TRAILING_SLASH_PATTERN$1, "")}#${placeId}`;
|
|
1640
|
+
return `${platformApiUrl.replace(TRAILING_SLASH_PATTERN$1, "")}#${placeId ?? "__unbound__"}`;
|
|
1641
1641
|
}
|
|
1642
1642
|
async function readForgewayShadowGrant(platformApiUrl, placeId, cwd) {
|
|
1643
1643
|
const store = await readStore(cwd);
|
|
@@ -1665,19 +1665,26 @@ const DATABASE_ENV_VAR_NAMES = ["DINEWAY_DATABASE_URL", "DINEWAY_DATABASE_AUTH_T
|
|
|
1665
1665
|
const POLL_INTERVAL_MS$1 = 5e3;
|
|
1666
1666
|
const POLL_TIMEOUT_MS$1 = 3e5;
|
|
1667
1667
|
const DIRECT_UPLOAD_CONCURRENCY = 8;
|
|
1668
|
-
const DEFAULT_BOOTSTRAP_PLACE_ID = "ChIJs5ydyTiuEmsR0fRSlU0C7k0";
|
|
1669
1668
|
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
1670
1669
|
const PLACE_ID_PATTERN = /^[A-Za-z0-9_-]{10,}$/;
|
|
1671
1670
|
const SLUG_SEPARATOR_PATTERN = /[^a-z0-9]+/g;
|
|
1672
1671
|
const LEADING_TRAILING_HYPHEN_PATTERN = /^-+|-+$/g;
|
|
1672
|
+
const DIACRITICS_PATTERN = /[\u0300-\u036f]/g;
|
|
1673
|
+
const NON_COMPARE_PATTERN = /[^\p{Letter}\p{Number}]+/gu;
|
|
1674
|
+
const LOCATION_PARTS_PATTERN = /[,;|/]+|\s+-\s+/u;
|
|
1673
1675
|
const JWT_PATTERN = /[A-Za-z0-9_-]{32,}\.[A-Za-z0-9_-]{16,}\.[A-Za-z0-9_-]{16,}/g;
|
|
1674
1676
|
const TOKEN_ASSIGNMENT_PATTERN = /(DINEWAY_DATABASE_AUTH_TOKEN|DATABASE_AUTH_TOKEN|AUTH_TOKEN)=\S+/gi;
|
|
1675
1677
|
const TRAILING_SLASH_PATTERN = /\/$/;
|
|
1676
1678
|
const BACKSLASH_PATTERN = /\\/g;
|
|
1677
|
-
const DIACRITICS_PATTERN = /[\u0300-\u036f]/g;
|
|
1678
|
-
const NON_COMPARE_PATTERN = /[^\p{Letter}\p{Number}]+/gu;
|
|
1679
|
-
const LOCATION_PARTS_PATTERN = /[,;|/]+|\s+-\s+/u;
|
|
1680
1679
|
const SHADOW_EMAIL_PATTERN = /^shadow_[a-f0-9]{16}@dineway\.ai$/i;
|
|
1680
|
+
const FOOD_TYPES = new Set([
|
|
1681
|
+
"restaurant",
|
|
1682
|
+
"cafe",
|
|
1683
|
+
"food",
|
|
1684
|
+
"meal_takeaway",
|
|
1685
|
+
"meal_delivery",
|
|
1686
|
+
"bakery"
|
|
1687
|
+
]);
|
|
1681
1688
|
const EXCLUDE_PATTERNS = [
|
|
1682
1689
|
"node_modules",
|
|
1683
1690
|
".git",
|
|
@@ -1792,7 +1799,7 @@ async function refreshFormalAccessToken(context, deps) {
|
|
|
1792
1799
|
return payload.accessToken;
|
|
1793
1800
|
}
|
|
1794
1801
|
async function refreshShadowAccessToken(context, deps) {
|
|
1795
|
-
if (!context.refreshToken
|
|
1802
|
+
if (!context.refreshToken) throw new Error("Dineway shadow deploy grant is missing its refresh token.");
|
|
1796
1803
|
const response = await forgewayRequest(`${context.platformApiUrl}/api/auth/refresh?client_type=server`, {
|
|
1797
1804
|
method: "POST",
|
|
1798
1805
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1849,7 +1856,6 @@ function isStoredFormalCredentialForGrant(stored, grant, email) {
|
|
|
1849
1856
|
if (normalizeEmail(stored.user.email) !== email) return false;
|
|
1850
1857
|
if (stored.user.emailVerified !== true) return false;
|
|
1851
1858
|
if (isShadowEmail(stored.user.email)) return false;
|
|
1852
|
-
if (grant.user?.id && stored.user.id !== grant.user.id) return false;
|
|
1853
1859
|
return true;
|
|
1854
1860
|
}
|
|
1855
1861
|
function assertVerifiedFormalAccountUser(user, expectedEmail) {
|
|
@@ -1917,7 +1923,7 @@ async function resolveShadowProjectContext(cwd, options, deps) {
|
|
|
1917
1923
|
const pkg = await readDeployPackageJson(cwd).catch(() => null);
|
|
1918
1924
|
const saved = pkg ? getSavedForgewayMetadata(pkg) : {};
|
|
1919
1925
|
const platformApiUrl = normalizePlatformApiUrl(getEnv("DINEWAY_API_BASE_URL") ?? getEnv("FORGEWAY_API_URL") ?? (typeof saved.platformApiUrl === "string" ? saved.platformApiUrl : void 0));
|
|
1920
|
-
const savedPlaceId = getEnv("DINEWAY_PLACE_ID") ?? (typeof saved.placeId === "string" ? saved.placeId : void 0);
|
|
1926
|
+
const savedPlaceId = options.placeId ?? getEnv("DINEWAY_PLACE_ID") ?? (typeof saved.placeId === "string" ? saved.placeId : void 0);
|
|
1921
1927
|
let grant = await (deps.readShadowGrant ?? readForgewayShadowGrant)(platformApiUrl, savedPlaceId, cwd);
|
|
1922
1928
|
let restaurant;
|
|
1923
1929
|
if (!grant) {
|
|
@@ -1936,6 +1942,28 @@ async function resolveShadowProjectContext(cwd, options, deps) {
|
|
|
1936
1942
|
name: options.restaurantName ?? grant.restaurantName,
|
|
1937
1943
|
city: options.city ?? grant.city
|
|
1938
1944
|
};
|
|
1945
|
+
if (!grant.placeId) {
|
|
1946
|
+
const shadowRestaurant = restaurant?.name && restaurant.city ? {
|
|
1947
|
+
name: restaurant.name,
|
|
1948
|
+
city: restaurant.city
|
|
1949
|
+
} : await resolveShadowRestaurantInfo(options, deps);
|
|
1950
|
+
restaurant = shadowRestaurant;
|
|
1951
|
+
grant = savedPlaceId ? await bindShadowGrantPlace({
|
|
1952
|
+
platformApiUrl,
|
|
1953
|
+
grant,
|
|
1954
|
+
placeId: savedPlaceId,
|
|
1955
|
+
restaurant: shadowRestaurant,
|
|
1956
|
+
cwd,
|
|
1957
|
+
deps
|
|
1958
|
+
}) : await resolvePlaceIdWithShadowSearch({
|
|
1959
|
+
platformApiUrl,
|
|
1960
|
+
grant,
|
|
1961
|
+
restaurant: shadowRestaurant,
|
|
1962
|
+
cwd,
|
|
1963
|
+
deps
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
if (!grant.placeId) throw new Error("Could not resolve a Dineway place id for Forgeway deploy.");
|
|
1939
1967
|
const shadowContext = {
|
|
1940
1968
|
projectDir: cwd,
|
|
1941
1969
|
platformApiUrl,
|
|
@@ -1965,107 +1993,280 @@ async function resolveShadowProjectContext(cwd, options, deps) {
|
|
|
1965
1993
|
async function resolveProjectContext(cwd, options, deps) {
|
|
1966
1994
|
return await resolveShadowProjectContext(cwd, options, deps);
|
|
1967
1995
|
}
|
|
1996
|
+
async function createShadowUser(platformApiUrl, placeId, deps) {
|
|
1997
|
+
const response = await forgewayRequest(`${platformApiUrl}/api/auth/users/shadow`, {
|
|
1998
|
+
method: "POST",
|
|
1999
|
+
headers: { "Content-Type": "application/json" },
|
|
2000
|
+
body: JSON.stringify({
|
|
2001
|
+
...placeId ? { placeId } : {},
|
|
2002
|
+
language: "en"
|
|
2003
|
+
})
|
|
2004
|
+
}, deps);
|
|
2005
|
+
if (!response.ok) throw new Error(await parseErrorResponse(response));
|
|
2006
|
+
const payload = await response.json();
|
|
2007
|
+
if (!payload.accessToken || !payload.refreshToken) throw new Error("Dineway shadow user response was missing tokens.");
|
|
2008
|
+
return payload;
|
|
2009
|
+
}
|
|
1968
2010
|
function isRecord(value) {
|
|
1969
|
-
return typeof value === "object" && value !== null;
|
|
2011
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2012
|
+
}
|
|
2013
|
+
function uniqueStrings(values) {
|
|
2014
|
+
return [...new Set(values.map((value) => String(value || "").trim()).filter(Boolean))];
|
|
1970
2015
|
}
|
|
1971
|
-
function
|
|
2016
|
+
function displayText(value) {
|
|
1972
2017
|
if (typeof value === "string" || typeof value === "number") return String(value);
|
|
1973
|
-
if (Array.isArray(value)) return value.map(
|
|
1974
|
-
if (isRecord(value)) return
|
|
2018
|
+
if (Array.isArray(value)) return value.map(displayText).filter(Boolean).join(" ");
|
|
2019
|
+
if (isRecord(value)) return displayText(value.text) || displayText(value.name) || displayText(value.displayName) || displayText(value.longText) || displayText(value.shortText) || displayText(value.long_name) || displayText(value.short_name) || displayText(value.value);
|
|
1975
2020
|
return "";
|
|
1976
2021
|
}
|
|
1977
|
-
function
|
|
1978
|
-
return value.toLowerCase().normalize("NFKD").replace(DIACRITICS_PATTERN, "").replace(NON_COMPARE_PATTERN, "");
|
|
2022
|
+
function normalizeCompare(value) {
|
|
2023
|
+
return String(value || "").toLowerCase().normalize("NFKD").replace(DIACRITICS_PATTERN, "").replace(NON_COMPARE_PATTERN, "");
|
|
1979
2024
|
}
|
|
1980
2025
|
function candidatePlaceId(candidate) {
|
|
1981
2026
|
return String(candidate.placeId || candidate.id || "").trim();
|
|
1982
2027
|
}
|
|
1983
|
-
function
|
|
1984
|
-
return [
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
]
|
|
2028
|
+
function candidateNameTexts(candidate) {
|
|
2029
|
+
return uniqueStrings([
|
|
2030
|
+
displayText(candidate.displayName),
|
|
2031
|
+
displayText(candidate.name),
|
|
2032
|
+
displayText(candidate.businessName),
|
|
2033
|
+
displayText(candidate.title)
|
|
2034
|
+
]);
|
|
2035
|
+
}
|
|
2036
|
+
function candidateAddressTexts(candidate) {
|
|
2037
|
+
const addressComponents = Array.isArray(candidate.addressComponents) ? candidate.addressComponents.flatMap((component) => isRecord(component) ? [
|
|
2038
|
+
displayText(component.longText),
|
|
2039
|
+
displayText(component.shortText),
|
|
2040
|
+
displayText(component.long_name),
|
|
2041
|
+
displayText(component.short_name),
|
|
2042
|
+
displayText(component.name)
|
|
2043
|
+
] : []) : [];
|
|
2044
|
+
return uniqueStrings([
|
|
2045
|
+
displayText(candidate.formattedAddress),
|
|
2046
|
+
displayText(candidate.shortFormattedAddress),
|
|
2047
|
+
displayText(candidate.address),
|
|
2048
|
+
displayText(candidate.vicinity),
|
|
2049
|
+
displayText(candidate.plusCode?.compoundCode),
|
|
2050
|
+
displayText(candidate.plus_code?.compound_code),
|
|
2051
|
+
...addressComponents
|
|
2052
|
+
]);
|
|
2053
|
+
}
|
|
2054
|
+
function candidateTypes(candidate) {
|
|
2055
|
+
return uniqueStrings([
|
|
2056
|
+
...Array.isArray(candidate.types) ? candidate.types : [],
|
|
2057
|
+
candidate.primaryType,
|
|
2058
|
+
candidate.primary_type
|
|
2059
|
+
]).map((type) => type.toLowerCase());
|
|
2060
|
+
}
|
|
2061
|
+
function locationParts(value) {
|
|
2062
|
+
return uniqueStrings(value.split(LOCATION_PARTS_PATTERN).map((part) => normalizeCompare(part)).filter(Boolean));
|
|
2063
|
+
}
|
|
2064
|
+
function scoreNameMatch(queryName, candidateNames) {
|
|
2065
|
+
let bestScore = 0;
|
|
2066
|
+
let bestReason = "";
|
|
2067
|
+
for (const name of candidateNames) {
|
|
2068
|
+
const currentName = normalizeCompare(name);
|
|
2069
|
+
if (!queryName || !currentName) continue;
|
|
2070
|
+
let score = 0;
|
|
2071
|
+
let reason = "";
|
|
2072
|
+
if (currentName === queryName) {
|
|
2073
|
+
score = 120;
|
|
2074
|
+
reason = "exact_name";
|
|
2075
|
+
} else if (currentName.includes(queryName)) {
|
|
2076
|
+
score = 80;
|
|
2077
|
+
reason = "candidate_contains_name";
|
|
2078
|
+
} else if (queryName.includes(currentName) && currentName.length >= Math.min(4, queryName.length)) {
|
|
2079
|
+
score = 45;
|
|
2080
|
+
reason = "query_contains_candidate_name";
|
|
2081
|
+
}
|
|
2082
|
+
if (score > bestScore) {
|
|
2083
|
+
bestScore = score;
|
|
2084
|
+
bestReason = reason;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
return {
|
|
2088
|
+
score: bestScore,
|
|
2089
|
+
reason: bestReason
|
|
2090
|
+
};
|
|
1990
2091
|
}
|
|
1991
|
-
function
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2092
|
+
function scoreLocationMatch(city, candidate) {
|
|
2093
|
+
const queryLocation = normalizeCompare(city);
|
|
2094
|
+
const parts = locationParts(city);
|
|
2095
|
+
const candidateLocation = normalizeCompare(candidateAddressTexts(candidate).join(" "));
|
|
2096
|
+
let score = 0;
|
|
2097
|
+
const reasons = [];
|
|
2098
|
+
if (!candidateLocation) return {
|
|
2099
|
+
score,
|
|
2100
|
+
reasons
|
|
2101
|
+
};
|
|
2102
|
+
if (queryLocation && candidateLocation.includes(queryLocation)) return {
|
|
2103
|
+
score: 55,
|
|
2104
|
+
reasons: ["location_full_match"]
|
|
2105
|
+
};
|
|
2106
|
+
const [primaryPart, ...secondaryParts] = parts;
|
|
2107
|
+
if (primaryPart && candidateLocation.includes(primaryPart)) {
|
|
2108
|
+
score += 38;
|
|
2109
|
+
reasons.push("location_primary_match");
|
|
2110
|
+
}
|
|
2111
|
+
for (const part of secondaryParts) if (part.length >= 3 && candidateLocation.includes(part)) {
|
|
2112
|
+
score += 10;
|
|
2113
|
+
reasons.push("location_secondary_match");
|
|
2114
|
+
}
|
|
2115
|
+
return {
|
|
2116
|
+
score,
|
|
2117
|
+
reasons
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
function scorePlaceCandidate(candidate, context) {
|
|
2121
|
+
const queryName = normalizeCompare(context.name);
|
|
2122
|
+
const currentPlaceId = candidatePlaceId(candidate);
|
|
2123
|
+
let score = 0;
|
|
2124
|
+
const reasons = [];
|
|
2125
|
+
if (context.providedPlaceId && currentPlaceId === context.providedPlaceId) {
|
|
2126
|
+
score += 1e4;
|
|
2127
|
+
reasons.push("provided_place_id");
|
|
2128
|
+
}
|
|
2129
|
+
const nameMatch = scoreNameMatch(queryName, candidateNameTexts(candidate));
|
|
2130
|
+
if (nameMatch.score) {
|
|
2131
|
+
score += nameMatch.score;
|
|
2132
|
+
reasons.push(nameMatch.reason);
|
|
2133
|
+
}
|
|
2134
|
+
const locationMatch = scoreLocationMatch(context.city, candidate);
|
|
2135
|
+
if (locationMatch.score) {
|
|
2136
|
+
score += locationMatch.score;
|
|
2137
|
+
reasons.push(...locationMatch.reasons);
|
|
2138
|
+
}
|
|
2139
|
+
if (candidateTypes(candidate).some((type) => FOOD_TYPES.has(type))) {
|
|
2140
|
+
score += 10;
|
|
2141
|
+
reasons.push("food_type");
|
|
2142
|
+
}
|
|
2143
|
+
const businessStatus = String(candidate.businessStatus ?? candidate.business_status ?? "").toUpperCase();
|
|
2144
|
+
if (businessStatus === "OPERATIONAL") {
|
|
2145
|
+
score += 4;
|
|
2146
|
+
reasons.push("operational");
|
|
2147
|
+
} else if (businessStatus === "CLOSED_PERMANENTLY") {
|
|
2148
|
+
score -= 60;
|
|
2149
|
+
reasons.push("closed_permanently");
|
|
2150
|
+
}
|
|
2151
|
+
const rating = Number(candidate.rating);
|
|
2152
|
+
if (Number.isFinite(rating)) score += Math.min(Math.max(rating, 0), 5);
|
|
2153
|
+
const reviewCount = Number(candidate.userRatingCount ?? candidate.user_ratings_total);
|
|
2154
|
+
if (Number.isFinite(reviewCount)) score += Math.min(Math.max(reviewCount, 0), 500) / 100;
|
|
2155
|
+
return {
|
|
2156
|
+
score,
|
|
2157
|
+
reason: reasons.join("+") || "fallback"
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
function selectPlaceCandidate(candidates, context) {
|
|
2004
2161
|
let best = null;
|
|
2162
|
+
let bestScore = Number.NEGATIVE_INFINITY;
|
|
2163
|
+
let bestReason = "fallback";
|
|
2005
2164
|
for (const candidate of candidates) {
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2165
|
+
const { score, reason } = scorePlaceCandidate(candidate, context);
|
|
2166
|
+
if (score > bestScore) {
|
|
2167
|
+
best = candidate;
|
|
2168
|
+
bestScore = score;
|
|
2169
|
+
bestReason = reason;
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
return best ? {
|
|
2173
|
+
candidate: best,
|
|
2174
|
+
score: bestScore,
|
|
2175
|
+
reason: bestReason
|
|
2176
|
+
} : null;
|
|
2177
|
+
}
|
|
2178
|
+
function extractPlaceCandidates(payload) {
|
|
2179
|
+
const root = isRecord(payload) ? payload : {};
|
|
2180
|
+
const nestedData = isRecord(root.data) ? root.data : {};
|
|
2181
|
+
const places = root.places ?? root.results ?? nestedData.places ?? nestedData.results;
|
|
2182
|
+
if (!Array.isArray(places)) throw new Error("Dineway place search response did not include places/results.");
|
|
2183
|
+
return places.filter(isRecord);
|
|
2184
|
+
}
|
|
2185
|
+
function shadowContextFromGrant(cwd, platformApiUrl, grant, restaurant) {
|
|
2186
|
+
return {
|
|
2187
|
+
projectDir: cwd,
|
|
2188
|
+
platformApiUrl,
|
|
2189
|
+
authKind: "shadow-grant",
|
|
2190
|
+
accessToken: grant.accessToken,
|
|
2191
|
+
refreshToken: grant.refreshToken,
|
|
2192
|
+
user: grant.user,
|
|
2193
|
+
ossHost: platformApiUrl,
|
|
2194
|
+
placeId: grant.placeId,
|
|
2195
|
+
restaurantName: restaurant?.name ?? grant.restaurantName,
|
|
2196
|
+
city: restaurant?.city ?? grant.city
|
|
2197
|
+
};
|
|
2024
2198
|
}
|
|
2025
|
-
function
|
|
2026
|
-
return
|
|
2199
|
+
function grantFromShadowContext(context, grant, overrides = {}) {
|
|
2200
|
+
return {
|
|
2201
|
+
...grant,
|
|
2202
|
+
platformApiUrl: context.platformApiUrl,
|
|
2203
|
+
accessToken: context.accessToken ?? grant.accessToken,
|
|
2204
|
+
refreshToken: context.refreshToken ?? grant.refreshToken,
|
|
2205
|
+
placeId: context.placeId ?? grant.placeId,
|
|
2206
|
+
restaurantName: context.restaurantName ?? grant.restaurantName,
|
|
2207
|
+
city: context.city ?? grant.city,
|
|
2208
|
+
user: context.user ?? grant.user,
|
|
2209
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2210
|
+
...overrides
|
|
2211
|
+
};
|
|
2027
2212
|
}
|
|
2028
|
-
async function
|
|
2029
|
-
const
|
|
2213
|
+
async function searchPlacesWithShadowGrant(options) {
|
|
2214
|
+
const context = shadowContextFromGrant(options.cwd, options.platformApiUrl, options.grant, options.restaurant);
|
|
2215
|
+
const payload = await shadowUpgradeFetch(context, "/api/places/search", options.deps, {
|
|
2216
|
+
method: "POST",
|
|
2217
|
+
body: JSON.stringify({ textQuery: `${options.restaurant.name} in ${options.restaurant.city}` })
|
|
2218
|
+
});
|
|
2219
|
+
return {
|
|
2220
|
+
grant: grantFromShadowContext(context, options.grant),
|
|
2221
|
+
candidates: extractPlaceCandidates(payload)
|
|
2222
|
+
};
|
|
2223
|
+
}
|
|
2224
|
+
async function bindShadowGrantPlace(options) {
|
|
2225
|
+
const context = shadowContextFromGrant(options.cwd, options.platformApiUrl, options.grant, options.restaurant);
|
|
2226
|
+
const payload = await shadowUpgradeFetch(context, "/api/auth/users/shadow/place", options.deps, {
|
|
2030
2227
|
method: "POST",
|
|
2031
|
-
headers: { "Content-Type": "application/json" },
|
|
2032
2228
|
body: JSON.stringify({
|
|
2033
|
-
placeId,
|
|
2229
|
+
placeId: options.placeId,
|
|
2034
2230
|
language: "en"
|
|
2035
2231
|
})
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2232
|
+
});
|
|
2233
|
+
const grant = grantFromShadowContext(context, options.grant, {
|
|
2234
|
+
placeId: options.placeId,
|
|
2235
|
+
accessToken: payload.accessToken ?? context.accessToken ?? options.grant.accessToken,
|
|
2236
|
+
refreshToken: payload.refreshToken ?? context.refreshToken ?? options.grant.refreshToken,
|
|
2237
|
+
restaurantName: options.restaurant.name,
|
|
2238
|
+
city: options.restaurant.city,
|
|
2239
|
+
user: payload.user ? normalizeForgewayUser(payload.user) : context.user ?? options.grant.user
|
|
2240
|
+
});
|
|
2241
|
+
await (options.deps.writeShadowGrant ?? writeForgewayShadowGrant)(grant, options.cwd);
|
|
2242
|
+
return grant;
|
|
2041
2243
|
}
|
|
2042
|
-
async function
|
|
2043
|
-
const
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2244
|
+
async function resolvePlaceIdWithShadowSearch(options) {
|
|
2245
|
+
const { grant, candidates } = await searchPlacesWithShadowGrant(options);
|
|
2246
|
+
if (candidates.length === 0) throw new Error(`Dineway place search returned no candidates for "${options.restaurant.name} in ${options.restaurant.city}".`);
|
|
2247
|
+
const selected = selectPlaceCandidate(candidates, {
|
|
2248
|
+
name: options.restaurant.name,
|
|
2249
|
+
city: options.restaurant.city
|
|
2250
|
+
});
|
|
2251
|
+
const finalPlaceId = selected ? candidatePlaceId(selected.candidate) : "";
|
|
2252
|
+
if (!PLACE_ID_PATTERN.test(finalPlaceId)) throw new Error("Could not resolve a valid Dineway place id for Forgeway deploy.");
|
|
2253
|
+
return await bindShadowGrantPlace({
|
|
2254
|
+
...options,
|
|
2255
|
+
grant,
|
|
2256
|
+
placeId: finalPlaceId
|
|
2257
|
+
});
|
|
2053
2258
|
}
|
|
2054
2259
|
async function createShadowGrant(options) {
|
|
2055
|
-
|
|
2056
|
-
const
|
|
2057
|
-
let finalPlaceId = options.placeId;
|
|
2058
|
-
if (!finalPlaceId) finalPlaceId = candidatePlaceId(selectPlaceCandidate(await searchPlaces(options.platformApiUrl, initialAuth.accessToken, options.restaurantName, options.city, options.deps), options.restaurantName, options.city));
|
|
2059
|
-
if (!PLACE_ID_PATTERN.test(finalPlaceId)) throw new Error("Could not resolve a valid Dineway place id for Forgeway deploy.");
|
|
2060
|
-
const finalAuth = finalPlaceId === initialPlaceId ? initialAuth : await createShadowUser(options.platformApiUrl, finalPlaceId, options.deps);
|
|
2260
|
+
if (options.placeId && !PLACE_ID_PATTERN.test(options.placeId)) throw new Error("Could not resolve a valid Dineway place id for Forgeway deploy.");
|
|
2261
|
+
const auth = await createShadowUser(options.platformApiUrl, options.placeId, options.deps);
|
|
2061
2262
|
const grant = {
|
|
2062
2263
|
platformApiUrl: options.platformApiUrl,
|
|
2063
|
-
placeId:
|
|
2064
|
-
accessToken:
|
|
2065
|
-
refreshToken:
|
|
2264
|
+
...options.placeId ? { placeId: options.placeId } : {},
|
|
2265
|
+
accessToken: auth.accessToken,
|
|
2266
|
+
refreshToken: auth.refreshToken,
|
|
2066
2267
|
restaurantName: options.restaurantName,
|
|
2067
2268
|
city: options.city,
|
|
2068
|
-
user:
|
|
2269
|
+
user: auth.user ? normalizeForgewayUser(auth.user) : void 0,
|
|
2069
2270
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2070
2271
|
};
|
|
2071
2272
|
await (options.deps.writeShadowGrant ?? writeForgewayShadowGrant)(grant, options.cwd);
|
|
@@ -2158,6 +2359,25 @@ async function getDeploymentSite(context, site, deps) {
|
|
|
2158
2359
|
throw error;
|
|
2159
2360
|
}
|
|
2160
2361
|
}
|
|
2362
|
+
async function getDeploymentSiteByPlaceId(context, placeId, deps) {
|
|
2363
|
+
try {
|
|
2364
|
+
return normalizeSiteDetail(await ossFetch(context, `/api/deployments/sites/by-place/${encodeURIComponent(placeId)}`, deps));
|
|
2365
|
+
} catch (error) {
|
|
2366
|
+
if (error instanceof ForgewayApiError && error.status === 404) return null;
|
|
2367
|
+
throw error;
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
async function ensureRestaurantClaim(context, restaurant, deps) {
|
|
2371
|
+
if (!context.placeId) throw new Error("Forgeway restaurant deploy is missing a place ID for claim ownership.");
|
|
2372
|
+
await ossFetch(context, "/api/restaurant-claims/ensure", deps, {
|
|
2373
|
+
method: "POST",
|
|
2374
|
+
body: JSON.stringify({
|
|
2375
|
+
placeId: context.placeId,
|
|
2376
|
+
...restaurant?.name ? { placeName: restaurant.name } : {},
|
|
2377
|
+
...restaurant?.city ? { city: restaurant.city } : {}
|
|
2378
|
+
})
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2161
2381
|
async function createDeploymentSite(context, input, deps) {
|
|
2162
2382
|
return await ossFetch(context, "/api/deployments/sites", deps, {
|
|
2163
2383
|
method: "POST",
|
|
@@ -2175,10 +2395,12 @@ async function resolveDeploymentSite(cwd, context, options, seedPath, deps, preR
|
|
|
2175
2395
|
const saved = pkg ? getSavedForgewayMetadata(pkg) : {};
|
|
2176
2396
|
const explicitSite = options.site;
|
|
2177
2397
|
const savedSite = typeof saved.siteId === "string" ? saved.siteId : saved.siteSlug;
|
|
2178
|
-
const siteRef = explicitSite ?? savedSite;
|
|
2179
|
-
const
|
|
2398
|
+
const siteRef = context.placeId ? explicitSite : explicitSite ?? savedSite;
|
|
2399
|
+
const existingByPlace = context.placeId ? await getDeploymentSiteByPlaceId(context, context.placeId, deps) : null;
|
|
2400
|
+
const restaurant = preResolvedRestaurant?.name && preResolvedRestaurant.city ? preResolvedRestaurant : await resolveRestaurantInfo(options, seedPath, deps, !existingByPlace && !siteRef);
|
|
2180
2401
|
const targetSlug = siteRef ?? deriveForgewaySiteSlug(restaurant.name || "", restaurant.city || "");
|
|
2181
|
-
let site =
|
|
2402
|
+
let site = existingByPlace;
|
|
2403
|
+
if (!site && siteRef) site = await getDeploymentSite(context, targetSlug, deps);
|
|
2182
2404
|
if (!site) site = await createDeploymentSite(context, {
|
|
2183
2405
|
slug: targetSlug,
|
|
2184
2406
|
restaurant,
|
|
@@ -2425,6 +2647,7 @@ async function deployForgeway(cwd, options, deps = {}) {
|
|
|
2425
2647
|
if (EXCLUDE_PATTERNS.includes(basename(sourceDir))) throw new Error(`"${basename(sourceDir)}" is an excluded directory and cannot be deployed.`);
|
|
2426
2648
|
const seedPath = await resolveSeedPath$1(cwd, options.seed);
|
|
2427
2649
|
const { context, restaurant } = await resolveProjectContext(cwd, options, deps);
|
|
2650
|
+
await ensureRestaurantClaim(context, restaurant, deps);
|
|
2428
2651
|
const { site } = await resolveDeploymentSite(cwd, context, options, seedPath, deps, restaurant);
|
|
2429
2652
|
const database = parseDatabaseMode(options.database);
|
|
2430
2653
|
if (database !== "none") {
|
|
@@ -2994,6 +3217,11 @@ const deployCommand = defineCommand({
|
|
|
2994
3217
|
description: "Forgeway deployment site ID or slug",
|
|
2995
3218
|
required: false
|
|
2996
3219
|
},
|
|
3220
|
+
"place-id": {
|
|
3221
|
+
type: "string",
|
|
3222
|
+
description: "Restaurant Google place ID for Forgeway claim and site recovery",
|
|
3223
|
+
required: false
|
|
3224
|
+
},
|
|
2997
3225
|
email: {
|
|
2998
3226
|
type: "string",
|
|
2999
3227
|
description: "Dineway account email for deploy authorization",
|
|
@@ -3029,6 +3257,7 @@ const deployCommand = defineCommand({
|
|
|
3029
3257
|
yes: args.yes,
|
|
3030
3258
|
dryRun: args["dry-run"],
|
|
3031
3259
|
site: args.site,
|
|
3260
|
+
placeId: args["place-id"],
|
|
3032
3261
|
email: args.email,
|
|
3033
3262
|
restaurantName: args["restaurant-name"],
|
|
3034
3263
|
city: args.city,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as ContentSeoInput, c as FindManyOptions, i as ContentSeo, l as FindManyResult, n as ContentBylineCredit, o as CreateContentInput, r as ContentItem, s as DinewayValidationError, t as BylineSummary, u as UpdateContentInput } from "./types-DvwHUku7.mjs";
|
|
2
|
-
import { $ as createPluginManager, $t as SandboxOptions, A as dropSessionDatabaseTables, An as handleContentDelete, At as verifyPreviewSignature, B as GeneratePreviewTokenOptions, Bn as handleContentSchedule, Bt as prosemirrorToPortableText, C as getByline, Cn as handleRevisionList, Ct as SessionOpenOrCreateOptions, D as AppliedSnapshotMeta, Dn as handleContentCountScheduled, Dt as defaultPreviewSidecarClient, E as renderPreviewToolbar, En as handleContentCompare, Et as buildPreviewSignatureHeader, F as getPreviewToken, Fn as handleContentList, Ft as AfterCallback, G as parseContentId, Gn as CreateMediaInput, Gt as PortableTextSpan, H as VerifyPreviewTokenOptions, Hn as handleContentUnpublish, Ht as PortableTextImageBlock, I as isPreviewRequest, In as handleContentListTrashed, It as after, J as createNodeSandboxRunner, Jn as ContentRepository, Jt as ProseMirrorDocument, K as verifyPreviewToken, Kn as MediaItem, Kt as PortableTextTextBlock, L as GetPreviewUrlOptions, Ln as handleContentPermanentDelete, Lt as computeContentHash, M as Snapshot, Mn as handleContentDuplicate, Mt as getFallbackChain, N as renderPreviewLoadingPage, Nn as handleContentGet, Nt as getI18nConfig, O as ApplySnapshotToDatabaseOptions, On as handleContentCountTrashed, Ot as parsePreviewSignatureHeader, P as isBlockedInPreview, Pn as handleContentGetIncludingTrashed, Pt as isI18nEnabled, Q as PluginManager, Qt as SandboxEmailSendCallback, R as buildPreviewUrl, Rn as handleContentPublish, Rt as hashString, S as Suggestion, Sn as handleRevisionGet, St as SessionOpenOptions, T as PreviewToolbarConfig, Tn as generateManifest, Tt as PreviewSidecarSignature, U as VerifyPreviewTokenResult, Un as handleContentUnschedule, Ut as PortableTextLinkMark, V as PreviewTokenPayload, Vn as handleContentTranslations, Vt as PortableTextCodeBlock, W as generatePreviewToken, Wn as handleContentUpdate, Wt as PortableTextMarkDef, X as SandboxNotAvailableError, Xn as DinewayDatabaseError, Xt as ProseMirrorNode, Y as NoopSandboxRunner, Yn as DatabaseConfig, Yt as ProseMirrorMark, Z as createNoopSandboxRunner, Zt as SandboxEmailMessage, _ as SearchOptions, _n as handleMediaGet, _t as SessionCleanupResult, an as getSections, ar as ApiContext, at as ValidatedPluginManifest, b as SearchStats, bn as RevisionListResponse, bt as SessionDatabaseInfo, c as extractSearchableFields, cn as Section, cr as FieldDescriptor, ct as CollectionFilter$1, d as search, dn as SchemaError, en as SandboxRunner, et as PluginRouteError, f as searchCollection, fn as SchemaRegistry, g as SearchConfig, gn as handleMediaDelete, gt as FileSessionDatabaseFactoryOptions, h as CollectionSearchOptions, hn as handleMediaCreate, ht as FileSessionDatabaseFactory, in as getSection, it as createHookPipeline, j as getAppliedSnapshotMeta, jn as handleContentDiscardDraft, jt as I18nConfig, k as applySnapshotToDatabase, kn as handleContentCreate, kt as signPreviewUrl, l as getSearchStats, ln as SectionSource, lr as ListResponse, lt as EntryData, m as FTSManager, mn as MediaResponse, mt as createFilePreviewMiddleware, n as PluginDescriptor, nn as SandboxedPlugin, nt as HookPipeline, on as CreateSectionInput, or as ContentListResponse, ot as pluginManifestSchema, p as searchWithDb, pn as MediaListResponse, pt as FilePreviewMiddlewareConfig, q as NodeSandboxRunner, qn as MediaRepository, qt as PortableTextUnknownBlock, rn as SerializedRequest, rt as HookResult, s as extractPlainText, sn as GetSectionsOptions, sr as ContentResponse, st as definePlugin, tn as SandboxRunnerFactory, u as getSuggestions, un as UpdateSectionInput, ur as ManifestResponse, ut as EntryFilter, v as SearchResponse, vn as handleMediaList, vt as SessionDatabaseFactory, w as getBylineBySlug, wn as handleRevisionRestore, wt as PreviewSidecarClient, x as SuggestOptions, xn as RevisionResponse, xt as SessionDatabaseLimitError, y as SearchResult, yn as handleMediaUpdate, yt as SessionDatabaseHandle, z as getPreviewUrl, zn as handleContentRestore, zt as portableTextToProsemirror } from "./runtime-
|
|
2
|
+
import { $ as createPluginManager, $t as SandboxOptions, A as dropSessionDatabaseTables, An as handleContentDelete, At as verifyPreviewSignature, B as GeneratePreviewTokenOptions, Bn as handleContentSchedule, Bt as prosemirrorToPortableText, C as getByline, Cn as handleRevisionList, Ct as SessionOpenOrCreateOptions, D as AppliedSnapshotMeta, Dn as handleContentCountScheduled, Dt as defaultPreviewSidecarClient, E as renderPreviewToolbar, En as handleContentCompare, Et as buildPreviewSignatureHeader, F as getPreviewToken, Fn as handleContentList, Ft as AfterCallback, G as parseContentId, Gn as CreateMediaInput, Gt as PortableTextSpan, H as VerifyPreviewTokenOptions, Hn as handleContentUnpublish, Ht as PortableTextImageBlock, I as isPreviewRequest, In as handleContentListTrashed, It as after, J as createNodeSandboxRunner, Jn as ContentRepository, Jt as ProseMirrorDocument, K as verifyPreviewToken, Kn as MediaItem, Kt as PortableTextTextBlock, L as GetPreviewUrlOptions, Ln as handleContentPermanentDelete, Lt as computeContentHash, M as Snapshot, Mn as handleContentDuplicate, Mt as getFallbackChain, N as renderPreviewLoadingPage, Nn as handleContentGet, Nt as getI18nConfig, O as ApplySnapshotToDatabaseOptions, On as handleContentCountTrashed, Ot as parsePreviewSignatureHeader, P as isBlockedInPreview, Pn as handleContentGetIncludingTrashed, Pt as isI18nEnabled, Q as PluginManager, Qt as SandboxEmailSendCallback, R as buildPreviewUrl, Rn as handleContentPublish, Rt as hashString, S as Suggestion, Sn as handleRevisionGet, St as SessionOpenOptions, T as PreviewToolbarConfig, Tn as generateManifest, Tt as PreviewSidecarSignature, U as VerifyPreviewTokenResult, Un as handleContentUnschedule, Ut as PortableTextLinkMark, V as PreviewTokenPayload, Vn as handleContentTranslations, Vt as PortableTextCodeBlock, W as generatePreviewToken, Wn as handleContentUpdate, Wt as PortableTextMarkDef, X as SandboxNotAvailableError, Xn as DinewayDatabaseError, Xt as ProseMirrorNode, Y as NoopSandboxRunner, Yn as DatabaseConfig, Yt as ProseMirrorMark, Z as createNoopSandboxRunner, Zt as SandboxEmailMessage, _ as SearchOptions, _n as handleMediaGet, _t as SessionCleanupResult, an as getSections, ar as ApiContext, at as ValidatedPluginManifest, b as SearchStats, bn as RevisionListResponse, bt as SessionDatabaseInfo, c as extractSearchableFields, cn as Section, cr as FieldDescriptor, ct as CollectionFilter$1, d as search, dn as SchemaError, en as SandboxRunner, et as PluginRouteError, f as searchCollection, fn as SchemaRegistry, g as SearchConfig, gn as handleMediaDelete, gt as FileSessionDatabaseFactoryOptions, h as CollectionSearchOptions, hn as handleMediaCreate, ht as FileSessionDatabaseFactory, in as getSection, it as createHookPipeline, j as getAppliedSnapshotMeta, jn as handleContentDiscardDraft, jt as I18nConfig, k as applySnapshotToDatabase, kn as handleContentCreate, kt as signPreviewUrl, l as getSearchStats, ln as SectionSource, lr as ListResponse, lt as EntryData, m as FTSManager, mn as MediaResponse, mt as createFilePreviewMiddleware, n as PluginDescriptor, nn as SandboxedPlugin, nt as HookPipeline, on as CreateSectionInput, or as ContentListResponse, ot as pluginManifestSchema, p as searchWithDb, pn as MediaListResponse, pt as FilePreviewMiddlewareConfig, q as NodeSandboxRunner, qn as MediaRepository, qt as PortableTextUnknownBlock, rn as SerializedRequest, rt as HookResult, s as extractPlainText, sn as GetSectionsOptions, sr as ContentResponse, st as definePlugin, tn as SandboxRunnerFactory, u as getSuggestions, un as UpdateSectionInput, ur as ManifestResponse, ut as EntryFilter, v as SearchResponse, vn as handleMediaList, vt as SessionDatabaseFactory, w as getBylineBySlug, wn as handleRevisionRestore, wt as PreviewSidecarClient, x as SuggestOptions, xn as RevisionResponse, xt as SessionDatabaseLimitError, y as SearchResult, yn as handleMediaUpdate, yt as SessionDatabaseHandle, z as getPreviewUrl, zn as handleContentRestore, zt as portableTextToProsemirror } from "./runtime-CP8eY2L-.mjs";
|
|
3
3
|
import { n as MediaTable, r as UserTable, t as Database } from "./types-B1NksXAb.mjs";
|
|
4
4
|
import { $ as StandardHookEntry, A as PageMetadataContribution, B as PluginDefinition, C as MediaAccess, D as PageFragmentContribution, E as ModerationDecision, F as PluginAdminConfig, G as PortableTextBlockConfig, H as PluginManifest, I as PluginAdminExports, K as PortableTextBlockField, L as PluginAdminPage, M as PageMetadataHandler, O as PageFragmentEvent, P as PagePlacement, Q as RouteContext, R as PluginCapability, S as LogAccess, T as MediaUploadEvent, U as PluginRoute, V as PluginHooks, W as PluginStorageConfig, X as ResolvedPlugin, Y as ResolvedHook, Z as ResolvedPluginHooks, _ as FieldWidgetConfig, a as CommentAfterModerateEvent, b as HttpAccess, c as CommentBeforeCreateHandler, d as ContentAccess, et as StandardHookHandler, f as ContentDeleteEvent, i as CommentAfterCreateHandler, it as StorageCollection, j as PageMetadataEvent, k as PageFragmentHandler, l as CommentModerateEvent, m as ContentPublishStateChangeEvent, n as CollectionCommentSettings, nt as StandardRouteEntry, o as CommentAfterModerateHandler, ot as StoredComment, p as ContentHookEvent, q as PublicPageContext, r as CommentAfterCreateEvent, rt as StandardRouteHandler, s as CommentBeforeCreateEvent, st as isStandardPluginDefinition, t as BreadcrumbItem, tt as StandardPluginDefinition, u as CommentModerateHandler, v as HookConfig, x as KVAccess, y as HookName, z as PluginContext } from "./types-BIM7jwxr.mjs";
|
|
5
5
|
import { _ as RESERVED_COLLECTION_SLUGS, a as Collection, b as UpdateFieldInput, c as CollectionWithFields, d as CreateFieldInput, f as FIELD_TYPE_TO_COLUMN, g as FieldWidgetOptions, h as FieldValidation, i as SiteSettings, l as ColumnType, m as FieldType, n as SeoSettings, o as CollectionSource, p as Field, r as SiteSettingKey, s as CollectionSupport, t as MediaReference, u as CreateCollectionInput, v as RESERVED_FIELD_SLUGS, y as UpdateCollectionInput } from "./types-t7_nCCA9.mjs";
|
|
@@ -11,7 +11,7 @@ import { $ as TranslationSummary, A as MenuItem, B as getPluginSettings, C as Ta
|
|
|
11
11
|
import { _ as WxrSite, a as getAllSources, b as parseWxrString, c as getUrlSources, d as importReusableBlocksAsSections, f as WxrAttachment, g as WxrPost, h as WxrData, i as clearSources, l as probeUrl, m as WxrCategory, n as parseWxrDate, o as getFileSources, p as WxrAuthor, r as wxrSource, s as getSource, t as wordpressRestSource, u as registerSource, v as WxrTag, x as decodeSlug, y as parseWxr } from "./index-CpbixmRL.mjs";
|
|
12
12
|
import { n as generatePlaceholder, r as normalizeMediaValue, t as PlaceholderData } from "./placeholder-BZpCpid_.mjs";
|
|
13
13
|
import { a as ListOptions, c as S3StorageConfig, d as Storage, f as StorageDescriptor, i as FileInfo, l as SignedUploadOptions, n as DinewayStorageError, o as ListResult, p as UploadResult, r as DownloadResult, s as LocalStorageConfig, t as CreateStorageFn, u as SignedUploadUrl } from "./types-BYjPylrZ.mjs";
|
|
14
|
-
import "./bylines-
|
|
14
|
+
import "./bylines-CtD_p_1z.mjs";
|
|
15
15
|
import { DinewayRequestContext, getRequestContext, runWithContext } from "./request-context.mjs";
|
|
16
16
|
import { adaptSandboxEntry } from "./plugins/adapt-sandbox-entry.mjs";
|
|
17
17
|
import { S as UrlInput, _ as SourceAuth, a as FileInput, b as SourceProbeResult, c as ImportContext, d as ImportSource, f as NormalizedItem, g as ProbeResult, h as PostTypeMapping, i as FieldCompatibility, l as ImportFieldDef, m as PostTypeAnalysis, n as CollectionSchemaStatus, o as ImportAnalysis, p as OAuthInput, r as FetchOptions, s as ImportConfig, t as AttachmentInfo, u as ImportResult, v as SourceCapabilities, x as SuggestedAction, y as SourceInput } from "./types-BBETcziA.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import "./byline-DpNNSjET.mjs";
|
|
|
24
24
|
import { t as normalizeMediaValue } from "./normalize-BY_EJnd9.mjs";
|
|
25
25
|
import { t as generatePlaceholder } from "./placeholder-b0Ufu0La.mjs";
|
|
26
26
|
import "./seo-BPb_reaG.mjs";
|
|
27
|
-
import { A as handleRevisionGet, B as handleContentDuplicate, D as handleMediaGet, E as handleMediaDelete, F as handleContentCountScheduled, G as handleContentPermanentDelete, H as handleContentGetIncludingTrashed, I as handleContentCountTrashed, J as handleContentSchedule, K as handleContentPublish, L as handleContentCreate, M as handleRevisionRestore, N as generateManifest, O as handleMediaList, P as handleContentCompare, Q as handleContentUpdate, R as handleContentDelete, T as handleMediaCreate, U as handleContentList, V as handleContentGet, W as handleContentListTrashed, X as handleContentUnpublish, Y as handleContentTranslations, Z as handleContentUnschedule, j as handleRevisionList, k as handleMediaUpdate, q as handleContentRestore, z as handleContentDiscardDraft } from "./api-
|
|
27
|
+
import { A as handleRevisionGet, B as handleContentDuplicate, D as handleMediaGet, E as handleMediaDelete, F as handleContentCountScheduled, G as handleContentPermanentDelete, H as handleContentGetIncludingTrashed, I as handleContentCountTrashed, J as handleContentSchedule, K as handleContentPublish, L as handleContentCreate, M as handleRevisionRestore, N as generateManifest, O as handleMediaList, P as handleContentCompare, Q as handleContentUpdate, R as handleContentDelete, T as handleMediaCreate, U as handleContentList, V as handleContentGet, W as handleContentListTrashed, X as handleContentUnpublish, Y as handleContentTranslations, Z as handleContentUnschedule, j as handleRevisionList, k as handleMediaUpdate, q as handleContentRestore, z as handleContentDiscardDraft } from "./api-Ow6RbraA.mjs";
|
|
28
28
|
import "./request-cache-BpwuE2ix.mjs";
|
|
29
29
|
import "./dashboard-BC9bgPOH.mjs";
|
|
30
30
|
import "./briefing-Jsxs587i.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../runtime-
|
|
1
|
+
import "../runtime-CP8eY2L-.mjs";
|
|
2
2
|
import { t as Database } from "../types-B1NksXAb.mjs";
|
|
3
3
|
import "../types-BIM7jwxr.mjs";
|
|
4
4
|
import "../types-BgE6gMFI.mjs";
|
|
@@ -7,7 +7,7 @@ import "../runner-pAnQS6iI.mjs";
|
|
|
7
7
|
import "../index-2tBfB_8X.mjs";
|
|
8
8
|
import "../index-CpbixmRL.mjs";
|
|
9
9
|
import { d as Storage } from "../types-BYjPylrZ.mjs";
|
|
10
|
-
import "../bylines-
|
|
10
|
+
import "../bylines-CtD_p_1z.mjs";
|
|
11
11
|
import "../types-BBETcziA.mjs";
|
|
12
12
|
import "../validate-BzUCAU2a.mjs";
|
|
13
13
|
import "../index.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as PluginDescriptor } from "../runtime-
|
|
1
|
+
import { n as PluginDescriptor } from "../runtime-CP8eY2L-.mjs";
|
|
2
2
|
import "../types-B1NksXAb.mjs";
|
|
3
3
|
import { X as ResolvedPlugin, tt as StandardPluginDefinition } from "../types-BIM7jwxr.mjs";
|
|
4
4
|
import "../types-BgE6gMFI.mjs";
|
|
5
5
|
import "../runner-pAnQS6iI.mjs";
|
|
6
6
|
import "../index-2tBfB_8X.mjs";
|
|
7
7
|
import "../index-CpbixmRL.mjs";
|
|
8
|
-
import "../bylines-
|
|
8
|
+
import "../bylines-CtD_p_1z.mjs";
|
|
9
9
|
import "../types-BBETcziA.mjs";
|
|
10
10
|
import "../validate-BzUCAU2a.mjs";
|
|
11
11
|
|
|
@@ -1787,14 +1787,14 @@ declare const pluginManifestSchema: z.ZodObject<{
|
|
|
1787
1787
|
number: "number";
|
|
1788
1788
|
boolean: "boolean";
|
|
1789
1789
|
file: "file";
|
|
1790
|
-
image: "image";
|
|
1791
1790
|
slug: "slug";
|
|
1792
|
-
datetime: "datetime";
|
|
1793
1791
|
text: "text";
|
|
1794
1792
|
integer: "integer";
|
|
1793
|
+
datetime: "datetime";
|
|
1795
1794
|
select: "select";
|
|
1796
1795
|
multiSelect: "multiSelect";
|
|
1797
1796
|
portableText: "portableText";
|
|
1797
|
+
image: "image";
|
|
1798
1798
|
reference: "reference";
|
|
1799
1799
|
json: "json";
|
|
1800
1800
|
repeater: "repeater";
|
package/dist/runtime.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ct as CollectionFilter, dt as dinewayLoader, ft as getDb, lt as EntryData, ut as EntryFilter } from "./runtime-
|
|
1
|
+
import { ct as CollectionFilter, dt as dinewayLoader, ft as getDb, lt as EntryData, ut as EntryFilter } from "./runtime-CP8eY2L-.mjs";
|
|
2
2
|
import "./types-B1NksXAb.mjs";
|
|
3
3
|
import "./types-BIM7jwxr.mjs";
|
|
4
4
|
import "./types-BgE6gMFI.mjs";
|
|
5
5
|
import "./runner-pAnQS6iI.mjs";
|
|
6
6
|
import "./index-2tBfB_8X.mjs";
|
|
7
7
|
import "./index-CpbixmRL.mjs";
|
|
8
|
-
import "./bylines-
|
|
8
|
+
import "./bylines-CtD_p_1z.mjs";
|
|
9
9
|
import "./types-BBETcziA.mjs";
|
|
10
10
|
import "./validate-BzUCAU2a.mjs";
|
|
11
11
|
import { t as getMediaProvider } from "./provider-loader-BaZhx7E3.mjs";
|