import { QueryBuilder, buildCustomDocument } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export function createQueryOperations(client) {
    return {
        currentUserId: (options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'CurrentUserId',
            fieldName: 'currentUserId',
            ...buildCustomDocument('query', 'CurrentUserId', 'currentUserId', options?.select, undefined, [], connectionFieldsMap, undefined),
        }),
        currentUserAgent: (options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'CurrentUserAgent',
            fieldName: 'currentUserAgent',
            ...buildCustomDocument('query', 'CurrentUserAgent', 'currentUserAgent', options?.select, undefined, [], connectionFieldsMap, undefined),
        }),
        currentIpAddress: (options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'CurrentIpAddress',
            fieldName: 'currentIpAddress',
            ...buildCustomDocument('query', 'CurrentIpAddress', 'currentIpAddress', options?.select, undefined, [], connectionFieldsMap, undefined),
        }),
        requireStepUp: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'RequireStepUp',
            fieldName: 'requireStepUp',
            ...buildCustomDocument('query', 'RequireStepUp', 'requireStepUp', options?.select, args, [
                {
                    name: 'stepUpType',
                    type: 'String',
                },
            ], connectionFieldsMap, undefined),
        }),
        appPermissionsGetPaddedMask: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'AppPermissionsGetPaddedMask',
            fieldName: 'appPermissionsGetPaddedMask',
            ...buildCustomDocument('query', 'AppPermissionsGetPaddedMask', 'appPermissionsGetPaddedMask', options?.select, args, [
                {
                    name: 'mask',
                    type: 'BitString',
                },
            ], connectionFieldsMap, undefined),
        }),
        orgPermissionsGetPaddedMask: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'OrgPermissionsGetPaddedMask',
            fieldName: 'orgPermissionsGetPaddedMask',
            ...buildCustomDocument('query', 'OrgPermissionsGetPaddedMask', 'orgPermissionsGetPaddedMask', options?.select, args, [
                {
                    name: 'mask',
                    type: 'BitString',
                },
            ], connectionFieldsMap, undefined),
        }),
        stepsAchieved: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'StepsAchieved',
            fieldName: 'stepsAchieved',
            ...buildCustomDocument('query', 'StepsAchieved', 'stepsAchieved', options?.select, args, [
                {
                    name: 'level',
                    type: 'String',
                },
                {
                    name: 'roleId',
                    type: 'UUID',
                },
            ], connectionFieldsMap, undefined),
        }),
        revParse: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'RevParse',
            fieldName: 'revParse',
            ...buildCustomDocument('query', 'RevParse', 'revParse', options?.select, args, [
                {
                    name: 'dbId',
                    type: 'UUID',
                },
                {
                    name: 'storeId',
                    type: 'UUID',
                },
                {
                    name: 'refname',
                    type: 'String',
                },
            ], connectionFieldsMap, undefined),
        }),
        resolveBlueprintField: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'ResolveBlueprintField',
            fieldName: 'resolveBlueprintField',
            ...buildCustomDocument('query', 'ResolveBlueprintField', 'resolveBlueprintField', options?.select, args, [
                {
                    name: 'databaseId',
                    type: 'UUID',
                },
                {
                    name: 'tableId',
                    type: 'UUID',
                },
                {
                    name: 'fieldName',
                    type: 'String',
                },
            ], connectionFieldsMap, undefined),
        }),
        orgIsManagerOf: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'OrgIsManagerOf',
            fieldName: 'orgIsManagerOf',
            ...buildCustomDocument('query', 'OrgIsManagerOf', 'orgIsManagerOf', options?.select, args, [
                {
                    name: 'pEntityId',
                    type: 'UUID',
                },
                {
                    name: 'pManagerId',
                    type: 'UUID',
                },
                {
                    name: 'pUserId',
                    type: 'UUID',
                },
                {
                    name: 'pMaxDepth',
                    type: 'Int',
                },
            ], connectionFieldsMap, undefined),
        }),
        appPermissionsGetMask: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'AppPermissionsGetMask',
            fieldName: 'appPermissionsGetMask',
            ...buildCustomDocument('query', 'AppPermissionsGetMask', 'appPermissionsGetMask', options?.select, args, [
                {
                    name: 'ids',
                    type: '[UUID]',
                },
            ], connectionFieldsMap, undefined),
        }),
        orgPermissionsGetMask: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'OrgPermissionsGetMask',
            fieldName: 'orgPermissionsGetMask',
            ...buildCustomDocument('query', 'OrgPermissionsGetMask', 'orgPermissionsGetMask', options?.select, args, [
                {
                    name: 'ids',
                    type: '[UUID]',
                },
            ], connectionFieldsMap, undefined),
        }),
        resolveBlueprintTable: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'ResolveBlueprintTable',
            fieldName: 'resolveBlueprintTable',
            ...buildCustomDocument('query', 'ResolveBlueprintTable', 'resolveBlueprintTable', options?.select, args, [
                {
                    name: 'databaseId',
                    type: 'UUID',
                },
                {
                    name: 'tableName',
                    type: 'String',
                },
                {
                    name: 'schemaName',
                    type: 'String',
                },
                {
                    name: 'tableMap',
                    type: 'JSON',
                },
                {
                    name: 'defaultSchemaId',
                    type: 'UUID',
                },
            ], connectionFieldsMap, undefined),
        }),
        appPermissionsGetMaskByNames: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'AppPermissionsGetMaskByNames',
            fieldName: 'appPermissionsGetMaskByNames',
            ...buildCustomDocument('query', 'AppPermissionsGetMaskByNames', 'appPermissionsGetMaskByNames', options?.select, args, [
                {
                    name: 'names',
                    type: '[String]',
                },
            ], connectionFieldsMap, undefined),
        }),
        orgPermissionsGetMaskByNames: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'OrgPermissionsGetMaskByNames',
            fieldName: 'orgPermissionsGetMaskByNames',
            ...buildCustomDocument('query', 'OrgPermissionsGetMaskByNames', 'orgPermissionsGetMaskByNames', options?.select, args, [
                {
                    name: 'names',
                    type: '[String]',
                },
            ], connectionFieldsMap, undefined),
        }),
        getAllObjectsFromRoot: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'GetAllObjectsFromRoot',
            fieldName: 'getAllObjectsFromRoot',
            ...buildCustomDocument('query', 'GetAllObjectsFromRoot', 'getAllObjectsFromRoot', options?.select, args, [
                {
                    name: 'databaseId',
                    type: 'UUID',
                },
                {
                    name: 'id',
                    type: 'UUID',
                },
                {
                    name: 'first',
                    type: 'Int',
                },
                {
                    name: 'offset',
                    type: 'Int',
                },
                {
                    name: 'after',
                    type: 'Cursor',
                },
            ], connectionFieldsMap, undefined),
        }),
        getPathObjectsFromRoot: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'GetPathObjectsFromRoot',
            fieldName: 'getPathObjectsFromRoot',
            ...buildCustomDocument('query', 'GetPathObjectsFromRoot', 'getPathObjectsFromRoot', options?.select, args, [
                {
                    name: 'databaseId',
                    type: 'UUID',
                },
                {
                    name: 'id',
                    type: 'UUID',
                },
                {
                    name: 'path',
                    type: '[String]',
                },
                {
                    name: 'first',
                    type: 'Int',
                },
                {
                    name: 'offset',
                    type: 'Int',
                },
                {
                    name: 'after',
                    type: 'Cursor',
                },
            ], connectionFieldsMap, undefined),
        }),
        getObjectAtPath: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'GetObjectAtPath',
            fieldName: 'getObjectAtPath',
            ...buildCustomDocument('query', 'GetObjectAtPath', 'getObjectAtPath', options.select, args, [
                {
                    name: 'dbId',
                    type: 'UUID',
                },
                {
                    name: 'storeId',
                    type: 'UUID',
                },
                {
                    name: 'path',
                    type: '[String]',
                },
                {
                    name: 'refname',
                    type: 'String',
                },
            ], connectionFieldsMap, 'Object'),
        }),
        appPermissionsGetByMask: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'AppPermissionsGetByMask',
            fieldName: 'appPermissionsGetByMask',
            ...buildCustomDocument('query', 'AppPermissionsGetByMask', 'appPermissionsGetByMask', options?.select, args, [
                {
                    name: 'mask',
                    type: 'BitString',
                },
                {
                    name: 'first',
                    type: 'Int',
                },
                {
                    name: 'offset',
                    type: 'Int',
                },
                {
                    name: 'after',
                    type: 'Cursor',
                },
            ], connectionFieldsMap, undefined),
        }),
        orgPermissionsGetByMask: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'OrgPermissionsGetByMask',
            fieldName: 'orgPermissionsGetByMask',
            ...buildCustomDocument('query', 'OrgPermissionsGetByMask', 'orgPermissionsGetByMask', options?.select, args, [
                {
                    name: 'mask',
                    type: 'BitString',
                },
                {
                    name: 'first',
                    type: 'Int',
                },
                {
                    name: 'offset',
                    type: 'Int',
                },
                {
                    name: 'after',
                    type: 'Cursor',
                },
            ], connectionFieldsMap, undefined),
        }),
        stepsRequired: (args, options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'StepsRequired',
            fieldName: 'stepsRequired',
            ...buildCustomDocument('query', 'StepsRequired', 'stepsRequired', options?.select, args, [
                {
                    name: 'level',
                    type: 'String',
                },
                {
                    name: 'roleId',
                    type: 'UUID',
                },
                {
                    name: 'first',
                    type: 'Int',
                },
                {
                    name: 'offset',
                    type: 'Int',
                },
                {
                    name: 'after',
                    type: 'Cursor',
                },
            ], connectionFieldsMap, undefined),
        }),
        currentUser: (options) => new QueryBuilder({
            client,
            operation: 'query',
            operationName: 'CurrentUser',
            fieldName: 'currentUser',
            ...buildCustomDocument('query', 'CurrentUser', 'currentUser', options.select, undefined, [], connectionFieldsMap, 'User'),
        }),
    };
}
