index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/decorators/PageDecorator.tsx | import { HelmetProvider } from 'react-helmet-async';
import { MemoryRouter, Route, Routes } from 'react-router-dom';
import { Decorator } from '@storybook/react';
import { ClientConfigProvider } from '~/modules/client-config/components/ClientConfigProvider';
import { DefaultLayout } from '~/modules/ui/layout/page/Defa... | 2,800 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/decorators/RootDecorator.tsx | import { ApolloProvider } from '@apollo/client';
import { Decorator } from '@storybook/react';
import { RecoilRoot } from 'recoil';
import { ApolloMetadataClientProvider } from '@/object-metadata/components/ApolloMetadataClientProvider';
import { InitializeHotkeyStorybookHookEffect } from '../InitializeHotkeyStoryboo... | 2,801 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/activities.ts | import { Activity } from '@/activities/types/Activity';
import { ActivityTarget } from '@/activities/types/ActivityTarget';
import { Comment } from '@/activities/types/Comment';
import { Company } from '@/companies/types/Company';
import { Person } from '@/people/types/Person';
import { WorkspaceMember } from '@/worksp... | 2,802 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/api-keys.ts | import { ApiKey } from '@/settings/developers/types/ApiKey';
type MockedApiKey = Pick<
ApiKey,
'id' | 'name' | 'createdAt' | 'updatedAt' | 'expiresAt'
>;
export const mockedApiKeys: Array<MockedApiKey> = [
{
id: 'f7c6d736-8fcd-4e9c-ab99-28f6a9031570',
name: 'Zapier Integration',
createdAt: '2023-04-2... | 2,803 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/companies.ts | import { Company } from '@/companies/types/Company';
import { Favorite } from '@/favorites/types/Favorite';
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { mockedUsersData } from './users';
type MockedCompany = Pick<
Company,
| 'id'
| 'name'
| 'domainName'
| 'createdAt'
... | 2,804 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/index.ts | import { isObject, isString } from '@sniptt/guards';
import { GraphQLVariables } from 'msw';
import { isDefined } from '../../utils/isDefined';
type StringFilter = {
equals?: string;
contains?: string;
in?: Array<string>;
notIn?: Array<string>;
};
const filterData = <DataT>(
data: Array<DataT>,
where: Re... | 2,805 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/jwt.ts | export const mockedUserJWT =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzNzRmZTNhNS1kZjFlLTQxMTktYWZlMC0yYTYyYTJiYTQ4MWUiLCJ3b3Jrc3BhY2VJZCI6InR3ZW50eS03ZWQ5ZDIxMi0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJpYXQiOjE2ODY5OTMxODIsImV4cCI6MTY4Njk5MzQ4Mn0.F_FD6nJ5fssR_47v2XFhtzqjr-wrEQpqaWVq8iIlLJw';
| 2,806 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/metadata.ts | export const mockedCompaniesMetadata = {
node: {
id: 'a3195559-cc20-4749-9565-572a2f506581',
dataSourceId: '',
nameSingular: 'company',
namePlural: 'companies',
labelSingular: 'Company',
labelPlural: 'Companies',
description: null,
icon: 'IconBuildingSkyscraper',
isCustom: false,
... | 2,807 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/people.ts | import { Company } from '@/companies/types/Company';
import { Person } from '@/people/types/Person';
type RequiredAndNotNull<T> = {
[P in keyof T]-?: Exclude<T[P], null | undefined>;
};
type MockedPerson = RequiredAndNotNull<
Pick<
Person,
| 'id'
| 'name'
| 'linkedinLink'
| 'xLink'
| 'jobT... | 2,808 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/users.ts | import { Activity } from '@/activities/types/Activity';
import { Attachment } from '@/attachments/types/Attachment';
import { Company } from '@/companies/types/Company';
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { User, Workspace } from '~/generated/graphql';
type MockedUser = ... | 2,809 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/view-fields.ts | import { mockedViewsData } from './views';
export const mockedViewFieldsData = [
// Companies
{
id: '79035310-e955-4986-a4a4-73f9d9949c6a',
fieldMetadataId: 'name',
viewId: mockedViewsData[0].id,
position: 0,
isVisible: true,
size: 180,
},
{
id: '2a96bbc8-d86d-439a-8e50-4b07ebd27750... | 2,810 |
0 | petrpan-code/twentyhq/twenty/front/src/testing | petrpan-code/twentyhq/twenty/front/src/testing/mock-data/views.ts | export const mockedViewsData = [
{
id: '37a8a866-eb17-4e76-9382-03143a2f6a80',
name: 'All companies',
objectMetadataId: 'company',
type: 'table',
},
{
id: '6095799e-b48f-4e00-b071-10818083593a',
name: 'All people',
objectMetadataId: 'person',
type: 'table',
},
{
id: 'e26f66... | 2,811 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/types/ComponentParameters.ts | export type ComponentParameters<
ComponentTypeToExtract extends (args: object) => JSX.Element,
> = Parameters<ComponentTypeToExtract>[0];
| 2,812 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/types/Nullable.ts | export type Nullable<T> = T | null | undefined;
| 2,813 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/types/ScopeContextProps.ts | export type ScopeContextProps<T = unknown> = {
scopeId: string;
} & T;
| 2,814 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/assert.ts | export const assertNotNull = <T>(item: T): item is NonNullable<T> =>
item !== null && item !== undefined;
| 2,815 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/cast-as-integer-or-null.ts | import { isNull, isNumber, isString } from '@sniptt/guards';
import { logError } from './logError';
const DEBUG_MODE = false;
export const canBeCastAsIntegerOrNull = (
probableNumberOrNull: string | undefined | number | null,
): probableNumberOrNull is number | null => {
if (probableNumberOrNull === undefined) {... | 2,816 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/cast-as-positive-integer-or-null.ts | import { isInteger, isNull, isNumber, isString } from '@sniptt/guards';
export const canBeCastAsPositiveIntegerOrNull = (
probablePositiveNumberOrNull: string | undefined | number | null,
): probablePositiveNumberOrNull is number | null => {
if (probablePositiveNumberOrNull === undefined) {
return false;
}
... | 2,817 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/convert-currency-amount.ts | import { isUndefined } from '@sniptt/guards';
export const convertCurrencyToCurrencyMicros = (
currencyAmount: number | undefined,
) => {
if (!currencyAmount) {
return undefined;
}
const currencyAmountAsNumber = +currencyAmount;
if (isNaN(currencyAmountAsNumber)) {
throw new Error(`Cannot convert ${c... | 2,818 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/cookie-storage.ts | import Cookies, { CookieAttributes } from 'js-cookie';
class CookieStorage {
private keys: Set<string> = new Set();
getItem(key: string): string | undefined {
return Cookies.get(key);
}
setItem(key: string, value: string, attributes?: CookieAttributes): void {
this.keys.add(key);
Cookies.set(key,... | 2,819 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/date-utils.ts | import { isDate, isNumber, isString } from '@sniptt/guards';
import { differenceInCalendarDays, formatDistanceToNow } from 'date-fns';
import { DateTime } from 'luxon';
import { logError } from './logError';
export const DEFAULT_DATE_LOCALE = 'en-EN';
export const parseDate = (dateToParse: Date | string | number) =>... | 2,820 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/debounce.ts | export const debounce = <FuncArgs extends any[]>(
func: (...args: FuncArgs) => void,
delay: number,
) => {
let timeoutId: ReturnType<typeof setTimeout>;
return (...args: FuncArgs) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
func(...args);
}, delay);
};
};
| 2,821 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/index.ts | import { parseDate } from './date-utils';
export const formatToHumanReadableDate = (date: Date | string) => {
const parsedJSDate = parseDate(date).toJSDate();
return new Intl.DateTimeFormat(undefined, {
month: 'short',
day: 'numeric',
year: 'numeric',
}).format(parsedJSDate);
};
export const saniti... | 2,822 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/is-domain.ts | import { isDefined } from './isDefined';
export const isDomain = (url: string | undefined | null) =>
isDefined(url) &&
/^((?!-))(xn--)?[a-z0-9][a-z0-9-_]{0,61}[a-z0-9]{0,1}\.(xn--)?([a-z0-9-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$/.test(
url,
);
| 2,823 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/is-url.ts | import { isDefined } from './isDefined';
export const isURL = (url: string | undefined | null) =>
isDefined(url) &&
url.match(
/^(https?:\/\/)?(www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/i,
);
| 2,824 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/isDeeplyEqual.ts | import deepEqual from 'deep-equal';
export const isDeeplyEqual = <T>(a: T, b: T) => deepEqual(a, b);
| 2,825 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/isDefined.ts | export const isDefined = <T>(
value: T | undefined | null,
): value is NonNullable<T> => value !== undefined && value !== null;
| 2,826 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/isNonEmptyArray.ts | export const isNonEmptyArray = <T>(
probableArray: T[] | readonly T[] | undefined | null,
): probableArray is NonNullable<T[]> => {
if (
Array.isArray(probableArray) &&
probableArray.length &&
probableArray.length > 0
) {
return true;
}
return false;
};
| 2,827 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/logDebug.ts | /* eslint-disable no-console */
export const logDebug = (message: any, ...optionalParams: any[]) => {
console.debug(message, optionalParams);
};
| 2,828 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/logError.ts | /* eslint-disable no-console */
export const logError = (message: any) => {
console.error(message);
};
| 2,829 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/measureTotalFrameLoad.ts | /* eslint-disable no-console */
import afterFrame from 'afterframe';
export const measureTotalFrameLoad = (id: string) => {
const timerId = `Total loading time for : ${id}`;
console.time(timerId);
afterFrame(() => {
console.timeEnd(timerId);
});
};
| 2,830 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/promise-to-observable.ts | import { Observable } from '@apollo/client';
export const promiseToObservable = <T>(promise: Promise<T>) =>
new Observable<T>((subscriber) => {
promise.then(
(value) => {
if (subscriber.closed) {
return;
}
subscriber.next(value);
subscriber.complete();
},
... | 2,831 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/recoil-effects.ts | import { AtomEffect } from 'recoil';
import { cookieStorage } from '~/utils/cookie-storage';
export const localStorageEffect =
<T>(key: string): AtomEffect<T> =>
({ setSelf, onSet }) => {
const savedValue = localStorage.getItem(key);
if (savedValue != null) {
setSelf(JSON.parse(savedValue));
}
... | 2,832 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/string-to-hsl.ts | export const stringToHslColor = (
str: string,
saturation: number,
lightness: number,
) => {
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
}
const h = hash % 360;
return 'hsl(' + h + ', ' + saturation + '%, ' + lightness + '%)';
};
| 2,833 |
0 | petrpan-code/twentyhq/twenty/front/src | petrpan-code/twentyhq/twenty/front/src/utils/title-utils.ts | import { AppBasePath } from '@/types/AppBasePath';
import { AppPath } from '@/types/AppPath';
import { SettingsPath } from '@/types/SettingsPath';
export const getPageTitleFromPath = (pathname: string): string => {
switch (pathname) {
case AppPath.Verify:
return 'Verify';
case AppPath.SignIn:
ret... | 2,834 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/__tests__/cast-as-integer-or-null.test.ts | import {
canBeCastAsIntegerOrNull,
castAsIntegerOrNull,
} from '../cast-as-integer-or-null';
describe('canBeCastAsIntegerOrNull', () => {
it(`should return true if null`, () => {
expect(canBeCastAsIntegerOrNull(null)).toBeTruthy();
});
it(`should return true if number`, () => {
expect(canBeCastAsInt... | 2,835 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/__tests__/cast-as-positive-integer-or-null.test.ts | import {
canBeCastAsPositiveIntegerOrNull,
castAsPositiveIntegerOrNull,
} from '~/utils/cast-as-positive-integer-or-null';
describe('canBeCastAsPositiveIntegerOrNull', () => {
it(`should return true if null`, () => {
expect(canBeCastAsPositiveIntegerOrNull(null)).toBeTruthy();
});
it(`should return true... | 2,836 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/__tests__/date-utils.test.ts | import { formatDistanceToNow } from 'date-fns';
import { DateTime } from 'luxon';
import {
beautifyDateDiff,
beautifyExactDate,
beautifyExactDateTime,
beautifyPastDateAbsolute,
beautifyPastDateRelativeToNow,
DEFAULT_DATE_LOCALE,
hasDatePassed,
parseDate,
} from '../date-utils';
import { logError } from... | 2,837 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/__tests__/is-domain.test.ts | import { isDomain } from '~/utils/is-domain';
describe('isDomain', () => {
it(`should return false if null`, () => {
expect(isDomain(null)).toBeFalsy();
});
it(`should return false if undefined`, () => {
expect(isDomain(undefined)).toBeFalsy();
});
it(`should return true if string google`, () => {
... | 2,838 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/__tests__/is-url.test.ts | import { isURL } from '~/utils/is-url';
describe('isURL', () => {
it(`should return false if null`, () => {
expect(isURL(null)).toBeFalsy();
});
it(`should return false if undefined`, () => {
expect(isURL(undefined)).toBeFalsy();
});
it(`should return true if string google`, () => {
expect(isUR... | 2,839 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/__tests__/utils.test.ts | import { getLogoUrlFromDomainName, sanitizeURL } from '..';
describe('sanitizeURL', () => {
test('should sanitize the URL correctly', () => {
expect(sanitizeURL('http://example.com/')).toBe('example.com');
expect(sanitizeURL('https://www.example.com/')).toBe('example.com');
expect(sanitizeURL('www.exampl... | 2,840 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/format/number.ts | export const formatNumber = (value: number): string => value.toLocaleString();
| 2,841 |
0 | petrpan-code/twentyhq/twenty/front/src/utils/format | petrpan-code/twentyhq/twenty/front/src/utils/format/__tests__/number.test.ts | import { formatNumber } from '../number';
// This tests the en-US locale by default
describe('formatNumber', () => {
it(`Should format 123 correctly`, () => {
expect(formatNumber(123)).toEqual('123');
});
it(`Should format decimal numbers correctly`, () => {
expect(formatNumber(123.92)).toEqual('123.92')... | 2,842 |
0 | petrpan-code/twentyhq/twenty/front/src/utils | petrpan-code/twentyhq/twenty/front/src/utils/string/capitalize.ts | import { isNonEmptyString } from '@sniptt/guards';
export const capitalize = (stringToCapitalize: string) => {
if (!isNonEmptyString(stringToCapitalize)) return '';
return stringToCapitalize[0].toUpperCase() + stringToCapitalize.slice(1);
};
| 2,843 |
0 | petrpan-code/twentyhq/twenty/infra/build | petrpan-code/twentyhq/twenty/infra/build/docs/Dockerfile | FROM node:18.16.0-alpine as docs
WORKDIR /app/docs
ARG SHOULD_INDEX_DOC
COPY ./docs/package.json .
COPY ./docs/yarn.lock .
RUN yarn install
COPY ./docs .
RUN npm run build
RUN yarn global add serve
LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
LABEL org.opencontainers.image.description="... | 2,844 |
0 | petrpan-code/twentyhq/twenty/infra/build | petrpan-code/twentyhq/twenty/infra/build/front/Dockerfile | FROM node:18.16.0-alpine as build
ARG REACT_APP_SERVER_BASE_URL
ARG REACT_APP_SERVER_AUTH_URL
ARG REACT_APP_SERVER_FILES_URL
COPY ./packages/ /app/packages
WORKDIR /app/front
COPY ./front .
RUN yarn install
RUN yarn build
COPY ./infra/build/front/serve.json ./build
FROM node:18.16.0-alpine as front
WORKDIR /app/... | 2,845 |
0 | petrpan-code/twentyhq/twenty/infra/build | petrpan-code/twentyhq/twenty/infra/build/front/serve.json | {
"rewrites": [
{ "source": "!static/**", "destination": "/index.html" }
],
"directoryListing": false
} | 2,846 |
0 | petrpan-code/twentyhq/twenty/infra/build | petrpan-code/twentyhq/twenty/infra/build/postgres/Dockerfile | ARG IMAGE_TAG='15.4.0-debian-11-r45'
FROM bitnami/postgresql:${IMAGE_TAG}
ARG PG_MAIN_VERSION=15
ARG PG_GRAPHQL_VERSION=1.3.0
ARG TARGETARCH
USER root
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
aarch64|arm64) \
TARGETARCH='arm64'; \
;; \
amd64|... | 2,847 |
0 | petrpan-code/twentyhq/twenty/infra/build | petrpan-code/twentyhq/twenty/infra/build/postgres/init.sql | SELECT 'CREATE DATABASE "default"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'default')\gexec
SELECT 'CREATE DATABASE "test"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'test')\gexec
SELECT 'CREATE USER twenty PASSWORD ''twenty'''
WHERE NOT EXISTS (SELECT FROM pg_user WHERE usename = 't... | 2,848 |
0 | petrpan-code/twentyhq/twenty/infra/build | petrpan-code/twentyhq/twenty/infra/build/server/Dockerfile | FROM node:18.16.0-alpine as build
WORKDIR /app/server
COPY ./server/package.json ./
COPY ./server/yarn.lock ./
COPY ./server/patches ./patches
RUN yarn install
COPY ./server .
RUN yarn build
LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
LABEL org.opencontainers.image.description="This imag... | 2,849 |
0 | petrpan-code/twentyhq/twenty/infra | petrpan-code/twentyhq/twenty/infra/dev/Makefile | build:
@docker compose down
rm -rf ../../front/node_modules
rm -rf ../../server/node_modules
rm -rf ../../docs/node_modules
@docker volume rm twenty_node_modules_front > /dev/null 2>&1 || true
@docker volume rm twenty_node_modules_server > /dev/null 2>&1 || true
@docker volume rm twenty_node_modules_docs > /dev... | 2,850 |
0 | petrpan-code/twentyhq/twenty/infra | petrpan-code/twentyhq/twenty/infra/dev/docker-compose.yml | version: "3.9"
services:
twenty-dev:
build:
context: ../..
dockerfile: ./infra/dev/twenty-dev/Dockerfile
ports:
- "3000:3000"
- "3001:3001"
- "6006:6006"
volumes:
- ../..:/app
- /app/front/node_modules
- /app/server/node_modules
depends_on:
- post... | 2,851 |
0 | petrpan-code/twentyhq/twenty/infra/dev | petrpan-code/twentyhq/twenty/infra/dev/postgres/Dockerfile | ARG PG_MAIN_VERSION=14
FROM postgres:${PG_MAIN_VERSION} as postgres
ARG PG_MAIN_VERSION
ARG PG_GRAPHQL_VERSION=1.3.0
ARG TARGETARCH
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
aarch64|arm64) \
TARGETARCH='arm64'; \
;; \
amd64|x86_64) \
T... | 2,852 |
0 | petrpan-code/twentyhq/twenty/infra/dev | petrpan-code/twentyhq/twenty/infra/dev/postgres/init.sql | SELECT 'CREATE DATABASE "default"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'default')\gexec
SELECT 'CREATE DATABASE "test"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'test')\gexec
SELECT 'CREATE USER twenty PASSWORD ''twenty'''
WHERE NOT EXISTS (SELECT FROM pg_user WHERE usename = 't... | 2,853 |
0 | petrpan-code/twentyhq/twenty/infra/dev | petrpan-code/twentyhq/twenty/infra/dev/scripts/setup-postgres-linux.sh | #!/bin/bash
# Colors
RED=31
GREEN=32
BLUE=34
# Function to display colored output
function echo_header {
COLOR=$1
MESSAGE=$2
echo -e "\e[${COLOR}m\n=======================================================\e[0m"
echo -e "\e[${COLOR}m${MESSAGE}\e[0m"
echo -e "\e[${COLOR}m=============================... | 2,854 |
0 | petrpan-code/twentyhq/twenty/infra/dev | petrpan-code/twentyhq/twenty/infra/dev/scripts/setup-postgres-macos.sh | #!/bin/bash
# Colors
RED=31
GREEN=32
BLUE=34
# Function to display colored output
function echo_header {
COLOR=$1
MESSAGE=$2
echo -e "\e[${COLOR}m\n=======================================================\e[0m"
echo -e "\e[${COLOR}m${MESSAGE}\e[0m"
echo -e "\e[${COLOR}m=============================... | 2,855 |
0 | petrpan-code/twentyhq/twenty/infra/dev | petrpan-code/twentyhq/twenty/infra/dev/twenty-dev/Dockerfile | FROM node:18.16-bullseye as twenty-dev
COPY /../../packages /app/packages
WORKDIR /app/front
COPY ../../front/package.json .
COPY ../../front/yarn.lock .
RUN yarn install
RUN npx playwright install-deps
WORKDIR /app/server
COPY ../../server/package.json .
COPY ../../server/yarn.lock .
COPY ../../server/patches ./... | 2,856 |
0 | petrpan-code/twentyhq/twenty/infra/dev | petrpan-code/twentyhq/twenty/infra/dev/twenty-docs/Dockerfile | FROM node:18.16-bullseye as docs
WORKDIR /app/docs
COPY ../../docs/package.json .
COPY ../../docs/yarn.lock .
RUN yarn
COPY ../../docs .
CMD ["yarn", "start"] | 2,857 |
0 | petrpan-code/twentyhq/twenty/infra/prod | petrpan-code/twentyhq/twenty/infra/prod/front/Dockerfile | FROM --platform=linux/amd64 twentycrm/twenty-front as front
CMD ["/bin/sh", "-c", "/app/front/scripts/inject-runtime-env.sh && serve build"]
| 2,858 |
0 | petrpan-code/twentyhq/twenty/infra/prod | petrpan-code/twentyhq/twenty/infra/prod/postgres/Dockerfile | ARG PG_MAIN_VERSION=14
FROM postgres:${PG_MAIN_VERSION} as postgres
ARG PG_MAIN_VERSION
ARG PG_GRAPHQL_VERSION=1.3.0
ARG TARGETARCH
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
aarch64|arm64) \
TARGETARCH='arm64'; \
;; \
amd64|x86_64) \
T... | 2,859 |
0 | petrpan-code/twentyhq/twenty/infra/prod | petrpan-code/twentyhq/twenty/infra/prod/postgres/init.sql | SELECT 'CREATE DATABASE "default"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'default')\gexec
SELECT 'CREATE DATABASE "test"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'test')\gexec
SELECT 'CREATE USER twenty PASSWORD ''twenty'''
WHERE NOT EXISTS (SELECT FROM pg_user WHERE usename = 't... | 2,860 |
0 | petrpan-code/twentyhq/twenty/infra/prod | petrpan-code/twentyhq/twenty/infra/prod/server/Dockerfile | FROM --platform=linux/amd64 twentycrm/twenty-server as server
CMD ["node", "dist/src/main"]
| 2,861 |
0 | petrpan-code/twentyhq/twenty/infra | petrpan-code/twentyhq/twenty/infra/release/build-front.sh |
docker buildx build \
--push \
--no-cache \
--platform linux/amd64,linux/arm64 \
-f ./infra/build/front/Dockerfile -t twentycrm/twenty-front:0.1.5 -t twentycrm/twenty-front:latest .
| 2,862 |
0 | petrpan-code/twentyhq/twenty/infra | petrpan-code/twentyhq/twenty/infra/release/build-postgres.sh |
docker buildx build \
--push \
--no-cache \
--platform linux/amd64,linux/arm64 \
-f ./infra/build/postgres/Dockerfile -t twentycrm/twenty-postgres:0.2.0 -t twentycrm/twenty-postgres:latest .
| 2,863 |
0 | petrpan-code/twentyhq/twenty/infra | petrpan-code/twentyhq/twenty/infra/release/build-server.sh |
docker buildx build \
--push \
--no-cache \
--platform linux/amd64,linux/arm64 \
-f ./infra/build/server/Dockerfile -t twentycrm/twenty-server:0.1.5 -t twentycrm/twenty-server:latest . | 2,864 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/.eslintrc.js | module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: [
'@typescript-eslint/eslint-plugin',
'unused-imports',
'simple-import-sort',
'prefer-arrow',
],
extends: [
'plugin... | 2,865 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/index.ts | module.exports = {
rules: {
"effect-components": require("./src/rules/effect-components"),
"no-hardcoded-colors": require("./src/rules/no-hardcoded-colors"),
"matching-state-variable": require("./src/rules/matching-state-variable"),
"sort-css-properties-alphabetically": require("./src/rules/sort-css-p... | 2,866 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/jest.config.js | /** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
"moduleDirectories": ["node_modules"]
}; | 2,867 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/package.json | {
"name": "eslint-plugin-twenty",
"version": "1.0.3",
"description": "",
"main": "dist/index.js",
"files": [
"dist",
"src"
],
"scripts": {
"test": "jest",
"build": "rimraf ./dist && tsc --outDir ./dist",
"lint": "eslint src --max-warnings=0"
},
"keywords": [],
"author": "",
"l... | 2,868 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/tsconfig.json | {
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and in clude compatible library declarations. */
"module": "Node16", ... | 2,869 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@aashutoshrathi/word-wrap@^1.2.3":
version "1.2.6"
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A... | 2,870 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/rules/component-props-naming.ts | import {
AST_NODE_TYPES,
ESLintUtils,
TSESTree,
} from "@typescript-eslint/utils";
import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
const createRule = ESLintUtils.RuleCreator(
() => "https://docs.twenty.com/developer/frontend/style-guide#props",
);
const checkPropsTypeName = (
node: TSESTre... | 2,871 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/rules/effect-components.ts | import { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
const createRule = ESLintUtils.RuleCreator(() => `https://docs.twenty.com`);
const checkIsPascalCase = (input: string): boolean => {
const pascalCaseRegex = /^[A-Z][a-zA-Z0-9_]*/g;
return pascalCaseRegex.test(input);
};
type ComponentType =
| T... | 2,872 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/rules/matching-state-variable.ts | import {
AST_NODE_TYPES,
ESLintUtils,
TSESTree,
} from "@typescript-eslint/utils";
const createRule = ESLintUtils.RuleCreator(() => `https://docs.twenty.com`);
const matchingStateVariableRule = createRule({
create: (context) => {
return {
VariableDeclarator: (node: TSESTree.VariableDeclarator) => {
... | 2,873 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/rules/no-hardcoded-colors.ts | import { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
const createRule = ESLintUtils.RuleCreator(() => `https://docs.twenty.com`);
const noHardcodedColorsRule = createRule({
create: (context) => {
const testHardcodedColor = (
literal: TSESTree.Literal | TSESTree.TemplateLiteral,
) => {
... | 2,874 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/rules/no-state-useref.ts | import { ESLintUtils } from "@typescript-eslint/utils";
const createRule = ESLintUtils.RuleCreator(() => `https://docs.twenty.com`);
const noStateUseRef = createRule({
create: (context) => {
return {
CallExpression: (node) => {
if (
node.callee.type !== "Identifier" ||
node.cal... | 2,875 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/rules/sort-css-properties-alphabetically.ts | import { TSESTree } from "@typescript-eslint/utils";
import { ESLintUtils } from "@typescript-eslint/utils";
import {
RuleFix,
RuleFixer,
SourceCode,
} from "@typescript-eslint/utils/ts-eslint";
import postcss from "postcss";
const createRule = ESLintUtils.RuleCreator(() => `https://docs.twenty.com`);
interfac... | 2,876 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/rules/styled-components-prefixed-with-styled.ts | import {
AST_NODE_TYPES,
ESLintUtils,
TSESTree,
} from "@typescript-eslint/utils";
const createRule = ESLintUtils.RuleCreator(() => `https://docs.twenty.com`);
const styledComponentsPrefixedWithStyledRule = createRule({
create: (context) => {
return {
VariableDeclarator: (node: TSESTree.VariableDecl... | 2,877 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/component-props-naming.spec.ts | import { RuleTester } from "@typescript-eslint/rule-tester";
import componentPropsNamingRule from "../rules/component-props-naming";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaFeatures: {
j... | 2,878 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/effect-components.spec.ts | import { RuleTester } from "@typescript-eslint/rule-tester";
import effectComponentsRule from "../rules/effect-components";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true,... | 2,879 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/file.ts | // Required by typescript-eslint https://typescript-eslint.io/packages/rule-tester#type-aware-testing
| 2,880 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/matching-state-variable.spec.ts | import { RuleTester } from "@typescript-eslint/rule-tester";
import matchingStateVariableRule from "../rules/matching-state-variable";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaFeatures: {
... | 2,881 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/no-hardcoded-colors.spec.ts | import { RuleTester } from "@typescript-eslint/rule-tester";
import noHardcodedColorsRule from "../rules/no-hardcoded-colors";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: tr... | 2,882 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/no-state-useref.spec.ts | import { RuleTester } from "@typescript-eslint/rule-tester";
import noStateUseRefRule from "../rules/no-state-useref";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true,
... | 2,883 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/react.tsx | // Required by typescript-eslint https://typescript-eslint.io/packages/rule-tester#type-aware-testing
| 2,884 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/sort-css-properties-alphabetically.spec.ts | import { RuleTester } from "@typescript-eslint/rule-tester";
import sortCssPropertiesAlphabeticallyRule from "../rules/sort-css-properties-alphabetically";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
... | 2,885 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/styled-components-prefixed-with-styled.spec.ts | import { RuleTester } from "@typescript-eslint/rule-tester";
import styledComponentsPrefixedWithStyledRule from "../rules/styled-components-prefixed-with-styled";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirnam... | 2,886 |
0 | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src | petrpan-code/twentyhq/twenty/packages/eslint-plugin-twenty/src/tests/tsconfig.json | {
"compilerOptions": {
"strict": true
},
"include": ["./file.ts", "./react.tsx"]
} | 2,887 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-utils/dangerfile.ts | import {message, danger, warn} from "danger"
// Check if package.json was changed, but not yarn.lock
const packageChanged = danger.git.modified_files.includes('package.json');
const lockfileChanged = danger.git.modified_files.includes('yarn.lock');
if (packageChanged && !lockfileChanged) {
const message = 'Changes... | 2,888 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-utils/package.json | {
"name": "twenty-utils",
"private": true,
"scripts": {
"release": "node release.js"
},
"dependencies": {
"semver": "^7.5.4"
},
"devDependencies": {
"danger": "^11.3.0"
}
}
| 2,889 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-utils/release.js | const fs = require("fs");
const semver = require("semver");
const path = require("path");
// Get the version argument from the command line
const [, , version] = process.argv;
if (!semver.valid(version)) {
console.error(
"Invalid version. The format should be X.X.X where X is a positive integer (or 0)."
);
... | 2,890 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-utils/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@gitbeaker/core@^35.8.1":
version "35.8.1"
resolved "https://registry.yarnpkg.com/@gitbeaker/core/-/core-35.8.1.tgz#b4ce2d08d344ff50e76c38ff81b800bec6dfe851"
integrity sha512-KBrDykVKSmU9Q9Gly8KeHOgdc0lZSa435srECxuO0FGqqBcUQ82h... | 2,891 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-zapier/.env.example | SERVER_BASE_URL=http://localhost:3000
API_KEY=YOUR_API_KEY
| 2,892 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-zapier/.prettierrc | {
"singleQuote": true,
"trailingComma": "all"
}
| 2,893 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-zapier/.zapierapprc | {
"id": 193409,
"key": "App193409"
}
| 2,894 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-zapier/index.js | module.exports = require('./lib').default;
| 2,895 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-zapier/package.json | {
"name": "twenty",
"version": "1.0.0",
"description": "Effortlessly sync Twenty with 3000+ apps. Automate tasks, boost productivity, and supercharge your customer relationships!",
"main": "src/index.ts",
"scripts": {
"format": "prettier . --write \"!build\"",
"test": "yarn build && jest --testTimeout... | 2,896 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-zapier/tsconfig.json | {
"compilerOptions": {
"target": "es2019",
"module": "commonjs",
"moduleResolution": "node",
"lib": ["esnext"],
"outDir": "./lib",
"rootDir": "./src",
"strict": true
}
}
| 2,897 |
0 | petrpan-code/twentyhq/twenty/packages | petrpan-code/twentyhq/twenty/packages/twenty-zapier/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@ampproject/remapping@^2.2.0":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630"
integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBn... | 2,898 |
0 | petrpan-code/twentyhq/twenty/packages/twenty-zapier | petrpan-code/twentyhq/twenty/packages/twenty-zapier/src/authentication.ts | import { Bundle, ZObject } from 'zapier-platform-core';
import requestDb from './utils/requestDb';
const testAuthentication = async (z: ZObject, bundle: Bundle) => {
return await requestDb(
z,
bundle,
'query currentWorkspace {currentWorkspace {id displayName}}',
);
};
export default {
type: 'custom'... | 2,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.