From 8e5f6dca37b3fcb0c94773f45f7de688fe8d27bc Mon Sep 17 00:00:00 2001 From: Teddy Paul Date: Mon, 22 Apr 2024 14:27:12 +0200 Subject: [PATCH] feat: refacto actionList runActionlist now takes array of values as input and return array of values Co-authored-by: emile --- apps/core/package.json | 2 +- .../inheritanceCalculationAction.test.ts | 5 +- .../src/__tests__/e2e/api/trees/trees.test.ts | 4 +- .../__tests__/e2e/api/values/metadata.test.ts | 5 +- .../__tests__/e2e/api/values/values.test.ts | 44 +- .../__tests__/e2e/api/values/versions.test.ts | 6 +- apps/core/src/_types/actionsList.ts | 13 +- apps/core/src/_types/errors.ts | 2 + apps/core/src/app/auth/authApp.ts | 2 +- .../src/app/core/attributeApp/attributeApp.ts | 1 + apps/core/src/app/core/valueApp.ts | 12 +- .../actions/dateRangeToNumberAction.spec.ts | 42 +- .../domain/actions/dateRangeToNumberAction.ts | 16 +- .../src/domain/actions/encryptAction.spec.ts | 20 +- apps/core/src/domain/actions/encryptAction.ts | 32 +- .../actions/excelCalculationAction.spec.ts | 69 +- .../domain/actions/excelCalculationAction.ts | 61 +- .../domain/actions/formatDateAction.spec.ts | 8 +- .../src/domain/actions/formatDateAction.ts | 36 +- .../actions/formatDateRangeAction.spec.ts | 24 +- .../domain/actions/formatDateRangeAction.ts | 31 +- .../domain/actions/formatNumberAction.spec.ts | 31 +- .../src/domain/actions/formatNumberAction.ts | 37 +- .../inheritanceCalculationAction.spec.ts | 21 +- .../actions/inheritanceCalculationAction.ts | 31 +- .../domain/actions/maskValueAction.spec.ts | 19 +- .../src/domain/actions/maskValueAction.ts | 18 +- .../domain/actions/parseJSONAction.spec.ts | 6 +- .../src/domain/actions/parseJSONAction.ts | 15 +- .../domain/actions/toBooleanAction.spec.ts | 16 +- .../src/domain/actions/toBooleanAction.ts | 25 +- .../src/domain/actions/toJSONAction.spec.ts | 6 +- apps/core/src/domain/actions/toJSONAction.ts | 18 +- .../src/domain/actions/toNumberAction.spec.ts | 14 +- .../core/src/domain/actions/toNumberAction.ts | 15 +- .../src/domain/actions/toStringAction.spec.ts | 8 +- .../core/src/domain/actions/toStringAction.ts | 15 +- .../domain/actions/toUppercaseAction.spec.ts | 4 +- .../src/domain/actions/toUppercaseAction.ts | 15 +- .../actions/validateEmailAction.spec.ts | 7 +- .../src/domain/actions/validateEmailAction.ts | 26 +- .../actions/validateFormatAction.spec.ts | 46 +- .../domain/actions/validateFormatAction.ts | 55 +- .../actions/validateRegexAction.spec.ts | 17 +- .../src/domain/actions/validateRegexAction.ts | 36 +- .../domain/actions/validateURLAction.spec.ts | 7 +- .../src/domain/actions/validateURLAction.ts | 28 +- .../actionsList/actionsListDomain.spec.ts | 65 +- .../domain/actionsList/actionsListDomain.ts | 70 +- .../calculationVariable.spec.ts | 23 +- .../helpers/calculationVariable/index.ts | 19 +- .../src/domain/record/recordDomain.spec.ts | 71 +- apps/core/src/domain/record/recordDomain.ts | 56 +- apps/core/src/domain/value/_types.ts | 2 +- .../src/domain/value/helpers/prepareValue.ts | 71 +- .../core/src/domain/value/valueDomain.spec.ts | 82 +- apps/core/src/domain/value/valueDomain.ts | 325 +- apps/core/src/locales/en/translation.json | 8 +- apps/core/src/locales/fr/translation.json | 12 +- apps/core/tsconfig.kikoo.json | 14 + apps/data-studio/src/_gqlTypes/index.ts | 6571 +++-------------- docker/docker-compose.override.yml | 3 + libs/ui/src/__mocks__/common/attribute.ts | 1 + libs/ui/src/_gqlTypes/index.ts | 31 +- .../_queries/values/valueDetailsFragment.ts | 3 +- .../EditRecordContent/antdUtils.tsx | 6 +- .../hooks/useExecuteDeleteValueMutation.ts | 2 +- package.json | 1 + yarn.lock | 11 + 69 files changed, 2256 insertions(+), 6162 deletions(-) create mode 100644 apps/core/tsconfig.kikoo.json create mode 100644 docker/docker-compose.override.yml diff --git a/apps/core/package.json b/apps/core/package.json index 6901f9783..53d8c805d 100644 --- a/apps/core/package.json +++ b/apps/core/package.json @@ -29,7 +29,7 @@ "benchmark": "ts-node src/ benchmark", "build": "scripts/build.js", "tscheck": "tsc --noEmit -p .", - "tscheck:watch": "tsc -w --noEmit -p ." + "tscheck:watch": "tsc -w --noEmit -p tsconfig.json" }, "main": "dist/index.js", "author": "", diff --git a/apps/core/src/__tests__/e2e/api/actionLists/actions/inheritanceCalculationAction.test.ts b/apps/core/src/__tests__/e2e/api/actionLists/actions/inheritanceCalculationAction.test.ts index aedc07494..aaa63a6c1 100644 --- a/apps/core/src/__tests__/e2e/api/actionLists/actions/inheritanceCalculationAction.test.ts +++ b/apps/core/src/__tests__/e2e/api/actionLists/actions/inheritanceCalculationAction.test.ts @@ -190,6 +190,7 @@ describe('inheritanceCalculationAction', () => { ${simpleAttributeId}: property(attribute: "${simpleAttributeId}") { ...on Value { value + isInherited } } } @@ -198,7 +199,9 @@ describe('inheritanceCalculationAction', () => { expect(res.data.errors).toBeUndefined(); expect(res.status).toBe(200); - expect(res.data.data.records.list[0][simpleAttributeId][0].value).toBe('text value'); + + const inheritedValue = res.data.data.records.list[0][simpleAttributeId].find(v => v.isInherited); + expect(inheritedValue.value).toBe('text value'); }); test('Inherit values on advanced attribute', async () => { diff --git a/apps/core/src/__tests__/e2e/api/trees/trees.test.ts b/apps/core/src/__tests__/e2e/api/trees/trees.test.ts index 60f31f661..b5df6600e 100644 --- a/apps/core/src/__tests__/e2e/api/trees/trees.test.ts +++ b/apps/core/src/__tests__/e2e/api/trees/trees.test.ts @@ -312,8 +312,8 @@ describe('Trees', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeTruthy(); - expect(res.data.data.saveValue.value.record.id).toBe(recordId1); + expect(res.data.data.saveValue[0].id_value).toBeTruthy(); + expect(res.data.data.saveValue[0].value.record.id).toBe(recordId1); // Get values of this attribute const resGetValues = await makeGraphQlCall(`{ diff --git a/apps/core/src/__tests__/e2e/api/values/metadata.test.ts b/apps/core/src/__tests__/e2e/api/values/metadata.test.ts index f99fa5435..da2b0c447 100644 --- a/apps/core/src/__tests__/e2e/api/values/metadata.test.ts +++ b/apps/core/src/__tests__/e2e/api/values/metadata.test.ts @@ -6,7 +6,6 @@ import {gqlCreateRecord, gqlSaveAttribute, gqlSaveLibrary, makeGraphQlCall} from describe('Values Metadata', () => { const metadataLibId = 'metadata_test_lib'; - const metadataLibGqlId = 'metadataTestLib'; const metaAttrId = 'metadata_simple_attribute'; const attrWithMetaId = 'metadata_attribute'; let recordId; @@ -54,8 +53,8 @@ describe('Values Metadata', () => { expect(resSaveValue.status).toBe(200); expect(resSaveValue.data.errors).toBeUndefined(); - expect(resSaveValue.data.data.saveValue.id_value).toBeDefined(); - expect(resSaveValue.data.data.saveValue.metadata.find(({name}) => name === metaAttrId)).toBeDefined(); + expect(resSaveValue.data.data.saveValue[0].id_value).toBeDefined(); + expect(resSaveValue.data.data.saveValue[0].metadata.find(({name}) => name === metaAttrId)).toBeDefined(); // Read value const queryGetVal = `{ diff --git a/apps/core/src/__tests__/e2e/api/values/values.test.ts b/apps/core/src/__tests__/e2e/api/values/values.test.ts index ec21b4494..0ce339630 100644 --- a/apps/core/src/__tests__/e2e/api/values/values.test.ts +++ b/apps/core/src/__tests__/e2e/api/values/values.test.ts @@ -237,8 +237,8 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeTruthy(); - expect(res.data.data.saveValue.value.record.id).toBe(treeElemId); + expect(res.data.data.saveValue[0].id_value).toBeTruthy(); + expect(res.data.data.saveValue[0].value.record.id).toBe(treeElemId); }); test('Save value simple', async () => { @@ -265,9 +265,9 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeNull(); - expect(res.data.data.saveValue.attribute?.permissions.edit_value).toBeDefined(); - expect(res.data.data.saveValue.value).toBe('TEST VAL'); + expect(res.data.data.saveValue[0].id_value).toBeNull(); + expect(res.data.data.saveValue[0].attribute?.permissions.edit_value).toBeDefined(); + expect(res.data.data.saveValue[0].value).toBe('TEST VAL'); }); test('Save same value on unique attribute', async () => { @@ -335,8 +335,8 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeNull(); - expect(res.data.data.saveValue.value).toBeTruthy(); + expect(res.data.data.saveValue[0].id_value).toBeNull(); + expect(res.data.data.saveValue[0].value).toBeTruthy(); }); test("Don't save invalid simple extended", async () => { @@ -385,8 +385,8 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeNull(); - expect(res.data.data.saveValue.value.id).toBe(recordIdLinked); + expect(res.data.data.saveValue[0].id_value).toBeNull(); + expect(res.data.data.saveValue[0].value.id).toBe(recordIdLinked); }); test('Save value advanced', async () => { @@ -407,10 +407,10 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeTruthy(); - expect(res.data.data.saveValue.value).toBe('TEST VAL ADV'); + expect(res.data.data.saveValue[0].id_value).toBeTruthy(); + expect(res.data.data.saveValue[0].value).toBe('TEST VAL ADV'); - advValueId = res.data.data.saveValue.id_value; + advValueId = res.data.data.saveValue[0].id_value; }); test('Save value advanced link', async () => { @@ -433,8 +433,8 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeTruthy(); - expect(res.data.data.saveValue.value.id).toBe(recordIdLinked); + expect(res.data.data.saveValue[0].id_value).toBeTruthy(); + expect(res.data.data.saveValue[0].value.id).toBe(recordIdLinked); }); test('Save value advanced reverse link', async () => { @@ -457,8 +457,8 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeTruthy(); - expect(res.data.data.saveValue.value.id).toBe(recordIdLinked); + expect(res.data.data.saveValue[0].id_value).toBeTruthy(); + expect(res.data.data.saveValue[0].value.id).toBe(recordIdLinked); }); test('Save value advanced reverse link into simple link', async () => { @@ -481,8 +481,8 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.id_value).toBeFalsy(); - expect(res.data.data.saveValue.value.id).toBe(recordIdLinked); + expect(res.data.data.saveValue[0].id_value).toBeFalsy(); + expect(res.data.data.saveValue[0].value.id).toBe(recordIdLinked); }); test('Delete value advanced', async () => { @@ -497,7 +497,7 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.deleteValue.id_value).toBeTruthy(); + expect(res.data.data.deleteValue[0].id_value).toBeTruthy(); }); test('Delete value simple', async () => { @@ -524,7 +524,7 @@ describe('Values', () => { } }`); - const idValue = saveValueRes.data.data.saveValue.id_value; + const idValue = saveValueRes.data.data.saveValue[0].id_value; const res = await makeGraphQlCall(`mutation { deleteValue( @@ -537,7 +537,7 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.deleteValue.id_value).toBeTruthy(); + expect(res.data.data.deleteValue[0].id_value).toBeTruthy(); }); test('Save value batch', async () => { @@ -596,7 +596,7 @@ describe('Values', () => { expect(res.status).toBe(200); expect(res.data.errors).toBeUndefined(); - expect(res.data.data.saveValue.value).toEqual({ + expect(res.data.data.saveValue[0].value).toEqual({ from: '1970-01-01T00:16:40+00:00', to: '1970-01-01T00:33:20+00:00' }); diff --git a/apps/core/src/__tests__/e2e/api/values/versions.test.ts b/apps/core/src/__tests__/e2e/api/values/versions.test.ts index f87560175..adbe7b91f 100644 --- a/apps/core/src/__tests__/e2e/api/values/versions.test.ts +++ b/apps/core/src/__tests__/e2e/api/values/versions.test.ts @@ -131,9 +131,9 @@ describe('Versions', () => { expect(resSaveValue.status).toBe(200); expect(resSaveValue.data.errors).toBeUndefined(); - expect(resSaveValue.data.data.v1.version).toBeDefined(); - expect(resSaveValue.data.data.v1.version[0].treeId).toBe(treeName); - expect(resSaveValue.data.data.v1.version[0].treeNode.id).toBe(nodeElement1); + expect(resSaveValue.data.data.v1[0].version).toBeDefined(); + expect(resSaveValue.data.data.v1[0].version[0].treeId).toBe(treeName); + expect(resSaveValue.data.data.v1[0].version[0].treeNode.id).toBe(nodeElement1); const resGetValues1 = await makeGraphQlCall(`{ r1: records( diff --git a/apps/core/src/_types/actionsList.ts b/apps/core/src/_types/actionsList.ts index a3f9fa877..e2dfac5ae 100644 --- a/apps/core/src/_types/actionsList.ts +++ b/apps/core/src/_types/actionsList.ts @@ -5,6 +5,7 @@ import {IQueryInfos} from '_types/queryInfos'; import {IAttribute} from './attribute'; import {ISystemTranslation} from './systemTranslation'; import {IValue} from './value'; +import {Errors} from './errors'; export enum ActionsListEvents { SAVE_VALUE = 'saveValue', @@ -46,6 +47,11 @@ export interface IActionsListParamsConfig { default_value: string; } +export interface IActionsListFunctionResult { + values: IValue[]; + errors: Array<{errorType: Errors; attributeValue: IValue; message?: string}>; +} + export interface IActionsListFunction { id: string; name: string; @@ -54,7 +60,11 @@ export interface IActionsListFunction { output_types: ActionsListIOTypes[]; params?: IActionsListParamsConfig[]; error_message?: ISystemTranslation; - action: (value: ActionsListValueType, params: IActionsListParams, ctx: IActionsListContext) => ActionsListValueType; + action: ( + values: IValue[], + params: IActionsListParams, + ctx: IActionsListContext + ) => IActionsListFunctionResult | Promise; } export interface IActionsListSavedAction { @@ -69,5 +79,4 @@ export interface IRunActionsListCtx extends IQueryInfos { attribute?: IAttribute; recordId?: string; library?: string; - value?: IValue; } diff --git a/apps/core/src/_types/errors.ts b/apps/core/src/_types/errors.ts index f36df963a..9292b402f 100644 --- a/apps/core/src/_types/errors.ts +++ b/apps/core/src/_types/errors.ts @@ -17,6 +17,7 @@ export enum Errors { ELEMENT_ALREADY_PRESENT_IN_ANCESTORS = 'ELEMENT_ALREADY_PRESENT_IN_ANCESTORS', ELEMENT_NOT_IN_TREE = 'ELEMENT_NOT_IN_TREE', ELEMENT_WITH_SAME_PATH_ALREADY_PRESENT = 'ELEMENT_WITH_SAME_PATH_ALREADY_PRESENT', + ENCRYPT_ERROR = 'ENCRYPT_ERROR', ERROR = 'ERROR', EXCEL_CALCULATION_ERROR = 'EXCEL_CALCULATION_ERROR', FILE_ERROR = 'FILE_ERROR', @@ -41,6 +42,7 @@ export enum Errors { INVALID_ID_FORMAT = 'INVALID_ID_FORMAT', INVALID_MAPPING = 'INVALID_MAPPING', INVALID_PERMISSIONS_CONF_LIBRARIES = 'INVALID_PERMISSIONS_CONF_LIBRARIES', + INVALID_REGEXP = 'INVALID_REGEXP', INVALID_SORT_FIELDS = 'INVALID_SORT_FIELDS', INVALID_TREE_FILTER_FORMAT = 'INVALID_TREE_FILTER_FORMAT', INVALID_URL = 'INVALID_URL', diff --git a/apps/core/src/app/auth/authApp.ts b/apps/core/src/app/auth/authApp.ts index 03bf051fc..0e6aafe0d 100644 --- a/apps/core/src/app/auth/authApp.ts +++ b/apps/core/src/app/auth/authApp.ts @@ -50,7 +50,7 @@ interface IDeps { config?: IConfig; } -export default function ({ +export default function({ 'core.domain.value': valueDomain = null, 'core.domain.record': recordDomain = null, 'core.domain.apiKey': apiKeyDomain = null, diff --git a/apps/core/src/app/core/attributeApp/attributeApp.ts b/apps/core/src/app/core/attributeApp/attributeApp.ts index 8102d6309..2bd85cd0a 100644 --- a/apps/core/src/app/core/attributeApp/attributeApp.ts +++ b/apps/core/src/app/core/attributeApp/attributeApp.ts @@ -121,6 +121,7 @@ export default function (deps: IDeps = {}): ICoreAttributeApp { type: AttributeType!, format: AttributeFormat, system: Boolean!, + required: Boolean!, readonly: Boolean!, label(lang: [AvailableLanguage!]): SystemTranslation, description(lang: [AvailableLanguage!]): SystemTranslationOptional, diff --git a/apps/core/src/app/core/valueApp.ts b/apps/core/src/app/core/valueApp.ts index 33bdcec96..da8f1ffb2 100644 --- a/apps/core/src/app/core/valueApp.ts +++ b/apps/core/src/app/core/valueApp.ts @@ -193,7 +193,7 @@ export default function ({ extend type Mutation { # Save one value - saveValue(library: ID, recordId: ID, attribute: ID, value: ValueInput): GenericValue! + saveValue(library: ID, recordId: ID, attribute: ID, value: ValueInput): [GenericValue!]! # Save values for several attributes at once. # If deleteEmpty is true, empty values will be deleted @@ -205,18 +205,18 @@ export default function ({ deleteEmpty: Boolean ): saveValueBatchResult! - deleteValue(library: ID!, recordId: ID!, attribute: ID!, value: ValueInput): GenericValue! + deleteValue(library: ID!, recordId: ID!, attribute: ID!, value: ValueInput): [GenericValue!]! } `, resolvers: { Mutation: { - async saveValue(_, {library, recordId, attribute, value}, ctx): Promise { + async saveValue(_: never, {library, recordId, attribute, value}, ctx): Promise { const valToSave = { ...value, version: convertVersionFromGqlFormat(value.version), metadata: utils.nameValArrayToObj(value.metadata) }; - const savedVal = await valueDomain.saveValue({ + const savedValues = await valueDomain.saveValue({ library, recordId, attribute, @@ -224,7 +224,7 @@ export default function ({ ctx }); - return {...savedVal}; + return savedValues; }, async saveValueBatch(parent, {library, recordId, version, values, deleteEmpty}, ctx) { // Convert version @@ -256,7 +256,7 @@ export default function ({ return res; }, - async deleteValue(parent, {library, recordId, attribute, value}, ctx): Promise { + async deleteValue(_: never, {library, recordId, attribute, value}, ctx): Promise { return valueDomain.deleteValue({ library, recordId, diff --git a/apps/core/src/domain/actions/dateRangeToNumberAction.spec.ts b/apps/core/src/domain/actions/dateRangeToNumberAction.spec.ts index 887a8fa1c..2739f34a6 100644 --- a/apps/core/src/domain/actions/dateRangeToNumberAction.spec.ts +++ b/apps/core/src/domain/actions/dateRangeToNumberAction.spec.ts @@ -1,6 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt +import {mockStandardValue} from '../../__tests__/mocks/value'; import {AttributeFormats, AttributeTypes, IAttribute} from '../../_types/attribute'; import dateRangeToNumberAction from './dateRangeToNumberAction'; @@ -9,10 +10,41 @@ describe('dateRangeToNumberAction', () => { const attrText: IAttribute = {id: 'test_attr', format: AttributeFormats.DATE_RANGE, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; test('dateRangeToNumberAction', async () => { - expect(action({from: 12345, to: 12346}, {}, ctx)).toEqual({from: 12345, to: 12346}); - expect(action({from: '12345', to: '12346'}, {}, ctx)).toEqual({from: 12345, to: 12346}); - expect(action({to: '12346'}, {}, ctx)).toEqual({from: 0, to: 12346}); - expect(action({from: '12345'}, {}, ctx)).toEqual({from: 12345, to: 0}); - expect(action('bad value', {}, ctx)).toEqual({from: 0, to: 0}); + expect(action([{...mockStandardValue, value: {from: 12345, to: 12346}}], {}, ctx)).toEqual({ + errors: [], + values: [{...mockStandardValue, value: {from: 12345, to: 12346}}] + }); + expect( + action( + [ + {...mockStandardValue, value: {from: 12345, to: 12346}}, + {...mockStandardValue, value: {from: 654321, to: 654320}} + ], + {}, + ctx + ) + ).toEqual({ + errors: [], + values: [ + {...mockStandardValue, value: {from: 12345, to: 12346}}, + {...mockStandardValue, value: {from: 654321, to: 654320}} + ] + }); + expect(action([{...mockStandardValue, value: {from: '12345', to: '12346'}}], {}, ctx)).toEqual({ + errors: [], + values: [{...mockStandardValue, value: {from: 12345, to: 12346}}] + }); + expect(action([{...mockStandardValue, value: {to: '12346'}}], {}, ctx)).toEqual({ + errors: [], + values: [{...mockStandardValue, value: {from: 0, to: 12346}}] + }); + expect(action([{...mockStandardValue, value: {from: '12345'}}], {}, ctx)).toEqual({ + errors: [], + values: [{...mockStandardValue, value: {from: 12345, to: 0}}] + }); + expect(action([{...mockStandardValue, value: 'bad value'}], {}, ctx)).toEqual({ + errors: [], + values: [{...mockStandardValue, value: {from: 0, to: 0}}] + }); }); }); diff --git a/apps/core/src/domain/actions/dateRangeToNumberAction.ts b/apps/core/src/domain/actions/dateRangeToNumberAction.ts index 12ca58b6a..787a9c8af 100644 --- a/apps/core/src/domain/actions/dateRangeToNumberAction.ts +++ b/apps/core/src/domain/actions/dateRangeToNumberAction.ts @@ -2,7 +2,7 @@ // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import {IDateRangeValue} from '_types/value'; -import {ActionsListIOTypes, ActionsListValueType, IActionsListFunction} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -11,9 +11,15 @@ export default function (): IActionsListFunction { description: 'Convert date range dates to numbers', input_types: [ActionsListIOTypes.OBJECT], output_types: [ActionsListIOTypes.OBJECT], - action: (value: ActionsListValueType): IDateRangeValue => { - const dateRangeValue = value as IDateRangeValue; - return {from: Number(dateRangeValue.from ?? ''), to: Number(dateRangeValue.to ?? '')}; - } + action: values => ({ + values: values.map(valueElement => { + const dateRangeValue = valueElement.value as IDateRangeValue; + return { + ...valueElement, + value: {from: Number(dateRangeValue.from ?? ''), to: Number(dateRangeValue.to ?? '')} + }; + }), + errors: [] + }) }; } diff --git a/apps/core/src/domain/actions/encryptAction.spec.ts b/apps/core/src/domain/actions/encryptAction.spec.ts index d1857b3c0..3086abf2f 100644 --- a/apps/core/src/domain/actions/encryptAction.spec.ts +++ b/apps/core/src/domain/actions/encryptAction.spec.ts @@ -1,6 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt +import {mockStandardValue} from '../../__tests__/mocks/value'; import {AttributeFormats, AttributeTypes, IAttribute} from '../../_types/attribute'; import encryptAction from './encryptAction'; @@ -8,10 +9,19 @@ describe('encryptAction', () => { const action = encryptAction().action; const attrText: IAttribute = {id: 'test_attr', format: AttributeFormats.NUMERIC, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; - test('encrypt', async () => { - const res = await action('MyPAssWd', {}, ctx); - expect(typeof res).toBe('string'); - expect(('' + res).length).toBe(60); - expect(await action(null, {}, ctx)).toBe(null); + + test('should encrypt a value', async () => { + const res = await action([{...mockStandardValue, value: 'MyPAssWd'}], {}, ctx); + + const valuePayload = res.values[0].value; + expect(typeof valuePayload).toBe('string'); + expect(('' + valuePayload).length).toBe(60); + }); + + test('should return null if no value', async () => { + expect(await action([{...mockStandardValue, value: null}], {}, ctx)).toEqual({ + errors: [], + values: [{...mockStandardValue, value: null}] + }); }); }); diff --git a/apps/core/src/domain/actions/encryptAction.ts b/apps/core/src/domain/actions/encryptAction.ts index 66823a691..d21251d88 100644 --- a/apps/core/src/domain/actions/encryptAction.ts +++ b/apps/core/src/domain/actions/encryptAction.ts @@ -2,12 +2,8 @@ // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import * as bcrypt from 'bcryptjs'; -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {Errors} from '../../_types/errors'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -16,15 +12,25 @@ export default function (): IActionsListFunction { description: 'Encrypt value', input_types: [ActionsListIOTypes.STRING], output_types: [ActionsListIOTypes.STRING], - action: async (value: ActionsListValueType, params: any, ctx: IActionsListContext): Promise => { - if (value === null) { - return null; - } + action: async values => { + return values.reduce(async (promAcc, valueElement) => { + const acc = await promAcc; + try { + if (valueElement.value === null) { + acc.values.push({...valueElement, value: null}); + return acc; + } - const salt = await bcrypt.genSalt(10); - const hash = await bcrypt.hash(value, salt); + const salt = await bcrypt.genSalt(10); + const hash = await bcrypt.hash(valueElement.value, salt); - return hash; + acc.values.push({...valueElement, value: hash}); + } catch (e) { + acc.errors.push({errorType: Errors, attributeValue: valueElement}); + } + + return acc; + }, Promise.resolve({values: [], errors: []})); } }; } diff --git a/apps/core/src/domain/actions/excelCalculationAction.spec.ts b/apps/core/src/domain/actions/excelCalculationAction.spec.ts index b3bd5a9a0..de032814a 100644 --- a/apps/core/src/domain/actions/excelCalculationAction.spec.ts +++ b/apps/core/src/domain/actions/excelCalculationAction.spec.ts @@ -5,6 +5,9 @@ import {ActionsListValueType, IActionsListContext} from '_types/actionsList'; import {ICalculationVariable, IVariableValue} from 'domain/helpers/calculationVariable'; import {IUtils} from 'utils/utils'; import excelCalculationAction from './excelCalculationAction'; +import {IValue} from '_types/value'; +import {Errors} from '../../_types/errors'; +import {mockStandardValue} from '../../__tests__/mocks/value'; const mockCalculationsVariable = { processVariableString: async ( @@ -27,65 +30,111 @@ describe('excelCalculationAction', () => { translateError: jest.fn().mockReturnValue('Excel calculation error') }; + const mockResultValueBase: IValue = { + id_value: null, + isCalculated: true, + modified_at: null, + modified_by: null, + created_at: null, + created_by: null, + value: null + }; + test('Simple excelCalculation', async () => { const action = excelCalculationAction().action; const ctx = {}; const res = await action( - null, + [], { Formula: '42' }, ctx ); - expect(res).toBe('42'); + + expect(res).toEqual({errors: [], values: [{...mockResultValueBase, value: '42'}]}); expect( await action( - null, + [], { Formula: '42+42' }, ctx ) - ).toBe('84'); + ).toEqual({errors: [], values: [{...mockResultValueBase, value: '84'}]}); }); + test('no formula', async () => { const action = excelCalculationAction().action; const ctx = {}; const res = await action( - null, + [], { Formula: '' }, ctx ); - expect(res).toBe(''); + expect(res).toEqual({errors: [], values: [{...mockResultValueBase, value: ''}]}); }); + test('Replace variables', async () => { const action = excelCalculationAction({ 'core.domain.helpers.calculationVariable': mockCalculationsVariable as ICalculationVariable }).action; const ctx = {}; const res = await action( - 38, + [], + { + Formula: '"resultat {toto} {tata} {titi}"' + }, + ctx + ); + + expect(res).toEqual({ + errors: [], + values: [{...mockResultValueBase, value: 'resultat totoValue tataValue titiValue'}] + }); + }); + + test('Return origin values along calculation result', async () => { + const action = excelCalculationAction({ + 'core.domain.helpers.calculationVariable': mockCalculationsVariable as ICalculationVariable + }).action; + const ctx = {}; + const res = await action( + [mockStandardValue], { Formula: '"resultat {toto} {tata} {titi}"' }, ctx ); - expect(res).toBe('resultat totoValue tataValue titiValue'); + + expect(res).toEqual({ + errors: [], + values: [mockStandardValue, {...mockResultValueBase, value: 'resultat totoValue tataValue titiValue'}] + }); }); + test('Error calculation', async () => { const action = excelCalculationAction({ 'core.utils': mockUtils as IUtils }).action; const ctx = {}; const res = await action( - null, + [], { Formula: 'UNKNOWN' }, ctx ); - expect(res).toContain('Excel calculation error'); + + expect(res).toEqual({ + errors: [ + { + errorType: Errors.EXCEL_CALCULATION_ERROR, + attributeValue: null + } + ], + values: [] + }); }); }); diff --git a/apps/core/src/domain/actions/excelCalculationAction.ts b/apps/core/src/domain/actions/excelCalculationAction.ts index 2693ea049..813f0f323 100644 --- a/apps/core/src/domain/actions/excelCalculationAction.ts +++ b/apps/core/src/domain/actions/excelCalculationAction.ts @@ -4,7 +4,13 @@ import {ICalculationVariable} from 'domain/helpers/calculationVariable'; import {Parser} from 'hot-formula-parser'; import {IUtils} from 'utils/utils'; -import {ActionsListIOTypes, ActionsListValueType, IActionsListContext} from '../../_types/actionsList'; +import {IValue} from '_types/value'; +import { + ActionsListIOTypes, + ActionsListValueType, + IActionsListContext, + IActionsListFunction +} from '../../_types/actionsList'; import {Errors} from '../../_types/errors'; interface IDeps { @@ -18,16 +24,15 @@ export interface IActionListExcelContext extends IActionsListContext { value?: ActionsListExcelValueType; } -export default function ({ - 'core.domain.helpers.calculationVariable': calculationVariable = null, - 'core.utils': utils = null -}: IDeps = {}) { +export default function({ + 'core.domain.helpers.calculationVariable': calculationVariable = null +}: IDeps = {}): IActionsListFunction { const _processReplacement = async ( context: IActionsListContext, - initialValue: ActionsListValueType, + initialValues: ActionsListValueType[], variable: string ): Promise => { - const variableValues = await calculationVariable.processVariableString(context, variable, initialValue); + const variableValues = await calculationVariable.processVariableString(context, variable, initialValues); const stringValues = variableValues.map(v => { return v.value === null ? '' : typeof v.value === 'object' ? v.value.value : v.value; }); @@ -40,7 +45,7 @@ export default function ({ regex: RegExp, asyncFn, context: IActionsListContext, - value: ActionsListValueType + values: ActionsListValueType[] ): Promise => { if (!str) { return ''; @@ -48,7 +53,7 @@ export default function ({ const promises = []; str.replace(regex, (match, ...args) => { - const promise = asyncFn(context, value, ...args); + const promise = asyncFn(context, values, ...args); promises.push(promise); return ''; }); @@ -61,10 +66,10 @@ export default function ({ const _replaceVariables = async ( formula: string, context: IActionsListContext, - value: ActionsListValueType + values: ActionsListValueType[] ): Promise => { const regExp = /{([^{}]*)}/g; - const res = _replaceAsync(formula, regExp, _processReplacement, context, value); + const res = _replaceAsync(formula, regExp, _processReplacement, context, values); return res; }; @@ -90,22 +95,40 @@ export default function ({ default_value: '21*2' } ], - action: async (value: ActionsListValueType, params: any, ctx: IActionsListContext): Promise => { + action: async (values, params, ctx) => { const {Formula: formula} = params; - const finalFormula = await _replaceVariables(formula, ctx, value); + const finalFormula = await _replaceVariables( + formula, + ctx, + values.map(v => v.value) + ); const parser = new Parser(); const {error, result} = parser.parse(finalFormula); if (error) { - return utils.translateError( - {msg: Errors.EXCEL_CALCULATION_ERROR, vars: {error, formula: finalFormula}}, - ctx.lang - ); + return { + values, + errors: [ + { + errorType: Errors.EXCEL_CALCULATION_ERROR, + attributeValue: null + } + ] + }; } - const finalResult: string = `${result}`; - return finalResult; + const finalResult: IValue = { + id_value: null, + isCalculated: true, + modified_at: null, + modified_by: null, + created_at: null, + created_by: null, + value: String(result) + }; + + return {values: [...values, finalResult], errors: []}; } }; } diff --git a/apps/core/src/domain/actions/formatDateAction.spec.ts b/apps/core/src/domain/actions/formatDateAction.spec.ts index 72359967f..a80b89f0b 100644 --- a/apps/core/src/domain/actions/formatDateAction.spec.ts +++ b/apps/core/src/domain/actions/formatDateAction.spec.ts @@ -10,9 +10,9 @@ describe('formatDateAction', () => { const ctx = {attribute: attrText}; test('formatDate', async () => { - expect(action(2119477320, {format: 'D/M/YY HH:mm'}, ctx)).toBeTruthy(); - expect(action(2119477320, {}, ctx)).toBeTruthy(); - expect(action('aaaa', {}, ctx)).toBe(''); - expect(action(null, {}, ctx)).toBe(null); + expect((await action([{value: 2119477320}], {format: 'D/M/YY HH:mm'}, ctx)).values[0].value).toBeTruthy(); + expect((await action([{value: 2119477320}], {}, ctx)).values[0].value).toBeTruthy(); + expect((await action([{value: 'aaaa'}], {}, ctx)).values[0].value).toBe(''); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/formatDateAction.ts b/apps/core/src/domain/actions/formatDateAction.ts index b5d1a8ddc..4809afe43 100644 --- a/apps/core/src/domain/actions/formatDateAction.ts +++ b/apps/core/src/domain/actions/formatDateAction.ts @@ -2,12 +2,7 @@ // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import moment from 'moment'; -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -32,24 +27,27 @@ export default function (): IActionsListFunction { default_value: 'DD/MM/YYYY HH:mm:ss' } ], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): string => { - if (value === null) { - return null; - } - + action: (values, params, ctx) => { const format = params.format; const auto = params.auto === 'true'; - const numberVal = Number(value); - let newValue = ''; + const computedValues = values.map(elementValue => { + if (elementValue.value === null) { + return elementValue; + } + const numberVal = Number(elementValue.value); - if (!isNaN(numberVal)) { - newValue = auto - ? new Date(numberVal * 1000).toLocaleString(ctx.lang) - : moment.unix(numberVal).format(format); - } + let newValue = ''; - return newValue; + if (!isNaN(numberVal)) { + newValue = auto + ? new Date(numberVal * 1000).toLocaleString(ctx.lang) + : moment.unix(numberVal).format(format); + } + elementValue.value = newValue; + return elementValue; + }); + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/formatDateRangeAction.spec.ts b/apps/core/src/domain/actions/formatDateRangeAction.spec.ts index 61b736921..6bae0be8a 100644 --- a/apps/core/src/domain/actions/formatDateRangeAction.spec.ts +++ b/apps/core/src/domain/actions/formatDateRangeAction.spec.ts @@ -1,6 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt +import {IActionsListFunctionResult} from '_types/actionsList'; import {AttributeFormats, AttributeTypes, IAttribute} from '../../_types/attribute'; import formatDateRangeAction from './formatDateRangeAction'; @@ -10,23 +11,32 @@ describe('formatDateRangeAction', () => { const ctx = {attribute: attrText}; test('formatDateRange', async () => { - const formattedDate = action({from: '2119477320', to: '2119477380'}, {format: 'D/M/YY HH:mm'}, ctx) as { + const formattedDateResult = action( + [{value: {from: '2119477320', to: '2119477380'}}], + {format: 'D/M/YY HH:mm'}, + ctx + ) as IActionsListFunctionResult; + const formattedDate = formattedDateResult.values[0].value as { from: string; to: string; }; expect(formattedDate.from).toBeTruthy(); expect(formattedDate.to).toBeTruthy(); - const formattedDateNoFormat = action({from: '2119477320', to: '2119477380'}, {format: 'D/M/YY HH:mm'}, ctx) as { + const formattedDateNoFormatResult = action( + [{value: {from: '2119477320', to: '2119477380'}}], + {format: 'D/M/YY HH:mm'}, + ctx + ) as IActionsListFunctionResult; + const formattedDateNoFormat = formattedDateNoFormatResult.values[0].value as { from: string; to: string; }; expect(formattedDateNoFormat.from).toBeTruthy(); expect(formattedDateNoFormat.to).toBeTruthy(); - - expect(action('aaaa', {}, ctx)).toBe(null); - expect(action({from: '2119477320'}, {}, ctx)).toBe(null); - expect(action({to: '2119477320'}, {}, ctx)).toBe(null); - expect(action(null, {}, ctx)).toBe(null); + expect((await action([{value: 'aaaa'}], {}, ctx)).values[0].value).toBe(null); + expect((await action([{value: {from: '2119477320'}}], {}, ctx)).values[0].value).toBe(null); + expect((await action([{value: {to: '2119477320'}}], {}, ctx)).values[0].value).toBe(null); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/formatDateRangeAction.ts b/apps/core/src/domain/actions/formatDateRangeAction.ts index e267b7292..8ff32b6ea 100644 --- a/apps/core/src/domain/actions/formatDateRangeAction.ts +++ b/apps/core/src/domain/actions/formatDateRangeAction.ts @@ -3,7 +3,7 @@ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import moment from 'moment'; import {IDateRangeValue} from '_types/value'; -import {ActionsListIOTypes, ActionsListValueType, IActionsListFunction} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -21,21 +21,26 @@ export default function (): IActionsListFunction { default_value: 'DD/MM/YYYY HH:mm:ss' } ], - action: (value: ActionsListValueType, params: any): IDateRangeValue => { - const dateRangeValue = value as IDateRangeValue; - if (value === null || !dateRangeValue.from || !dateRangeValue.to) { - return null; - } - + action: (values, params) => { const format = params.format || ''; + const computedValues = values.map(elementValue => { + const dateRangeValue = elementValue.value as IDateRangeValue; + + if (elementValue.value === null || !dateRangeValue.from || !dateRangeValue.to) { + return {value: null}; + } + + const numberValFrom = dateRangeValue.from; + const numberValTo = dateRangeValue.to; - const numberValFrom = dateRangeValue.from; - const numberValTo = dateRangeValue.to; + elementValue.value = { + from: !isNaN(numberValFrom) ? moment.unix(numberValFrom).format(format) : '', + to: !isNaN(numberValTo) ? moment.unix(numberValTo).format(format) : '' + }; + return elementValue; + }); - return { - from: !isNaN(numberValFrom) ? moment.unix(numberValFrom).format(format) : '', - to: !isNaN(numberValTo) ? moment.unix(numberValTo).format(format) : '' - }; + return {values: computedValues, errors: [] as any[]}; } }; } diff --git a/apps/core/src/domain/actions/formatNumberAction.spec.ts b/apps/core/src/domain/actions/formatNumberAction.spec.ts index c9fa6033a..b5e14277d 100644 --- a/apps/core/src/domain/actions/formatNumberAction.spec.ts +++ b/apps/core/src/domain/actions/formatNumberAction.spec.ts @@ -10,19 +10,28 @@ describe('formatNumberAction', () => { const ctx = {attribute: attrText}; test('formatNumber', async () => { expect( - action( - 123456.781, - {thousandsSeparator: ' ', decimalsSeparator: ',', decimals: 2, prefix: '=> ', suffix: ' €'}, - ctx - ) + ( + await action( + [{value: 123456.781}], + {thousandsSeparator: ' ', decimalsSeparator: ',', decimals: 2, prefix: '=> ', suffix: ' €'}, + ctx + ) + ).values[0].value ).toBe('=> 123 456,78 €'); expect( - action(123456.786, {thousandsSeparator: ' ', decimalsSeparator: ',', decimals: 2, suffix: ' €'}, ctx) + ( + await action( + [{value: 123456.786}], + {thousandsSeparator: ' ', decimalsSeparator: ',', decimals: 2, suffix: ' €'}, + ctx + ) + ).values[0].value ).toBe('123 456,79 €'); - expect(action(123456.78, {thousandsSeparator: '.', decimalsSeparator: ',', decimals: 4}, ctx)).toBe( - '123.456,7800' - ); - expect(action('aaa', {}, ctx)).toBe(''); - expect(action(null, {}, ctx)).toBe(null); + expect( + (await action([{value: 123456.78}], {thousandsSeparator: '.', decimalsSeparator: ',', decimals: 4}, ctx)) + .values[0].value + ).toBe('123.456,7800'); + expect((await action([{value: 'aaa'}], {}, ctx)).values[0].value).toBe(''); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/formatNumberAction.ts b/apps/core/src/domain/actions/formatNumberAction.ts index b74eae802..69b241299 100644 --- a/apps/core/src/domain/actions/formatNumberAction.ts +++ b/apps/core/src/domain/actions/formatNumberAction.ts @@ -2,12 +2,7 @@ // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import {flow, partialRight} from 'lodash'; -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { const _toString = (num, d) => @@ -67,11 +62,7 @@ export default function (): IActionsListFunction { default_value: '' } ], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): string => { - if (value === null) { - return null; - } - + action: (values, params) => { const defaultParams = { decimals: 2, thousandsSeparator: ',', @@ -85,14 +76,22 @@ export default function (): IActionsListFunction { ...params }; - return isNaN(Number(value)) - ? '' - : flow( - partialRight(_toString, userParams.decimals), - partialRight(_formatSeparators, userParams.thousandsSeparator, userParams.decimalsSeparator), - partialRight(_addPrefix, userParams.prefix), - partialRight(_addSuffix, userParams.suffix) - )(Number(value)); + const computedValues = values.map(elementValue => { + if (elementValue.value === null) { + return elementValue; + } + elementValue.value = isNaN(Number(elementValue.value)) + ? '' + : flow( + partialRight(_toString, userParams.decimals), + partialRight(_formatSeparators, userParams.thousandsSeparator, userParams.decimalsSeparator), + partialRight(_addPrefix, userParams.prefix), + partialRight(_addSuffix, userParams.suffix) + )(Number(elementValue.value)); + return elementValue; + }); + + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/inheritanceCalculationAction.spec.ts b/apps/core/src/domain/actions/inheritanceCalculationAction.spec.ts index 7f325feb7..ae8bda393 100644 --- a/apps/core/src/domain/actions/inheritanceCalculationAction.spec.ts +++ b/apps/core/src/domain/actions/inheritanceCalculationAction.spec.ts @@ -9,11 +9,7 @@ import {AttributeTypes} from '../../_types/attribute'; import inheritanceCalculationAction from './inheritanceCalculationAction'; const mockCalculationsVariable = { - processVariableString: async ( - ctx: IActionsListContext, - variable: string, - initialValue: ActionsListValueType - ): Promise => { + processVariableString: async (ctx: IActionsListContext, variable: string): Promise => { return [ { value: `${variable}Value`, @@ -48,7 +44,7 @@ describe('heritageCalculationAction', () => { }, ctx ); - expect(res).toBe('42Value'); + expect(res.values[0].value).toBe('42Value'); }); test('No formula', async () => { @@ -65,7 +61,8 @@ describe('heritageCalculationAction', () => { }, ctx ); - expect(res).toBe('Value'); + + expect(res.values[0].value).toBe('Value'); }); test('Inherit from link', async () => { @@ -91,9 +88,11 @@ describe('heritageCalculationAction', () => { ctx )) as IRecord; - expect(res).toHaveProperty('id'); - expect(res).toHaveProperty('library'); - expect(res.id).toBe('Value'); - expect(res.library).toBe('meh'); + const resultValue = res.values[0].value; + + expect(resultValue).toHaveProperty('id'); + expect(resultValue).toHaveProperty('library'); + expect(resultValue.id).toBe('Value'); + expect(resultValue.library).toBe('meh'); }); }); diff --git a/apps/core/src/domain/actions/inheritanceCalculationAction.ts b/apps/core/src/domain/actions/inheritanceCalculationAction.ts index 8980870dc..898795c5c 100644 --- a/apps/core/src/domain/actions/inheritanceCalculationAction.ts +++ b/apps/core/src/domain/actions/inheritanceCalculationAction.ts @@ -3,10 +3,9 @@ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import {IAttributeDomain} from 'domain/attribute/attributeDomain'; import {ICalculationVariable} from 'domain/helpers/calculationVariable'; -import {IRecord} from '_types/record'; -import {IValue} from '_types/value'; -import {ActionsListIOTypes, ActionsListValueType, IActionsListContext} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListContext} from '../../_types/actionsList'; import {AttributeTypes} from '../../_types/attribute'; +import {IValue} from '_types/value'; interface IDeps { 'core.domain.helpers.calculationVariable'?: ICalculationVariable; @@ -19,7 +18,7 @@ export interface IActionListInheritanceContext extends IActionsListContext { value?: ActionsListInheritanceValueType; } -export default function({ +export default function ({ 'core.domain.helpers.calculationVariable': calculationVariable = null, 'core.domain.attribute': attributeDomain = null }: IDeps = {}) { @@ -55,29 +54,27 @@ export default function({ default_value: '' } ], - action: async ( - value: ActionsListValueType, - params: any, - ctx: IActionsListContext - ): Promise => { + action: async (values: IValue[], params, ctx) => { const {Formula: formula} = params; const attrProps = await attributeDomain.getAttributeProperties({id: ctx.attribute.id, ctx}); + let inheritedValues = []; - const result = await calculationVariable.processVariableString(ctx, formula, value); + const result = await calculationVariable.processVariableString(ctx, formula, []); if (!result.length) { - return null; + return {values, errors: []}; } if (attrProps.type === AttributeTypes.SIMPLE_LINK || attrProps.type === AttributeTypes.ADVANCED_LINK) { - return result.map(v => ({ - id: String(v.value), - library: v.library - }))[0]; + inheritedValues = result.map(resultValue => ({ + value: {id: String(resultValue.value), library: resultValue.library}, + isInherited: true + })); + } else { + inheritedValues = result.map(v => ({value: v.value, isInherited: true, raw_value: v.value})); } - const finalResult = result.map(v => v.value)[0]; - return finalResult; + return {values: [...(values ?? []), ...inheritedValues], errors: []}; } }; } diff --git a/apps/core/src/domain/actions/maskValueAction.spec.ts b/apps/core/src/domain/actions/maskValueAction.spec.ts index 0466ece06..897cd26f6 100644 --- a/apps/core/src/domain/actions/maskValueAction.spec.ts +++ b/apps/core/src/domain/actions/maskValueAction.spec.ts @@ -1,17 +1,24 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt +import {IActionsListFunctionResult} from '_types/actionsList'; import maskValueAction from './maskValueAction'; describe('maskValue', () => { const action = maskValueAction().action; test('maskValue', async () => { - expect(action('coucou', null, null)).toBe('●●●●●●●'); - expect(action(13456, null, null)).toBe('●●●●●●●'); - expect(action({toto: 'tata'}, null, null)).toBe('●●●●●●●'); + expect(((await action([{value: 'coucou'}], null, null)) as IActionsListFunctionResult).values[0].value).toBe( + '●●●●●●●' + ); + expect(((await action([{value: 13456}], null, null)) as IActionsListFunctionResult).values[0].value).toBe( + '●●●●●●●' + ); + expect( + ((await action([{value: {toto: 'tata'}}], null, null)) as IActionsListFunctionResult).values[0].value + ).toBe('●●●●●●●'); - expect(action('', null, null)).toBe(''); - expect(action(null, null, null)).toBe(''); - expect(action({}, null, null)).toBe(''); + expect(((await action([{value: ''}], null, null)) as IActionsListFunctionResult).values[0].value).toBe(''); + expect(((await action([{value: null}], null, null)) as IActionsListFunctionResult).values[0].value).toBe(''); + expect(((await action([{value: {}}], null, null)) as IActionsListFunctionResult).values[0].value).toBe(''); }); }); diff --git a/apps/core/src/domain/actions/maskValueAction.ts b/apps/core/src/domain/actions/maskValueAction.ts index 47bef886a..0fa86fc54 100644 --- a/apps/core/src/domain/actions/maskValueAction.ts +++ b/apps/core/src/domain/actions/maskValueAction.ts @@ -1,19 +1,25 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import {ActionsListIOTypes, ActionsListValueType, IActionsListFunction} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; -export default function (): IActionsListFunction { +export default function(): IActionsListFunction { return { id: 'maskValue', name: 'Mask Value', description: 'Mask any value by replacing with dots or empty string if no value', input_types: [ActionsListIOTypes.STRING, ActionsListIOTypes.NUMBER, ActionsListIOTypes.OBJECT], output_types: [ActionsListIOTypes.STRING], - action: (value: ActionsListValueType): string => { - return value !== null && value !== '' && (typeof value !== 'object' || Object.keys(value).length) - ? '●●●●●●●' - : ''; + action: values => { + const _isValueDefined = value => + value !== null && value !== '' && (typeof value !== 'object' || Object.keys(value).length); + + const computedValues = values.map(elementValue => ({ + ...elementValue, + value: _isValueDefined(elementValue.value) ? '●●●●●●●' : '' + })); + + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/parseJSONAction.spec.ts b/apps/core/src/domain/actions/parseJSONAction.spec.ts index 11e52073d..1248e249c 100644 --- a/apps/core/src/domain/actions/parseJSONAction.spec.ts +++ b/apps/core/src/domain/actions/parseJSONAction.spec.ts @@ -9,7 +9,9 @@ describe('parseJSONAction', () => { const attrText: IAttribute = {id: 'test_attr', format: AttributeFormats.NUMERIC, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; test('parseJSON', async () => { - expect(action('{"test":"aaa","toto":{"tata":true}}', {}, ctx)).toMatchObject({test: 'aaa', toto: {tata: true}}); - expect(action(null, {}, ctx)).toBe(null); + expect( + (await action([{value: '{"test":"aaa","toto":{"tata":true}}'}], {}, ctx)).values[0].value + ).toMatchObject({test: 'aaa', toto: {tata: true}}); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/parseJSONAction.ts b/apps/core/src/domain/actions/parseJSONAction.ts index 347d90c38..bb25de4c7 100644 --- a/apps/core/src/domain/actions/parseJSONAction.ts +++ b/apps/core/src/domain/actions/parseJSONAction.ts @@ -1,12 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -15,8 +10,12 @@ export default function (): IActionsListFunction { description: 'Parse a JSON string', input_types: [ActionsListIOTypes.STRING], output_types: [ActionsListIOTypes.OBJECT], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): string => { - return JSON.parse('' + value); + action: values => { + const computedValues = values.map(elementValue => { + elementValue.value = JSON.parse('' + elementValue.value); + return elementValue; + }); + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/toBooleanAction.spec.ts b/apps/core/src/domain/actions/toBooleanAction.spec.ts index bd87ce896..80f1de5fc 100644 --- a/apps/core/src/domain/actions/toBooleanAction.spec.ts +++ b/apps/core/src/domain/actions/toBooleanAction.spec.ts @@ -9,13 +9,13 @@ describe('toBooleanAction', () => { const attrText: IAttribute = {id: 'test_attr', format: AttributeFormats.NUMERIC, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; test('toBoolean', async () => { - expect(action(true, {}, ctx)).toBe(true); - expect(action(false, {}, ctx)).toBe(false); - expect(action(1, {}, ctx)).toBe(true); - expect(action(0, {}, ctx)).toBe(false); - expect(action('true', {}, ctx)).toBe(true); - expect(action('false', {}, ctx)).toBe(false); - expect(action('totot', {}, ctx)).toBe(true); - expect(action(null, {}, ctx)).toBe(false); + expect((await action([{value: true}], {}, ctx)).values[0].value).toBe(true); + expect((await action([{value: false}], {}, ctx)).values[0].value).toBe(false); + expect((await action([{value: 1}], {}, ctx)).values[0].value).toBe(true); + expect((await action([{value: 0}], {}, ctx)).values[0].value).toBe(false); + expect((await action([{value: 'true'}], {}, ctx)).values[0].value).toBe(true); + expect((await action([{value: 'false'}], {}, ctx)).values[0].value).toBe(false); + expect((await action([{value: 'totot'}], {}, ctx)).values[0].value).toBe(true); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(false); }); }); diff --git a/apps/core/src/domain/actions/toBooleanAction.ts b/apps/core/src/domain/actions/toBooleanAction.ts index 83f60ae35..b1c9ddf42 100644 --- a/apps/core/src/domain/actions/toBooleanAction.ts +++ b/apps/core/src/domain/actions/toBooleanAction.ts @@ -1,12 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -15,8 +10,22 @@ export default function (): IActionsListFunction { description: 'Convert value to boolean', input_types: [ActionsListIOTypes.STRING, ActionsListIOTypes.NUMBER, ActionsListIOTypes.BOOLEAN], output_types: [ActionsListIOTypes.BOOLEAN], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): boolean => { - return value === 'true' ? true : value === 'false' ? false : !!value; + action: values => { + const computedValues = values.map(elementValue => { + switch (elementValue.value) { + case 'true': + elementValue.value = true; + break; + case 'false': + elementValue.value = false; + break; + default: + elementValue.value = !!elementValue.value; + break; + } + return elementValue; + }); + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/toJSONAction.spec.ts b/apps/core/src/domain/actions/toJSONAction.spec.ts index 9438e265f..6979713be 100644 --- a/apps/core/src/domain/actions/toJSONAction.spec.ts +++ b/apps/core/src/domain/actions/toJSONAction.spec.ts @@ -9,7 +9,9 @@ describe('toJSONAction', () => { const attrText: IAttribute = {id: 'test_attr', format: AttributeFormats.NUMERIC, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; test('toJSON', async () => { - expect(action({test: 'aaa', toto: {tata: true}}, {}, ctx)).toBe('{"test":"aaa","toto":{"tata":true}}'); - expect(action(null, {}, ctx)).toBe(null); + expect((await action([{value: {test: 'aaa', toto: {tata: true}}}], {}, ctx)).values[0].value).toBe( + '{"test":"aaa","toto":{"tata":true}}' + ); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/toJSONAction.ts b/apps/core/src/domain/actions/toJSONAction.ts index ae78ecea0..591bd3569 100644 --- a/apps/core/src/domain/actions/toJSONAction.ts +++ b/apps/core/src/domain/actions/toJSONAction.ts @@ -1,12 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -15,12 +10,13 @@ export default function (): IActionsListFunction { description: 'Convert value to a JSON string', input_types: [ActionsListIOTypes.OBJECT], output_types: [ActionsListIOTypes.STRING], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): string => { - if (value === null) { - return null; - } + action: values => { + const computedValues = values.map(elementValue => { + elementValue.value = elementValue?.value === null ? null : JSON.stringify(elementValue.value); + return elementValue; + }); - return JSON.stringify(value); + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/toNumberAction.spec.ts b/apps/core/src/domain/actions/toNumberAction.spec.ts index 2a7a50464..ac6da35f2 100644 --- a/apps/core/src/domain/actions/toNumberAction.spec.ts +++ b/apps/core/src/domain/actions/toNumberAction.spec.ts @@ -9,12 +9,12 @@ describe('toNumberAction', () => { const attrText: IAttribute = {id: 'test_attr', format: AttributeFormats.NUMERIC, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; test('toNumber', async () => { - expect(action(12345, {}, ctx)).toBe(12345); - expect(action('12345', {}, ctx)).toBe(12345); - expect(action('12345.45', {}, ctx)).toBe(12345.45); - expect(action(true, {}, ctx)).toBe(1); - expect(action(false, {}, ctx)).toBe(0); - expect(action('aaaa', {}, ctx)).toBe(NaN); - expect(action(null, {}, ctx)).toBe(null); + expect((await action([{value: 12345}], {}, ctx)).values[0].value).toBe(12345); + expect((await action([{value: '12345'}], {}, ctx)).values[0].value).toBe(12345); + expect((await action([{value: '12345.45'}], {}, ctx)).values[0].value).toBe(12345.45); + expect((await action([{value: true}], {}, ctx)).values[0].value).toBe(1); + expect((await action([{value: false}], {}, ctx)).values[0].value).toBe(0); + expect((await action([{value: 'aaaa'}], {}, ctx)).values[0].value).toBe(NaN); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/toNumberAction.ts b/apps/core/src/domain/actions/toNumberAction.ts index 67a8e71b5..3b98b8868 100644 --- a/apps/core/src/domain/actions/toNumberAction.ts +++ b/apps/core/src/domain/actions/toNumberAction.ts @@ -1,12 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -15,8 +10,12 @@ export default function (): IActionsListFunction { description: 'Convert value to number', input_types: [ActionsListIOTypes.STRING, ActionsListIOTypes.NUMBER, ActionsListIOTypes.BOOLEAN], output_types: [ActionsListIOTypes.NUMBER], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): number => { - return value !== null ? Number(value) : null; + action: values => { + const computedValues = values.map(elementValue => { + elementValue.value = elementValue.value !== null ? Number(elementValue.value) : null; + return elementValue; + }); + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/toStringAction.spec.ts b/apps/core/src/domain/actions/toStringAction.spec.ts index 5a8df165d..19a53c0eb 100644 --- a/apps/core/src/domain/actions/toStringAction.spec.ts +++ b/apps/core/src/domain/actions/toStringAction.spec.ts @@ -9,9 +9,9 @@ describe('toStringAction', () => { const attrText: IAttribute = {id: 'test_attr', format: AttributeFormats.TEXT, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; test('toString', async () => { - expect(action('test', {}, ctx)).toBe('test'); - expect(action(12345, {}, ctx)).toBe('12345'); - expect(action(true, {}, ctx)).toBe('true'); - expect(action(null, {}, ctx)).toBe(null); + expect((await action([{value: 'test'}], {}, ctx)).values[0].value).toBe('test'); + expect((await action([{value: 12345}], {}, ctx)).values[0].value).toBe('12345'); + expect((await action([{value: true}], {}, ctx)).values[0].value).toBe('true'); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/toStringAction.ts b/apps/core/src/domain/actions/toStringAction.ts index e67f7f5ec..1cd6b8ac3 100644 --- a/apps/core/src/domain/actions/toStringAction.ts +++ b/apps/core/src/domain/actions/toStringAction.ts @@ -1,12 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -15,8 +10,12 @@ export default function (): IActionsListFunction { description: 'Convert value to string', input_types: [ActionsListIOTypes.STRING, ActionsListIOTypes.NUMBER, ActionsListIOTypes.BOOLEAN], output_types: [ActionsListIOTypes.STRING], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): string => { - return value !== null ? '' + value : null; + action: values => { + const computedValues = values.map(elementValue => { + elementValue.value = elementValue.value !== null ? String(elementValue.value) : null; + return elementValue; + }); + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/toUppercaseAction.spec.ts b/apps/core/src/domain/actions/toUppercaseAction.spec.ts index 37372c8d6..c59a19c78 100644 --- a/apps/core/src/domain/actions/toUppercaseAction.spec.ts +++ b/apps/core/src/domain/actions/toUppercaseAction.spec.ts @@ -9,7 +9,7 @@ describe('toUppercaseAction', () => { const ctx = {attribute: {id: 'test_attr', format: AttributeFormats.TEXT, type: AttributeTypes.SIMPLE}}; test('toUppercase', async () => { - expect(action('azerty', {}, ctx)).toBe('AZERTY'); - expect(action(null, {}, ctx)).toBe(null); + expect((await action([{value: 'azerty'}], {}, ctx)).values[0].value).toBe('AZERTY'); + expect((await action([{value: null}], {}, ctx)).values[0].value).toBe(null); }); }); diff --git a/apps/core/src/domain/actions/toUppercaseAction.ts b/apps/core/src/domain/actions/toUppercaseAction.ts index 28e7933b0..555e83636 100644 --- a/apps/core/src/domain/actions/toUppercaseAction.ts +++ b/apps/core/src/domain/actions/toUppercaseAction.ts @@ -1,12 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; export default function (): IActionsListFunction { return { @@ -15,8 +10,12 @@ export default function (): IActionsListFunction { description: 'Convert the string to uppercase', input_types: [ActionsListIOTypes.STRING], output_types: [ActionsListIOTypes.STRING], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): string => { - return value !== null ? (value as string).toUpperCase() : null; + action: values => { + const computedValues = values.map(elementValue => { + elementValue.value = elementValue.value !== null ? (elementValue.value as string).toUpperCase() : null; + return elementValue; + }); + return {values: computedValues, errors: []}; } }; } diff --git a/apps/core/src/domain/actions/validateEmailAction.spec.ts b/apps/core/src/domain/actions/validateEmailAction.spec.ts index 91b948498..e44e940df 100644 --- a/apps/core/src/domain/actions/validateEmailAction.spec.ts +++ b/apps/core/src/domain/actions/validateEmailAction.spec.ts @@ -1,9 +1,9 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import ValidationError from '../../errors/ValidationError'; import {AttributeFormats, AttributeTypes} from '../../_types/attribute'; import validateEmailAction from './validateEmailAction'; +import {IActionsListFunctionResult} from '_types/actionsList'; describe('validateEmailFormatAction', () => { const action = validateEmailAction().action; @@ -11,10 +11,11 @@ describe('validateEmailFormatAction', () => { const ctx = {attribute: {id: 'test_attr', format: AttributeFormats.TEXT, type: AttributeTypes.SIMPLE}}; test('validateEmail should throw', async () => { - expect(() => action('test', null, ctx)).toThrow(ValidationError); + const res = action([{value: 'test'}], null, ctx) as IActionsListFunctionResult; + expect(res.errors.length).toBe(1); }); test('validateEmail should return email', async () => { - expect(action('email@domain.com', null, ctx)).toBe('email@domain.com'); + expect((await action([{value: 'email@domain.com'}], null, ctx)).values[0].value).toBe('email@domain.com'); }); }); diff --git a/apps/core/src/domain/actions/validateEmailAction.ts b/apps/core/src/domain/actions/validateEmailAction.ts index 863088a04..c777f5a27 100644 --- a/apps/core/src/domain/actions/validateEmailAction.ts +++ b/apps/core/src/domain/actions/validateEmailAction.ts @@ -1,14 +1,7 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import Joi from 'joi'; -import ValidationError from '../../errors/ValidationError'; -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; import {Errors} from '../../_types/errors'; export default function (): IActionsListFunction { @@ -20,16 +13,15 @@ export default function (): IActionsListFunction { description: 'Check if value is a string matching email format', input_types: [ActionsListIOTypes.STRING], output_types: [ActionsListIOTypes.STRING], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): ActionsListValueType => { - const schema = Joi.string().regex(EMAIL_REGEX); + action: values => { + const allErrors = values.reduce((errors, elementValue) => { + if (!elementValue.value.match(EMAIL_REGEX)) { + errors.push({errorType: Errors.INVALID_EMAIL, attributeValue: elementValue}); + } + return errors; + }, []); - const validationRes = schema.validate(value); - - if (!!validationRes.error) { - throw new ValidationError({[ctx.attribute.id]: Errors.INVALID_EMAIL}); - } - - return value; + return {values, errors: allErrors}; } }; } diff --git a/apps/core/src/domain/actions/validateFormatAction.spec.ts b/apps/core/src/domain/actions/validateFormatAction.spec.ts index 635ed07cb..e275e1ddb 100644 --- a/apps/core/src/domain/actions/validateFormatAction.spec.ts +++ b/apps/core/src/domain/actions/validateFormatAction.spec.ts @@ -1,25 +1,14 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import ValidationError from '../../errors/ValidationError'; import {AttributeFormats, AttributeTypes} from '../../_types/attribute'; -import {IActionsListDomain} from '../actionsList/actionsListDomain'; import validateFormatAction from './validateFormatAction'; describe('validateFormatAction', () => { - const mockActionListDomain: Mockify = { - handleJoiError: jest.fn().mockReturnValue({ - test_attr: 'error' - }) - }; - - const action = validateFormatAction({'core.domain.actionsList': mockActionListDomain as IActionsListDomain}).action; + const action = validateFormatAction().action; const mockAttr = {id: 'test_attr', type: AttributeTypes.SIMPLE}; const attrText = {...mockAttr, format: AttributeFormats.TEXT}; - const attrNumeric = {...mockAttr, format: AttributeFormats.NUMERIC}; - const attrDate = {...mockAttr, format: AttributeFormats.DATE}; - const attrBoolean = {...mockAttr, format: AttributeFormats.BOOLEAN}; const attrColor = {...mockAttr, format: AttributeFormats.COLOR}; const attrExt = { ...mockAttr, @@ -45,41 +34,44 @@ describe('validateFormatAction', () => { } ] }; - const ctx = {attribute: attrText}; test('validateFormat', async () => { // Extended - const extValue = {street: 'test', city: {zipcode: 38000, name: 'Grenoble'}}; - expect(action(extValue, {}, {attribute: attrExt})).toMatchObject(extValue); + const extValue = [{value: {street: 'test', city: {zipcode: 38000, name: 'Grenoble'}}}]; + expect((await action(extValue, {}, {attribute: attrExt})).values[0]).toBe(extValue[0]); }); test('Throw if invalid format', async () => { // Extended - const badExtValue = {street: 'test', city: {zipcode: 'aaa', name: 'Grenoble'}}; - expect(() => action(badExtValue, {}, {attribute: attrExt})).toThrow(ValidationError); + const badExtValue = [{value: {street: 'test', city: {zipcode: 'aaa', name: 'Grenoble'}}}]; + const res = await action(badExtValue, {}, {attribute: attrExt}); + expect(res.errors.length).toBe(1); }); test('validateFormat COLOR', async () => { - const colorValue = 'FFFFFF'; - expect(action(colorValue, {}, {attribute: attrColor})).toBe(colorValue); + const colorValue = [{value: 'FFFFFF'}]; + expect((await action(colorValue, {}, {attribute: attrColor})).values[0]).toBe(colorValue[0]); }); test('Throw if invalid format COLOR', async () => { - const badColorValue = 'AZERTY'; - expect(() => action(badColorValue, {}, {attribute: attrColor})).toThrow(ValidationError); + const badColorValue = [{value: 'AZERTY'}]; + const res = await action(badColorValue, {}, {attribute: attrColor}); + expect(res.errors.length).toBe(1); }); test('Throw if invalid format COLOR, to be less or equal to 6 characters ', async () => { - const badColorValue = 'FFFFFFFFFFFFFFFFFFF'; - expect(() => action(badColorValue, {}, {attribute: attrColor})).toThrow(ValidationError); + const badColorValue = [{value: 'FFFFFFFFFFFFFFFFFFF'}]; + const res = await action(badColorValue, {}, {attribute: attrColor}); + expect(res.errors.length).toBe(1); }); test('validateFormat RICH TEXT', async () => { - const RichTextValue = '

salut

'; - expect(action(RichTextValue, {}, {attribute: attrText})).toBe(RichTextValue); + const RichTextValue = [{value: '

salut

'}]; + expect((await action(RichTextValue, {}, {attribute: attrText})).values[0]).toBe(RichTextValue[0]); }); test('validateFormat RICH TEXT', async () => { - const RichTextValue = false; - expect(() => action(RichTextValue, {}, {attribute: attrText})).toThrow(ValidationError); + const RichTextValue = [{value: false}]; + const res = await action(RichTextValue, {}, {attribute: attrText}); + expect(res.errors.length).toBe(1); }); }); diff --git a/apps/core/src/domain/actions/validateFormatAction.ts b/apps/core/src/domain/actions/validateFormatAction.ts index 3eec849ce..16196b4af 100644 --- a/apps/core/src/domain/actions/validateFormatAction.ts +++ b/apps/core/src/domain/actions/validateFormatAction.ts @@ -3,22 +3,11 @@ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import Joi from 'joi'; import {IDateRangeValue} from '_types/value'; -import ValidationError from '../../errors/ValidationError'; -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; import {AttributeFormats, IAttribute, IEmbeddedAttribute} from '../../_types/attribute'; import {Errors} from '../../_types/errors'; -import {IActionsListDomain} from '../actionsList/actionsListDomain'; -interface IDeps { - 'core.domain.actionsList'?: IActionsListDomain; -} - -export default function ({'core.domain.actionsList': actionsListDomain = null}: IDeps = {}): IActionsListFunction { +export default function (): IActionsListFunction { return { id: 'validateFormat', name: 'Validate Format', @@ -35,7 +24,7 @@ export default function ({'core.domain.actionsList': actionsListDomain = null}: ActionsListIOTypes.BOOLEAN, ActionsListIOTypes.OBJECT ], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): ActionsListValueType => { + action: (values, params, ctx) => { const _getSchema = (attribute: IAttribute | IEmbeddedAttribute): Joi.Schema => { let schema; switch (attribute.format) { @@ -87,29 +76,39 @@ export default function ({'core.domain.actionsList': actionsListDomain = null}: return schema; }; - const attributeSchema = _getSchema(ctx.attribute); + const errors = []; if (!attributeSchema) { - return value; + return {values, errors}; } - // Joi might convert value before testing. raw() force it to send back the value we passed in const formatSchema = attributeSchema.raw(); - const validationRes = formatSchema.validate(value); - if (!!validationRes.error) { - throw new ValidationError(actionsListDomain.handleJoiError(ctx.attribute, validationRes.error)); - } + const computedValues = values.map(elementValue => { + // Joi might convert value before testing. raw() force it to send back the value we passed in + const validationRes = formatSchema.validate(elementValue.value); + if (!!validationRes.error) { + errors.push({ + errorType: Errors.FORMAT_ERROR, + attributeValue: elementValue, + message: validationRes.error.message + }); + } - // Specific Validation for date range - if (ctx.attribute.format === AttributeFormats.DATE_RANGE) { - const rangeValue = value as IDateRangeValue; - if (Number(rangeValue.from) > Number(rangeValue.to)) { - throw new ValidationError({[ctx.attribute.id]: Errors.INVALID_DATE_RANGE}); + // Specific Validation for date range + if (ctx.attribute.format === AttributeFormats.DATE_RANGE) { + const rangeValue = elementValue.value as IDateRangeValue; + if (Number(rangeValue.from) > Number(rangeValue.to)) { + errors.push({ + errorType: Errors.INVALID_DATE_RANGE, + attributeValue: elementValue + }); + } } - } + return elementValue; + }); - return value; + return {values: computedValues, errors}; } }; } diff --git a/apps/core/src/domain/actions/validateRegexAction.spec.ts b/apps/core/src/domain/actions/validateRegexAction.spec.ts index 428cc93a0..d8794958d 100644 --- a/apps/core/src/domain/actions/validateRegexAction.spec.ts +++ b/apps/core/src/domain/actions/validateRegexAction.spec.ts @@ -1,23 +1,18 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import ValidationError from '../../errors/ValidationError'; import {AttributeFormats, AttributeTypes} from '../../_types/attribute'; -import {IActionsListDomain} from '../actionsList/actionsListDomain'; import validateRegexAction from './validateRegexAction'; describe('validateRegexAction', () => { - const mockActionListDomain: Mockify = { - handleJoiError: jest.fn().mockReturnValue({ - test_attr: 'error' - }) - }; - - const action = validateRegexAction({'core.domain.actionsList': mockActionListDomain as IActionsListDomain}).action; + const action = validateRegexAction().action; const attrText = {id: 'test_attr', format: AttributeFormats.TEXT, type: AttributeTypes.SIMPLE}; const ctx = {attribute: attrText}; test('validateRegex', async () => { - expect(action('test', {regex: '^test$'}, ctx)).toBe('test'); - expect(() => action('test', {regex: '^toto$'}, ctx)).toThrow(ValidationError); + const res = await action([{value: 'test'}], {regex: '^test$'}, ctx); + expect(res.values[0].value).toBe('test'); + + const resError = await action([{value: 'test'}], {regex: '^toto$'}, ctx); + expect(resError.errors.length).toBe(1); }); }); diff --git a/apps/core/src/domain/actions/validateRegexAction.ts b/apps/core/src/domain/actions/validateRegexAction.ts index 3352df3f8..24a2184fc 100644 --- a/apps/core/src/domain/actions/validateRegexAction.ts +++ b/apps/core/src/domain/actions/validateRegexAction.ts @@ -1,21 +1,10 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import Joi from 'joi'; -import ValidationError from '../../errors/ValidationError'; -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; -import {IActionsListDomain} from '../actionsList/actionsListDomain'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; +import {Errors} from '../../_types/errors'; -interface IDeps { - 'core.domain.actionsList'?: IActionsListDomain; -} - -export default function ({'core.domain.actionsList': actionsListDomain = null}: IDeps = {}): IActionsListFunction { +export default function (): IActionsListFunction { return { id: 'validateRegex', name: 'Validate Regex', @@ -23,18 +12,15 @@ export default function ({'core.domain.actionsList': actionsListDomain = null}: input_types: [ActionsListIOTypes.STRING], output_types: [ActionsListIOTypes.STRING], params: [{name: 'regex', type: 'string', description: 'Validation regex', required: true, default_value: ''}], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): ActionsListValueType => { - let schema = Joi.string(); - - if (params.regex) { - schema = schema.regex(new RegExp(params.regex)); - } - const validationRes = schema.validate(value); - if (!!validationRes.error) { - throw new ValidationError(actionsListDomain.handleJoiError(ctx.attribute, validationRes.error)); - } + action: (values, params) => { + const allErrors = values.reduce((errors, elementValue) => { + if (params.regex && !elementValue.value.match(new RegExp(params.regex))) { + errors.push({errorType: Errors.INVALID_REGEXP, attributeValue: elementValue}); + } + return errors; + }, []); - return value; + return {values, errors: allErrors}; } }; } diff --git a/apps/core/src/domain/actions/validateURLAction.spec.ts b/apps/core/src/domain/actions/validateURLAction.spec.ts index 1a6c61717..5b5accef8 100644 --- a/apps/core/src/domain/actions/validateURLAction.spec.ts +++ b/apps/core/src/domain/actions/validateURLAction.spec.ts @@ -1,7 +1,6 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import ValidationError from '../../errors/ValidationError'; import {AttributeFormats, AttributeTypes} from '../../_types/attribute'; import validateURLAction from './validateURLAction'; @@ -11,10 +10,12 @@ describe('validateURLFormatAction', () => { const ctx = {attribute: {id: 'test_attr', format: AttributeFormats.TEXT, type: AttributeTypes.SIMPLE}}; test('validateURL should throw', async () => { - expect(() => action('test', null, ctx)).toThrow(ValidationError); + const res = await action([{value: 'test'}], null, ctx); + expect(res.errors.length).toBe(1); }); test('validateURL should return URL', async () => { - expect(action('http://url.com', null, ctx)).toBe('http://url.com'); + const res = await action([{value: 'http://url.com'}], null, ctx); + expect(res.values[0].value).toBe('http://url.com'); }); }); diff --git a/apps/core/src/domain/actions/validateURLAction.ts b/apps/core/src/domain/actions/validateURLAction.ts index 14210b0c4..51494f36e 100644 --- a/apps/core/src/domain/actions/validateURLAction.ts +++ b/apps/core/src/domain/actions/validateURLAction.ts @@ -1,15 +1,9 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import Joi from 'joi'; -import ValidationError from '../../errors/ValidationError'; -import { - ActionsListIOTypes, - ActionsListValueType, - IActionsListContext, - IActionsListFunction -} from '../../_types/actionsList'; +import {ActionsListIOTypes, IActionsListFunction} from '../../_types/actionsList'; import {Errors} from '../../_types/errors'; +import {IValue} from '_types/value'; export default function (): IActionsListFunction { return { @@ -18,14 +12,18 @@ export default function (): IActionsListFunction { description: 'Check if value is a string matching URL format', input_types: [ActionsListIOTypes.STRING], output_types: [ActionsListIOTypes.STRING], - action: (value: ActionsListValueType, params: any, ctx: IActionsListContext): ActionsListValueType => { - try { - new URL(value as string); - } catch (err) { - throw new ValidationError({[ctx.attribute.id]: Errors.INVALID_URL}); - } + action: (values: IValue[]) => { + const allErrors = values.reduce((errors, elementValue) => { + try { + new URL(elementValue as string); + } catch (err) { + errors.push({errorType: Errors.INVALID_URL, attributeValue: elementValue}); + } - return value; + return errors; + }, []); + + return {values, errors: allErrors}; } }; } diff --git a/apps/core/src/domain/actionsList/actionsListDomain.spec.ts b/apps/core/src/domain/actionsList/actionsListDomain.spec.ts index 6371551cd..89441b9bf 100644 --- a/apps/core/src/domain/actionsList/actionsListDomain.spec.ts +++ b/apps/core/src/domain/actionsList/actionsListDomain.spec.ts @@ -8,6 +8,8 @@ import {Errors} from '../../_types/errors'; import {mockAttrSimple} from '../../__tests__/mocks/attribute'; import {mockCtx} from '../../__tests__/mocks/shared'; import actionListDomain from './actionsListDomain'; +import {mockTranslator} from '../../__tests__/mocks/translator'; +import {i18n} from 'i18next'; describe('handleJoiError', () => { test('handleJoiError', async () => { @@ -47,14 +49,23 @@ describe('runActionsList', () => { test('Should run a list of actions', async () => { const domain = actionListDomain(); + const availActions = [ { + id: 'validate', name: 'validate', - action: jest.fn().mockReturnValue('test_val') + action: jest.fn().mockImplementation(() => ({ + values: {id_value: '999', value: 'test_val'}, + errors: [] + })) }, { + id: 'convert', name: 'convert', - action: jest.fn().mockReturnValue('test_val') + action: jest.fn().mockImplementation(() => ({ + values: {id_value: '999', value: 'test_val'}, + errors: [] + })) } ]; @@ -65,7 +76,7 @@ describe('runActionsList', () => { {id: 'convert', name: 'Convert', params: [{name: 'firstArg', value: 'test'}], is_system: false}, {id: 'validate', name: 'Validate', is_system: true} ], - val, + [val], ctx ); @@ -76,14 +87,18 @@ describe('runActionsList', () => { const domain = actionListDomain(); const availActions = [ { + id: 'validate', name: 'validate', - action: jest.fn().mockImplementation(() => { - throw new ValidationError({test_attr: Errors.ERROR}); - }) + action: jest.fn().mockImplementation(() => ({ + errors: [{errorType: Errors.ERROR, message: 'validation Error', attributeValue: {value: true}}] + })) }, { + id: 'convert', name: 'convert', - action: jest.fn().mockReturnValue('test_val') + action: jest.fn().mockImplementation(() => ({ + errors: [{errorType: Errors.ERROR, message: 'validation Error', attributeValue: {value: true}}] + })) } ]; @@ -95,7 +110,7 @@ describe('runActionsList', () => { {id: 'convert', name: 'Convert', params: [{name: 'firstArg', value: 'test'}], is_system: false}, {id: 'validate', name: 'validate', is_system: true} ], - val, + [val], ctx ) ).rejects.toThrow(ValidationError); @@ -105,14 +120,18 @@ describe('runActionsList', () => { const domain = actionListDomain(); const availActions = [ { + id: 'validate', name: 'validate', - action: jest.fn().mockImplementation(() => { - throw new ValidationError({test_attr: Errors.ERROR}, 'validation Error', true); - }) + action: jest.fn().mockImplementation(() => ({ + errors: [{errorType: Errors.ERROR, message: 'validation Error', attributeValue: {value: true}}] + })) }, { + id: 'convert', name: 'convert', - action: jest.fn().mockReturnValue('test_val') + action: jest.fn().mockImplementation(() => ({ + errors: [{errorType: Errors.ERROR, message: 'validation Error', attributeValue: {value: true}}] + })) } ]; @@ -123,12 +142,12 @@ describe('runActionsList', () => { {id: 'convert', name: 'Convert', params: [{name: 'firstArg', value: 'test'}], is_system: false}, {id: 'validate', name: 'validate', is_system: true, error_message: {en: 'test error message'}} ], - val, + [val], ctx ); await expect(res).rejects.toThrow(ValidationError); - await expect(res).rejects.toHaveProperty('fields.test_attr', 'test error message'); + await expect(res).rejects.toHaveProperty('fields.test_attr', 'validation Error: true'); }); test('Should throw an exception with custom message from system while a error_message "en" has been set', async () => { @@ -138,17 +157,21 @@ describe('runActionsList', () => { lang: 'fr', defaultLang: 'fr' }; - const domain = actionListDomain(); + const domain = actionListDomain({translator: mockTranslator as i18n}); const availActions = [ { + id: 'validate', name: 'validate', - action: jest.fn().mockImplementation(() => { - throw new ValidationError({test_attr: Errors.ERROR}, 'validation Error', true); - }) + action: jest.fn().mockImplementation(() => ({ + errors: [{errorType: Errors.ERROR, message: 'validation Error', attributeValue: {value: true}}] + })) }, { + id: 'convert', name: 'convert', - action: jest.fn().mockReturnValue('test_val') + action: jest.fn().mockImplementation(() => ({ + errors: [{errorType: Errors.ERROR, message: 'validation Error', attributeValue: {value: true}}] + })) } ]; @@ -159,10 +182,10 @@ describe('runActionsList', () => { {id: 'convert', name: 'Convert', params: [{name: 'firstArg', value: 'test'}], is_system: false}, {id: 'validate', name: 'validate', is_system: true, error_message: {en: 'test error message'}} ], - val, + [val], textctx ); await expect(res).rejects.toThrow(ValidationError); - await expect(res).rejects.toHaveProperty('fields.test_attr', Errors.ERROR); + await expect(res).rejects.toHaveProperty('fields.test_attr', 'validation Error: true'); }); }); diff --git a/apps/core/src/domain/actionsList/actionsListDomain.ts b/apps/core/src/domain/actionsList/actionsListDomain.ts index 362a25939..27163e521 100644 --- a/apps/core/src/domain/actionsList/actionsListDomain.ts +++ b/apps/core/src/domain/actionsList/actionsListDomain.ts @@ -15,6 +15,7 @@ import {IAttribute} from '../../_types/attribute'; import {ErrorFieldDetail, Errors} from '../../_types/errors'; import {IRecord} from '../../_types/record'; import {IValue} from '../../_types/value'; +import {i18n} from 'i18next'; export interface IActionsListDomain { /** @@ -44,17 +45,18 @@ export interface IActionsListDomain { * They're run in the order defined in the actions array. * * @param actions List of actions to execute - * @param value + * @param values Array of values to pass to the actions * @param ctx Context transmitted to the function when executed */ - runActionsList(actions: IActionsListSavedAction[], value: IValue, ctx: IRunActionsListCtx): Promise; + runActionsList(actions: IActionsListSavedAction[], values: IValue[], ctx: IRunActionsListCtx): Promise; } interface IDeps { 'core.depsManager'?: AwilixContainer; + translator?: i18n; } -export default function ({'core.depsManager': depsManager = null}: IDeps = {}): IActionsListDomain { +export default function({'core.depsManager': depsManager = null, translator = null}: IDeps = {}): IActionsListDomain { let _pluginActions = []; return { getAvailableActions(): IActionsListFunction[] { @@ -74,10 +76,9 @@ export default function ({'core.depsManager': depsManager = null}: IDeps = {}): registerActions(actions: IActionsListFunction[]): void { _pluginActions = [..._pluginActions, ...actions]; }, - async runActionsList(actions, value, ctx) { + async runActionsList(actions, values, ctx) { const availActions: IActionsListFunction[] = this.getAvailableActions(); - - let resultAction = value.value; + let resultAction = values; for (const action of actions) { const params: IActionsListParams = !!action.params ? action.params.reduce((all, p) => { @@ -85,42 +86,51 @@ export default function ({'core.depsManager': depsManager = null}: IDeps = {}): return all; }, {}) : {}; - const actionFunc = availActions.find(a => { - const availableActionId = a.id ? a.id : a.name; - const actionId = action.id ? action.id : action.name; - return availableActionId === actionId; - }).action; - try { - // run each actions separately to catch the context of the error. - resultAction = await actionFunc(resultAction, params, ctx); - } catch (error) { - //check if there is a custom message added by a user (also check the default lng message) + const actionFunc = availActions.find(availableAction => availableAction.id === action.id).action; + + // run each actions separately to catch the context of the error. + const {values: actionFuncValues, errors} = await actionFunc(resultAction, params, ctx); + resultAction = actionFuncValues; + if (errors.length > 0) { + //check if there is a custom message added by a user (also check the default lng message) let customMessage = !isEmpty(action?.error_message?.[ctx.lang]?.trim()) ? action.error_message[ctx.lang] : !isEmpty(action?.error_message?.[ctx.defaultLang]?.trim()) ? action.error_message[ctx.defaultLang] : ''; + if (customMessage) { + customMessage += ': ' + errors.map(error => error.attributeValue.value).join(', '); + throw new ValidationError({[ctx.attribute.id]: customMessage}, customMessage, true); + } else { + const errorsByType = errors.reduce< + Record | {} + >((acc, actionError) => { + if (!acc[actionError.errorType]) { + acc[actionError.errorType] = {attributeValues: [], message: actionError.message}; + } + acc[actionError.errorType].attributeValues.push(actionError.attributeValue); + return acc; + }, {}); - //check if there is a joy error message - customMessage = - customMessage === '' && error.fields[ctx.attribute.id]?.vars?.details - ? error.fields[ctx.attribute.id].vars.details - : customMessage; + const errorMessage = Object.entries(errorsByType).reduce( + (message, [errorType, {attributeValues, message: optionalMessage}]) => { + const messageText = optionalMessage ?? translator.t(`error.${errorType}`); + message.push( + `${messageText}: ${(attributeValues ?? []).map(value => value.value).join(', ')}` + ); + return message; + }, + [] + ); - let objectValidationError = {[ctx.attribute.id]: error.fields[ctx.attribute.id]}; - let isCustomMessage = false; + const formattedErrorMessage = errorMessage.join('\n'); - if (!isEmpty(customMessage)) { - objectValidationError = {[ctx.attribute.id]: customMessage}; - isCustomMessage = true; + throw new ValidationError({[ctx.attribute.id]: formattedErrorMessage}, formattedErrorMessage); } - - //throw the validation error with a custom message - throw new ValidationError(objectValidationError, error.message, isCustomMessage); } } - return {...value, value: resultAction}; + return resultAction; } }; } diff --git a/apps/core/src/domain/helpers/calculationVariable/calculationVariable.spec.ts b/apps/core/src/domain/helpers/calculationVariable/calculationVariable.spec.ts index a27d160b9..4627fca80 100644 --- a/apps/core/src/domain/helpers/calculationVariable/calculationVariable.spec.ts +++ b/apps/core/src/domain/helpers/calculationVariable/calculationVariable.spec.ts @@ -1,12 +1,10 @@ // Copyright LEAV Solutions 2017 // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt -import {IActionsListContext} from '_types/actionsList'; import calculationVariable, {IVariableValue} from '.'; - const mockCalculationsVariableFunctions = { test: { - run: async (context: IActionsListContext, initialValue: any, ...params: any[]): Promise => { + run: async (): Promise => { return [ { recordId: '1', @@ -18,12 +16,12 @@ const mockCalculationsVariableFunctions = { after: [] }, test2: { - run: async (context: IActionsListContext, initialValue: any, ...params: any[]): Promise => { + run: async (_, initialValues: any[]): Promise => { return [ { recordId: '1', library: 'meh', - value: initialValue[0].value + 10 + value: initialValues[0].value + 10 } ]; }, @@ -37,19 +35,24 @@ describe('calculationVariable', () => { }); test('empty variable', async () => { - const res = await calculation.processVariableString({recordId: '1', library: 'meh'}, '', 'toto'); - expect(res[0].value).toBe('toto'); + const res = await calculation.processVariableString({recordId: '1', library: 'meh'}, '', ['toto']); + expect(res[0].value).toEqual(['toto']); }); + test('run variable function', async () => { - const res = await calculation.processVariableString({recordId: '1', library: 'meh'}, 'test()', 'toto'); + const res = await calculation.processVariableString({recordId: '1', library: 'meh'}, 'test()', ['toto']); expect(res[0].value).toBe(42); }); + test('run sequence of variable functions', async () => { - const res = await calculation.processVariableString({recordId: '1', library: 'meh'}, 'test().test2()', 'toto'); + const res = await calculation.processVariableString({recordId: '1', library: 'meh'}, 'test().test2()', [ + 'toto' + ]); expect(res[0].value).toBe(52); }); + test('run unknown function', async () => { - const res = calculation.processVariableString({recordId: '1', library: 'meh'}, 'meh()', 'toto'); + const res = calculation.processVariableString({recordId: '1', library: 'meh'}, 'meh()', ['toto']); res.catch(e => { expect(e).toEqual(Error('Invalid request')); }); diff --git a/apps/core/src/domain/helpers/calculationVariable/index.ts b/apps/core/src/domain/helpers/calculationVariable/index.ts index 5b5f8eab7..dfc0c19ad 100644 --- a/apps/core/src/domain/helpers/calculationVariable/index.ts +++ b/apps/core/src/domain/helpers/calculationVariable/index.ts @@ -18,19 +18,24 @@ export interface IVariableValue { } export interface ICalculationVariable { - processVariableString: (IActionsListContext, string, ActionsListValueType) => Promise; + processVariableString: ( + context: IActionsListContext, + variables: string, + initialValues: ActionsListValueType[] + ) => Promise; } + export default function({'core.domain.helpers.calculationsVariableFunctions': variableFunctions = null}: IDeps = {}) { - const processVariableString = async ( - context: IActionsListContext, - variableString: string, - initialValue: ActionsListValueType - ): Promise => { + const processVariableString: ICalculationVariable['processVariableString'] = async ( + context, + variableString, + initialValues + ) => { let passingValue = [ { recordId: context.recordId, library: context.library, - value: initialValue + value: initialValues } ] as IVariableValue[]; diff --git a/apps/core/src/domain/record/recordDomain.spec.ts b/apps/core/src/domain/record/recordDomain.spec.ts index bb1095afc..d42efc0de 100644 --- a/apps/core/src/domain/record/recordDomain.spec.ts +++ b/apps/core/src/domain/record/recordDomain.spec.ts @@ -2,7 +2,6 @@ // This file is released under LGPL V3 // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import {ErrorTypes} from '@leav/utils'; -import {IActionsListDomain} from 'domain/actionsList/actionsListDomain'; import {IAttributeDomain} from 'domain/attribute/attributeDomain'; import {IEventsManagerDomain} from 'domain/eventsManager/eventsManagerDomain'; import {IValidateHelper} from 'domain/helpers/validate'; @@ -77,7 +76,7 @@ describe('RecordDomain', () => { }); describe('createRecord', () => { - test('Should create a new record', async function () { + test('Should create a new record', async function() { const createdRecordData = { id: '222435651', library: 'test', @@ -116,7 +115,7 @@ describe('RecordDomain', () => { expect(createdRecord.valuesErrors).toBe(null); }); - test('Should create a new record and save its values', async function () { + test('Should create a new record and save its values', async function() { const createdRecordData = { id: '222435651', library: 'test', @@ -269,7 +268,7 @@ describe('RecordDomain', () => { }); describe('updateRecord', () => { - test('Should update a record', async function () { + test('Should update a record', async function() { const updatedRecordData = { id: '222435651', library: 'test', @@ -304,7 +303,7 @@ describe('RecordDomain', () => { describe('deleteRecord', () => { const recordData = {id: '222435651', library: 'test', created_at: 1519303348, modified_at: 1519303348}; - test('Should delete an record and return deleted record', async function () { + test('Should delete an record and return deleted record', async function() { const recRepo: Mockify = { deleteRecord: global.__mockPromise(recordData) }; @@ -377,7 +376,7 @@ describe('RecordDomain', () => { getLibraryPermission: global.__mockPromise(true) }; - test('Should find records', async function () { + test('Should find records', async function() { const recRepo: Mockify = {find: global.__mockPromise(mockRes)}; const recDomain = recordDomain({ @@ -879,7 +878,7 @@ describe('RecordDomain', () => { }); }); - test('Should search records', async function () { + test('Should search records', async function() { const mockSearchRes = { totalCount: 1, list: [ @@ -1272,7 +1271,7 @@ describe('RecordDomain', () => { const mockValueDomainFormatValue: Mockify = { formatValue: jest.fn(({value, library}) => Promise.resolve(value)), - runActionsList: jest.fn(({value}) => Promise.resolve(value)) + runActionsList: jest.fn(() => Promise.resolve([{value: 2119477320}])) }; const mockAttributeDomainCommon: Mockify = { @@ -1307,15 +1306,15 @@ describe('RecordDomain', () => { 'core.domain.value': mockValueDomainFormatValue as IValueDomain }); - const value = await recDomain.getRecordFieldValue({ + const values = (await recDomain.getRecordFieldValue({ library: 'test_lib', record: mockRecordWithValues, attributeId: 'created_at', ctx - }); + })) as IValue[]; - expect(Array.isArray(value)).toBe(false); - expect((value as IValue).value).toBe(mockRecordWithValues.created_at); + expect(Array.isArray(values)).toBe(true); + expect(values[0].value).toBe(mockRecordWithValues.created_at); }); test('Return a value not present on record', async () => { @@ -1342,15 +1341,15 @@ describe('RecordDomain', () => { 'core.domain.value': mockValDomain as IValueDomain }); - const value = await recDomain.getRecordFieldValue({ + const values = await recDomain.getRecordFieldValue({ library: 'test_lib', record: mockRecordWithValues, attributeId: 'label', ctx }); - expect(Array.isArray(value)).toBe(true); - expect(value[0].value).toBe('MyLabel'); + expect(Array.isArray(values)).toBe(true); + expect(values[0].value).toBe('MyLabel'); }); test('Return a formatted value', async () => { @@ -1366,15 +1365,11 @@ describe('RecordDomain', () => { }) }; - const mockALDomain: Mockify = { - runActionsList: global.__mockPromise({value: '1/3/37 00:42'}) - }; - const mockValueDomainFormatValueDate: Mockify = { formatValue: jest.fn(({value}) => - Promise.resolve({...value, raw_value: value.value, value: '1/3/37 00:42'}) + Promise.resolve({...value, raw_value: 2119477320, value: '1/3/37 00:42'}) ), - runActionsList: jest.fn(({value}) => Promise.resolve(value)) + runActionsList: jest.fn(() => Promise.resolve([{value: '1/3/37 00:42', raw_value: 2119477320}])) }; const recDomain = recordDomain({ @@ -1382,15 +1377,15 @@ describe('RecordDomain', () => { 'core.domain.value': mockValueDomainFormatValueDate as IValueDomain }); - const value = await recDomain.getRecordFieldValue({ + const values = (await recDomain.getRecordFieldValue({ library: 'test_lib', record: mockRecordWithValues, attributeId: 'created_at', ctx - }); + })) as IStandardValue[]; - expect((value as IValue).value).toBe('1/3/37 00:42'); - expect((value as IStandardValue).raw_value).toBe(2119477320); + expect(values[0].value).toBe('1/3/37 00:42'); + expect(values[0].raw_value).toBe(2119477320); }); test('Return a link value', async () => { @@ -1408,7 +1403,7 @@ describe('RecordDomain', () => { formatValue: jest.fn(({value, library}) => Promise.resolve({value: {...mockRecord, id: mockRecordWithValues.created_by, library: 'users'}}) ), - runActionsList: jest.fn((_, value) => Promise.resolve(value)) + runActionsList: jest.fn((_, value) => Promise.resolve([value])) }; const recDomain = recordDomain({ @@ -1416,15 +1411,15 @@ describe('RecordDomain', () => { 'core.domain.value': mockValueDomainFormatValueLink as IValueDomain }); - const value = await recDomain.getRecordFieldValue({ + const values = (await recDomain.getRecordFieldValue({ library: 'test_lib', record: mockRecordWithValues, attributeId: 'created_by', ctx - }); + })) as IValue[]; - expect((value as IValue).value.id).toBe('42'); - expect((value as IValue).value.library).toBe('users'); + expect(values[0].value.id).toBe('42'); + expect(values[0].value.library).toBe('users'); }); test('If force array, return an array', async () => { @@ -1441,16 +1436,16 @@ describe('RecordDomain', () => { 'core.domain.value': mockValueDomainFormatValue as IValueDomain }); - const value = await recDomain.getRecordFieldValue({ + const values = (await recDomain.getRecordFieldValue({ library: 'test_lib', record: mockRecordWithValues, attributeId: 'created_at', options: {forceArray: true}, ctx - }); + })) as IValue[]; - expect(Array.isArray(value)).toBe(true); - expect((value as IValue)[0].value).toBe(2119477320); + expect(Array.isArray(values)).toBe(true); + expect(values[0].value).toBe(2119477320); }); }); @@ -1465,7 +1460,7 @@ describe('RecordDomain', () => { }; const mockValueDomain: Mockify = { - saveValue: global.__mockPromise({value: false}) + saveValue: global.__mockPromise([{value: false}]) }; const recDomain = recordDomain({'core.domain.value': mockValueDomain as IValueDomain}); @@ -1491,7 +1486,7 @@ describe('RecordDomain', () => { }; const mockValueDomain: Mockify = { - saveValue: global.__mockPromise({value: true}) + saveValue: global.__mockPromise([{value: true}]) }; const recDomain = recordDomain({'core.domain.value': mockValueDomain as IValueDomain}); @@ -1518,7 +1513,7 @@ describe('RecordDomain', () => { }; const mockValueDomain: Mockify = { - saveValue: global.__mockPromise({value: false}) + saveValue: global.__mockPromise([{value: false}]) }; const recDomain = recordDomain({'core.domain.value': mockValueDomain as IValueDomain}); @@ -1543,7 +1538,7 @@ describe('RecordDomain', () => { }; const mockValueDomain: Mockify = { - saveValue: global.__mockPromise({value: true}) + saveValue: global.__mockPromise([{value: true}]) }; const recDomain = recordDomain({'core.domain.value': mockValueDomain as IValueDomain}); diff --git a/apps/core/src/domain/record/recordDomain.ts b/apps/core/src/domain/record/recordDomain.ts index 4a5fe6f09..f28c3322a 100644 --- a/apps/core/src/domain/record/recordDomain.ts +++ b/apps/core/src/domain/record/recordDomain.ts @@ -225,25 +225,22 @@ export default function ({ values = [ { value: - attribute.type === AttributeTypes.SIMPLE_LINK && typeof record[attribute.id] === 'string' - ? {id: record[attribute.id]} - : record[attribute.id] + attribute.type === AttributeTypes.SIMPLE_LINK && typeof record[attribute.id] === 'string' + ? {id: record[attribute.id]} + : record[attribute.id] } ]; // Apply actionsList - values = await Promise.all( - values.map(v => - valueDomain.runActionsList({ - listName: ActionsListEvents.GET_VALUE, - value: v, - attribute, - record, - library, - ctx - }) - ) - ); + values = await valueDomain.runActionsList({ + listName: ActionsListEvents.GET_VALUE, + values, + attribute, + record, + library, + ctx + }); + } else { values = await valueDomain.getValues({ library, @@ -848,15 +845,23 @@ export default function ({ if (values?.length) { // First, check if values are ok. If not, we won't create the record at all + const valuesByAttribute = values.reduce>((acc, value) => { + if (!acc[value.attribute]) { + acc[value.attribute] = []; + } + acc[value.attribute].push(value); + return acc; + }, {}); + const res = await Promise.allSettled( - values.map(async v => { + Object.entries(valuesByAttribute).map(async ([attributeId, attributeValues]) => { const attributeProps = await attributeDomain.getAttributeProperties({ - id: v.attribute, + id: attributeId, ctx }); return valueDomain.runActionsList({ listName: ActionsListEvents.SAVE_VALUE, - value: v, + values: attributeValues, attribute: attributeProps, library, ctx @@ -1216,9 +1221,9 @@ export default function ({ listName: ActionsListEvents.GET_VALUE, attribute: metadataAttributeProps, library, - value: formattedValue.metadata[metadataField] as IStandardValue, + values: [formattedValue.metadata[metadataField] as IStandardValue], ctx - }); + })[0]; } } @@ -1253,11 +1258,10 @@ export default function ({ v.value.hasOwnProperty('library') ); } - - return attrProps.multiple_values || forceArray ? formattedValues : formattedValues[0] || null; + return formattedValues; }, async deactivateRecord(record: IRecord, ctx: IQueryInfos): Promise { - const savedVal = await valueDomain.saveValue({ + const savedValues = await valueDomain.saveValue({ library: record.library, recordId: record.id, attribute: 'active', @@ -1265,10 +1269,10 @@ export default function ({ ctx }); - return {...record, active: savedVal.value}; + return {...record, active: savedValues[0].value}; }, async activateRecord(record: IRecord, ctx: IQueryInfos): Promise { - const savedVal = await valueDomain.saveValue({ + const savedValues = await valueDomain.saveValue({ library: record.library, recordId: record.id, attribute: 'active', @@ -1276,7 +1280,7 @@ export default function ({ ctx }); - return {...record, active: savedVal.value}; + return {...record, active: savedValues[0].value}; }, async deactivateRecordsBatch({libraryId, recordsIds, filters, ctx}) { let recordsToDeactivate: string[] = recordsIds ?? []; diff --git a/apps/core/src/domain/value/_types.ts b/apps/core/src/domain/value/_types.ts index fbbb5a21a..81477ea2f 100644 --- a/apps/core/src/domain/value/_types.ts +++ b/apps/core/src/domain/value/_types.ts @@ -17,7 +17,7 @@ export interface IDeleteValueParams { export interface IRunActionListParams { listName: ActionsListEvents; - value: IValue; + values: IValue[]; attribute: IAttribute; record?: IRecord; library: string; diff --git a/apps/core/src/domain/value/helpers/prepareValue.ts b/apps/core/src/domain/value/helpers/prepareValue.ts index 05c737e1f..ccad593b2 100644 --- a/apps/core/src/domain/value/helpers/prepareValue.ts +++ b/apps/core/src/domain/value/helpers/prepareValue.ts @@ -25,49 +25,50 @@ interface IPrepareValueParams { ctx: IQueryInfos; } -export default async (params: IPrepareValueParams): Promise => { +export default async (params: IPrepareValueParams): Promise => { const {attributeProps, value, library, recordId, deps, ctx} = params; // Execute actions list. Output value might be different from input value - const preparedValue = - !!attributeProps.actions_list && !!attributeProps.actions_list.saveValue - ? await deps.actionsListDomain.runActionsList(attributeProps.actions_list.saveValue, value, { - ...ctx, - attribute: attributeProps, - recordId, - library - }) - : value; + const preparedValues = !!attributeProps.actions_list?.saveValue + ? await deps.actionsListDomain.runActionsList(attributeProps.actions_list.saveValue, [value], { + ...ctx, + attribute: attributeProps, + recordId, + library + }) + : [value]; - if (preparedValue.metadata) { - try { - for (const metaFieldName of Object.keys(preparedValue.metadata)) { - const metaFieldProps = await deps.attributeDomain.getAttributeProperties({id: metaFieldName, ctx}); + preparedValues.map(async preparedValue => { + if (preparedValue.metadata) { + try { + for (const metaFieldName of Object.keys(preparedValue.metadata)) { + const metaFieldProps = await deps.attributeDomain.getAttributeProperties({id: metaFieldName, ctx}); - if (metaFieldProps?.actions_list?.[ActionsListEvents.SAVE_VALUE]) { - const processedMetaValue = await deps.actionsListDomain.runActionsList( - metaFieldProps.actions_list[ActionsListEvents.SAVE_VALUE], - {value: preparedValue.metadata[metaFieldName]}, - { - ...ctx, - attribute: metaFieldProps, - recordId, - library - } - ); - preparedValue.metadata[metaFieldName] = processedMetaValue.value; + if (metaFieldProps?.actions_list?.[ActionsListEvents.SAVE_VALUE]) { + const processedMetaValue = await deps.actionsListDomain.runActionsList( + metaFieldProps.actions_list[ActionsListEvents.SAVE_VALUE], + [{value: preparedValue.metadata[metaFieldName]}], + { + ...ctx, + attribute: metaFieldProps, + recordId, + library + } + ); + preparedValue.metadata[metaFieldName] = processedMetaValue[0].value; + } + } + } catch (e) { + if (!(e instanceof ValidationError)) { + deps.utils.rethrow(e); } - } - } catch (e) { - if (!(e instanceof ValidationError)) { - deps.utils.rethrow(e); - } - e.fields = {metadata: {...e.fields}}; + e.fields = {metadata: {...e.fields}}; - deps.utils.rethrow(e); + deps.utils.rethrow(e); + } } - } + }); - return preparedValue; + return preparedValues; }; diff --git a/apps/core/src/domain/value/valueDomain.spec.ts b/apps/core/src/domain/value/valueDomain.spec.ts index deca24868..1800906e6 100644 --- a/apps/core/src/domain/value/valueDomain.spec.ts +++ b/apps/core/src/domain/value/valueDomain.spec.ts @@ -142,7 +142,7 @@ describe('ValueDomain', () => { getTrees: global.__mockPromise({list: [mockTree], totalCount: 0}) }; - test('Should save an indexed value', async function () { + test('Should save an indexed value', async function() { const savedValueData = {value: 'test val', attribute: 'test_attr'}; const mockValRepo = { @@ -181,10 +181,10 @@ describe('ValueDomain', () => { expect(mockValRepo.createValue.mock.calls.length).toBe(1); expect(mockActionsListDomain.runActionsList.mock.calls.length).toBe(2); - expect(savedValue).toMatchObject(savedValueData); + expect(savedValue[0]).toMatchObject(savedValueData); }); - test('Should save a new standard value', async function () { + test('Should save a new standard value', async function() { const savedValueData = { id_value: '1337', value: 'test val', @@ -230,14 +230,14 @@ describe('ValueDomain', () => { expect(mockValRepo.createValue.mock.calls[0][0].value.modified_at).toBeDefined(); expect(mockValRepo.createValue.mock.calls[0][0].value.created_at).toBeDefined(); - expect(savedValue).toMatchObject(savedValueData); - expect(savedValue.id_value).toBeTruthy(); - expect(savedValue.attribute).toBeTruthy(); - expect(savedValue.modified_at).toBeTruthy(); - expect(savedValue.created_at).toBeTruthy(); + expect(savedValue[0]).toMatchObject(savedValueData); + expect(savedValue[0].id_value).toBeTruthy(); + expect(savedValue[0].attribute).toBeTruthy(); + expect(savedValue[0].modified_at).toBeTruthy(); + expect(savedValue[0].created_at).toBeTruthy(); }); - test('Should update a standard value', async function () { + test('Should update a standard value', async function() { const savedValueData = { id_value: '1337', value: 'test val', @@ -289,14 +289,14 @@ describe('ValueDomain', () => { expect(mockValRepo.updateValue.mock.calls[0][0].value.modified_at).toBeDefined(); expect(mockValRepo.updateValue.mock.calls[0][0].value.created_at).toBeUndefined(); - expect(savedValue).toMatchObject(savedValueData); - expect(savedValue.id_value).toBeTruthy(); - expect(savedValue.attribute).toBeTruthy(); - expect(savedValue.modified_at).toBeTruthy(); - expect(savedValue.created_at).toBeTruthy(); + expect(savedValue[0]).toMatchObject(savedValueData); + expect(savedValue[0].id_value).toBeTruthy(); + expect(savedValue[0].attribute).toBeTruthy(); + expect(savedValue[0].modified_at).toBeTruthy(); + expect(savedValue[0].created_at).toBeTruthy(); }); - test('Should throw if unknown attribute', async function () { + test('Should throw if unknown attribute', async function() { const mockAttrDomain: Mockify = { getAttributeProperties: jest.fn().mockImplementationOnce(id => { throw new ValidationError({id: Errors.UNKNOWN_ATTRIBUTE}); @@ -323,7 +323,7 @@ describe('ValueDomain', () => { ).rejects.toThrow(); }); - test('Should throw if the library does not use the attribute', async function () { + test('Should throw if the library does not use the attribute', async function() { const mValidateHelper: Mockify = { validateLibraryAttribute: jest.fn().mockImplementation(() => { throw new ValidationError({attribute: Errors.UNKNOWN_LIBRARY_ATTRIBUTE}); @@ -350,7 +350,7 @@ describe('ValueDomain', () => { ).rejects.toThrow(); }); - test('Should throw if unknown library', async function () { + test('Should throw if unknown library', async function() { const mockAttrDomain: Mockify = { getAttributes: global.__mockPromise({list: [{id: 'test_attr'}], totalCount: 1}), getLibraryFullTextAttributes: global.__mockPromise([{id: 'id'}]) @@ -376,7 +376,7 @@ describe('ValueDomain', () => { ).rejects.toThrow(); }); - test('Should throw if unknown value', async function () { + test('Should throw if unknown value', async function() { const mockAttrDomain: Mockify = { getAttributeProperties: global.__mockPromise({...mockAttribute, type: AttributeTypes.ADVANCED}), getLibraryFullTextAttributes: global.__mockPromise([{id: 'id'}]) @@ -405,7 +405,7 @@ describe('ValueDomain', () => { ).rejects.toThrow(); }); - test('Should update record modif date and user', async function () { + test('Should update record modif date and user', async function() { const savedValueData = {value: 'test val', attribute: 'test_attr'}; const mockValRepo = { @@ -449,7 +449,7 @@ describe('ValueDomain', () => { expect(mockUpdateRecordLastModif).toBeCalledWith('test_lib', '12345', ctx); - expect(savedValue).toMatchObject(savedValueData); + expect(savedValue[0]).toMatchObject(savedValueData); }); test('Should save a versioned value', async () => { @@ -501,7 +501,7 @@ describe('ValueDomain', () => { expect(mockValRepo.createValue.mock.calls.length).toBe(1); expect(mockValRepo.createValue.mock.calls[0][0].value.version).toBeDefined(); - expect(savedValue.version).toBeTruthy(); + expect(savedValue[0].version).toBeTruthy(); }); test('Should ignore version when saving version on a non versionable attribute', async () => { @@ -541,7 +541,7 @@ describe('ValueDomain', () => { ctx }); - expect(savedValue.version).toBeUndefined(); + expect(savedValue[0].version).toBeUndefined(); }); test('Should throw if unknown record', async () => { @@ -829,7 +829,7 @@ describe('ValueDomain', () => { expect(mockEventsManagerDomain.sendDatabaseEvent).not.toBeCalled(); expect(mockUpdateRecordLastModif).not.toBeCalled(); expect(mockSendRecordUpdateEventHelper).not.toBeCalled(); - expect(savedValue).toEqual(dbValueData); + expect(savedValue[0]).toEqual({...dbValueData, raw_value: dbValueData.value}); }); describe('Metadata', () => { @@ -883,7 +883,7 @@ describe('ValueDomain', () => { meta_attribute: 'metadata value' }); - expect(savedValue.metadata).toMatchObject({ + expect(savedValue[0].metadata).toMatchObject({ meta_attribute: { value: 'metadata value' } @@ -1603,7 +1603,7 @@ describe('ValueDomain', () => { expect(mockValRepo.deleteValue).toBeCalledTimes(0); }); - test('Should throw if unknown library', async function () { + test('Should throw if unknown library', async function() { const values: IValue[] = [ { attribute: 'advanced_attribute', @@ -1635,7 +1635,7 @@ describe('ValueDomain', () => { await expect(saveVal).rejects.toHaveProperty('fields.library'); }); - test('Should throw if the library does not use the attribute', async function () { + test('Should throw if the library does not use the attribute', async function() { const mValidateHelper: Mockify = { validateLibrary: global.__mockPromise(true), validateLibraryAttribute: jest.fn().mockImplementation(() => { @@ -1658,7 +1658,7 @@ describe('ValueDomain', () => { ).rejects.toThrow(); }); - test('Should throw if unknown record', async function () { + test('Should throw if unknown record', async function() { const values: IValue[] = [ { attribute: 'advanced_attribute', @@ -1693,7 +1693,7 @@ describe('ValueDomain', () => { }); describe('deleteValue', () => { - test('Should delete a value', async function () { + test('Should delete a value', async function() { const deletedValueData = {value: 'test val', attribute: 'test_attr'}; const mockValRepo = { @@ -1729,10 +1729,10 @@ describe('ValueDomain', () => { }); expect(mockValRepo.deleteValue.mock.calls.length).toBe(1); - expect(deletedValue).toMatchObject(deletedValueData); + expect(deletedValue[0]).toMatchObject(deletedValueData); }); - test('Should throw if unknown attribute', async function () { + test('Should throw if unknown attribute', async function() { const mockAttrDomain: Mockify = { getAttributeProperties: jest.fn().mockImplementationOnce(id => { throw new ValidationError({id: Errors.UNKNOWN_ATTRIBUTE}); @@ -1755,7 +1755,7 @@ describe('ValueDomain', () => { ).rejects.toThrow(); }); - test('Should throw if unknown library', async function () { + test('Should throw if unknown library', async function() { const mockAttrDomain: Mockify = { getAttributeProperties: global.__mockPromise({...mockAttrSimple}), getAttributes: global.__mockPromise({list: [{id: 'test_attr'}], totalCount: 1}) @@ -1801,7 +1801,7 @@ describe('ValueDomain', () => { await expect(deleteVal).rejects.toHaveProperty('fields.library'); }); - test('Should throw if unknown record', async function () { + test('Should throw if unknown record', async function() { const mockAttrDomain: Mockify = { getAttributeProperties: global.__mockPromise({...mockAttrSimple}), getAttributes: global.__mockPromise({list: [{id: 'test_attr'}], totalCount: 1}) @@ -1846,7 +1846,7 @@ describe('ValueDomain', () => { await expect(deleteVal).rejects.toHaveProperty('fields.recordId'); }); - test('Should throw if unknown value', async function () { + test('Should throw if unknown value', async function() { const mockAttrDomain: Mockify = { getAttributeProperties: global.__mockPromise({...mockAttribute, type: AttributeTypes.ADVANCED}), getLibraryFullTextAttributes: global.__mockPromise([{id: 'id'}]) @@ -1872,7 +1872,7 @@ describe('ValueDomain', () => { }); describe('getValues', () => { - test('Should return values', async function () { + test('Should return values', async function() { const valueData = [{value: 'test val', attribute: 'test_attr'}]; const mockValRepo = { @@ -1907,7 +1907,7 @@ describe('ValueDomain', () => { expect(resValue).toMatchObject(valueData); }); - test('Should return versioned values in simple mode', async function () { + test('Should return versioned values in simple mode', async function() { const version = {my_tree: '12345'}; const valueData = [ { @@ -1951,7 +1951,7 @@ describe('ValueDomain', () => { expect(resValue).toMatchObject(valueData); }); - test('Should return versioned values in smart mode', async function () { + test('Should return versioned values in smart mode', async function() { const valueData = [ { value: 'val1', @@ -2004,7 +2004,7 @@ describe('ValueDomain', () => { expect(resValue[0].version).toMatchObject({my_tree: '8'}); }); - test('Should return versioned values with multiple trees', async function () { + test('Should return versioned values with multiple trees', async function() { const valueData = [ { value: 'val1', @@ -2184,7 +2184,7 @@ describe('ValueDomain', () => { }); }); - test('Should return empty array if no values matching version', async function () { + test('Should return empty array if no values matching version', async function() { const valueData = [ { value: 'val1', @@ -2238,7 +2238,7 @@ describe('ValueDomain', () => { expect(resValue.length).toBe(0); }); - test('Should throw if unknown attribute', async function () { + test('Should throw if unknown attribute', async function() { const mockAttrDomain: Mockify = { getAttributeProperties: jest.fn().mockImplementationOnce(id => { throw new ValidationError({id: Errors.UNKNOWN_ATTRIBUTE}); @@ -2259,7 +2259,7 @@ describe('ValueDomain', () => { ).rejects.toThrow(); }); - test('Should throw if unknown library', async function () { + test('Should throw if unknown library', async function() { const mockValidHelper: Mockify = { validateLibrary: jest.fn().mockImplementation(() => { throw new ValidationError({library: Errors.UNKNOWN_LIBRARY}); @@ -2282,7 +2282,7 @@ describe('ValueDomain', () => { await expect(getVal).rejects.toHaveProperty('fields.library'); }); - test('Should throw if unknown record', async function () { + test('Should throw if unknown record', async function() { const mockValidHelper: Mockify = { validateRecord: jest.fn().mockImplementation(() => { throw new ValidationError({recordId: Errors.UNKNOWN_RECORD}); diff --git a/apps/core/src/domain/value/valueDomain.ts b/apps/core/src/domain/value/valueDomain.ts index 520e67964..556ff8bb2 100644 --- a/apps/core/src/domain/value/valueDomain.ts +++ b/apps/core/src/domain/value/valueDomain.ts @@ -74,6 +74,10 @@ export interface IValueDomain { ctx: IQueryInfos; }): Promise; + /** + * Save value takes one value as parameter, apply all actions that can return multiple values and return them + * @example [inheritance, calculation, etc]. + */ saveValue({ library, recordId, @@ -86,7 +90,7 @@ export interface IValueDomain { attribute: string; value: IValue; ctx: IQueryInfos; - }): Promise; + }): Promise; /** * Save multiple values independently (possibly different attributes or versions). @@ -102,7 +106,7 @@ export interface IValueDomain { keepEmpty?: boolean; }): Promise; - deleteValue(params: IDeleteValueParams): Promise; + deleteValue(params: IDeleteValueParams): Promise; formatValue(params: { attribute: IAttribute; @@ -112,7 +116,7 @@ export interface IValueDomain { ctx: IQueryInfos; }): Promise; - runActionsList(params: IRunActionListParams): Promise; + runActionsList(params: IRunActionListParams): Promise; } interface IDeps { @@ -136,7 +140,7 @@ interface IDeps { 'core.domain.tree'?: ITreeDomain; } -const valueDomain = function ({ +const valueDomain = function({ config = null, 'core.domain.actionsList': actionsListDomain = null, 'core.domain.attribute': attributeDomain = null, @@ -167,33 +171,33 @@ const valueDomain = function ({ */ const _runActionsList: IValueDomain['runActionsList'] = async ({ listName, - value, + values, attribute: attrProps, record, library, ctx }) => { + const valuesToProcess = utils.isStandardAttribute(attrProps) + ? values.map(value => ({...value, raw_value: value.value})) + : values; + try { - const processedValue = await (!!attrProps.actions_list?.[listName] && value !== null - ? actionsListDomain.runActionsList(attrProps.actions_list[listName], value, { - ...ctx, - attribute: attrProps, - recordId: record?.id, - library, - value - }) - : value); - - if (utils.isStandardAttribute(attrProps)) { - (processedValue as IStandardValue).raw_value = value.value; - } - return processedValue; + const processedValues = + !!attrProps.actions_list?.[listName] && values !== null + ? await actionsListDomain.runActionsList(attrProps.actions_list[listName], valuesToProcess, { + ...ctx, + attribute: attrProps, + recordId: record?.id, + library + }) + : valuesToProcess; + return processedValues; } catch (e) { // If ValidationError, add some context about value to the error and throw it again if (e.type === ErrorTypes.VALIDATION_ERROR) { e.context = { attributeId: attrProps.id, - value, + values, recordId: record?.id }; } @@ -201,7 +205,15 @@ const valueDomain = function ({ } }; - const _formatValue = async ({attribute, value, record, library, ctx}) => { + const _formatValue = async ({ + attribute, + value, + ctx + }: { + attribute: IAttribute; + value: IValue; + ctx: IQueryInfos; + }): Promise => { let processedValue = {...value}; // Don't mutate given value const isLinkAttribute = @@ -232,8 +244,6 @@ const valueDomain = function ({ ? await _formatValue({ attribute: metadataAttributeProps, value: {value: value.metadata?.[metadataField]}, - record, - library, ctx }) : null; @@ -351,47 +361,51 @@ const valueDomain = function ({ throw new ValidationError({id: Errors.UNKNOWN_VALUE}); } - const actionsListRes = - !!attributeProps.actions_list && !!attributeProps.actions_list.deleteValue - ? await actionsListDomain.runActionsList(attributeProps.actions_list.deleteValue, existingValue, { - ...ctx, - attribute: attributeProps, - recordId, - library, - value: existingValue - }) - : existingValue; - - const res: IValue = await valueRepo.deleteValue({ - library, - recordId, - attribute: {...attributeProps, reverse_link: reverseLink}, - value: actionsListRes, - ctx - }); + const actionsListRes = !!attributeProps.actions_list?.deleteValue + ? await actionsListDomain.runActionsList(attributeProps.actions_list.deleteValue, [existingValue], { + ...ctx, + attribute: attributeProps, + recordId, + library + }) + : [existingValue]; + + const deletedValues = await Promise.all( + actionsListRes.map(async actionsListResValue => { + const deletedValue = await valueRepo.deleteValue({ + library, + recordId, + attribute: {...attributeProps, reverse_link: reverseLink}, + value: actionsListResValue, + ctx + }); - // Make sure attribute is returned here - res.attribute = attribute; + // Make sure attribute is returned here + deletedValue.attribute = attribute; - await eventsManager.sendDatabaseEvent( - { - action: EventAction.VALUE_DELETE, - topic: { - library, - record: { - id: recordId, - libraryId: library + await eventsManager.sendDatabaseEvent( + { + action: EventAction.VALUE_DELETE, + topic: { + library, + record: { + id: recordId, + libraryId: library + }, + attribute: attributeProps.id + }, + before: actionsListRes }, - attribute: attributeProps.id - }, - before: actionsListRes - }, - ctx - ); + ctx + ); - await sendRecordUpdateEvent({id: recordId, library}, [{attribute, value: actionsListRes}], ctx); + sendRecordUpdateEvent({id: recordId, library}, [{attribute, value: deletedValue}], ctx); - return res; + return deletedValue; + }) + ); + + return deletedValues; }; const _executeSaveValue = async ( @@ -416,11 +430,11 @@ const valueDomain = function ({ const areValuesIdentical = utils.areValuesIdentical(valueBeforeToCheck, value); // If values are identical, don't save it again. Consider DB value as saved value - let savedVal: IValue; + let savedValue: IValue; if (areValuesIdentical) { - savedVal = valueBefore; + savedValue = valueBefore; } else { - savedVal = await saveOneValue( + savedValue = await saveOneValue( library, record.id, attribute, @@ -439,48 +453,52 @@ const valueDomain = function ({ } // Apply actions list and format value before returning it - let processedValue = await _runActionsList({ + let processedValues = await _runActionsList({ listName: ActionsListEvents.GET_VALUE, - value: savedVal, - attribute, - record, - library, - ctx - }); - - processedValue = await _formatValue({ + values: [savedValue], attribute, - value: processedValue, record, library, ctx }); - // Runs actionsList on metadata values as well - if (attribute.metadata_fields?.length && processedValue.metadata) { - for (const metadataField of attribute.metadata_fields) { - if ( - processedValue.metadata[metadataField] === null || - typeof processedValue.metadata[metadataField] === 'undefined' - ) { - continue; - } - - const metadataAttributeProps = await attributeDomain.getAttributeProperties({ - id: metadataField, + processedValues = await Promise.all( + processedValues.map(async processedValue => { + const formattedValue = await _formatValue({ + attribute, + value: processedValue, ctx }); - processedValue.metadata[metadataField] = await _runActionsList({ - listName: ActionsListEvents.GET_VALUE, - value: processedValue.metadata[metadataField] as IStandardValue, - attribute: metadataAttributeProps, - record, - library, - ctx - }); - } - } + // Runs actionsList on metadata values as well + if (attribute.metadata_fields?.length && formattedValue.metadata) { + for (const metadataField of attribute.metadata_fields) { + if ( + formattedValue.metadata[metadataField] === null || + typeof formattedValue.metadata[metadataField] === 'undefined' + ) { + continue; + } + + const metadataAttributeProps = await attributeDomain.getAttributeProperties({ + id: metadataField, + ctx + }); + + const resActionList = await _runActionsList({ + listName: ActionsListEvents.GET_VALUE, + values: [formattedValue.metadata[metadataField] as IStandardValue], + attribute: metadataAttributeProps, + record, + library, + ctx + }); + formattedValue.metadata[metadataField] = resActionList[0]; + } + } + return formattedValue; + }) + ); if (!areValuesIdentical) { await eventsManager.sendDatabaseEvent( @@ -495,13 +513,13 @@ const valueDomain = function ({ attribute: attribute.id }, before: valueBefore, - after: savedVal + after: savedValue }, ctx ); } - return {value: processedValue, areValuesIdentical}; + return {values: processedValues, areValuesIdentical}; }; return { @@ -581,34 +599,18 @@ const valueDomain = function ({ } // Runs actionsList - values = values.length - ? await Promise.all( - values.map(v => - _runActionsList({ - listName: ActionsListEvents.GET_VALUE, - value: v, - attribute: attr, - record: {id: recordId}, - library, - ctx - }) - ) - ) - : [ - // Force running actionsList for actions that generate values (eg. calculation or inheritance) - await _runActionsList({ - listName: ActionsListEvents.GET_VALUE, - value: {value: null}, - attribute: attr, - record: {id: recordId}, - library, - ctx - }) - ].filter(v => v?.value !== null); + const actionsListRes = await _runActionsList({ + listName: ActionsListEvents.GET_VALUE, + values, + attribute: attr, + record: {id: recordId}, + library, + ctx + }); - return values; + return actionsListRes; }, - async saveValue({library, recordId, attribute, value, ctx}): Promise { + async saveValue({library, recordId, attribute, value, ctx}): Promise { await validate.validateLibrary(library, ctx); const attributeProps = await attributeDomain.getAttributeProperties({id: attribute, ctx}); await validate.validateLibraryAttribute(library, attribute, ctx); @@ -663,7 +665,7 @@ const valueDomain = function ({ } // Prepare value - const valueToSave = await prepareValue({ + const valuesToSave = await prepareValue({ ...valueChecksParams, deps: { actionsListDomain, @@ -673,20 +675,32 @@ const valueDomain = function ({ ctx }); - const {value: savedVal, areValuesIdentical} = await _executeSaveValue( - library, - record, - attributeProps, - valueToSave, - ctx - ); + const {allSavedValues, areValuesIdentical} = await valuesToSave.reduce(async (promiseAcc, valueToSave) => { + const acc = await promiseAcc; + const {values: savedValues, areValuesIdentical: identicalValues} = await _executeSaveValue( + library, + record, + attributeProps, + valueToSave, + ctx + ); + + if (!identicalValues) { + acc.areValuesIdentical = false; + } + + acc.allSavedValues.push(...savedValues); + return acc; + }, Promise.resolve({allSavedValues: [], areValuesIdentical: true})); if (!areValuesIdentical) { await updateRecordLastModif(library, recordId, ctx); - sendRecordUpdateEvent(record, [{attribute, value: savedVal}], ctx); + allSavedValues.forEach(async savedValue => { + sendRecordUpdateEvent(record, [{attribute, value: savedValue}], ctx); + }); } - return savedVal; + return allSavedValues; }, async saveValueBatch({library, recordId, values, ctx, keepEmpty = false}): Promise { await validate.validateLibrary(library, ctx); @@ -702,7 +716,7 @@ const valueDomain = function ({ const prevRes = await promPrevRes; try { if (value.value === null && !keepEmpty) { - const deletedVal = await _executeDeleteValue({ + const deletedValues = await _executeDeleteValue({ library, value, recordId, @@ -710,21 +724,13 @@ const valueDomain = function ({ ctx }); - prevRes.values.push(deletedVal); + prevRes.values.push(...deletedValues); return prevRes; } const attributeProps = await attributeDomain.getAttributeProperties({id: value.attribute, ctx}); - let reverseLink: IAttribute; - if (!!attributeProps.reverse_link) { - reverseLink = await attributeDomain.getAttributeProperties({ - id: attributeProps.reverse_link as string, - ctx - }); - } - const valueChecksParams = { attributeProps, library, @@ -773,7 +779,7 @@ const valueDomain = function ({ } // Prepare value - const valToSave = await prepareValue({ + const valuesToSave = await prepareValue({ ...valueChecksParams, deps: { actionsListDomain, @@ -783,18 +789,25 @@ const valueDomain = function ({ ctx }); - const savedVal = - !keepEmpty && !valToSave.value && !!valToSave.id_value - ? await _executeDeleteValue({ - library, - value, - recordId, - attribute: value.attribute, - ctx - }) - : (await _executeSaveValue(library, record, attributeProps, valToSave, ctx)).value; - - prevRes.values.push(savedVal); + const saveResult = await valuesToSave.reduce>(async (acc, valueToSave) => { + const prevAcc = await acc; + const savedValues = + !keepEmpty && !valueToSave.value && !!valueToSave.id_value + ? await _executeDeleteValue({ + library, + value: valueToSave, + recordId, + attribute: valueToSave.attribute, + ctx + }) + : (await _executeSaveValue(library, record, attributeProps, valueToSave, ctx)) + .values; + + prevAcc.push(...savedValues); + return prevAcc; + }, Promise.resolve([])); + + prevRes.values.push(...saveResult); } catch (e) { if ( !e.type || @@ -838,7 +851,7 @@ const valueDomain = function ({ return saveRes; }, - async deleteValue({library, recordId, attribute, value, ctx}): Promise { + async deleteValue({library, recordId, attribute, value, ctx}) { await validate.validateLibrary(library, ctx); await validate.validateRecord(library, recordId, ctx); diff --git a/apps/core/src/locales/en/translation.json b/apps/core/src/locales/en/translation.json index 17295863f..3da216218 100644 --- a/apps/core/src/locales/en/translation.json +++ b/apps/core/src/locales/en/translation.json @@ -9,6 +9,7 @@ "ELEMENT_ALREADY_PRESENT": "Element already present", "ELEMENT_NOT_IN_TREE": "Element {{element}} not present in tree {{tree}}", "ELEMENT_WITH_SAME_PATH_ALREADY_PRESENT": "Element with same path already present", + "ENCRYPT_ERROR": "Encryption error", "ERROR": "Error", "EXCEL_CALCULATION_ERROR": "Excel calculation error: {{error}}. Formula: {{formula}}", "FILE_ERROR": "File read error: {{error}}", @@ -25,7 +26,7 @@ "INVALID_EMAIL": "Invalid email", "INVALID_ENDPOINT_FORMAT": "Invalid endpoint format", "INVALID_FILE_FORMAT": "Invalid file format: {{received}}. Expected format: {{expected}}", - "INVALID_FILTER_CONDITION_VALUE" : "Condition/value filter are not compatible: {{libraries}}", + "INVALID_FILTER_CONDITION_VALUE": "Condition/value filter are not compatible: {{libraries}}", "INVALID_FILTER_FIELDS": "Invalid filter's fields", "INVALID_FILTER_FORMAT": "Filter must have a condition or operator", "INVALID_FILTERS_EXPRESSION": "Invalid Filters expression order", @@ -33,6 +34,7 @@ "INVALID_ID_FORMAT": "Invalid ID format", "INVALID_MAPPING": "Invalid mapping", "INVALID_PERMISSIONS_CONF_LIBRARIES": "These libraries are not bound to the tree", + "INVALID_REGEXP": "Value does not match the regular expression", "INVALID_SORT_FIELDS": "Invalid sort fields", "INVALID_TREE_FILTER_FORMAT": "Classified filter must have condition, value and treeId", "INVALID_URL": "Invalid URL", @@ -50,7 +52,7 @@ "MISSING_REQUIRED_ACTION": "Missing required actions: {{actions}}", "MISSING_TARGET": "Missing target", "MULTIPLE_VALUES_NOT_ALLOWED": "Multiple values not allowed for this attribute type", - "NO_IMPORT_MATCHES" : "Missing import key", + "NO_IMPORT_MATCHES": "Missing import key", "NON_FILES_LIBRARY": "Cannot bind a non-files library", "ONLY_FOLDERS_CAN_BE_SELECTED": "Only folders can be selected", "PAGINATION_OFFSET_AND_CURSOR": "Cannot use offset and cursor at the same time", @@ -232,4 +234,4 @@ "default": { "admin_users_group_label": "Administrators" } -} +} \ No newline at end of file diff --git a/apps/core/src/locales/fr/translation.json b/apps/core/src/locales/fr/translation.json index f318a0881..f831b2fbc 100644 --- a/apps/core/src/locales/fr/translation.json +++ b/apps/core/src/locales/fr/translation.json @@ -9,6 +9,7 @@ "ELEMENT_ALREADY_PRESENT": "Cet élément est déjà présent", "ELEMENT_NOT_IN_TREE": "Élément {{element}} non présent dans l’arbre {{tree}}", "ELEMENT_WITH_SAME_PATH_ALREADY_PRESENT": "Un élement identique avec le même chemin est déjà présent", + "ENCRYPT_ERROR": "Erreur lors de l'encryptage", "ERROR": "Erreur", "EXCEL_CALCULATION_ERROR": "Erreur de calcul Excel: {{error}}. Formule: {{formula}}", "FILE_ERROR": "Erreur lors de la lecture du fichier: {{error}}", @@ -25,7 +26,7 @@ "INVALID_EMAIL": "Email non valide", "INVALID_ENDPOINT_FORMAT": "Format de chemin non valide", "INVALID_FILE_FORMAT": "Format de fichier non valide: {{received}}. Format attendu: {{expected}}", - "INVALID_FILTER_CONDITION_VALUE" : "La condition d'un filtre n'est pas compatible avec sa valeur associée", + "INVALID_FILTER_CONDITION_VALUE": "La condition d'un filtre n'est pas compatible avec sa valeur associée", "INVALID_FILTER_FIELDS": "Les champs d'un filtre ne sont pas valides", "INVALID_FILTER_FORMAT": "Format de filtre non valide: {{reason}}", "INVALID_FILTERS_EXPRESSION": "L'ordre des filtres n'est pas valide", @@ -33,6 +34,7 @@ "INVALID_ID_FORMAT": "Format d'ID non valide", "INVALID_MAPPING": "Mapping incorrect", "INVALID_PERMISSIONS_CONF_LIBRARIES": "Ces bibliothèques ne sont pas liées à cet arbre: {{libraries}}", + "INVALID_REGEXP": "La valeur ne correspond pas à l'expression régulière", "INVALID_SORT_FIELDS": "Les champs de tri ne sont pas valides", "INVALID_TREE_FILTER_FORMAT": "Un filtre sur un arbre doit avoir une condition, un champ et un treeId", "INVALID_URL": "URL non valide", @@ -50,7 +52,7 @@ "MISSING_REQUIRED_ACTION": "Actions requises manquantes: {{actions}}", "MISSING_TARGET": "Cible manquante", "MULTIPLE_VALUES_NOT_ALLOWED": "Valeurs multiples non autorisées sur ce type d'attribut", - "NO_IMPORT_MATCHES" : "Clé d'import manquante", + "NO_IMPORT_MATCHES": "Clé d'import manquante", "NON_FILES_LIBRARY": "Impossible de lier une bibliothèque non-fichiers", "ONLY_FOLDERS_CAN_BE_SELECTED": "Only folders can be selected", "PAGINATION_OFFSET_AND_CURSOR": "Impossible d'utiliser un offset et un curseur en même temps", @@ -94,7 +96,7 @@ "VALUE_NOT_UNIQUE": "Cette valeur a déjà été enregistrée" }, "actions": { - "names" : { + "names": { "encrypt": "Encrypter", "formatDate": "Formater une Date", "formatDateRange": "Formater les dates d'une période", @@ -114,7 +116,7 @@ "inheritanceCalculation": "Héritage", "toUppercase": "Convertir en majuscules" }, - "descriptions" : { + "descriptions": { "encrypt": "Encrypter la valeur", "formatDate": "Convertir un timestamp en format date", "formatDateRange": "Convertir les timestamps en format date", @@ -232,4 +234,4 @@ "default": { "admin_users_group_label": "Administrateurs" } -} +} \ No newline at end of file diff --git a/apps/core/tsconfig.kikoo.json b/apps/core/tsconfig.kikoo.json new file mode 100644 index 000000000..f9d8accf6 --- /dev/null +++ b/apps/core/tsconfig.kikoo.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["jest", "node", "@types/jest"], + "baseUrl": "src", + "outDir": "dist", + "isolatedModules": false, + "typeRoots": ["./src/_types"] + }, + "exclude": [ + "applications", + "**/*.spec.ts", + ] +} \ No newline at end of file diff --git a/apps/data-studio/src/_gqlTypes/index.ts b/apps/data-studio/src/_gqlTypes/index.ts index 37b7e60db..9eb0688f1 100644 --- a/apps/data-studio/src/_gqlTypes/index.ts +++ b/apps/data-studio/src/_gqlTypes/index.ts @@ -1,3962 +1,1127 @@ -// Copyright LEAV Solutions 2017 -// This file is released under LGPL V3 -// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt +import {IPreviewScalar} from '@leav/utils' +import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; -import {gql} from '@apollo/client'; -import {IPreviewScalar} from '@leav/utils'; 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 Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; const defaultOptions = {} as const; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: string; - String: string; - Boolean: boolean; - Int: number; - Float: number; - /** Can be anything */ - Any: any; - /** - * The DateTime scalar type represents time data, - * represented as an ISO-8601 encoded UTC date string. - */ - DateTime: any; - /** - * Object representing the full tree structure. - * On each node we will have record data and children - */ - FullTreeContent: 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: any; - /** The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ - JSONObject: any; - /** Object containing all previews available for a record */ - Preview: IPreviewScalar; - /** System entities fields translation (label...) */ - SystemTranslation: any; - /** System entities fields translation (label...) */ - SystemTranslationOptional: any; - TaskPriority: any; - /** The `Upload` scalar type represents a file upload. */ - Upload: any; + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + /** Can be anything */ + Any: any; + /** + * The DateTime scalar type represents time data, + * represented as an ISO-8601 encoded UTC date string. + */ + DateTime: any; + /** + * Object representing the full tree structure. + * On each node we will have record data and children + */ + FullTreeContent: 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: any; + /** The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ + JSONObject: any; + /** Object containing all previews available for a record */ + Preview: IPreviewScalar; + /** System entities fields translation (label...) */ + SystemTranslation: any; + /** System entities fields translation (label...) */ + SystemTranslationOptional: any; + TaskPriority: any; + /** The `Upload` scalar type represents a file upload. */ + Upload: any; }; export type ActionConfigurationInput = { - error_message?: InputMaybe; - id: Scalars['ID']; - params?: InputMaybe>; + error_message?: InputMaybe; + id: Scalars['ID']; + params?: InputMaybe>; }; export type ActionConfigurationParamInput = { - name: Scalars['String']; - value: Scalars['String']; + name: Scalars['String']; + value: Scalars['String']; }; export enum ActionIoTypes { - boolean = 'boolean', - number = 'number', - object = 'object', - string = 'string' + boolean = 'boolean', + number = 'number', + object = 'object', + string = 'string' } export type ActionsListConfigurationInput = { - deleteValue?: InputMaybe>; - getValue?: InputMaybe>; - saveValue?: InputMaybe>; + deleteValue?: InputMaybe>; + getValue?: InputMaybe>; + saveValue?: InputMaybe>; }; export type ApiKeyInput = { - expiresAt?: InputMaybe; - id?: InputMaybe; - label: Scalars['String']; - userId: Scalars['String']; + expiresAt?: InputMaybe; + id?: InputMaybe; + label: Scalars['String']; + userId: Scalars['String']; }; export type ApiKeysFiltersInput = { - createdBy?: InputMaybe; - label?: InputMaybe; - modifiedBy?: InputMaybe; - user_id?: InputMaybe; + createdBy?: InputMaybe; + label?: InputMaybe; + modifiedBy?: InputMaybe; + user_id?: InputMaybe; }; export enum ApiKeysSortableFields { - createdAt = 'createdAt', - createdBy = 'createdBy', - expiresAt = 'expiresAt', - label = 'label', - modifiedAt = 'modifiedAt', - modifiedBy = 'modifiedBy' + createdAt = 'createdAt', + createdBy = 'createdBy', + expiresAt = 'expiresAt', + label = 'label', + modifiedAt = 'modifiedAt', + modifiedBy = 'modifiedBy' } export type ApplicationEventFiltersInput = { - applicationId?: InputMaybe; - events?: InputMaybe>; - ignoreOwnEvents?: InputMaybe; + applicationId?: InputMaybe; + events?: InputMaybe>; + ignoreOwnEvents?: InputMaybe; }; export enum ApplicationEventTypes { - DELETE = 'DELETE', - SAVE = 'SAVE' + DELETE = 'DELETE', + SAVE = 'SAVE' } export type ApplicationIconInput = { - libraryId: Scalars['String']; - recordId: Scalars['String']; + libraryId: Scalars['String']; + recordId: Scalars['String']; }; export type ApplicationInput = { - color?: InputMaybe; - description?: InputMaybe; - endpoint?: InputMaybe; - icon?: InputMaybe; - id: Scalars['ID']; - label?: InputMaybe; - module?: InputMaybe; - settings?: InputMaybe; - type?: InputMaybe; + color?: InputMaybe; + description?: InputMaybe; + endpoint?: InputMaybe; + icon?: InputMaybe; + id: Scalars['ID']; + label?: InputMaybe; + module?: InputMaybe; + settings?: InputMaybe; + type?: InputMaybe; }; export enum ApplicationSortableFields { - endpoint = 'endpoint', - id = 'id', - module = 'module', - system = 'system', - type = 'type' + endpoint = 'endpoint', + id = 'id', + module = 'module', + system = 'system', + type = 'type' } export enum ApplicationType { - external = 'external', - internal = 'internal' + external = 'external', + internal = 'internal' } export type ApplicationsFiltersInput = { - endpoint?: InputMaybe; - id?: InputMaybe; - label?: InputMaybe; - module?: InputMaybe; - system?: InputMaybe; - type?: InputMaybe>>; + endpoint?: InputMaybe; + id?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + system?: InputMaybe; + type?: InputMaybe>>; }; export enum AttributeFormat { - boolean = 'boolean', - color = 'color', - date = 'date', - date_range = 'date_range', - encrypted = 'encrypted', - extended = 'extended', - numeric = 'numeric', - rich_text = 'rich_text', - text = 'text' + boolean = 'boolean', + color = 'color', + date = 'date', + date_range = 'date_range', + encrypted = 'encrypted', + extended = 'extended', + numeric = 'numeric', + rich_text = 'rich_text', + text = 'text' } export type AttributeInput = { - actions_list?: InputMaybe; - description?: InputMaybe; - embedded_fields?: InputMaybe>>; - format?: InputMaybe; - id: Scalars['ID']; - label?: InputMaybe; - linked_library?: InputMaybe; - linked_tree?: InputMaybe; - metadata_fields?: InputMaybe>; - multiple_values?: InputMaybe; - permissions_conf?: InputMaybe; - readonly?: InputMaybe; - reverse_link?: InputMaybe; - type?: InputMaybe; - unique?: InputMaybe; - values_list?: InputMaybe; - versions_conf?: InputMaybe; + actions_list?: InputMaybe; + description?: InputMaybe; + embedded_fields?: InputMaybe>>; + format?: InputMaybe; + id: Scalars['ID']; + label?: InputMaybe; + linked_library?: InputMaybe; + linked_tree?: InputMaybe; + maxLength?: InputMaybe; + metadata_fields?: InputMaybe>; + multiple_values?: InputMaybe; + permissions_conf?: InputMaybe; + readonly?: InputMaybe; + reverse_link?: InputMaybe; + type?: InputMaybe; + unique?: InputMaybe; + values_list?: InputMaybe; + versions_conf?: InputMaybe; }; export type AttributePermissionsRecord = { - id?: InputMaybe; - library: Scalars['String']; + id?: InputMaybe; + library: Scalars['String']; }; export enum AttributeType { - advanced = 'advanced', - advanced_link = 'advanced_link', - simple = 'simple', - simple_link = 'simple_link', - tree = 'tree' + advanced = 'advanced', + advanced_link = 'advanced_link', + simple = 'simple', + simple_link = 'simple_link', + tree = 'tree' } export type AttributesFiltersInput = { - format?: InputMaybe>>; - id?: InputMaybe; - label?: InputMaybe; - libraries?: InputMaybe>>; - multiple_values?: InputMaybe; - system?: InputMaybe; - type?: InputMaybe>>; - versionable?: InputMaybe; + format?: InputMaybe>>; + id?: InputMaybe; + label?: InputMaybe; + libraries?: InputMaybe>>; + librariesExcluded?: InputMaybe>>; + multiple_values?: InputMaybe; + system?: InputMaybe; + type?: InputMaybe>>; + versionable?: InputMaybe; }; export enum AttributesSortableFields { - format = 'format', - id = 'id', - linked_library = 'linked_library', - linked_tree = 'linked_tree', - multiple_values = 'multiple_values', - type = 'type' + format = 'format', + id = 'id', + linked_library = 'linked_library', + linked_tree = 'linked_tree', + multiple_values = 'multiple_values', + type = 'type' } export enum AvailableLanguage { - en = 'en', - fr = 'fr' + en = 'en', + fr = 'fr' } export type CreateRecordDataInput = { - values?: InputMaybe>; - version?: InputMaybe>; + values?: InputMaybe>; + version?: InputMaybe>; }; export type DeleteTaskInput = { - archive: Scalars['Boolean']; - id: Scalars['ID']; + archive: Scalars['Boolean']; + id: Scalars['ID']; }; export type EmbeddedAttributeInput = { - description?: InputMaybe; - embedded_fields?: InputMaybe>>; - format?: InputMaybe; - id: Scalars['ID']; - label?: InputMaybe; - validation_regex?: InputMaybe; + description?: InputMaybe; + embedded_fields?: InputMaybe>>; + format?: InputMaybe; + id: Scalars['ID']; + label?: InputMaybe; + validation_regex?: InputMaybe; }; export type FileInput = { - data: Scalars['Upload']; - replace?: InputMaybe; - size?: InputMaybe; - uid: Scalars['String']; + data: Scalars['Upload']; + replace?: InputMaybe; + size?: InputMaybe; + uid: Scalars['String']; }; export enum FileType { - audio = 'audio', - document = 'document', - image = 'image', - other = 'other', - video = 'video' + audio = 'audio', + document = 'document', + image = 'image', + other = 'other', + video = 'video' } export type FormDependencyValueInput = { - attribute: Scalars['ID']; - value: Scalars['ID']; + attribute: Scalars['ID']; + value: Scalars['ID']; }; export type FormElementInput = { - containerId: Scalars['ID']; - id: Scalars['ID']; - order: Scalars['Int']; - settings: Array; - type: FormElementTypes; - uiElementType: Scalars['String']; + containerId: Scalars['ID']; + id: Scalars['ID']; + order: Scalars['Int']; + settings: Array; + type: FormElementTypes; + uiElementType: Scalars['String']; }; export type FormElementSettingsInput = { - key: Scalars['String']; - value: Scalars['Any']; + key: Scalars['String']; + value: Scalars['Any']; }; export enum FormElementTypes { - field = 'field', - layout = 'layout' + field = 'field', + layout = 'layout' } export type FormElementsByDepsInput = { - dependencyValue?: InputMaybe; - elements: Array; + dependencyValue?: InputMaybe; + elements: Array; }; export type FormFiltersInput = { - id?: InputMaybe; - label?: InputMaybe; - library: Scalars['ID']; - system?: InputMaybe; + id?: InputMaybe; + label?: InputMaybe; + library: Scalars['ID']; + system?: InputMaybe; }; export type FormInput = { - dependencyAttributes?: InputMaybe>; - elements?: InputMaybe>; - id: Scalars['ID']; - label?: InputMaybe; - library: Scalars['ID']; + dependencyAttributes?: InputMaybe>; + elements?: InputMaybe>; + id: Scalars['ID']; + label?: InputMaybe; + library: Scalars['ID']; }; export enum FormsSortableFields { - id = 'id', - library = 'library', - system = 'system' + id = 'id', + library = 'library', + system = 'system' } export type GlobalSettingsIconInput = { - library: Scalars['String']; - recordId: Scalars['String']; + library: Scalars['String']; + recordId: Scalars['String']; }; export type GlobalSettingsInput = { - icon?: InputMaybe; - name?: InputMaybe; + icon?: InputMaybe; + name?: InputMaybe; }; export enum IoTypes { - boolean = 'boolean', - number = 'number', - object = 'object', - string = 'string' + boolean = 'boolean', + number = 'number', + object = 'object', + string = 'string' } export enum ImportMode { - insert = 'insert', - update = 'update', - upsert = 'upsert' + insert = 'insert', + update = 'update', + upsert = 'upsert' } export enum ImportType { - IGNORE = 'IGNORE', - LINK = 'LINK', - STANDARD = 'STANDARD' + IGNORE = 'IGNORE', + LINK = 'LINK', + STANDARD = 'STANDARD' } export enum InfoChannel { - passive = 'passive', - trigger = 'trigger' + passive = 'passive', + trigger = 'trigger' } export enum InfoPriority { - high = 'high', - low = 'low', - medium = 'medium' + high = 'high', + low = 'low', + medium = 'medium' } export enum InfoType { - basic = 'basic', - error = 'error', - success = 'success', - warning = 'warning' + basic = 'basic', + error = 'error', + success = 'success', + warning = 'warning' } export type LibrariesFiltersInput = { - behavior?: InputMaybe>; - id?: InputMaybe>; - label?: InputMaybe>; - system?: InputMaybe; + behavior?: InputMaybe>; + id?: InputMaybe>; + label?: InputMaybe>; + system?: InputMaybe; }; export enum LibrariesSortableFields { - behavior = 'behavior', - id = 'id', - system = 'system' + behavior = 'behavior', + id = 'id', + system = 'system' } export enum LibraryBehavior { - directories = 'directories', - files = 'files', - standard = 'standard' + directories = 'directories', + files = 'files', + standard = 'standard' } export type LibraryIconInput = { - libraryId: Scalars['String']; - recordId: Scalars['String']; + libraryId: Scalars['String']; + recordId: Scalars['String']; }; export type LibraryInput = { - attributes?: InputMaybe>; - behavior?: InputMaybe; - defaultView?: InputMaybe; - fullTextAttributes?: InputMaybe>; - icon?: InputMaybe; - id: Scalars['ID']; - label?: InputMaybe; - permissions_conf?: InputMaybe; - previewsSettings?: InputMaybe>; - recordIdentityConf?: InputMaybe; + attributes?: InputMaybe>; + behavior?: InputMaybe; + defaultView?: InputMaybe; + fullTextAttributes?: InputMaybe>; + icon?: InputMaybe; + id: Scalars['ID']; + label?: InputMaybe; + permissions_conf?: InputMaybe; + previewsSettings?: InputMaybe>; + recordIdentityConf?: InputMaybe; }; export type LibraryPreviewsSettingsInput = { - description?: InputMaybe; - label: Scalars['SystemTranslation']; - versions: PreviewVersionInput; + description?: InputMaybe; + label: Scalars['SystemTranslation']; + versions: PreviewVersionInput; }; export enum LogAction { - API_KEY_DELETE = 'API_KEY_DELETE', - API_KEY_SAVE = 'API_KEY_SAVE', - APP_DELETE = 'APP_DELETE', - APP_SAVE = 'APP_SAVE', - ATTRIBUTE_DELETE = 'ATTRIBUTE_DELETE', - ATTRIBUTE_SAVE = 'ATTRIBUTE_SAVE', - CONFIG_IMPORT_END = 'CONFIG_IMPORT_END', - CONFIG_IMPORT_START = 'CONFIG_IMPORT_START', - DATA_IMPORT_END = 'DATA_IMPORT_END', - DATA_IMPORT_START = 'DATA_IMPORT_START', - EXPORT_END = 'EXPORT_END', - EXPORT_START = 'EXPORT_START', - GLOBAL_SETTINGS_SAVE = 'GLOBAL_SETTINGS_SAVE', - LIBRARY_DELETE = 'LIBRARY_DELETE', - LIBRARY_PURGE = 'LIBRARY_PURGE', - LIBRARY_SAVE = 'LIBRARY_SAVE', - PERMISSION_SAVE = 'PERMISSION_SAVE', - RECORD_DELETE = 'RECORD_DELETE', - RECORD_SAVE = 'RECORD_SAVE', - TASKS_DELETE = 'TASKS_DELETE', - TREE_ADD_ELEMENT = 'TREE_ADD_ELEMENT', - TREE_DELETE = 'TREE_DELETE', - TREE_DELETE_ELEMENT = 'TREE_DELETE_ELEMENT', - TREE_MOVE_ELEMENT = 'TREE_MOVE_ELEMENT', - TREE_SAVE = 'TREE_SAVE', - VALUE_DELETE = 'VALUE_DELETE', - VALUE_SAVE = 'VALUE_SAVE', - VERSION_PROFILE_DELETE = 'VERSION_PROFILE_DELETE', - VERSION_PROFILE_SAVE = 'VERSION_PROFILE_SAVE' + API_KEY_DELETE = 'API_KEY_DELETE', + API_KEY_SAVE = 'API_KEY_SAVE', + APP_DELETE = 'APP_DELETE', + APP_SAVE = 'APP_SAVE', + ATTRIBUTE_DELETE = 'ATTRIBUTE_DELETE', + ATTRIBUTE_SAVE = 'ATTRIBUTE_SAVE', + CONFIG_IMPORT_END = 'CONFIG_IMPORT_END', + CONFIG_IMPORT_START = 'CONFIG_IMPORT_START', + DATA_IMPORT_END = 'DATA_IMPORT_END', + DATA_IMPORT_START = 'DATA_IMPORT_START', + EXPORT_END = 'EXPORT_END', + EXPORT_START = 'EXPORT_START', + GLOBAL_SETTINGS_SAVE = 'GLOBAL_SETTINGS_SAVE', + LIBRARY_DELETE = 'LIBRARY_DELETE', + LIBRARY_PURGE = 'LIBRARY_PURGE', + LIBRARY_SAVE = 'LIBRARY_SAVE', + PERMISSION_SAVE = 'PERMISSION_SAVE', + RECORD_DELETE = 'RECORD_DELETE', + RECORD_SAVE = 'RECORD_SAVE', + TASKS_DELETE = 'TASKS_DELETE', + TREE_ADD_ELEMENT = 'TREE_ADD_ELEMENT', + TREE_DELETE = 'TREE_DELETE', + TREE_DELETE_ELEMENT = 'TREE_DELETE_ELEMENT', + TREE_MOVE_ELEMENT = 'TREE_MOVE_ELEMENT', + TREE_SAVE = 'TREE_SAVE', + VALUE_DELETE = 'VALUE_DELETE', + VALUE_SAVE = 'VALUE_SAVE', + VERSION_PROFILE_DELETE = 'VERSION_PROFILE_DELETE', + VERSION_PROFILE_SAVE = 'VERSION_PROFILE_SAVE' } export type LogFilterInput = { - action?: InputMaybe; - instanceId?: InputMaybe; - queryId?: InputMaybe; - time?: InputMaybe; - topic?: InputMaybe; - trigger?: InputMaybe; - userId?: InputMaybe; + actions?: InputMaybe>; + instanceId?: InputMaybe; + queryId?: InputMaybe; + time?: InputMaybe; + topic?: InputMaybe; + trigger?: InputMaybe; + userId?: InputMaybe; }; export type LogFilterTimeInput = { - from?: InputMaybe; - to?: InputMaybe; + from?: InputMaybe; + to?: InputMaybe; }; export type LogSortInput = { - field: LogSortableField; - order: SortOrder; + field: LogSortableField; + order: SortOrder; }; export enum LogSortableField { - action = 'action', - instanceId = 'instanceId', - queryId = 'queryId', - time = 'time', - trigger = 'trigger', - userId = 'userId' + action = 'action', + instanceId = 'instanceId', + queryId = 'queryId', + time = 'time', + trigger = 'trigger', + userId = 'userId' } export type LogTopicFilterInput = { - apiKey?: InputMaybe; - attribute?: InputMaybe; - filename?: InputMaybe; - library?: InputMaybe; - permission?: InputMaybe; - profile?: InputMaybe; - record?: InputMaybe; - tree?: InputMaybe; + apiKey?: InputMaybe; + attribute?: InputMaybe; + filename?: InputMaybe; + library?: InputMaybe; + permission?: InputMaybe; + profile?: InputMaybe; + record?: InputMaybe; + tree?: InputMaybe; }; export type LogTopicPermissionFilterInput = { - applyTo?: InputMaybe; - type?: InputMaybe; + applyTo?: InputMaybe; + type?: InputMaybe; }; export type LogTopicRecordFilterInput = { - id?: InputMaybe; - libraryId?: InputMaybe; + id?: InputMaybe; + libraryId?: InputMaybe; }; export type Pagination = { - limit: Scalars['Int']; - offset: Scalars['Int']; + limit: Scalars['Int']; + offset: Scalars['Int']; }; export type PermissionActionInput = { - allowed?: InputMaybe; - name: PermissionsActions; + allowed?: InputMaybe; + name: PermissionsActions; }; export type PermissionInput = { - actions: Array; - applyTo?: InputMaybe; - permissionTreeTarget?: InputMaybe; - type: PermissionTypes; - usersGroup?: InputMaybe; + actions: Array; + applyTo?: InputMaybe; + permissionTreeTarget?: InputMaybe; + type: PermissionTypes; + usersGroup?: InputMaybe; }; export type PermissionTarget = { - attributeId?: InputMaybe; - libraryId?: InputMaybe; - nodeId?: InputMaybe; - recordId?: InputMaybe; + attributeId?: InputMaybe; + libraryId?: InputMaybe; + nodeId?: InputMaybe; + recordId?: InputMaybe; }; export enum PermissionTypes { - admin = 'admin', - application = 'application', - attribute = 'attribute', - library = 'library', - record = 'record', - record_attribute = 'record_attribute', - tree = 'tree', - tree_library = 'tree_library', - tree_node = 'tree_node' + admin = 'admin', + application = 'application', + attribute = 'attribute', + library = 'library', + record = 'record', + record_attribute = 'record_attribute', + tree = 'tree', + tree_library = 'tree_library', + tree_node = 'tree_node' } export enum PermissionsActions { - access_application = 'access_application', - access_attribute = 'access_attribute', - access_library = 'access_library', - access_record = 'access_record', - access_tree = 'access_tree', - admin_access_api_keys = 'admin_access_api_keys', - admin_access_applications = 'admin_access_applications', - admin_access_attributes = 'admin_access_attributes', - admin_access_libraries = 'admin_access_libraries', - admin_access_permissions = 'admin_access_permissions', - admin_access_tasks = 'admin_access_tasks', - admin_access_trees = 'admin_access_trees', - admin_access_version_profiles = 'admin_access_version_profiles', - admin_application = 'admin_application', - admin_cancel_task = 'admin_cancel_task', - admin_create_api_key = 'admin_create_api_key', - admin_create_application = 'admin_create_application', - admin_create_attribute = 'admin_create_attribute', - admin_create_library = 'admin_create_library', - admin_create_tree = 'admin_create_tree', - admin_create_version_profile = 'admin_create_version_profile', - admin_delete_api_key = 'admin_delete_api_key', - admin_delete_application = 'admin_delete_application', - admin_delete_attribute = 'admin_delete_attribute', - admin_delete_library = 'admin_delete_library', - admin_delete_task = 'admin_delete_task', - admin_delete_tree = 'admin_delete_tree', - admin_delete_version_profile = 'admin_delete_version_profile', - admin_edit_api_key = 'admin_edit_api_key', - admin_edit_application = 'admin_edit_application', - admin_edit_attribute = 'admin_edit_attribute', - admin_edit_global_settings = 'admin_edit_global_settings', - admin_edit_library = 'admin_edit_library', - admin_edit_permission = 'admin_edit_permission', - admin_edit_tree = 'admin_edit_tree', - admin_edit_version_profile = 'admin_edit_version_profile', - admin_library = 'admin_library', - admin_manage_global_preferences = 'admin_manage_global_preferences', - create_record = 'create_record', - delete_record = 'delete_record', - detach = 'detach', - edit_children = 'edit_children', - edit_record = 'edit_record', - edit_value = 'edit_value' + access_application = 'access_application', + access_attribute = 'access_attribute', + access_library = 'access_library', + access_record = 'access_record', + access_tree = 'access_tree', + admin_access_api_keys = 'admin_access_api_keys', + admin_access_applications = 'admin_access_applications', + admin_access_attributes = 'admin_access_attributes', + admin_access_libraries = 'admin_access_libraries', + admin_access_permissions = 'admin_access_permissions', + admin_access_tasks = 'admin_access_tasks', + admin_access_trees = 'admin_access_trees', + admin_access_version_profiles = 'admin_access_version_profiles', + admin_application = 'admin_application', + admin_cancel_task = 'admin_cancel_task', + admin_create_api_key = 'admin_create_api_key', + admin_create_application = 'admin_create_application', + admin_create_attribute = 'admin_create_attribute', + admin_create_library = 'admin_create_library', + admin_create_tree = 'admin_create_tree', + admin_create_version_profile = 'admin_create_version_profile', + admin_delete_api_key = 'admin_delete_api_key', + admin_delete_application = 'admin_delete_application', + admin_delete_attribute = 'admin_delete_attribute', + admin_delete_library = 'admin_delete_library', + admin_delete_task = 'admin_delete_task', + admin_delete_tree = 'admin_delete_tree', + admin_delete_version_profile = 'admin_delete_version_profile', + admin_edit_api_key = 'admin_edit_api_key', + admin_edit_application = 'admin_edit_application', + admin_edit_attribute = 'admin_edit_attribute', + admin_edit_global_settings = 'admin_edit_global_settings', + admin_edit_library = 'admin_edit_library', + admin_edit_permission = 'admin_edit_permission', + admin_edit_tree = 'admin_edit_tree', + admin_edit_version_profile = 'admin_edit_version_profile', + admin_library = 'admin_library', + admin_manage_global_preferences = 'admin_manage_global_preferences', + create_record = 'create_record', + delete_record = 'delete_record', + detach = 'detach', + edit_children = 'edit_children', + edit_record = 'edit_record', + edit_value = 'edit_value' } export enum PermissionsRelation { - and = 'and', - or = 'or' + and = 'and', + or = 'or' } export type PermissionsTreeTargetInput = { - nodeId?: InputMaybe; - tree: Scalars['ID']; + nodeId?: InputMaybe; + tree: Scalars['ID']; }; export type PreviewVersionInput = { - background: Scalars['String']; - density: Scalars['Int']; - sizes: Array; + background: Scalars['String']; + density: Scalars['Int']; + sizes: Array; }; export type PreviewVersionSizeInput = { - name: Scalars['String']; - size: Scalars['Int']; + name: Scalars['String']; + size: Scalars['Int']; }; export enum RecordFilterCondition { - BEGIN_WITH = 'BEGIN_WITH', - BETWEEN = 'BETWEEN', - CLASSIFIED_IN = 'CLASSIFIED_IN', - CONTAINS = 'CONTAINS', - END_AFTER = 'END_AFTER', - END_BEFORE = 'END_BEFORE', - END_ON = 'END_ON', - END_WITH = 'END_WITH', - EQUAL = 'EQUAL', - GREATER_THAN = 'GREATER_THAN', - IS_EMPTY = 'IS_EMPTY', - IS_NOT_EMPTY = 'IS_NOT_EMPTY', - LAST_MONTH = 'LAST_MONTH', - LESS_THAN = 'LESS_THAN', - NEXT_MONTH = 'NEXT_MONTH', - NOT_CLASSIFIED_IN = 'NOT_CLASSIFIED_IN', - NOT_CONTAINS = 'NOT_CONTAINS', - NOT_EQUAL = 'NOT_EQUAL', - START_AFTER = 'START_AFTER', - START_BEFORE = 'START_BEFORE', - START_ON = 'START_ON', - TODAY = 'TODAY', - TOMORROW = 'TOMORROW', - VALUES_COUNT_EQUAL = 'VALUES_COUNT_EQUAL', - VALUES_COUNT_GREATER_THAN = 'VALUES_COUNT_GREATER_THAN', - VALUES_COUNT_LOWER_THAN = 'VALUES_COUNT_LOWER_THAN', - YESTERDAY = 'YESTERDAY' + BEGIN_WITH = 'BEGIN_WITH', + BETWEEN = 'BETWEEN', + CLASSIFIED_IN = 'CLASSIFIED_IN', + CONTAINS = 'CONTAINS', + END_AFTER = 'END_AFTER', + END_BEFORE = 'END_BEFORE', + END_ON = 'END_ON', + END_WITH = 'END_WITH', + EQUAL = 'EQUAL', + GREATER_THAN = 'GREATER_THAN', + IS_EMPTY = 'IS_EMPTY', + IS_NOT_EMPTY = 'IS_NOT_EMPTY', + LAST_MONTH = 'LAST_MONTH', + LESS_THAN = 'LESS_THAN', + NEXT_MONTH = 'NEXT_MONTH', + NOT_CLASSIFIED_IN = 'NOT_CLASSIFIED_IN', + NOT_CONTAINS = 'NOT_CONTAINS', + NOT_EQUAL = 'NOT_EQUAL', + START_AFTER = 'START_AFTER', + START_BEFORE = 'START_BEFORE', + START_ON = 'START_ON', + TODAY = 'TODAY', + TOMORROW = 'TOMORROW', + VALUES_COUNT_EQUAL = 'VALUES_COUNT_EQUAL', + VALUES_COUNT_GREATER_THAN = 'VALUES_COUNT_GREATER_THAN', + VALUES_COUNT_LOWER_THAN = 'VALUES_COUNT_LOWER_THAN', + YESTERDAY = 'YESTERDAY' } export type RecordFilterInput = { - condition?: InputMaybe; - field?: InputMaybe; - operator?: InputMaybe; - treeId?: InputMaybe; - value?: InputMaybe; + condition?: InputMaybe; + field?: InputMaybe; + operator?: InputMaybe; + treeId?: InputMaybe; + value?: InputMaybe; }; export enum RecordFilterOperator { - AND = 'AND', - CLOSE_BRACKET = 'CLOSE_BRACKET', - OPEN_BRACKET = 'OPEN_BRACKET', - OR = 'OR' + AND = 'AND', + CLOSE_BRACKET = 'CLOSE_BRACKET', + OPEN_BRACKET = 'OPEN_BRACKET', + OR = 'OR' } export type RecordIdentityConfInput = { - color?: InputMaybe; - label?: InputMaybe; - preview?: InputMaybe; - subLabel?: InputMaybe; - treeColorPreview?: InputMaybe; + color?: InputMaybe; + label?: InputMaybe; + preview?: InputMaybe; + subLabel?: InputMaybe; + treeColorPreview?: InputMaybe; }; export type RecordInput = { - id: Scalars['ID']; - library: Scalars['String']; + id: Scalars['ID']; + library: Scalars['String']; }; export type RecordSortInput = { - field: Scalars['String']; - order: SortOrder; + field: Scalars['String']; + order: SortOrder; }; export type RecordUpdateFilterInput = { - ignoreOwnEvents?: InputMaybe; - libraries?: InputMaybe>; - records?: InputMaybe>; + ignoreOwnEvents?: InputMaybe; + libraries?: InputMaybe>; + records?: InputMaybe>; }; export type RecordsPagination = { - cursor?: InputMaybe; - limit: Scalars['Int']; - offset?: InputMaybe; + cursor?: InputMaybe; + limit: Scalars['Int']; + offset?: InputMaybe; }; export type SheetInput = { - keyIndex?: InputMaybe; - keyToIndex?: InputMaybe; - library: Scalars['String']; - linkAttribute?: InputMaybe; - mapping?: InputMaybe>>; - mode: ImportMode; - treeLinkLibrary?: InputMaybe; - type: ImportType; + keyIndex?: InputMaybe; + keyToIndex?: InputMaybe; + library: Scalars['String']; + linkAttribute?: InputMaybe; + mapping?: InputMaybe>>; + mode: ImportMode; + treeLinkLibrary?: InputMaybe; + type: ImportType; }; export type SortApiKeysInput = { - field: ApiKeysSortableFields; - order?: InputMaybe; + field: ApiKeysSortableFields; + order?: InputMaybe; }; export type SortApplications = { - field: ApplicationSortableFields; - order?: InputMaybe; + field: ApplicationSortableFields; + order?: InputMaybe; }; export type SortAttributes = { - field: AttributesSortableFields; - order?: InputMaybe; + field: AttributesSortableFields; + order?: InputMaybe; }; export type SortForms = { - field: FormsSortableFields; - order?: InputMaybe; + field: FormsSortableFields; + order?: InputMaybe; }; export type SortLibraries = { - field: LibrariesSortableFields; - order?: InputMaybe; + field: LibrariesSortableFields; + order?: InputMaybe; }; export enum SortOrder { - asc = 'asc', - desc = 'desc' + asc = 'asc', + desc = 'desc' } export type SortTrees = { - field: TreesSortableFields; - order?: InputMaybe; + field: TreesSortableFields; + order?: InputMaybe; }; export type SortVersionProfilesInput = { - field: VersionProfilesSortableFields; - order?: InputMaybe; + field: VersionProfilesSortableFields; + order?: InputMaybe; }; export type TaskFiltersInput = { - archive?: InputMaybe; - created_by?: InputMaybe; - id?: InputMaybe; - status?: InputMaybe; - type?: InputMaybe; + archive?: InputMaybe; + created_by?: InputMaybe; + id?: InputMaybe; + status?: InputMaybe; + type?: InputMaybe; }; export enum TaskStatus { - CANCELED = 'CANCELED', - CREATED = 'CREATED', - DONE = 'DONE', - FAILED = 'FAILED', - PENDING = 'PENDING', - PENDING_CANCEL = 'PENDING_CANCEL', - RUNNING = 'RUNNING' + CANCELED = 'CANCELED', + CREATED = 'CREATED', + DONE = 'DONE', + FAILED = 'FAILED', + PENDING = 'PENDING', + PENDING_CANCEL = 'PENDING_CANCEL', + RUNNING = 'RUNNING' } export enum TaskType { - EXPORT = 'EXPORT', - IMPORT_CONFIG = 'IMPORT_CONFIG', - IMPORT_DATA = 'IMPORT_DATA', - INDEXATION = 'INDEXATION' + EXPORT = 'EXPORT', + IMPORT_CONFIG = 'IMPORT_CONFIG', + IMPORT_DATA = 'IMPORT_DATA', + INDEXATION = 'INDEXATION' } export enum TreeBehavior { - files = 'files', - standard = 'standard' + files = 'files', + standard = 'standard' } export type TreeElementInput = { - id: Scalars['ID']; - library: Scalars['String']; + id: Scalars['ID']; + library: Scalars['String']; }; export type TreeEventFiltersInput = { - events?: InputMaybe>; - ignoreOwnEvents?: InputMaybe; - nodes?: InputMaybe>>; - treeId: Scalars['ID']; + events?: InputMaybe>; + ignoreOwnEvents?: InputMaybe; + nodes?: InputMaybe>>; + treeId: Scalars['ID']; }; export enum TreeEventTypes { - add = 'add', - move = 'move', - remove = 'remove' + add = 'add', + move = 'move', + remove = 'remove' } export type TreeInput = { - behavior?: InputMaybe; - id: Scalars['ID']; - label?: InputMaybe; - libraries?: InputMaybe>; - permissions_conf?: InputMaybe>; + behavior?: InputMaybe; + id: Scalars['ID']; + label?: InputMaybe; + libraries?: InputMaybe>; + permissions_conf?: InputMaybe>; }; export type TreeLibraryInput = { - library: Scalars['ID']; - settings: TreeLibrarySettingsInput; + library: Scalars['ID']; + settings: TreeLibrarySettingsInput; }; export type TreeLibrarySettingsInput = { - allowMultiplePositions: Scalars['Boolean']; - allowedAtRoot: Scalars['Boolean']; - allowedChildren: Array; + allowMultiplePositions: Scalars['Boolean']; + allowedAtRoot: Scalars['Boolean']; + allowedChildren: Array; }; export type TreeNodePermissionsConfInput = { - libraryId: Scalars['ID']; - permissionsConf: TreepermissionsConfInput; + libraryId: Scalars['ID']; + permissionsConf: TreepermissionsConfInput; }; export type TreepermissionsConfInput = { - permissionTreeAttributes: Array; - relation: PermissionsRelation; + permissionTreeAttributes: Array; + relation: PermissionsRelation; }; export type TreesFiltersInput = { - behavior?: InputMaybe; - id?: InputMaybe>; - label?: InputMaybe>; - library?: InputMaybe; - system?: InputMaybe; + behavior?: InputMaybe; + id?: InputMaybe>; + label?: InputMaybe>; + library?: InputMaybe; + system?: InputMaybe; }; export enum TreesSortableFields { - behavior = 'behavior', - id = 'id', - system = 'system' + behavior = 'behavior', + id = 'id', + system = 'system' } export type UploadFiltersInput = { - uid?: InputMaybe; - userId?: InputMaybe; + uid?: InputMaybe; + userId?: InputMaybe; }; export enum UserCoreDataKeys { - applications_consultation = 'applications_consultation' + applications_consultation = 'applications_consultation' } export type ValueBatchInput = { - attribute?: InputMaybe; - id_value?: InputMaybe; - metadata?: InputMaybe>>; - value?: InputMaybe; + attribute?: InputMaybe; + id_value?: InputMaybe; + metadata?: InputMaybe>>; + value?: InputMaybe; }; export type ValueInput = { - id_value?: InputMaybe; - metadata?: InputMaybe>>; - value?: InputMaybe; - version?: InputMaybe>>; + id_value?: InputMaybe; + metadata?: InputMaybe>>; + value?: InputMaybe; + version?: InputMaybe>>; }; export type ValueMetadataInput = { - name: Scalars['String']; - value?: InputMaybe; + name: Scalars['String']; + value?: InputMaybe; }; export type ValueVersionInput = { - treeId: Scalars['String']; - treeNodeId: Scalars['String']; + treeId: Scalars['String']; + treeNodeId: Scalars['String']; }; export enum ValueVersionMode { - simple = 'simple', - smart = 'smart' + simple = 'simple', + smart = 'smart' } export type ValuesListConfInput = { - allowFreeEntry?: InputMaybe; - enable: Scalars['Boolean']; - values?: InputMaybe>; + allowFreeEntry?: InputMaybe; + enable: Scalars['Boolean']; + values?: InputMaybe>; }; export type ValuesVersionsConfInput = { - mode?: InputMaybe; - profile?: InputMaybe; - versionable: Scalars['Boolean']; + mode?: InputMaybe; + profile?: InputMaybe; + versionable: Scalars['Boolean']; }; export type VersionProfileInput = { - description?: InputMaybe; - id: Scalars['String']; - label?: InputMaybe; - trees?: InputMaybe>; + description?: InputMaybe; + id: Scalars['String']; + label?: InputMaybe; + trees?: InputMaybe>; }; export type VersionProfilesFiltersInput = { - id?: InputMaybe; - label?: InputMaybe; - trees?: InputMaybe; + id?: InputMaybe; + label?: InputMaybe; + trees?: InputMaybe; }; export enum VersionProfilesSortableFields { - id = 'id' + id = 'id' } export type ViewDisplayInput = { - size: ViewSizes; - type: ViewTypes; + size: ViewSizes; + type: ViewTypes; }; export type ViewInput = { - color?: InputMaybe; - description?: InputMaybe; - display: ViewDisplayInput; - filters?: InputMaybe>; - id?: InputMaybe; - label?: InputMaybe; - library: Scalars['String']; - settings?: InputMaybe>; - shared: Scalars['Boolean']; - sort?: InputMaybe; - valuesVersions?: InputMaybe>; + color?: InputMaybe; + description?: InputMaybe; + display: ViewDisplayInput; + filters?: InputMaybe>; + id?: InputMaybe; + label?: InputMaybe; + library: Scalars['String']; + settings?: InputMaybe>; + shared: Scalars['Boolean']; + sort?: InputMaybe; + valuesVersions?: InputMaybe>; }; export type ViewSettingsInput = { - name: Scalars['String']; - value?: InputMaybe; + name: Scalars['String']; + value?: InputMaybe; }; export enum ViewSizes { - BIG = 'BIG', - MEDIUM = 'MEDIUM', - SMALL = 'SMALL' + BIG = 'BIG', + MEDIUM = 'MEDIUM', + SMALL = 'SMALL' } export enum ViewTypes { - cards = 'cards', - list = 'list', - timeline = 'timeline' + cards = 'cards', + list = 'list', + timeline = 'timeline' } export type ViewValuesVersionInput = { - treeId: Scalars['String']; - treeNode: Scalars['String']; + treeId: Scalars['String']; + treeNode: Scalars['String']; }; -export type RecordIdentityFragment = { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; -}; - -export type ValueDetailsLinkValueFragment = { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - linkValue?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - attribute?: {id: string; format?: AttributeFormat | null; type: AttributeType; system: boolean} | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - } | null; - } | null> | null; -}; - -export type ValueDetailsTreeValueFragment = { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - treeValue?: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - ancestors?: Array<{ - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - attribute?: {id: string; format?: AttributeFormat | null; type: AttributeType; system: boolean} | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - } | null; - } | null> | null; -}; - -export type ValueDetailsValueFragment = { - value?: any | null; - raw_value?: any | null; - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - attribute?: {id: string; format?: AttributeFormat | null; type: AttributeType; system: boolean} | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - } | null; - } | null> | null; -}; - -export type ValueDetailsFragment = - | ValueDetailsLinkValueFragment - | ValueDetailsTreeValueFragment - | ValueDetailsValueFragment; - -export type ValuesVersionDetailsFragment = { - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; -}; - -export type ViewDetailsFragment = { - id: string; - shared: boolean; - label: any; - description?: any | null; - color?: string | null; - display: {size: ViewSizes; type: ViewTypes}; - created_by: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}}; - filters?: Array<{ - field?: string | null; - value?: string | null; - condition?: RecordFilterCondition | null; - operator?: RecordFilterOperator | null; - tree?: {id: string; label?: any | null} | null; - }> | null; - sort?: {field: string; order: SortOrder} | null; - valuesVersions?: Array<{ - treeId: string; - treeNode: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }; - }> | null; - settings?: Array<{name: string; value?: any | null}> | null; -}; - -export type ApplicationDetailsFragment = { - id: string; - label: any; - type: ApplicationType; - description?: any | null; - endpoint?: string | null; - url?: string | null; - color?: string | null; - module?: string | null; - settings?: any | null; - icon?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - permissions: {access_application: boolean; admin_application: boolean}; -}; - -export type StandardValuesListFragmentStandardDateRangeValuesListConfFragment = { - enable: boolean; - allowFreeEntry?: boolean | null; - dateRangeValues?: Array<{from?: string | null; to?: string | null}> | null; -}; - -export type StandardValuesListFragmentStandardStringValuesListConfFragment = { - enable: boolean; - allowFreeEntry?: boolean | null; - values?: Array | null; -}; - -export type StandardValuesListFragmentFragment = - | StandardValuesListFragmentStandardDateRangeValuesListConfFragment - | StandardValuesListFragmentStandardStringValuesListConfFragment; - -export type CreateDirectoryMutationVariables = Exact<{ - library: Scalars['String']; - nodeId: Scalars['String']; - name: Scalars['String']; -}>; - -export type CreateDirectoryMutation = { - createDirectory: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - }; -}; - -export type ForcePreviewsGenerationMutationVariables = Exact<{ - libraryId: Scalars['ID']; - filters?: InputMaybe | RecordFilterInput>; - recordIds?: InputMaybe | Scalars['ID']>; - failedOnly?: InputMaybe; - previewVersionSizeNames?: InputMaybe | Scalars['String']>; -}>; - -export type ForcePreviewsGenerationMutation = {forcePreviewsGeneration: boolean}; - -export type ImportExcelMutationVariables = Exact<{ - file: Scalars['Upload']; - sheets?: InputMaybe> | InputMaybe>; - startAt?: InputMaybe; -}>; - -export type ImportExcelMutation = {importExcel: string}; - -export type CreateRecordMutationVariables = Exact<{ - library: Scalars['ID']; - data?: InputMaybe; -}>; +export type ApplicationDetailsFragment = { id: string, label: any, type: ApplicationType, description?: any | null, endpoint?: string | null, url?: string | null, color?: string | null, module?: string | null, settings?: any | null, icon?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null, permissions: { access_application: boolean, admin_application: boolean } }; -export type CreateRecordMutation = { - createRecord: { - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - valuesErrors?: Array<{ - attributeId: string; - id_value?: string | null; - input?: string | null; - message?: string | null; - type: string; - }> | null; - }; -}; - -export type DeactivateRecordsMutationVariables = Exact<{ - libraryId: Scalars['String']; - recordsIds?: InputMaybe | Scalars['String']>; - filters?: InputMaybe | RecordFilterInput>; -}>; - -export type DeactivateRecordsMutation = {deactivateRecords: Array<{id: string}>}; +export type RecordIdentityFragment = { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } }; export type CancelTaskMutationVariables = Exact<{ - taskId: Scalars['ID']; + taskId: Scalars['ID']; }>; -export type CancelTaskMutation = {cancelTask: boolean}; + +export type CancelTaskMutation = { cancelTask: boolean }; export type DeleteTasksMutationVariables = Exact<{ - tasks: Array | DeleteTaskInput; + tasks: Array | DeleteTaskInput; }>; -export type DeleteTasksMutation = {deleteTasks: boolean}; + +export type DeleteTasksMutation = { deleteTasks: boolean }; export type AddTreeElementMutationVariables = Exact<{ - treeId: Scalars['ID']; - element: TreeElementInput; - parent?: InputMaybe; - order?: InputMaybe; + treeId: Scalars['ID']; + element: TreeElementInput; + parent?: InputMaybe; + order?: InputMaybe; }>; -export type AddTreeElementMutation = {treeAddElement: {id: string}}; + +export type AddTreeElementMutation = { treeAddElement: { id: string } }; export type MoveTreeElementMutationVariables = Exact<{ - treeId: Scalars['ID']; - nodeId: Scalars['ID']; - parentTo?: InputMaybe; - order?: InputMaybe; + treeId: Scalars['ID']; + nodeId: Scalars['ID']; + parentTo?: InputMaybe; + order?: InputMaybe; }>; -export type MoveTreeElementMutation = {treeMoveElement: {id: string}}; + +export type MoveTreeElementMutation = { treeMoveElement: { id: string } }; export type RemoveTreeElementMutationVariables = Exact<{ - treeId: Scalars['ID']; - nodeId: Scalars['ID']; - deleteChildren?: InputMaybe; + treeId: Scalars['ID']; + nodeId: Scalars['ID']; + deleteChildren?: InputMaybe; }>; -export type RemoveTreeElementMutation = {treeDeleteElement: string}; - -export type UploadMutationVariables = Exact<{ - library: Scalars['String']; - nodeId: Scalars['String']; - files: Array | FileInput; -}>; -export type UploadMutation = { - upload: Array<{ - uid: string; - record: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - }; - }>; -}; +export type RemoveTreeElementMutation = { treeDeleteElement: string }; export type SaveUserDataMutationVariables = Exact<{ - key: Scalars['String']; - value?: InputMaybe; - global: Scalars['Boolean']; -}>; - -export type SaveUserDataMutation = {saveUserData: {global: boolean; data?: any | null}}; - -export type DeleteValueMutationVariables = Exact<{ - library: Scalars['ID']; - recordId: Scalars['ID']; - attribute: Scalars['ID']; - value?: InputMaybe; -}>; - -export type DeleteValueMutation = { - deleteValue: - | { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - linkValue?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - attribute?: {id: string; format?: AttributeFormat | null; type: AttributeType; system: boolean} | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - } - | { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - treeValue?: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - ancestors?: Array<{ - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - attribute?: {id: string; format?: AttributeFormat | null; type: AttributeType; system: boolean} | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - } - | { - value?: any | null; - raw_value?: any | null; - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}} | null; - } | null; - } | null> | null; - attribute?: {id: string; format?: AttributeFormat | null; type: AttributeType; system: boolean} | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - }; -}; - -export type SaveValueBatchMutationVariables = Exact<{ - library: Scalars['ID']; - recordId: Scalars['ID']; - version?: InputMaybe | ValueVersionInput>; - values: Array | ValueBatchInput; - deleteEmpty?: InputMaybe; -}>; - -export type SaveValueBatchMutation = { - saveValueBatch: { - values?: Array< - | { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - linkValue?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - attribute?: { - id: string; - format?: AttributeFormat | null; - type: AttributeType; - system: boolean; - } | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - } - | { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - treeValue?: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - ancestors?: Array<{ - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - attribute?: { - id: string; - format?: AttributeFormat | null; - type: AttributeType; - system: boolean; - } | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - } - | { - value?: any | null; - raw_value?: any | null; - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - attribute?: { - id: string; - format?: AttributeFormat | null; - type: AttributeType; - system: boolean; - } | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - } - > | null; - errors?: Array<{type: string; attribute: string; input?: string | null; message: string}> | null; - }; -}; - -export type DeleteViewMutationVariables = Exact<{ - viewId: Scalars['String']; + key: Scalars['String']; + value?: InputMaybe; + global: Scalars['Boolean']; }>; -export type DeleteViewMutation = {deleteView: {id: string; library: string}}; -export type AddViewMutationVariables = Exact<{ - view: ViewInput; -}>; - -export type AddViewMutation = { - saveView: { - id: string; - shared: boolean; - label: any; - description?: any | null; - color?: string | null; - display: {size: ViewSizes; type: ViewTypes}; - created_by: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}}; - filters?: Array<{ - field?: string | null; - value?: string | null; - condition?: RecordFilterCondition | null; - operator?: RecordFilterOperator | null; - tree?: {id: string; label?: any | null} | null; - }> | null; - sort?: {field: string; order: SortOrder} | null; - valuesVersions?: Array<{ - treeId: string; - treeNode: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }; - }> | null; - settings?: Array<{name: string; value?: any | null}> | null; - }; -}; +export type SaveUserDataMutation = { saveUserData: { global: boolean, data?: any | null } }; export type GetApplicationByEndpointQueryVariables = Exact<{ - endpoint: Scalars['String']; -}>; - -export type GetApplicationByEndpointQuery = { - applications?: { - list: Array<{ - id: string; - label: any; - type: ApplicationType; - description?: any | null; - endpoint?: string | null; - url?: string | null; - color?: string | null; - module?: string | null; - settings?: any | null; - icon?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - permissions: {access_application: boolean; admin_application: boolean}; - }>; - } | null; -}; - -export type GetApplicationsQueryVariables = Exact<{[key: string]: never}>; - -export type GetApplicationsQuery = { - applications?: { - list: Array<{ - id: string; - label: any; - description?: any | null; - endpoint?: string | null; - url?: string | null; - color?: string | null; - icon?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }>; - } | null; -}; - -export type GetAttributesByLibQueryVariables = Exact<{ - library: Scalars['String']; + endpoint: Scalars['String']; }>; -export type GetAttributesByLibQuery = { - attributes?: { - list: Array< - | { - id: string; - type: AttributeType; - format?: AttributeFormat | null; - label?: any | null; - multiple_values: boolean; - system: boolean; - readonly: boolean; - linked_library?: {id: string} | null; - } - | { - id: string; - type: AttributeType; - format?: AttributeFormat | null; - label?: any | null; - multiple_values: boolean; - system: boolean; - readonly: boolean; - embedded_fields?: Array<{ - id: string; - format?: AttributeFormat | null; - label?: any | null; - } | null> | null; - } - | { - id: string; - type: AttributeType; - format?: AttributeFormat | null; - label?: any | null; - multiple_values: boolean; - system: boolean; - readonly: boolean; - linked_tree?: { - id: string; - label?: any | null; - libraries: Array<{library: {id: string; label?: any | null}}>; - } | null; - } - >; - } | null; -}; - -export type GetVersionableAttributesByLibraryQueryVariables = Exact<{ - libraryId: Scalars['String']; -}>; -export type GetVersionableAttributesByLibraryQuery = { - attributes?: { - list: Array<{ - id: string; - versions_conf?: { - versionable: boolean; - profile?: {id: string; trees: Array<{id: string; label?: any | null}>} | null; - } | null; - }>; - } | null; -}; - -export type GetActiveLibraryQueryVariables = Exact<{[key: string]: never}>; - -export type GetActiveLibraryQuery = { - activeLib?: { - id: string; - name: string; - behavior: LibraryBehavior; - attributes: Array; - trees: Array; - permissions: { - access_library: boolean; - access_record: boolean; - create_record: boolean; - edit_record: boolean; - delete_record: boolean; - }; - } | null; -}; - -export type GetActiveTreeQueryVariables = Exact<{[key: string]: never}>; - -export type GetActiveTreeQuery = { - activeTree?: { - id: string; - behavior: TreeBehavior; - label: string; - libraries: Array<{id: string; behavior: LibraryBehavior}>; - permissions: {access_tree: boolean; edit_children: boolean}; - } | null; -}; +export type GetApplicationByEndpointQuery = { applications?: { list: Array<{ id: string, label: any, type: ApplicationType, description?: any | null, endpoint?: string | null, url?: string | null, color?: string | null, module?: string | null, settings?: any | null, icon?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null, permissions: { access_application: boolean, admin_application: boolean } }> } | null }; -export type GetLangAllQueryVariables = Exact<{[key: string]: never}>; +export type GetApplicationsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetLangAllQuery = {lang: string; availableLangs: Array; defaultLang: string}; -export type GetLangQueryVariables = Exact<{[key: string]: never}>; +export type GetApplicationsQuery = { applications?: { list: Array<{ id: string, label: any, description?: any | null, endpoint?: string | null, url?: string | null, color?: string | null, icon?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null }> } | null }; -export type GetLangQuery = {lang: string}; +export type GetActiveLibraryQueryVariables = Exact<{ [key: string]: never; }>; -export type GetAvailableLangsQueryVariables = Exact<{[key: string]: never}>; -export type GetAvailableLangsQuery = {availableLangs: Array; lang: string}; +export type GetActiveLibraryQuery = { activeLib?: { id: string, name: string, behavior: LibraryBehavior, attributes: Array, trees: Array, permissions: { access_library: boolean, access_record: boolean, create_record: boolean, edit_record: boolean, delete_record: boolean } } | null }; -export type GetUserQueryVariables = Exact<{[key: string]: never}>; +export type GetActiveTreeQueryVariables = Exact<{ [key: string]: never; }>; -export type GetUserQuery = { - userId: string; - userPermissions: Array; - userWhoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; -}; -export type GetLangsQueryVariables = Exact<{[key: string]: never}>; +export type GetActiveTreeQuery = { activeTree?: { id: string, behavior: TreeBehavior, label: string, libraries: Array<{ id: string, behavior: LibraryBehavior }>, permissions: { access_tree: boolean, edit_children: boolean } } | null }; -export type GetLangsQuery = {langs: Array}; +export type GetLangsQueryVariables = Exact<{ [key: string]: never; }>; -export type ExportQueryVariables = Exact<{ - library: Scalars['ID']; - attributes?: InputMaybe | Scalars['ID']>; - filters?: InputMaybe | RecordFilterInput>; -}>; -export type ExportQuery = {export: string}; +export type GetLangsQuery = { langs: Array }; -export type RecordFormQueryVariables = Exact<{ - libraryId: Scalars['String']; - formId: Scalars['String']; - recordId?: InputMaybe; - version?: InputMaybe | ValueVersionInput>; -}>; +export type GetGlobalSettingsQueryVariables = Exact<{ [key: string]: never; }>; -export type RecordFormQuery = { - recordForm?: { - id: string; - recordId?: string | null; - library: {id: string}; - dependencyAttributes?: Array<{id: string}> | null; - elements: Array<{ - id: string; - containerId: string; - uiElementType: string; - type: FormElementTypes; - valueError?: string | null; - values?: Array< - | { - id_value?: string | null; - created_at?: number | null; - modified_at?: number | null; - linkValue?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - metadata?: Array<{ - name: string; - value?: {id_value?: string | null; value?: any | null; raw_value?: any | null} | null; - } | null> | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } - | { - id_value?: string | null; - created_at?: number | null; - modified_at?: number | null; - treeValue?: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - ancestors?: Array<{ - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - metadata?: Array<{ - name: string; - value?: {id_value?: string | null; value?: any | null; raw_value?: any | null} | null; - } | null> | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } - | { - value?: any | null; - raw_value?: any | null; - id_value?: string | null; - created_at?: number | null; - modified_at?: number | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - metadata?: Array<{ - name: string; - value?: {id_value?: string | null; value?: any | null; raw_value?: any | null} | null; - } | null> | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } - > | null; - attribute?: - | { - id: string; - label?: any | null; - description?: any | null; - type: AttributeType; - format?: AttributeFormat | null; - system: boolean; - readonly: boolean; - multiple_values: boolean; - linked_library?: { - id: string; - label?: any | null; - behavior: LibraryBehavior; - permissions?: {create_record: boolean} | null; - } | null; - linkValuesList?: { - enable: boolean; - allowFreeEntry?: boolean | null; - values?: Array<{ - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - }> | null; - } | null; - permissions: {access_attribute: boolean; edit_value: boolean}; - versions_conf?: { - versionable: boolean; - profile?: {id: string; trees: Array<{id: string; label?: any | null}>} | null; - } | null; - metadata_fields?: Array<{ - id: string; - label?: any | null; - description?: any | null; - type: AttributeType; - format?: AttributeFormat | null; - system: boolean; - readonly: boolean; - multiple_values: boolean; - permissions: {access_attribute: boolean; edit_value: boolean}; - values_list?: - | { - enable: boolean; - allowFreeEntry?: boolean | null; - dateRangeValues?: Array<{from?: string | null; to?: string | null}> | null; - } - | {enable: boolean; allowFreeEntry?: boolean | null; values?: Array | null} - | null; - metadata_fields?: Array<{id: string}> | null; - }> | null; - } - | { - id: string; - label?: any | null; - description?: any | null; - type: AttributeType; - format?: AttributeFormat | null; - system: boolean; - readonly: boolean; - multiple_values: boolean; - values_list?: - | { - enable: boolean; - allowFreeEntry?: boolean | null; - dateRangeValues?: Array<{from?: string | null; to?: string | null}> | null; - } - | {enable: boolean; allowFreeEntry?: boolean | null; values?: Array | null} - | null; - permissions: {access_attribute: boolean; edit_value: boolean}; - versions_conf?: { - versionable: boolean; - profile?: {id: string; trees: Array<{id: string; label?: any | null}>} | null; - } | null; - metadata_fields?: Array<{ - id: string; - label?: any | null; - description?: any | null; - type: AttributeType; - format?: AttributeFormat | null; - system: boolean; - readonly: boolean; - multiple_values: boolean; - permissions: {access_attribute: boolean; edit_value: boolean}; - values_list?: - | { - enable: boolean; - allowFreeEntry?: boolean | null; - dateRangeValues?: Array<{from?: string | null; to?: string | null}> | null; - } - | {enable: boolean; allowFreeEntry?: boolean | null; values?: Array | null} - | null; - metadata_fields?: Array<{id: string}> | null; - }> | null; - } - | { - id: string; - label?: any | null; - description?: any | null; - type: AttributeType; - format?: AttributeFormat | null; - system: boolean; - readonly: boolean; - multiple_values: boolean; - linked_tree?: {id: string; label?: any | null} | null; - treeValuesList?: { - enable: boolean; - allowFreeEntry?: boolean | null; - values?: Array<{ - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - ancestors?: Array<{ - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - }> | null; - } | null; - permissions: {access_attribute: boolean; edit_value: boolean}; - versions_conf?: { - versionable: boolean; - profile?: {id: string; trees: Array<{id: string; label?: any | null}>} | null; - } | null; - metadata_fields?: Array<{ - id: string; - label?: any | null; - description?: any | null; - type: AttributeType; - format?: AttributeFormat | null; - system: boolean; - readonly: boolean; - multiple_values: boolean; - permissions: {access_attribute: boolean; edit_value: boolean}; - values_list?: - | { - enable: boolean; - allowFreeEntry?: boolean | null; - dateRangeValues?: Array<{from?: string | null; to?: string | null}> | null; - } - | {enable: boolean; allowFreeEntry?: boolean | null; values?: Array | null} - | null; - metadata_fields?: Array<{id: string}> | null; - }> | null; - } - | null; - settings: Array<{key: string; value: any}>; - }>; - } | null; -}; -export type GetGlobalSettingsQueryVariables = Exact<{[key: string]: never}>; - -export type GetGlobalSettingsQuery = { - globalSettings: { - name: string; - icon?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }; -}; +export type GetGlobalSettingsQuery = { globalSettings: { name: string, icon?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null } }; export type GetLibrariesListQueryVariables = Exact<{ - filters?: InputMaybe; + filters?: InputMaybe; }>; -export type GetLibrariesListQuery = { - libraries?: { - list: Array<{ - id: string; - label?: any | null; - behavior: LibraryBehavior; - icon?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - previewsSettings?: Array<{ - description?: any | null; - label: any; - system: boolean; - versions: {background: string; density: number; sizes: Array<{name: string; size: number}>}; - }> | null; - permissions?: { - access_library: boolean; - access_record: boolean; - create_record: boolean; - edit_record: boolean; - delete_record: boolean; - } | null; - }>; - } | null; -}; + +export type GetLibrariesListQuery = { libraries?: { list: Array<{ id: string, label?: any | null, behavior: LibraryBehavior, icon?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null, previewsSettings?: Array<{ description?: any | null, label: any, system: boolean, versions: { background: string, density: number, sizes: Array<{ name: string, size: number }> } }> | null, permissions?: { access_library: boolean, access_record: boolean, create_record: boolean, edit_record: boolean, delete_record: boolean } | null }> } | null }; export type GetLibraryPermissionsQueryVariables = Exact<{ - libraryId?: InputMaybe | Scalars['ID']>; + libraryId?: InputMaybe | Scalars['ID']>; }>; -export type GetLibraryPermissionsQuery = { - libraries?: { - list: Array<{ - permissions?: { - access_library: boolean; - access_record: boolean; - create_record: boolean; - edit_record: boolean; - delete_record: boolean; - } | null; - }>; - } | null; -}; - -export type NoopQueryVariables = Exact<{[key: string]: never}>; -export type NoopQuery = {__typename: 'Query'}; +export type GetLibraryPermissionsQuery = { libraries?: { list: Array<{ permissions?: { access_library: boolean, access_record: boolean, create_record: boolean, edit_record: boolean, delete_record: boolean } | null }> } | null }; export type IsAllowedQueryVariables = Exact<{ - type: PermissionTypes; - actions: Array | PermissionsActions; - applyTo?: InputMaybe; - target?: InputMaybe; -}>; - -export type IsAllowedQuery = {isAllowed?: Array<{name: PermissionsActions; allowed?: boolean | null}> | null}; - -export type DoesFileExistAsChildQueryVariables = Exact<{ - parentNode?: InputMaybe; - treeId: Scalars['ID']; - filename: Scalars['String']; -}>; - -export type DoesFileExistAsChildQuery = {doesFileExistAsChild?: boolean | null}; - -export type GetDirectoryDataQueryVariables = Exact<{ - library: Scalars['ID']; - directoryId: Scalars['String']; + type: PermissionTypes; + actions: Array | PermissionsActions; + applyTo?: InputMaybe; + target?: InputMaybe; }>; -export type GetDirectoryDataQuery = { - records: { - list: Array<{ - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - created_at?: Array<{value?: any | null}> | null; - created_by?: Array<{ - value?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - modified_at?: Array<{value?: any | null}> | null; - modified_by?: Array<{ - value?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - file_name?: Array<{value?: any | null}> | null; - file_path?: Array<{value?: any | null}> | null; - library: {behavior: LibraryBehavior}; - }>; - }; -}; -export type GetFileDataQueryVariables = Exact<{ - library: Scalars['ID']; - fileId: Scalars['String']; - previewsStatusAttribute: Scalars['ID']; -}>; - -export type GetFileDataQuery = { - records: { - list: Array<{ - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - created_at?: Array<{value?: any | null}> | null; - created_by?: Array<{ - value?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - modified_at?: Array<{value?: any | null}> | null; - modified_by?: Array<{ - value?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - file_name?: Array<{value?: any | null}> | null; - file_path?: Array<{value?: any | null}> | null; - previews_status?: Array<{value?: any | null}> | null; - library: {behavior: LibraryBehavior}; - }>; - }; -}; +export type IsAllowedQuery = { isAllowed?: Array<{ name: PermissionsActions, allowed?: boolean | null }> | null }; export type GetTasksQueryVariables = Exact<{ - filters?: InputMaybe; + filters?: InputMaybe; }>; -export type GetTasksQuery = { - tasks: { - totalCount: number; - list: Array<{ - id: string; - label: any; - modified_at: number; - created_at: number; - startAt: number; - status: TaskStatus; - priority: any; - startedAt?: number | null; - completedAt?: number | null; - archive: boolean; - created_by: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - }; - role?: {type: TaskType; detail?: string | null} | null; - progress?: {percent?: number | null; description?: any | null} | null; - link?: {name: string; url: string} | null; - canceledBy?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }>; - }; -}; + +export type GetTasksQuery = { tasks: { totalCount: number, list: Array<{ id: string, label: any, modified_at: number, created_at: number, startAt: number, status: TaskStatus, priority: any, startedAt?: number | null, completedAt?: number | null, archive: boolean, created_by: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } }, role?: { type: TaskType, detail?: string | null } | null, progress?: { percent?: number | null, description?: any | null } | null, link?: { name: string, url: string } | null, canceledBy?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null }> } }; export type GetTreeAttributesQueryQueryVariables = Exact<{ - treeId?: InputMaybe | Scalars['ID']>; + treeId?: InputMaybe | Scalars['ID']>; }>; -export type GetTreeAttributesQueryQuery = { - trees?: { - list: Array<{ - id: string; - libraries: Array<{ - library: { - id: string; - label?: any | null; - attributes?: Array< - | { - id: string; - type: AttributeType; - format?: AttributeFormat | null; - label?: any | null; - multiple_values: boolean; - linked_library?: {id: string} | null; - } - | { - id: string; - type: AttributeType; - format?: AttributeFormat | null; - label?: any | null; - multiple_values: boolean; - embedded_fields?: Array<{ - id: string; - format?: AttributeFormat | null; - label?: any | null; - } | null> | null; - } - | { - id: string; - type: AttributeType; - format?: AttributeFormat | null; - label?: any | null; - multiple_values: boolean; - linked_tree?: {id: string; label?: any | null} | null; - } - > | null; - }; - }>; - }>; - } | null; -}; + +export type GetTreeAttributesQueryQuery = { trees?: { list: Array<{ id: string, libraries: Array<{ library: { id: string, label?: any | null, attributes?: Array<{ id: string, type: AttributeType, format?: AttributeFormat | null, label?: any | null, multiple_values: boolean, linked_library?: { id: string } | null } | { id: string, type: AttributeType, format?: AttributeFormat | null, label?: any | null, multiple_values: boolean, embedded_fields?: Array<{ id: string, format?: AttributeFormat | null, label?: any | null } | null> | null } | { id: string, type: AttributeType, format?: AttributeFormat | null, label?: any | null, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null }> | null } }> }> } | null }; export type GetTreeLibrariesQueryVariables = Exact<{ - treeId?: InputMaybe | Scalars['ID']>; - library?: InputMaybe; + treeId?: InputMaybe | Scalars['ID']>; + library?: InputMaybe; }>; -export type GetTreeLibrariesQuery = { - trees?: { - totalCount: number; - list: Array<{ - id: string; - behavior: TreeBehavior; - system: boolean; - libraries: Array<{ - library: {id: string; label?: any | null; behavior: LibraryBehavior; system?: boolean | null}; - settings: {allowMultiplePositions: boolean; allowedChildren: Array; allowedAtRoot: boolean}; - }>; - }>; - } | null; -}; + +export type GetTreeLibrariesQuery = { trees?: { totalCount: number, list: Array<{ id: string, behavior: TreeBehavior, system: boolean, libraries: Array<{ library: { id: string, label?: any | null, behavior: LibraryBehavior, system?: boolean | null }, settings: { allowMultiplePositions: boolean, allowedChildren: Array, allowedAtRoot: boolean } }> }> } | null }; export type GetTreesQueryVariables = Exact<{ - filters?: InputMaybe; + filters?: InputMaybe; }>; -export type GetTreesQuery = { - trees?: { - list: Array<{ - id: string; - label?: any | null; - behavior: TreeBehavior; - libraries: Array<{library: {id: string; label?: any | null; behavior: LibraryBehavior}}>; - permissions: {access_tree: boolean; edit_children: boolean}; - }>; - } | null; -}; + +export type GetTreesQuery = { trees?: { list: Array<{ id: string, label?: any | null, behavior: TreeBehavior, libraries: Array<{ library: { id: string, label?: any | null, behavior: LibraryBehavior } }>, permissions: { access_tree: boolean, edit_children: boolean } }> } | null }; export type TreeNodeChildrenQueryVariables = Exact<{ - treeId: Scalars['ID']; - node?: InputMaybe; - pagination?: InputMaybe; + treeId: Scalars['ID']; + node?: InputMaybe; + pagination?: InputMaybe; }>; -export type TreeNodeChildrenQuery = { - treeNodeChildren: { - totalCount?: number | null; - list: Array<{ - id: string; - childrenCount?: number | null; - record: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - active?: Array<{value?: any | null}> | null; - }; - permissions: {access_tree: boolean; detach: boolean; edit_children: boolean}; - }>; - }; -}; + +export type TreeNodeChildrenQuery = { treeNodeChildren: { totalCount?: number | null, list: Array<{ id: string, childrenCount?: number | null, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } }, active?: Array<{ value?: any | null }> | null }, permissions: { access_tree: boolean, detach: boolean, edit_children: boolean } }> } }; export type GetUserDataQueryVariables = Exact<{ - keys: Array | Scalars['String']; - global?: InputMaybe; + keys: Array | Scalars['String']; + global?: InputMaybe; }>; -export type GetUserDataQuery = {userData: {global: boolean; data?: any | null}}; - -export type MeQueryVariables = Exact<{[key: string]: never}>; - -export type MeQuery = { - me?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; -}; -export type GetViewQueryVariables = Exact<{ - viewId: Scalars['String']; -}>; +export type GetUserDataQuery = { userData: { global: boolean, data?: any | null } }; -export type GetViewQuery = { - view: { - id: string; - shared: boolean; - label: any; - description?: any | null; - color?: string | null; - display: {size: ViewSizes; type: ViewTypes}; - created_by: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}}; - filters?: Array<{ - field?: string | null; - value?: string | null; - condition?: RecordFilterCondition | null; - operator?: RecordFilterOperator | null; - tree?: {id: string; label?: any | null} | null; - }> | null; - sort?: {field: string; order: SortOrder} | null; - valuesVersions?: Array<{ - treeId: string; - treeNode: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }; - }> | null; - settings?: Array<{name: string; value?: any | null}> | null; - }; -}; +export type MeQueryVariables = Exact<{ [key: string]: never; }>; -export type GetViewsListQueryVariables = Exact<{ - libraryId: Scalars['String']; -}>; -export type GetViewsListQuery = { - views: { - totalCount: number; - list: Array<{ - id: string; - shared: boolean; - label: any; - description?: any | null; - color?: string | null; - display: {size: ViewSizes; type: ViewTypes}; - created_by: {id: string; whoAmI: {id: string; label?: string | null; library: {id: string}}}; - filters?: Array<{ - field?: string | null; - value?: string | null; - condition?: RecordFilterCondition | null; - operator?: RecordFilterOperator | null; - tree?: {id: string; label?: any | null} | null; - }> | null; - sort?: {field: string; order: SortOrder} | null; - valuesVersions?: Array<{ - treeId: string; - treeNode: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }; - }> | null; - settings?: Array<{name: string; value?: any | null}> | null; - }>; - }; -}; +export type MeQuery = { me?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null }; export type ApplicationEventsSubscriptionVariables = Exact<{ - filters?: InputMaybe; + filters?: InputMaybe; }>; -export type ApplicationEventsSubscription = { - applicationEvent: { - type: ApplicationEventTypes; - application: { - id: string; - label: any; - type: ApplicationType; - description?: any | null; - endpoint?: string | null; - url?: string | null; - color?: string | null; - module?: string | null; - settings?: any | null; - icon?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - permissions: {access_application: boolean; admin_application: boolean}; - }; - }; -}; - -export type SubRecordUpdateSubscriptionVariables = Exact<{ - filters?: InputMaybe; -}>; -export type SubRecordUpdateSubscription = { - recordUpdate: { - record: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - modified_by?: Array<{ - value?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - }; - updatedValues: Array<{ - attribute: string; - value: - | { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - linkValue?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - attribute?: { - id: string; - format?: AttributeFormat | null; - type: AttributeType; - system: boolean; - } | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - } - | { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - treeValue?: { - id: string; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - ancestors?: Array<{ - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }> | null; - } | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - attribute?: { - id: string; - format?: AttributeFormat | null; - type: AttributeType; - system: boolean; - } | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - } - | { - value?: any | null; - raw_value?: any | null; - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - attribute?: { - id: string; - format?: AttributeFormat | null; - type: AttributeType; - system: boolean; - } | null; - metadata?: Array<{ - name: string; - value?: { - id_value?: string | null; - modified_at?: number | null; - created_at?: number | null; - value?: any | null; - raw_value?: any | null; - modified_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - created_by?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - version?: Array<{ - treeId: string; - treeNode?: { - id: string; - record?: { - id: string; - whoAmI: {id: string; label?: string | null; library: {id: string}}; - } | null; - } | null; - } | null> | null; - } | null; - } | null> | null; - }; - }>; - }; -}; +export type ApplicationEventsSubscription = { applicationEvent: { type: ApplicationEventTypes, application: { id: string, label: any, type: ApplicationType, description?: any | null, endpoint?: string | null, url?: string | null, color?: string | null, module?: string | null, settings?: any | null, icon?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null, permissions: { access_application: boolean, admin_application: boolean } } } }; export type SubTasksUpdateSubscriptionVariables = Exact<{ - filters?: InputMaybe; + filters?: InputMaybe; }>; -export type SubTasksUpdateSubscription = { - task: { - id: string; - label: any; - modified_at: number; - created_at: number; - startAt: number; - status: TaskStatus; - priority: any; - startedAt?: number | null; - completedAt?: number | null; - archive: boolean; - created_by: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - }; - role?: {type: TaskType; detail?: string | null} | null; - progress?: {percent?: number | null; description?: any | null} | null; - link?: {name: string; url: string} | null; - canceledBy?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - }; -}; + +export type SubTasksUpdateSubscription = { task: { id: string, label: any, modified_at: number, created_at: number, startAt: number, status: TaskStatus, priority: any, startedAt?: number | null, completedAt?: number | null, archive: boolean, created_by: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } }, role?: { type: TaskType, detail?: string | null } | null, progress?: { percent?: number | null, description?: any | null } | null, link?: { name: string, url: string } | null, canceledBy?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } } | null } }; export type TreeEventsSubscriptionVariables = Exact<{ - filters?: InputMaybe; + filters?: InputMaybe; }>; -export type TreeEventsSubscription = { - treeEvent: { - type: TreeEventTypes; - treeId: string; - element: { - id: string; - childrenCount?: number | null; - record?: { - id: string; - whoAmI: { - id: string; - label?: string | null; - subLabel?: string | null; - color?: string | null; - preview?: IPreviewScalar | null; - library: {id: string; behavior: LibraryBehavior; label?: any | null}; - }; - } | null; - permissions: {access_tree: boolean; detach: boolean; edit_children: boolean}; - }; - parentNode?: {id: string} | null; - parentNodeBefore?: {id: string} | null; - }; -}; -export type SubUploadUpdateSubscriptionVariables = Exact<{ - filters?: InputMaybe; -}>; - -export type SubUploadUpdateSubscription = { - upload: { - userId: string; - uid: string; - progress: { - length?: number | null; - transferred?: number | null; - speed?: number | null; - runtime?: number | null; - remaining?: number | null; - percentage?: number | null; - eta?: number | null; - delta?: number | null; - }; - }; -}; +export type TreeEventsSubscription = { treeEvent: { type: TreeEventTypes, treeId: string, element: { id: string, childrenCount?: number | null, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, behavior: LibraryBehavior, label?: any | null } } }, permissions: { access_tree: boolean, detach: boolean, edit_children: boolean } }, parentNode?: { id: string } | null, parentNodeBefore?: { id: string } | null } }; export const RecordIdentityFragmentDoc = gql` fragment RecordIdentity on Record { - id - whoAmI { - id - label - subLabel - color - library { - id - behavior - label - } - preview - } - } -`; -export const ValuesVersionDetailsFragmentDoc = gql` - fragment ValuesVersionDetails on ValueVersion { - treeId - treeNode { - id - record { - id - whoAmI { - id - label - library { - id - } - } - } - } - } -`; -export const ValueDetailsFragmentDoc = gql` - fragment ValueDetails on GenericValue { - id_value - modified_at - modified_by { - ...RecordIdentity - } - created_at - created_by { - ...RecordIdentity - } - version { - ...ValuesVersionDetails - } - attribute { - id - format - type - system - } - metadata { - name - value { - id_value - modified_at - modified_by { - ...RecordIdentity - } - created_at - created_by { - ...RecordIdentity - } - version { - ...ValuesVersionDetails - } - value - raw_value - } - } - ... on Value { - value - raw_value - } - ... on LinkValue { - linkValue: value { - ...RecordIdentity - } - } - ... on TreeValue { - treeValue: value { - id - record { - ...RecordIdentity - } - ancestors { - record { - ...RecordIdentity - } - } - } - } + id + whoAmI { + id + label + subLabel + color + library { + id + behavior + label } - ${RecordIdentityFragmentDoc} - ${ValuesVersionDetailsFragmentDoc} -`; + preview + } +} + `; export const ApplicationDetailsFragmentDoc = gql` fragment ApplicationDetails on Application { - id - label - type - description - endpoint - url - color - icon { - ...RecordIdentity - } - module - permissions { - access_application - admin_application - } - settings - } - ${RecordIdentityFragmentDoc} -`; -export const StandardValuesListFragmentFragmentDoc = gql` - fragment StandardValuesListFragment on StandardValuesListConf { - ... on StandardStringValuesListConf { - enable - allowFreeEntry - values - } - ... on StandardDateRangeValuesListConf { - enable - allowFreeEntry - dateRangeValues: values { - from - to - } - } - } -`; -export const ViewDetailsFragmentDoc = gql` - fragment ViewDetails on View { - id - display { - size - type - } - shared - created_by { - id - whoAmI { - id - label - library { - id - } - } - } - label - description - color - filters { - field - value - tree { - id - label - } - condition - operator - } - sort { - field - order - } - valuesVersions { - treeId - treeNode { - id - record { - ...RecordIdentity - } - } - } - settings { - name - value - } - } - ${RecordIdentityFragmentDoc} -`; -export const CreateDirectoryDocument = gql` - mutation CREATE_DIRECTORY($library: String!, $nodeId: String!, $name: String!) { - createDirectory(library: $library, nodeId: $nodeId, name: $name) { - ...RecordIdentity - } - } - ${RecordIdentityFragmentDoc} -`; -export type CreateDirectoryMutationFn = Apollo.MutationFunction< - CreateDirectoryMutation, - CreateDirectoryMutationVariables ->; - -/** - * __useCreateDirectoryMutation__ - * - * To run a mutation, you first call `useCreateDirectoryMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateDirectoryMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [createDirectoryMutation, { data, loading, error }] = useCreateDirectoryMutation({ - * variables: { - * library: // value for 'library' - * nodeId: // value for 'nodeId' - * name: // value for 'name' - * }, - * }); - */ -export function useCreateDirectoryMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation( - CreateDirectoryDocument, - options - ); -} -export type CreateDirectoryMutationHookResult = ReturnType; -export type CreateDirectoryMutationResult = Apollo.MutationResult; -export type CreateDirectoryMutationOptions = Apollo.BaseMutationOptions< - CreateDirectoryMutation, - CreateDirectoryMutationVariables ->; -export const ForcePreviewsGenerationDocument = gql` - mutation FORCE_PREVIEWS_GENERATION( - $libraryId: ID! - $filters: [RecordFilterInput!] - $recordIds: [ID!] - $failedOnly: Boolean - $previewVersionSizeNames: [String!] - ) { - forcePreviewsGeneration( - libraryId: $libraryId - filters: $filters - recordIds: $recordIds - failedOnly: $failedOnly - previewVersionSizeNames: $previewVersionSizeNames - ) - } -`; -export type ForcePreviewsGenerationMutationFn = Apollo.MutationFunction< - ForcePreviewsGenerationMutation, - ForcePreviewsGenerationMutationVariables ->; - -/** - * __useForcePreviewsGenerationMutation__ - * - * To run a mutation, you first call `useForcePreviewsGenerationMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useForcePreviewsGenerationMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [forcePreviewsGenerationMutation, { data, loading, error }] = useForcePreviewsGenerationMutation({ - * variables: { - * libraryId: // value for 'libraryId' - * filters: // value for 'filters' - * recordIds: // value for 'recordIds' - * failedOnly: // value for 'failedOnly' - * previewVersionSizeNames: // value for 'previewVersionSizeNames' - * }, - * }); - */ -export function useForcePreviewsGenerationMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation( - ForcePreviewsGenerationDocument, - options - ); -} -export type ForcePreviewsGenerationMutationHookResult = ReturnType; -export type ForcePreviewsGenerationMutationResult = Apollo.MutationResult; -export type ForcePreviewsGenerationMutationOptions = Apollo.BaseMutationOptions< - ForcePreviewsGenerationMutation, - ForcePreviewsGenerationMutationVariables ->; -export const ImportExcelDocument = gql` - mutation IMPORT_EXCEL($file: Upload!, $sheets: [SheetInput], $startAt: Int) { - importExcel(file: $file, sheets: $sheets, startAt: $startAt) - } -`; -export type ImportExcelMutationFn = Apollo.MutationFunction; - -/** - * __useImportExcelMutation__ - * - * To run a mutation, you first call `useImportExcelMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useImportExcelMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [importExcelMutation, { data, loading, error }] = useImportExcelMutation({ - * variables: { - * file: // value for 'file' - * sheets: // value for 'sheets' - * startAt: // value for 'startAt' - * }, - * }); - */ -export function useImportExcelMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(ImportExcelDocument, options); -} -export type ImportExcelMutationHookResult = ReturnType; -export type ImportExcelMutationResult = Apollo.MutationResult; -export type ImportExcelMutationOptions = Apollo.BaseMutationOptions; -export const CreateRecordDocument = gql` - mutation CREATE_RECORD($library: ID!, $data: CreateRecordDataInput) { - createRecord(library: $library, data: $data) { - record { - ...RecordIdentity - } - valuesErrors { - attributeId - id_value - input - message - type - } - } - } - ${RecordIdentityFragmentDoc} -`; -export type CreateRecordMutationFn = Apollo.MutationFunction; - -/** - * __useCreateRecordMutation__ - * - * To run a mutation, you first call `useCreateRecordMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateRecordMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [createRecordMutation, { data, loading, error }] = useCreateRecordMutation({ - * variables: { - * library: // value for 'library' - * data: // value for 'data' - * }, - * }); - */ -export function useCreateRecordMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(CreateRecordDocument, options); -} -export type CreateRecordMutationHookResult = ReturnType; -export type CreateRecordMutationResult = Apollo.MutationResult; -export type CreateRecordMutationOptions = Apollo.BaseMutationOptions< - CreateRecordMutation, - CreateRecordMutationVariables ->; -export const DeactivateRecordsDocument = gql` - mutation DEACTIVATE_RECORDS($libraryId: String!, $recordsIds: [String!], $filters: [RecordFilterInput!]) { - deactivateRecords(recordsIds: $recordsIds, filters: $filters, libraryId: $libraryId) { - id - } - } -`; -export type DeactivateRecordsMutationFn = Apollo.MutationFunction< - DeactivateRecordsMutation, - DeactivateRecordsMutationVariables ->; - -/** - * __useDeactivateRecordsMutation__ - * - * To run a mutation, you first call `useDeactivateRecordsMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeactivateRecordsMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deactivateRecordsMutation, { data, loading, error }] = useDeactivateRecordsMutation({ - * variables: { - * libraryId: // value for 'libraryId' - * recordsIds: // value for 'recordsIds' - * filters: // value for 'filters' - * }, - * }); - */ -export function useDeactivateRecordsMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation( - DeactivateRecordsDocument, - options - ); -} -export type DeactivateRecordsMutationHookResult = ReturnType; -export type DeactivateRecordsMutationResult = Apollo.MutationResult; -export type DeactivateRecordsMutationOptions = Apollo.BaseMutationOptions< - DeactivateRecordsMutation, - DeactivateRecordsMutationVariables ->; + id + label + type + description + endpoint + url + color + icon { + ...RecordIdentity + } + module + permissions { + access_application + admin_application + } + settings +} + ${RecordIdentityFragmentDoc}`; export const CancelTaskDocument = gql` mutation CANCEL_TASK($taskId: ID!) { - cancelTask(taskId: $taskId) - } -`; + cancelTask(taskId: $taskId) +} + `; export type CancelTaskMutationFn = Apollo.MutationFunction; /** @@ -3976,20 +1141,18 @@ export type CancelTaskMutationFn = Apollo.MutationFunction -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(CancelTaskDocument, options); -} +export function useCancelTaskMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CancelTaskDocument, options); + } export type CancelTaskMutationHookResult = ReturnType; export type CancelTaskMutationResult = Apollo.MutationResult; export type CancelTaskMutationOptions = Apollo.BaseMutationOptions; export const DeleteTasksDocument = gql` mutation DELETE_TASKS($tasks: [DeleteTaskInput!]!) { - deleteTasks(tasks: $tasks) - } -`; + deleteTasks(tasks: $tasks) +} + `; export type DeleteTasksMutationFn = Apollo.MutationFunction; /** @@ -4009,411 +1172,177 @@ export type DeleteTasksMutationFn = Apollo.MutationFunction -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(DeleteTasksDocument, options); -} +export function useDeleteTasksMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(DeleteTasksDocument, options); + } export type DeleteTasksMutationHookResult = ReturnType; export type DeleteTasksMutationResult = Apollo.MutationResult; -export type DeleteTasksMutationOptions = Apollo.BaseMutationOptions; -export const AddTreeElementDocument = gql` - mutation ADD_TREE_ELEMENT($treeId: ID!, $element: TreeElementInput!, $parent: ID, $order: Int) { - treeAddElement(treeId: $treeId, element: $element, parent: $parent, order: $order) { - id - } - } -`; -export type AddTreeElementMutationFn = Apollo.MutationFunction; - -/** - * __useAddTreeElementMutation__ - * - * To run a mutation, you first call `useAddTreeElementMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAddTreeElementMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [addTreeElementMutation, { data, loading, error }] = useAddTreeElementMutation({ - * variables: { - * treeId: // value for 'treeId' - * element: // value for 'element' - * parent: // value for 'parent' - * order: // value for 'order' - * }, - * }); - */ -export function useAddTreeElementMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(AddTreeElementDocument, options); -} -export type AddTreeElementMutationHookResult = ReturnType; -export type AddTreeElementMutationResult = Apollo.MutationResult; -export type AddTreeElementMutationOptions = Apollo.BaseMutationOptions< - AddTreeElementMutation, - AddTreeElementMutationVariables ->; -export const MoveTreeElementDocument = gql` - mutation MOVE_TREE_ELEMENT($treeId: ID!, $nodeId: ID!, $parentTo: ID, $order: Int) { - treeMoveElement(treeId: $treeId, nodeId: $nodeId, parentTo: $parentTo, order: $order) { - id - } - } -`; -export type MoveTreeElementMutationFn = Apollo.MutationFunction< - MoveTreeElementMutation, - MoveTreeElementMutationVariables ->; - -/** - * __useMoveTreeElementMutation__ - * - * To run a mutation, you first call `useMoveTreeElementMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useMoveTreeElementMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [moveTreeElementMutation, { data, loading, error }] = useMoveTreeElementMutation({ - * variables: { - * treeId: // value for 'treeId' - * nodeId: // value for 'nodeId' - * parentTo: // value for 'parentTo' - * order: // value for 'order' - * }, - * }); - */ -export function useMoveTreeElementMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation( - MoveTreeElementDocument, - options - ); -} -export type MoveTreeElementMutationHookResult = ReturnType; -export type MoveTreeElementMutationResult = Apollo.MutationResult; -export type MoveTreeElementMutationOptions = Apollo.BaseMutationOptions< - MoveTreeElementMutation, - MoveTreeElementMutationVariables ->; -export const RemoveTreeElementDocument = gql` - mutation REMOVE_TREE_ELEMENT($treeId: ID!, $nodeId: ID!, $deleteChildren: Boolean) { - treeDeleteElement(treeId: $treeId, nodeId: $nodeId, deleteChildren: $deleteChildren) - } -`; -export type RemoveTreeElementMutationFn = Apollo.MutationFunction< - RemoveTreeElementMutation, - RemoveTreeElementMutationVariables ->; - -/** - * __useRemoveTreeElementMutation__ - * - * To run a mutation, you first call `useRemoveTreeElementMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useRemoveTreeElementMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [removeTreeElementMutation, { data, loading, error }] = useRemoveTreeElementMutation({ - * variables: { - * treeId: // value for 'treeId' - * nodeId: // value for 'nodeId' - * deleteChildren: // value for 'deleteChildren' - * }, - * }); - */ -export function useRemoveTreeElementMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation( - RemoveTreeElementDocument, - options - ); -} -export type RemoveTreeElementMutationHookResult = ReturnType; -export type RemoveTreeElementMutationResult = Apollo.MutationResult; -export type RemoveTreeElementMutationOptions = Apollo.BaseMutationOptions< - RemoveTreeElementMutation, - RemoveTreeElementMutationVariables ->; -export const UploadDocument = gql` - mutation UPLOAD($library: String!, $nodeId: String!, $files: [FileInput!]!) { - upload(library: $library, nodeId: $nodeId, files: $files) { - uid - record { - ...RecordIdentity - } - } - } - ${RecordIdentityFragmentDoc} -`; -export type UploadMutationFn = Apollo.MutationFunction; - -/** - * __useUploadMutation__ - * - * To run a mutation, you first call `useUploadMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUploadMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [uploadMutation, { data, loading, error }] = useUploadMutation({ - * variables: { - * library: // value for 'library' - * nodeId: // value for 'nodeId' - * files: // value for 'files' - * }, - * }); - */ -export function useUploadMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(UploadDocument, options); -} -export type UploadMutationHookResult = ReturnType; -export type UploadMutationResult = Apollo.MutationResult; -export type UploadMutationOptions = Apollo.BaseMutationOptions; -export const SaveUserDataDocument = gql` - mutation SAVE_USER_DATA($key: String!, $value: Any, $global: Boolean!) { - saveUserData(key: $key, value: $value, global: $global) { - global - data - } - } -`; -export type SaveUserDataMutationFn = Apollo.MutationFunction; - -/** - * __useSaveUserDataMutation__ - * - * To run a mutation, you first call `useSaveUserDataMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useSaveUserDataMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [saveUserDataMutation, { data, loading, error }] = useSaveUserDataMutation({ - * variables: { - * key: // value for 'key' - * value: // value for 'value' - * global: // value for 'global' - * }, - * }); - */ -export function useSaveUserDataMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(SaveUserDataDocument, options); -} -export type SaveUserDataMutationHookResult = ReturnType; -export type SaveUserDataMutationResult = Apollo.MutationResult; -export type SaveUserDataMutationOptions = Apollo.BaseMutationOptions< - SaveUserDataMutation, - SaveUserDataMutationVariables ->; -export const DeleteValueDocument = gql` - mutation DELETE_VALUE($library: ID!, $recordId: ID!, $attribute: ID!, $value: ValueInput) { - deleteValue(library: $library, recordId: $recordId, attribute: $attribute, value: $value) { - ...ValueDetails - } - } - ${ValueDetailsFragmentDoc} -`; -export type DeleteValueMutationFn = Apollo.MutationFunction; +export type DeleteTasksMutationOptions = Apollo.BaseMutationOptions; +export const AddTreeElementDocument = gql` + mutation ADD_TREE_ELEMENT($treeId: ID!, $element: TreeElementInput!, $parent: ID, $order: Int) { + treeAddElement( + treeId: $treeId + element: $element + parent: $parent + order: $order + ) { + id + } +} + `; +export type AddTreeElementMutationFn = Apollo.MutationFunction; /** - * __useDeleteValueMutation__ + * __useAddTreeElementMutation__ * - * To run a mutation, you first call `useDeleteValueMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteValueMutation` returns a tuple that includes: + * To run a mutation, you first call `useAddTreeElementMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAddTreeElementMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [deleteValueMutation, { data, loading, error }] = useDeleteValueMutation({ + * const [addTreeElementMutation, { data, loading, error }] = useAddTreeElementMutation({ * variables: { - * library: // value for 'library' - * recordId: // value for 'recordId' - * attribute: // value for 'attribute' - * value: // value for 'value' + * treeId: // value for 'treeId' + * element: // value for 'element' + * parent: // value for 'parent' + * order: // value for 'order' * }, * }); */ -export function useDeleteValueMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(DeleteValueDocument, options); -} -export type DeleteValueMutationHookResult = ReturnType; -export type DeleteValueMutationResult = Apollo.MutationResult; -export type DeleteValueMutationOptions = Apollo.BaseMutationOptions; -export const SaveValueBatchDocument = gql` - mutation SAVE_VALUE_BATCH( - $library: ID! - $recordId: ID! - $version: [ValueVersionInput!] - $values: [ValueBatchInput!]! - $deleteEmpty: Boolean - ) { - saveValueBatch( - library: $library - recordId: $recordId - version: $version - values: $values - deleteEmpty: $deleteEmpty - ) { - values { - ...ValueDetails - } - errors { - type - attribute - input - message - } - } - } - ${ValueDetailsFragmentDoc} -`; -export type SaveValueBatchMutationFn = Apollo.MutationFunction; +export function useAddTreeElementMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(AddTreeElementDocument, options); + } +export type AddTreeElementMutationHookResult = ReturnType; +export type AddTreeElementMutationResult = Apollo.MutationResult; +export type AddTreeElementMutationOptions = Apollo.BaseMutationOptions; +export const MoveTreeElementDocument = gql` + mutation MOVE_TREE_ELEMENT($treeId: ID!, $nodeId: ID!, $parentTo: ID, $order: Int) { + treeMoveElement( + treeId: $treeId + nodeId: $nodeId + parentTo: $parentTo + order: $order + ) { + id + } +} + `; +export type MoveTreeElementMutationFn = Apollo.MutationFunction; /** - * __useSaveValueBatchMutation__ + * __useMoveTreeElementMutation__ * - * To run a mutation, you first call `useSaveValueBatchMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useSaveValueBatchMutation` returns a tuple that includes: + * To run a mutation, you first call `useMoveTreeElementMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useMoveTreeElementMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [saveValueBatchMutation, { data, loading, error }] = useSaveValueBatchMutation({ + * const [moveTreeElementMutation, { data, loading, error }] = useMoveTreeElementMutation({ * variables: { - * library: // value for 'library' - * recordId: // value for 'recordId' - * version: // value for 'version' - * values: // value for 'values' - * deleteEmpty: // value for 'deleteEmpty' + * treeId: // value for 'treeId' + * nodeId: // value for 'nodeId' + * parentTo: // value for 'parentTo' + * order: // value for 'order' * }, * }); */ -export function useSaveValueBatchMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(SaveValueBatchDocument, options); +export function useMoveTreeElementMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(MoveTreeElementDocument, options); + } +export type MoveTreeElementMutationHookResult = ReturnType; +export type MoveTreeElementMutationResult = Apollo.MutationResult; +export type MoveTreeElementMutationOptions = Apollo.BaseMutationOptions; +export const RemoveTreeElementDocument = gql` + mutation REMOVE_TREE_ELEMENT($treeId: ID!, $nodeId: ID!, $deleteChildren: Boolean) { + treeDeleteElement( + treeId: $treeId + nodeId: $nodeId + deleteChildren: $deleteChildren + ) } -export type SaveValueBatchMutationHookResult = ReturnType; -export type SaveValueBatchMutationResult = Apollo.MutationResult; -export type SaveValueBatchMutationOptions = Apollo.BaseMutationOptions< - SaveValueBatchMutation, - SaveValueBatchMutationVariables ->; -export const DeleteViewDocument = gql` - mutation DELETE_VIEW($viewId: String!) { - deleteView(viewId: $viewId) { - id - library - } - } -`; -export type DeleteViewMutationFn = Apollo.MutationFunction; + `; +export type RemoveTreeElementMutationFn = Apollo.MutationFunction; /** - * __useDeleteViewMutation__ + * __useRemoveTreeElementMutation__ * - * To run a mutation, you first call `useDeleteViewMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteViewMutation` returns a tuple that includes: + * To run a mutation, you first call `useRemoveTreeElementMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useRemoveTreeElementMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [deleteViewMutation, { data, loading, error }] = useDeleteViewMutation({ + * const [removeTreeElementMutation, { data, loading, error }] = useRemoveTreeElementMutation({ * variables: { - * viewId: // value for 'viewId' + * treeId: // value for 'treeId' + * nodeId: // value for 'nodeId' + * deleteChildren: // value for 'deleteChildren' * }, * }); */ -export function useDeleteViewMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(DeleteViewDocument, options); +export function useRemoveTreeElementMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(RemoveTreeElementDocument, options); + } +export type RemoveTreeElementMutationHookResult = ReturnType; +export type RemoveTreeElementMutationResult = Apollo.MutationResult; +export type RemoveTreeElementMutationOptions = Apollo.BaseMutationOptions; +export const SaveUserDataDocument = gql` + mutation SAVE_USER_DATA($key: String!, $value: Any, $global: Boolean!) { + saveUserData(key: $key, value: $value, global: $global) { + global + data + } } -export type DeleteViewMutationHookResult = ReturnType; -export type DeleteViewMutationResult = Apollo.MutationResult; -export type DeleteViewMutationOptions = Apollo.BaseMutationOptions; -export const AddViewDocument = gql` - mutation ADD_VIEW($view: ViewInput!) { - saveView(view: $view) { - ...ViewDetails - } - } - ${ViewDetailsFragmentDoc} -`; -export type AddViewMutationFn = Apollo.MutationFunction; + `; +export type SaveUserDataMutationFn = Apollo.MutationFunction; /** - * __useAddViewMutation__ + * __useSaveUserDataMutation__ * - * To run a mutation, you first call `useAddViewMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAddViewMutation` returns a tuple that includes: + * To run a mutation, you first call `useSaveUserDataMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useSaveUserDataMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [addViewMutation, { data, loading, error }] = useAddViewMutation({ + * const [saveUserDataMutation, { data, loading, error }] = useSaveUserDataMutation({ * variables: { - * view: // value for 'view' + * key: // value for 'key' + * value: // value for 'value' + * global: // value for 'global' * }, * }); */ -export function useAddViewMutation( - baseOptions?: Apollo.MutationHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useMutation(AddViewDocument, options); -} -export type AddViewMutationHookResult = ReturnType; -export type AddViewMutationResult = Apollo.MutationResult; -export type AddViewMutationOptions = Apollo.BaseMutationOptions; +export function useSaveUserDataMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(SaveUserDataDocument, options); + } +export type SaveUserDataMutationHookResult = ReturnType; +export type SaveUserDataMutationResult = Apollo.MutationResult; +export type SaveUserDataMutationOptions = Apollo.BaseMutationOptions; export const GetApplicationByEndpointDocument = gql` query GET_APPLICATION_BY_ENDPOINT($endpoint: String!) { - applications(filters: {endpoint: $endpoint}) { - list { - ...ApplicationDetails - } - } + applications(filters: {endpoint: $endpoint}) { + list { + ...ApplicationDetails } - ${ApplicationDetailsFragmentDoc} -`; + } +} + ${ApplicationDetailsFragmentDoc}`; /** * __useGetApplicationByEndpointQuery__ @@ -4431,48 +1360,34 @@ export const GetApplicationByEndpointDocument = gql` * }, * }); */ -export function useGetApplicationByEndpointQuery( - baseOptions: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery( - GetApplicationByEndpointDocument, - options - ); -} -export function useGetApplicationByEndpointLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetApplicationByEndpointDocument, - options - ); -} +export function useGetApplicationByEndpointQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetApplicationByEndpointDocument, options); + } +export function useGetApplicationByEndpointLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetApplicationByEndpointDocument, options); + } export type GetApplicationByEndpointQueryHookResult = ReturnType; export type GetApplicationByEndpointLazyQueryHookResult = ReturnType; -export type GetApplicationByEndpointQueryResult = Apollo.QueryResult< - GetApplicationByEndpointQuery, - GetApplicationByEndpointQueryVariables ->; +export type GetApplicationByEndpointQueryResult = Apollo.QueryResult; export const GetApplicationsDocument = gql` query GET_APPLICATIONS { - applications { - list { - id - label - description - endpoint - url - color - icon { - ...RecordIdentity - } - } - } + applications { + list { + id + label + description + endpoint + url + color + icon { + ...RecordIdentity + } } - ${RecordIdentityFragmentDoc} -`; + } +} + ${RecordIdentityFragmentDoc}`; /** * __useGetApplicationsQuery__ @@ -4489,189 +1404,35 @@ export const GetApplicationsDocument = gql` * }, * }); */ -export function useGetApplicationsQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetApplicationsDocument, options); -} -export function useGetApplicationsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetApplicationsDocument, options); -} +export function useGetApplicationsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetApplicationsDocument, options); + } +export function useGetApplicationsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetApplicationsDocument, options); + } export type GetApplicationsQueryHookResult = ReturnType; export type GetApplicationsLazyQueryHookResult = ReturnType; export type GetApplicationsQueryResult = Apollo.QueryResult; -export const GetAttributesByLibDocument = gql` - query GET_ATTRIBUTES_BY_LIB($library: String!) { - attributes(filters: {libraries: [$library]}) { - list { - id - type - format - label - multiple_values - system - readonly - ... on LinkAttribute { - linked_library { - id - } - } - ... on TreeAttribute { - linked_tree { - id - label - libraries { - library { - id - label - } - } - } - } - ... on StandardAttribute { - embedded_fields { - id - format - label - } - } - } - } - } -`; - -/** - * __useGetAttributesByLibQuery__ - * - * To run a query within a React component, call `useGetAttributesByLibQuery` and pass it any options that fit your needs. - * When your component renders, `useGetAttributesByLibQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetAttributesByLibQuery({ - * variables: { - * library: // value for 'library' - * }, - * }); - */ -export function useGetAttributesByLibQuery( - baseOptions: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery( - GetAttributesByLibDocument, - options - ); -} -export function useGetAttributesByLibLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetAttributesByLibDocument, - options - ); -} -export type GetAttributesByLibQueryHookResult = ReturnType; -export type GetAttributesByLibLazyQueryHookResult = ReturnType; -export type GetAttributesByLibQueryResult = Apollo.QueryResult< - GetAttributesByLibQuery, - GetAttributesByLibQueryVariables ->; -export const GetVersionableAttributesByLibraryDocument = gql` - query GET_VERSIONABLE_ATTRIBUTES_BY_LIBRARY($libraryId: String!) { - attributes(filters: {libraries: [$libraryId], versionable: true}) { - list { - id - versions_conf { - versionable - profile { - id - trees { - id - label - } - } - } - } - } - } -`; - -/** - * __useGetVersionableAttributesByLibraryQuery__ - * - * To run a query within a React component, call `useGetVersionableAttributesByLibraryQuery` and pass it any options that fit your needs. - * When your component renders, `useGetVersionableAttributesByLibraryQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetVersionableAttributesByLibraryQuery({ - * variables: { - * libraryId: // value for 'libraryId' - * }, - * }); - */ -export function useGetVersionableAttributesByLibraryQuery( - baseOptions: Apollo.QueryHookOptions< - GetVersionableAttributesByLibraryQuery, - GetVersionableAttributesByLibraryQueryVariables - > -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery( - GetVersionableAttributesByLibraryDocument, - options - ); -} -export function useGetVersionableAttributesByLibraryLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - GetVersionableAttributesByLibraryQuery, - GetVersionableAttributesByLibraryQueryVariables - > -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetVersionableAttributesByLibraryDocument, - options - ); -} -export type GetVersionableAttributesByLibraryQueryHookResult = ReturnType< - typeof useGetVersionableAttributesByLibraryQuery ->; -export type GetVersionableAttributesByLibraryLazyQueryHookResult = ReturnType< - typeof useGetVersionableAttributesByLibraryLazyQuery ->; -export type GetVersionableAttributesByLibraryQueryResult = Apollo.QueryResult< - GetVersionableAttributesByLibraryQuery, - GetVersionableAttributesByLibraryQueryVariables ->; export const GetActiveLibraryDocument = gql` query GET_ACTIVE_LIBRARY { - activeLib @client { - id @client - name @client - behavior @client - attributes @client - trees - permissions @client { - access_library @client - access_record @client - create_record @client - edit_record @client - delete_record @client - } - } + activeLib @client { + id @client + name @client + behavior @client + attributes @client + trees + permissions @client { + access_library @client + access_record @client + create_record @client + edit_record @client + delete_record @client } -`; + } +} + `; /** * __useGetActiveLibraryQuery__ @@ -4688,41 +1449,34 @@ export const GetActiveLibraryDocument = gql` * }, * }); */ -export function useGetActiveLibraryQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetActiveLibraryDocument, options); -} -export function useGetActiveLibraryLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetActiveLibraryDocument, - options - ); -} +export function useGetActiveLibraryQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetActiveLibraryDocument, options); + } +export function useGetActiveLibraryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetActiveLibraryDocument, options); + } export type GetActiveLibraryQueryHookResult = ReturnType; export type GetActiveLibraryLazyQueryHookResult = ReturnType; export type GetActiveLibraryQueryResult = Apollo.QueryResult; export const GetActiveTreeDocument = gql` query GET_ACTIVE_TREE { - activeTree @client { - id @client - behavior @client - libraries @client { - id @client - behavior @client - } - label @client - permissions @client { - access_tree @client - edit_children @client - } - } + activeTree @client { + id @client + behavior @client + libraries @client { + id @client + behavior @client } -`; + label @client + permissions @client { + access_tree @client + edit_children @client + } + } +} + `; /** * __useGetActiveTreeQuery__ @@ -4739,179 +1493,22 @@ export const GetActiveTreeDocument = gql` * }, * }); */ -export function useGetActiveTreeQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetActiveTreeDocument, options); -} -export function useGetActiveTreeLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetActiveTreeDocument, options); -} +export function useGetActiveTreeQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetActiveTreeDocument, options); + } +export function useGetActiveTreeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetActiveTreeDocument, options); + } export type GetActiveTreeQueryHookResult = ReturnType; export type GetActiveTreeLazyQueryHookResult = ReturnType; export type GetActiveTreeQueryResult = Apollo.QueryResult; -export const GetLangAllDocument = gql` - query GET_LANG_ALL { - lang @client - availableLangs @client - defaultLang @client - } -`; - -/** - * __useGetLangAllQuery__ - * - * To run a query within a React component, call `useGetLangAllQuery` and pass it any options that fit your needs. - * When your component renders, `useGetLangAllQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetLangAllQuery({ - * variables: { - * }, - * }); - */ -export function useGetLangAllQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetLangAllDocument, options); -} -export function useGetLangAllLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetLangAllDocument, options); -} -export type GetLangAllQueryHookResult = ReturnType; -export type GetLangAllLazyQueryHookResult = ReturnType; -export type GetLangAllQueryResult = Apollo.QueryResult; -export const GetLangDocument = gql` - query GET_LANG { - lang @client - } -`; - -/** - * __useGetLangQuery__ - * - * To run a query within a React component, call `useGetLangQuery` and pass it any options that fit your needs. - * When your component renders, `useGetLangQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetLangQuery({ - * variables: { - * }, - * }); - */ -export function useGetLangQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetLangDocument, options); -} -export function useGetLangLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetLangDocument, options); -} -export type GetLangQueryHookResult = ReturnType; -export type GetLangLazyQueryHookResult = ReturnType; -export type GetLangQueryResult = Apollo.QueryResult; -export const GetAvailableLangsDocument = gql` - query GET_AVAILABLE_LANGS { - availableLangs @client - lang @client - } -`; - -/** - * __useGetAvailableLangsQuery__ - * - * To run a query within a React component, call `useGetAvailableLangsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetAvailableLangsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetAvailableLangsQuery({ - * variables: { - * }, - * }); - */ -export function useGetAvailableLangsQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetAvailableLangsDocument, options); -} -export function useGetAvailableLangsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetAvailableLangsDocument, - options - ); -} -export type GetAvailableLangsQueryHookResult = ReturnType; -export type GetAvailableLangsLazyQueryHookResult = ReturnType; -export type GetAvailableLangsQueryResult = Apollo.QueryResult; -export const GetUserDocument = gql` - query GET_USER { - userId @client - userPermissions @client - userWhoAmI @client { - id - label - subLabel - color - preview - library { - id - behavior - label - } - } - } -`; - -/** - * __useGetUserQuery__ - * - * To run a query within a React component, call `useGetUserQuery` and pass it any options that fit your needs. - * When your component renders, `useGetUserQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetUserQuery({ - * variables: { - * }, - * }); - */ -export function useGetUserQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetUserDocument, options); -} -export function useGetUserLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetUserDocument, options); -} -export type GetUserQueryHookResult = ReturnType; -export type GetUserLazyQueryHookResult = ReturnType; -export type GetUserQueryResult = Apollo.QueryResult; export const GetLangsDocument = gql` query GET_LANGS { - langs - } -`; + langs +} + `; /** * __useGetLangsQuery__ @@ -4929,255 +1526,27 @@ export const GetLangsDocument = gql` * }); */ export function useGetLangsQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetLangsDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLangsDocument, options); + } export function useGetLangsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetLangsDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLangsDocument, options); + } export type GetLangsQueryHookResult = ReturnType; export type GetLangsLazyQueryHookResult = ReturnType; export type GetLangsQueryResult = Apollo.QueryResult; -export const ExportDocument = gql` - query EXPORT($library: ID!, $attributes: [ID!], $filters: [RecordFilterInput!]) { - export(library: $library, attributes: $attributes, filters: $filters) - } -`; - -/** - * __useExportQuery__ - * - * To run a query within a React component, call `useExportQuery` and pass it any options that fit your needs. - * When your component renders, `useExportQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useExportQuery({ - * variables: { - * library: // value for 'library' - * attributes: // value for 'attributes' - * filters: // value for 'filters' - * }, - * }); - */ -export function useExportQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(ExportDocument, options); -} -export function useExportLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(ExportDocument, options); -} -export type ExportQueryHookResult = ReturnType; -export type ExportLazyQueryHookResult = ReturnType; -export type ExportQueryResult = Apollo.QueryResult; -export const RecordFormDocument = gql` - query RECORD_FORM($libraryId: String!, $formId: String!, $recordId: String, $version: [ValueVersionInput!]) { - recordForm(recordId: $recordId, libraryId: $libraryId, formId: $formId, version: $version) { - id - recordId - library { - id - } - dependencyAttributes { - id - } - elements { - id - containerId - uiElementType - type - valueError - values { - id_value - created_at - modified_at - created_by { - ...RecordIdentity - } - modified_by { - ...RecordIdentity - } - metadata { - name - value { - id_value - value - raw_value - } - } - version { - ...ValuesVersionDetails - } - ... on Value { - value - raw_value - } - ... on LinkValue { - linkValue: value { - ...RecordIdentity - } - } - ... on TreeValue { - treeValue: value { - id - record { - ...RecordIdentity - } - ancestors { - record { - ...RecordIdentity - } - } - } - } - } - attribute { - id - label - description - type - format - system - readonly - multiple_values - permissions(record: {id: $recordId, library: $libraryId}) { - access_attribute - edit_value - } - versions_conf { - versionable - profile { - id - trees { - id - label - } - } - } - metadata_fields { - id - label - description - type - format - system - readonly - multiple_values - permissions(record: {id: $recordId, library: $libraryId}) { - access_attribute - edit_value - } - values_list { - ...StandardValuesListFragment - } - metadata_fields { - id - } - } - ... on StandardAttribute { - values_list { - ...StandardValuesListFragment - } - } - ... on LinkAttribute { - linked_library { - id - label - behavior - permissions { - create_record - } - } - linkValuesList: values_list { - enable - allowFreeEntry - values { - ...RecordIdentity - } - } - } - ... on TreeAttribute { - linked_tree { - id - label - } - treeValuesList: values_list { - enable - allowFreeEntry - values { - id - record { - ...RecordIdentity - } - ancestors { - record { - ...RecordIdentity - } - } - } - } - } - } - settings { - key - value - } - } - } - } - ${RecordIdentityFragmentDoc} - ${ValuesVersionDetailsFragmentDoc} - ${StandardValuesListFragmentFragmentDoc} -`; - -/** - * __useRecordFormQuery__ - * - * To run a query within a React component, call `useRecordFormQuery` and pass it any options that fit your needs. - * When your component renders, `useRecordFormQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useRecordFormQuery({ - * variables: { - * libraryId: // value for 'libraryId' - * formId: // value for 'formId' - * recordId: // value for 'recordId' - * version: // value for 'version' - * }, - * }); - */ -export function useRecordFormQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(RecordFormDocument, options); -} -export function useRecordFormLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(RecordFormDocument, options); -} -export type RecordFormQueryHookResult = ReturnType; -export type RecordFormLazyQueryHookResult = ReturnType; -export type RecordFormQueryResult = Apollo.QueryResult; export const GetGlobalSettingsDocument = gql` query GET_GLOBAL_SETTINGS { - globalSettings { - name - icon { - id - ...RecordIdentity - } - } + globalSettings { + name + icon { + id + ...RecordIdentity } - ${RecordIdentityFragmentDoc} -`; + } +} + ${RecordIdentityFragmentDoc}`; /** * __useGetGlobalSettingsQuery__ @@ -5194,59 +1563,51 @@ export const GetGlobalSettingsDocument = gql` * }, * }); */ -export function useGetGlobalSettingsQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetGlobalSettingsDocument, options); -} -export function useGetGlobalSettingsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetGlobalSettingsDocument, - options - ); -} +export function useGetGlobalSettingsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetGlobalSettingsDocument, options); + } +export function useGetGlobalSettingsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetGlobalSettingsDocument, options); + } export type GetGlobalSettingsQueryHookResult = ReturnType; export type GetGlobalSettingsLazyQueryHookResult = ReturnType; export type GetGlobalSettingsQueryResult = Apollo.QueryResult; -export const GetLibrariesListDocument = gql` - query GET_LIBRARIES_LIST($filters: LibrariesFiltersInput) { - libraries(filters: $filters) { - list { - id - label - behavior - icon { - ...RecordIdentity - } - previewsSettings { - description - label - system - versions { - background - density - sizes { - name - size - } - } - } - permissions { - access_library - access_record - create_record - edit_record - delete_record - } - } +export const GetLibrariesListDocument = gql` + query GET_LIBRARIES_LIST($filters: LibrariesFiltersInput) { + libraries(filters: $filters) { + list { + id + label + behavior + icon { + ...RecordIdentity + } + previewsSettings { + description + label + system + versions { + background + density + sizes { + name + size + } } + } + permissions { + access_library + access_record + create_record + edit_record + delete_record + } } - ${RecordIdentityFragmentDoc} -`; + } +} + ${RecordIdentityFragmentDoc}`; /** * __useGetLibrariesListQuery__ @@ -5264,39 +1625,32 @@ export const GetLibrariesListDocument = gql` * }, * }); */ -export function useGetLibrariesListQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetLibrariesListDocument, options); -} -export function useGetLibrariesListLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetLibrariesListDocument, - options - ); -} +export function useGetLibrariesListQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLibrariesListDocument, options); + } +export function useGetLibrariesListLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLibrariesListDocument, options); + } export type GetLibrariesListQueryHookResult = ReturnType; export type GetLibrariesListLazyQueryHookResult = ReturnType; export type GetLibrariesListQueryResult = Apollo.QueryResult; export const GetLibraryPermissionsDocument = gql` query GET_LIBRARY_PERMISSIONS($libraryId: [ID!]) { - libraries(filters: {id: $libraryId}) { - list { - permissions { - access_library - access_record - create_record - edit_record - delete_record - } - } - } + libraries(filters: {id: $libraryId}) { + list { + permissions { + access_library + access_record + create_record + edit_record + delete_record + } } -`; + } +} + `; /** * __useGetLibraryPermissionsQuery__ @@ -5314,75 +1668,25 @@ export const GetLibraryPermissionsDocument = gql` * }, * }); */ -export function useGetLibraryPermissionsQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery( - GetLibraryPermissionsDocument, - options - ); -} -export function useGetLibraryPermissionsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetLibraryPermissionsDocument, - options - ); -} +export function useGetLibraryPermissionsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLibraryPermissionsDocument, options); + } +export function useGetLibraryPermissionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLibraryPermissionsDocument, options); + } export type GetLibraryPermissionsQueryHookResult = ReturnType; export type GetLibraryPermissionsLazyQueryHookResult = ReturnType; -export type GetLibraryPermissionsQueryResult = Apollo.QueryResult< - GetLibraryPermissionsQuery, - GetLibraryPermissionsQueryVariables ->; -export const NoopDocument = gql` - query NOOP { - __typename - } -`; - -/** - * __useNoopQuery__ - * - * To run a query within a React component, call `useNoopQuery` and pass it any options that fit your needs. - * When your component renders, `useNoopQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useNoopQuery({ - * variables: { - * }, - * }); - */ -export function useNoopQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(NoopDocument, options); -} -export function useNoopLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(NoopDocument, options); -} -export type NoopQueryHookResult = ReturnType; -export type NoopLazyQueryHookResult = ReturnType; -export type NoopQueryResult = Apollo.QueryResult; +export type GetLibraryPermissionsQueryResult = Apollo.QueryResult; export const IsAllowedDocument = gql` - query IS_ALLOWED( - $type: PermissionTypes! - $actions: [PermissionsActions!]! - $applyTo: ID - $target: PermissionTarget - ) { - isAllowed(type: $type, actions: $actions, applyTo: $applyTo, target: $target) { - name - allowed - } - } -`; + query IS_ALLOWED($type: PermissionTypes!, $actions: [PermissionsActions!]!, $applyTo: ID, $target: PermissionTarget) { + isAllowed(type: $type, actions: $actions, applyTo: $applyTo, target: $target) { + name + allowed + } +} + `; /** * __useIsAllowedQuery__ @@ -5404,271 +1708,53 @@ export const IsAllowedDocument = gql` * }); */ export function useIsAllowedQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(IsAllowedDocument, options); -} -export function useIsAllowedLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(IsAllowedDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(IsAllowedDocument, options); + } +export function useIsAllowedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(IsAllowedDocument, options); + } export type IsAllowedQueryHookResult = ReturnType; export type IsAllowedLazyQueryHookResult = ReturnType; export type IsAllowedQueryResult = Apollo.QueryResult; -export const DoesFileExistAsChildDocument = gql` - query DOES_FILE_EXIST_AS_CHILD($parentNode: ID, $treeId: ID!, $filename: String!) { - doesFileExistAsChild(parentNode: $parentNode, treeId: $treeId, filename: $filename) - } -`; - -/** - * __useDoesFileExistAsChildQuery__ - * - * To run a query within a React component, call `useDoesFileExistAsChildQuery` and pass it any options that fit your needs. - * When your component renders, `useDoesFileExistAsChildQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useDoesFileExistAsChildQuery({ - * variables: { - * parentNode: // value for 'parentNode' - * treeId: // value for 'treeId' - * filename: // value for 'filename' - * }, - * }); - */ -export function useDoesFileExistAsChildQuery( - baseOptions: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery( - DoesFileExistAsChildDocument, - options - ); -} -export function useDoesFileExistAsChildLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - DoesFileExistAsChildDocument, - options - ); -} -export type DoesFileExistAsChildQueryHookResult = ReturnType; -export type DoesFileExistAsChildLazyQueryHookResult = ReturnType; -export type DoesFileExistAsChildQueryResult = Apollo.QueryResult< - DoesFileExistAsChildQuery, - DoesFileExistAsChildQueryVariables ->; -export const GetDirectoryDataDocument = gql` - query GET_DIRECTORY_DATA($library: ID!, $directoryId: String!) { - records(library: $library, filters: [{field: "id", value: $directoryId, condition: EQUAL}]) { - list { - ...RecordIdentity - created_at: property(attribute: "created_at") { - ... on Value { - value - } - } - created_by: property(attribute: "created_by") { - ... on LinkValue { - value { - ...RecordIdentity - } - } - } - modified_at: property(attribute: "modified_at") { - ... on Value { - value - } - } - modified_by: property(attribute: "modified_by") { - ... on LinkValue { - value { - ...RecordIdentity - } - } - } - file_name: property(attribute: "file_name") { - ... on Value { - value - } - } - file_path: property(attribute: "file_path") { - ... on Value { - value - } - } - library { - behavior - } - } - } - } - ${RecordIdentityFragmentDoc} -`; - -/** - * __useGetDirectoryDataQuery__ - * - * To run a query within a React component, call `useGetDirectoryDataQuery` and pass it any options that fit your needs. - * When your component renders, `useGetDirectoryDataQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetDirectoryDataQuery({ - * variables: { - * library: // value for 'library' - * directoryId: // value for 'directoryId' - * }, - * }); - */ -export function useGetDirectoryDataQuery( - baseOptions: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetDirectoryDataDocument, options); -} -export function useGetDirectoryDataLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetDirectoryDataDocument, - options - ); -} -export type GetDirectoryDataQueryHookResult = ReturnType; -export type GetDirectoryDataLazyQueryHookResult = ReturnType; -export type GetDirectoryDataQueryResult = Apollo.QueryResult; -export const GetFileDataDocument = gql` - query GET_FILE_DATA($library: ID!, $fileId: String!, $previewsStatusAttribute: ID!) { - records(library: $library, filters: [{field: "id", value: $fileId, condition: EQUAL}]) { - list { - ...RecordIdentity - created_at: property(attribute: "created_at") { - ... on Value { - value - } - } - created_by: property(attribute: "created_by") { - ... on LinkValue { - value { - ...RecordIdentity - } - } - } - modified_at: property(attribute: "modified_at") { - ... on Value { - value - } - } - modified_by: property(attribute: "modified_by") { - ... on LinkValue { - value { - ...RecordIdentity - } - } - } - file_name: property(attribute: "file_name") { - ... on Value { - value - } - } - file_path: property(attribute: "file_path") { - ... on Value { - value - } - } - previews_status: property(attribute: $previewsStatusAttribute) { - ... on Value { - value - } - } - library { - behavior - } - } - } - } - ${RecordIdentityFragmentDoc} -`; - -/** - * __useGetFileDataQuery__ - * - * To run a query within a React component, call `useGetFileDataQuery` and pass it any options that fit your needs. - * When your component renders, `useGetFileDataQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetFileDataQuery({ - * variables: { - * library: // value for 'library' - * fileId: // value for 'fileId' - * previewsStatusAttribute: // value for 'previewsStatusAttribute' - * }, - * }); - */ -export function useGetFileDataQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetFileDataDocument, options); -} -export function useGetFileDataLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetFileDataDocument, options); -} -export type GetFileDataQueryHookResult = ReturnType; -export type GetFileDataLazyQueryHookResult = ReturnType; -export type GetFileDataQueryResult = Apollo.QueryResult; export const GetTasksDocument = gql` query GET_TASKS($filters: TaskFiltersInput) { - tasks(filters: $filters) { - totalCount - list { - id - label - modified_at - created_at - created_by { - ...RecordIdentity - } - startAt - status - priority - role { - type - detail - } - progress { - percent - description - } - startedAt - completedAt - link { - name - url - } - canceledBy { - ...RecordIdentity - } - archive - } - } + tasks(filters: $filters) { + totalCount + list { + id + label + modified_at + created_at + created_by { + ...RecordIdentity + } + startAt + status + priority + role { + type + detail + } + progress { + percent + description + } + startedAt + completedAt + link { + name + url + } + canceledBy { + ...RecordIdentity + } + archive } - ${RecordIdentityFragmentDoc} -`; + } +} + ${RecordIdentityFragmentDoc}`; /** * __useGetTasksQuery__ @@ -5687,56 +1773,56 @@ export const GetTasksDocument = gql` * }); */ export function useGetTasksQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetTasksDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetTasksDocument, options); + } export function useGetTasksLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetTasksDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetTasksDocument, options); + } export type GetTasksQueryHookResult = ReturnType; export type GetTasksLazyQueryHookResult = ReturnType; export type GetTasksQueryResult = Apollo.QueryResult; export const GetTreeAttributesQueryDocument = gql` query GET_TREE_ATTRIBUTES_QUERY($treeId: [ID!]) { - trees(filters: {id: $treeId}) { - list { + trees(filters: {id: $treeId}) { + list { + id + libraries { + library { + id + label + attributes { + id + type + format + label + multiple_values + ... on StandardAttribute { + embedded_fields { + id + format + label + } + } + ... on LinkAttribute { + linked_library { + id + } + } + ... on TreeAttribute { + linked_tree { id - libraries { - library { - id - label - attributes { - id - type - format - label - multiple_values - ... on StandardAttribute { - embedded_fields { - id - format - label - } - } - ... on LinkAttribute { - linked_library { - id - } - } - ... on TreeAttribute { - linked_tree { - id - label - } - } - } - } - } + label + } } + } } + } } -`; + } +} + `; /** * __useGetTreeAttributesQueryQuery__ @@ -5754,55 +1840,42 @@ export const GetTreeAttributesQueryDocument = gql` * }, * }); */ -export function useGetTreeAttributesQueryQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery( - GetTreeAttributesQueryDocument, - options - ); -} -export function useGetTreeAttributesQueryLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetTreeAttributesQueryDocument, - options - ); -} +export function useGetTreeAttributesQueryQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetTreeAttributesQueryDocument, options); + } +export function useGetTreeAttributesQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetTreeAttributesQueryDocument, options); + } export type GetTreeAttributesQueryQueryHookResult = ReturnType; export type GetTreeAttributesQueryLazyQueryHookResult = ReturnType; -export type GetTreeAttributesQueryQueryResult = Apollo.QueryResult< - GetTreeAttributesQueryQuery, - GetTreeAttributesQueryQueryVariables ->; +export type GetTreeAttributesQueryQueryResult = Apollo.QueryResult; export const GetTreeLibrariesDocument = gql` query GET_TREE_LIBRARIES($treeId: [ID!], $library: String) { - trees(filters: {id: $treeId, library: $library}) { - totalCount - list { - id - behavior - system - libraries { - library { - id - label - behavior - system - } - settings { - allowMultiplePositions - allowedChildren - allowedAtRoot - } - } - } + trees(filters: {id: $treeId, library: $library}) { + totalCount + list { + id + behavior + system + libraries { + library { + id + label + behavior + system + } + settings { + allowMultiplePositions + allowedChildren + allowedAtRoot } + } } -`; + } +} + `; /** * __useGetTreeLibrariesQuery__ @@ -5821,46 +1894,39 @@ export const GetTreeLibrariesDocument = gql` * }, * }); */ -export function useGetTreeLibrariesQuery( - baseOptions?: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetTreeLibrariesDocument, options); -} -export function useGetTreeLibrariesLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - GetTreeLibrariesDocument, - options - ); -} +export function useGetTreeLibrariesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetTreeLibrariesDocument, options); + } +export function useGetTreeLibrariesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetTreeLibrariesDocument, options); + } export type GetTreeLibrariesQueryHookResult = ReturnType; export type GetTreeLibrariesLazyQueryHookResult = ReturnType; export type GetTreeLibrariesQueryResult = Apollo.QueryResult; export const GetTreesDocument = gql` query GET_TREES($filters: TreesFiltersInput) { - trees(filters: $filters) { - list { - id - label - libraries { - library { - id - label - behavior - } - } - behavior - permissions { - access_tree - edit_children - } - } + trees(filters: $filters) { + list { + id + label + libraries { + library { + id + label + behavior } + } + behavior + permissions { + access_tree + edit_children + } } -`; + } +} + `; /** * __useGetTreesQuery__ @@ -5879,41 +1945,40 @@ export const GetTreesDocument = gql` * }); */ export function useGetTreesQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetTreesDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetTreesDocument, options); + } export function useGetTreesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetTreesDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetTreesDocument, options); + } export type GetTreesQueryHookResult = ReturnType; export type GetTreesLazyQueryHookResult = ReturnType; export type GetTreesQueryResult = Apollo.QueryResult; export const TreeNodeChildrenDocument = gql` query TREE_NODE_CHILDREN($treeId: ID!, $node: ID, $pagination: Pagination) { - treeNodeChildren(treeId: $treeId, node: $node, pagination: $pagination) { - totalCount - list { - id - childrenCount - record { - ...RecordIdentity - active: property(attribute: "active") { - ... on Value { - value - } - } - } - permissions { - access_tree - detach - edit_children - } - } + treeNodeChildren(treeId: $treeId, node: $node, pagination: $pagination) { + totalCount + list { + id + childrenCount + record { + ...RecordIdentity + active: property(attribute: "active") { + ... on Value { + value + } } + } + permissions { + access_tree + detach + edit_children + } } - ${RecordIdentityFragmentDoc} -`; + } +} + ${RecordIdentityFragmentDoc}`; /** * __useTreeNodeChildrenQuery__ @@ -5933,32 +1998,25 @@ export const TreeNodeChildrenDocument = gql` * }, * }); */ -export function useTreeNodeChildrenQuery( - baseOptions: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(TreeNodeChildrenDocument, options); -} -export function useTreeNodeChildrenLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery( - TreeNodeChildrenDocument, - options - ); -} +export function useTreeNodeChildrenQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(TreeNodeChildrenDocument, options); + } +export function useTreeNodeChildrenLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(TreeNodeChildrenDocument, options); + } export type TreeNodeChildrenQueryHookResult = ReturnType; export type TreeNodeChildrenLazyQueryHookResult = ReturnType; export type TreeNodeChildrenQueryResult = Apollo.QueryResult; export const GetUserDataDocument = gql` query GET_USER_DATA($keys: [String!]!, $global: Boolean) { - userData(keys: $keys, global: $global) { - global - data - } - } -`; + userData(keys: $keys, global: $global) { + global + data + } +} + `; /** * __useGetUserDataQuery__ @@ -5978,26 +2036,23 @@ export const GetUserDataDocument = gql` * }); */ export function useGetUserDataQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetUserDataDocument, options); -} -export function useGetUserDataLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetUserDataDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetUserDataDocument, options); + } +export function useGetUserDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetUserDataDocument, options); + } export type GetUserDataQueryHookResult = ReturnType; export type GetUserDataLazyQueryHookResult = ReturnType; export type GetUserDataQueryResult = Apollo.QueryResult; export const MeDocument = gql` query ME { - me { - ...RecordIdentity - } - } - ${RecordIdentityFragmentDoc} -`; + me { + ...RecordIdentity + } +} + ${RecordIdentityFragmentDoc}`; /** * __useMeQuery__ @@ -6015,106 +2070,26 @@ export const MeDocument = gql` * }); */ export function useMeQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(MeDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MeDocument, options); + } export function useMeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(MeDocument, options); -} + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MeDocument, options); + } export type MeQueryHookResult = ReturnType; export type MeLazyQueryHookResult = ReturnType; export type MeQueryResult = Apollo.QueryResult; -export const GetViewDocument = gql` - query GET_VIEW($viewId: String!) { - view(viewId: $viewId) { - ...ViewDetails - } - } - ${ViewDetailsFragmentDoc} -`; - -/** - * __useGetViewQuery__ - * - * To run a query within a React component, call `useGetViewQuery` and pass it any options that fit your needs. - * When your component renders, `useGetViewQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetViewQuery({ - * variables: { - * viewId: // value for 'viewId' - * }, - * }); - */ -export function useGetViewQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetViewDocument, options); -} -export function useGetViewLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetViewDocument, options); -} -export type GetViewQueryHookResult = ReturnType; -export type GetViewLazyQueryHookResult = ReturnType; -export type GetViewQueryResult = Apollo.QueryResult; -export const GetViewsListDocument = gql` - query GET_VIEWS_LIST($libraryId: String!) { - views(library: $libraryId) { - totalCount - list { - ...ViewDetails - } - } - } - ${ViewDetailsFragmentDoc} -`; - -/** - * __useGetViewsListQuery__ - * - * To run a query within a React component, call `useGetViewsListQuery` and pass it any options that fit your needs. - * When your component renders, `useGetViewsListQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetViewsListQuery({ - * variables: { - * libraryId: // value for 'libraryId' - * }, - * }); - */ -export function useGetViewsListQuery( - baseOptions: Apollo.QueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useQuery(GetViewsListDocument, options); -} -export function useGetViewsListLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useLazyQuery(GetViewsListDocument, options); -} -export type GetViewsListQueryHookResult = ReturnType; -export type GetViewsListLazyQueryHookResult = ReturnType; -export type GetViewsListQueryResult = Apollo.QueryResult; export const ApplicationEventsDocument = gql` subscription APPLICATION_EVENTS($filters: ApplicationEventFiltersInput) { - applicationEvent(filters: $filters) { - type - application { - ...ApplicationDetails - } - } + applicationEvent(filters: $filters) { + type + application { + ...ApplicationDetails } - ${ApplicationDetailsFragmentDoc} -`; + } +} + ${ApplicationDetailsFragmentDoc}`; /** * __useApplicationEventsSubscription__ @@ -6132,104 +2107,46 @@ export const ApplicationEventsDocument = gql` * }, * }); */ -export function useApplicationEventsSubscription( - baseOptions?: Apollo.SubscriptionHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useSubscription( - ApplicationEventsDocument, - options - ); -} +export function useApplicationEventsSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(ApplicationEventsDocument, options); + } export type ApplicationEventsSubscriptionHookResult = ReturnType; export type ApplicationEventsSubscriptionResult = Apollo.SubscriptionResult; -export const SubRecordUpdateDocument = gql` - subscription SUB_RECORD_UPDATE($filters: RecordUpdateFilterInput) { - recordUpdate(filters: $filters) { - record { - ...RecordIdentity - modified_by: property(attribute: "modified_by") { - ... on LinkValue { - value { - ...RecordIdentity - } - } - } - } - updatedValues { - attribute - value { - ...ValueDetails - } - } - } - } - ${RecordIdentityFragmentDoc} - ${ValueDetailsFragmentDoc} -`; - -/** - * __useSubRecordUpdateSubscription__ - * - * To run a query within a React component, call `useSubRecordUpdateSubscription` and pass it any options that fit your needs. - * When your component renders, `useSubRecordUpdateSubscription` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useSubRecordUpdateSubscription({ - * variables: { - * filters: // value for 'filters' - * }, - * }); - */ -export function useSubRecordUpdateSubscription( - baseOptions?: Apollo.SubscriptionHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useSubscription( - SubRecordUpdateDocument, - options - ); -} -export type SubRecordUpdateSubscriptionHookResult = ReturnType; -export type SubRecordUpdateSubscriptionResult = Apollo.SubscriptionResult; export const SubTasksUpdateDocument = gql` subscription SUB_TASKS_UPDATE($filters: TaskFiltersInput) { - task(filters: $filters) { - id - label - modified_at - created_at - created_by { - ...RecordIdentity - } - startAt - status - priority - role { - type - detail - } - progress { - percent - description - } - startedAt - completedAt - link { - name - url - } - canceledBy { - ...RecordIdentity - } - archive - } + task(filters: $filters) { + id + label + modified_at + created_at + created_by { + ...RecordIdentity + } + startAt + status + priority + role { + type + detail + } + progress { + percent + description + } + startedAt + completedAt + link { + name + url } - ${RecordIdentityFragmentDoc} -`; + canceledBy { + ...RecordIdentity + } + archive + } +} + ${RecordIdentityFragmentDoc}`; /** * __useSubTasksUpdateSubscription__ @@ -6247,44 +2164,38 @@ export const SubTasksUpdateDocument = gql` * }, * }); */ -export function useSubTasksUpdateSubscription( - baseOptions?: Apollo.SubscriptionHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useSubscription( - SubTasksUpdateDocument, - options - ); -} +export function useSubTasksUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(SubTasksUpdateDocument, options); + } export type SubTasksUpdateSubscriptionHookResult = ReturnType; export type SubTasksUpdateSubscriptionResult = Apollo.SubscriptionResult; export const TreeEventsDocument = gql` subscription TREE_EVENTS($filters: TreeEventFiltersInput) { - treeEvent(filters: $filters) { - type - treeId - element { - id - childrenCount - record { - ...RecordIdentity - } - permissions { - access_tree - detach - edit_children - } - } - parentNode { - id - } - parentNodeBefore { - id - } - } + treeEvent(filters: $filters) { + type + treeId + element { + id + childrenCount + record { + ...RecordIdentity + } + permissions { + access_tree + detach + edit_children + } + } + parentNode { + id } - ${RecordIdentityFragmentDoc} -`; + parentNodeBefore { + id + } + } +} + ${RecordIdentityFragmentDoc}`; /** * __useTreeEventsSubscription__ @@ -6302,57 +2213,9 @@ export const TreeEventsDocument = gql` * }, * }); */ -export function useTreeEventsSubscription( - baseOptions?: Apollo.SubscriptionHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useSubscription(TreeEventsDocument, options); -} +export function useTreeEventsSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(TreeEventsDocument, options); + } export type TreeEventsSubscriptionHookResult = ReturnType; -export type TreeEventsSubscriptionResult = Apollo.SubscriptionResult; -export const SubUploadUpdateDocument = gql` - subscription SUB_UPLOAD_UPDATE($filters: UploadFiltersInput) { - upload(filters: $filters) { - userId - progress { - length - transferred - speed - runtime - remaining - percentage - eta - delta - } - uid - } - } -`; - -/** - * __useSubUploadUpdateSubscription__ - * - * To run a query within a React component, call `useSubUploadUpdateSubscription` and pass it any options that fit your needs. - * When your component renders, `useSubUploadUpdateSubscription` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useSubUploadUpdateSubscription({ - * variables: { - * filters: // value for 'filters' - * }, - * }); - */ -export function useSubUploadUpdateSubscription( - baseOptions?: Apollo.SubscriptionHookOptions -) { - const options = {...defaultOptions, ...baseOptions}; - return Apollo.useSubscription( - SubUploadUpdateDocument, - options - ); -} -export type SubUploadUpdateSubscriptionHookResult = ReturnType; -export type SubUploadUpdateSubscriptionResult = Apollo.SubscriptionResult; +export type TreeEventsSubscriptionResult = Apollo.SubscriptionResult; \ No newline at end of file diff --git a/docker/docker-compose.override.yml b/docker/docker-compose.override.yml new file mode 100644 index 000000000..544bec00c --- /dev/null +++ b/docker/docker-compose.override.yml @@ -0,0 +1,3 @@ +version: "3.4" + +name: "leav-engine" \ No newline at end of file diff --git a/libs/ui/src/__mocks__/common/attribute.ts b/libs/ui/src/__mocks__/common/attribute.ts index 69bb26ab7..fbc4f601e 100644 --- a/libs/ui/src/__mocks__/common/attribute.ts +++ b/libs/ui/src/__mocks__/common/attribute.ts @@ -40,6 +40,7 @@ export const mockAttributeWithDetails: AttributeDetailsFragment = { fr: 'Mon attribut', en: 'My attribute' }, + required: false, format: AttributeFormat.text, type: AttributeType.simple, system: false, diff --git a/libs/ui/src/_gqlTypes/index.ts b/libs/ui/src/_gqlTypes/index.ts index 62e3c5b20..cec0c66bb 100644 --- a/libs/ui/src/_gqlTypes/index.ts +++ b/libs/ui/src/_gqlTypes/index.ts @@ -1,6 +1,3 @@ -// Copyright LEAV Solutions 2017 -// This file is released under LGPL V3 -// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt import {IPreviewScalar} from '@leav/utils' import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; @@ -870,11 +867,11 @@ export type DetailsApplicationFragment = { id: string, label: any, type: Applica export type RecordIdentityFragment = { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }; -export type AttributeDetailsLinkAttributeFragment = { reverse_link?: string | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, linked_library?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }; +export type AttributeDetailsLinkAttributeFragment = { reverse_link?: string | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, linked_library?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }; -export type AttributeDetailsStandardAttributeFragment = { unique?: boolean | null, maxLength?: number | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }; +export type AttributeDetailsStandardAttributeFragment = { unique?: boolean | null, maxLength?: number | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }; -export type AttributeDetailsTreeAttributeFragment = { id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }; +export type AttributeDetailsTreeAttributeFragment = { id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }; export type AttributeDetailsFragment = AttributeDetailsLinkAttributeFragment | AttributeDetailsStandardAttributeFragment | AttributeDetailsTreeAttributeFragment; @@ -900,13 +897,13 @@ export type LibraryLinkAttributeDetailsFragment = { linked_library?: { id: strin export type LibraryPreviewsSettingsFragment = { label: any, description?: any | null, system: boolean, versions: { background: string, density: number, sizes: Array<{ name: string, size: number }> } }; -export type RecordFormElementFragment = { id: string, containerId: string, uiElementType: string, type: FormElementTypes, valueError?: string | null, values?: Array<{ id_value?: string | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }> | null, attribute?: { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_library?: { id: string, label?: any | null, behavior: LibraryBehavior, permissions?: { create_record: boolean } | null } | null, linkValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, treeValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | null, settings: Array<{ key: string, value: any }> }; +export type RecordFormElementFragment = { id: string, containerId: string, uiElementType: string, type: FormElementTypes, valueError?: string | null, values?: Array<{ id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }> | null, attribute?: { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_library?: { id: string, label?: any | null, behavior: LibraryBehavior, permissions?: { create_record: boolean } | null } | null, linkValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, treeValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | null, settings: Array<{ key: string, value: any }> }; -export type ValueDetailsLinkValueFragment = { id_value?: string | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }; +export type ValueDetailsLinkValueFragment = { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }; -export type ValueDetailsTreeValueFragment = { id_value?: string | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }; +export type ValueDetailsTreeValueFragment = { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }; -export type ValueDetailsValueFragment = { value?: any | null, raw_value?: any | null, id_value?: string | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }; +export type ValueDetailsValueFragment = { value?: any | null, raw_value?: any | null, id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }; export type ValueDetailsFragment = ValueDetailsLinkValueFragment | ValueDetailsTreeValueFragment | ValueDetailsValueFragment; @@ -980,7 +977,7 @@ export type GetAttributeByIdQueryVariables = Exact<{ }>; -export type GetAttributeByIdQuery = { attributes?: { list: Array<{ reverse_link?: string | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, linked_library?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { unique?: boolean | null, maxLength?: number | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }> } | null }; +export type GetAttributeByIdQuery = { attributes?: { list: Array<{ reverse_link?: string | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, linked_library?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { unique?: boolean | null, maxLength?: number | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null }> } | null }; export type GetAttributesByLibQueryVariables = Exact<{ library: Scalars['String']; @@ -1018,7 +1015,7 @@ export type SaveAttributeMutationVariables = Exact<{ }>; -export type SaveAttributeMutation = { saveAttribute: { reverse_link?: string | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, linked_library?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { unique?: boolean | null, maxLength?: number | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, description?: any | null, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } }; +export type SaveAttributeMutation = { saveAttribute: { reverse_link?: string | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, linked_library?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { unique?: boolean | null, maxLength?: number | null, id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } | { id: string, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, label?: any | null, required: boolean, description?: any | null, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, type: AttributeType, format?: AttributeFormat | null }> | null, versions_conf?: { versionable: boolean, mode?: ValueVersionMode | null, profile?: { id: string, label: any, trees: Array<{ id: string, label?: any | null }> } | null } | null, libraries?: Array<{ id: string, label?: any | null }> | null } }; export type ExportQueryVariables = Exact<{ library: Scalars['ID']; @@ -1182,14 +1179,14 @@ export type RecordFormQueryVariables = Exact<{ }>; -export type RecordFormQuery = { recordForm?: { id: string, recordId?: string | null, library: { id: string }, dependencyAttributes?: Array<{ id: string }> | null, elements: Array<{ id: string, containerId: string, uiElementType: string, type: FormElementTypes, valueError?: string | null, values?: Array<{ id_value?: string | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }> | null, attribute?: { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_library?: { id: string, label?: any | null, behavior: LibraryBehavior, permissions?: { create_record: boolean } | null } | null, linkValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, treeValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | null, settings: Array<{ key: string, value: any }> }> } | null }; +export type RecordFormQuery = { recordForm?: { id: string, recordId?: string | null, library: { id: string }, dependencyAttributes?: Array<{ id: string }> | null, elements: Array<{ id: string, containerId: string, uiElementType: string, type: FormElementTypes, valueError?: string | null, values?: Array<{ id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }> | null, attribute?: { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_library?: { id: string, label?: any | null, behavior: LibraryBehavior, permissions?: { create_record: boolean } | null } | null, linkValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | { id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, linked_tree?: { id: string, label?: any | null } | null, treeValuesList?: { enable: boolean, allowFreeEntry?: boolean | null, values?: Array<{ id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null }> | null } | null, permissions: { access_attribute: boolean, edit_value: boolean }, versions_conf?: { versionable: boolean, profile?: { id: string, trees: Array<{ id: string, label?: any | null }> } | null } | null, metadata_fields?: Array<{ id: string, label?: any | null, description?: any | null, type: AttributeType, format?: AttributeFormat | null, system: boolean, readonly: boolean, multiple_values: boolean, permissions: { access_attribute: boolean, edit_value: boolean }, values_list?: { enable: boolean, allowFreeEntry?: boolean | null, dateRangeValues?: Array<{ from?: string | null, to?: string | null }> | null } | { enable: boolean, allowFreeEntry?: boolean | null, values?: Array | null } | null, metadata_fields?: Array<{ id: string }> | null }> | null } | null, settings: Array<{ key: string, value: any }> }> } | null }; export type RecordUpdateSubscriptionVariables = Exact<{ filters?: InputMaybe; }>; -export type RecordUpdateSubscription = { recordUpdate: { record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } }, modified_by?: Array<{ value?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null }> | null }, updatedValues: Array<{ attribute: string, value: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } }> } }; +export type RecordUpdateSubscription = { recordUpdate: { record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } }, modified_by?: Array<{ value?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null }> | null }, updatedValues: Array<{ attribute: string, value: { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } }> } }; export type IndexRecordsMutationVariables = Exact<{ libraryId: Scalars['String']; @@ -1281,7 +1278,7 @@ export type DeleteValueMutationVariables = Exact<{ }>; -export type DeleteValueMutation = { deleteValue: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } }; +export type DeleteValueMutation = { deleteValue: Array<{ id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }> }; export type SaveValueBatchMutationVariables = Exact<{ library: Scalars['ID']; @@ -1292,7 +1289,7 @@ export type SaveValueBatchMutationVariables = Exact<{ }>; -export type SaveValueBatchMutation = { saveValueBatch: { values?: Array<{ id_value?: string | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }> | null, errors?: Array<{ type: string, attribute: string, input?: string | null, message: string }> | null } }; +export type SaveValueBatchMutation = { saveValueBatch: { values?: Array<{ id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, linkValue?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, treeValue?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } }, ancestors?: Array<{ record: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } }> | null } | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null } | { value?: any | null, raw_value?: any | null, id_value?: string | null, isInherited?: boolean | null, modified_at?: number | null, created_at?: number | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null, attribute?: { id: string, format?: AttributeFormat | null, type: AttributeType, system: boolean } | null, metadata?: Array<{ name: string, value?: { id_value?: string | null, modified_at?: number | null, created_at?: number | null, value?: any | null, raw_value?: any | null, modified_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, created_by?: { id: string, whoAmI: { id: string, label?: string | null, subLabel?: string | null, color?: string | null, preview?: IPreviewScalar | null, library: { id: string, label?: any | null } } } | null, version?: Array<{ treeId: string, treeNode?: { id: string, record: { id: string, whoAmI: { id: string, label?: string | null, library: { id: string } } } } | null } | null> | null } | null } | null> | null }> | null, errors?: Array<{ type: string, attribute: string, input?: string | null, message: string }> | null } }; export type DeleteViewMutationVariables = Exact<{ viewId: Scalars['String']; @@ -1366,6 +1363,7 @@ export const AttributeDetailsFragmentDoc = gql` system readonly label + required description multiple_values metadata_fields { @@ -1565,6 +1563,7 @@ export const ValuesVersionDetailsFragmentDoc = gql` export const ValueDetailsFragmentDoc = gql` fragment ValueDetails on GenericValue { id_value + isInherited modified_at modified_by { ...RecordIdentity diff --git a/libs/ui/src/_queries/values/valueDetailsFragment.ts b/libs/ui/src/_queries/values/valueDetailsFragment.ts index c5fbddcae..f67287cc9 100644 --- a/libs/ui/src/_queries/values/valueDetailsFragment.ts +++ b/libs/ui/src/_queries/values/valueDetailsFragment.ts @@ -6,10 +6,11 @@ import {recordIdentityFragment} from '../../gqlFragments'; import {valuesVersionDetailsFragment} from './valuesVersionFragment'; export const valueDetailsFragment = gql` - ${recordIdentityFragment} + ${recordIdentityFragment} ${valuesVersionDetailsFragment} fragment ValueDetails on GenericValue { id_value + isInherited modified_at modified_by { ...RecordIdentity diff --git a/libs/ui/src/components/RecordEdition/EditRecordContent/antdUtils.tsx b/libs/ui/src/components/RecordEdition/EditRecordContent/antdUtils.tsx index 61b97a98a..b7708e5f9 100644 --- a/libs/ui/src/components/RecordEdition/EditRecordContent/antdUtils.tsx +++ b/libs/ui/src/components/RecordEdition/EditRecordContent/antdUtils.tsx @@ -12,6 +12,9 @@ import dayjs from 'dayjs'; const hasDateRangeValues = (dateRange: unknown): dateRange is IDateRangeValue => (dateRange as IDateRangeValue).from !== undefined && (dateRange as IDateRangeValue).to !== undefined; +const getinHeritedValue = (values) => values.find((value) => value.isInherited); +const getNotInheritedValue = (values) => values.find((value) => !value.isInherited && value.raw_value !== null); + const isRecordFormElementsValueLinkValue = ( value: RecordFormElementsValue, attribute: IRecordForm['elements'][0]['attribute'] @@ -24,7 +27,8 @@ export const getAntdFormInitialValues = (recordForm: IRecordForm) => if (!attribute) { return acc; } - const value = values[0]; + + const value = getNotInheritedValue(values) || getinHeritedValue(values) || null; if (isRecordFormElementsValueLinkValue(value, attribute)) { acc[attribute.id] = value?.linkValue?.id; diff --git a/libs/ui/src/components/RecordEdition/EditRecordContent/hooks/useExecuteDeleteValueMutation.ts b/libs/ui/src/components/RecordEdition/EditRecordContent/hooks/useExecuteDeleteValueMutation.ts index ccfe2a5f2..6ceb2fd1d 100644 --- a/libs/ui/src/components/RecordEdition/EditRecordContent/hooks/useExecuteDeleteValueMutation.ts +++ b/libs/ui/src/components/RecordEdition/EditRecordContent/hooks/useExecuteDeleteValueMutation.ts @@ -17,7 +17,7 @@ export default function useExecuteDeleteValueMutation(record: IRecordIdentityWho const updateValuesCache = useValuesCacheUpdate(); const [executeDeleteValue] = useDeleteValueMutation({ update: (cache, {data: {deleteValue}}) => { - updateValuesCache(record, [deleteValue]); + updateValuesCache(record, deleteValue); } }); const {t} = useSharedTranslation(); diff --git a/package.json b/package.json index fda36bdb8..d462df81f 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "devDependencies": { "@commitlint/cli": "19.2.1", "@commitlint/config-conventional": "19.1.0", + "@types/jest": "29.5.12", "@types/testing-library__jest-dom": "5.9.5", "@typescript-eslint/eslint-plugin": "5.19.0", "@typescript-eslint/parser": "5.19.0", diff --git a/yarn.lock b/yarn.lock index 8451f176e..d91294003 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9862,6 +9862,16 @@ __metadata: languageName: node linkType: hard +"@types/jest@npm:29.5.12": + version: 29.5.12 + resolution: "@types/jest@npm:29.5.12" + dependencies: + expect: "npm:^29.0.0" + pretty-format: "npm:^29.0.0" + checksum: 312e8dcf92cdd5a5847d6426f0940829bca6fe6b5a917248f3d7f7ef5d85c9ce78ef05e47d2bbabc40d41a930e0e36db2d443d2610a9e3db9062da2d5c904211 + languageName: node + linkType: hard + "@types/jest@npm:29.5.6": version: 29.5.6 resolution: "@types/jest@npm:29.5.6" @@ -22357,6 +22367,7 @@ __metadata: "@commitlint/cli": "npm:19.2.1" "@commitlint/config-conventional": "npm:19.1.0" "@rushstack/eslint-patch": "npm:1.1.3" + "@types/jest": "npm:29.5.12" "@types/testing-library__jest-dom": "npm:5.9.5" "@typescript-eslint/eslint-plugin": "npm:5.19.0" "@typescript-eslint/parser": "npm:5.19.0"