This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "scripts", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs' | |
async function init() { | |
let token = '' | |
const size = 1000 | |
const schema = '' | |
const allDocuments = [] | |
const accountName = '' | |
const fields = ['_all'].join(',') | |
const entity = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getEntityNameAndSchemaOfMDV2({ | |
appName, | |
vendor, | |
entity, | |
version, | |
workspace = '', | |
}) { | |
return { | |
entityName: `${vendor}_${appName}_${entity}`.replace(/(\.)|-|:|@/gi, "_"), | |
schema: [version, workspace].filter(Boolean).join('-'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function deleteAll(entity) { | |
const sleep = (ms) => { | |
return new Promise((resolve) => { | |
setTimeout(resolve, ms) | |
}) | |
} | |
while (true) { | |
const randomNumber = Math.ceil(Math.random() * 100000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable @typescript-eslint/explicit-member-accessibility */ | |
/* eslint-disable import/order */ | |
// Dependencies | |
import React from 'react' | |
type OrderForm = any | |
interface StateProviderState { | |
orderForm: OrderForm | null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Depedencies | |
import React from 'react' | |
import { createPortal } from 'react-dom' | |
// Components | |
import ErrorBoundary from './ErrorBoundary' | |
interface SafePortalProps { | |
rootSelector: string | |
applyCleanup?: boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies | |
import Cookies from 'js-cookie' | |
// TODO: improve this typing | |
declare global { | |
interface Window { | |
vtexjs: { | |
checkout: { | |
orderForm: any; | |
getOrderForm: () => Promise<any>; |