{"version":3,"file":"document-type-item.repository-DTDTiU9b.js","sources":["../../../src/packages/documents/document-types/repository/item/document-type-item.server.data-source.ts","../../../src/packages/documents/document-types/repository/item/document-type-item.repository.ts"],"sourcesContent":["import { UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../../entity.js';\r\nimport type { UmbDocumentTypeItemModel } from './types.js';\r\nimport { UmbItemServerDataSourceBase } from '@umbraco-cms/backoffice/repository';\r\nimport type { DocumentTypeItemResponseModel } from '@umbraco-cms/backoffice/external/backend-api';\r\nimport { DocumentTypeService } from '@umbraco-cms/backoffice/external/backend-api';\r\nimport type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';\r\n\r\n/**\r\n * A data source for Document Type items that fetches data from the server\r\n * @class UmbDocumentTypeItemServerDataSource\r\n * @augments {UmbItemServerDataSourceBase}\r\n */\r\nexport class UmbDocumentTypeItemServerDataSource extends UmbItemServerDataSourceBase<\r\n\tDocumentTypeItemResponseModel,\r\n\tUmbDocumentTypeItemModel\r\n> {\r\n\t/**\r\n\t * Creates an instance of UmbDocumentTypeItemServerDataSource.\r\n\t * @param {UmbControllerHost} host - The controller host for this controller to be appended to\r\n\t * @memberof UmbDocumentTypeItemServerDataSource\r\n\t */\r\n\tconstructor(host: UmbControllerHost) {\r\n\t\tsuper(host, { getItems, mapper });\r\n\t}\r\n}\r\n\r\n/* eslint-disable local-rules/no-direct-api-import */\r\nconst getItems = (uniques: Array) => DocumentTypeService.getItemDocumentType({ id: uniques });\r\n\r\nconst mapper = (item: DocumentTypeItemResponseModel): UmbDocumentTypeItemModel => {\r\n\treturn {\r\n\t\tentityType: UMB_DOCUMENT_TYPE_ENTITY_TYPE,\r\n\t\tisElement: item.isElement,\r\n\t\ticon: item.icon,\r\n\t\tunique: item.id,\r\n\t\tname: item.name,\r\n\t\tdescription: item.description,\r\n\t};\r\n};\r\n","import type { UmbDocumentTypeItemModel } from './types.js';\r\nimport { UmbDocumentTypeItemServerDataSource } from './document-type-item.server.data-source.js';\r\nimport { UMB_DOCUMENT_TYPE_ITEM_STORE_CONTEXT } from './document-type-item-store.context-token.js';\r\nimport type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';\r\nimport { UmbItemRepositoryBase } from '@umbraco-cms/backoffice/repository';\r\n\r\nexport class UmbDocumentTypeItemRepository extends UmbItemRepositoryBase {\r\n\tconstructor(host: UmbControllerHost) {\r\n\t\tsuper(host, UmbDocumentTypeItemServerDataSource, UMB_DOCUMENT_TYPE_ITEM_STORE_CONTEXT);\r\n\t}\r\n}\r\n\r\nexport { UmbDocumentTypeItemRepository as api };\r\n"],"names":["UmbDocumentTypeItemServerDataSource","UmbItemServerDataSourceBase","host","getItems","mapper","uniques","DocumentTypeService","item","UMB_DOCUMENT_TYPE_ENTITY_TYPE","UmbDocumentTypeItemRepository","UmbItemRepositoryBase","UMB_DOCUMENT_TYPE_ITEM_STORE_CONTEXT"],"mappings":";;;AAYO,MAAMA,UAA4CC,EAGvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,YAAYC,GAAyB;AACpC,UAAMA,GAAM,EAAE,UAAAC,GAAU,QAAAC,EAAA,CAAQ;AAAA,EAAA;AAElC;AAGA,MAAMD,IAAW,CAACE,MAA2BC,EAAoB,oBAAoB,EAAE,IAAID,GAAS,GAE9FD,IAAS,CAACG,OACR;AAAA,EACN,YAAYC;AAAA,EACZ,WAAWD,EAAK;AAAA,EAChB,MAAMA,EAAK;AAAA,EACX,QAAQA,EAAK;AAAA,EACb,MAAMA,EAAK;AAAA,EACX,aAAaA,EAAK;AACnB;AC/BM,MAAME,UAAsCC,EAAgD;AAAA,EAClG,YAAYR,GAAyB;AAC9B,UAAAA,GAAMF,GAAqCW,CAAoC;AAAA,EAAA;AAEvF;"}