'use strict';
import { eq } from 'drizzle-orm';
import { getDbSchema } from '../../../../db/db-schema.js';
import { getResourcesByName, getResource, createResourceDirectlyInDb } from '../../../../meta/server/db/db.js';
import { resourceNames } from '../../../../../fd-toolbox/resources/resource-names.js';
import { getQuery } from '../../../../meta/server/web/drizzle.js';
import { applyFilterToQuery, getTableColumn } from '../../../../db/drizzle-queries.js';
import { createResource } from '../../../../meta/server/resources/crud-resources.js';
import { schemaNames, columnNames } from '../../../../db/constants/schema-names.js';

var __defProp=Object['defineProperty'],__name=(_0xbdb78b,_0x4e3107)=>__defProp(_0xbdb78b,'name',{'value':_0x4e3107,'configurable':!![]});async function getByResourcePropertyResourceIds(_0x334e42){const _0x390af0=getDbSchema(),_0x2b56e3=_0x390af0[schemaNames['resourcePropertySchema']],{query:_0x27b622}=await getQuery(_0x2b56e3);applyFilterToQuery(_0x27b622,eq(getTableColumn(_0x2b56e3,columnNames['resourceId']),_0x334e42));const _0x1885e2=await _0x27b622;return _0x1885e2;}__name(getByResourcePropertyResourceIds,'getByResourcePropertyResourceIds');async function getResourceProperties(){const _0x5eee78=await getResourcesByName(resourceNames['resourceProperty']);return _0x5eee78;}__name(getResourceProperties,'getResourceProperties');async function getOneResourceProperty(_0x1174d8){const _0x16cf32=getResource({'resourceName':resourceNames['resourceProperty'],'id':_0x1174d8});return _0x16cf32;}__name(getOneResourceProperty,'getOneResourceProperty');async function createResourceProperty(_0xe69968){const _0x2ba5c8=await createResource(_0xe69968,resourceNames['resourceProperty']);return _0x2ba5c8;}__name(createResourceProperty,'createResourceProperty');async function createResourcePropertyDirectlyInDb(_0x278ae6){return createResourceDirectlyInDb(_0x278ae6,resourceNames['resourceProperty']);}__name(createResourcePropertyDirectlyInDb,'createResourcePropertyDirectlyInDb');

export { createResourceProperty, createResourcePropertyDirectlyInDb, getByResourcePropertyResourceIds, getOneResourceProperty, getResourceProperties };
