Socket
Socket
Sign inDemoInstall

@wix/api-client

Package Overview
Dependencies
41
Maintainers
21
Versions
112
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.7 to 1.5.8

35

build/index.d.ts

@@ -34,4 +34,3 @@ import { Host, RESTFunctionDescriptor, BuildRESTFunction, HostModule, HostModuleAPI, AuthenticationStrategy, BoundAuthenticationStrategy } from '@wix/sdk-types';

};
type AmbassadorFactory<Request, Response> = {
(payload: Request): (context: RequestContext) => AmbassadorRequestOptions<Response>;
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
__isAmbassador: boolean;

@@ -154,11 +153,28 @@ };

width: number;
} | {
altText: string;
filename: string;
altText?: string;
filename?: string;
};
declare function getVideoUrl(val: string, resolution?: VideoResolution): {
id: string;
url: string;
height: number;
width: number;
thumbnail: string;
};
declare function getAudioUrl(val: string): {
id: string;
url: string;
duration: number;
name?: string;
};
declare function getDocumentUrl(val: string): {
id: string;
url: string;
name?: string;
};
declare function decodeText(s: string): string;
declare enum VideoResolution {
MOBILE = "360p",
LOW = "480p",
MID = "720p",
HIGH = "1080p"
}
declare const media: {

@@ -169,2 +185,5 @@ getCroppedImageUrl: typeof getCroppedImageUrl;

getImageUrl: typeof getImageUrl;
getVideoUrl: typeof getVideoUrl;
getAudioUrl: typeof getAudioUrl;
getDocumentUrl: typeof getDocumentUrl;
};

@@ -372,2 +391,2 @@

export { API_URL, AccessToken, ApiKeyStrategy, AssertHostMatches, BuildDescriptors, CalculateNextState, Descriptors, IApiKeyStrategy, IOAuthStrategy, LoginParams, LoginState, OAuthStrategy, OauthData, OauthPKCE, ProcessableState, RefreshToken, RegisterParams, StateMachine, Token, TokenResponse, TokenRole, Tokens, WixAppOAuthStrategy, WixClient, createClient, decodeText, getDefaultDomain, media };
export { API_URL, type AccessToken, ApiKeyStrategy, type AssertHostMatches, type BuildDescriptors, type CalculateNextState, type Descriptors, type IApiKeyStrategy, type IOAuthStrategy, type LoginParams, LoginState, OAuthStrategy, type OauthData, type OauthPKCE, type ProcessableState, type RefreshToken, type RegisterParams, type StateMachine, type Token, type TokenResponse, TokenRole, type Tokens, VideoResolution, WixAppOAuthStrategy, type WixClient, createClient, decodeText, getDefaultDomain, media };

@@ -39,2 +39,3 @@ "use strict";

TokenRole: () => TokenRole,
VideoResolution: () => VideoResolution,
WixAppOAuthStrategy: () => WixAppOAuthStrategy,

@@ -119,2 +120,9 @@ createClient: () => createClient,

});
var isAmbassadorModule = (module2) => {
if (module2.__isAmbassador) {
return true;
}
const fn = module2();
return Boolean(fn.__isAmbassador);
};

@@ -301,3 +309,3 @@ // src/common.ts

} else if (typeof modules === "function") {
const { module: module2, options } = modules.__isAmbassador ? {
const { module: module2, options } = isAmbassadorModule(modules) ? {
module: toHTTPModule(modules),

@@ -372,3 +380,9 @@ options: ambassadorModuleOptions()

var WIX_IMAGE = "image";
var WIX_VIDEO = "video";
var WIX_AUDIO = "audio";
var WIX_DOCUMENT = "document";
var WIX_IMAGE_URL = "https://static.wixstatic.com/media/";
var WIX_VIDEO_URL = "https://video.wixstatic.com/video/";
var WIX_AUDIO_URL = "https://static.wixstatic.com/mp3/";
var WIX_DOCUMENT_URL = "https://d945e594-8657-47e2-9cd9-e9033c3d8da0.usrfiles.com/ugd/";
function getScaledToFillImageUrl(wixMediaIdentifier, targetWidth, targetHeight, options) {

@@ -442,2 +456,61 @@ const img = getImageUrl(wixMediaIdentifier);

}
function getVideoUrl(val, resolution) {
let id, thumbnailId, thumbnailWidth, thumbnailHeight;
if (val.startsWith(WIX_VIDEO_URL)) {
id = val.split(WIX_VIDEO_URL).pop().split("/")[0];
thumbnailId = `${id}.jpg`;
thumbnailWidth = "50";
thumbnailHeight = "50";
} else {
const alignedVideo = alignIfLegacy(val, WIX_VIDEO);
const { pathname, hash } = new URL(alignedVideo);
const hashParams = new URLSearchParams(hash.replace("#", ""));
[id] = pathname.replace(`${WIX_VIDEO}://v1/`, "").split("/");
thumbnailId = hashParams.get("posterUri") || `${id}.jpg`;
thumbnailWidth = hashParams.get("posterWidth") || "50";
thumbnailHeight = hashParams.get("posterHeight") || "50";
}
return {
id,
url: `${WIX_VIDEO_URL}${id}/${resolution ? `${resolution}/mp4/file.mp4` : "file"}`,
thumbnail: `${WIX_PROTOCOL}${WIX_IMAGE}://v1/${thumbnailId}#originWidth=${thumbnailWidth}&originHeight=${thumbnailHeight}`
};
}
function getAudioUrl(val) {
const alignedAudio = alignIfLegacy(val, WIX_AUDIO);
const { pathname, hash } = new URL(alignedAudio);
const [id, filename] = pathname.replace(`${WIX_AUDIO}://v1/`, "").split("/");
const decodedFilename = decodeText(filename);
const hashParams = new URLSearchParams(hash.replace("#", ""));
const res = {
id,
duration: Number(hashParams.get("duration") || ""),
url: `${WIX_AUDIO_URL}${id}`
};
if (!decodedFilename) {
return res;
}
return {
...res,
name: decodedFilename
};
}
function getDocumentUrl(val) {
const valWithoutUGD = val.replace("v1/ugd", "v1");
const alignedDocument = alignIfLegacy(valWithoutUGD, WIX_DOCUMENT);
const { pathname } = new URL(alignedDocument);
const [id, filename] = pathname.replace(`${WIX_DOCUMENT}://v1/`, "").split("/");
const decodedFilename = decodeText(filename);
const res = {
id,
url: `${WIX_DOCUMENT_URL}${id}`
};
if (!decodedFilename) {
return res;
}
return {
...res,
name: decodedFilename
};
}
function decodeText(s) {

@@ -453,2 +526,9 @@ if (!s) {

}
var VideoResolution = /* @__PURE__ */ ((VideoResolution2) => {
VideoResolution2["MOBILE"] = "360p";
VideoResolution2["LOW"] = "480p";
VideoResolution2["MID"] = "720p";
VideoResolution2["HIGH"] = "1080p";
return VideoResolution2;
})(VideoResolution || {});
var media = {

@@ -458,3 +538,6 @@ getCroppedImageUrl,

getScaledToFitImageUrl,
getImageUrl
getImageUrl,
getVideoUrl,
getAudioUrl,
getDocumentUrl
};

@@ -1023,2 +1106,3 @@

TokenRole,
VideoResolution,
WixAppOAuthStrategy,

@@ -1025,0 +1109,0 @@ createClient,

{
"name": "@wix/api-client",
"version": "1.5.7",
"version": "1.5.8",
"license": "UNLICENSED",

@@ -23,14 +23,14 @@ "main": "build/index.js",

"dependencies": {
"@babel/runtime": "^7.23.2",
"@wix/identity": "^1.0.62",
"@wix/image-kit": "^1.40.0",
"@babel/runtime": "^7.23.5",
"@wix/identity": "^1.0.63",
"@wix/image-kit": "^1.42.0",
"@wix/redirects": "^1.0.28",
"@wix/sdk-types": "1.5.1",
"@wix/sdk-types": "1.5.2",
"pkce-challenge": "^3.1.0",
"querystring": "^0.2.1",
"type-fest": "^3.13.1"
"type-fest": "^4.8.3"
},
"devDependencies": {
"@wix/metro-runtime": "^1.1547.0",
"@wix/sdk": "1.5.7"
"@wix/metro-runtime": "^1.1556.0",
"@wix/sdk": "1.5.8"
},

@@ -48,3 +48,3 @@ "wix": {

},
"falconPackageHash": "f647f89b7d4809ae0d5c718502a6547bb1aff81ef83f1afa97072bee"
"falconPackageHash": "dc1f43c792f4a977cf8398a7496e89db92dea1005976b5069e650563"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc