// Ctrl+. to cache dependencies on imports hover, Ctrl+S to format.
type Hubspot = {
  token: string;
};
export async function main(
  auth: Hubspot,
  objectType: string,
  propertyName: string,
) {
  const res = await fetch(
    `https://api.hubapi.com/crm/v3/properties/${objectType}/${propertyName}?archived=false`,
    {
      headers: {
        Authorization: `Bearer ${auth.token}`,
        Accept: "application/json",
      },
      method: "GET",
    },
  );
  const jsonRes = await res.json();
  if (jsonRes.status == "error") {
    console.error(jsonRes);
    throw new Error(jsonRes.message);
  }
  return jsonRes;
}
Submitted by hugo697 177 days ago
// Ctrl+. to cache dependencies on imports hover, Ctrl+S to format.
type Hubspot = {
  token: string;
};
export async function main(
  auth: Hubspot,
  objectType: string,
  propertyName: string,
) {
  const res = await fetch(
    `https://api.hubapi.com/crm/v3/properties/${objectType}/${propertyName}?archived=false`,
    {
      headers: {
        Authorization: `Bearer ${auth.token}`,
        Accept: "application/json",
      },
      method: "GET",
    },
  );
  const jsonRes = await res.json();
  if (jsonRes.status == "error") {
    console.error(jsonRes);
    throw new Error(jsonRes.message);
  }
  return jsonRes;
}
Submitted by admin 810 days ago
// Ctrl+. to cache dependencies on imports hover, Ctrl+S to format.
type Hubspot = {
  token: string;
};
export async function main(
  auth: Hubspot,
  objectType: string,
  propertyName: string,
) {
  const res = await fetch(
    `https://api.hubapi.com/crm/v3/properties/${objectType}/${propertyName}?archived=false`,
    {
      headers: {
        Authorization: `Bearer ${auth.token}`,
        Accept: "application/json",
      },
      method: "GET",
    },
  );
  const jsonRes = await res.json();
  if (jsonRes.status == "error") {
    console.error(jsonRes);
    throw new Error(jsonRes.message);
  }
  return jsonRes;
}
Submitted by admin 813 days ago
// Ctrl+. to cache dependencies on imports hover, Ctrl+S to format.
import type { Resource } from "https://deno.land/x/windmill@v1.98.0/mod.ts"
export async function main(
  auth: wmill.Resource<"hubspot">,
  objectType: string,
  propertyName: string,
) {
  const res = await fetch(
    `https://api.hubapi.com/crm/v3/properties/${objectType}/${propertyName}?archived=false`,
    {
      headers: {
        Authorization: `Bearer ${auth.token}`,
        Accept: "application/json",
      },
      method: "GET",
    },
  );
  const jsonRes = await res.json();
  if (jsonRes.status == "error") {
    console.error(jsonRes);
    throw new Error(jsonRes.message);
  }
  return jsonRes;
}Submitted by sindre svendby964 905 days ago
// Ctrl+. to cache dependencies on imports hover, Ctrl+S to format.
import * as wmill from "https://deno.land/x/windmill@v1.98.0/mod.ts";
export async function main(
  auth: wmill.Resource<"hubspot">,
  objectType: string,
  propertyName: string,
) {
  const res = await fetch(
    `https://api.hubapi.com/crm/v3/properties/${objectType}/${propertyName}?archived=false`,
    {
      headers: {
        Authorization: `Bearer ${auth.token}`,
        Accept: "application/json",
      },
      method: "GET",
    },
  );
  const jsonRes = await res.json();
  if (jsonRes.status == "error") {
    console.error(jsonRes);
    throw new Error(jsonRes.message);
  }
  return jsonRes;
}
Submitted by sindre svendby964 905 days ago