import { Client } from "npm:@hubspot/api-client@^8.1.0";
type Hubspot = {
token: string;
};
export async function main(
auth: Hubspot,
file_id: string,
size?: "" | "thumb" | "icon" | "medium" | "preview",
expiration_seconds?: number,
upscale?: boolean,
) {
const client = new Client({
accessToken: auth.token,
});
try {
return await client.files.filesApi.getSignedUrl(
file_id,
size || undefined,
expiration_seconds || undefined,
upscale || undefined,
);
} catch (e) {
throw Error(`
${e.code}\n
Message: ${e.body.message || e.body}\n
`);
}
}
Submitted by admin 497 days ago
import { Client } from "npm:@hubspot/api-client@^8.1.0"
type Hubspot = {
token: string;
};
export async function main(
auth: Hubspot,
file_id: string,
size?: "" | "thumb" | "icon" | "medium" | "preview",
expiration_seconds?: number,
upscale?: boolean
) {
const client = new Client({
accessToken: auth.token
})
try {
return await client.files.filesApi.getSignedUrl(
file_id,
size || undefined,
expiration_seconds || undefined,
upscale || undefined,
)
} catch (e) {
throw Error(`
${e.code}\n
Message: ${e.body.message || e.body}\n
`)
}
}
Submitted by admin 500 days ago
import * as wmill from "https://deno.land/x/windmill@v1.85.0/mod.ts"
import { Client } from "npm:@hubspot/api-client@^8.1.0"
export async function main(
auth: wmill.Resource<"hubspot">,
file_id: string,
size?: "" | "thumb" | "icon" | "medium" | "preview",
expiration_seconds?: number,
upscale?: boolean
) {
const client = new Client({
accessToken: auth.token
})
try {
return await client.files.filesApi.getSignedUrl(
file_id,
size || undefined,
expiration_seconds || undefined,
upscale || undefined,
)
} catch (e) {
throw Error(`
${e.code}\n
Message: ${e.body.message || e.body}\n
`)
}
}
Submitted by adam186 628 days ago
import * as wmill from "https://deno.land/x/windmill@v1.70.1/mod.ts"
import { Client } from "npm:@hubspot/api-client@^8.1.0"
export async function main(
auth: wmill.Resource<"hubspot">,
file_id: string,
size?: "" | "thumb" | "icon" | "medium" | "preview",
expiration_seconds?: number,
upscale?: boolean
) {
const client = new Client({
accessToken: auth.token
})
try {
return await client.files.filesApi.getSignedUrl(
file_id,
size || undefined,
expiration_seconds || undefined,
upscale || undefined,
)
} catch (e) {
throw Error(`
${e.code}\n
Message: ${e.body.message || e.body}\n
`)
}
}
Submitted by adam186 663 days ago
import * as wmill from "https://deno.land/x/windmill@v1.52.0/mod.ts"
import { Client } from "npm:@hubspot/api-client@^8.1.0"
export async function main(
auth: wmill.Resource<"hubspot">,
file_id: string,
size?: "" | "thumb" | "icon" | "medium" | "preview",
expiration_seconds?: number,
upscale?: boolean
) {
const client = new Client({
accessToken: auth.token
})
try {
return await client.files.filesApi.getSignedUrl(
file_id,
size || undefined,
expiration_seconds || undefined,
upscale || undefined,
)
} catch (e) {
throw Error(`
${e.code}\n
Message: ${e.body.message || e.body}\n
`)
}
}
Submitted by adam186 747 days ago