Fix ObjectType casing and conflict between Relation and RelationMetadata (#9849)
Fixes #9827 Also uncovered a conflict with `@objectType('Relation')` and `@objectType('relation)` I don't want to address it in this PR so I will create a followup issue when we close this but I think there's a confusion between Relation/RelationMetadata, it's unclear what is what --------- Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
import * as Apollo from '@apollo/client';
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
export type Maybe<T> = T | null;
|
||||
export type InputMaybe<T> = Maybe<T>;
|
||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||
@ -401,6 +401,32 @@ export enum FeatureFlagKey {
|
||||
IsWorkflowEnabled = 'IsWorkflowEnabled'
|
||||
}
|
||||
|
||||
export type Field = {
|
||||
__typename?: 'Field';
|
||||
createdAt: Scalars['DateTime'];
|
||||
defaultValue?: Maybe<Scalars['JSON']>;
|
||||
description?: Maybe<Scalars['String']>;
|
||||
fromRelationMetadata?: Maybe<RelationMetadata>;
|
||||
icon?: Maybe<Scalars['String']>;
|
||||
id: Scalars['UUID'];
|
||||
isActive?: Maybe<Scalars['Boolean']>;
|
||||
isCustom?: Maybe<Scalars['Boolean']>;
|
||||
isLabelSyncedWithName?: Maybe<Scalars['Boolean']>;
|
||||
isNullable?: Maybe<Scalars['Boolean']>;
|
||||
isSystem?: Maybe<Scalars['Boolean']>;
|
||||
isUnique?: Maybe<Scalars['Boolean']>;
|
||||
label: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
object?: Maybe<Object>;
|
||||
options?: Maybe<Scalars['JSON']>;
|
||||
relation?: Maybe<Relation>;
|
||||
relationDefinition?: Maybe<RelationDefinition>;
|
||||
settings?: Maybe<Scalars['JSON']>;
|
||||
toRelationMetadata?: Maybe<RelationMetadata>;
|
||||
type: FieldMetadataType;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
export type FieldConnection = {
|
||||
__typename?: 'FieldConnection';
|
||||
/** Array of edges. */
|
||||
@ -409,6 +435,23 @@ export type FieldConnection = {
|
||||
pageInfo: PageInfo;
|
||||
};
|
||||
|
||||
export type FieldEdge = {
|
||||
__typename?: 'FieldEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the Field */
|
||||
node: Field;
|
||||
};
|
||||
|
||||
export type FieldFilter = {
|
||||
and?: InputMaybe<Array<FieldFilter>>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
isActive?: InputMaybe<BooleanFieldComparison>;
|
||||
isCustom?: InputMaybe<BooleanFieldComparison>;
|
||||
isSystem?: InputMaybe<BooleanFieldComparison>;
|
||||
or?: InputMaybe<Array<FieldFilter>>;
|
||||
};
|
||||
|
||||
/** Type of the field */
|
||||
export enum FieldMetadataType {
|
||||
ACTOR = 'ACTOR',
|
||||
@ -489,6 +532,32 @@ export type ImpersonateOutput = {
|
||||
workspace: WorkspaceSubdomainAndId;
|
||||
};
|
||||
|
||||
export type Index = {
|
||||
__typename?: 'Index';
|
||||
createdAt: Scalars['DateTime'];
|
||||
id: Scalars['UUID'];
|
||||
indexFieldMetadatas: IndexIndexFieldMetadatasConnection;
|
||||
indexType: IndexType;
|
||||
indexWhereClause?: Maybe<Scalars['String']>;
|
||||
isCustom?: Maybe<Scalars['Boolean']>;
|
||||
isUnique: Scalars['Boolean'];
|
||||
name: Scalars['String'];
|
||||
objectMetadata: IndexObjectMetadataConnection;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
|
||||
export type IndexIndexFieldMetadatasArgs = {
|
||||
filter?: IndexFieldFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
|
||||
export type IndexObjectMetadataArgs = {
|
||||
filter?: ObjectFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
export type IndexConnection = {
|
||||
__typename?: 'IndexConnection';
|
||||
/** Array of edges. */
|
||||
@ -497,6 +566,45 @@ export type IndexConnection = {
|
||||
pageInfo: PageInfo;
|
||||
};
|
||||
|
||||
export type IndexEdge = {
|
||||
__typename?: 'IndexEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the Index */
|
||||
node: Index;
|
||||
};
|
||||
|
||||
export type IndexField = {
|
||||
__typename?: 'IndexField';
|
||||
createdAt: Scalars['DateTime'];
|
||||
fieldMetadataId: Scalars['UUID'];
|
||||
id: Scalars['UUID'];
|
||||
order: Scalars['Float'];
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
export type IndexFieldEdge = {
|
||||
__typename?: 'IndexFieldEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the IndexField */
|
||||
node: IndexField;
|
||||
};
|
||||
|
||||
export type IndexFieldFilter = {
|
||||
and?: InputMaybe<Array<IndexFieldFilter>>;
|
||||
fieldMetadataId?: InputMaybe<UuidFilterComparison>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
or?: InputMaybe<Array<IndexFieldFilter>>;
|
||||
};
|
||||
|
||||
export type IndexFilter = {
|
||||
and?: InputMaybe<Array<IndexFilter>>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
isCustom?: InputMaybe<BooleanFieldComparison>;
|
||||
or?: InputMaybe<Array<IndexFilter>>;
|
||||
};
|
||||
|
||||
export type IndexIndexFieldMetadatasConnection = {
|
||||
__typename?: 'IndexIndexFieldMetadatasConnection';
|
||||
/** Array of edges. */
|
||||
@ -871,6 +979,42 @@ export type MutationUserLookupAdminPanelArgs = {
|
||||
userIdentifier: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Object = {
|
||||
__typename?: 'Object';
|
||||
createdAt: Scalars['DateTime'];
|
||||
dataSourceId: Scalars['String'];
|
||||
description?: Maybe<Scalars['String']>;
|
||||
fields: ObjectFieldsConnection;
|
||||
icon?: Maybe<Scalars['String']>;
|
||||
id: Scalars['UUID'];
|
||||
imageIdentifierFieldMetadataId?: Maybe<Scalars['String']>;
|
||||
indexMetadatas: ObjectIndexMetadatasConnection;
|
||||
isActive: Scalars['Boolean'];
|
||||
isCustom: Scalars['Boolean'];
|
||||
isLabelSyncedWithName: Scalars['Boolean'];
|
||||
isRemote: Scalars['Boolean'];
|
||||
isSystem: Scalars['Boolean'];
|
||||
labelIdentifierFieldMetadataId?: Maybe<Scalars['String']>;
|
||||
labelPlural: Scalars['String'];
|
||||
labelSingular: Scalars['String'];
|
||||
namePlural: Scalars['String'];
|
||||
nameSingular: Scalars['String'];
|
||||
shortcut?: Maybe<Scalars['String']>;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
|
||||
export type ObjectFieldsArgs = {
|
||||
filter?: FieldFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
|
||||
export type ObjectIndexMetadatasArgs = {
|
||||
filter?: IndexFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
export type ObjectConnection = {
|
||||
__typename?: 'ObjectConnection';
|
||||
/** Array of edges. */
|
||||
@ -879,6 +1023,14 @@ export type ObjectConnection = {
|
||||
pageInfo: PageInfo;
|
||||
};
|
||||
|
||||
export type ObjectEdge = {
|
||||
__typename?: 'ObjectEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the Object */
|
||||
node: Object;
|
||||
};
|
||||
|
||||
export type ObjectFieldsConnection = {
|
||||
__typename?: 'ObjectFieldsConnection';
|
||||
/** Array of edges. */
|
||||
@ -887,6 +1039,16 @@ export type ObjectFieldsConnection = {
|
||||
pageInfo: PageInfo;
|
||||
};
|
||||
|
||||
export type ObjectFilter = {
|
||||
and?: InputMaybe<Array<ObjectFilter>>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
isActive?: InputMaybe<BooleanFieldComparison>;
|
||||
isCustom?: InputMaybe<BooleanFieldComparison>;
|
||||
isRemote?: InputMaybe<BooleanFieldComparison>;
|
||||
isSystem?: InputMaybe<BooleanFieldComparison>;
|
||||
or?: InputMaybe<Array<ObjectFilter>>;
|
||||
};
|
||||
|
||||
export type ObjectIndexMetadatasConnection = {
|
||||
__typename?: 'ObjectIndexMetadatasConnection';
|
||||
/** Array of edges. */
|
||||
@ -1079,14 +1241,6 @@ export type Relation = {
|
||||
type: RelationType;
|
||||
};
|
||||
|
||||
export type RelationConnection = {
|
||||
__typename?: 'RelationConnection';
|
||||
/** Array of edges. */
|
||||
edges: Array<RelationEdge>;
|
||||
/** Paging information */
|
||||
pageInfo: PageInfo;
|
||||
};
|
||||
|
||||
export type RelationDefinition = {
|
||||
__typename?: 'RelationDefinition';
|
||||
direction: RelationDefinitionType;
|
||||
@ -1105,6 +1259,36 @@ export enum RelationDefinitionType {
|
||||
ONE_TO_ONE = 'ONE_TO_ONE'
|
||||
}
|
||||
|
||||
export type RelationMetadata = {
|
||||
__typename?: 'RelationMetadata';
|
||||
createdAt: Scalars['DateTime'];
|
||||
fromFieldMetadataId: Scalars['String'];
|
||||
fromObjectMetadata: Object;
|
||||
fromObjectMetadataId: Scalars['String'];
|
||||
id: Scalars['UUID'];
|
||||
relationType: RelationMetadataType;
|
||||
toFieldMetadataId: Scalars['String'];
|
||||
toObjectMetadata: Object;
|
||||
toObjectMetadataId: Scalars['String'];
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
export type RelationMetadataConnection = {
|
||||
__typename?: 'RelationMetadataConnection';
|
||||
/** Array of edges. */
|
||||
edges: Array<RelationMetadataEdge>;
|
||||
/** Paging information */
|
||||
pageInfo: PageInfo;
|
||||
};
|
||||
|
||||
export type RelationMetadataEdge = {
|
||||
__typename?: 'RelationMetadataEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the RelationMetadata */
|
||||
node: RelationMetadata;
|
||||
};
|
||||
|
||||
/** Type of the relation */
|
||||
export enum RelationMetadataType {
|
||||
MANY_TO_MANY = 'MANY_TO_MANY',
|
||||
@ -1668,176 +1852,6 @@ export type WorkspaceSubdomainAndId = {
|
||||
subdomain: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Field = {
|
||||
__typename?: 'field';
|
||||
createdAt: Scalars['DateTime'];
|
||||
defaultValue?: Maybe<Scalars['JSON']>;
|
||||
description?: Maybe<Scalars['String']>;
|
||||
fromRelationMetadata?: Maybe<Relation>;
|
||||
icon?: Maybe<Scalars['String']>;
|
||||
id: Scalars['UUID'];
|
||||
isActive?: Maybe<Scalars['Boolean']>;
|
||||
isCustom?: Maybe<Scalars['Boolean']>;
|
||||
isLabelSyncedWithName?: Maybe<Scalars['Boolean']>;
|
||||
isNullable?: Maybe<Scalars['Boolean']>;
|
||||
isSystem?: Maybe<Scalars['Boolean']>;
|
||||
isUnique?: Maybe<Scalars['Boolean']>;
|
||||
label: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
object?: Maybe<Object>;
|
||||
options?: Maybe<Scalars['JSON']>;
|
||||
relation?: Maybe<Relation>;
|
||||
relationDefinition?: Maybe<RelationDefinition>;
|
||||
settings?: Maybe<Scalars['JSON']>;
|
||||
toRelationMetadata?: Maybe<Relation>;
|
||||
type: FieldMetadataType;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
export type FieldEdge = {
|
||||
__typename?: 'fieldEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the field */
|
||||
node: Field;
|
||||
};
|
||||
|
||||
export type FieldFilter = {
|
||||
and?: InputMaybe<Array<FieldFilter>>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
isActive?: InputMaybe<BooleanFieldComparison>;
|
||||
isCustom?: InputMaybe<BooleanFieldComparison>;
|
||||
isSystem?: InputMaybe<BooleanFieldComparison>;
|
||||
or?: InputMaybe<Array<FieldFilter>>;
|
||||
};
|
||||
|
||||
export type Index = {
|
||||
__typename?: 'index';
|
||||
createdAt: Scalars['DateTime'];
|
||||
id: Scalars['UUID'];
|
||||
indexFieldMetadatas: IndexIndexFieldMetadatasConnection;
|
||||
indexType: IndexType;
|
||||
indexWhereClause?: Maybe<Scalars['String']>;
|
||||
isCustom?: Maybe<Scalars['Boolean']>;
|
||||
isUnique: Scalars['Boolean'];
|
||||
name: Scalars['String'];
|
||||
objectMetadata: IndexObjectMetadataConnection;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
|
||||
export type IndexIndexFieldMetadatasArgs = {
|
||||
filter?: IndexFieldFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
|
||||
export type IndexObjectMetadataArgs = {
|
||||
filter?: ObjectFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
export type IndexEdge = {
|
||||
__typename?: 'indexEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the index */
|
||||
node: Index;
|
||||
};
|
||||
|
||||
export type IndexField = {
|
||||
__typename?: 'indexField';
|
||||
createdAt: Scalars['DateTime'];
|
||||
fieldMetadataId: Scalars['UUID'];
|
||||
id: Scalars['UUID'];
|
||||
order: Scalars['Float'];
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
export type IndexFieldEdge = {
|
||||
__typename?: 'indexFieldEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the indexField */
|
||||
node: IndexField;
|
||||
};
|
||||
|
||||
export type IndexFieldFilter = {
|
||||
and?: InputMaybe<Array<IndexFieldFilter>>;
|
||||
fieldMetadataId?: InputMaybe<UuidFilterComparison>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
or?: InputMaybe<Array<IndexFieldFilter>>;
|
||||
};
|
||||
|
||||
export type IndexFilter = {
|
||||
and?: InputMaybe<Array<IndexFilter>>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
isCustom?: InputMaybe<BooleanFieldComparison>;
|
||||
or?: InputMaybe<Array<IndexFilter>>;
|
||||
};
|
||||
|
||||
export type Object = {
|
||||
__typename?: 'object';
|
||||
createdAt: Scalars['DateTime'];
|
||||
dataSourceId: Scalars['String'];
|
||||
description?: Maybe<Scalars['String']>;
|
||||
fields: ObjectFieldsConnection;
|
||||
icon?: Maybe<Scalars['String']>;
|
||||
id: Scalars['UUID'];
|
||||
imageIdentifierFieldMetadataId?: Maybe<Scalars['String']>;
|
||||
indexMetadatas: ObjectIndexMetadatasConnection;
|
||||
isActive: Scalars['Boolean'];
|
||||
isCustom: Scalars['Boolean'];
|
||||
isLabelSyncedWithName: Scalars['Boolean'];
|
||||
isRemote: Scalars['Boolean'];
|
||||
isSystem: Scalars['Boolean'];
|
||||
labelIdentifierFieldMetadataId?: Maybe<Scalars['String']>;
|
||||
labelPlural: Scalars['String'];
|
||||
labelSingular: Scalars['String'];
|
||||
namePlural: Scalars['String'];
|
||||
nameSingular: Scalars['String'];
|
||||
shortcut?: Maybe<Scalars['String']>;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
|
||||
export type ObjectFieldsArgs = {
|
||||
filter?: FieldFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
|
||||
export type ObjectIndexMetadatasArgs = {
|
||||
filter?: IndexFilter;
|
||||
paging?: CursorPaging;
|
||||
};
|
||||
|
||||
export type ObjectEdge = {
|
||||
__typename?: 'objectEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the object */
|
||||
node: Object;
|
||||
};
|
||||
|
||||
export type ObjectFilter = {
|
||||
and?: InputMaybe<Array<ObjectFilter>>;
|
||||
id?: InputMaybe<UuidFilterComparison>;
|
||||
isActive?: InputMaybe<BooleanFieldComparison>;
|
||||
isCustom?: InputMaybe<BooleanFieldComparison>;
|
||||
isRemote?: InputMaybe<BooleanFieldComparison>;
|
||||
isSystem?: InputMaybe<BooleanFieldComparison>;
|
||||
or?: InputMaybe<Array<ObjectFilter>>;
|
||||
};
|
||||
|
||||
export type RelationEdge = {
|
||||
__typename?: 'relationEdge';
|
||||
/** Cursor for this node. */
|
||||
cursor: Scalars['ConnectionCursor'];
|
||||
/** The node containing the relation */
|
||||
node: Relation;
|
||||
};
|
||||
|
||||
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: any, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: CalendarChannelVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
|
||||
|
||||
export type TimelineCalendarEventParticipantFragmentFragment = { __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
||||
|
||||
@ -43,8 +43,10 @@ export const CREATE_ONE_FIELD_METADATA_ITEM = gql`
|
||||
`;
|
||||
|
||||
export const CREATE_ONE_RELATION_METADATA_ITEM = gql`
|
||||
mutation CreateOneRelationMetadata($input: CreateOneRelationInput!) {
|
||||
createOneRelation(input: $input) {
|
||||
mutation CreateOneRelationMetadataItem(
|
||||
$input: CreateOneRelationMetadataInput!
|
||||
) {
|
||||
createOneRelationMetadata(input: $input) {
|
||||
id
|
||||
relationType
|
||||
fromObjectMetadataId
|
||||
|
||||
@ -2,8 +2,8 @@ import { gql } from '@apollo/client';
|
||||
|
||||
export const FIND_MANY_OBJECT_METADATA_ITEMS = gql`
|
||||
query ObjectMetadataItems(
|
||||
$objectFilter: objectFilter
|
||||
$fieldFilter: fieldFilter
|
||||
$objectFilter: ObjectFilter
|
||||
$fieldFilter: FieldFilter
|
||||
) {
|
||||
objects(paging: { first: 1000 }, filter: $objectFilter) {
|
||||
edges {
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const query = gql`
|
||||
mutation CreateOneRelationMetadata($input: CreateOneRelationInput!) {
|
||||
createOneRelation(input: $input) {
|
||||
mutation CreateOneRelationMetadataItem(
|
||||
$input: CreateOneRelationMetadataInput!
|
||||
) {
|
||||
createOneRelationMetadata(input: $input) {
|
||||
id
|
||||
relationType
|
||||
fromObjectMetadataId
|
||||
@ -17,7 +19,7 @@ export const query = gql`
|
||||
|
||||
export const variables = {
|
||||
input: {
|
||||
relation: {
|
||||
relationMetadata: {
|
||||
fromDescription: null,
|
||||
fromIcon: undefined,
|
||||
fromLabel: 'label',
|
||||
|
||||
@ -2,7 +2,7 @@ import { gql } from '@apollo/client';
|
||||
import { mockedStandardObjectMetadataQueryResult } from '~/testing/mock-data/generated/mock-metadata-query-result';
|
||||
|
||||
export const query = gql`
|
||||
query ObjectMetadataItems($objectFilter: objectFilter, $fieldFilter: fieldFilter) {
|
||||
query ObjectMetadataItems($objectFilter: ObjectFilter, $fieldFilter: FieldFilter) {
|
||||
objects(paging: {first: 1000}, filter: $objectFilter) {
|
||||
edges {
|
||||
node {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { useMutation } from '@apollo/client';
|
||||
|
||||
import {
|
||||
CreateOneRelationMetadataMutation,
|
||||
CreateOneRelationMetadataMutationVariables,
|
||||
CreateOneRelationMetadataItemMutation,
|
||||
CreateOneRelationMetadataItemMutationVariables,
|
||||
} from '~/generated-metadata/graphql';
|
||||
|
||||
import { CREATE_ONE_RELATION_METADATA_ITEM } from '../graphql/mutations';
|
||||
@ -18,8 +18,8 @@ export const useCreateOneRelationMetadataItem = () => {
|
||||
const apolloMetadataClient = useApolloMetadataClient();
|
||||
|
||||
const [mutate] = useMutation<
|
||||
CreateOneRelationMetadataMutation,
|
||||
CreateOneRelationMetadataMutationVariables
|
||||
CreateOneRelationMetadataItemMutation,
|
||||
CreateOneRelationMetadataItemMutationVariables
|
||||
>(CREATE_ONE_RELATION_METADATA_ITEM, {
|
||||
client: apolloMetadataClient,
|
||||
});
|
||||
@ -31,7 +31,9 @@ export const useCreateOneRelationMetadataItem = () => {
|
||||
input: FormatRelationMetadataInputParams,
|
||||
) => {
|
||||
const result = await mutate({
|
||||
variables: { input: { relation: formatRelationMetadataInput(input) } },
|
||||
variables: {
|
||||
input: { relationMetadata: formatRelationMetadataInput(input) },
|
||||
},
|
||||
});
|
||||
|
||||
await refreshObjectMetadataItems();
|
||||
|
||||
@ -11,7 +11,7 @@ import { camelCaseStringSchema } from '~/utils/validation-schemas/camelCaseStrin
|
||||
|
||||
export const fieldMetadataItemSchema = (existingLabels?: string[]) => {
|
||||
return z.object({
|
||||
__typename: z.literal('field').optional(),
|
||||
__typename: z.literal('Field').optional(),
|
||||
createdAt: z.string().datetime(),
|
||||
defaultValue: z.any().optional(),
|
||||
description: z.string().trim().nullable().optional(),
|
||||
@ -44,23 +44,23 @@ export const fieldMetadataItemSchema = (existingLabels?: string[]) => {
|
||||
relationId: z.string().uuid(),
|
||||
direction: z.nativeEnum(RelationDefinitionType),
|
||||
sourceFieldMetadata: z.object({
|
||||
__typename: z.literal('field').optional(),
|
||||
__typename: z.literal('Field').optional(),
|
||||
id: z.string().uuid(),
|
||||
name: z.string().trim().min(1),
|
||||
}),
|
||||
sourceObjectMetadata: z.object({
|
||||
__typename: z.literal('object').optional(),
|
||||
__typename: z.literal('Object').optional(),
|
||||
id: z.string().uuid(),
|
||||
namePlural: z.string().trim().min(1),
|
||||
nameSingular: z.string().trim().min(1),
|
||||
}),
|
||||
targetFieldMetadata: z.object({
|
||||
__typename: z.literal('field').optional(),
|
||||
__typename: z.literal('Field').optional(),
|
||||
id: z.string().uuid(),
|
||||
name: z.string().trim().min(1),
|
||||
}),
|
||||
targetObjectMetadata: z.object({
|
||||
__typename: z.literal('object').optional(),
|
||||
__typename: z.literal('Object').optional(),
|
||||
id: z.string().uuid(),
|
||||
namePlural: z.string().trim().min(1),
|
||||
nameSingular: z.string().trim().min(1),
|
||||
|
||||
@ -3,7 +3,7 @@ import { z } from 'zod';
|
||||
import { IndexFieldMetadataItem } from '@/object-metadata/types/IndexFieldMetadataItem';
|
||||
|
||||
export const indexFieldMetadataItemSchema = z.object({
|
||||
__typename: z.literal('indexField'),
|
||||
__typename: z.literal('IndexField'),
|
||||
fieldMetadataId: z.string().uuid(),
|
||||
id: z.string(),
|
||||
createdAt: z.string(),
|
||||
|
||||
@ -5,7 +5,7 @@ import { indexFieldMetadataItemSchema } from '@/object-metadata/validation-schem
|
||||
import { IndexType } from '~/generated-metadata/graphql';
|
||||
|
||||
export const indexMetadataItemSchema = z.object({
|
||||
__typename: z.literal('index'),
|
||||
__typename: z.literal('Index'),
|
||||
id: z.string().uuid(),
|
||||
name: z.string(),
|
||||
indexFieldMetadatas: z.array(indexFieldMetadataItemSchema),
|
||||
|
||||
@ -7,7 +7,7 @@ import { metadataLabelSchema } from '@/object-metadata/validation-schemas/metada
|
||||
import { camelCaseStringSchema } from '~/utils/validation-schemas/camelCaseStringSchema';
|
||||
|
||||
export const objectMetadataItemSchema = z.object({
|
||||
__typename: z.literal('object').optional(),
|
||||
__typename: z.literal('Object').optional(),
|
||||
createdAt: z.string().datetime(),
|
||||
dataSourceId: z.string().uuid(),
|
||||
description: z.string().trim().nullable().optional(),
|
||||
|
||||
@ -17,7 +17,7 @@ import {
|
||||
IconSettings,
|
||||
} from 'twenty-ui';
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
import { FeatureFlag, FeatureFlagKey } from '~/generated/graphql';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
export const useRecordShowContainerTabs = (
|
||||
loading: boolean,
|
||||
@ -252,7 +252,7 @@ export const useRecordShowContainerTabs = (
|
||||
hide.ifFeaturesDisabled.length > 0 &&
|
||||
!hide.ifFeaturesDisabled.every((flagKey) => {
|
||||
return !!currentWorkspace?.featureFlags?.find(
|
||||
(flag: FeatureFlag) => flag.key === flagKey && flag.value,
|
||||
(flag) => flag.key === flagKey && flag.value,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ import { UpgradeTo0_40CommandModule } from 'src/database/commands/upgrade-versio
|
||||
import { UpgradeTo0_41CommandModule } from 'src/database/commands/upgrade-version/0-41/0-41-upgrade-version.module';
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { WorkspaceModule } from 'src/engine/core-modules/workspace/workspace.module';
|
||||
@ -34,7 +34,7 @@ import { WorkspaceSyncMetadataModule } from 'src/engine/workspace-manager/worksp
|
||||
DataSourceModule,
|
||||
TypeORMModule,
|
||||
TypeOrmModule.forFeature(
|
||||
[Workspace, BillingSubscription, FeatureFlagEntity],
|
||||
[Workspace, BillingSubscription, FeatureFlag],
|
||||
'core',
|
||||
),
|
||||
TypeOrmModule.forFeature(
|
||||
|
||||
@ -13,7 +13,7 @@ import { rawDataSource } from 'src/database/typeorm/raw/raw.datasource';
|
||||
import { TypeORMService } from 'src/database/typeorm/typeorm.service';
|
||||
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
|
||||
import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
@ -40,8 +40,8 @@ export class UpdateInactiveWorkspaceStatusCommand extends BaseCommandRunner {
|
||||
protected readonly workspaceMigrationRepository: Repository<WorkspaceMigrationEntity>,
|
||||
@InjectRepository(BillingSubscription, 'core')
|
||||
protected readonly subscriptionRepository: Repository<BillingSubscription>,
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
protected readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
protected readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
@InjectRepository(KeyValuePair, 'core')
|
||||
protected readonly keyValuePairRepository: Repository<KeyValuePair>,
|
||||
@InjectRepository(UserWorkspace, 'core')
|
||||
|
||||
@ -6,7 +6,7 @@ import { UpdateInactiveWorkspaceStatusCommand } from 'src/database/commands/upgr
|
||||
import { UpgradeTo0_40Command } from 'src/database/commands/upgrade-version/0-40/0-40-upgrade-version.command';
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
@ -25,7 +25,7 @@ import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/wor
|
||||
[
|
||||
Workspace,
|
||||
BillingSubscription,
|
||||
FeatureFlagEntity,
|
||||
FeatureFlag,
|
||||
KeyValuePair,
|
||||
User,
|
||||
UserWorkspace,
|
||||
|
||||
@ -11,7 +11,7 @@ import { BillingProduct } from 'src/engine/core-modules/billing/entities/billing
|
||||
import { BillingSubscriptionItem } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity';
|
||||
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
|
||||
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||
import { PostgresCredentials } from 'src/engine/core-modules/postgres-credentials/postgres-credentials.entity';
|
||||
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
@ -38,7 +38,7 @@ export class TypeORMService implements OnModuleInit, OnModuleDestroy {
|
||||
UserWorkspace,
|
||||
AppToken,
|
||||
KeyValuePair,
|
||||
FeatureFlagEntity,
|
||||
FeatureFlag,
|
||||
BillingSubscription,
|
||||
BillingSubscriptionItem,
|
||||
BillingMeter,
|
||||
|
||||
@ -7,7 +7,7 @@ import { TelemetryListener } from 'src/engine/api/graphql/workspace-query-runner
|
||||
import { WorkspaceQueryHookModule } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-hook/workspace-query-hook.module';
|
||||
import { AnalyticsModule } from 'src/engine/core-modules/analytics/analytics.module';
|
||||
import { AuthModule } from 'src/engine/core-modules/auth/auth.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { FileModule } from 'src/engine/core-modules/file/file.module';
|
||||
import { TelemetryModule } from 'src/engine/core-modules/telemetry/telemetry.module';
|
||||
@ -24,7 +24,7 @@ import { EntityEventsToDbListener } from './listeners/entity-events-to-db.listen
|
||||
WorkspaceDataSourceModule,
|
||||
WorkspaceQueryHookModule,
|
||||
ObjectMetadataRepositoryModule.forFeature([WorkspaceMemberWorkspaceEntity]),
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
AnalyticsModule,
|
||||
TelemetryModule,
|
||||
FileModule,
|
||||
|
||||
@ -4,13 +4,13 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { AdminPanelResolver } from 'src/engine/core-modules/admin-panel/admin-panel.resolver';
|
||||
import { AdminPanelService } from 'src/engine/core-modules/admin-panel/admin-panel.service';
|
||||
import { AuthModule } from 'src/engine/core-modules/auth/auth.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([User, Workspace, FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([User, Workspace, FeatureFlag], 'core'),
|
||||
AuthModule,
|
||||
],
|
||||
providers: [AdminPanelResolver, AdminPanelService],
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
} from 'src/engine/core-modules/auth/auth.exception';
|
||||
import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import {
|
||||
FeatureFlagException,
|
||||
FeatureFlagExceptionCode,
|
||||
@ -29,8 +29,8 @@ export class AdminPanelService {
|
||||
private readonly userRepository: Repository<User>,
|
||||
@InjectRepository(Workspace, 'core')
|
||||
private readonly workspaceRepository: Repository<Workspace>,
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
async impersonate(userId: string, workspaceId: string) {
|
||||
@ -115,7 +115,7 @@ export class AdminPanelService {
|
||||
userWorkspace.workspace.featureFlags?.find(
|
||||
(flag) => flag.key === key,
|
||||
)?.value ?? false,
|
||||
})) as FeatureFlagEntity[],
|
||||
})) as FeatureFlag[],
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
} from 'src/engine/core-modules/auth/auth.exception';
|
||||
import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@ -49,7 +49,7 @@ describe('AdminPanelService', () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: getRepositoryToken(FeatureFlagEntity, 'core'),
|
||||
provide: getRepositoryToken(FeatureFlag, 'core'),
|
||||
useValue: {
|
||||
update: FeatureFlagUpdateMock,
|
||||
save: FeatureFlagSaveMock,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
|
||||
@ObjectType()
|
||||
class UserInfo {
|
||||
@ -37,8 +37,8 @@ class WorkspaceInfo {
|
||||
@Field(() => [UserInfo])
|
||||
users: UserInfo[];
|
||||
|
||||
@Field(() => [FeatureFlagEntity])
|
||||
featureFlags: FeatureFlagEntity[];
|
||||
@Field(() => [FeatureFlag])
|
||||
featureFlags: FeatureFlag[];
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
|
||||
@ -28,7 +28,7 @@ export enum AppTokenType {
|
||||
}
|
||||
|
||||
@Entity({ name: 'appToken', schema: 'core' })
|
||||
@ObjectType('AppToken')
|
||||
@ObjectType()
|
||||
@BeforeCreateOne(BeforeCreateOneAppToken)
|
||||
export class AppToken {
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -26,7 +26,7 @@ import { TransientTokenService } from 'src/engine/core-modules/auth/token/servic
|
||||
import { TokenModule } from 'src/engine/core-modules/auth/token/token.module';
|
||||
import { DomainManagerModule } from 'src/engine/core-modules/domain-manager/domain-manager.module';
|
||||
import { EmailVerificationModule } from 'src/engine/core-modules/email-verification/email-verification.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { FileUploadModule } from 'src/engine/core-modules/file/file-upload/file-upload.module';
|
||||
import { JwtModule } from 'src/engine/core-modules/jwt/jwt.module';
|
||||
@ -67,7 +67,7 @@ import { JwtAuthStrategy } from './strategies/jwt.auth.strategy';
|
||||
Workspace,
|
||||
User,
|
||||
AppToken,
|
||||
FeatureFlagEntity,
|
||||
FeatureFlag,
|
||||
WorkspaceSSOIdentityProvider,
|
||||
KeyValuePair,
|
||||
],
|
||||
|
||||
@ -25,7 +25,7 @@ import { BillingWebhookPriceService } from 'src/engine/core-modules/billing/webh
|
||||
import { BillingWebhookProductService } from 'src/engine/core-modules/billing/webhooks/services/billing-webhook-product.service';
|
||||
import { BillingWebhookSubscriptionService } from 'src/engine/core-modules/billing/webhooks/services/billing-webhook-subscription.service';
|
||||
import { DomainManagerModule } from 'src/engine/core-modules/domain-manager/domain-manager.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { MessageQueueModule } from 'src/engine/core-modules/message-queue/message-queue.module';
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
@ -48,7 +48,7 @@ import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
BillingEntitlement,
|
||||
Workspace,
|
||||
UserWorkspace,
|
||||
FeatureFlagEntity,
|
||||
FeatureFlag,
|
||||
],
|
||||
'core',
|
||||
),
|
||||
|
||||
@ -16,7 +16,7 @@ import { BillingEntitlement } from 'src/engine/core-modules/billing/entities/bil
|
||||
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
|
||||
|
||||
@Entity({ name: 'billingCustomer', schema: 'core' })
|
||||
@ObjectType('billingCustomer')
|
||||
@ObjectType()
|
||||
export class BillingCustomer {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
@ -17,7 +17,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
|
||||
import { BillingCustomer } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
|
||||
import { BillingEntitlementKey } from 'src/engine/core-modules/billing/enums/billing-entitlement-key.enum';
|
||||
@Entity({ name: 'billingEntitlement', schema: 'core' })
|
||||
@ObjectType('billingEntitlement')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnFeatureKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
|
||||
export class BillingEntitlement {
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -30,7 +30,7 @@ registerEnumType(SubscriptionInterval, { name: 'SubscriptionInterval' });
|
||||
unique: true,
|
||||
where: `status IN ('trialing', 'active', 'past_due')`,
|
||||
})
|
||||
@ObjectType('BillingSubscription')
|
||||
@ObjectType()
|
||||
export class BillingSubscription {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ObjectType, Field } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('TimelineCalendarEventParticipant')
|
||||
@ObjectType()
|
||||
export class TimelineCalendarEventParticipant {
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
personId: string | null;
|
||||
|
||||
@ -4,7 +4,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
|
||||
import { TimelineCalendarEventParticipant } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
|
||||
import { CalendarChannelVisibility } from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';
|
||||
|
||||
@ObjectType('LinkMetadata')
|
||||
@ObjectType()
|
||||
class LinkMetadata {
|
||||
@Field()
|
||||
label: string;
|
||||
@ -13,7 +13,7 @@ class LinkMetadata {
|
||||
url: string;
|
||||
}
|
||||
|
||||
@ObjectType('LinksMetadata')
|
||||
@ObjectType()
|
||||
export class LinksMetadata {
|
||||
@Field()
|
||||
primaryLinkLabel: string;
|
||||
@ -25,7 +25,7 @@ export class LinksMetadata {
|
||||
secondaryLinks: LinkMetadata[] | null;
|
||||
}
|
||||
|
||||
@ObjectType('TimelineCalendarEvent')
|
||||
@ObjectType()
|
||||
export class TimelineCalendarEvent {
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@ -2,7 +2,7 @@ import { Field, Int, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { TimelineCalendarEvent } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto';
|
||||
|
||||
@ObjectType('TimelineCalendarEventsWithTotal')
|
||||
@ObjectType()
|
||||
export class TimelineCalendarEventsWithTotal {
|
||||
@Field(() => Int)
|
||||
totalNumberOfCalendarEvents: number;
|
||||
|
||||
@ -17,9 +17,9 @@ import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/featu
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Entity({ name: 'featureFlag', schema: 'core' })
|
||||
@ObjectType('FeatureFlag')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
|
||||
export class FeatureFlagEntity {
|
||||
export class FeatureFlag {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ -4,16 +4,14 @@ import { NestjsQueryGraphQLModule } from '@ptc-org/nestjs-query-graphql';
|
||||
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
|
||||
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeORMModule,
|
||||
NestjsQueryGraphQLModule.forFeature({
|
||||
imports: [
|
||||
NestjsQueryTypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
],
|
||||
imports: [NestjsQueryTypeOrmModule.forFeature([FeatureFlag], 'core')],
|
||||
services: [],
|
||||
resolvers: [],
|
||||
}),
|
||||
|
||||
@ -6,13 +6,13 @@ import { Repository } from 'typeorm';
|
||||
import { FeatureFlagMap } from 'src/engine/core-modules/feature-flag/interfaces/feature-flag-map.interface';
|
||||
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
|
||||
@Injectable()
|
||||
export class FeatureFlagService {
|
||||
constructor(
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
public async isFeatureEnabled(
|
||||
@ -30,7 +30,7 @@ export class FeatureFlagService {
|
||||
|
||||
public async getWorkspaceFeatureFlags(
|
||||
workspaceId: string,
|
||||
): Promise<FeatureFlagEntity[]> {
|
||||
): Promise<FeatureFlag[]> {
|
||||
return this.featureFlagRepository.find({ where: { workspaceId } });
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ export enum KeyValuePairType {
|
||||
}
|
||||
|
||||
@Entity({ name: 'keyValuePair', schema: 'core' })
|
||||
@ObjectType('KeyValuePair')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnKeyUserIdWorkspaceIdUnique', ['key', 'userId', 'workspaceId'])
|
||||
@Index('IndexOnKeyWorkspaceIdAndNullUserIdUnique', ['key', 'workspaceId'], {
|
||||
unique: true,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
import { LabResolver } from './lab.resolver';
|
||||
@ -9,7 +9,7 @@ import { LabResolver } from './lab.resolver';
|
||||
import { LabService } from './services/lab.service';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([FeatureFlagEntity, Workspace], 'core')],
|
||||
imports: [TypeOrmModule.forFeature([FeatureFlag, Workspace], 'core')],
|
||||
providers: [LabService, LabResolver],
|
||||
exports: [LabService],
|
||||
})
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
AuthExceptionCode,
|
||||
} from 'src/engine/core-modules/auth/auth.exception';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import {
|
||||
FeatureFlagException,
|
||||
FeatureFlagExceptionCode,
|
||||
@ -22,8 +22,8 @@ import { workspaceValidator } from 'src/engine/core-modules/workspace/workspace.
|
||||
@Injectable()
|
||||
export class LabService {
|
||||
constructor(
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
@InjectRepository(Workspace, 'core')
|
||||
private readonly workspaceRepository: Repository<Workspace>,
|
||||
) {}
|
||||
|
||||
@ -2,7 +2,7 @@ import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('TimelineThreadParticipant')
|
||||
@ObjectType()
|
||||
export class TimelineThreadParticipant {
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
personId: string | null;
|
||||
|
||||
@ -4,7 +4,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
|
||||
import { TimelineThreadParticipant } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
|
||||
import { MessageChannelVisibility } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
|
||||
|
||||
@ObjectType('TimelineThread')
|
||||
@ObjectType()
|
||||
export class TimelineThread {
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@ -2,7 +2,7 @@ import { Field, Int, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { TimelineThread } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
|
||||
|
||||
@ObjectType('TimelineThreadsWithTotal')
|
||||
@ObjectType()
|
||||
export class TimelineThreadsWithTotal {
|
||||
@Field(() => Int)
|
||||
totalNumberOfThreads: number;
|
||||
|
||||
@ -6,7 +6,7 @@ import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
|
||||
|
||||
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
import { BillingModule } from 'src/engine/core-modules/billing/billing.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { SSOService } from 'src/engine/core-modules/sso/services/sso.service';
|
||||
import { SSOResolver } from 'src/engine/core-modules/sso/sso.resolver';
|
||||
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
@ -17,7 +17,7 @@ import { GuardRedirectModule } from 'src/engine/core-modules/guard-redirect/guar
|
||||
@Module({
|
||||
imports: [
|
||||
NestjsQueryTypeOrmModule.forFeature(
|
||||
[WorkspaceSSOIdentityProvider, User, AppToken, FeatureFlagEntity],
|
||||
[WorkspaceSSOIdentityProvider, User, AppToken, FeatureFlag],
|
||||
'core',
|
||||
),
|
||||
BillingModule,
|
||||
|
||||
@ -45,7 +45,7 @@ registerEnumType(SSOIdentityProviderStatus, {
|
||||
});
|
||||
|
||||
@Entity({ name: 'workspaceSSOIdentityProvider', schema: 'core' })
|
||||
@ObjectType('WorkspaceSSOIdentityProvider')
|
||||
@ObjectType()
|
||||
export class WorkspaceSSOIdentityProvider {
|
||||
// COMMON
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -14,7 +14,7 @@ import {
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
|
||||
@Entity({ name: 'twoFactorMethod', schema: 'core' })
|
||||
@ObjectType('TwoFactorMethod')
|
||||
@ObjectType()
|
||||
export class TwoFactorMethod {
|
||||
@Field()
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
@ -20,7 +20,7 @@ import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Entity({ name: 'userWorkspace', schema: 'core' })
|
||||
@ObjectType('UserWorkspace')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnUserIdAndWorkspaceIdUnique', ['userId', 'workspaceId'])
|
||||
export class UserWorkspace {
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
WorkspaceMemberTimeFormatEnum,
|
||||
} from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
@ObjectType('FullName')
|
||||
@ObjectType()
|
||||
export class FullName {
|
||||
@Field({ nullable: false })
|
||||
firstName: string;
|
||||
@ -17,7 +17,7 @@ export class FullName {
|
||||
lastName: string;
|
||||
}
|
||||
|
||||
@ObjectType('WorkspaceMember')
|
||||
@ObjectType()
|
||||
export class WorkspaceMember {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@ -27,7 +27,7 @@ registerEnumType(OnboardingStatus, {
|
||||
});
|
||||
|
||||
@Entity({ name: 'user', schema: 'core' })
|
||||
@ObjectType('User')
|
||||
@ObjectType()
|
||||
@Index('UQ_USER_EMAIL', ['email'], {
|
||||
unique: true,
|
||||
where: '"deletedAt" IS NULL',
|
||||
|
||||
@ -15,7 +15,7 @@ import {
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||
import { PostgresCredentials } from 'src/engine/core-modules/postgres-credentials/postgres-credentials.entity';
|
||||
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
@ -26,7 +26,7 @@ registerEnumType(WorkspaceActivationStatus, {
|
||||
});
|
||||
|
||||
@Entity({ name: 'workspace', schema: 'core' })
|
||||
@ObjectType('Workspace')
|
||||
@ObjectType()
|
||||
export class Workspace {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
@ -83,8 +83,8 @@ export class Workspace {
|
||||
@Column({ default: true })
|
||||
isPublicInviteLinkEnabled: boolean;
|
||||
|
||||
@OneToMany(() => FeatureFlagEntity, (featureFlag) => featureFlag.workspace)
|
||||
featureFlags: Relation<FeatureFlagEntity[]>;
|
||||
@OneToMany(() => FeatureFlag, (featureFlag) => featureFlag.workspace)
|
||||
featureFlags: Relation<FeatureFlag[]>;
|
||||
|
||||
@Field({ nullable: true })
|
||||
workspaceMembersCount: number;
|
||||
|
||||
@ -19,7 +19,7 @@ import { BillingSubscriptionService } from 'src/engine/core-modules/billing/serv
|
||||
import { DomainManagerService } from 'src/engine/core-modules/domain-manager/services/domain-manager.service';
|
||||
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
import { FileUploadService } from 'src/engine/core-modules/file/file-upload/services/file-upload.service';
|
||||
import { FileService } from 'src/engine/core-modules/file/services/file.service';
|
||||
@ -142,10 +142,8 @@ export class WorkspaceResolver {
|
||||
return `${paths[0]}?token=${workspaceLogoToken}`;
|
||||
}
|
||||
|
||||
@ResolveField(() => [FeatureFlagEntity], { nullable: true })
|
||||
async featureFlags(
|
||||
@Parent() workspace: Workspace,
|
||||
): Promise<FeatureFlagEntity[]> {
|
||||
@ResolveField(() => [FeatureFlag], { nullable: true })
|
||||
async featureFlags(@Parent() workspace: Workspace): Promise<FeatureFlag[]> {
|
||||
const featureFlags = await this.featureFlagService.getWorkspaceFeatureFlags(
|
||||
workspace.id,
|
||||
);
|
||||
|
||||
@ -44,7 +44,7 @@ registerEnumType(FieldMetadataType, {
|
||||
description: 'Type of the field',
|
||||
});
|
||||
|
||||
@ObjectType('field')
|
||||
@ObjectType('Field')
|
||||
@Authorize({
|
||||
authorize: (context: any) => ({
|
||||
workspaceId: { eq: context?.req?.workspace?.id },
|
||||
|
||||
@ -14,7 +14,7 @@ import { FieldMetadataDTO } from 'src/engine/metadata-modules/field-metadata/dto
|
||||
|
||||
import { IndexMetadataDTO } from './index-metadata.dto';
|
||||
|
||||
@ObjectType('indexField')
|
||||
@ObjectType('IndexField')
|
||||
@Authorize({
|
||||
authorize: (context: any) => ({
|
||||
workspaceId: { eq: context?.req?.workspace?.id },
|
||||
|
||||
@ -33,7 +33,7 @@ registerEnumType(IndexType, {
|
||||
description: 'Type of the index',
|
||||
});
|
||||
|
||||
@ObjectType('index')
|
||||
@ObjectType('Index')
|
||||
@Authorize({
|
||||
authorize: (context: any) => ({
|
||||
workspaceId: { eq: context?.req?.workspace?.id },
|
||||
|
||||
@ -14,7 +14,7 @@ import { FieldMetadataDTO } from 'src/engine/metadata-modules/field-metadata/dto
|
||||
import { IndexMetadataDTO } from 'src/engine/metadata-modules/index-metadata/dtos/index-metadata.dto';
|
||||
import { BeforeDeleteOneObject } from 'src/engine/metadata-modules/object-metadata/hooks/before-delete-one-object.hook';
|
||||
|
||||
@ObjectType('object')
|
||||
@ObjectType('Object')
|
||||
@Authorize({
|
||||
authorize: (context: any) => ({
|
||||
workspaceId: { eq: context?.req?.workspace?.id },
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
|
||||
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
|
||||
import { DataSourceModule } from 'src/engine/metadata-modules/data-source/data-source.module';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
@ -43,7 +43,7 @@ import { UpdateObjectPayload } from './dtos/update-object.input';
|
||||
[ObjectMetadataEntity, FieldMetadataEntity, RelationMetadataEntity],
|
||||
'metadata',
|
||||
),
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
DataSourceModule,
|
||||
WorkspaceMigrationModule,
|
||||
WorkspaceMigrationRunnerModule,
|
||||
|
||||
@ -24,7 +24,7 @@ registerEnumType(RelationMetadataType, {
|
||||
description: 'Type of the relation',
|
||||
});
|
||||
|
||||
@ObjectType('relation')
|
||||
@ObjectType('RelationMetadata')
|
||||
@Authorize({
|
||||
authorize: (context: any) => ({
|
||||
workspaceId: { eq: context?.req?.workspace?.id },
|
||||
|
||||
@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { ForeignDataWrapperServerQueryFactory } from 'src/engine/api/graphql/workspace-query-builder/factories/foreign-data-wrapper-server-query.factory';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { JwtModule } from 'src/engine/core-modules/jwt/jwt.module';
|
||||
import { RemoteServerEntity } from 'src/engine/metadata-modules/remote-server/remote-server.entity';
|
||||
import { RemoteServerResolver } from 'src/engine/metadata-modules/remote-server/remote-server.resolver';
|
||||
@ -16,7 +16,7 @@ import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/works
|
||||
TypeOrmModule.forFeature([RemoteServerEntity], 'metadata'),
|
||||
RemoteTableModule,
|
||||
WorkspaceDataSourceModule,
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
],
|
||||
providers: [
|
||||
RemoteServerService,
|
||||
|
||||
@ -7,7 +7,7 @@ import { v4 } from 'uuid';
|
||||
|
||||
import { ForeignDataWrapperServerQueryFactory } from 'src/engine/api/graphql/workspace-query-builder/factories/foreign-data-wrapper-server-query.factory';
|
||||
import { encryptText } from 'src/engine/core-modules/auth/auth.util';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { JwtWrapperService } from 'src/engine/core-modules/jwt/services/jwt-wrapper.service';
|
||||
import { CreateRemoteServerInput } from 'src/engine/metadata-modules/remote-server/dtos/create-remote-server.input';
|
||||
import { UpdateRemoteServerInput } from 'src/engine/metadata-modules/remote-server/dtos/update-remote-server.input';
|
||||
@ -41,8 +41,8 @@ export class RemoteServerService<T extends RemoteServerType> {
|
||||
private readonly foreignDataWrapperServerQueryFactory: ForeignDataWrapperServerQueryFactory,
|
||||
private readonly remoteTableService: RemoteTableService,
|
||||
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
public async createOneRemoteServer(
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { RemoteServerType } from 'src/engine/metadata-modules/remote-server/remote-server.entity';
|
||||
import {
|
||||
RemoteServerException,
|
||||
@ -10,7 +10,7 @@ import {
|
||||
|
||||
export const validateRemoteServerType = async (
|
||||
remoteServerType: RemoteServerType,
|
||||
featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
featureFlagRepository: Repository<FeatureFlag>,
|
||||
workspaceId: string,
|
||||
) => {
|
||||
const featureFlagKey = getFeatureFlagKey(remoteServerType);
|
||||
|
||||
@ -4,7 +4,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
|
||||
|
||||
import { AnalyticsModule } from 'src/engine/core-modules/analytics/analytics.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FileUploadModule } from 'src/engine/core-modules/file/file-upload/file-upload.module';
|
||||
import { FileModule } from 'src/engine/core-modules/file/file.module';
|
||||
import { ThrottlerModule } from 'src/engine/core-modules/throttler/throttler.module';
|
||||
@ -17,7 +17,7 @@ import { BuildServerlessFunctionJob } from 'src/engine/metadata-modules/serverle
|
||||
imports: [
|
||||
FileUploadModule,
|
||||
NestjsQueryTypeOrmModule.forFeature([ServerlessFunctionEntity], 'metadata'),
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
FileModule,
|
||||
ThrottlerModule,
|
||||
AnalyticsModule,
|
||||
|
||||
@ -6,7 +6,7 @@ import graphqlTypeJson from 'graphql-type-json';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
|
||||
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
|
||||
@ -30,8 +30,8 @@ import { serverlessFunctionGraphQLApiExceptionHandler } from 'src/engine/metadat
|
||||
export class ServerlessFunctionResolver {
|
||||
constructor(
|
||||
private readonly serverlessFunctionService: ServerlessFunctionService,
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
async checkFeatureFlag(workspaceId: string) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
@ -34,7 +34,7 @@ import { WorkspaceSyncMetadataService } from 'src/engine/workspace-manager/works
|
||||
],
|
||||
'metadata',
|
||||
),
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
WorkspaceMetadataVersionModule,
|
||||
],
|
||||
providers: [
|
||||
|
||||
@ -5,7 +5,7 @@ import { DataSource, QueryFailedError, Repository } from 'typeorm';
|
||||
|
||||
import { WorkspaceSyncContext } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/workspace-sync-context.interface';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
import { WorkspaceMetadataVersionService } from 'src/engine/metadata-modules/workspace-metadata-version/services/workspace-metadata-version.service';
|
||||
import { WorkspaceMigrationEntity } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.entity';
|
||||
@ -36,8 +36,8 @@ export class WorkspaceSyncMetadataService {
|
||||
private readonly workspaceSyncIndexMetadataService: WorkspaceSyncIndexMetadataService,
|
||||
private readonly workspaceSyncObjectMetadataIdentifiersService: WorkspaceSyncObjectMetadataIdentifiersService,
|
||||
private readonly workspaceMetadataVersionService: WorkspaceMetadataVersionService,
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
||||
@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { BillingModule } from 'src/engine/core-modules/billing/billing.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity';
|
||||
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
||||
@ -39,7 +39,7 @@ import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/sta
|
||||
WorkspaceMemberWorkspaceEntity,
|
||||
]),
|
||||
CalendarEventParticipantManagerModule,
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity, Workspace], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag, Workspace], 'core'),
|
||||
TypeOrmModule.forFeature([DataSourceEntity], 'metadata'),
|
||||
WorkspaceDataSourceModule,
|
||||
CalendarEventCleanerModule,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
||||
import { CalendarChannelSyncStatusService } from 'src/modules/calendar/common/services/calendar-channel-sync-status.service';
|
||||
import { ConnectedAccountModule } from 'src/modules/connected-account/connected-account.module';
|
||||
@ -9,7 +9,7 @@ import { ConnectedAccountModule } from 'src/modules/connected-account/connected-
|
||||
@Module({
|
||||
imports: [
|
||||
WorkspaceDataSourceModule,
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
ConnectedAccountModule,
|
||||
],
|
||||
providers: [CalendarChannelSyncStatusService],
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
||||
@ -17,7 +17,7 @@ import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/sta
|
||||
imports: [
|
||||
ObjectMetadataRepositoryModule.forFeature([WorkspaceMemberWorkspaceEntity]),
|
||||
WorkspaceDataSourceModule,
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
TypeOrmModule.forFeature(
|
||||
[ObjectMetadataEntity, FieldMetadataEntity],
|
||||
'metadata',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
||||
import { ConnectedAccountModule } from 'src/modules/connected-account/connected-account.module';
|
||||
import { MessageChannelSyncStatusService } from 'src/modules/messaging/common/services/message-channel-sync-status.service';
|
||||
@ -9,7 +9,7 @@ import { MessageChannelSyncStatusService } from 'src/modules/messaging/common/se
|
||||
@Module({
|
||||
imports: [
|
||||
WorkspaceDataSourceModule,
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
ConnectedAccountModule,
|
||||
],
|
||||
providers: [MessageChannelSyncStatusService],
|
||||
|
||||
@ -3,7 +3,7 @@ import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
||||
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
||||
@ -27,7 +27,7 @@ import { MessageParticipantManagerModule } from 'src/modules/messaging/message-p
|
||||
EnvironmentModule,
|
||||
ObjectMetadataRepositoryModule.forFeature([BlocklistWorkspaceEntity]),
|
||||
MessagingCommonModule,
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag], 'core'),
|
||||
OAuth2ClientManagerModule,
|
||||
EmailAliasManagerModule,
|
||||
FeatureFlagModule,
|
||||
|
||||
@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { AnalyticsModule } from 'src/engine/core-modules/analytics/analytics.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
||||
@ -21,7 +21,7 @@ import { TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-o
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([FeatureFlagEntity, Workspace], 'core'),
|
||||
TypeOrmModule.forFeature([FeatureFlag, Workspace], 'core'),
|
||||
AnalyticsModule,
|
||||
ContactCreationManagerModule,
|
||||
WorkspaceDataSourceModule,
|
||||
|
||||
@ -13,7 +13,7 @@ export const objectsMetadataFactory = ({
|
||||
input,
|
||||
}: ObjectsFactoryParams) => ({
|
||||
query: gql`
|
||||
query ObjectsMetadata($filter: objectFilter!, $paging: CursorPaging!) {
|
||||
query ObjectsMetadata($filter: ObjectFilter!, $paging: CursorPaging!) {
|
||||
objects(filter: $filter, paging: $paging) {
|
||||
edges {
|
||||
node {
|
||||
|
||||
@ -14,8 +14,8 @@ export const createOneRelationMetadataFactory = ({
|
||||
input,
|
||||
}: CreateOneRelationFactoryParams) => ({
|
||||
query: gql`
|
||||
mutation CreateOneRelationMetadata($input: CreateOneRelationInput!) {
|
||||
createOneRelation(input: $input) {
|
||||
mutation CreateOneRelationMetadata($input: CreateOneRelationMetadataInput!) {
|
||||
createOneRelationMetadata(input: $input) {
|
||||
${gqlFields}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user