Skip to content

Commit e7b12bb

Browse files
feat: add mhtmlUrl parameter for website importing (#66)
1 parent 7fb2061 commit e7b12bb

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

sdk-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@animaapp/anima-sdk-react",
3-
"version": "0.9.0",
3+
"version": "0.10.0",
44
"type": "module",
55
"description": "Anima's JavaScript utilities library",
66
"author": "Anima App, Inc.",

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@animaapp/anima-sdk",
3-
"version": "0.9.0",
3+
"version": "0.10.0",
44
"type": "module",
55
"description": "Anima's JavaScript utilities library",
66
"author": "Anima App, Inc.",

sdk/src/anima.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,13 @@ export class Anima {
425425
}
426426

427427
let input;
428-
if (params.mhtml) {
428+
if (params.mhtmlUrl) {
429+
input = {
430+
type: "hosted-mhtml",
431+
mhtmlUrl: params.mhtmlUrl,
432+
url: params.url,
433+
};
434+
} else if (params.mhtml) {
429435
input = {
430436
type: "mhtml",
431437
mhtml: params.mhtml,
@@ -437,7 +443,7 @@ export class Anima {
437443
url: params.url,
438444
};
439445
} else {
440-
throw new Error("Either 'url' or 'mhtml' must be provided");
446+
throw new Error("Either 'url', 'mhtml' or 'mhtmlUrl' must be provided");
441447
}
442448

443449
let engine: "react-v2" | undefined = undefined;

sdk/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export type GeneratingCodePayload = {
9999
export type GetCodeFromWebsiteParams = {
100100
url?: string;
101101
mhtml?: string;
102+
mhtmlUrl?: string;
102103

103104
assetsStorage?: AssetsStorage;
104105
settings: GetCodeFromWebsiteSettings;

0 commit comments

Comments
 (0)