max_stars_repo_path
stringlengths
4
384
max_stars_repo_name
stringlengths
5
120
max_stars_count
int64
0
208k
id
stringlengths
1
8
content
stringlengths
1
1.05M
score
float64
-1.05
3.83
int_score
int64
0
4
cypress/support/base.component.ts
frederikprijck/ngx-bootstrap
0
0
import { AttrObj } from './interfaces'; export abstract class BaseComponent { titleSel = 'h1'; titleLinkSel = '.content-header a'; usageExSel = 'demo-top-section h2'; usageExCodeSel = 'demo-top-section .prettyprint'; abstract pageUrl: string; titleDefaultExample = 'Usage'; navigateTo() { const bsVersionRoute = Cypress.env('bsVersion') ? `?_bsVersion=bs${Cypress.env('bsVersion')}` : ''; cy.visit(`${ this.pageUrl }${bsVersionRoute}`); } scrollToMenu(subMenu: string) { cy.get('examples h3').contains(subMenu).scrollIntoView(); } clickOnDemoMenu(subMenu: string) { cy.get('add-nav').contains('a', subMenu).click(); } clickByText(parent: string, text: string) { cy.get(parent).contains(text).click(); } dblClickByText(parent: string, text: string) { cy.get(parent).contains(text).dblclick(); } isBtnTxtEqual(baseSelector: string, expectedBtnTxt: string, buttonIndex?: number) { cy.get(`${ baseSelector } button`).eq(buttonIndex ? buttonIndex : 0).invoke('text') .should(btnTxt => expect(btnTxt).to.equal(expectedBtnTxt)); } isLabelTxtEqual(baseSelector: string, expectedLabelTxt: string, labelIndex?: number) { cy.get(`${baseSelector} label`).eq(labelIndex ? labelIndex : 0).invoke('text') .should(labelTxt => expect(labelTxt).to.equal(expectedLabelTxt)); } clickOnBtn(baseSelector: string, buttonIndex?: number) { cy.get(`${ baseSelector } button`).eq(buttonIndex ? buttonIndex : 0).click(); } dblClickOnBtn(baseSelector: string, buttonIndex?: number) { cy.get(`${ baseSelector } button`).eq(buttonIndex ? buttonIndex : 0).dblclick(); } clickOnInput(baseSelector: string, inputIndex?: number) { cy.get(`${ baseSelector } input`).eq(inputIndex ? inputIndex : 0).click(); } dblClickOnInput(baseSelector: string, inputIndex?: number) { cy.get(`${ baseSelector } input`).eq(inputIndex ? inputIndex : 0).dblclick(); } hoverOnBtn(baseSelector: string, buttonIndex?: number) { cy.get(`${baseSelector} button`).eq(buttonIndex ? buttonIndex : 0).trigger('mouseenter'); } mouseLeave(baseSelector: string, buttonIndex?: number) { cy.get(`${baseSelector} button`).eq(buttonIndex ? buttonIndex : 0).trigger('mouseleave'); } isInputHaveAttrs(baseSelector: string, attributes: AttrObj[], inputIndex = 0) { cy.get(`${baseSelector} input`).eq(inputIndex) .then(input => { let i = 0; for (; i < attributes.length; i++) { expect(input).to.have.attr(attributes[i].attr, attributes[i].value); } }); } isInputValueEqual(baseSelector: string, expectedTxt: string, inputIndex = 0) { cy.get(`${baseSelector} input`).eq(inputIndex).should('to.have.value', expectedTxt); } isInputValueContain(baseSelector: string, expectedTxt: string, inputIndex = 0) { cy.get(`${baseSelector} input`).eq(inputIndex).then(input => { expect(input.val()).to.contains(expectedTxt); }); } clearInputAndSendKeys(baseSelector: string, dataToSend: string, inputIndex = 0) { cy.get(`${baseSelector} input`).eq(inputIndex).clear().type(dataToSend); } clickEnterOnInput(baseSelector: string, inputIndex = 0) { cy.get(`${baseSelector} input`).eq(inputIndex).type('{enter}'); } isDemoContainsTxt(baseSelector: string, expectedTxt: string, expectedTxtOther?: string) { cy.get(`${baseSelector}`).invoke('text') .should(blockTxt => { expect(blockTxt).to.contains(expectedTxt); expect(blockTxt).to.contains(expectedTxtOther ? expectedTxtOther : expectedTxt); }); } isButtonExist(baseSelector: string, buttonName: string, buttonNumber?: number) { cy.get(`${baseSelector} button`).eq(buttonNumber ? buttonNumber : 0).invoke('text') .should(btnTxt => expect(btnTxt).to.equal(buttonName)); } isSelectExist(baseSelector: string, selectText: string, selectNumber = 0) { cy.get(`${baseSelector} select`).eq(selectNumber).invoke('text') .should(btnTxt => expect(btnTxt).to.contain(selectText)); } selectOne(baseSelector: string, selectToChose: string, selectNumber = 0) { cy.get(`${baseSelector} select`).eq(selectNumber).select(selectToChose); } isPreviewExist(baseSelector: string, previewText: string, previewNumber?: number) { cy.get(`${baseSelector} .card.card-block`).eq(previewNumber ? previewNumber : 0).invoke('text') .should(btnTxt => expect(btnTxt).to.contain(previewText)); } isCodePreviewExist(baseSelector: string, previewText: string, exist = true, previewNumber?: number) { if (exist) { cy.get(`${baseSelector} .code-preview`).eq(previewNumber ? previewNumber : 0).invoke('text') .should(btnTxt => expect(btnTxt).to.contain(previewText)); } else { cy.get(`${baseSelector} .code-preview`) .should('not.exist'); } } isComponentSrcContain(demoName: string, expectedTxt: string) { cy.get('examples h3') .contains(demoName) .parent() .find('tab[heading*="component"]') .invoke('text') .should('to.contains', expectedTxt); } }
1.453125
1
src/views/FarmAuction/components/PlaceBidModal.tsx
Allswap/allswap-farm
14
8
import React, { useState, useEffect } from 'react' import styled from 'styled-components' import BigNumber from 'bignumber.js' import { ethers } from 'ethers' import { Modal, Text, Flex, BalanceInput, Box, Button, PancakeRoundIcon } from '@pancakeswap/uikit' import { useTranslation } from 'contexts/Localization' import { useWeb3React } from '@web3-react/core' import { formatNumber, getBalanceAmount, getBalanceNumber } from 'utils/formatBalance' import { ethersToBigNumber } from 'utils/bigNumber' import useTheme from 'hooks/useTheme' import useTokenBalance, { FetchStatus } from 'hooks/useTokenBalance' import useApproveConfirmTransaction from 'hooks/useApproveConfirmTransaction' import { useCake, useFarmAuctionContract } from 'hooks/useContract' import { DEFAULT_TOKEN_DECIMAL } from 'config' import useToast from 'hooks/useToast' import ConnectWalletButton from 'components/ConnectWalletButton' import ApproveConfirmButtons, { ButtonArrangement } from 'components/ApproveConfirmButtons' import { ConnectedBidder } from 'config/constants/types' import { usePriceCakeBusd } from 'state/farms/hooks' import { useCallWithGasPrice } from 'hooks/useCallWithGasPrice' import { ToastDescriptionWithTx } from 'components/Toast' import tokens from 'config/constants/tokens' const StyledModal = styled(Modal)` min-width: 280px; max-width: 320px; & > div:nth-child(2) { padding: 0; } ` const ExistingInfo = styled(Box)` padding: 24px; background-color: ${({ theme }) => theme.colors.dropdown}; ` const InnerContent = styled(Box)` padding: 24px; ` interface PlaceBidModalProps { onDismiss?: () => void // undefined initialBidAmount is passed only if auction is not loaded // in this case modal will not be possible to open initialBidAmount?: number connectedBidder: ConnectedBidder refreshBidders: () => void } const PlaceBidModal: React.FC<PlaceBidModalProps> = ({ onDismiss, initialBidAmount, connectedBidder, refreshBidders, }) => { const { account } = useWeb3React() const { t } = useTranslation() const { theme } = useTheme() const { callWithGasPrice } = useCallWithGasPrice() const [bid, setBid] = useState('') const [isMultipleOfTen, setIsMultipleOfTen] = useState(false) const [isMoreThanInitialBidAmount, setIsMoreThanInitialBidAmount] = useState(false) const [userNotEnoughCake, setUserNotEnoughCake] = useState(false) const [errorText, setErrorText] = useState(null) const { balance: userCake, fetchStatus } = useTokenBalance(tokens.cake.address) const userCakeBalance = getBalanceAmount(userCake) const cakePriceBusd = usePriceCakeBusd() const farmAuctionContract = useFarmAuctionContract() const cakeContract = useCake() const { toastSuccess } = useToast() const { bidderData } = connectedBidder const { amount, position } = bidderData const isFirstBid = amount.isZero() const isInvalidFirstBid = isFirstBid && !isMoreThanInitialBidAmount useEffect(() => { setIsMoreThanInitialBidAmount(parseFloat(bid) >= initialBidAmount) setIsMultipleOfTen(parseFloat(bid) % 10 === 0 && parseFloat(bid) !== 0) if (fetchStatus === FetchStatus.SUCCESS && userCakeBalance.lt(bid)) { setUserNotEnoughCake(true) } else { setUserNotEnoughCake(false) } }, [bid, initialBidAmount, fetchStatus, userCakeBalance]) useEffect(() => { if (userNotEnoughCake) { setErrorText(t('Insufficient CAKE balance')) } else if (!isMoreThanInitialBidAmount && isFirstBid) { setErrorText(t('First bid must be %initialBidAmount% CAKE or more.', { initialBidAmount })) } else if (!isMultipleOfTen) { setErrorText(t('Bid must be a multiple of 10')) } else { setErrorText(null) } }, [isMultipleOfTen, isMoreThanInitialBidAmount, userNotEnoughCake, initialBidAmount, t, isFirstBid]) const { isApproving, isApproved, isConfirmed, isConfirming, handleApprove, handleConfirm } = useApproveConfirmTransaction({ onRequiresApproval: async () => { try { const response = await cakeContract.allowance(account, farmAuctionContract.address) const currentAllowance = ethersToBigNumber(response) return currentAllowance.gt(0) } catch (error) { return false } }, onApprove: () => { return callWithGasPrice(cakeContract, 'approve', [farmAuctionContract.address, ethers.constants.MaxUint256]) }, onApproveSuccess: async ({ receipt }) => { toastSuccess( t('Contract approved - you can now place your bid!'), <ToastDescriptionWithTx txHash={receipt.transactionHash} />, ) }, onConfirm: () => { const bidAmount = new BigNumber(bid).times(DEFAULT_TOKEN_DECIMAL).toString() return callWithGasPrice(farmAuctionContract, 'bid', [bidAmount]) }, onSuccess: async ({ receipt }) => { refreshBidders() onDismiss() toastSuccess(t('Bid placed!'), <ToastDescriptionWithTx txHash={receipt.transactionHash} />) }, }) const handleInputChange = (input: string) => { setBid(input) } const setPercentageValue = (percentage: number) => { const rounding = percentage === 1 ? BigNumber.ROUND_FLOOR : BigNumber.ROUND_CEIL const valueToSet = getBalanceAmount(userCake.times(percentage)).div(10).integerValue(rounding).times(10) setBid(valueToSet.toString()) } return ( <StyledModal title={t('Place a Bid')} onDismiss={onDismiss} headerBackground={theme.colors.gradients.cardHeader}> <ExistingInfo> <Flex justifyContent="space-between"> <Text>{t('Your existing bid')}</Text> <Text>{t('%num% CAKE', { num: getBalanceNumber(amount).toLocaleString() })}</Text> </Flex> <Flex justifyContent="space-between"> <Text>{t('Your position')}</Text> <Text>{position ? `#${position}` : '-'}</Text> </Flex> </ExistingInfo> <InnerContent> <Flex justifyContent="space-between" alignItems="center" pb="8px"> <Text>{t('Bid a multiple of 10')}</Text> <Flex> <PancakeRoundIcon width="24px" height="24px" mr="4px" /> <Text bold>CAKE</Text> </Flex> </Flex> {isFirstBid && ( <Text pb="8px" small> {t('First bid must be %initialBidAmount% CAKE or more.', { initialBidAmount })} </Text> )} <BalanceInput isWarning={!isMultipleOfTen || isInvalidFirstBid} placeholder="0" value={bid} onUserInput={handleInputChange} currencyValue={ cakePriceBusd.gt(0) && `~${bid ? cakePriceBusd.times(new BigNumber(bid)).toNumber().toLocaleString() : '0.00'} USD` } /> <Flex justifyContent="flex-end" mt="8px"> <Text fontSize="12px" color="textSubtle" mr="8px"> {t('Balance')}: </Text> <Text fontSize="12px" color="textSubtle"> {formatNumber(userCakeBalance.toNumber(), 3, 3)} </Text> </Flex> {errorText && ( <Text color="failure" textAlign="right" fontSize="12px"> {errorText} </Text> )} <Flex justifyContent="space-between" mt="8px" mb="24px"> <Button disabled={fetchStatus !== FetchStatus.SUCCESS} scale="xs" mx="2px" p="4px 16px" variant="tertiary" onClick={() => setPercentageValue(0.25)} > 25% </Button> <Button disabled={fetchStatus !== FetchStatus.SUCCESS} scale="xs" mx="2px" p="4px 16px" variant="tertiary" onClick={() => setPercentageValue(0.5)} > 50% </Button> <Button disabled={fetchStatus !== FetchStatus.SUCCESS} scale="xs" mx="2px" p="4px 16px" variant="tertiary" onClick={() => setPercentageValue(0.75)} > 75% </Button> <Button disabled={fetchStatus !== FetchStatus.SUCCESS} scale="xs" mx="2px" p="4px 16px" variant="tertiary" onClick={() => setPercentageValue(1)} > MAX </Button> </Flex> <Flex flexDirection="column"> {account ? ( <ApproveConfirmButtons isApproveDisabled={isApproved} isApproving={isApproving} isConfirmDisabled={ !isMultipleOfTen || getBalanceAmount(userCake).lt(bid) || isConfirmed || isInvalidFirstBid || userNotEnoughCake } isConfirming={isConfirming} onApprove={handleApprove} onConfirm={handleConfirm} buttonArrangement={ButtonArrangement.SEQUENTIAL} /> ) : ( <ConnectWalletButton /> )} </Flex> <Text color="textSubtle" small mt="24px"> {t('If your bid is unsuccessful, you’ll be able to reclaim your CAKE after the auction.')} </Text> </InnerContent> </StyledModal> ) } export default PlaceBidModal
1.570313
2
scripts/publish/publish.ts
userlea/BatchExplorer
111
16
import { exec } from "child_process"; import "colors"; import * as fs from "fs"; import * as path from "path"; import { ask } from "yesno"; import { createIssue, createPullRequest, getMilestone, githubToken, listMilestoneIssues, listPullRequests, } from "./github-api"; const MAIN_BRANCH = "master"; const root = path.resolve(path.join(__dirname, "../..")); const allMessages: string[] = []; const repoName = "Azure/BatchExplorer"; const newIssueBody = ` - [x] Update version in package.json - [x] Update changelog - [x] Update third party notices if needed - [ ] Double check the prod build is working`; function log(text: string) { allMessages.push(text); // eslint-disable no-console console.log(text); } function failure(message: string) { log(`✘ ${message}`.red); } function success(message: string) { log(`✔ ${message}`.green); } async function run(command: string): Promise<{ stdout: string, stderr: string }> { return new Promise<{ stdout: string, stderr: string }>((resolve, reject) => { exec(command, { maxBuffer: 100_000_000 }, (error, stdout, stderr) => { if (error) { reject(error); return; } resolve({ stdout, stderr }); }); }); } function checkGithubToken() { if (!githubToken) { failure("GH_TOKEN environment variable is not set." + "Please create a new env var with a github token to use the github api"); } else { success("GH_TOKEN has a github token"); } } /** * This goes back to master and pull */ async function gotoMainBranch() { await run(`git checkout ${MAIN_BRANCH}`); await run("git pull"); success(`Checkout to ${MAIN_BRANCH} branch and pulled latest`); } async function loadMilestone(milestoneId: number) { return getMilestone(repoName, milestoneId); } async function getCurrentBranch(): Promise<string> { const { stdout } = await run(`git symbolic-ref --short -q HEAD`); return stdout.trim(); } function getMilestoneId() { if (process.argv.length < 3) { throw new Error("No milestone id was provided."); } return parseInt(process.argv[2], 10); } async function confirmVersion(version: string) { return new Promise((resolve, reject) => { ask(`Up program to be version ${version} (From milestone title) [Y/n]`, true, (ok) => { if (ok) { success(`A new release for version ${version} will be prepared`); resolve(null); } else { reject(new Error("milestone version wasn't confirmed. Please change milestone title")); } }); }); } function calcNextVersion(version: string) { const match = /^(\d+\.)(\d+)(\.\d+)$/.exec(version); return `${match[1]}${parseInt(match[2], 10) + 1}${match[3]}`; } function getPreparationBranchName(version: string) { return `release/prepare-${version}`; } async function switchToNewBranch(branchName: string) { await run(`git checkout -B ${branchName}`); success(`Created a new branch ${branchName}`); } async function bumpVersion(version) { const currentBranch = await getCurrentBranch(); const nextVersion = calcNextVersion(version); const bumpBranch = `release/bump-${nextVersion}`; await gotoMainBranch(); await run (`git branch --set-upstream-to=origin/${bumpBranch} ${bumpBranch}`); await switchToNewBranch(bumpBranch); await run(`npm version --no-git-tag-version --allow-same-version ${nextVersion}`); await run(`git commit -am "Bump version to ${nextVersion}"`); await run(`git push origin ${bumpBranch}`); await run(`git checkout "${currentBranch}"`); success(`Updated version in package.json to ${nextVersion} (branch: ${bumpBranch})`); } async function updateChangeLog(version, milestoneId) { const { stdout } = await run(`gh-changelog-gen --repo ${repoName} ${milestoneId} --formatter markdown`); const changelogFile = path.join(root, "CHANGELOG.md"); const changelogContent = fs.readFileSync(changelogFile); if (changelogContent.indexOf(`## ${version}`) === -1) { fs.writeFileSync(changelogFile, `${stdout}\n${changelogContent}`); success("Added changes to the changelog"); } else { success("Changelog already contains the changes for this version"); } } async function updateThirdParty() { await run(`npm run -s ts scripts/lca/generate-third-party`); success("Updated ThirdPartyNotices.txt"); } async function commitChanges() { await run(`git commit --allow-empty -am "Updated changelog and version."`); } async function push(branchName: string) { await run(`git push --set-upstream origin ${branchName}`); } async function createIssueIfNot(milestoneId, version) { const title = `Prepare for release of version ${version}`; const issues = await listMilestoneIssues(repoName, milestoneId); let issue = issues.filter(x => x.title === title)[0]; if (issue) { success(`Issue was already created earlier ${issue.html_url}`); } else { issue = await createIssue(repoName, title, newIssueBody, milestoneId); success(`Created a new issue ${issue.html_url}`); } return issue; } async function createPullrequestIfNot(version, releaseBranch, issue) { const title = `Prepare for release ${version}`; const body = `fix #${issue.number}`; const prs = await listPullRequests(repoName, releaseBranch); let pr = prs[0]; if (pr) { success(`There is already a pr created ${pr.html_url}`); } else { pr = await createPullRequest(repoName, title, body, releaseBranch); success(`Create a new pull request ${pr.html_url}`); } return pr; } async function buildApp() { // eslint-disable no-console console.log("Building the app with npm run build-and-pack..."); await run("npm run build-and-pack"); success("Build the app successfully. Starting it now, double check it is working correctly"); await run(path.join(root, "release/win-unpacked/BatchExplorer.exe")); } async function startPublish() { checkGithubToken(); const milestoneId = getMilestoneId(); const milestone = await loadMilestone(milestoneId); if (!milestone.title && milestone["message"]) { throw new Error(`Error fetching milestone: ${milestone["message"]}`); } const version = milestone.title; await confirmVersion(version); const releaseBranch = getPreparationBranchName(version); const branch = await getCurrentBranch(); if (branch !== releaseBranch) { await gotoMainBranch(); await switchToNewBranch(releaseBranch); } await updateChangeLog(version, milestoneId); await updateThirdParty(); await commitChanges(); await push(releaseBranch); const issue = await createIssueIfNot(milestoneId, version); await createPullrequestIfNot(version, releaseBranch, issue); await buildApp(); await bumpVersion(version); } startPublish().then(() => { success("First step of publishing is completed. Now wait for the pull request to complete."); process.exit(0); }).catch((error) => { failure(error.message); process.exit(1); });
1.359375
1
node_modules/simple-statistics/src/sum_simple.d.ts
lsabella/baishu-admin
1
24
/** * https://simplestatistics.org/docs/#sumsimple */ declare function sumSimple( x: number[] ): number export default sumSimple;
0.613281
1
client/src/views/Users/index.tsx
JeanMarcoMiranda/op-mini
0
32
import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { useSelector, useDispatch } from 'react-redux'; import { setModalData, setNotificationData, setToastData } from '../../store/action/actions'; // My components import { ButtonComponent as Button, TableComponent as Table, } from '../../components/common'; import { RootState } from '../../store/store'; import { renderActiveChip, renderIconActions, toHoverStyle } from '../../components/utils'; interface IModalUInfo { name?: string, documentType?: string, documentNumber?: number, } const tableFieldData = [ { text: 'Nombre', width: 2, name: 'name' }, { text: 'Rol', width: 2, name: 'role' }, { text: 'Telefono', width: 1, name: 'phone' }, { text: 'Correo', width: 2, name: 'email' }, { text: 'Direccion', width: 2, name: 'currentAddress' }, { text: 'Estado', width: 1, name: 'active' }, { text: 'Acciones', width: 2, name: 'actions' }, ]; const tableNotification = [ { text: 'Nombre'}, { text: 'Tipo de documento'}, { text: 'Numero de documento'}, ]; const UserView: React.FC = () => { const dispatch = useDispatch() const [userData, setUserData] = useState<IUser[]>([]); const [tableData, setTableData] = useState<IUserTableData[]>([]); const { access_token, userData: userDataT } = useSelector<RootState, RootState['user']>( (state) => state.user, ); const url: RequestInfo = 'http://localhost:8000/users'; useEffect(() => { getUserData(); //eslint-disable-next-line }, []); useEffect(() => { if (userData.length === 0) return; const prepareTableData = () => { let { name: role } = userDataT.role let showActions = { edit: false, delete: false } if (role === "Administrador") { showActions = { edit: true, delete: true } } let newTableData: IUserTableData[] = userData.map( ({ _id, name, isActive, phone, email, currentAddress, role, }: IUser) => { let newData: IUserTableData = { _id, name, role: role.name, phone, email, currentAddress, active: renderActiveChip(isActive), actions: renderIconActions(_id, 'user', showAlert, showActions), }; return newData; }, ); setTableData(newTableData); }; prepareTableData(); // eslint-disable-next-line }, [userData]); const getDataNotification = async (id: string) => { const urlReq: RequestInfo = url + `/${id}`; const res = await fetch(urlReq); const { name, documentType, documentNumber, }: IModalUInfo = await res.json(); const data = {name,documentType,documentNumber}; dispatch(setNotificationData({ isOpen: true, setisOpen: (prev => !prev), title: 'Notificacion del usuario', theadData: tableNotification, tbodyData: data })) }; const getUserData = async () => { const requestInit: RequestInit = { method: 'GET', headers: { Authorization: `Bearer ${access_token}`, 'Content-Type': 'application/json', }, }; const res = await fetch(url, requestInit); const data = await res.json(); setUserData(data); }; const deleteUser = async (idUser: string) => { const urlDelete: RequestInfo = url + '/' + idUser; const requestInit: RequestInit = { method: 'DELETE', headers: { Authorization: `Bearer ${access_token}`, 'Content-Type': 'application/json', }, }; const res = await fetch(urlDelete, requestInit); const data = await res.json(); console.log('User Deleted', data); getUserData(); dispatch(setModalData({setisOpen: (prev => !prev)})) showAlert('toast') }; const showAlert = (type: string, id?: string) => { if (type === 'toast') { dispatch(setToastData({ isOpen: true, setisOpen: (prev => !prev), contentText: 'El usuario ha sido eliminado con exito.', color: 'success', delay: 5 })) } else if (type === 'notifi') { getDataNotification(id!) } else { dispatch(setModalData({ isOpen: true, setisOpen: (prev => !prev), title: '¿Esta seguro que desea eliminar el elemento?', contentText: 'El elemento seleccionado sera eliminado de la base de datos', cancelButton: true, typeButton: 'Si, Eliminalo', colorTYB: 'danger', onClickTYB: () => deleteUser(id!) })) } } return ( <> <div className="container mx-auto"> <div className="w-full lg:w-10/12 px-4 py-4 mx-auto"> <div className="relative flex flex-col min-w-0 break-words w-full mb-6 shadow-lg rounded-lg bg-gray-100 border-0"> <div className="rounded-lg bg-white mb-0 px-6 py-3"> <div className="text-center flex justify-between"> <h6 className="text-gray-500 text-2xl font-semibold tracking-normal">Usuarios</h6> { userDataT.role.name === "Administrador" && <Link to={`/user/form`}> <Button label="Agregar" textColor="white" bgColor="bg-gradient-to-r from-green-400 to-green-500" onHoverStyles={toHoverStyle('bg-gradient-to-r from-green-500 to-green-600')} /> </Link> } </div> </div> <div className="my-3"> <Table theadData={tableFieldData} tbodyData={tableData} /> </div> </div> </div> </div> </> ); }; export default UserView;
1.679688
2
src/models/Rewards_dummy.ts
TeamB-um/B-umServer
6
40
import mongoose from "mongoose"; import { IRewards } from "../interfaces/IRewards"; const RewardDummySchema = new mongoose.Schema({ sentence: { type: String, required: true, }, context: { type: String, required: true, }, author: { type: String, required: true, }, seq: { type: Number, required: true, }, }); export default mongoose.model<IRewards & mongoose.Document>( "RewardDummy", RewardDummySchema );
1.085938
1
src/geodata/lang/FR.ts
Rostov1991/amcharts5
73
48
import type { Lang } from "../.internal/Lang"; // FRENCH const lang: Lang = { "AD": "Andorre", "AE": "Émirats arabes unis", "AF": "Afghanistan", "AG": "Antigua-et-Barbuda", "AI": "Anguilla", "AL": "Albanie", "AM": "Arménie", "AO": "Angola", "AQ": "Antarctique", "AR": "Argentine", "AS": "Samoa américaines", "AT": "Autriche", "AU": "Australie", "AW": "Aruba", "AX": "Åland, Îles", "AZ": "Azerbaïdjan", "BA": "Bosnie-Herzégovine", "BB": "Barbade", "BD": "Bangladesh", "BE": "Belgique", "BF": "Burkina Faso", "BG": "Bulgarie", "BH": "Bahreïn", "BI": "Burundi", "BJ": "Bénin", "BL": "Saint-Barthélémy", "BM": "Bermudes", "BN": "Brunéi Darussalam", "BO": "Bolivie, État Plurinational de", "BQ": "Bonaire, Saint-Eustache et Saba", "BR": "Brésil", "BS": "Bahamas", "BT": "Bhoutan", "BV": "Bouvet, Île", "BW": "Botswana", "BY": "Bélarus", "BZ": "Belize", "CA": "Canada", "CC": "Cocos (Keeling), Îles", "CD": "République démocratique du Congo", "CF": "Centrafricaine, République", "CG": "Congo", "CH": "Suisse", "CI": "Côte d’Ivoire", "CK": "Îles Cook", "CL": "Chili", "CM": "Cameroun", "CN": "Chine", "CO": "Colombie", "CR": "<NAME>", "CU": "Cuba", "CV": "Cap-Vert", "CW": "Curaçao", "CX": "Christmas, Île", "CY": "Chypre", "CZ": "Tchèque, République", "DE": "Allemagne", "DJ": "Djibouti", "DK": "Danemark", "DM": "Dominique", "DO": "Dominicaine, République", "DZ": "Algérie", "EC": "Équateur", "EE": "Estonie", "EG": "Égypte", "EH": "Sahara occidental", "ER": "Érythrée", "ES": "Espagne", "ET": "Éthiopie", "FI": "Finlande", "FJ": "Fidji", "FK": "Falkland, Îles (Malvinas)", "FM": "Micronésie, États Fédérés de", "FO": "Féroé, Îles", "FR": "France", "GA": "Gabon", "GB": "Royaume-Uni", "GD": "Grenade", "GE": "Géorgie", "GF": "Guyane Française", "GG": "Guernesey", "GH": "Ghana", "GI": "Gibraltar", "GL": "Groenland", "GM": "Gambie", "GN": "Guinée", "GP": "Guadeloupe", "GQ": "Guinée équatoriale", "GR": "Grèce", "GS": "Géorgie du Sud et les îles Sandwich du Sud", "GT": "Guatemala", "GU": "Guam", "GW": "Guinée-Bissau", "GY": "Guyana", "HK": "R.A.S. chinoise de Hong Kong", "HM": "Heard et MacDonald, Îles", "HN": "Honduras", "HR": "Croatie", "HT": "Haïti", "HU": "Hongrie", "ID": "Indonésie", "IE": "Irlande", "IL": "Israël", "IM": "Île de Man", "IN": "Inde", "IO": "Océan Indien, Territoire Britannique de L'", "IQ": "Irak", "IR": "Iran, République Islamique d'", "IS": "Islande", "IT": "Italie", "JE": "Jersey", "JM": "Jamaïque", "JO": "Jordanie", "JP": "Japon", "KE": "Kenya", "KG": "Kirghizistan", "KH": "Cambodge", "KI": "Kiribati", "KM": "Comores", "KN": "Saint-Kitts-et-Nevis", "KP": "Corée, République Populaire Démocratique de", "KR": "Corée, République de", "KW": "Koweït", "KY": "Caïmanes, Îles", "KZ": "Kazakhstan", "LA": "Lao, République Démocratique Populaire", "LB": "Liban", "LC": "Sainte-Lucie", "LI": "Liechtenstein", "LK": "<NAME>", "LR": "Libéria", "LS": "Lesotho", "LT": "Lituanie", "LU": "Luxembourg", "LV": "Lettonie", "LY": "Libye", "MA": "Maroc", "MC": "Monaco", "MD": "Moldavie", "ME": "Monténégro", "MF": "Saint-Martin (Partie Française)", "MG": "Madagascar", "MH": "Marshall, Îles", "MK": "Macédoine, L'ex-république Yougoslave de", "ML": "Mali", "MM": "Myanmar", "MN": "Mongolie", "MO": "R.A.S. chinoise de Macao", "MP": "Mariannes du Nord, Îles", "MQ": "Martinique", "MR": "Mauritanie", "MS": "Montserrat", "MT": "Malte", "MU": "Maurice", "MV": "Maldives", "MW": "Malawi", "MX": "Mexique", "MY": "Malaisie", "MZ": "Mozambique", "NA": "Namibie", "NC": "Nouvelle-Calédonie", "NE": "Niger", "NF": "Norfolk, Île", "NG": "Nigéria", "NI": "Nicaragua", "NL": "Pays-Bas", "NO": "Norvège", "NP": "Népal", "NR": "Nauru", "NU": "Niue", "NZ": "Nouvelle-Zélande", "OM": "Oman", "PA": "Panama", "PE": "Pérou", "PF": "Polynésie française", "PG": "Papouasie-Nouvelle-Guinée", "PH": "Philippines", "PK": "Pakistan", "PL": "Pologne", "PM": "Saint-Pierre-et-Miquelon", "PN": "Pitcairn", "PR": "Porto Rico", "PS": "État de Palestine", "PT": "Portugal", "PW": "Palaos", "PY": "Paraguay", "QA": "Qatar", "RE": "Réunion", "RO": "Roumanie", "RS": "Serbie", "RU": "Russie, Fédération de", "RW": "Rwanda", "SA": "Arabie saoudite", "SB": "Salomon, Îles", "SC": "Seychelles", "SD": "Soudan", "SE": "Suède", "SG": "Singapour", "SH": "Sainte-Hélène", "SI": "Slovénie", "SJ": "Svalbard et Île Jan Mayen", "SK": "Slovaquie", "SL": "Sierra Leone", "SM": "Saint-Marin", "SN": "Sénégal", "SO": "Somalie", "SR": "Suriname", "SS": "Soudan du Sud", "ST": "Sao Tomé-et-Principe", "SV": "El Salvador", "SX": "Saint-Martin (Partie Néerlandaise)", "SY": "Syrienne, République Arabe", "SZ": "Swaziland", "TC": "Turks et Caïques, Îles", "TD": "Tchad", "TF": "Terres australes françaises", "TG": "Togo", "TH": "Thaïlande", "TJ": "Tadjikistan", "TK": "Tokelau", "TL": "Timor-Leste", "TM": "Turkménistan", "TN": "Tunisie", "TO": "Tonga", "TR": "Turquie", "TT": "Trinité-et-Tobago", "TV": "Tuvalu", "TW": "Taïwan, Province de Chine", "TZ": "Tanzanie, République Unie de", "UA": "Ukraine", "UG": "Ouganda", "UM": "Îles mineures éloignées des États-Unis", "US": "États-Unis", "UY": "Uruguay", "UZ": "Ouzbékistan", "VA": "État de la Cité du Vatican", "VC": "Saint-Vincent-et-les Grenadines", "VE": "Venezuela, République Bolivarienne du", "VG": "Îles Vierges britanniques", "VI": "Îles Vierges des États-Unis", "VN": "Viêt Nam", "VU": "Vanuatu", "WF": "Wallis-et-Futuna", "WS": "Samoa", "YE": "Yémen", "YT": "Mayotte", "ZA": "Afrique du Sud", "ZM": "Zambie", "ZW": "Zimbabwe", }; export default lang;
0.878906
1
frontend/src/lib/utils.ts
pohlt/streamlit
5
56
/** * @license * Copyright 2018-2020 Streamlit Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import url from "url" import xxhash from "xxhashjs" import { fromJS, List, Map as ImmutableMap, Set as ImmutableSet, } from "immutable" import { Alert as AlertProto } from "autogen/proto" import { BlockElement, ReportElement, SimpleElement } from "./DeltaParser" /** * Wraps a function to allow it to be called, at most, once per interval * (specified in milliseconds). If the wrapper function is called N times * within that interval, only the Nth call will go through. The function * will only be called after the full interval has elapsed since the last * call. */ export function debounce(delay: number, fn: any): any { let timerId: any return function(...args: any[]) { if (timerId) { clearTimeout(timerId) } timerId = setTimeout(() => { fn(...args) timerId = null }, delay) } } /** * Returns true if the URL parameters indicated that we're embedded in an * iframe. */ export function isEmbeddedInIFrame(): boolean { return url.parse(window.location.href, true).query.embed === "true" } /** * A helper function to make an ImmutableJS * info element from the given text. */ export function makeElementWithInfoText( text: string ): ImmutableMap<string, any> { return fromJS({ type: "alert", alert: { body: text, format: AlertProto.Format.INFO, }, }) } /** * A helper function to hash a string using xxHash32 algorithm. * Seed used: 0xDEADBEEF */ export function hashString(s: string): string { return xxhash.h32(s, 0xdeadbeef).toString(16) } /** * Coerces a possibly-null value into a non-null value, throwing an error * if the value is null or undefined. */ export function requireNonNull<T>(obj: T | null | undefined): T { if (obj == null) { throw new Error("value is null") } return obj } /** * Provide an ImmutableSet of SimpleElements by walking a BlockElement to * its leaves. */ export function flattenElements( elements: BlockElement ): ImmutableSet<SimpleElement> { return elements.reduce( (acc: ImmutableSet<SimpleElement>, reportElement: ReportElement) => { const element = reportElement.get("element") if (element instanceof List) { return flattenElements(element as BlockElement) } return acc.union(ImmutableSet.of(element as SimpleElement)) }, ImmutableSet.of<SimpleElement>() ) } /** * A promise that would be resolved after certain time * @param ms number */ export function timeout(ms: number): Promise<void> { return new Promise(resolve => setTimeout(resolve, ms)) }
1.726563
2
src/pages/painel-controle-adm/painel-controle-adm/catalogo-produtos/produto-edit/produto-edit.ts
wtempone/aguamineral
0
64
import { Component, ViewChild } from '@angular/core'; import { IonicPage, NavController, NavParams, ToastController, AlertController } from 'ionic-angular'; import { Produto } from '../../../../../providers/database/models/produto'; import { InputPhotoComponent } from '../../../../../components/input-photo/input-photo'; import { ProdutoService } from '../../../../../providers/database/services/produto'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { MarcaService } from '../../../../../providers/database/services/marca'; import { Marca } from '../../../../../providers/database/models/marca'; @IonicPage() @Component({ selector: 'page-produto-edit', templateUrl: 'produto-edit.html', }) export class ProdutoEditPage { produto: Produto; marcas: Marca[]; formulario: FormGroup; @ViewChild(InputPhotoComponent) pro_img: InputPhotoComponent; constructor( public navCtrl: NavController, public navParams: NavParams, public produtoSrvc: ProdutoService, public marcaSrvc: MarcaService, private formBuilder: FormBuilder, private toastCtrl: ToastController, private alertCtrl: AlertController ) { this.marcaSrvc.marcas.subscribe(marcas => this.marcas = marcas); if (this.navParams.data.produto) this.produto = this.navParams.data.produto; else this.produto = <Produto>{ pro_nome: null, pro_marca: null, pro_descricao: null, pro_img: null, pro_ativo: null } } ngOnInit() { this.formulario = this.formBuilder.group({ pro_nome: [null, Validators.required], pro_marca: [null, Validators.required], pro_descricao: [null, Validators.required], pro_ativo:[null] }); this.formulario.patchValue({ pro_nome: this.produto.pro_nome, pro_descricao: this.produto.pro_descricao, pro_marca: this.produto.pro_marca, pro_img: this.produto.pro_img, pro_ativo: this.produto.pro_ativo, }); } verificaValidTouched(campo: string) { this.formulario.get(campo).errors; return ( !this.formulario.get(campo).valid && (this.formulario.get(campo).touched || this.formulario.get(campo).dirty) ); } verificaValidacoesForm(formGroup: FormGroup) { console.log(formGroup); Object.keys(formGroup.controls).forEach(campo => { const controle = formGroup.get(campo); controle.markAsDirty(); if (controle instanceof FormGroup) { this.verificaValidacoesForm(controle); } }); } salvarProduto() { if (this.formulario.valid) { this.produto.pro_nome = this.formulario.get('pro_nome').value; this.produto.pro_descricao = this.formulario.get('pro_descricao').value; this.produto.pro_marca = this.formulario.get('pro_marca').value; this.produto.pro_img = this.pro_img.value; this.produto.pro_ativo = this.formulario.get('pro_ativo').value; let parsekey: any = this.produto; if (parsekey.$key) { this.produtoSrvc.update(parsekey.$key, this.produto).then(() => { this.mensagemFinal('Produto alterado com sucesso.'); }) } else { this.produtoSrvc.create(this.produto).then(() => { this.mensagemFinal('Produto criado com sucesso.'); }) } } else { this.verificaValidacoesForm(this.formulario); } } mensagemFinal(mensagem) { let toast = this.toastCtrl.create({ message: mensagem, duration: 3000, position: 'top', cssClass: 'toast-success' }); toast.present(); this.navCtrl.pop(); } }
1.34375
1
src/components/Calculator.tsx
mikecousins/rpn
0
72
import React, { FunctionComponent } from 'react'; const Calculator: FunctionComponent = ({ children }) => ( <div className="max-w-6xl mx-auto h-screen flex flex-col bg-gray-900 p-4"> {children} </div> ); export default Calculator;
0.621094
1
src/index.ts
iotaledger/mam.js
42
80
// SPDX-License-Identifier: Apache-2.0 export * from "./mam/channel"; export * from "./mam/client"; export * from "./mam/parser"; export * from "./models/IMamChannelState"; export * from "./models/IMamFetchedMessage"; export * from "./models/IMamMessage"; export * from "./models/mamMode"; export * from "./utils/trytesHelper";
0.373047
0
src/wall/wall.service.ts
lucsbasto/paint-calculator
0
88
import { Injectable, UnprocessableEntityException } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; import { Model } from 'mongoose'; import { PaintService } from 'src/paint/paint.service'; import { Wall, WallDocument, PaintCans } from './schemas/wall.schema'; const DOOR = { height: 1.9, width: 0.8 } const WINDOW = { height: 1.2, width: 2 } @Injectable() export class WallService { constructor( @InjectModel('walls') private readonly wallModel: Model<WallDocument>, private readonly paintService: PaintService ){ } private windowArea = WINDOW.height * WINDOW.width; private doorArea = DOOR.height * DOOR.width; isWindowFit(wall: Wall) { const windowArea = this.getWindowArea(wall); const doorArea = this.getDoorArea(wall); const wallArea = this.getWallArea(wall); if ((windowArea + doorArea) > (wallArea * 0.5)){ throw new UnprocessableEntityException(`A área da parede ${wall.number} precisa ser no minimo 50% maior que a área das janelas e portas`) } if (wall.width < WINDOW.width) { throw new UnprocessableEntityException(`A largura da parede ${wall.number} precisa ser maior que a largura da janela`) } if (wall.height < WINDOW.height) { throw new UnprocessableEntityException(`A altura da parede ${wall.number} precisa ser maior que a altura da janela`) } return true; } async getWalls(room = {}){ const walls = await this.wallModel.find(room).sort({room: 1}).select('-_id -createdAt -updatedAt') return walls } async delete(room = {}){ const isDeleted = await this.wallModel.deleteMany(room); return isDeleted.deletedCount == 0 ? 'Sala não encontrada' : 'Sala deletada com sucesso'; } async save(walls: Wall[]){ if(this.verifyAllConditions(walls)){ const bulkInsertOperations = walls.map(wall => { return { insertOne: { document: wall } }; }); const isSaveOk = await this.wallModel.bulkWrite(bulkInsertOperations, { ordered: false }) return isSaveOk } } isDoorFit({height, width, number}: Wall): boolean{ if(height < DOOR.height + 0.3 ){ throw new UnprocessableEntityException(`A parede ${number} precisa ser 30cm maior que a porta`) } if(width < DOOR.width ){ throw new UnprocessableEntityException(`A largura da parede ${number} precisa ser maior que a largura da porta`) } return true } getWallArea({height, width}: Wall){ return height * width } getWindowArea({ windows }: Wall){ return this.windowArea * windows; } getDoorArea({ doors }: Wall){ return this.doorArea * doors; } verifyWallHeigthAndWidth({height, width, number}: Wall){ if(height < 1 || height > 15 || width < 1 || width > 15){ throw new UnprocessableEntityException(`Dados invalidos, por favor verifique as medidas da parede ${number} e tente novamente.`) } return true } verifyIfWallFieldsAreFilled(wall: Wall): boolean{ if(!wall.doors||!wall.height||!wall.width||!wall.windows){ throw new UnprocessableEntityException(`Alguns campos da parede ${wall.number} precisam ser preenchidos`) } return true } verifyAllConditions(wall: Wall[]): boolean { const isOKToSave = wall.every(wall => (this.verifyIfWallFieldsAreFilled(wall) && this.verifyWallHeigthAndWidth(wall) && this.isDoorFit(wall) && this.isWindowFit(wall))) return isOKToSave } getPaintableArea(walls: Wall[]){ const paintableArea = walls.map(wall => { const wallArea = this.getWallArea(wall) const doorArea = this.getDoorArea(wall) const windowArea = this.getWindowArea(wall) return wallArea - (doorArea + windowArea) }).reduce((a, b) => a+b) return paintableArea } calculate(walls: Wall[]){ const paintableArea = this.getPaintableArea(walls) const liters = this.paintService.getLitersNeededToPaint(walls, paintableArea) const paintCans: PaintCans = this.paintService.calculateCan(liters) return paintCans } }
1.492188
1
web/src/layout/controlPanel/settings/webhooks/Form.test.tsx
s-vkropotko/hub
0
96
import { fireEvent, render, waitFor } from '@testing-library/react'; import React from 'react'; import { BrowserRouter as Router } from 'react-router-dom'; import { mocked } from 'ts-jest/utils'; import { API } from '../../../../api'; import { AppCtx } from '../../../../context/AppCtx'; import { ErrorKind, SearchResults, Webhook } from '../../../../types'; import WebhookForm from './Form'; jest.mock('../../../../api'); const getMockWebhook = (fixtureId: string): Webhook => { return require(`./__fixtures__/Form/${fixtureId}.json`) as Webhook; }; const getMockSearch = (fixtureId: string): SearchResults => { return require(`./__fixtures__/Form/${fixtureId}s.json`) as SearchResults; }; const mockOnSuccess = jest.fn(); const mockOnClose = jest.fn(); const mockOnAuthError = jest.fn(); const scrollIntoViewMock = jest.fn(); window.HTMLElement.prototype.scrollIntoView = scrollIntoViewMock; const defaultProps = { onSuccess: mockOnSuccess, onClose: mockOnClose, onAuthError: mockOnAuthError, }; const mockUserCtx = { user: { alias: 'userAlias', email: '<EMAIL>' }, prefs: { controlPanel: {}, search: { limit: 60 }, theme: { configured: 'light', automatic: false, }, }, }; const mockOrgCtx = { user: { alias: 'userAlias', email: '<EMAIL>' }, prefs: { controlPanel: { selectedOrg: 'test' }, search: { limit: 60 }, theme: { configured: 'light', automatic: false, }, }, }; describe('WebhookForm', () => { afterEach(() => { jest.resetAllMocks(); }); it('creates snapshot', () => { const mockWebhook = getMockWebhook('1'); const { asFragment } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={mockWebhook} /> </Router> </AppCtx.Provider> ); expect(asFragment).toMatchSnapshot(); }); describe('Render', () => { it('when webhook edition', () => { const mockWebhook = getMockWebhook('2'); const { getByText, getAllByTestId, getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={mockWebhook} /> </Router> </AppCtx.Provider> ); expect(getByTestId('goBack')).toBeInTheDocument(); expect(getByText('Back to webhooks list')).toBeInTheDocument(); expect(getByTestId('webhookForm')).toBeInTheDocument(); expect(getByTestId('nameInput')).toBeInTheDocument(); expect(getByText('Name')).toBeInTheDocument(); expect(getByTestId('nameInput')).toHaveValue(mockWebhook.name); expect(getByTestId('descriptionInput')).toBeInTheDocument(); expect(getByText('Description')).toBeInTheDocument(); expect(getByTestId('descriptionInput')).toHaveValue(mockWebhook.description!); expect( getByText( 'A POST request will be sent to the provided URL when any of the events selected in the triggers section happens.' ) ).toBeInTheDocument(); expect(getByTestId('urlInput')).toBeInTheDocument(); expect(getByText('Url')).toBeInTheDocument(); expect(getByTestId('urlInput')).toHaveValue(mockWebhook.url); expect(getByText(/X-ArtifactHub-Secret/i)).toBeInTheDocument(); expect(getByTestId('secretInput')).toBeInTheDocument(); expect(getByText('Secret')).toBeInTheDocument(); expect(getByTestId('secretInput')).toHaveValue(mockWebhook.secret!); expect(getByText('Active')).toBeInTheDocument(); expect(getByTestId('activeCheckbox')).toBeInTheDocument(); expect(getByTestId('activeCheckbox')).not.toBeChecked(); expect( getByText( 'This flag indicates if the webhook is active or not. Inactive webhooks will not receive notifications.' ) ).toBeInTheDocument(); expect(getByText('Triggers')).toBeInTheDocument(); expect(getByText('Events')).toBeInTheDocument(); expect(getByTestId('checkbox')).toBeInTheDocument(); expect(getByTestId('checkbox')).toBeChecked(); expect(getByText('Packages')).toBeInTheDocument(); expect( getByText( "When the events selected happen for any of the packages you've chosen, a notification will be triggered and the configured url will be called. At least one package must be selected." ) ).toBeInTheDocument(); expect(getByText('Package')).toBeInTheDocument(); expect(getByText('Publisher')).toBeInTheDocument(); expect(getAllByTestId('packageTableCell')).toHaveLength(1); expect(getByText('Payload')).toBeInTheDocument(); expect(getByTestId('defaultPayloadRadio')).toBeInTheDocument(); expect(getByTestId('defaultPayloadRadio')).not.toBeChecked(); expect(getByTestId('customPayloadRadio')).toBeInTheDocument(); expect(getByTestId('customPayloadRadio')).toBeChecked(); expect(getByText('Default payload')).toBeInTheDocument(); expect(getByText('Custom payload')).toBeInTheDocument(); expect( getByText( "It's possible to customize the payload used to notify your service. This may help integrating ArtifactHub webhooks with other services without requiring you to write any code. To integrate ArtifactHub webhooks with Slack, for example, you could use a custom payload using the following template:" ) ).toBeInTheDocument(); expect(getByTestId('contentTypeInput')).toBeInTheDocument(); expect(getByText('Content type')).toBeInTheDocument(); expect(getByTestId('contentTypeInput')).toHaveValue(mockWebhook.contentType!); expect(getByText('Template')).toBeInTheDocument(); expect(getByTestId('templateTextarea')).toBeInTheDocument(); expect(getByTestId('templateTextarea')).toHaveValue(mockWebhook.template!); expect(getByText('Variables reference')).toBeInTheDocument(); expect(getByText(`{{ .Event.kind }}`)).toBeInTheDocument(); expect(getByText('Version of the new release.')).toBeInTheDocument(); expect(getByTestId('testWebhookBtn')).toBeInTheDocument(); expect(getByTestId('testWebhookBtn')).toBeEnabled(); expect(getByText('Cancel')).toBeInTheDocument(); expect(getByText('Save')).toBeInTheDocument(); expect(getByTestId('sendWebhookBtn')).toBeInTheDocument(); }); it('when webhook addition', () => { const { getByText, queryByText, getByTestId, getByPlaceholderText } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} /> </Router> </AppCtx.Provider> ); expect(getByTestId('goBack')).toBeInTheDocument(); expect(getByText('Back to webhooks list')).toBeInTheDocument(); expect(getByTestId('webhookForm')).toBeInTheDocument(); expect(getByTestId('nameInput')).toBeInTheDocument(); expect(getByText('Name')).toBeInTheDocument(); expect(getByTestId('nameInput')).toHaveValue(''); expect(getByTestId('descriptionInput')).toBeInTheDocument(); expect(getByText('Description')).toBeInTheDocument(); expect(getByTestId('descriptionInput')).toHaveValue(''); expect( getByText( 'A POST request will be sent to the provided URL when any of the events selected in the triggers section happens.' ) ).toBeInTheDocument(); expect(getByTestId('urlInput')).toBeInTheDocument(); expect(getByText('Url')).toBeInTheDocument(); expect(getByTestId('urlInput')).toHaveValue(''); expect(getByText(/X-ArtifactHub-Secret/i)).toBeInTheDocument(); expect(getByTestId('secretInput')).toBeInTheDocument(); expect(getByText('Secret')).toBeInTheDocument(); expect(getByTestId('secretInput')).toHaveValue(''); expect(getByText('Active')).toBeInTheDocument(); expect(getByTestId('activeCheckbox')).toBeInTheDocument(); expect(getByTestId('activeCheckbox')).toBeChecked(); expect( getByText( 'This flag indicates if the webhook is active or not. Inactive webhooks will not receive notifications.' ) ).toBeInTheDocument(); expect(getByText('Triggers')).toBeInTheDocument(); expect(getByText('Events')).toBeInTheDocument(); expect(getByTestId('checkbox')).toBeInTheDocument(); expect(getByTestId('checkbox')).toBeChecked(); expect(getByText('Packages')).toBeInTheDocument(); expect( getByText( "When the events selected happen for any of the packages you've chosen, a notification will be triggered and the configured url will be called. At least one package must be selected." ) ).toBeInTheDocument(); expect(queryByText('Package')).toBeNull(); expect(queryByText('Publisher')).toBeNull(); expect(getByText('Payload')).toBeInTheDocument(); expect(getByTestId('defaultPayloadRadio')).toBeInTheDocument(); expect(getByTestId('defaultPayloadRadio')).toBeChecked(); expect(getByTestId('customPayloadRadio')).toBeInTheDocument(); expect(getByTestId('customPayloadRadio')).not.toBeChecked(); expect(getByText('Default payload')).toBeInTheDocument(); expect(getByText('Custom payload')).toBeInTheDocument(); expect( queryByText( "It's possible to customize the payload used to notify your service. This may help integrating ArtifactHub webhooks with other services without requiring you to write any code. To integrate ArtifactHub webhooks with Slack, for example, you could use a custom payload using the following template:" ) ).toBeNull(); expect(getByTestId('contentTypeInput')).toBeInTheDocument(); expect(getByText('Content type')).toBeInTheDocument(); expect(getByTestId('contentTypeInput')).toHaveValue(''); expect(getByPlaceholderText('application/cloudevents+json')).toBeInTheDocument(); expect(getByText('Template')).toBeInTheDocument(); expect(getByTestId('templateTextarea')).toBeInTheDocument(); expect(getByTestId('templateTextarea')).toBeDisabled(); expect(getByTestId('templateTextarea')).toHaveValue(`{ "specversion" : "1.0", "id" : "{{ .Event.id }}", "source" : "https://artifacthub.io/cloudevents", "type" : "io.artifacthub.{{ .Event.kind }}", "datacontenttype" : "application/json", "data" : { "package": { "name": "{{ .Package.name }}", "version": "{{ .Package.version }}", "url": "{{ .Package.url }}" "repository": { "kind": "{{ .Package.repository.kind }}", "name": "{{ .Package.repository.name }}", "publisher": "{{ .Package.repository.publisher }}" } } } }`); expect(getByText('Variables reference')).toBeInTheDocument(); expect(getByText(`{{ .Event.kind }}`)).toBeInTheDocument(); expect(getByText('Version of the new release.')).toBeInTheDocument(); expect(getByTestId('testWebhookBtn')).toBeInTheDocument(); expect(getByTestId('testWebhookBtn')).toBeDisabled(); expect(getByText('Cancel')).toBeInTheDocument(); expect(getByText('Add')).toBeInTheDocument(); expect(getByTestId('sendWebhookBtn')).toBeInTheDocument(); }); it('closes form on back button click', () => { const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} /> </Router> </AppCtx.Provider> ); const btn = getByTestId('goBack'); fireEvent.click(btn); expect(mockOnClose).toHaveBeenCalledTimes(1); }); it('closes form on Cancel button click', () => { const { getByText } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} /> </Router> </AppCtx.Provider> ); const btn = getByText('Cancel'); fireEvent.click(btn); expect(mockOnClose).toHaveBeenCalledTimes(1); }); }); describe('Form submission', () => { it('when incomplete form', () => { const { getByTestId, getAllByText, getByText } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} /> </Router> </AppCtx.Provider> ); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); expect(getAllByText('This field is required')).toHaveLength(4); expect(getByText('At least one package has to be selected')).toBeInTheDocument(); }); it('calls updateWebhook', async () => { mocked(API).updateWebhook.mockResolvedValue(null); const mockWebhook = getMockWebhook('3'); const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const input = getByTestId('nameInput'); fireEvent.change(input, { target: { value: 'test' } }); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.updateWebhook).toHaveBeenCalledTimes(1); expect(API.updateWebhook).toHaveBeenCalledWith( { ...mockWebhook, name: 'test', }, undefined ); }); expect(mockOnSuccess).toHaveBeenCalledTimes(1); expect(mockOnClose).toHaveBeenCalledTimes(1); }); it('calls updateWebhook with selected org context', async () => { mocked(API).updateWebhook.mockResolvedValue(null); const mockWebhook = getMockWebhook('4'); const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockOrgCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const input = getByTestId('nameInput'); fireEvent.change(input, { target: { value: 'test' } }); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.updateWebhook).toHaveBeenCalledTimes(1); expect(API.updateWebhook).toHaveBeenCalledWith( { ...mockWebhook, name: 'test', }, 'test' ); }); expect(mockOnSuccess).toHaveBeenCalledTimes(1); expect(mockOnClose).toHaveBeenCalledTimes(1); }); it('calls addWebhook', async () => { mocked(API).addWebhook.mockResolvedValue(null); const mockSearch = getMockSearch('1'); mocked(API).searchPackages.mockResolvedValue(mockSearch); const { getByTestId, getAllByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} /> </Router> </AppCtx.Provider> ); const nameInput = getByTestId('nameInput'); fireEvent.change(nameInput, { target: { value: 'test' } }); const urlInput = getByTestId('urlInput'); fireEvent.change(urlInput, { target: { value: 'http://url.com' } }); const input = getByTestId('searchPackagesInput'); fireEvent.change(input, { target: { value: 'testing' } }); fireEvent.keyDown(input, { key: 'Enter', code: 13, charCode: 13 }); await waitFor(() => { expect(API.searchPackages).toHaveBeenCalledTimes(1); }); const packages = getAllByTestId('packageItem'); fireEvent.click(packages[0]); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.addWebhook).toHaveBeenCalledTimes(1); expect(API.addWebhook).toHaveBeenCalledWith( { name: 'test', url: 'http://url.com', active: true, description: '', secret: '', eventKinds: [0], packages: [mockSearch.data.packages![0]], }, undefined ); }); expect(mockOnSuccess).toHaveBeenCalledTimes(1); expect(mockOnClose).toHaveBeenCalledTimes(1); }); describe('when fails', () => { it('UnauthorizedError', async () => { mocked(API).updateWebhook.mockRejectedValue({ kind: ErrorKind.Unauthorized, }); const mockWebhook = getMockWebhook('5'); const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const input = getByTestId('nameInput'); fireEvent.change(input, { target: { value: 'test' } }); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.updateWebhook).toHaveBeenCalledTimes(1); expect(API.updateWebhook).toHaveBeenCalledWith( { ...mockWebhook, name: 'test', }, undefined ); }); expect(mockOnAuthError).toHaveBeenCalledTimes(1); }); it('with error message', async () => { mocked(API).updateWebhook.mockRejectedValue({ kind: ErrorKind.Other, message: 'message error', }); const mockWebhook = getMockWebhook('6'); const component = ( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const { getByTestId, getByText, rerender } = render(component); const input = getByTestId('nameInput'); fireEvent.change(input, { target: { value: 'test' } }); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.updateWebhook).toHaveBeenCalledTimes(1); expect(API.updateWebhook).toHaveBeenCalledWith( { ...mockWebhook, name: 'test', }, undefined ); }); rerender(component); expect(scrollIntoViewMock).toHaveBeenCalledTimes(1); expect(getByText('An error occurred updating the webhook: message error')).toBeInTheDocument(); }); it('without error message', async () => { mocked(API).updateWebhook.mockRejectedValue({ kind: ErrorKind.Other }); const mockWebhook = getMockWebhook('7'); const component = ( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const { getByTestId, getByText, rerender } = render(component); const input = getByTestId('nameInput'); fireEvent.change(input, { target: { value: 'test' } }); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.updateWebhook).toHaveBeenCalledTimes(1); expect(API.updateWebhook).toHaveBeenCalledWith( { ...mockWebhook, name: 'test', }, undefined ); }); rerender(component); expect(scrollIntoViewMock).toHaveBeenCalledTimes(1); expect(getByText('An error occurred updating the webhook, please try again later.')).toBeInTheDocument(); }); }); it('removes package from list to update webhook', async () => { mocked(API).updateWebhook.mockResolvedValue(null); const mockWebhook = getMockWebhook('8'); const newPackagesList = [...mockWebhook.packages]; newPackagesList.shift(); const { getByTestId, getAllByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const btns = getAllByTestId('deletePackageButton'); expect(btns).toHaveLength(mockWebhook.packages.length); fireEvent.click(btns[0]); const btn = getByTestId('sendWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.updateWebhook).toHaveBeenCalledTimes(1); expect(API.updateWebhook).toHaveBeenCalledWith( { ...mockWebhook, packages: newPackagesList, }, undefined ); }); }); }); describe('testing webhook', () => { it('triggers test on webhook edition', async () => { mocked(API).triggerWebhookTest.mockResolvedValue(null); const mockWebhook = getMockWebhook('9'); const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const btn = getByTestId('testWebhookBtn'); expect(btn).toBeInTheDocument(); expect(btn).toBeEnabled(); fireEvent.click(btn); await waitFor(() => { expect(API.triggerWebhookTest).toHaveBeenCalledTimes(1); expect(API.triggerWebhookTest).toHaveBeenCalledWith({ url: mockWebhook.url, eventKinds: mockWebhook.eventKinds, }); }); expect(getByTestId('testWebhookTick')).toBeInTheDocument(); }); it('triggers test on webhook addition', async () => { mocked(API).triggerWebhookTest.mockResolvedValue(null); const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} /> </Router> </AppCtx.Provider> ); const btn = getByTestId('testWebhookBtn'); expect(btn).toBeInTheDocument(); expect(btn).toBeDisabled(); const urlInput = getByTestId('urlInput'); fireEvent.change(urlInput, { target: { value: 'http://url.com' } }); expect(btn).toBeEnabled(); fireEvent.click(btn); await waitFor(() => { expect(API.triggerWebhookTest).toHaveBeenCalledTimes(1); expect(API.triggerWebhookTest).toHaveBeenCalledWith({ url: 'http://url.com', eventKinds: [0], }); }); expect(getByTestId('testWebhookTick')).toBeInTheDocument(); }); it('disables test btn when webhook for testing is not valid', () => { const mockWebhook = getMockWebhook('10'); const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const btn = getByTestId('testWebhookBtn'); expect(btn).toBeInTheDocument(); expect(btn).toBeEnabled(); const urlInput = getByTestId('urlInput'); fireEvent.change(urlInput, { target: { value: 'wrongUrl' } }); expect(btn).toBeDisabled(); }); describe('when fails', () => { it('UnauthorizedError', async () => { mocked(API).triggerWebhookTest.mockRejectedValue({ kind: ErrorKind.Unauthorized, }); const mockWebhook = getMockWebhook('11'); const { getByTestId } = render( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const btn = getByTestId('testWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.triggerWebhookTest).toHaveBeenCalledTimes(1); expect(API.triggerWebhookTest).toHaveBeenCalledWith({ url: mockWebhook.url, eventKinds: mockWebhook.eventKinds, }); }); expect(mockOnAuthError).toHaveBeenCalledTimes(1); }); it('with custom error', async () => { mocked(API).triggerWebhookTest.mockRejectedValue({ kind: ErrorKind.Other, message: 'custom error', }); const mockWebhook = getMockWebhook('12'); const component = ( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const { getByTestId, getByText, rerender } = render(component); const btn = getByTestId('testWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.triggerWebhookTest).toHaveBeenCalledTimes(1); expect(API.triggerWebhookTest).toHaveBeenCalledWith({ url: mockWebhook.url, eventKinds: mockWebhook.eventKinds, }); }); rerender(component); expect(scrollIntoViewMock).toHaveBeenCalledTimes(1); expect(getByText('An error occurred testing the webhook: custom error')).toBeInTheDocument(); }); it('default error', async () => { mocked(API).triggerWebhookTest.mockRejectedValue({ kind: ErrorKind.Other, }); const mockWebhook = getMockWebhook('13'); const component = ( <AppCtx.Provider value={{ ctx: mockUserCtx, dispatch: jest.fn() }}> <Router> <WebhookForm {...defaultProps} webhook={{ ...mockWebhook, contentType: null, template: null }} /> </Router> </AppCtx.Provider> ); const { getByTestId, getByText, rerender } = render(component); const btn = getByTestId('testWebhookBtn'); fireEvent.click(btn); await waitFor(() => { expect(API.triggerWebhookTest).toHaveBeenCalledTimes(1); expect(API.triggerWebhookTest).toHaveBeenCalledWith({ url: mockWebhook.url, eventKinds: mockWebhook.eventKinds, }); }); rerender(component); expect(scrollIntoViewMock).toHaveBeenCalledTimes(1); expect(getByText('An error occurred testing the webhook, please try again later.')).toBeInTheDocument(); }); }); }); });
1.75
2
src/components-examples/material/datepicker/datepicker-views-selection/datepicker-views-selection-example.ts
mottlik214/components
0
104
import {Component} from '@angular/core'; import {UntypedFormControl} from '@angular/forms'; import {MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS} from '@angular/material-moment-adapter'; import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; import {MatDatepicker} from '@angular/material/datepicker'; // Depending on whether rollup is used, moment needs to be imported differently. // Since Moment.js doesn't have a default export, we normally need to import using the `* as` // syntax. However, rollup creates a synthetic default module and we thus need to import it using // the `default as` syntax. import * as _moment from 'moment'; // tslint:disable-next-line:no-duplicate-imports import {default as _rollupMoment, Moment} from 'moment'; const moment = _rollupMoment || _moment; // See the Moment.js docs for the meaning of these formats: // https://momentjs.com/docs/#/displaying/format/ export const MY_FORMATS = { parse: { dateInput: 'MM/YYYY', }, display: { dateInput: 'MM/YYYY', monthYearLabel: 'MMM YYYY', dateA11yLabel: 'LL', monthYearA11yLabel: 'MMMM YYYY', }, }; /** @title Datepicker emulating a Year and month picker */ @Component({ selector: 'datepicker-views-selection-example', templateUrl: 'datepicker-views-selection-example.html', styleUrls: ['datepicker-views-selection-example.css'], providers: [ // `MomentDateAdapter` can be automatically provided by importing `MomentDateModule` in your // application's root module. We provide it at the component level here, due to limitations of // our example generation script. { provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS], }, {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, ], }) export class DatepickerViewsSelectionExample { date = new UntypedFormControl(moment()); setMonthAndYear(normalizedMonthAndYear: Moment, datepicker: MatDatepicker<Moment>) { const ctrlValue = this.date.value; ctrlValue.month(normalizedMonthAndYear.month()); ctrlValue.year(normalizedMonthAndYear.year()); this.date.setValue(ctrlValue); datepicker.close(); } }
1.289063
1
src/types/chart.ts
ajuhos/react-flow-chart
0
112
import { IPosition, ISize } from './generics' export interface IChart { offset: IPosition nodes: { [id: string]: INode, } links: { [id: string]: ILink, } scale: number properties?: any /** System Temp */ selected: ISelectedOrHovered hovered: ISelectedOrHovered } export interface ISelectedOrHovered { type?: 'link' | 'node' | 'port' id?: string doubleClick?: boolean } export interface INode { id: string type: string position: IPosition orientation?: number ports: { [id: string]: IPort, } properties?: any /** System Temp */ size?: ISize } export interface IPort { id: string type: string value?: string properties?: any /** System Temp */ position?: IPosition } export interface ILink { id: string from: { nodeId: string portId: string, } to: { nodeId?: string portId?: string /** System Temp */ position?: IPosition, } properties?: any }
1.070313
1
src/pages/index.tsx
xsharonhe/personal-portfolio
0
120
import React from 'react'; import IndexLayout from '../layouts'; import { Hero, About, Experiences, Projects, Contact, Copyright } from '../sections'; const IndexPage = () => { return ( <IndexLayout> <Hero style={{ marginTop: '40px' }}/> <About style={{ marginTop: '80px' }}/> <Experiences style={{ marginTop: '80px' }}/> <Projects style={{ marginTop: '80px' }}/> <Contact style={{ marginTop: '80px' }}/> <Copyright style={{ marginTop: '90px', paddingBottom: '90px'}}/> </IndexLayout> ); } export default IndexPage;
0.886719
1
aire-ether/src/config.ts
RedEtherProject/AIRE
0
128
const TOKEN_ADDRESS = ''; const TOKEN_ABI = []; export { TOKEN_ABI, TOKEN_ADDRESS }
0.086426
0
spa/src/view/SingleCard/SingleCard.tsx
vincentli77/MT4-projetEveillard
0
136
// @ts-ignore import React, { Fragment, useEffect, useState } from 'react' import {cardList} from "../../cardList"; import { useParams } from "react-router-dom"; import styles from "./Single.module.scss"; import { dependencies } from '../..' import { translationApi, Translation, Language } from '../../domain' import AddTranslation from '../AddTranslation' interface RouteParams { id: any; slug: any } export interface Props { card?: any } export const SingleCard = ( props: Props ) => { const params = useParams<RouteParams>(); const [translations, setTranslations] = useState<Translation<Language>[]>([]) useEffect(() => { translationApi .getAllTranslationsForForeignLanguage(dependencies)('FR') .then((translations) => setTranslations(translations)) },[]) return ( <div> <a></a> <div> <div> <section> <h1>Add a new translation</h1> <AddTranslation /> </section> </div> </div> </div> ); };
1.460938
1
packages/metrics/examples/decorator/default-dimensions.ts
dreamorosi/aws-lambda-powertools-typescript
0
144
import { populateEnvironmentVariables } from '../../tests/helpers'; // Populate runtime populateEnvironmentVariables(); // Additional runtime variables process.env.POWERTOOLS_METRICS_NAMESPACE = 'hello-world'; import * as dummyEvent from '../../../../tests/resources/events/custom/hello-world.json'; import { context as dummyContext } from '../../../../tests/resources/contexts/hello-world'; import { LambdaInterface } from '../utils/lambda'; import { Callback, Context } from 'aws-lambda/handler'; import { Metrics, MetricUnits } from '../../src'; const metrics = new Metrics(); class Lambda implements LambdaInterface { @metrics.logMetrics({ defaultDimensions:{ 'application': 'hello-world' } }) public handler<TEvent, TResult>(_event: TEvent, _context: Context, _callback: Callback<TResult>): void | Promise<TResult> { metrics.addDimension('environment', 'dev'); metrics.addDimension('application', 'hello-world-dev'); metrics.addMetric('test-metric', MetricUnits.Count, 10); // You can override the default dimensions by clearing the existing metrics first. Note that the cleared metric will be dropped, it will NOT be published to CloudWatch const metricsObject = metrics.serializeMetrics(); metrics.clearMetrics(); metrics.clearDimensions(); metrics.addMetric('new-test-metric', MetricUnits.Count, 5); console.log(JSON.stringify(metricsObject)); } } new Lambda().handler(dummyEvent, dummyContext, () => console.log('Lambda invoked!'));
1.476563
1
src/components/Input/styles.ts
Sandrolaxx/votingMachine
0
152
import styled from "../../../node_modules/styled-components/native"; export const Container = styled.View` margin-top: 8%; align-items: center; ` export const InputVote = styled.TextInput` border-radius: 12px; height: 52px; width: 70px; background-color: #f5f5f5; font-size: 22px; text-align: center; padding: 8px; border: 2px; ` export const HeaderTitle = styled.Text` width: 100%; margin: 8px 0px; font-size: 22px; color: #9606CF; `
0.890625
1
src/entities/startUp/address.ts
rocky-bgta/TillBoxWeb_Node_Back_End
0
160
import BaseEntity from "../../core/abstractClass/baseEntity"; import {Column, DataType, Table} from "sequelize-typescript"; @Table export default class Address extends BaseEntity { @Column({primaryKey: true, autoIncrement: true}) @Column(DataType.INTEGER) addressID: number; @Column(DataType.INTEGER) businessID: number; @Column(DataType.INTEGER) typeID: number; @Column(DataType.STRING) address: string; @Column(DataType.STRING) suburb: string; @Column(DataType.STRING) state: string; @Column(DataType.STRING) postCode: string; @Column(DataType.INTEGER) country: number; }
0.988281
1
lib/dots/DotsLoader.d.ts
Seimodei/react-loaders-kit
40
168
export interface DotsProps { loading: boolean; size?: number; duration?: number; pause?: boolean; color?: string; } declare const DotsLoader: (props: DotsProps) => JSX.Element; export default DotsLoader;
0.582031
1
src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts
pcsanwald/kibana
12
176
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import { EuiContextMenuPanelDescriptor } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { connect } from 'react-redux'; import { buildEuiContextMenuPanels, ContainerState, ContextMenuPanel, Embeddable, } from 'ui/embeddable'; import { panelActionsStore } from '../../store/panel_actions_store'; import { getCustomizePanelAction, getEditPanelAction, getInspectorPanelAction, getRemovePanelAction, getToggleExpandPanelAction, } from './panel_actions'; import { PanelOptionsMenu, PanelOptionsMenuProps } from './panel_options_menu'; import { closeContextMenu, deletePanel, maximizePanel, minimizePanel, resetPanelTitle, setPanelTitle, setVisibleContextMenuPanelId, } from '../../actions'; import { Dispatch } from 'redux'; import { CoreKibanaState } from '../../../selectors'; import { DashboardViewMode } from '../../dashboard_view_mode'; import { getContainerState, getEmbeddable, getEmbeddableEditUrl, getEmbeddableTitle, getMaximizedPanelId, getPanel, getViewMode, getVisibleContextMenuPanelId, PanelId, } from '../../selectors'; interface PanelOptionsMenuContainerDispatchProps { onDeletePanel: () => void; onCloseContextMenu: () => void; openContextMenu: () => void; onMaximizePanel: () => void; onMinimizePanel: () => void; onResetPanelTitle: () => void; onUpdatePanelTitle: (title: string) => void; } interface PanelOptionsMenuContainerOwnProps { panelId: PanelId; embeddable?: Embeddable; } interface PanelOptionsMenuContainerStateProps { panelTitle?: string; editUrl: string | null | undefined; isExpanded: boolean; containerState: ContainerState; visibleContextMenuPanelId: PanelId | undefined; isViewMode: boolean; } const mapStateToProps = ( { dashboard }: CoreKibanaState, { panelId }: PanelOptionsMenuContainerOwnProps ) => { const embeddable = getEmbeddable(dashboard, panelId); const panel = getPanel(dashboard, panelId); const embeddableTitle = getEmbeddableTitle(dashboard, panelId); const containerState = getContainerState(dashboard, panelId); const visibleContextMenuPanelId = getVisibleContextMenuPanelId(dashboard); const viewMode = getViewMode(dashboard); return { panelTitle: panel.title === undefined ? embeddableTitle : panel.title, editUrl: embeddable ? getEmbeddableEditUrl(dashboard, panelId) : null, isExpanded: getMaximizedPanelId(dashboard) === panelId, containerState, visibleContextMenuPanelId, isViewMode: viewMode === DashboardViewMode.VIEW, }; }; /** * @param dispatch {Function} * @param embeddableFactory {EmbeddableFactory} * @param panelId {string} */ const mapDispatchToProps = ( dispatch: Dispatch, { panelId }: PanelOptionsMenuContainerOwnProps ) => ({ onDeletePanel: () => { dispatch(deletePanel(panelId)); }, onCloseContextMenu: () => dispatch(closeContextMenu()), openContextMenu: () => dispatch(setVisibleContextMenuPanelId(panelId)), onMaximizePanel: () => dispatch(maximizePanel(panelId)), onMinimizePanel: () => dispatch(minimizePanel()), onResetPanelTitle: () => dispatch(resetPanelTitle(panelId)), onUpdatePanelTitle: (newTitle: string) => dispatch(setPanelTitle({ title: newTitle, panelId })), }); const mergeProps = ( stateProps: PanelOptionsMenuContainerStateProps, dispatchProps: PanelOptionsMenuContainerDispatchProps, ownProps: PanelOptionsMenuContainerOwnProps ) => { const { isExpanded, panelTitle, containerState, visibleContextMenuPanelId, isViewMode, } = stateProps; const isPopoverOpen = visibleContextMenuPanelId === ownProps.panelId; const { onMaximizePanel, onMinimizePanel, onDeletePanel, onResetPanelTitle, onUpdatePanelTitle, onCloseContextMenu, openContextMenu, } = dispatchProps; const toggleContextMenu = () => (isPopoverOpen ? onCloseContextMenu() : openContextMenu()); // Outside click handlers will trigger for every closed context menu, we only want to react to clicks external to // the currently opened menu. const closeMyContextMenuPanel = () => { if (isPopoverOpen) { onCloseContextMenu(); } }; const toggleExpandedPanel = () => { isExpanded ? onMinimizePanel() : onMaximizePanel(); closeMyContextMenuPanel(); }; let panels: EuiContextMenuPanelDescriptor[] = []; // Don't build the panels if the pop over is not open, or this gets expensive - this function is called once for // every panel, every time any state changes. if (isPopoverOpen) { const contextMenuPanel = new ContextMenuPanel({ title: i18n.translate('kbn.dashboard.panel.optionsMenu.optionsContextMenuTitle', { defaultMessage: 'Options', }), id: 'mainMenu', }); const actions = [ getInspectorPanelAction({ closeContextMenu: closeMyContextMenuPanel, panelTitle, }), getEditPanelAction(), getCustomizePanelAction({ onResetPanelTitle, onUpdatePanelTitle, title: panelTitle, closeContextMenu: closeMyContextMenuPanel, }), getToggleExpandPanelAction({ isExpanded, toggleExpandedPanel }), getRemovePanelAction(onDeletePanel), ].concat(panelActionsStore.actions); panels = buildEuiContextMenuPanels({ contextMenuPanel, actions, embeddable: ownProps.embeddable, containerState, }); } return { panels, toggleContextMenu, closeContextMenu: closeMyContextMenuPanel, isPopoverOpen, isViewMode, }; }; export const PanelOptionsMenuContainer = connect< PanelOptionsMenuContainerStateProps, PanelOptionsMenuContainerDispatchProps, PanelOptionsMenuContainerOwnProps, PanelOptionsMenuProps, CoreKibanaState >( mapStateToProps, mapDispatchToProps, mergeProps )(PanelOptionsMenu);
1.109375
1
cli/test/execution/fixtures/test-invalid/src/publicApi.ts
retarsis/monoreact
3
184
export const noop = (): void => {}; export const sum = (a: number, b: number): number => a + b; export const concat = (a: string, b: string): string => a + b;
0.742188
1
packages/indexer/src/index.ts
0xsequence/sequence.js
120
192
export * from './indexer.gen' import fetch from 'cross-fetch' import { Indexer as BaseSequenceIndexer } from './indexer.gen' export class SequenceIndexerClient extends BaseSequenceIndexer { constructor(hostname: string, public jwtAuth?: string) { super(hostname, fetch) this.fetch = this._fetch } _fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => { // automatically include jwt auth header to requests // if its been set on the api client const headers: { [key: string]: any } = {} if (this.jwtAuth && this.jwtAuth.length > 0) { headers['Authorization'] = `BEARER ${this.jwtAuth}` } // before the request is made init!.headers = { ...init!.headers, ...headers } return fetch(input, init) } }
1.1875
1
packages/fetch-manager/src/__testUtils__/responseDataSets.ts
dylanaubrey/handl
5
200
/* tslint:disable:object-literal-sort-keys */ export default [ { data: { search: { edges: [ { cursor: "<KEY> node: { posterPath: "/s2xcqSFfT6F7ZXHxowjxfG0yisT.jpg", title: "Jaws", voteAverage: 7.6, voteCount: 8135, id: "578", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/cN3ijEwsn4kBaRuHfcJpAQJbeWe.jpg", title: "Jaws 2", voteAverage: 5.9, voteCount: 1434, id: "579", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/kqDXj53F9paqVGJLGfHtz7giJ3s.jpg", title: "Jaws 3-D", voteAverage: 4.4, voteCount: 931, id: "17692", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/kGiaOztahZV2x7bil7sbk7fb6ob.jpg", title: "Jaws: The Revenge", voteAverage: 4, voteCount: 752, id: "580", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/tq9swm2dKN0bNb48HArwSDGuF12.jpg", title: "Cruel Jaws", voteAverage: 4.2, voteCount: 59, id: "84060", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/8Lg3hV7ZbHn9nTsKFj0UWU1X2v2.jpg", title: "Santa Jaws", voteAverage: 4.5, voteCount: 14, id: "542476", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/4lthj4OrIRtislto5oFNnTgBNuy.jpg", title: "Deep Jaws", voteAverage: 1, voteCount: 1, id: "50963", __typename: "Movie", }, }, { cursor: "<KEY>TVVMVEkifQ==", node: { posterPath: "/rMr9cwQAJst3dKZmxdA8rFS13aZ.jpg", title: "Jaws of Satan", voteAverage: 5, voteCount: 22, id: "85512", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/osyj5B7WrVn0Oc2oDWvDVoSCQ9y.jpg", title: "The Making of Jaws", voteAverage: 6.6, voteCount: 23, id: "167065", __typename: "Movie", }, }, { cursor: "<KEY>", node: { name: "Jaws", profilePath: null, id: "3240866", __typename: "Person" }, }, { cursor: "<KEY> node: { posterPath: "/nqROqLDEE5f185mW4OGC18GffUN.jpg", title: "Mako: The Jaws of Death", voteAverage: 4.1, voteCount: 9, id: "97559", __typename: "Movie", }, }, { cursor: "<KEY>SI6Ik1VTFRJIn0=", node: { posterPath: null, title: "Moose Jaws", voteAverage: 0, voteCount: 0, id: "405180", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/lD38L3noqH82pJLVQrK7MP4uwhZ.jpg", title: "Ghost Shark 2: Urban Jaws", voteAverage: 5, voteCount: 4, id: "204473", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/4Cf8I4D9I05KeHpYRUzlILRTn2C.jpg", title: "Psycho Shark", voteAverage: 3.8, voteCount: 11, id: "72021", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/soCdTnnjJss5oc55ceCBZSP1zsF.jpg", title: "Saving Jaws", voteAverage: 6.3, voteCount: 3, id: "613476", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/jKk6PlDSZffdTrGtg371JvAX2OS.jpg", title: "Inside Jaws: A Filmumentary", voteAverage: 0, voteCount: 0, id: "363144", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/zQ790ksu8IXI0NO3ORz8MOCMuUG.jpg", title: "Jaws", voteAverage: 0, voteCount: 0, id: "645900", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/n29QyzfangOxBlNWtfukNXXu9YQ.jpg", title: "Jaws", voteAverage: 0, voteCount: 0, id: "514492", __typename: "Movie", }, }, { cursor: "<KEY> node: { posterPath: "/y4rfFsOV1fh5F553y32MCFLKcHl.jpg", title: "Jaws of Steel", voteAverage: 8, voteCount: 1, id: "294375", __typename: "Movie", }, }, { cursor: "<KEY> node: { name: "The Croc that ate Jaws", posterPath: "/cnBDN0J5Fqua3qQAD54QI0ypAOK.jpg", voteAverage: 0, voteCount: 0, id: "129375", __typename: "Tv", }, }, ], pageInfo: { hasNextPage: true, hasPreviousPage: false, startCursor: "<KEY> endCursor: "<KEY> }, totalCount: 91, }, }, hasNext: true, requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.pageInfo": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, { node: { videos: [ { name: "Jaws 2 Re-done Trailer", key: "<KEY>", site: "YouTube", type: "TRAILER", id: "5e803baf76484100133d085e", }, { name: "ABC Friday Night Movie open Jaws 2 1983", key: "<KEY>", site: "YouTube", type: "FEATURETTE", id: "533ec654c3a368544800042d", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.1.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"dba8637ed5eac51b975c6b62d6a79f69"', ttl: 1645814743124, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, { node: { videos: [ { name: "JAWS: The Revenge Trailer HQ", key: "<KEY>", site: "YouTube", type: "TRAILER", id: "533ec654c3a368544800042e", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.3.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"3d97aaca06d57561486e2b6584963e3d"', ttl: 1645814743174, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ { node: { videos: [ { name: "Jaws | Final Face-Off With the Shark in 4K Ultra HD", key: "<KEY>", site: "YouTube", type: "CLIP", id: "608786162c6b7b002a70fb25", }, { name: "Jaws 35mm Grindhouse Trailer", key: "352702348", site: "Vimeo", type: "TRAILER", id: "5ff14203a39d0b00418d7469", }, { name: "<NAME> on JAWS", key: "<KEY>", site: "YouTube", type: "FEATURETTE", id: "533ec654c3a3685448000428", }, { name: "Jaws Official Trailer #1 - <NAME>, <NAME>berg Movie (1975) HD", key: "U1fu_sA7XhE", site: "YouTube", type: "TRAILER", id: "53cd4cbbc3a3687775002dd0", }, { name: "Siskel & <NAME> (1975) Review", key: "<KEY>", site: "YouTube", type: "FEATURETTE", id: "533ec654c3a3685448000427", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.0.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"ef7dc264044a1de7affcf190e991a577"', ttl: 1645814743204, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ { node: { releaseDates: [ { iso_3166_1: "PE", releaseDates: [{ certification: "" }] }, { iso_3166_1: "AR", releaseDates: [{ certification: "" }, { certification: "" }] }, { iso_3166_1: "IN", releaseDates: [{ certification: "A" }] }, { iso_3166_1: "BE", releaseDates: [{ certification: "" }] }, { iso_3166_1: "TH", releaseDates: [{ certification: "" }] }, { iso_3166_1: "FI", releaseDates: [{ certification: "K-16" }] }, { iso_3166_1: "IT", releaseDates: [{ certification: "T" }] }, { iso_3166_1: "HK", releaseDates: [{ certification: "" }] }, { iso_3166_1: "TR", releaseDates: [{ certification: "" }] }, { iso_3166_1: "PT", releaseDates: [{ certification: "M/16" }] }, { iso_3166_1: "GB", releaseDates: [{ certification: "PG" }, { certification: "" }] }, { iso_3166_1: "SI", releaseDates: [{ certification: "" }] }, { iso_3166_1: "MX", releaseDates: [{ certification: "" }] }, { iso_3166_1: "HU", releaseDates: [{ certification: "16" }] }, { iso_3166_1: "JP", releaseDates: [{ certification: "" }] }, { iso_3166_1: "ZA", releaseDates: [{ certification: "" }] }, { iso_3166_1: "NO", releaseDates: [{ certification: "" }] }, { iso_3166_1: "SU", releaseDates: [{ certification: "16+" }] }, { iso_3166_1: "AU", releaseDates: [{ certification: "M" }] }, { iso_3166_1: "UY", releaseDates: [{ certification: "" }] }, { iso_3166_1: "RU", releaseDates: [{ certification: "18+" }, { certification: "18+" }] }, { iso_3166_1: "IS", releaseDates: [{ certification: "" }] }, { iso_3166_1: "PH", releaseDates: [{ certification: "" }] }, { iso_3166_1: "DE", releaseDates: [{ certification: "16" }] }, { iso_3166_1: "XC", releaseDates: [{ certification: "" }] }, { iso_3166_1: "NL", releaseDates: [ { certification: "" }, { certification: "16" }, { certification: "16" }, { certification: "16" }, { certification: "16" }, ], }, { iso_3166_1: "FR", releaseDates: [ { certification: "12" }, { certification: "" }, { certification: "16" }, { certification: "16" }, { certification: "12" }, { certification: "12" }, { certification: "12" }, ], }, { iso_3166_1: "SE", releaseDates: [ { certification: "15" }, { certification: "15" }, { certification: "15" }, { certification: "15" }, ], }, { iso_3166_1: "DK", releaseDates: [{ certification: "15" }] }, { iso_3166_1: "US", releaseDates: [{ certification: "PG-13" }, { certification: "" }, { certification: "PG" }], }, { iso_3166_1: "CL", releaseDates: [{ certification: "" }] }, { iso_3166_1: "BR", releaseDates: [{ certification: "14" }] }, { iso_3166_1: "IE", releaseDates: [{ certification: "" }, { certification: "" }] }, { iso_3166_1: "KR", releaseDates: [{ certification: "" }] }, { iso_3166_1: "GR", releaseDates: [{ certification: "" }] }, { iso_3166_1: "ES", releaseDates: [{ certification: "" }, { certification: "APTA" }] }, { iso_3166_1: "CZ", releaseDates: [{ certification: "" }] }, { iso_3166_1: "PL", releaseDates: [{ certification: "" }] }, { iso_3166_1: "AE", releaseDates: [{ certification: "" }] }, { iso_3166_1: "SG", releaseDates: [{ certification: "" }] }, { iso_3166_1: "CA", releaseDates: [{ certification: "" }] }, { iso_3166_1: "CO", releaseDates: [{ certification: "" }] }, { iso_3166_1: "EG", releaseDates: [{ certification: "" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.0.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"ef7dc264044a1de7affcf190e991a577"', ttl: 1645814743204, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"afcb448d9b0eeac5ebf188aed0064717"', ttl: 1645814743290, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, { node: { releaseDates: [ { iso_3166_1: "US", releaseDates: [{ certification: "PG" }] }, { iso_3166_1: "GB", releaseDates: [{ certification: "PG" }] }, { iso_3166_1: "DK", releaseDates: [{ certification: "15" }] }, { iso_3166_1: "NL", releaseDates: [{ certification: "12" }, { certification: "12" }] }, { iso_3166_1: "BR", releaseDates: [{ certification: "14" }] }, { iso_3166_1: "PT", releaseDates: [{ certification: "M/12" }] }, { iso_3166_1: "ES", releaseDates: [{ certification: "16" }] }, { iso_3166_1: "DE", releaseDates: [{ certification: "16" }] }, { iso_3166_1: "FR", releaseDates: [{ certification: "U" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.1.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"ef7dc264044a1de7affcf190e991a577"', ttl: 1645814743204, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"570d27346fc74b9c6bbc404f6c60c5a5"', ttl: 1645814743457, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, { node: { releaseDates: [ { iso_3166_1: "ES", releaseDates: [{ certification: "16" }] }, { iso_3166_1: "GB", releaseDates: [{ certification: "PG" }] }, { iso_3166_1: "US", releaseDates: [{ certification: "PG-13" }, { certification: "" }] }, { iso_3166_1: "BR", releaseDates: [{ certification: "14" }] }, { iso_3166_1: "FR", releaseDates: [{ certification: "U" }] }, { iso_3166_1: "DE", releaseDates: [{ certification: "16" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.3.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"ef7dc264044a1de7affcf190e991a577"', ttl: 1645814743204, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"09483e2f49e706f58a08c84133421b8d"', ttl: 1645814743567, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, { node: { releaseDates: [ { iso_3166_1: "DE", releaseDates: [{ certification: "16" }] }, { iso_3166_1: "AU", releaseDates: [{ certification: "" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.7.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"ef7dc264044a1de7affcf190e991a577"', ttl: 1645814743204, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743599 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, { node: { releaseDates: [ { iso_3166_1: "US", releaseDates: [{ certification: "" }] }, { iso_3166_1: "FR", releaseDates: [{ certification: "" }] }, { iso_3166_1: "IT", releaseDates: [{ certification: "" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.4.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"ef7dc264044a1de7affcf190e991a577"', ttl: 1645814743204, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743619 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, { node: { videos: [ { name: "Jaws 3-D (1983) (TV Spot)", key: "<KEY>", site: "YouTube", type: "TRAILER", id: "578a3b51925141601e0010e3", }, { name: "JAWS 3D MOVIE TRAILER HD", key: "<KEY>", site: "YouTube", type: "TEASER", id: "533ec67cc3a3685448002d59", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.2.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"d09366514179b03741ce98e4d4de32a7"', ttl: 1645814743637, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743619 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, { node: { videos: [ { name: "Santa Jaws Trailer", key: "<KEY>", site: "YouTube", type: "TRAILER", id: "5fc087e66bdec3003b26acc2", }, { name: "Santa Jaws (2018) Carnage Count", key: "<KEY>", site: "YouTube", type: "CLIP", id: "5c61bcaec3a3684fabd647b4", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.5.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"1da096fef94420cf4505fab6d9b922f7"', ttl: 1645814743671, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743619 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.5.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"1da096fef94420cf4505fab6d9b922f7"', ttl: 1645814743671, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743747 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "NR" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.14.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"1da096fef94420cf4505fab6d9b922f7"', ttl: 1645814743671, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"e35627f104898a688550b129206f3804"', ttl: 1645814743816, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.12.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"1da096fef94420cf4505fab6d9b922f7"', ttl: 1645814743671, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743831 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [null, null, null, null, null, null, { node: { videos: [] } }] } }, hasNext: true, paths: ["search.edges.6.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"5124d6d65f04ea24e33ad7f9320cadeb"', ttl: 1645814743847, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743831 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, { node: { releaseDates: [ { iso_3166_1: "DE", releaseDates: [{ certification: "16" }] }, { iso_3166_1: "ES", releaseDates: [{ certification: "12" }] }, { iso_3166_1: "US", releaseDates: [{ certification: "PG" }] }, { iso_3166_1: "BR", releaseDates: [{ certification: "14" }] }, { iso_3166_1: "GB", releaseDates: [{ certification: "PG" }] }, { iso_3166_1: "FR", releaseDates: [{ certification: "12" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.2.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"5124d6d65f04ea24e33ad7f9320cadeb"', ttl: 1645814743847, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"f49110181a2d2ebfb413c1fc0719e92a"', ttl: 1645814743862, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [null, null, null, null, null, null, null, null, { node: { videos: [] } }] } }, hasNext: true, paths: ["search.edges.8.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743893 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"f49110181a2d2ebfb413c1fc0719e92a"', ttl: 1645814743862, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [] } }], }, }, hasNext: true, paths: ["search.edges.11.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743893 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743915 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, { node: { videos: [ { name: "<NAME> (1995) Trailer", key: "<KEY>", site: "YouTube", type: "TRAILER", id: "5b037420c3a3686c92015af8", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.4.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"29e95cad3c55e51b33b06ce710a89cb5"', ttl: 1645814743927, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743915 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "G" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.8.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"29e95cad3c55e51b33b06ce710a89cb5"', ttl: 1645814743927, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743950 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "NR" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.6.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"29e95cad3c55e51b33b06ce710a89cb5"', ttl: 1645814743927, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743964 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [ { name: "GHOST SHARK 2: URBAN JAWS Official Trailer", key: "h9n-_sc6As8", site: "YouTube", type: "TRAILER", id: "5e85bee55294e700134aa7e6", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.12.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743995 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743964 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, { node: { videos: [ { name: 'Jaws Of Satan (1981) "King Cobra" HD Trailer [1080p]', key: "<KEY>", site: "YouTube", type: "TRAILER", id: "5f9312a76331b20039f322d0", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.7.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"a7b360aa812a534d1c44e86808ec3593"', ttl: 1645814744014, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743964 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [] } }] }, }, hasNext: true, paths: ["search.edges.11.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744039 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743964 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [ { name: "Jaws in Japan AKA Psycho Shark (2009) - Trailer", key: "<KEY>", site: "YouTube", type: "TRAILER", id: "5efa31fda284eb0039914905", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.13.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744049 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814743964 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [ { iso_3166_1: "TR", releaseDates: [{ certification: "" }] }, { iso_3166_1: "US", releaseDates: [{ certification: "" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.10.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744049 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744070 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, { node: { videos: [ { name: "CBS Late Movie promo Mako: The Jaws of Death 1978", key: "SCAXfuznbUk", site: "YouTube", type: "TRAILER", id: "533ec6dac3a368544800811c", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.10.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744087 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744070 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [] } }, ], }, }, hasNext: true, paths: ["search.edges.15.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744107 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744070 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "GB", releaseDates: [{ certification: "" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.15.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744107 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744123 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "NR" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.16.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744107 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744136 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [ { name: "JAWS (Full Short) <NAME>", key: "272344126", site: "Vimeo", type: "FEATURETTE", id: "60980a4db39e35003b1a2df4", }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.17.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"1f251eea9a8c1eb292fbb5b5bb5b9a58"', ttl: 1645814744152, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744136 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [ { iso_3166_1: "JP", releaseDates: [{ certification: "" }] }, { iso_3166_1: "US", releaseDates: [{ certification: "" }] }, ], }, }, ], }, }, hasNext: true, paths: ["search.edges.13.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"1f251eea9a8c1eb292fbb5b5bb5b9a58"', ttl: 1645814744152, }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744171 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [] } }, ], }, }, hasNext: true, paths: ["search.edges.14.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744183 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744171 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.18.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744183 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744191 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { releaseDates: [{ iso_3166_1: "US", releaseDates: [{ certification: "" }] }] } }, ], }, }, hasNext: true, paths: ["search.edges.17.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744183 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744202 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679, }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [] } }, ], }, }, hasNext: true, paths: ["search.edges.16.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744214 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744202 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: [] } }, ], }, }, hasNext: true, paths: ["search.edges.18.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744224 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744202 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { contentRatings: [{ iso_3166_1: "US", rating: "TV-14" }] } }, ], }, }, hasNext: true, paths: ["search.edges.19.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744224 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744202 }, "query.tv.contentRatings": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744234 }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, { data: { search: { edges: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { node: { videos: null } }, ], }, }, hasNext: false, paths: ["search.edges.19.node"], requestID: "0e9ad890-9628-11ec-9046-412e5b96757a", _cacheMetadata: { query: { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.movie.videos": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744224 }, "query.movie.releaseDates": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744202 }, "query.tv.contentRatings": { cacheControl: { public: true, maxAge: 28800 }, ttl: 1645814744234 }, "query.tv.videos": { cacheControl: { public: true, maxAge: 28800 }, etag: 'W/"8266d1b1f6d14ed7d9db5d31bb242532"', ttl: 1645814744243, }, "query.search.edges": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.releaseDates": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.videos": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, "query.search.edges.node.contentRatings": { cacheControl: { public: true, maxAge: 600 }, ttl: 1645786542679 }, }, }, ];
1.125
1
src/datascience-ui/native-editor/nativeEditor.tsx
lightme16/vscode-python
0
208
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; import './nativeEditor.less'; import * as React from 'react'; import { noop } from '../../client/common/utils/misc'; import { NativeCommandType } from '../../client/datascience/interactive-common/interactiveWindowTypes'; import { ContentPanel, IContentPanelProps } from '../interactive-common/contentPanel'; import { ICellViewModel, IMainState } from '../interactive-common/mainState'; import { IVariablePanelProps, VariablePanel } from '../interactive-common/variablePanel'; import { ErrorBoundary } from '../react-common/errorBoundary'; import { Image, ImageName } from '../react-common/image'; import { ImageButton } from '../react-common/imageButton'; import { getLocString } from '../react-common/locReactSide'; import { Progress } from '../react-common/progress'; import { getSettings } from '../react-common/settingsReactSide'; import { AddCellLine } from './addCellLine'; import { NativeCell } from './nativeCell'; import { NativeEditorStateController } from './nativeEditorStateController'; // See the discussion here: https://github.com/Microsoft/tslint-microsoft-contrib/issues/676 // tslint:disable: react-this-binding-issue // tslint:disable-next-line:no-require-imports no-var-requires const debounce = require('lodash/debounce') as typeof import('lodash/debounce'); interface INativeEditorProps { skipDefault: boolean; testMode?: boolean; codeTheme: string; baseTheme: string; } export class NativeEditor extends React.Component<INativeEditorProps, IMainState> { // Public so can access it from test code public stateController: NativeEditorStateController; private renderCount: number = 0; private mainPanelRef: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>(); private contentPanelScrollRef: React.RefObject<HTMLElement> = React.createRef<HTMLElement>(); private contentPanelRef: React.RefObject<ContentPanel> = React.createRef<ContentPanel>(); private debounceUpdateVisibleCells = debounce(this.updateVisibleCells.bind(this), 100); private cellRefs: Map<string, React.RefObject<NativeCell>> = new Map<string, React.RefObject<NativeCell>>(); private cellContainerRefs: Map<string, React.RefObject<HTMLDivElement>> = new Map<string, React.RefObject<HTMLDivElement>>(); private initialVisibilityUpdate: boolean = false; constructor(props: INativeEditorProps) { super(props); // Create our state controller. It manages updating our state. this.stateController = new NativeEditorStateController({ skipDefault: this.props.skipDefault, testMode: this.props.testMode ? true : false, expectingDark: this.props.baseTheme !== 'vscode-light', setState: this.setState.bind(this), activate: this.activated.bind(this), scrollToCell: this.scrollToCell.bind(this), defaultEditable: true, hasEdit: false, enableGather: false }); // Default our state. this.state = this.stateController.getState(); } public shouldComponentUpdate(_nextProps: INativeEditorProps, nextState: IMainState): boolean { return this.stateController.requiresUpdate(this.state, nextState); } public componentDidMount() { window.addEventListener('keydown', this.mainKeyDown); window.addEventListener('resize', () => this.forceUpdate(), true); } public componentWillUnmount() { window.removeEventListener('keydown', this.mainKeyDown); window.removeEventListener('resize', () => this.forceUpdate()); // Dispose of our state controller so it stops listening this.stateController.dispose(); } public render() { const dynamicFont: React.CSSProperties = { fontSize: this.state.font.size, fontFamily: this.state.font.family }; // If in test mode, update our count. Use this to determine how many renders a normal update takes. if (this.props.testMode) { this.renderCount = this.renderCount + 1; } // Update the state controller with our new state this.stateController.renderUpdate(this.state); const progressBar = this.state.busy && !this.props.testMode ? <Progress /> : undefined; const insertAboveFirst = () => { const cellId = this.state.cellVMs.length > 0 ? this.state.cellVMs[0].cell.id : undefined; const newCell = this.stateController.insertAbove(cellId, true); if (newCell) { this.selectCell(newCell); } }; const addCellLine = this.state.cellVMs.length === 0 ? null : <AddCellLine includePlus={true} className='add-cell-line-top' click={insertAboveFirst} baseTheme={this.props.baseTheme}/>; return ( <div id='main-panel' ref={this.mainPanelRef} role='Main' style={dynamicFont}> <div className='styleSetter'> <style> {this.state.rootCss} </style> </div> <header id='main-panel-toolbar'> {this.renderToolbarPanel()} {progressBar} </header> <section id='main-panel-variable' aria-label={getLocString('DataScience.collapseVariableExplorerLabel', 'Variables')}> {this.renderVariablePanel(this.props.baseTheme)} </section> <main id='main-panel-content' onScroll={this.onContentScroll} ref={this.contentPanelScrollRef}> {addCellLine} {this.renderContentPanel(this.props.baseTheme)} </main> </div> ); } private activated = () => { // Make sure the input cell gets focus if (getSettings && getSettings().allowInput) { // Delay this so that we make sure the outer frame has focus first. setTimeout(() => { // First we have to give ourselves focus (so that focus actually ends up in the code cell) if (this.mainPanelRef && this.mainPanelRef.current) { this.mainPanelRef.current.focus({preventScroll: true}); } }, 100); } } private scrollToCell(_id: string) { // Not used in the native editor noop(); } private moveSelectionToExisting = (cellId: string) => { // Cell should already exist in the UI if (this.contentPanelRef) { const wasFocused = this.state.focusedCellId !== undefined; this.stateController.selectCell(cellId, wasFocused ? cellId : undefined); this.focusCell(cellId, wasFocused ? true : false); } } private selectCell = (id: string) => { // Check to see that this cell already exists in our window (it's part of the rendered state) const cells = this.state.cellVMs.map(c => c.cell).filter(c => c.data.cell_type !== 'messages'); if (cells.find(c => c.id === id)) { // Force selection change right now as we don't need the cell to exist // to make it selected (otherwise we'll get a flash) const wasFocused = this.state.focusedCellId !== undefined; this.stateController.selectCell(id, wasFocused ? id : undefined); // Then wait to give it actual input focus setTimeout(() => this.moveSelectionToExisting(id), 1); } else { this.moveSelectionToExisting(id); } } // tslint:disable: react-this-binding-issue private renderToolbarPanel() { const addCell = () => { const newCell = this.stateController.addNewCell(); this.stateController.sendCommand(NativeCommandType.AddToEnd, 'mouse'); if (newCell) { this.stateController.selectCell(newCell.cell.id, newCell.cell.id); } }; const runAll = () => { this.stateController.runAll(); this.stateController.sendCommand(NativeCommandType.RunAll, 'mouse'); }; const toggleVariableExplorer = () => { this.stateController.toggleVariableExplorer(); this.stateController.sendCommand(NativeCommandType.ToggleVariableExplorer, 'mouse'); }; const variableExplorerTooltip = this.state.variablesVisible ? getLocString('DataScience.collapseVariableExplorerTooltip', 'Hide variables active in jupyter kernel') : getLocString('DataScience.expandVariableExplorerTooltip', 'Show variables active in jupyter kernel'); return ( <div id='toolbar-panel'> <div className='toolbar-menu-bar'> <ImageButton baseTheme={this.props.baseTheme} onClick={this.stateController.restartKernel} className='native-button' tooltip={getLocString('DataScience.restartServer', 'Restart IPython kernel')}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.Restart} /> </ImageButton> <ImageButton baseTheme={this.props.baseTheme} onClick={this.stateController.interruptKernel} className='native-button' tooltip={getLocString('DataScience.interruptKernel', 'Interrupt IPython kernel')}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.Interrupt} /> </ImageButton> <ImageButton baseTheme={this.props.baseTheme} onClick={addCell} className='native-button' tooltip={getLocString('DataScience.addNewCell', 'Insert cell')}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.InsertBelow} /> </ImageButton> <ImageButton baseTheme={this.props.baseTheme} onClick={runAll} className='native-button' tooltip={getLocString('DataScience.runAll', 'Run All Cells')}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.RunAll} /> </ImageButton> <ImageButton baseTheme={this.props.baseTheme} onClick={this.stateController.clearAllOutputs} disabled={!this.stateController.canClearAllOutputs} className='native-button' tooltip={getLocString('DataScience.clearAllOutput', 'Clear All Output')}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.ClearAllOutput} /> </ImageButton> <ImageButton baseTheme={this.props.baseTheme} onClick={toggleVariableExplorer} className='native-button' tooltip={variableExplorerTooltip}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.VariableExplorer} /> </ImageButton> <ImageButton baseTheme={this.props.baseTheme} onClick={this.stateController.save} disabled={!this.state.dirty} className='native-button' tooltip={getLocString('DataScience.save', 'Save File')}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.SaveAs} /> </ImageButton> <ImageButton baseTheme={this.props.baseTheme} onClick={this.stateController.export} disabled={!this.stateController.canExport()} className='save-button' tooltip={getLocString('DataScience.exportAsPythonFileTooltip', 'Save As Python File')}> <Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.ExportToPython} /> </ImageButton> </div> <div className='toolbar-divider'/> </div> ); } private renderVariablePanel(baseTheme: string) { if (this.state.variablesVisible) { const variableProps = this.getVariableProps(baseTheme); return <VariablePanel {...variableProps} />; } return null; } private renderContentPanel(baseTheme: string) { // Skip if the tokenizer isn't finished yet. It needs // to finish loading so our code editors work. if (!this.state.tokenizerLoaded && !this.props.testMode) { return null; } // Otherwise render our cells. const contentProps = this.getContentProps(baseTheme); return <ContentPanel {...contentProps} ref={this.contentPanelRef}/>; } private getContentProps = (baseTheme: string): IContentPanelProps => { return { baseTheme: baseTheme, cellVMs: this.state.cellVMs, history: this.state.history, testMode: this.props.testMode, codeTheme: this.props.codeTheme, submittedText: this.state.submittedText, skipNextScroll: this.state.skipNextScroll ? true : false, editable: true, renderCell: this.renderCell, scrollToBottom: this.scrollDiv }; } private getVariableProps = (baseTheme: string): IVariablePanelProps => { return { variables: this.state.variables, pendingVariableCount: this.state.pendingVariableCount, debugging: this.state.debugging, busy: this.state.busy, showDataExplorer: this.stateController.showDataViewer, skipDefault: this.props.skipDefault, testMode: this.props.testMode, closeVariableExplorer: this.stateController.toggleVariableExplorer, baseTheme: baseTheme }; } private onContentScroll = (_event: React.UIEvent<HTMLDivElement>) => { if (this.contentPanelScrollRef.current) { this.debounceUpdateVisibleCells(); } } private updateVisibleCells() { if (this.contentPanelScrollRef.current && this.cellContainerRefs.size !== 0) { const visibleTop = this.contentPanelScrollRef.current.offsetTop + this.contentPanelScrollRef.current.scrollTop; const visibleBottom = visibleTop + this.contentPanelScrollRef.current.clientHeight; const cellVMs = [...this.state.cellVMs]; // Go through the cell divs and find the ones that are suddenly visible let makeChange = false; for (let i = 0; i < cellVMs.length; i += 1) { const cellVM = cellVMs[i]; if (cellVM.useQuickEdit && this.cellRefs.has(cellVM.cell.id)) { const ref = this.cellContainerRefs.get(cellVM.cell.id); if (ref && ref.current) { const top = ref.current.offsetTop; const bottom = top + ref.current.offsetHeight; if (top > visibleBottom) { break; } else if (bottom < visibleTop) { continue; } else { cellVMs[i] = {...cellVM, useQuickEdit: false }; makeChange = true; } } } } // update our state so that newly visible items appear if (makeChange) { this.setState({cellVMs}); } } } private mainKeyDown = (event: KeyboardEvent) => { // Handler for key down presses in the main panel switch (event.key) { // tslint:disable-next-line: no-suspicious-comment // TODO: How to have this work for when the keyboard shortcuts are changed? case 's': if (event.ctrlKey) { // This is save, save our cells this.stateController.save(); } break; default: break; } } // private copyToClipboard = (cellId: string) => { // const cell = this.stateController.findCell(cellId); // if (cell) { // // Need to do this in this process so it copies to the user's clipboard and not // // the remote clipboard where the extension is running // const textArea = document.createElement('textarea'); // textArea.value = concatMultilineString(cell.cell.data.source); // document.body.appendChild(textArea); // textArea.select(); // document.execCommand('Copy'); // textArea.remove(); // } // } // private pasteFromClipboard = (cellId: string) => { // const editedCells = this.state.cellVMs; // const index = editedCells.findIndex(x => x.cell.id === cellId) + 1; // if (index > -1) { // const textArea = document.createElement('textarea'); // document.body.appendChild(textArea); // textArea.select(); // document.execCommand('Paste'); // editedCells[index].cell.data.source = textArea.value.split(/\r?\n/); // textArea.remove(); // } // this.setState({ // cellVMs: editedCells // }); // } private renderCell = (cellVM: ICellViewModel, index: number): JSX.Element | null => { const cellRef : React.RefObject<NativeCell> = React.createRef<NativeCell>(); const containerRef = React.createRef<HTMLDivElement>(); this.cellRefs.set(cellVM.cell.id, cellRef); this.cellContainerRefs.set(cellVM.cell.id, containerRef); const addNewCell = () => { const newCell = this.stateController.insertBelow(cellVM.cell.id, true); this.stateController.sendCommand(NativeCommandType.AddToEnd, 'mouse'); if (newCell) { this.selectCell(newCell); } }; const lastLine = index === this.state.cellVMs.length - 1 ? <AddCellLine includePlus={true} baseTheme={this.props.baseTheme} className='add-cell-line-cell' click={addNewCell} /> : null; // Special case, see if our initial load is finally complete. if (this.state.loadTotal && this.cellRefs.size >= this.state.loadTotal && !this.initialVisibilityUpdate) { // We are finally at the point where we have rendered all visible cells. Try fixing up their visible state this.initialVisibilityUpdate = true; this.debounceUpdateVisibleCells(); } return ( <div key={index} id={cellVM.cell.id} ref={containerRef}> <ErrorBoundary key={index}> <NativeCell ref={cellRef} role='listitem' stateController={this.stateController} maxTextSize={getSettings().maxOutputSize} autoFocus={false} testMode={this.props.testMode} cellVM={cellVM} baseTheme={this.props.baseTheme} codeTheme={this.props.codeTheme} monacoTheme={this.state.monacoTheme} focusCell={this.focusCell} selectCell={this.selectCell} lastCell={lastLine !== null} font={this.state.font} /> </ErrorBoundary> {lastLine} </div>); } private focusCell = (cellId: string, focusCode: boolean): void => { this.stateController.selectCell(cellId, focusCode ? cellId : undefined); const ref = this.cellRefs.get(cellId); if (ref && ref.current) { ref.current.giveFocus(focusCode); } } private scrollDiv = (_div: HTMLDivElement) => { if (this.state.newCellId) { const newCell = this.state.newCellId; this.stateController.setState({newCell: undefined}); // Bounce this so state has time to update. setTimeout(() => { this.focusCell(newCell, true); }, 10); } } }
1.304688
1
framework/dist-node/controller/index.d.ts
Atomicwallet/lisk-sdk
4
216
export { Controller } from './controller'; export { InMemoryChannel, IPCChannel } from './channels';
0.170898
0
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
920
Edit dataset card