From cafcfdc95e1ae54adab02035b0da6a300a85f859 Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Fri, 13 Oct 2023 18:01:57 +0200 Subject: [PATCH] Feat/front metadata request (#1977) * wip * Wip * Wip * Finished v1 * Fix from PR * Removed unused fragment masking feature --- front/.eslintrc.js | 2 +- front/codegen-metadata.js | 13 + front/codegen.js | 2 +- front/package.json | 4 +- front/src/generated-metadata/gql.ts | 42 + front/src/generated-metadata/graphql.ts | 823 ++++++++++++++++++ front/src/generated-metadata/index.ts | 1 + front/src/generated/graphql.tsx | 265 ++++-- front/src/index.tsx | 25 +- .../tasks/hooks/useCurrentUserDueTaskCount.ts | 9 +- .../ApolloClientMetadataProvider.tsx | 36 + .../components/FetchMetadataEffect.tsx | 37 + .../context/ApolloClientMetadataContext.ts | 5 + front/src/modules/metadata/graphql/queries.ts | 58 ++ .../metadata/hooks/useApolloClientMetadata.ts | 7 + .../metadata/states/metadataObjectsState.ts | 8 + .../modules/metadata/types/MetadataObject.ts | 5 + .../FilterDropdownEntitySearchSelect.tsx | 6 +- .../FilterDropdownOperandSelect.tsx | 4 +- .../SingleEntityFilterDropdownButton.tsx | 4 +- .../selectedOperandInDropdownScopedState.ts | 4 +- front/src/modules/ui/view-bar/types/Filter.ts | 5 +- .../ui/view-bar/types/FilterOperand.ts | 1 - .../ui/view-bar/utils/getOperandLabel.ts | 36 +- .../utils/getOperandsForFilterType.ts | 11 +- .../utils/turnFilterIntoWhereClause.ts | 21 +- front/src/pages/tasks/TasksEffect.tsx | 4 +- front/yarn.lock | 141 +++ 28 files changed, 1439 insertions(+), 140 deletions(-) create mode 100644 front/codegen-metadata.js create mode 100644 front/src/generated-metadata/gql.ts create mode 100644 front/src/generated-metadata/graphql.ts create mode 100644 front/src/generated-metadata/index.ts create mode 100644 front/src/modules/metadata/components/ApolloClientMetadataProvider.tsx create mode 100644 front/src/modules/metadata/components/FetchMetadataEffect.tsx create mode 100644 front/src/modules/metadata/context/ApolloClientMetadataContext.ts create mode 100644 front/src/modules/metadata/graphql/queries.ts create mode 100644 front/src/modules/metadata/hooks/useApolloClientMetadata.ts create mode 100644 front/src/modules/metadata/states/metadataObjectsState.ts create mode 100644 front/src/modules/metadata/types/MetadataObject.ts delete mode 100644 front/src/modules/ui/view-bar/types/FilterOperand.ts diff --git a/front/.eslintrc.js b/front/.eslintrc.js index a4780acb6..9926d52ca 100644 --- a/front/.eslintrc.js +++ b/front/.eslintrc.js @@ -58,7 +58,7 @@ module.exports = { } }, ], - ignorePatterns: ['.eslintrc.js', 'codegen.js', '**/generated/*', '*.config.js'], + ignorePatterns: ['.eslintrc.js', 'codegen*.js', '**/generated*/*', '*.config.js'], rules: { '@typescript-eslint/interface-name-prefix': 'off', '@typescript-eslint/explicit-function-return-type': 'off', diff --git a/front/codegen-metadata.js b/front/codegen-metadata.js new file mode 100644 index 000000000..45f53d86f --- /dev/null +++ b/front/codegen-metadata.js @@ -0,0 +1,13 @@ +module.exports = { + schema: process.env.REACT_APP_SERVER_BASE_URL + "/metadata", + documents: ['./src/modules/metadata/graphql/*.tsx', './src/modules/metadata/graphql/*.ts'], + overwrite: true, + generates: { + './src/generated-metadata/': { + preset: 'client', + presetConfig: { + fragmentMasking: false + } + }, + }, +}; diff --git a/front/codegen.js b/front/codegen.js index 818affe05..fe756f367 100644 --- a/front/codegen.js +++ b/front/codegen.js @@ -1,6 +1,6 @@ module.exports = { schema: process.env.REACT_APP_SERVER_BASE_URL + "/graphql", - documents: ['./src/**/*.tsx', './src/**/*.ts'], + documents: ['!./src/modules/metadata/**', './src/modules/**/*.tsx', './src/modules/**/*.ts'], overwrite: true, generates: { './src/generated/graphql.tsx': { diff --git a/front/package.json b/front/package.json index 2c2bdb357..1fc0c8af4 100644 --- a/front/package.json +++ b/front/package.json @@ -82,7 +82,8 @@ "storybook:pages:build": "STORYBOOK_STORIES_FOLDER=pages yarn storybook:build", "storybook:modules:coverage": "STORYBOOK_STORIES_FOLDER=modules yarn storybook:coverage", "storybook:pages:coverage": "STORYBOOK_STORIES_FOLDER=pages yarn storybook:coverage", - "graphql:generate": "dotenv cross-var graphql-codegen --config codegen.js", + "graphql:data:generate": "dotenv cross-var graphql-codegen -- --config codegen.js", + "graphql:metadata:generate": "dotenv cross-var graphql-codegen -- --config codegen-metadata.js", "chromatic": "dotenv cross-var npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN", "install": "yarn eslint-plugin:setup" }, @@ -126,6 +127,7 @@ "devDependencies": { "@craco/craco": "^7.1.0", "@graphql-codegen/cli": "^3.3.1", + "@graphql-codegen/client-preset": "^4.1.0", "@graphql-codegen/typescript": "^3.0.4", "@graphql-codegen/typescript-operations": "^3.0.4", "@graphql-codegen/typescript-react-apollo": "^3.3.7", diff --git a/front/src/generated-metadata/gql.ts b/front/src/generated-metadata/gql.ts new file mode 100644 index 000000000..bbab28c99 --- /dev/null +++ b/front/src/generated-metadata/gql.ts @@ -0,0 +1,42 @@ +/* eslint-disable */ +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; + +/** + * Map of all GraphQL operations in the project. + * + * This map has several performance disadvantages: + * 1. It is not tree-shakeable, so it will include all operations in the project. + * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. + * 3. It does not support dead code elimination, so it will add unused operations. + * + * Therefore it is highly recommended to use the babel or swc plugin for production. + */ +const documents = { + "\n query Objects {\n objects(paging: { first: 100 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n fields(paging: { first: 100 }) {\n edges {\n node {\n id\n type\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n": types.ObjectsDocument, +}; + +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + * + * + * @example + * ```ts + * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`); + * ``` + * + * The query argument is unknown! + * Please regenerate the types. + */ +export function graphql(source: string): unknown; + +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query Objects {\n objects(paging: { first: 100 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n fields(paging: { first: 100 }) {\n edges {\n node {\n id\n type\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n"): (typeof documents)["\n query Objects {\n objects(paging: { first: 100 }) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n fields(paging: { first: 100 }) {\n edges {\n node {\n id\n type\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n placeholder\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n totalCount\n }\n }\n"]; + +export function graphql(source: string) { + return (documents as any)[source] ?? {}; +} + +export type DocumentType> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never; \ No newline at end of file diff --git a/front/src/generated-metadata/graphql.ts b/front/src/generated-metadata/graphql.ts new file mode 100644 index 000000000..60e7e3b89 --- /dev/null +++ b/front/src/generated-metadata/graphql.ts @@ -0,0 +1,823 @@ +/* eslint-disable */ +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + /** Cursor for paging through collections */ + ConnectionCursor: { input: any; output: any; } + /** A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. */ + DateTime: { input: any; output: any; } + /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ + JSON: { input: any; output: any; } +}; + +export type Activity = { + __typename?: 'Activity'; + activityTargets?: Maybe>; + assignee?: Maybe; + assigneeId?: Maybe; + attachments?: Maybe>; + author: User; + authorId: Scalars['String']['output']; + body?: Maybe; + comments?: Maybe>; + completedAt?: Maybe; + createdAt: Scalars['DateTime']['output']; + dueAt?: Maybe; + id: Scalars['ID']['output']; + reminderAt?: Maybe; + title?: Maybe; + type: ActivityType; + updatedAt: Scalars['DateTime']['output']; + workspaceMemberAssignee?: Maybe; + workspaceMemberAssigneeId?: Maybe; + workspaceMemberAuthor?: Maybe; + workspaceMemberAuthorId?: Maybe; +}; + +export type ActivityTarget = { + __typename?: 'ActivityTarget'; + activity: Activity; + activityId: Scalars['String']['output']; + company?: Maybe; + companyId?: Maybe; + createdAt: Scalars['DateTime']['output']; + id: Scalars['ID']['output']; + person?: Maybe; + personId?: Maybe; + updatedAt: Scalars['DateTime']['output']; +}; + +export enum ActivityType { + Note = 'Note', + Task = 'Task' +} + +export type ApiKey = { + __typename?: 'ApiKey'; + createdAt: Scalars['DateTime']['output']; + expiresAt?: Maybe; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + updatedAt: Scalars['DateTime']['output']; +}; + +export type Attachment = { + __typename?: 'Attachment'; + activity?: Maybe; + activityId?: Maybe; + author: User; + authorId: Scalars['String']['output']; + company?: Maybe; + companyId?: Maybe; + createdAt: Scalars['DateTime']['output']; + fullPath: Scalars['String']['output']; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + person?: Maybe; + personId?: Maybe; + type: AttachmentType; + updatedAt: Scalars['DateTime']['output']; + workspace: Workspace; + workspaceMemberAuthor?: Maybe; + workspaceMemberAuthorId?: Maybe; +}; + +export enum AttachmentType { + Archive = 'Archive', + Audio = 'Audio', + Image = 'Image', + Other = 'Other', + Spreadsheet = 'Spreadsheet', + TextDocument = 'TextDocument', + Video = 'Video' +} + +export type AuthProviders = { + __typename?: 'AuthProviders'; + google: Scalars['Boolean']['output']; + magicLink: Scalars['Boolean']['output']; + password: Scalars['Boolean']['output']; +}; + +export type AuthToken = { + __typename?: 'AuthToken'; + expiresAt: Scalars['DateTime']['output']; + token: Scalars['String']['output']; +}; + +export type AuthTokenPair = { + __typename?: 'AuthTokenPair'; + accessToken: AuthToken; + refreshToken: AuthToken; +}; + +export enum ColorScheme { + Dark = 'Dark', + Light = 'Light', + System = 'System' +} + +export type Comment = { + __typename?: 'Comment'; + activity?: Maybe; + activityId?: Maybe; + author: User; + authorId: Scalars['String']['output']; + body: Scalars['String']['output']; + commentThreadId?: Maybe; + createdAt: Scalars['DateTime']['output']; + id: Scalars['ID']['output']; + updatedAt: Scalars['DateTime']['output']; + workspaceMemberAuthor?: Maybe; + workspaceMemberAuthorId?: Maybe; +}; + +export type Company = { + __typename?: 'Company'; + ActivityTarget?: Maybe>; + Attachment?: Maybe>; + Favorite?: Maybe>; + PipelineProgress?: Maybe>; + accountOwner?: Maybe; + accountOwnerId?: Maybe; + address: Scalars['String']['output']; + annualRecurringRevenue?: Maybe; + createdAt: Scalars['DateTime']['output']; + domainName: Scalars['String']['output']; + employees?: Maybe; + id: Scalars['ID']['output']; + idealCustomerProfile: Scalars['Boolean']['output']; + linkedinUrl?: Maybe; + name: Scalars['String']['output']; + people?: Maybe>; + updatedAt: Scalars['DateTime']['output']; + workspaceMemberAccountOwner?: Maybe; + workspaceMemberAccountOwnerId?: Maybe; + xUrl?: Maybe; +}; + +export type CreateFieldInput = { + description?: InputMaybe; + icon?: InputMaybe; + labelPlural?: InputMaybe; + labelSingular: Scalars['String']['input']; + namePlural?: InputMaybe; + nameSingular: Scalars['String']['input']; + objectId: Scalars['String']['input']; + placeholder?: InputMaybe; + type: Scalars['String']['input']; +}; + +export type CreateObjectInput = { + description?: InputMaybe; + icon?: InputMaybe; + labelPlural: Scalars['String']['input']; + labelSingular: Scalars['String']['input']; + namePlural: Scalars['String']['input']; + nameSingular: Scalars['String']['input']; +}; + +export type CreateOneFieldInput = { + /** The record to create */ + field: CreateFieldInput; +}; + +export type CreateOneObjectInput = { + /** The record to create */ + object: CreateObjectInput; +}; + +export enum Currency { + Aed = 'AED', + Afn = 'AFN', + All = 'ALL', + Amd = 'AMD', + Ang = 'ANG', + Aoa = 'AOA', + Ars = 'ARS', + Aud = 'AUD', + Awg = 'AWG', + Azn = 'AZN', + Bam = 'BAM', + Bbd = 'BBD', + Bdt = 'BDT', + Bgn = 'BGN', + Bhd = 'BHD', + Bif = 'BIF', + Bmd = 'BMD', + Bnd = 'BND', + Bob = 'BOB', + Bov = 'BOV', + Brl = 'BRL', + Bsd = 'BSD', + Btn = 'BTN', + Bwp = 'BWP', + Byn = 'BYN', + Bzd = 'BZD', + Cad = 'CAD', + Cdf = 'CDF', + Chf = 'CHF', + Clf = 'CLF', + Clp = 'CLP', + Cny = 'CNY', + Cop = 'COP', + Cou = 'COU', + Crc = 'CRC', + Cuc = 'CUC', + Cup = 'CUP', + Cve = 'CVE', + Czk = 'CZK', + Djf = 'DJF', + Dkk = 'DKK', + Dop = 'DOP', + Dzd = 'DZD', + Egp = 'EGP', + Ern = 'ERN', + Etb = 'ETB', + Eur = 'EUR', + Fjd = 'FJD', + Fkp = 'FKP', + Gbp = 'GBP', + Gel = 'GEL', + Ghs = 'GHS', + Gip = 'GIP', + Gmd = 'GMD', + Gnf = 'GNF', + Gtq = 'GTQ', + Gyd = 'GYD', + Hkd = 'HKD', + Hnl = 'HNL', + Hrk = 'HRK', + Htg = 'HTG', + Huf = 'HUF', + Idr = 'IDR', + Ils = 'ILS', + Inr = 'INR', + Iqd = 'IQD', + Irr = 'IRR', + Isk = 'ISK', + Jmd = 'JMD', + Jod = 'JOD', + Jpy = 'JPY', + Kes = 'KES', + Kgs = 'KGS', + Khr = 'KHR', + Kmf = 'KMF', + Kpw = 'KPW', + Krw = 'KRW', + Kwd = 'KWD', + Kyd = 'KYD', + Kzt = 'KZT', + Lak = 'LAK', + Lbp = 'LBP', + Lkr = 'LKR', + Lrd = 'LRD', + Lsl = 'LSL', + Lyd = 'LYD', + Mad = 'MAD', + Mdl = 'MDL', + Mga = 'MGA', + Mkd = 'MKD', + Mmk = 'MMK', + Mnt = 'MNT', + Mop = 'MOP', + Mro = 'MRO', + Mru = 'MRU', + Mur = 'MUR', + Mvr = 'MVR', + Mwk = 'MWK', + Mxn = 'MXN', + Mxv = 'MXV', + Myr = 'MYR', + Mzn = 'MZN', + Nad = 'NAD', + Ngn = 'NGN', + Nio = 'NIO', + Nok = 'NOK', + Npr = 'NPR', + Nzd = 'NZD', + Omr = 'OMR', + Pab = 'PAB', + Pen = 'PEN', + Pgk = 'PGK', + Php = 'PHP', + Pkr = 'PKR', + Pln = 'PLN', + Pyg = 'PYG', + Qar = 'QAR', + Ron = 'RON', + Rsd = 'RSD', + Rub = 'RUB', + Rwf = 'RWF', + Sar = 'SAR', + Sbd = 'SBD', + Scr = 'SCR', + Sdd = 'SDD', + Sdg = 'SDG', + Sek = 'SEK', + Sgd = 'SGD', + Shp = 'SHP', + Sll = 'SLL', + Sos = 'SOS', + Srd = 'SRD', + Ssp = 'SSP', + Std = 'STD', + Stn = 'STN', + Svc = 'SVC', + Syp = 'SYP', + Szl = 'SZL', + Thb = 'THB', + Tjs = 'TJS', + Tmm = 'TMM', + Tmt = 'TMT', + Tnd = 'TND', + Top = 'TOP', + Try = 'TRY', + Ttd = 'TTD', + Twd = 'TWD', + Tzs = 'TZS', + Uah = 'UAH', + Ugx = 'UGX', + Usd = 'USD', + Uyu = 'UYU', + Uzs = 'UZS', + Vef = 'VEF', + Ves = 'VES', + Vnd = 'VND', + Vuv = 'VUV', + Wst = 'WST', + Xaf = 'XAF', + Xcd = 'XCD', + Xof = 'XOF', + Xpf = 'XPF', + Xsu = 'XSU', + Xua = 'XUA', + Yer = 'YER', + Zar = 'ZAR', + Zmw = 'ZMW', + Zwl = 'ZWL' +} + +export type CursorPaging = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + +export type Favorite = { + __typename?: 'Favorite'; + company?: Maybe; + companyId?: Maybe; + id: Scalars['ID']['output']; + person?: Maybe; + personId?: Maybe; + workspaceId?: Maybe; + workspaceMember?: Maybe; + workspaceMemberId?: Maybe; +}; + +export type FieldConnection = { + __typename?: 'FieldConnection'; + /** Array of edges. */ + edges: Array; + /** Paging information */ + pageInfo: PageInfo; + /** Fetch total count of records */ + totalCount: Scalars['Int']['output']; +}; + +export type Mutation = { + __typename?: 'Mutation'; + createOneField: Field; + createOneObject: Object; + updateOneField: Field; + updateOneObject: Object; +}; + + +export type MutationCreateOneFieldArgs = { + input: CreateOneFieldInput; +}; + + +export type MutationCreateOneObjectArgs = { + input: CreateOneObjectInput; +}; + + +export type MutationUpdateOneFieldArgs = { + input: UpdateOneFieldInput; +}; + + +export type MutationUpdateOneObjectArgs = { + input: UpdateOneObjectInput; +}; + +export type ObjectConnection = { + __typename?: 'ObjectConnection'; + /** Array of edges. */ + edges: Array; + /** Paging information */ + pageInfo: PageInfo; + /** Fetch total count of records */ + totalCount: Scalars['Int']['output']; +}; + +export type ObjectFieldsConnection = { + __typename?: 'ObjectFieldsConnection'; + /** Array of edges. */ + edges: Array; + /** Paging information */ + pageInfo: PageInfo; + /** Fetch total count of records */ + totalCount: Scalars['Int']['output']; +}; + +export type PageInfo = { + __typename?: 'PageInfo'; + /** The cursor of the last returned record. */ + endCursor?: Maybe; + /** true if paging forward and there are more records. */ + hasNextPage?: Maybe; + /** true if paging backwards and there are more records. */ + hasPreviousPage?: Maybe; + /** The cursor of the first returned record. */ + startCursor?: Maybe; +}; + +export type Person = { + __typename?: 'Person'; + ActivityTarget?: Maybe>; + Attachment?: Maybe>; + Favorite?: Maybe>; + PipelineProgress?: Maybe>; + avatarUrl?: Maybe; + city?: Maybe; + company?: Maybe; + companyId?: Maybe; + contactPipelineProgresses?: Maybe>; + createdAt: Scalars['DateTime']['output']; + email?: Maybe; + firstName?: Maybe; + id: Scalars['ID']['output']; + jobTitle?: Maybe; + lastName?: Maybe; + linkedinUrl?: Maybe; + phone?: Maybe; + updatedAt: Scalars['DateTime']['output']; + xUrl?: Maybe; +}; + +export type Pipeline = { + __typename?: 'Pipeline'; + createdAt: Scalars['DateTime']['output']; + currency: Currency; + icon: Scalars['String']['output']; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + pipelineProgressableType: PipelineProgressableType; + pipelineProgresses?: Maybe>; + pipelineStages?: Maybe>; + updatedAt: Scalars['DateTime']['output']; +}; + +export type PipelineProgress = { + __typename?: 'PipelineProgress'; + amount?: Maybe; + closeDate?: Maybe; + company?: Maybe; + companyId?: Maybe; + createdAt: Scalars['DateTime']['output']; + id: Scalars['ID']['output']; + person?: Maybe; + personId?: Maybe; + pipeline: Pipeline; + pipelineId: Scalars['String']['output']; + pipelineStage: PipelineStage; + pipelineStageId: Scalars['String']['output']; + pointOfContact?: Maybe; + pointOfContactId?: Maybe; + probability?: Maybe; + updatedAt: Scalars['DateTime']['output']; +}; + +export enum PipelineProgressableType { + Company = 'Company', + Person = 'Person' +} + +export type PipelineStage = { + __typename?: 'PipelineStage'; + color: Scalars['String']['output']; + createdAt: Scalars['DateTime']['output']; + id: Scalars['ID']['output']; + index?: Maybe; + name: Scalars['String']['output']; + pipeline: Pipeline; + pipelineId: Scalars['String']['output']; + pipelineProgresses?: Maybe>; + type: Scalars['String']['output']; + updatedAt: Scalars['DateTime']['output']; +}; + +export type Query = { + __typename?: 'Query'; + field: Field; + fields: FieldConnection; + object: Object; + objects: ObjectConnection; +}; + + +export type QueryFieldArgs = { + id: Scalars['ID']['input']; +}; + + +export type QueryFieldsArgs = { + paging?: CursorPaging; +}; + + +export type QueryObjectArgs = { + id: Scalars['ID']['input']; +}; + + +export type QueryObjectsArgs = { + paging?: CursorPaging; +}; + +export type Support = { + __typename?: 'Support'; + supportDriver: Scalars['String']['output']; + supportFrontChatId?: Maybe; +}; + +export type Telemetry = { + __typename?: 'Telemetry'; + anonymizationEnabled: Scalars['Boolean']['output']; + enabled: Scalars['Boolean']['output']; +}; + +export type UpdateFieldInput = { + description?: InputMaybe; + icon?: InputMaybe; + isActive?: InputMaybe; + labelPlural?: InputMaybe; + labelSingular?: InputMaybe; + namePlural?: InputMaybe; + nameSingular?: InputMaybe; + placeholder?: InputMaybe; +}; + +export type UpdateObjectInput = { + description?: InputMaybe; + icon?: InputMaybe; + isActive?: InputMaybe; + labelPlural: Scalars['String']['input']; + labelSingular: Scalars['String']['input']; + namePlural: Scalars['String']['input']; + nameSingular: Scalars['String']['input']; +}; + +export type UpdateOneFieldInput = { + /** The id of the record to update */ + id: Scalars['ID']['input']; + /** The update to apply. */ + update: UpdateFieldInput; +}; + +export type UpdateOneObjectInput = { + /** The id of the record to update */ + id: Scalars['ID']['input']; + /** The update to apply. */ + update: UpdateObjectInput; +}; + +export type User = { + __typename?: 'User'; + assignedActivities?: Maybe>; + authoredActivities?: Maybe>; + authoredAttachments?: Maybe>; + avatarUrl?: Maybe; + canImpersonate: Scalars['Boolean']['output']; + comments?: Maybe>; + companies?: Maybe>; + createdAt: Scalars['DateTime']['output']; + disabled: Scalars['Boolean']['output']; + email: Scalars['String']['output']; + emailVerified: Scalars['Boolean']['output']; + firstName?: Maybe; + id: Scalars['ID']['output']; + lastName?: Maybe; + lastSeen?: Maybe; + locale: Scalars['String']['output']; + metadata?: Maybe; + phoneNumber?: Maybe; + settings: UserSettings; + settingsId: Scalars['String']['output']; + updatedAt: Scalars['DateTime']['output']; + workspaceMember?: Maybe; +}; + +export type UserSettings = { + __typename?: 'UserSettings'; + WorkspaceMember?: Maybe>; + colorScheme: ColorScheme; + createdAt: Scalars['DateTime']['output']; + id: Scalars['ID']['output']; + locale: Scalars['String']['output']; + updatedAt: Scalars['DateTime']['output']; + user?: Maybe; +}; + +export type View = { + __typename?: 'View'; + fields?: Maybe>; + filters?: Maybe>; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + objectId: Scalars['String']['output']; + sorts?: Maybe>; + type: ViewType; +}; + +export type ViewField = { + __typename?: 'ViewField'; + index: Scalars['Float']['output']; + isVisible: Scalars['Boolean']['output']; + key: Scalars['String']['output']; + name: Scalars['String']['output']; + objectId: Scalars['String']['output']; + size?: Maybe; + view: View; + viewId: Scalars['String']['output']; +}; + +export type ViewFilter = { + __typename?: 'ViewFilter'; + displayValue: Scalars['String']['output']; + key: Scalars['String']['output']; + name: Scalars['String']['output']; + operand: ViewFilterOperand; + value: Scalars['String']['output']; + view: View; + viewId: Scalars['String']['output']; +}; + +export enum ViewFilterOperand { + Contains = 'Contains', + DoesNotContain = 'DoesNotContain', + GreaterThan = 'GreaterThan', + Is = 'Is', + IsNot = 'IsNot', + IsNotNull = 'IsNotNull', + LessThan = 'LessThan' +} + +export type ViewSort = { + __typename?: 'ViewSort'; + direction: ViewSortDirection; + key: Scalars['String']['output']; + name: Scalars['String']['output']; + view: View; + viewId: Scalars['String']['output']; +}; + +export enum ViewSortDirection { + Asc = 'asc', + Desc = 'desc' +} + +export enum ViewType { + Pipeline = 'Pipeline', + Table = 'Table' +} + +export type Workspace = { + __typename?: 'Workspace'; + Attachment?: Maybe>; + activities?: Maybe>; + activityTargets?: Maybe>; + apiKeys?: Maybe>; + comments?: Maybe>; + companies?: Maybe>; + createdAt: Scalars['DateTime']['output']; + displayName?: Maybe; + domainName?: Maybe; + id: Scalars['ID']['output']; + inviteHash?: Maybe; + logo?: Maybe; + people?: Maybe>; + pipelineProgresses?: Maybe>; + pipelineStages?: Maybe>; + pipelines?: Maybe>; + updatedAt: Scalars['DateTime']['output']; + viewFields?: Maybe>; + viewFilters?: Maybe>; + viewSorts?: Maybe>; + views?: Maybe>; + workspaceMember?: Maybe>; +}; + +export type WorkspaceMember = { + __typename?: 'WorkspaceMember'; + Favorite?: Maybe>; + allowImpersonation: Scalars['Boolean']['output']; + assignedActivities?: Maybe>; + authoredActivities?: Maybe>; + authoredAttachments?: Maybe>; + comments?: Maybe>; + companies?: Maybe>; + createdAt: Scalars['DateTime']['output']; + id: Scalars['ID']['output']; + settings?: Maybe; + settingsId?: Maybe; + updatedAt: Scalars['DateTime']['output']; + user: User; + userId: Scalars['String']['output']; + workspace: Workspace; +}; + +export type Field = { + __typename?: 'field'; + createdAt: Scalars['DateTime']['output']; + description?: Maybe; + icon?: Maybe; + id: Scalars['ID']['output']; + isActive: Scalars['Boolean']['output']; + isCustom: Scalars['Boolean']['output']; + isNullable: Scalars['Boolean']['output']; + labelPlural: Scalars['String']['output']; + labelSingular: Scalars['String']['output']; + namePlural: Scalars['String']['output']; + nameSingular: Scalars['String']['output']; + placeholder?: Maybe; + type: Scalars['String']['output']; + updatedAt: Scalars['DateTime']['output']; +}; + +export type FieldEdge = { + __typename?: 'fieldEdge'; + /** Cursor for this node. */ + cursor: Scalars['ConnectionCursor']['output']; + /** The node containing the field */ + node: Field; +}; + +export type Object = { + __typename?: 'object'; + createdAt: Scalars['DateTime']['output']; + dataSourceId: Scalars['String']['output']; + description?: Maybe; + fields: ObjectFieldsConnection; + icon?: Maybe; + id: Scalars['ID']['output']; + isActive: Scalars['Boolean']['output']; + isCustom: Scalars['Boolean']['output']; + labelPlural: Scalars['String']['output']; + labelSingular: Scalars['String']['output']; + namePlural: Scalars['String']['output']; + nameSingular: Scalars['String']['output']; + updatedAt: Scalars['DateTime']['output']; +}; + + +export type ObjectFieldsArgs = { + paging?: CursorPaging; +}; + +export type ObjectEdge = { + __typename?: 'objectEdge'; + /** Cursor for this node. */ + cursor: Scalars['ConnectionCursor']['output']; + /** The node containing the object */ + node: Object; +}; + +export type ObjectsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type ObjectsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', totalCount: number, edges: Array<{ __typename?: 'objectEdge', node: { __typename?: 'object', id: string, dataSourceId: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, description?: string | null, icon?: string | null, isCustom: boolean, isActive: boolean, createdAt: any, updatedAt: any, fields: { __typename?: 'ObjectFieldsConnection', totalCount: number, edges: Array<{ __typename?: 'fieldEdge', node: { __typename?: 'field', id: string, type: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, description?: string | null, icon?: string | null, placeholder?: string | null, isCustom: boolean, isActive: boolean, isNullable: boolean, createdAt: any, updatedAt: any } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } }; + + +export const ObjectsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Objects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"100"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"100"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"placeholder"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/front/src/generated-metadata/index.ts b/front/src/generated-metadata/index.ts new file mode 100644 index 000000000..af7839936 --- /dev/null +++ b/front/src/generated-metadata/index.ts @@ -0,0 +1 @@ +export * from "./gql"; \ No newline at end of file diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx index af1656214..dffa4951e 100644 --- a/front/src/generated/graphql.tsx +++ b/front/src/generated/graphql.tsx @@ -13,6 +13,7 @@ export type Scalars = { Boolean: boolean; Int: number; Float: number; + ConnectionCursor: any; DateTime: string; JSON: any; Upload: any; @@ -445,6 +446,63 @@ export type Analytics = { success: Scalars['Boolean']; }; +export type ApiKey = { + __typename?: 'ApiKey'; + createdAt: Scalars['DateTime']; + expiresAt?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + updatedAt: Scalars['DateTime']; +}; + +export type ApiKeyCreateInput = { + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + id?: InputMaybe; + name: Scalars['String']; + updatedAt?: InputMaybe; +}; + +export type ApiKeyOrderByWithRelationInput = { + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export enum ApiKeyScalarFieldEnum { + CreatedAt = 'createdAt', + DeletedAt = 'deletedAt', + ExpiresAt = 'expiresAt', + Id = 'id', + Name = 'name', + RevokedAt = 'revokedAt', + UpdatedAt = 'updatedAt', + WorkspaceId = 'workspaceId' +} + +export type ApiKeyUpdateManyWithoutWorkspaceNestedInput = { + connect?: InputMaybe>; + disconnect?: InputMaybe>; + set?: InputMaybe>; +}; + +export type ApiKeyWhereInput = { + AND?: InputMaybe>; + NOT?: InputMaybe>; + OR?: InputMaybe>; + createdAt?: InputMaybe; + expiresAt?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type ApiKeyWhereUniqueInput = { + id?: InputMaybe; +}; + export type Attachment = { __typename?: 'Attachment'; activity?: Maybe; @@ -1070,6 +1128,17 @@ export enum Currency { Zwl = 'ZWL' } +export type CursorPaging = { + /** Paginate after opaque cursor */ + after?: InputMaybe; + /** Paginate before opaque cursor */ + before?: InputMaybe; + /** Paginate first */ + first?: InputMaybe; + /** Paginate last */ + last?: InputMaybe; +}; + export type DateTimeFilter = { equals?: InputMaybe; gt?: InputMaybe; @@ -1219,6 +1288,16 @@ export type FavoriteWhereUniqueInput = { id?: InputMaybe; }; +export type FieldConnection = { + __typename?: 'FieldConnection'; + /** Array of edges. */ + edges: Array; + /** Paging information */ + pageInfo: PageInfo; + /** Fetch total count of records */ + totalCount: Scalars['Int']; +}; + export enum FileFolder { Attachment = 'Attachment', PersonPicture = 'PersonPicture', @@ -1274,7 +1353,6 @@ export type Mutation = { UpdateOneWorkspaceMember: WorkspaceMember; allowImpersonation: WorkspaceMember; challenge: LoginToken; - createCustomField: Scalars['String']; createEvent: Analytics; createFavoriteForCompany: Favorite; createFavoriteForPerson: Favorite; @@ -1285,6 +1363,7 @@ export type Mutation = { createManyViewFilter: AffectedRows; createManyViewSort: AffectedRows; createOneActivity: Activity; + createOneApiKey: AuthToken; createOneComment: Comment; createOneCompany: Company; createOnePerson: Person; @@ -1307,6 +1386,7 @@ export type Mutation = { deleteWorkspaceMember: WorkspaceMember; impersonate: Verify; renewToken: AuthTokens; + revokeOneApiKey: ApiKey; signUp: LoginToken; updateOneActivity: Activity; updateOneCompany?: Maybe; @@ -1346,13 +1426,6 @@ export type MutationChallengeArgs = { }; -export type MutationCreateCustomFieldArgs = { - name: Scalars['String']; - objectId: Scalars['String']; - type: Scalars['String']; -}; - - export type MutationCreateEventArgs = { data: Scalars['JSON']; type: Scalars['String']; @@ -1410,6 +1483,11 @@ export type MutationCreateOneActivityArgs = { }; +export type MutationCreateOneApiKeyArgs = { + data: ApiKeyCreateInput; +}; + + export type MutationCreateOneCommentArgs = { data: CommentCreateInput; }; @@ -1510,6 +1588,11 @@ export type MutationRenewTokenArgs = { }; +export type MutationRevokeOneApiKeyArgs = { + where: ApiKeyWhereUniqueInput; +}; + + export type MutationSignUpArgs = { email: Scalars['String']; password: Scalars['String']; @@ -1755,19 +1838,36 @@ export type NestedStringNullableFilter = { startsWith?: InputMaybe; }; -export type PageInfo = { - __typename?: 'PageInfo'; - endCursor?: Maybe; - hasNextPage: Scalars['Boolean']; - hasPreviousPage: Scalars['Boolean']; - startCursor?: Maybe; +export type ObjectConnection = { + __typename?: 'ObjectConnection'; + /** Array of edges. */ + edges: Array; + /** Paging information */ + pageInfo: PageInfo; + /** Fetch total count of records */ + totalCount: Scalars['Int']; }; -export type PaginatedUniversalEntity = { - __typename?: 'PaginatedUniversalEntity'; - edges?: Maybe>; - pageInfo?: Maybe; - totalCount: Scalars['Float']; +export type ObjectFieldsConnection = { + __typename?: 'ObjectFieldsConnection'; + /** Array of edges. */ + edges: Array; + /** Paging information */ + pageInfo: PageInfo; + /** Fetch total count of records */ + totalCount: Scalars['Int']; +}; + +export type PageInfo = { + __typename?: 'PageInfo'; + /** The cursor of the last returned record. */ + endCursor?: Maybe; + /** true if paging forward and there are more records. */ + hasNextPage?: Maybe; + /** true if paging backwards and there are more records. */ + hasPreviousPage?: Maybe; + /** The cursor of the first returned record. */ + startCursor?: Maybe; }; export type Person = { @@ -2350,10 +2450,9 @@ export type Query = { clientConfig: ClientConfig; currentUser: User; currentWorkspace: Workspace; - deleteOneCustom: UniversalEntity; findFavorites: Array; - findMany: PaginatedUniversalEntity; findManyActivities: Array; + findManyApiKey: Array; findManyCompany: Array; findManyPerson: Array; findManyPipeline: Array; @@ -2365,11 +2464,9 @@ export type Query = { findManyViewFilter: Array; findManyViewSort: Array; findManyWorkspaceMember: Array; - findUnique: UniversalEntity; findUniqueCompany: Company; findUniquePerson: Person; findWorkspaceFromInviteHash: Workspace; - updateOneCustom: UniversalEntity; }; @@ -2383,21 +2480,6 @@ export type QueryCheckWorkspaceInviteHashIsValidArgs = { }; -export type QueryFindManyArgs = { - after?: InputMaybe; - before?: InputMaybe; - cursor?: InputMaybe; - distinct?: InputMaybe>; - entity: Scalars['String']; - first?: InputMaybe; - last?: InputMaybe; - orderBy?: InputMaybe; - skip?: InputMaybe; - take?: InputMaybe; - where?: InputMaybe; -}; - - export type QueryFindManyActivitiesArgs = { cursor?: InputMaybe; distinct?: InputMaybe>; @@ -2408,6 +2490,16 @@ export type QueryFindManyActivitiesArgs = { }; +export type QueryFindManyApiKeyArgs = { + cursor?: InputMaybe; + distinct?: InputMaybe>; + orderBy?: InputMaybe>; + skip?: InputMaybe; + take?: InputMaybe; + where?: InputMaybe; +}; + + export type QueryFindManyCompanyArgs = { cursor?: InputMaybe; distinct?: InputMaybe>; @@ -2518,12 +2610,6 @@ export type QueryFindManyWorkspaceMemberArgs = { }; -export type QueryFindUniqueArgs = { - entity: Scalars['String']; - where?: InputMaybe; -}; - - export type QueryFindUniqueCompanyArgs = { where: CompanyWhereUniqueInput; }; @@ -2590,39 +2676,6 @@ export type Telemetry = { enabled: Scalars['Boolean']; }; -export enum TypeOrmSortOrder { - Asc = 'ASC', - Desc = 'DESC' -} - -export type UniversalEntity = { - __typename?: 'UniversalEntity'; - createdAt: Scalars['DateTime']; - data: Scalars['JSON']; - id: Scalars['ID']; - updatedAt: Scalars['DateTime']; -}; - -export type UniversalEntityEdge = { - __typename?: 'UniversalEntityEdge'; - cursor?: Maybe; - node?: Maybe; -}; - -export type UniversalEntityInput = { - createdAt?: InputMaybe; - data?: InputMaybe; - id?: InputMaybe; - updatedAt?: InputMaybe; -}; - -export type UniversalEntityOrderByRelationInput = { - createdAt?: InputMaybe; - data?: InputMaybe; - id?: InputMaybe; - updatedAt?: InputMaybe; -}; - export type User = { __typename?: 'User'; assignedActivities?: Maybe>; @@ -3282,6 +3335,7 @@ export type Workspace = { Attachment?: Maybe>; activities?: Maybe>; activityTargets?: Maybe>; + apiKeys?: Maybe>; comments?: Maybe>; companies?: Maybe>; createdAt: Scalars['DateTime']; @@ -3456,6 +3510,7 @@ export type WorkspaceUpdateInput = { Attachment?: InputMaybe; activities?: InputMaybe; activityTargets?: InputMaybe; + apiKeys?: InputMaybe; comments?: InputMaybe; companies?: InputMaybe; createdAt?: InputMaybe; @@ -3476,6 +3531,62 @@ export type WorkspaceUpdateInput = { workspaceMember?: InputMaybe; }; +export type Field = { + __typename?: 'field'; + createdAt: Scalars['DateTime']; + description?: Maybe; + icon?: Maybe; + id: Scalars['ID']; + isActive: Scalars['Boolean']; + isCustom: Scalars['Boolean']; + isNullable: Scalars['Boolean']; + labelPlural: Scalars['String']; + labelSingular: Scalars['String']; + namePlural: Scalars['String']; + nameSingular: Scalars['String']; + placeholder?: Maybe; + type: Scalars['String']; + updatedAt: Scalars['DateTime']; +}; + +export type FieldEdge = { + __typename?: 'fieldEdge'; + /** Cursor for this node. */ + cursor: Scalars['ConnectionCursor']; + /** The node containing the field */ + node: Field; +}; + +export type Object = { + __typename?: 'object'; + createdAt: Scalars['DateTime']; + dataSourceId: Scalars['String']; + description?: Maybe; + fields: ObjectFieldsConnection; + icon?: Maybe; + id: Scalars['ID']; + isActive: Scalars['Boolean']; + isCustom: Scalars['Boolean']; + labelPlural: Scalars['String']; + labelSingular: Scalars['String']; + namePlural: Scalars['String']; + nameSingular: Scalars['String']; + updatedAt: Scalars['DateTime']; +}; + + +export type ObjectFieldsArgs = { + paging?: CursorPaging; +}; + +export type ObjectEdge = { + __typename?: 'objectEdge'; + /** Cursor for this node. */ + cursor: Scalars['ConnectionCursor']; + /** The node containing the object */ + node: Object; +}; + export type ActivityWithTargetsFragment = { __typename?: 'Activity', id: string, createdAt: string, updatedAt: string, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, createdAt: string, updatedAt: string, companyId?: string | null, personId?: string | null }> | null }; export type ActivityQueryFragmentFragment = { __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }; diff --git a/front/src/index.tsx b/front/src/index.tsx index 716bfda8d..003c0ca88 100644 --- a/front/src/index.tsx +++ b/front/src/index.tsx @@ -16,6 +16,8 @@ import { UserProvider } from '@/users/components/UserProvider'; import '@emotion/react'; import { PageChangeEffect } from './effect-components/PageChangeEffect'; +import { ApolloClientMetadataProvider } from './modules/metadata/components/ApolloClientMetadataProvider'; +import { FetchMetadataEffect } from './modules/metadata/components/FetchMetadataEffect'; import { App } from './App'; import './index.css'; @@ -33,16 +35,19 @@ root.render( - - - - - - - - - - + + + + + + + + + + + + + diff --git a/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts b/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts index 69bf4eeb9..a8ab8d83e 100644 --- a/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts +++ b/front/src/modules/activities/tasks/hooks/useCurrentUserDueTaskCount.ts @@ -2,9 +2,12 @@ import { DateTime } from 'luxon'; import { useRecoilState } from 'recoil'; import { currentUserState } from '@/auth/states/currentUserState'; -import { FilterOperand } from '@/ui/view-bar/types/FilterOperand'; import { turnFilterIntoWhereClause } from '@/ui/view-bar/utils/turnFilterIntoWhereClause'; -import { ActivityType, useGetActivitiesQuery } from '~/generated/graphql'; +import { + ActivityType, + useGetActivitiesQuery, + ViewFilterOperand, +} from '~/generated/graphql'; import { parseDate } from '~/utils/date-utils'; export const useCurrentUserTaskCount = () => { @@ -20,7 +23,7 @@ export const useCurrentUserTaskCount = () => { key: 'assigneeId', type: 'entity', value: currentUser.id, - operand: FilterOperand.Is, + operand: ViewFilterOperand.Is, displayValue: currentUser.displayName, displayAvatarUrl: currentUser.avatarUrl ?? undefined, }) diff --git a/front/src/modules/metadata/components/ApolloClientMetadataProvider.tsx b/front/src/modules/metadata/components/ApolloClientMetadataProvider.tsx new file mode 100644 index 000000000..52eaf570f --- /dev/null +++ b/front/src/modules/metadata/components/ApolloClientMetadataProvider.tsx @@ -0,0 +1,36 @@ +/* eslint-disable no-console */ +import { useMemo } from 'react'; +import { ApolloClient, InMemoryCache } from '@apollo/client'; +import { useRecoilState } from 'recoil'; + +import { tokenPairState } from '@/auth/states/tokenPairState'; + +import { ApolloClientMetadataContext } from '../context/ApolloClientMetadataContext'; + +export const ApolloClientMetadataProvider = ({ + children, +}: { + children: React.ReactNode; +}) => { + const [tokenPair] = useRecoilState(tokenPairState); + + const apolloClientMetadata = useMemo(() => { + if (tokenPair?.accessToken.token) { + return new ApolloClient({ + uri: `${process.env.REACT_APP_SERVER_BASE_URL}/metadata`, + cache: new InMemoryCache(), + headers: { + Authorization: `Bearer ${tokenPair.accessToken.token}`, + }, + }); + } else { + return null; + } + }, [tokenPair]); + + return ( + + {children} + + ); +}; diff --git a/front/src/modules/metadata/components/FetchMetadataEffect.tsx b/front/src/modules/metadata/components/FetchMetadataEffect.tsx new file mode 100644 index 000000000..698c82168 --- /dev/null +++ b/front/src/modules/metadata/components/FetchMetadataEffect.tsx @@ -0,0 +1,37 @@ +import { useEffect } from 'react'; +import { useRecoilState } from 'recoil'; + +import { ObjectsQuery } from '~/generated-metadata/graphql'; + +import { GET_ALL_OBJECTS } from '../graphql/queries'; +import { useApolloClientMetadata } from '../hooks/useApolloClientMetadata'; +import { metadataObjectsState } from '../states/metadataObjectsState'; +import { MetadataObject } from '../types/MetadataObject'; + +export const FetchMetadataEffect = () => { + const [metadataObjects, setMetadataObjects] = + useRecoilState(metadataObjectsState); + + const apolloClientMetadata = useApolloClientMetadata(); + + useEffect(() => { + (async () => { + if (apolloClientMetadata && metadataObjects.length === 0) { + const objects = await apolloClientMetadata.query({ + query: GET_ALL_OBJECTS, + }); + + if (objects.data.objects.edges.length > 0) { + const formattedObjects: MetadataObject[] = + objects.data.objects.edges.map((object) => ({ + ...object.node, + fields: object.node.fields.edges.map((field) => field.node), + })); + setMetadataObjects(formattedObjects); + } + } + })(); + }, [metadataObjects, setMetadataObjects, apolloClientMetadata]); + + return <>; +}; diff --git a/front/src/modules/metadata/context/ApolloClientMetadataContext.ts b/front/src/modules/metadata/context/ApolloClientMetadataContext.ts new file mode 100644 index 000000000..ee0944db3 --- /dev/null +++ b/front/src/modules/metadata/context/ApolloClientMetadataContext.ts @@ -0,0 +1,5 @@ +import { createContext } from 'react'; +import { ApolloClient, NormalizedCacheObject } from '@apollo/client'; + +export const ApolloClientMetadataContext = + createContext | null>(null); diff --git a/front/src/modules/metadata/graphql/queries.ts b/front/src/modules/metadata/graphql/queries.ts new file mode 100644 index 000000000..84e6259b4 --- /dev/null +++ b/front/src/modules/metadata/graphql/queries.ts @@ -0,0 +1,58 @@ +import { gql } from '@apollo/client'; + +export const GET_ALL_OBJECTS = gql` + query Objects { + objects(paging: { first: 100 }) { + edges { + node { + id + dataSourceId + nameSingular + namePlural + labelSingular + labelPlural + description + icon + isCustom + isActive + createdAt + updatedAt + fields(paging: { first: 100 }) { + edges { + node { + id + type + nameSingular + namePlural + labelSingular + labelPlural + description + icon + placeholder + isCustom + isActive + isNullable + createdAt + updatedAt + } + } + pageInfo { + hasNextPage + hasPreviousPage + startCursor + endCursor + } + totalCount + } + } + } + pageInfo { + hasNextPage + hasPreviousPage + startCursor + endCursor + } + totalCount + } + } +`; diff --git a/front/src/modules/metadata/hooks/useApolloClientMetadata.ts b/front/src/modules/metadata/hooks/useApolloClientMetadata.ts new file mode 100644 index 000000000..56ae655da --- /dev/null +++ b/front/src/modules/metadata/hooks/useApolloClientMetadata.ts @@ -0,0 +1,7 @@ +import { useContext } from 'react'; + +import { ApolloClientMetadataContext } from '../context/ApolloClientMetadataContext'; + +export const useApolloClientMetadata = () => { + return useContext(ApolloClientMetadataContext); +}; diff --git a/front/src/modules/metadata/states/metadataObjectsState.ts b/front/src/modules/metadata/states/metadataObjectsState.ts new file mode 100644 index 000000000..1a7304b47 --- /dev/null +++ b/front/src/modules/metadata/states/metadataObjectsState.ts @@ -0,0 +1,8 @@ +import { atom } from 'recoil'; + +import { MetadataObject } from '../types/MetadataObject'; + +export const metadataObjectsState = atom({ + key: 'metadataObjectsState', + default: [], +}); diff --git a/front/src/modules/metadata/types/MetadataObject.ts b/front/src/modules/metadata/types/MetadataObject.ts new file mode 100644 index 000000000..6d4577bbb --- /dev/null +++ b/front/src/modules/metadata/types/MetadataObject.ts @@ -0,0 +1,5 @@ +import { Field, Object as GeneratedObject } from '~/generated-metadata/graphql'; + +export type MetadataObject = Omit & { + fields: Field[]; +}; diff --git a/front/src/modules/ui/view-bar/components/FilterDropdownEntitySearchSelect.tsx b/front/src/modules/ui/view-bar/components/FilterDropdownEntitySearchSelect.tsx index a7b3e364e..9a5d43a2d 100644 --- a/front/src/modules/ui/view-bar/components/FilterDropdownEntitySearchSelect.tsx +++ b/front/src/modules/ui/view-bar/components/FilterDropdownEntitySearchSelect.tsx @@ -10,10 +10,10 @@ import { useUpsertFilter } from '@/ui/view-bar/hooks/useUpsertFilter'; import { filterDefinitionUsedInDropdownScopedState } from '@/ui/view-bar/states/filterDefinitionUsedInDropdownScopedState'; import { filterDropdownSelectedEntityIdScopedState } from '@/ui/view-bar/states/filterDropdownSelectedEntityIdScopedState'; import { selectedOperandInDropdownScopedState } from '@/ui/view-bar/states/selectedOperandInDropdownScopedState'; +import { ViewFilterOperand } from '~/generated/graphql'; import { useViewBarContext } from '../hooks/useViewBarContext'; import { filterDropdownSearchInputScopedState } from '../states/filterDropdownSearchInputScopedState'; -import { FilterOperand } from '../types/FilterOperand'; export const FilterDropdownEntitySearchSelect = ({ entitiesForSelect, @@ -113,7 +113,7 @@ export const FilterDropdownEntitySearchSelect = ({ upsertFilter({ displayValue: filterDefinitionUsedInDropdown.selectAllLabel, key: filterDefinitionUsedInDropdown.key, - operand: FilterOperand.IsNotNull, + operand: ViewFilterOperand.IsNotNull, type: filterDefinitionUsedInDropdown.type, value: '', }); @@ -126,7 +126,7 @@ export const FilterDropdownEntitySearchSelect = ({ } else { setFilterDropdownSelectedEntityId(filterCurrentlyEdited.value); setIsAllEntitySelected( - filterCurrentlyEdited.operand === FilterOperand.IsNotNull, + filterCurrentlyEdited.operand === ViewFilterOperand.IsNotNull, ); } }, [ diff --git a/front/src/modules/ui/view-bar/components/FilterDropdownOperandSelect.tsx b/front/src/modules/ui/view-bar/components/FilterDropdownOperandSelect.tsx index fc375b184..be2cf0cc5 100644 --- a/front/src/modules/ui/view-bar/components/FilterDropdownOperandSelect.tsx +++ b/front/src/modules/ui/view-bar/components/FilterDropdownOperandSelect.tsx @@ -1,6 +1,7 @@ import { DropdownMenuItemsContainer } from '@/ui/dropdown/components/DropdownMenuItemsContainer'; import { MenuItem } from '@/ui/menu-item/components/MenuItem'; import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState'; +import { ViewFilterOperand } from '~/generated/graphql'; import { useFilterCurrentlyEdited } from '../hooks/useFilterCurrentlyEdited'; import { useUpsertFilter } from '../hooks/useUpsertFilter'; @@ -8,7 +9,6 @@ import { useViewBarContext } from '../hooks/useViewBarContext'; import { filterDefinitionUsedInDropdownScopedState } from '../states/filterDefinitionUsedInDropdownScopedState'; import { isFilterDropdownOperandSelectUnfoldedScopedState } from '../states/isFilterDropdownOperandSelectUnfoldedScopedState'; import { selectedOperandInDropdownScopedState } from '../states/selectedOperandInDropdownScopedState'; -import { FilterOperand } from '../types/FilterOperand'; import { getOperandLabel } from '../utils/getOperandLabel'; import { getOperandsForFilterType } from '../utils/getOperandsForFilterType'; @@ -41,7 +41,7 @@ export const FilterDropdownOperandSelect = () => { const upsertFilter = useUpsertFilter(); - const handleOperangeChange = (newOperand: FilterOperand) => { + const handleOperangeChange = (newOperand: ViewFilterOperand) => { setSelectedOperandInDropdown(newOperand); setIsFilterDropdownOperandSelectUnfolded(false); diff --git a/front/src/modules/ui/view-bar/components/SingleEntityFilterDropdownButton.tsx b/front/src/modules/ui/view-bar/components/SingleEntityFilterDropdownButton.tsx index 00a5e6a7a..fdcd1afe9 100644 --- a/front/src/modules/ui/view-bar/components/SingleEntityFilterDropdownButton.tsx +++ b/front/src/modules/ui/view-bar/components/SingleEntityFilterDropdownButton.tsx @@ -10,11 +10,11 @@ import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope'; import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState'; import { filterDefinitionUsedInDropdownScopedState } from '@/ui/view-bar/states/filterDefinitionUsedInDropdownScopedState'; import { selectedOperandInDropdownScopedState } from '@/ui/view-bar/states/selectedOperandInDropdownScopedState'; +import { ViewFilterOperand } from '~/generated/graphql'; import { useViewBarContext } from '../hooks/useViewBarContext'; import { availableFiltersScopedState } from '../states/availableFiltersScopedState'; import { filtersScopedState } from '../states/filtersScopedState'; -import { FilterOperand } from '../types/FilterOperand'; import { getOperandsForFilterType } from '../utils/getOperandsForFilterType'; import { FilterDropdownEntitySearchInput } from './FilterDropdownEntitySearchInput'; @@ -72,7 +72,7 @@ export const SingleEntityFilterDropdownButton = ({ ({ key: 'selectedOperandInDropdownScopedState', diff --git a/front/src/modules/ui/view-bar/types/Filter.ts b/front/src/modules/ui/view-bar/types/Filter.ts index 4cd8ad887..faae8abf1 100644 --- a/front/src/modules/ui/view-bar/types/Filter.ts +++ b/front/src/modules/ui/view-bar/types/Filter.ts @@ -1,4 +1,5 @@ -import { FilterOperand } from './FilterOperand'; +import { ViewFilterOperand } from '~/generated/graphql'; + import { FilterType } from './FilterType'; export type Filter = { @@ -7,5 +8,5 @@ export type Filter = { value: string; displayValue: string; displayAvatarUrl?: string; - operand: FilterOperand; + operand: ViewFilterOperand; }; diff --git a/front/src/modules/ui/view-bar/types/FilterOperand.ts b/front/src/modules/ui/view-bar/types/FilterOperand.ts deleted file mode 100644 index 9e9a893bc..000000000 --- a/front/src/modules/ui/view-bar/types/FilterOperand.ts +++ /dev/null @@ -1 +0,0 @@ -export { ViewFilterOperand as FilterOperand } from '~/generated/graphql'; diff --git a/front/src/modules/ui/view-bar/utils/getOperandLabel.ts b/front/src/modules/ui/view-bar/utils/getOperandLabel.ts index 6e318451e..a3b603157 100644 --- a/front/src/modules/ui/view-bar/utils/getOperandLabel.ts +++ b/front/src/modules/ui/view-bar/utils/getOperandLabel.ts @@ -1,20 +1,22 @@ -import { FilterOperand } from '../types/FilterOperand'; +import { ViewFilterOperand } from '~/generated/graphql'; -export const getOperandLabel = (operand: FilterOperand | null | undefined) => { +export const getOperandLabel = ( + operand: ViewFilterOperand | null | undefined, +) => { switch (operand) { - case FilterOperand.Contains: + case ViewFilterOperand.Contains: return 'Contains'; - case FilterOperand.DoesNotContain: + case ViewFilterOperand.DoesNotContain: return "Doesn't contain"; - case FilterOperand.GreaterThan: + case ViewFilterOperand.GreaterThan: return 'Greater than'; - case FilterOperand.LessThan: + case ViewFilterOperand.LessThan: return 'Less than'; - case FilterOperand.Is: + case ViewFilterOperand.Is: return 'Is'; - case FilterOperand.IsNot: + case ViewFilterOperand.IsNot: return 'Is not'; - case FilterOperand.IsNotNull: + case ViewFilterOperand.IsNotNull: return 'Is not null'; default: return ''; @@ -22,20 +24,20 @@ export const getOperandLabel = (operand: FilterOperand | null | undefined) => { }; export const getOperandLabelShort = ( - operand: FilterOperand | null | undefined, + operand: ViewFilterOperand | null | undefined, ) => { switch (operand) { - case FilterOperand.Is: - case FilterOperand.Contains: + case ViewFilterOperand.Is: + case ViewFilterOperand.Contains: return ': '; - case FilterOperand.IsNot: - case FilterOperand.DoesNotContain: + case ViewFilterOperand.IsNot: + case ViewFilterOperand.DoesNotContain: return ': Not'; - case FilterOperand.IsNotNull: + case ViewFilterOperand.IsNotNull: return ': NotNull'; - case FilterOperand.GreaterThan: + case ViewFilterOperand.GreaterThan: return '\u00A0> '; - case FilterOperand.LessThan: + case ViewFilterOperand.LessThan: return '\u00A0< '; default: return ': '; diff --git a/front/src/modules/ui/view-bar/utils/getOperandsForFilterType.ts b/front/src/modules/ui/view-bar/utils/getOperandsForFilterType.ts index 03140ee7a..1b06b7a8a 100644 --- a/front/src/modules/ui/view-bar/utils/getOperandsForFilterType.ts +++ b/front/src/modules/ui/view-bar/utils/getOperandsForFilterType.ts @@ -1,17 +1,18 @@ -import { FilterOperand } from '../types/FilterOperand'; +import { ViewFilterOperand } from '~/generated/graphql'; + import { FilterType } from '../types/FilterType'; export const getOperandsForFilterType = ( filterType: FilterType | null | undefined, -): FilterOperand[] => { +): ViewFilterOperand[] => { switch (filterType) { case 'text': - return [FilterOperand.Contains, FilterOperand.DoesNotContain]; + return [ViewFilterOperand.Contains, ViewFilterOperand.DoesNotContain]; case 'number': case 'date': - return [FilterOperand.GreaterThan, FilterOperand.LessThan]; + return [ViewFilterOperand.GreaterThan, ViewFilterOperand.LessThan]; case 'entity': - return [FilterOperand.Is, FilterOperand.IsNot]; + return [ViewFilterOperand.Is, ViewFilterOperand.IsNot]; default: return []; } diff --git a/front/src/modules/ui/view-bar/utils/turnFilterIntoWhereClause.ts b/front/src/modules/ui/view-bar/utils/turnFilterIntoWhereClause.ts index af90d765f..d94b24496 100644 --- a/front/src/modules/ui/view-bar/utils/turnFilterIntoWhereClause.ts +++ b/front/src/modules/ui/view-bar/utils/turnFilterIntoWhereClause.ts @@ -1,11 +1,10 @@ -import { QueryMode } from '~/generated/graphql'; +import { QueryMode, ViewFilterOperand } from '~/generated/graphql'; import { Filter } from '../types/Filter'; -import { FilterOperand } from '../types/FilterOperand'; export const turnFilterIntoWhereClause = (filter: Filter) => { switch (filter.operand) { - case FilterOperand.IsNotNull: + case ViewFilterOperand.IsNotNull: return { [filter.key]: { not: null, @@ -15,14 +14,14 @@ export const turnFilterIntoWhereClause = (filter: Filter) => { switch (filter.type) { case 'text': switch (filter.operand) { - case FilterOperand.Contains: + case ViewFilterOperand.Contains: return { [filter.key]: { contains: filter.value, mode: QueryMode.Insensitive, }, }; - case FilterOperand.DoesNotContain: + case ViewFilterOperand.DoesNotContain: return { [filter.key]: { not: { @@ -38,13 +37,13 @@ export const turnFilterIntoWhereClause = (filter: Filter) => { } case 'number': switch (filter.operand) { - case FilterOperand.GreaterThan: + case ViewFilterOperand.GreaterThan: return { [filter.key]: { gte: parseFloat(filter.value), }, }; - case FilterOperand.LessThan: + case ViewFilterOperand.LessThan: return { [filter.key]: { lte: parseFloat(filter.value), @@ -57,13 +56,13 @@ export const turnFilterIntoWhereClause = (filter: Filter) => { } case 'date': switch (filter.operand) { - case FilterOperand.GreaterThan: + case ViewFilterOperand.GreaterThan: return { [filter.key]: { gte: filter.value, }, }; - case FilterOperand.LessThan: + case ViewFilterOperand.LessThan: return { [filter.key]: { lte: filter.value, @@ -76,13 +75,13 @@ export const turnFilterIntoWhereClause = (filter: Filter) => { } case 'entity': switch (filter.operand) { - case FilterOperand.Is: + case ViewFilterOperand.Is: return { [filter.key]: { equals: filter.value, }, }; - case FilterOperand.IsNot: + case ViewFilterOperand.IsNot: return { [filter.key]: { not: { equals: filter.value }, diff --git a/front/src/pages/tasks/TasksEffect.tsx b/front/src/pages/tasks/TasksEffect.tsx index fb23d22c7..fa5c3d53e 100644 --- a/front/src/pages/tasks/TasksEffect.tsx +++ b/front/src/pages/tasks/TasksEffect.tsx @@ -6,7 +6,7 @@ import { currentUserState } from '@/auth/states/currentUserState'; import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState'; import { availableFiltersScopedState } from '@/ui/view-bar/states/availableFiltersScopedState'; import { filtersScopedState } from '@/ui/view-bar/states/filtersScopedState'; -import { FilterOperand } from '@/ui/view-bar/types/FilterOperand'; +import { ViewFilterOperand } from '~/generated/graphql'; import { tasksFilters } from './tasks-filters'; @@ -33,7 +33,7 @@ export const TasksEffect = () => { key: 'assigneeId', type: 'entity', value: currentUser.id, - operand: FilterOperand.Is, + operand: ViewFilterOperand.Is, displayValue: currentUser.displayName, displayAvatarUrl: currentUser.avatarUrl ?? undefined, }, diff --git a/front/yarn.lock b/front/yarn.lock index 317b5fccd..287572430 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -1940,6 +1940,14 @@ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.1.1.tgz#1a5b1959a528e374e8037c4396c3e825d6cf4a83" integrity sha512-m0G6wlnhm/AX0H12IOWtK8gASEMffnX08RtKkCgTdHb9JpHKGloI7icFfLg9ZmQeavcvR0PKmzxClyuFPSjKWw== +"@graphql-codegen/add@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@graphql-codegen/add/-/add-5.0.0.tgz#578ebaf4fa87c1e934c381cd679bcedcf79feaba" + integrity sha512-ynWDOsK2yxtFHwcJTB9shoSkUd7YXd6ZE57f0nk7W5cu/nAgxZZpEsnTPEpZB/Mjf14YRGe2uJHQ7AfElHjqUQ== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.0" + tslib "~2.5.0" + "@graphql-codegen/cli@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-3.3.1.tgz#103e7a2263126fdde168a1ce623fc2bdc05352f0" @@ -1981,6 +1989,25 @@ yaml "^1.10.0" yargs "^17.0.0" +"@graphql-codegen/client-preset@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@graphql-codegen/client-preset/-/client-preset-4.1.0.tgz#81becd32b78b207b0e966876900537ec172d8df1" + integrity sha512-/3Ymb/fjxIF1+HGmaI1YwSZbWsrZAWMSQjh3dU425eBjctjsVQ6gzGRr+l/gE5F1mtmCf+vlbTAT03heAc/QIw== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/template" "^7.20.7" + "@graphql-codegen/add" "^5.0.0" + "@graphql-codegen/gql-tag-operations" "4.0.1" + "@graphql-codegen/plugin-helpers" "^5.0.1" + "@graphql-codegen/typed-document-node" "^5.0.1" + "@graphql-codegen/typescript" "^4.0.1" + "@graphql-codegen/typescript-operations" "^4.0.1" + "@graphql-codegen/visitor-plugin-common" "^4.0.1" + "@graphql-tools/documents" "^1.0.0" + "@graphql-tools/utils" "^10.0.0" + "@graphql-typed-document-node/core" "3.2.0" + tslib "~2.5.0" + "@graphql-codegen/core@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-3.1.0.tgz#ad859d52d509a4eb2ebe5aabba6543a628fb181b" @@ -1991,6 +2018,17 @@ "@graphql-tools/utils" "^9.1.1" tslib "~2.5.0" +"@graphql-codegen/gql-tag-operations@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.1.tgz#36c7d40a135b9889d7f225166be323c3d48cee87" + integrity sha512-qF6wIbBzW8BNT+wiVsBxrYOs2oYcsxQ7mRvCpfEI3HnNZMAST/uX76W8MqFEJvj4mw7NIDv7xYJAcAZIWM5LWw== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.0" + "@graphql-codegen/visitor-plugin-common" "4.0.1" + "@graphql-tools/utils" "^10.0.0" + auto-bind "~4.0.0" + tslib "~2.5.0" + "@graphql-codegen/plugin-helpers@^2.7.2": version "2.7.2" resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.7.2.tgz#6544f739d725441c826a8af6a49519f588ff9bed" @@ -2015,6 +2053,18 @@ lodash "~4.17.0" tslib "~2.5.0" +"@graphql-codegen/plugin-helpers@^5.0.0", "@graphql-codegen/plugin-helpers@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.1.tgz#e2429fcfba3f078d5aa18aa062d46c922bbb0d55" + integrity sha512-6L5sb9D8wptZhnhLLBcheSPU7Tg//DGWgc5tQBWX46KYTOTQHGqDpv50FxAJJOyFVJrveN9otWk9UT9/yfY4ww== + dependencies: + "@graphql-tools/utils" "^10.0.0" + change-case-all "1.0.15" + common-tags "1.8.2" + import-from "4.0.0" + lodash "~4.17.0" + tslib "~2.5.0" + "@graphql-codegen/schema-ast@^3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@graphql-codegen/schema-ast/-/schema-ast-3.0.1.tgz#37b458bb57b95715a9eb4259341c856dae2a461d" @@ -2024,6 +2074,26 @@ "@graphql-tools/utils" "^9.0.0" tslib "~2.5.0" +"@graphql-codegen/schema-ast@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@graphql-codegen/schema-ast/-/schema-ast-4.0.0.tgz#5d60996c87b64f81847da8fcb2d8ef50ede89755" + integrity sha512-WIzkJFa9Gz28FITAPILbt+7A8+yzOyd1NxgwFh7ie+EmO9a5zQK6UQ3U/BviirguXCYnn+AR4dXsoDrSrtRA1g== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.0" + "@graphql-tools/utils" "^10.0.0" + tslib "~2.5.0" + +"@graphql-codegen/typed-document-node@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.1.tgz#ac90cf67c61554f63ec100d6076b47c9f0b18b27" + integrity sha512-VFkhCuJnkgtbbgzoCAwTdJe2G1H6sd3LfCrDqWUrQe53y2ukfSb5Ov1PhAIkCBStKCMQBUY9YgGz9GKR40qQ8g== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.0" + "@graphql-codegen/visitor-plugin-common" "4.0.1" + auto-bind "~4.0.0" + change-case-all "1.0.15" + tslib "~2.5.0" + "@graphql-codegen/typescript-operations@^3.0.4": version "3.0.4" resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-3.0.4.tgz#60163c07f0ef73655779ece450d02c1172c44027" @@ -2035,6 +2105,17 @@ auto-bind "~4.0.0" tslib "~2.5.0" +"@graphql-codegen/typescript-operations@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-4.0.1.tgz#930af3e2d2ae8ff06de696291be28fe7046a2fef" + integrity sha512-GpUWWdBVUec/Zqo23aFLBMrXYxN2irypHqDcKjN78JclDPdreasAEPcIpMfqf4MClvpmvDLy4ql+djVAwmkjbw== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.0" + "@graphql-codegen/typescript" "^4.0.1" + "@graphql-codegen/visitor-plugin-common" "4.0.1" + auto-bind "~4.0.0" + tslib "~2.5.0" + "@graphql-codegen/typescript-react-apollo@^3.3.7": version "3.3.7" resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-react-apollo/-/typescript-react-apollo-3.3.7.tgz#e856caa22c5f7bc9a546c44f54e5f3bd5801ab67" @@ -2057,6 +2138,17 @@ auto-bind "~4.0.0" tslib "~2.5.0" +"@graphql-codegen/typescript@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-4.0.1.tgz#7481d68f59bea802dd10e278dce73c8a1552b2a4" + integrity sha512-3YziQ21dCVdnHb+Us1uDb3pA6eG5Chjv0uTK+bt9dXeMlwYBU8MbtzvQTo4qvzWVC1AxSOKj0rgfNu1xCXqJyA== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.0" + "@graphql-codegen/schema-ast" "^4.0.0" + "@graphql-codegen/visitor-plugin-common" "4.0.1" + auto-bind "~4.0.0" + tslib "~2.5.0" + "@graphql-codegen/visitor-plugin-common@2.13.1": version "2.13.1" resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.13.1.tgz#2228660f6692bcdb96b1f6d91a0661624266b76b" @@ -2089,6 +2181,22 @@ parse-filepath "^1.0.2" tslib "~2.5.0" +"@graphql-codegen/visitor-plugin-common@4.0.1", "@graphql-codegen/visitor-plugin-common@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-4.0.1.tgz#64e293728b3c186f6767141e41fcdb310e50d367" + integrity sha512-Bi/1z0nHg4QMsAqAJhds+ForyLtk7A3HQOlkrZNm3xEkY7lcBzPtiOTLBtvziwopBsXUxqeSwVjOOFPLS5Yw1Q== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.0" + "@graphql-tools/optimize" "^2.0.0" + "@graphql-tools/relay-operation-optimizer" "^7.0.0" + "@graphql-tools/utils" "^10.0.0" + auto-bind "~4.0.0" + change-case-all "1.0.15" + dependency-graph "^0.11.0" + graphql-tag "^2.11.0" + parse-filepath "^1.0.2" + tslib "~2.5.0" + "@graphql-tools/apollo-engine-loader@^7.3.6": version "7.3.26" resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-7.3.26.tgz#91e54460d5579933e42a2010b8688c3459c245d8" @@ -2133,6 +2241,14 @@ tslib "^2.5.0" value-or-promise "^1.0.12" +"@graphql-tools/documents@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/documents/-/documents-1.0.0.tgz#e3ed97197cc22ec830ca227fd7d17e86d8424bdf" + integrity sha512-rHGjX1vg/nZ2DKqRGfDPNC55CWZBMldEVcH+91BThRa6JeT80NqXknffLLEZLRUxyikCfkwMsk6xR3UNMqG0Rg== + dependencies: + lodash.sortby "^4.7.0" + tslib "^2.4.0" + "@graphql-tools/executor-graphql-ws@^0.0.14": version "0.0.14" resolved "https://registry.yarnpkg.com/@graphql-tools/executor-graphql-ws/-/executor-graphql-ws-0.0.14.tgz#e0f53fc4cfc8a06cc461b2bc1edb4bb9a8e837ed" @@ -2274,6 +2390,13 @@ dependencies: tslib "^2.4.0" +"@graphql-tools/optimize@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-2.0.0.tgz#7a9779d180824511248a50c5a241eff6e7a2d906" + integrity sha512-nhdT+CRGDZ+bk68ic+Jw1OZ99YCDIKYA5AlVAnBHJvMawSx9YQqQAIj4refNc1/LRieGiuWvhbG3jvPVYho0Dg== + dependencies: + tslib "^2.4.0" + "@graphql-tools/prisma-loader@^7.2.49": version "7.2.72" resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-7.2.72.tgz#6304fc23600458396f3ede713d8e2371df7850e3" @@ -2307,6 +2430,15 @@ "@graphql-tools/utils" "^9.2.1" tslib "^2.4.0" +"@graphql-tools/relay-operation-optimizer@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-7.0.0.tgz#24367666af87bc5a81748de5e8e9b3c523fd4207" + integrity sha512-UNlJi5y3JylhVWU4MBpL0Hun4Q7IoJwv9xYtmAz+CgRa066szzY7dcuPfxrA7cIGgG/Q6TVsKsYaiF4OHPs1Fw== + dependencies: + "@ardatan/relay-compiler" "12.0.0" + "@graphql-tools/utils" "^10.0.0" + tslib "^2.4.0" + "@graphql-tools/schema@^9.0.0", "@graphql-tools/schema@^9.0.18", "@graphql-tools/schema@^9.0.19": version "9.0.19" resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-9.0.19.tgz#c4ad373b5e1b8a0cf365163435b7d236ebdd06e7" @@ -2336,6 +2468,15 @@ value-or-promise "^1.0.11" ws "^8.12.0" +"@graphql-tools/utils@^10.0.0": + version "10.0.7" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.0.7.tgz#ed88968b5ce53dabacbdd185df967aaab35f8549" + integrity sha512-KOdeMj6Hd/MENDaqPbws3YJl3wVy0DeYnL7PyUms5Skyf7uzI9INynDwPMhLXfSb0/ph6BXTwMd5zBtWbF8tBQ== + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + dset "^3.1.2" + tslib "^2.4.0" + "@graphql-tools/utils@^8.8.0": version "8.13.1" resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.13.1.tgz#b247607e400365c2cd87ff54654d4ad25a7ac491"