@wix/himalaya-cli 0.1948.0 → 0.1949.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/files/src/index.d.ts +23 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +13 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/video/src/display.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/files.mjs +4 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +3 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-video.mjs +4 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{1425fc7ef3149df8ba41fdbcca629cefd430a2cae524822c21985f0aade6430a.bin → a8cfd0e17359578587e8937e88dedd40b46d533f08b4d2fdac4c47d5bae6f385.bin} +1 -1
- package/dist/browser-plane/sw.js +1 -1
- package/dist/cli.mjs +127 -65
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/app-icon.md +7 -3
- package/guides/one-app-to-himi-app.md +2 -2
- package/guides/sdk-reference.json +27 -6
- package/package.json +2 -2
- package/templates/beauty-salon-owner/config.ts +7 -0
- package/templates/beauty-salon-owner/dev/index.ts +567 -0
- package/templates/beauty-salon-owner/himalaya.content.json +3 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/branded-lite/l10n/ar.json +21 -0
- package/templates/branded-lite/l10n/cs.json +21 -0
- package/templates/branded-lite/l10n/da.json +21 -0
- package/templates/branded-lite/l10n/de.json +21 -0
- package/templates/branded-lite/l10n/el.json +21 -0
- package/templates/branded-lite/l10n/en.json +5 -0
- package/templates/branded-lite/l10n/es.json +21 -0
- package/templates/branded-lite/l10n/fi.json +21 -0
- package/templates/branded-lite/l10n/fr.json +21 -0
- package/templates/branded-lite/l10n/he.json +21 -0
- package/templates/branded-lite/l10n/hu.json +21 -0
- package/templates/branded-lite/l10n/id.json +21 -0
- package/templates/branded-lite/l10n/it.json +21 -0
- package/templates/branded-lite/l10n/ja.json +21 -0
- package/templates/branded-lite/l10n/ko.json +21 -0
- package/templates/branded-lite/l10n/lt.json +21 -0
- package/templates/branded-lite/l10n/nl.json +21 -0
- package/templates/branded-lite/l10n/no.json +21 -0
- package/templates/branded-lite/l10n/pl.json +21 -0
- package/templates/branded-lite/l10n/pt.json +21 -0
- package/templates/branded-lite/l10n/ru.json +21 -0
- package/templates/branded-lite/l10n/sv.json +21 -0
- package/templates/branded-lite/l10n/th.json +21 -0
- package/templates/branded-lite/l10n/tr.json +21 -0
- package/templates/branded-lite/l10n/uk.json +21 -0
- package/templates/branded-lite/l10n/vi.json +21 -0
- package/templates/branded-lite/l10n/zh.json +21 -0
- package/templates/branded-lite/recipes/group-feed.json +221 -3
- package/templates/branded-lite/recipes/groups-newsfeed.json +160 -2
- package/templates/branded-lite/recipes/video-library.json +475 -0
- package/templates/branded-lite/tier5-src/_shared/group-feed-section.ts +119 -7
- package/templates/branded-lite/tier5-src/_shared/groups-newsfeed-section.ts +17 -9
- package/templates/branded-lite/tier5-src/_shared/videos-section.ts +134 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +4 -2
- package/templates/community-club-owner/config.ts +7 -0
- package/templates/community-club-owner/dev/index.ts +567 -0
- package/templates/community-club-owner/himalaya.content.json +3 -0
- package/templates/community-club-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/community-club-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/community-club-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/community-club-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/events-meetups-owner/config.ts +7 -0
- package/templates/events-meetups-owner/dev/index.ts +567 -0
- package/templates/events-meetups-owner/himalaya.content.json +3 -0
- package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/gym-fitness-owner/config.ts +7 -0
- package/templates/gym-fitness-owner/dev/index.ts +567 -0
- package/templates/gym-fitness-owner/himalaya.content.json +3 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/nonprofit-cause-owner/config.ts +7 -0
- package/templates/nonprofit-cause-owner/dev/index.ts +567 -0
- package/templates/nonprofit-cause-owner/himalaya.content.json +3 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/owner-lite/config.ts +7 -0
- package/templates/owner-lite/dev/index.ts +567 -0
- package/templates/owner-lite/himalaya.content.json +3 -0
- package/templates/owner-lite/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/owner-lite/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/owner-lite/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/owner-lite/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/owner-lite/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +4 -2
- package/templates/podcast-creator-owner/config.ts +7 -0
- package/templates/podcast-creator-owner/dev/index.ts +567 -0
- package/templates/podcast-creator-owner/himalaya.content.json +3 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/portfolio-creative-owner/config.ts +7 -0
- package/templates/portfolio-creative-owner/dev/index.ts +567 -0
- package/templates/portfolio-creative-owner/himalaya.content.json +3 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/restaurant-owner/config.ts +7 -0
- package/templates/restaurant-owner/dev/index.ts +567 -0
- package/templates/restaurant-owner/himalaya.content.json +3 -0
- package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/retail-store-owner/config.ts +7 -0
- package/templates/retail-store-owner/dev/index.ts +567 -0
- package/templates/retail-store-owner/himalaya.content.json +3 -0
- package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
- package/templates/yoga-studio-owner/config.ts +7 -0
- package/templates/yoga-studio-owner/dev/index.ts +567 -0
- package/templates/yoga-studio-owner/himalaya.content.json +3 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/files/src/index.d.ts
CHANGED
|
@@ -41,13 +41,19 @@ export declare function stat(path: string): Promise<FileStat | null>;
|
|
|
41
41
|
* - `invalid_url` — not an absolute `https:` URL, carries userinfo, or names a
|
|
42
42
|
* loopback / private-network / link-local host (checked on every
|
|
43
43
|
* redirect hop; natively also on the resolved DNS records).
|
|
44
|
+
* - `invalid_quota_scope` — `quotaScope` normalizes to an empty path (the offending value is in `quotaScope`).
|
|
45
|
+
* - `outside_quota_scope` — the file `name` is not inside `quotaScope` (`path`, `quotaScope` are set).
|
|
44
46
|
* - `too_large` — the response is (or announces it will be) over `maxBytes`.
|
|
47
|
+
* - `quota_exceeded` — the download quota (2 GiB per app, or per `quotaScope`) leaves no room
|
|
48
|
+
* for a download of that cap.
|
|
49
|
+
* - `insufficient_storage` — the 1 GiB free-space floor would be breached by a download of that cap.
|
|
45
50
|
* - `http_error` — the server answered a non-2xx status (`status` is set).
|
|
46
51
|
* - `network` — the transfer failed (DNS, TLS, reset, CORS on web, …).
|
|
47
52
|
* - `unavailable` — this host cannot do it: no implementation for the verb, no save
|
|
48
|
-
* picker or volume reading to hand,
|
|
53
|
+
* picker or volume reading to hand, a file store that cannot report its
|
|
54
|
+
* size (so the quota cannot be enforced), or (`download`) the account signed
|
|
49
55
|
* out mid-transfer, so the file was not kept. */
|
|
50
|
-
export type FilesErrorCode = "invalid_url" | "too_large" | "http_error" | "network" | "unavailable";
|
|
56
|
+
export type FilesErrorCode = "invalid_url" | "invalid_quota_scope" | "outside_quota_scope" | "too_large" | "quota_exceeded" | "insufficient_storage" | "http_error" | "network" | "unavailable";
|
|
51
57
|
/** A v3 verb failure: an `Error` whose `code` is stable and `message` is for humans.
|
|
52
58
|
* (A plain Error with fields, not a subclass — worker bundles target a syntax level
|
|
53
59
|
* without `class`.) Narrow with {@link isFilesError}. */
|
|
@@ -64,6 +70,8 @@ export declare function isFilesError(e: unknown): e is FilesError;
|
|
|
64
70
|
export declare const DEFAULT_DOWNLOAD_MAX_BYTES: number;
|
|
65
71
|
/** The hard ceiling every arm clamps `maxBytes` to: 1 GiB. */
|
|
66
72
|
export declare const MAX_DOWNLOAD_BYTES: number;
|
|
73
|
+
/** The stored bytes one app (or one `quotaScope`) may hold once downloads count: 2 GiB. */
|
|
74
|
+
export declare const DOWNLOAD_QUOTA_BYTES: number;
|
|
67
75
|
/**
|
|
68
76
|
* Stream an `https:` URL straight into the sandbox and resolve with its FileHandle —
|
|
69
77
|
* the same shape `write` returns. The bytes never cross the worker bridge.
|
|
@@ -77,10 +85,23 @@ export declare const MAX_DOWNLOAD_BYTES: number;
|
|
|
77
85
|
* `path`); default `downloads/<last URL path segment>`. An existing file is replaced.
|
|
78
86
|
* - `maxBytes` defaults to 100 MiB (clamped to 1 GiB); over it the transfer is aborted (`too_large`) and
|
|
79
87
|
* nothing is left behind.
|
|
88
|
+
* - Quota: the transfer reserves its `maxBytes` up front and releases it when it ends. It is refused
|
|
89
|
+
* (`too_large`) when the bytes already stored, the bytes other in-flight downloads have reserved,
|
|
90
|
+
* and its own cap would exceed {@link DOWNLOAD_QUOTA_BYTES} (2 GiB) — so a smaller `maxBytes`
|
|
91
|
+
* fits where the 100 MiB default does not. It is also refused when the volume's free space
|
|
92
|
+
* after the download would fall below 1 GiB (web: judged from the browser's storage estimate,
|
|
93
|
+
* when it gives one).
|
|
94
|
+
* - `quotaScope` is a path prefix (e.g. `widgets/<folder>`) whose stored and reserved bytes are
|
|
95
|
+
* counted on their own, so each caller gets its own 2 GiB. `name` must lie inside it.
|
|
96
|
+
* - The file does not appear at `name` until the transfer completes.
|
|
97
|
+
* - `mimeType` of the stored handle comes from the response's `Content-Type` (else the file
|
|
98
|
+
* extension). `files.export`'s `mimeType` option is ignored on Apple (iOS/macOS): the type is
|
|
99
|
+
* taken from the file itself, as the share and save panels use it.
|
|
80
100
|
*/
|
|
81
101
|
export declare function download(url: string, opts?: {
|
|
82
102
|
name?: string;
|
|
83
103
|
maxBytes?: number;
|
|
104
|
+
quotaScope?: string;
|
|
84
105
|
}): Promise<FileHandle>;
|
|
85
106
|
/**
|
|
86
107
|
* Let the user save a sandbox file OUTSIDE the app through the OS save picker: the
|
|
@@ -66,10 +66,7 @@ export interface WixFeedItem {
|
|
|
66
66
|
imageUrl?: string;
|
|
67
67
|
} | string;
|
|
68
68
|
createdAt?: string;
|
|
69
|
-
permissions?:
|
|
70
|
-
canReact?: boolean;
|
|
71
|
-
canAddComment?: boolean;
|
|
72
|
-
};
|
|
69
|
+
permissions?: WixFeedItemPermissions;
|
|
73
70
|
}
|
|
74
71
|
/** Author directory returned alongside the v4 feed — resolves author.id → name/photo. */
|
|
75
72
|
export interface WixFeedProfile {
|
|
@@ -79,10 +76,22 @@ export interface WixFeedProfile {
|
|
|
79
76
|
url?: string;
|
|
80
77
|
} | string;
|
|
81
78
|
}
|
|
79
|
+
/** What the viewer may do to a post of the feed (verified live: a visitor reading a public group gets canReact and
|
|
80
|
+
* canAddComment false, canShare true). */
|
|
81
|
+
export interface WixFeedItemPermissions {
|
|
82
|
+
canReact?: boolean;
|
|
83
|
+
canAddComment?: boolean;
|
|
84
|
+
canShare?: boolean;
|
|
85
|
+
}
|
|
82
86
|
export interface WixListFeedItemsResponse {
|
|
83
87
|
feedItems: WixFeedItem[];
|
|
84
88
|
profiles?: WixFeedProfile[];
|
|
85
89
|
nextPageCursor?: string;
|
|
90
|
+
/** The viewer's permissions for this feed: `allFeedItemPermissions` for anyone's post, `ownFeedItemPermissions` for their own. */
|
|
91
|
+
permissions?: {
|
|
92
|
+
allFeedItemPermissions?: WixFeedItemPermissions;
|
|
93
|
+
ownFeedItemPermissions?: WixFeedItemPermissions;
|
|
94
|
+
};
|
|
86
95
|
}
|
|
87
96
|
/** Read controls shared by the source's single-group and central feeds. */
|
|
88
97
|
export interface WixFeedPageOptions extends WixCallOptions {
|
|
@@ -9,6 +9,9 @@ export declare function isVideoProcessing(video: WixVideo): boolean;
|
|
|
9
9
|
/** The 11-character YouTube id of a linked YouTube video, or "". The embed URL is
|
|
10
10
|
* treated as data: only the id is taken, never the URL itself. */
|
|
11
11
|
export declare function youtubeVideoId(video: WixVideo): string;
|
|
12
|
+
/** True when a Himi player can play the video: a hosted file (through `getVideoStreamUrl`) or a
|
|
13
|
+
* YouTube video with an id. Any other host (Vimeo, Facebook, live) has no player here. */
|
|
14
|
+
export declare function isPlayableVideo(video: WixVideo): boolean;
|
|
12
15
|
/**
|
|
13
16
|
* The video's card image, sized for display: the owner's cover, then the poster, then
|
|
14
17
|
* the media thumbnail, then (for a YouTube video) YouTube's own thumbnail. "" when there
|
|
@@ -71,7 +71,7 @@ function filesError(code, message, status) {
|
|
|
71
71
|
function isFilesError(e) {
|
|
72
72
|
return e instanceof Error && e.name === "FilesError" && typeof e.code === "string";
|
|
73
73
|
}
|
|
74
|
-
var ERROR_CODES = ["invalid_url", "too_large", "http_error", "network", "unavailable"];
|
|
74
|
+
var ERROR_CODES = ["invalid_url", "invalid_quota_scope", "outside_quota_scope", "too_large", "quota_exceeded", "insufficient_storage", "http_error", "network", "unavailable"];
|
|
75
75
|
function throwIfError(verb, r) {
|
|
76
76
|
const e = r?.error;
|
|
77
77
|
if (e == null) return;
|
|
@@ -82,10 +82,12 @@ function throwIfError(verb, r) {
|
|
|
82
82
|
}
|
|
83
83
|
var DEFAULT_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
|
|
84
84
|
var MAX_DOWNLOAD_BYTES = 1024 * 1024 * 1024;
|
|
85
|
+
var DOWNLOAD_QUOTA_BYTES = 2 * 1024 * 1024 * 1024;
|
|
85
86
|
async function download(url, opts) {
|
|
86
87
|
const params = { url };
|
|
87
88
|
if (opts?.name) params.name = opts.name;
|
|
88
89
|
if (typeof opts?.maxBytes === "number" && opts.maxBytes > 0) params.maxBytes = String(Math.floor(opts.maxBytes));
|
|
90
|
+
if (opts?.quotaScope) params.quotaScope = opts.quotaScope;
|
|
89
91
|
const r = await dispatch("capability.files.download", params);
|
|
90
92
|
throwIfError("download", r);
|
|
91
93
|
return toHandle(r, opts?.name ?? "download");
|
|
@@ -114,6 +116,7 @@ async function storageInfo() {
|
|
|
114
116
|
var version = 3;
|
|
115
117
|
export {
|
|
116
118
|
DEFAULT_DOWNLOAD_MAX_BYTES,
|
|
119
|
+
DOWNLOAD_QUOTA_BYTES,
|
|
117
120
|
MAX_DOWNLOAD_BYTES,
|
|
118
121
|
download,
|
|
119
122
|
exportFile as export,
|
|
@@ -369,7 +369,7 @@ function filesError(code, message, status2) {
|
|
|
369
369
|
function isFilesError(e) {
|
|
370
370
|
return e instanceof Error && e.name === "FilesError" && typeof e.code === "string";
|
|
371
371
|
}
|
|
372
|
-
var ERROR_CODES = ["invalid_url", "too_large", "http_error", "network", "unavailable"];
|
|
372
|
+
var ERROR_CODES = ["invalid_url", "invalid_quota_scope", "outside_quota_scope", "too_large", "quota_exceeded", "insufficient_storage", "http_error", "network", "unavailable"];
|
|
373
373
|
function throwIfError(verb, r) {
|
|
374
374
|
const e = r?.error;
|
|
375
375
|
if (e == null) return;
|
|
@@ -380,10 +380,12 @@ function throwIfError(verb, r) {
|
|
|
380
380
|
}
|
|
381
381
|
var DEFAULT_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
|
|
382
382
|
var MAX_DOWNLOAD_BYTES = 1024 * 1024 * 1024;
|
|
383
|
+
var DOWNLOAD_QUOTA_BYTES = 2 * 1024 * 1024 * 1024;
|
|
383
384
|
async function download(url, opts) {
|
|
384
385
|
const params = { url };
|
|
385
386
|
if (opts?.name) params.name = opts.name;
|
|
386
387
|
if (typeof opts?.maxBytes === "number" && opts.maxBytes > 0) params.maxBytes = String(Math.floor(opts.maxBytes));
|
|
388
|
+
if (opts?.quotaScope) params.quotaScope = opts.quotaScope;
|
|
387
389
|
const r = await dispatch("capability.files.download", params);
|
|
388
390
|
throwIfError("download", r);
|
|
389
391
|
return toHandle(r, opts?.name ?? "download");
|
|
@@ -100,6 +100,9 @@ function youtubeVideoId(video) {
|
|
|
100
100
|
const id = video.content?.externalId ?? "";
|
|
101
101
|
return /^[A-Za-z0-9_-]{11}$/.test(id) ? id : "";
|
|
102
102
|
}
|
|
103
|
+
function isPlayableVideo(video) {
|
|
104
|
+
return isHostedVideo(video) || video.source === "YOUTUBE" && youtubeVideoId(video) !== "";
|
|
105
|
+
}
|
|
103
106
|
function videoCoverUrl(video, size = WIX_LIST_IMAGE) {
|
|
104
107
|
for (const candidate of [video.cover?.selected, video.poster?.selected, video.content?.thumbnailUrl]) {
|
|
105
108
|
const url = wixMediaUrl(candidate, size);
|
|
@@ -319,6 +322,7 @@ export {
|
|
|
319
322
|
getVideoStreamUrl,
|
|
320
323
|
isHostedVideo,
|
|
321
324
|
isPaidVideo,
|
|
325
|
+
isPlayableVideo,
|
|
322
326
|
isVideoProcessing,
|
|
323
327
|
isVideoReady,
|
|
324
328
|
isWixVideoWebRefusal,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
4
|
"name": "sw.js",
|
|
5
|
-
"bytes":
|
|
5
|
+
"bytes": 2831117
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "host.html",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bytes": 24320
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"name": "preview-deferred/
|
|
24
|
+
"name": "preview-deferred/a8cfd0e17359578587e8937e88dedd40b46d533f08b4d2fdac4c47d5bae6f385.bin",
|
|
25
25
|
"bytes": 488215
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"deferred": [
|
|
81
81
|
{
|
|
82
|
-
"key": "assets/pdf-
|
|
82
|
+
"key": "assets/pdf-DvnPEsbL.js",
|
|
83
83
|
"contentType": "application/javascript; charset=utf-8",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"file": "preview-deferred/
|
|
84
|
+
"sha256": "a8cfd0e17359578587e8937e88dedd40b46d533f08b4d2fdac4c47d5bae6f385",
|
|
85
|
+
"file": "preview-deferred/a8cfd0e17359578587e8937e88dedd40b46d533f08b4d2fdac4c47d5bae6f385.bin"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "assets/pdf.worker.min-BGnVRhRG.js",
|