Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma strängvärde byggs med konkatenering i stället för att matcha mönstret.
68 lines
1.9 KiB
TypeScript
68 lines
1.9 KiB
TypeScript
import { ResourceType } from '../dto';
|
|
import type { BjornLundenResourceConfig, RateLimitConfig } from '../types';
|
|
import {
|
|
mapBLToSalesInvoice,
|
|
mapBLToSupplierInvoice,
|
|
mapBLToCustomer,
|
|
mapBLToSupplier,
|
|
mapBLToJournal,
|
|
mapBLToAccountingAccount,
|
|
mapBLToCompanyInformation,
|
|
} from './mapper';
|
|
|
|
export const BL_BASE_URL = 'https://apigateway.blinfo.se/bla-api/v1/sp';
|
|
export const BL_RATE_LIMIT: RateLimitConfig = { maxRequests: 10, windowMs: 1000 };
|
|
|
|
export const BL_RESOURCE_CONFIGS: Partial<Record<ResourceType, BjornLundenResourceConfig>> = {
|
|
[ResourceType.SalesInvoices]: {
|
|
listEndpoint: '/customerinvoice/batch',
|
|
detailEndpoint: '/customerinvoice/{id}',
|
|
idField: 'invoiceNumber',
|
|
mapper: mapBLToSalesInvoice,
|
|
paginated: true,
|
|
},
|
|
[ResourceType.SupplierInvoices]: {
|
|
listEndpoint: '/supplierinvoice/batch',
|
|
detailEndpoint: '/supplierinvoice/byId/{id}',
|
|
idField: 'entityId',
|
|
mapper: mapBLToSupplierInvoice,
|
|
paginated: true,
|
|
},
|
|
[ResourceType.Customers]: {
|
|
listEndpoint: '/customer',
|
|
detailEndpoint: '/customer/{id}',
|
|
idField: 'id',
|
|
mapper: mapBLToCustomer,
|
|
paginated: false,
|
|
},
|
|
[ResourceType.Suppliers]: {
|
|
listEndpoint: '/supplier',
|
|
detailEndpoint: '/supplier/{id}',
|
|
idField: 'id',
|
|
mapper: mapBLToSupplier,
|
|
paginated: false,
|
|
},
|
|
[ResourceType.Journals]: {
|
|
listEndpoint: '/journal/entry/batch',
|
|
detailEndpoint: '/journal/entry/{id}',
|
|
idField: 'entityId',
|
|
mapper: mapBLToJournal,
|
|
paginated: true,
|
|
},
|
|
[ResourceType.AccountingAccounts]: {
|
|
listEndpoint: '/account',
|
|
detailEndpoint: '/account/{id}',
|
|
idField: 'id',
|
|
mapper: mapBLToAccountingAccount,
|
|
paginated: false,
|
|
},
|
|
[ResourceType.CompanyInformation]: {
|
|
listEndpoint: '/details',
|
|
detailEndpoint: '',
|
|
idField: '',
|
|
mapper: mapBLToCompanyInformation,
|
|
singleton: true,
|
|
paginated: false,
|
|
},
|
|
};
|