build: 📦️ Update packages
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
const loadLandbot = (): Promise<void> =>
|
||||
new Promise((resolve) => {
|
||||
const existingScript = document.getElementById('landbot-lib')
|
||||
if (!existingScript) {
|
||||
const script = document.createElement('script')
|
||||
script.src = 'https://static.landbot.io/landbot-3/landbot-3.0.0.js'
|
||||
script.id = 'landbot-lib'
|
||||
document.body.appendChild(script)
|
||||
script.onload = () => {
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
if (existingScript) resolve()
|
||||
})
|
||||
|
||||
export default loadLandbot
|
||||
@@ -1,62 +0,0 @@
|
||||
import { Client } from '@notionhq/client'
|
||||
|
||||
const notion = new Client({
|
||||
auth: process.env.NOTION_API_TOKEN,
|
||||
})
|
||||
|
||||
export const getDatabase = async (databaseId: string) => {
|
||||
const response = await notion.databases.query({
|
||||
database_id: databaseId,
|
||||
sorts: [
|
||||
{
|
||||
property: 'Created',
|
||||
direction: 'descending',
|
||||
},
|
||||
],
|
||||
filter: {
|
||||
property: 'Published',
|
||||
checkbox: {
|
||||
equals: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
return response.results
|
||||
}
|
||||
|
||||
export const getFullDatabase = async (databaseId: string) => {
|
||||
const response = await notion.databases.query({
|
||||
database_id: databaseId,
|
||||
sorts: [
|
||||
{
|
||||
property: 'Created',
|
||||
direction: 'descending',
|
||||
},
|
||||
],
|
||||
})
|
||||
return response.results
|
||||
}
|
||||
|
||||
export const getPage = async (databaseId: string, slug: string) => {
|
||||
const { results } = await notion.databases.query({
|
||||
database_id: databaseId,
|
||||
filter: {
|
||||
property: 'Slug',
|
||||
text: {
|
||||
equals: slug,
|
||||
},
|
||||
},
|
||||
})
|
||||
if (results.length === 0) return
|
||||
const page_id = results.pop()?.id
|
||||
if (!page_id) return
|
||||
const response = await notion.pages.retrieve({ page_id })
|
||||
return response
|
||||
}
|
||||
|
||||
export const getBlocks = async (blockId: string) => {
|
||||
const response = await notion.blocks.children.list({
|
||||
block_id: blockId,
|
||||
page_size: 50,
|
||||
})
|
||||
return response.results
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
const loadTypeform = (): Promise<void> =>
|
||||
new Promise((resolve) => {
|
||||
const existingScript = document.getElementById('typeform-lib')
|
||||
if (!existingScript) {
|
||||
const script = document.createElement('script')
|
||||
script.innerHTML = `(function() { var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id="typef_orm", b="https://embed.typeform.com/"; if(!gi.call(d,id)) { js=ce.call(d,"script"); js.id=id; js.src=b+"embed.js"; q=gt.call(d,"script")[0]; q.parentNode.insertBefore(js,q) } })()`
|
||||
script.id = 'typeform-lib'
|
||||
document.body.appendChild(script)
|
||||
resolve()
|
||||
}
|
||||
if (existingScript) resolve()
|
||||
})
|
||||
|
||||
export default loadTypeform
|
||||
Reference in New Issue
Block a user