@mergeapi/merge-node-client 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mock/definition/accounting/__package__.yml +3089 -0
- package/.mock/definition/accounting/expenseReports.yml +938 -0
- package/.mock/definition/accounting/fieldMapping.yml +20 -0
- package/.mock/definition/accounting/items.yml +4 -0
- package/.mock/definition/accounting/payments.yml +8 -8
- package/Client.d.ts +3 -3
- package/Client.js +8 -8
- package/api/resources/accounting/client/Client.d.ts +3 -0
- package/api/resources/accounting/client/Client.js +57 -52
- package/api/resources/accounting/resources/expenseReports/client/Client.d.ts +118 -0
- package/api/resources/accounting/resources/expenseReports/client/Client.js +667 -0
- package/api/resources/accounting/resources/expenseReports/client/index.d.ts +1 -0
- package/api/resources/accounting/resources/expenseReports/client/index.js +17 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.d.ts +23 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.js +5 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesListRequest.d.ts +38 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesListRequest.js +5 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesRemoteFieldClassesListRequest.d.ts +37 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesRemoteFieldClassesListRequest.js +5 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsListRequest.d.ts +62 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsListRequest.js +5 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRemoteFieldClassesListRequest.d.ts +37 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRemoteFieldClassesListRequest.js +5 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRetrieveRequest.d.ts +26 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRetrieveRequest.js +5 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/index.d.ts +6 -0
- package/api/resources/accounting/resources/expenseReports/client/requests/index.js +2 -0
- package/api/resources/accounting/resources/expenseReports/index.d.ts +2 -0
- package/api/resources/accounting/resources/expenseReports/index.js +18 -0
- package/api/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.d.ts +69 -0
- package/api/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.js +71 -0
- package/api/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.d.ts +21 -0
- package/api/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.js +23 -0
- package/api/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.d.ts +21 -0
- package/api/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.js +23 -0
- package/api/resources/accounting/resources/expenseReports/types/index.d.ts +3 -0
- package/api/resources/accounting/resources/expenseReports/types/index.js +19 -0
- package/api/resources/accounting/resources/index.d.ts +3 -0
- package/api/resources/accounting/resources/index.js +4 -1
- package/api/resources/accounting/types/ExpenseReport.d.ts +364 -0
- package/api/resources/accounting/types/ExpenseReport.js +5 -0
- package/api/resources/accounting/types/ExpenseReportCompany.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportCompany.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLine.d.ts +366 -0
- package/api/resources/accounting/types/ExpenseReportLine.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineAccount.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineAccount.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineCompany.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportLineCompany.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineContact.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineContact.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineEmployee.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportLineEmployee.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineProject.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineProject.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequest.d.ts +361 -0
- package/api/resources/accounting/types/ExpenseReportLineRequest.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestAccount.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestAccount.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestCompany.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestCompany.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestContact.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestContact.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestEmployee.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestEmployee.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestProject.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestProject.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestTaxRate.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineRequestTaxRate.js +5 -0
- package/api/resources/accounting/types/ExpenseReportLineTaxRate.d.ts +5 -0
- package/api/resources/accounting/types/ExpenseReportLineTaxRate.js +5 -0
- package/api/resources/accounting/types/ExpenseReportRequest.d.ts +354 -0
- package/api/resources/accounting/types/ExpenseReportRequest.js +5 -0
- package/api/resources/accounting/types/ExpenseReportRequestAccountingPeriod.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportRequestAccountingPeriod.js +5 -0
- package/api/resources/accounting/types/ExpenseReportRequestCompany.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportRequestCompany.js +5 -0
- package/api/resources/accounting/types/ExpenseReportRequestEmployee.d.ts +8 -0
- package/api/resources/accounting/types/ExpenseReportRequestEmployee.js +5 -0
- package/api/resources/accounting/types/ExpenseReportResponse.d.ts +10 -0
- package/api/resources/accounting/types/ExpenseReportResponse.js +5 -0
- package/api/resources/accounting/types/ExpenseReportStatus.d.ts +13 -0
- package/api/resources/accounting/types/ExpenseReportStatus.js +5 -0
- package/api/resources/accounting/types/ExpenseReportStatusEnum.d.ts +16 -0
- package/api/resources/accounting/types/ExpenseReportStatusEnum.js +12 -0
- package/api/resources/accounting/types/ExternalTargetFieldApiResponse.d.ts +1 -0
- package/api/resources/accounting/types/FieldMappingApiInstanceResponse.d.ts +1 -0
- package/api/resources/accounting/types/Item.d.ts +9 -0
- package/api/resources/accounting/types/ItemType.d.ts +13 -0
- package/api/resources/accounting/types/ItemType.js +5 -0
- package/api/resources/accounting/types/PaginatedExpenseReportLineList.d.ts +9 -0
- package/api/resources/accounting/types/PaginatedExpenseReportLineList.js +5 -0
- package/api/resources/accounting/types/PaginatedExpenseReportList.d.ts +9 -0
- package/api/resources/accounting/types/PaginatedExpenseReportList.js +5 -0
- package/api/resources/accounting/types/index.d.ts +26 -0
- package/api/resources/accounting/types/index.js +26 -0
- package/api/resources/index.d.ts +1 -1
- package/api/resources/index.js +2 -2
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +8 -8
- package/dist/api/resources/accounting/client/Client.d.ts +3 -0
- package/dist/api/resources/accounting/client/Client.js +57 -52
- package/dist/api/resources/accounting/resources/expenseReports/client/Client.d.ts +118 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/Client.js +667 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/index.d.ts +1 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/index.js +17 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.d.ts +23 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.js +5 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesListRequest.d.ts +38 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesListRequest.js +5 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesRemoteFieldClassesListRequest.d.ts +37 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsLinesRemoteFieldClassesListRequest.js +5 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsListRequest.d.ts +62 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsListRequest.js +5 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRemoteFieldClassesListRequest.d.ts +37 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRemoteFieldClassesListRequest.js +5 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRetrieveRequest.d.ts +26 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/ExpenseReportsRetrieveRequest.js +5 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/index.d.ts +6 -0
- package/dist/api/resources/accounting/resources/expenseReports/client/requests/index.js +2 -0
- package/dist/api/resources/accounting/resources/expenseReports/index.d.ts +2 -0
- package/dist/api/resources/accounting/resources/expenseReports/index.js +18 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.d.ts +69 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.js +71 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.d.ts +21 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.js +23 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.d.ts +21 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.js +23 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/index.d.ts +3 -0
- package/dist/api/resources/accounting/resources/expenseReports/types/index.js +19 -0
- package/dist/api/resources/accounting/resources/index.d.ts +3 -0
- package/dist/api/resources/accounting/resources/index.js +4 -1
- package/dist/api/resources/accounting/types/ExpenseReport.d.ts +364 -0
- package/dist/api/resources/accounting/types/ExpenseReport.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportCompany.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportCompany.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLine.d.ts +366 -0
- package/dist/api/resources/accounting/types/ExpenseReportLine.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineAccount.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineAccount.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineCompany.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineCompany.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineContact.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineContact.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineEmployee.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineEmployee.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineProject.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineProject.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequest.d.ts +361 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequest.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestAccount.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestAccount.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestCompany.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestCompany.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestContact.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestContact.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestEmployee.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestEmployee.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestProject.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestProject.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestTaxRate.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineRequestTaxRate.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineTaxRate.d.ts +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportLineTaxRate.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequest.d.ts +354 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequest.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequestAccountingPeriod.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequestAccountingPeriod.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequestCompany.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequestCompany.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequestEmployee.d.ts +8 -0
- package/dist/api/resources/accounting/types/ExpenseReportRequestEmployee.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportResponse.d.ts +10 -0
- package/dist/api/resources/accounting/types/ExpenseReportResponse.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportStatus.d.ts +13 -0
- package/dist/api/resources/accounting/types/ExpenseReportStatus.js +5 -0
- package/dist/api/resources/accounting/types/ExpenseReportStatusEnum.d.ts +16 -0
- package/dist/api/resources/accounting/types/ExpenseReportStatusEnum.js +12 -0
- package/dist/api/resources/accounting/types/ExternalTargetFieldApiResponse.d.ts +1 -0
- package/dist/api/resources/accounting/types/FieldMappingApiInstanceResponse.d.ts +1 -0
- package/dist/api/resources/accounting/types/Item.d.ts +9 -0
- package/dist/api/resources/accounting/types/ItemType.d.ts +13 -0
- package/dist/api/resources/accounting/types/ItemType.js +5 -0
- package/dist/api/resources/accounting/types/PaginatedExpenseReportLineList.d.ts +9 -0
- package/dist/api/resources/accounting/types/PaginatedExpenseReportLineList.js +5 -0
- package/dist/api/resources/accounting/types/PaginatedExpenseReportList.d.ts +9 -0
- package/dist/api/resources/accounting/types/PaginatedExpenseReportList.js +5 -0
- package/dist/api/resources/accounting/types/index.d.ts +26 -0
- package/dist/api/resources/accounting/types/index.js +26 -0
- package/dist/api/resources/index.d.ts +1 -1
- package/dist/api/resources/index.js +2 -2
- package/dist/serialization/resources/accounting/resources/expenseReports/client/index.d.ts +1 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/client/index.js +17 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.d.ts +13 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.js +44 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/client/requests/index.js +5 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/index.d.ts +2 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/index.js +18 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.d.ts +10 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.js +105 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.d.ts +10 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.js +57 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.d.ts +10 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.js +57 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/index.d.ts +3 -0
- package/dist/serialization/resources/accounting/resources/expenseReports/types/index.js +19 -0
- package/dist/serialization/resources/accounting/resources/index.d.ts +3 -0
- package/dist/serialization/resources/accounting/resources/index.js +4 -1
- package/dist/serialization/resources/accounting/types/ExpenseReport.d.ts +36 -0
- package/dist/serialization/resources/accounting/types/ExpenseReport.js +67 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportCompany.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportCompany.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLine.d.ts +43 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLine.js +74 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineAccount.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineAccount.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineCompany.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineCompany.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineContact.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineContact.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineEmployee.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineEmployee.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineProject.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineProject.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequest.d.ts +41 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequest.js +72 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestCompany.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestCompany.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestContact.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestContact.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestEmployee.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestEmployee.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestProject.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestProject.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestTaxRate.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineRequestTaxRate.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineTaxRate.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportLineTaxRate.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequest.d.ts +30 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequest.js +61 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequestAccountingPeriod.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequestAccountingPeriod.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequestCompany.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequestCompany.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequestEmployee.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportRequestEmployee.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportResponse.d.ts +19 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportResponse.js +50 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportStatus.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportStatus.js +42 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportStatusEnum.d.ts +10 -0
- package/dist/serialization/resources/accounting/types/ExpenseReportStatusEnum.js +41 -0
- package/dist/serialization/resources/accounting/types/ExternalTargetFieldApiResponse.d.ts +1 -0
- package/dist/serialization/resources/accounting/types/ExternalTargetFieldApiResponse.js +1 -0
- package/dist/serialization/resources/accounting/types/FieldMappingApiInstanceResponse.d.ts +1 -0
- package/dist/serialization/resources/accounting/types/FieldMappingApiInstanceResponse.js +1 -0
- package/dist/serialization/resources/accounting/types/Item.d.ts +2 -0
- package/dist/serialization/resources/accounting/types/Item.js +2 -0
- package/dist/serialization/resources/accounting/types/ItemType.d.ts +11 -0
- package/dist/serialization/resources/accounting/types/ItemType.js +42 -0
- package/dist/serialization/resources/accounting/types/PaginatedExpenseReportLineList.d.ts +15 -0
- package/dist/serialization/resources/accounting/types/PaginatedExpenseReportLineList.js +46 -0
- package/dist/serialization/resources/accounting/types/PaginatedExpenseReportList.d.ts +15 -0
- package/dist/serialization/resources/accounting/types/PaginatedExpenseReportList.js +46 -0
- package/dist/serialization/resources/accounting/types/index.d.ts +26 -0
- package/dist/serialization/resources/accounting/types/index.js +26 -0
- package/dist/serialization/resources/index.d.ts +1 -1
- package/dist/serialization/resources/index.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +2508 -2053
- package/serialization/resources/accounting/resources/expenseReports/client/index.d.ts +1 -0
- package/serialization/resources/accounting/resources/expenseReports/client/index.js +17 -0
- package/serialization/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.d.ts +13 -0
- package/serialization/resources/accounting/resources/expenseReports/client/requests/ExpenseReportEndpointRequest.js +44 -0
- package/serialization/resources/accounting/resources/expenseReports/client/requests/index.d.ts +1 -0
- package/serialization/resources/accounting/resources/expenseReports/client/requests/index.js +5 -0
- package/serialization/resources/accounting/resources/expenseReports/index.d.ts +2 -0
- package/serialization/resources/accounting/resources/expenseReports/index.js +18 -0
- package/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.d.ts +10 -0
- package/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsLinesListRequestExpand.js +105 -0
- package/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.d.ts +10 -0
- package/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsListRequestExpand.js +57 -0
- package/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.d.ts +10 -0
- package/serialization/resources/accounting/resources/expenseReports/types/ExpenseReportsRetrieveRequestExpand.js +57 -0
- package/serialization/resources/accounting/resources/expenseReports/types/index.d.ts +3 -0
- package/serialization/resources/accounting/resources/expenseReports/types/index.js +19 -0
- package/serialization/resources/accounting/resources/index.d.ts +3 -0
- package/serialization/resources/accounting/resources/index.js +4 -1
- package/serialization/resources/accounting/types/ExpenseReport.d.ts +36 -0
- package/serialization/resources/accounting/types/ExpenseReport.js +67 -0
- package/serialization/resources/accounting/types/ExpenseReportCompany.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportCompany.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLine.d.ts +43 -0
- package/serialization/resources/accounting/types/ExpenseReportLine.js +74 -0
- package/serialization/resources/accounting/types/ExpenseReportLineAccount.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineAccount.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineCompany.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineCompany.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineContact.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineContact.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineEmployee.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineEmployee.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineProject.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineProject.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequest.d.ts +41 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequest.js +72 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestAccount.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestCompany.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestCompany.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestContact.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestContact.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestEmployee.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestEmployee.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestProject.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestProject.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestTaxRate.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineRequestTaxRate.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportLineTaxRate.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportLineTaxRate.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportRequest.d.ts +30 -0
- package/serialization/resources/accounting/types/ExpenseReportRequest.js +61 -0
- package/serialization/resources/accounting/types/ExpenseReportRequestAccountingPeriod.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportRequestAccountingPeriod.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportRequestCompany.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportRequestCompany.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportRequestEmployee.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportRequestEmployee.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportResponse.d.ts +19 -0
- package/serialization/resources/accounting/types/ExpenseReportResponse.js +50 -0
- package/serialization/resources/accounting/types/ExpenseReportStatus.d.ts +11 -0
- package/serialization/resources/accounting/types/ExpenseReportStatus.js +42 -0
- package/serialization/resources/accounting/types/ExpenseReportStatusEnum.d.ts +10 -0
- package/serialization/resources/accounting/types/ExpenseReportStatusEnum.js +41 -0
- package/serialization/resources/accounting/types/ExternalTargetFieldApiResponse.d.ts +1 -0
- package/serialization/resources/accounting/types/ExternalTargetFieldApiResponse.js +1 -0
- package/serialization/resources/accounting/types/FieldMappingApiInstanceResponse.d.ts +1 -0
- package/serialization/resources/accounting/types/FieldMappingApiInstanceResponse.js +1 -0
- package/serialization/resources/accounting/types/Item.d.ts +2 -0
- package/serialization/resources/accounting/types/Item.js +2 -0
- package/serialization/resources/accounting/types/ItemType.d.ts +11 -0
- package/serialization/resources/accounting/types/ItemType.js +42 -0
- package/serialization/resources/accounting/types/PaginatedExpenseReportLineList.d.ts +15 -0
- package/serialization/resources/accounting/types/PaginatedExpenseReportLineList.js +46 -0
- package/serialization/resources/accounting/types/PaginatedExpenseReportList.d.ts +15 -0
- package/serialization/resources/accounting/types/PaginatedExpenseReportList.js +46 -0
- package/serialization/resources/accounting/types/index.d.ts +26 -0
- package/serialization/resources/accounting/types/index.js +26 -0
- package/serialization/resources/index.d.ts +1 -1
- package/serialization/resources/index.js +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
|
+
var t = {};
|
|
49
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
+
t[p] = s[p];
|
|
51
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
+
t[p[i]] = s[p[i]];
|
|
55
|
+
}
|
|
56
|
+
return t;
|
|
57
|
+
};
|
|
58
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
exports.ExpenseReports = void 0;
|
|
63
|
+
const environments = __importStar(require("../../../../../../environments"));
|
|
64
|
+
const core = __importStar(require("../../../../../../core"));
|
|
65
|
+
const serializers = __importStar(require("../../../../../../serialization/index"));
|
|
66
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
67
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
68
|
+
const errors = __importStar(require("../../../../../../errors/index"));
|
|
69
|
+
class ExpenseReports {
|
|
70
|
+
constructor(_options) {
|
|
71
|
+
this._options = _options;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns a list of `ExpenseReport` objects.
|
|
75
|
+
*
|
|
76
|
+
* @param {Merge.accounting.ExpenseReportsListRequest} request
|
|
77
|
+
* @param {ExpenseReports.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.accounting.expenseReports.list()
|
|
81
|
+
*/
|
|
82
|
+
list(request = {}, requestOptions) {
|
|
83
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
84
|
+
}
|
|
85
|
+
__list() {
|
|
86
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
87
|
+
var _a, _b, _c, _d;
|
|
88
|
+
const { companyId, createdAfter, createdBefore, cursor, expand, includeDeletedData, includeRemoteData, includeRemoteFields, includeShellData, modifiedAfter, modifiedBefore, pageSize, remoteId, } = request;
|
|
89
|
+
const _queryParams = {};
|
|
90
|
+
if (companyId != null) {
|
|
91
|
+
_queryParams["company_id"] = companyId;
|
|
92
|
+
}
|
|
93
|
+
if (createdAfter != null) {
|
|
94
|
+
_queryParams["created_after"] = createdAfter.toISOString();
|
|
95
|
+
}
|
|
96
|
+
if (createdBefore != null) {
|
|
97
|
+
_queryParams["created_before"] = createdBefore.toISOString();
|
|
98
|
+
}
|
|
99
|
+
if (cursor != null) {
|
|
100
|
+
_queryParams["cursor"] = cursor;
|
|
101
|
+
}
|
|
102
|
+
if (expand != null) {
|
|
103
|
+
_queryParams["expand"] = serializers.accounting.ExpenseReportsListRequestExpand.jsonOrThrow(expand, {
|
|
104
|
+
unrecognizedObjectKeys: "strip",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (includeDeletedData != null) {
|
|
108
|
+
_queryParams["include_deleted_data"] = includeDeletedData.toString();
|
|
109
|
+
}
|
|
110
|
+
if (includeRemoteData != null) {
|
|
111
|
+
_queryParams["include_remote_data"] = includeRemoteData.toString();
|
|
112
|
+
}
|
|
113
|
+
if (includeRemoteFields != null) {
|
|
114
|
+
_queryParams["include_remote_fields"] = includeRemoteFields.toString();
|
|
115
|
+
}
|
|
116
|
+
if (includeShellData != null) {
|
|
117
|
+
_queryParams["include_shell_data"] = includeShellData.toString();
|
|
118
|
+
}
|
|
119
|
+
if (modifiedAfter != null) {
|
|
120
|
+
_queryParams["modified_after"] = modifiedAfter.toISOString();
|
|
121
|
+
}
|
|
122
|
+
if (modifiedBefore != null) {
|
|
123
|
+
_queryParams["modified_before"] = modifiedBefore.toISOString();
|
|
124
|
+
}
|
|
125
|
+
if (pageSize != null) {
|
|
126
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
127
|
+
}
|
|
128
|
+
if (remoteId != null) {
|
|
129
|
+
_queryParams["remote_id"] = remoteId;
|
|
130
|
+
}
|
|
131
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
132
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MergeEnvironment.Production, "accounting/v1/expense-reports"),
|
|
133
|
+
method: "GET",
|
|
134
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
135
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
136
|
+
"X-Account-Token": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.accountToken,
|
|
137
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
138
|
+
queryParameters: _queryParams,
|
|
139
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
140
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
141
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
142
|
+
});
|
|
143
|
+
if (_response.ok) {
|
|
144
|
+
return {
|
|
145
|
+
data: serializers.accounting.PaginatedExpenseReportList.parseOrThrow(_response.body, {
|
|
146
|
+
unrecognizedObjectKeys: "passthrough",
|
|
147
|
+
allowUnrecognizedUnionMembers: true,
|
|
148
|
+
allowUnrecognizedEnumValues: true,
|
|
149
|
+
skipValidation: true,
|
|
150
|
+
breadcrumbsPrefix: ["response"],
|
|
151
|
+
}),
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (_response.error.reason === "status-code") {
|
|
156
|
+
throw new errors.MergeError({
|
|
157
|
+
statusCode: _response.error.statusCode,
|
|
158
|
+
body: _response.error.body,
|
|
159
|
+
rawResponse: _response.rawResponse,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
switch (_response.error.reason) {
|
|
163
|
+
case "non-json":
|
|
164
|
+
throw new errors.MergeError({
|
|
165
|
+
statusCode: _response.error.statusCode,
|
|
166
|
+
body: _response.error.rawBody,
|
|
167
|
+
rawResponse: _response.rawResponse,
|
|
168
|
+
});
|
|
169
|
+
case "timeout":
|
|
170
|
+
throw new errors.MergeTimeoutError("Timeout exceeded when calling GET /accounting/v1/expense-reports.");
|
|
171
|
+
case "unknown":
|
|
172
|
+
throw new errors.MergeError({
|
|
173
|
+
message: _response.error.errorMessage,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Creates an `ExpenseReport` object with the given values.
|
|
181
|
+
*
|
|
182
|
+
* @param {Merge.accounting.ExpenseReportEndpointRequest} request
|
|
183
|
+
* @param {ExpenseReports.RequestOptions} requestOptions - Request-specific configuration.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* await client.accounting.expenseReports.create({
|
|
187
|
+
* model: {
|
|
188
|
+
* trackingCategories: ["a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d", "d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p"]
|
|
189
|
+
* }
|
|
190
|
+
* })
|
|
191
|
+
*/
|
|
192
|
+
create(request, requestOptions) {
|
|
193
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
194
|
+
}
|
|
195
|
+
__create(request, requestOptions) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
var _a, _b, _c, _d;
|
|
198
|
+
const { isDebugMode, runAsync } = request, _body = __rest(request, ["isDebugMode", "runAsync"]);
|
|
199
|
+
const _queryParams = {};
|
|
200
|
+
if (isDebugMode != null) {
|
|
201
|
+
_queryParams["is_debug_mode"] = isDebugMode.toString();
|
|
202
|
+
}
|
|
203
|
+
if (runAsync != null) {
|
|
204
|
+
_queryParams["run_async"] = runAsync.toString();
|
|
205
|
+
}
|
|
206
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
207
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MergeEnvironment.Production, "accounting/v1/expense-reports"),
|
|
208
|
+
method: "POST",
|
|
209
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
210
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
211
|
+
"X-Account-Token": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.accountToken,
|
|
212
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
213
|
+
contentType: "application/json",
|
|
214
|
+
queryParameters: _queryParams,
|
|
215
|
+
requestType: "json",
|
|
216
|
+
body: serializers.accounting.ExpenseReportEndpointRequest.jsonOrThrow(_body, {
|
|
217
|
+
unrecognizedObjectKeys: "strip",
|
|
218
|
+
}),
|
|
219
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
220
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
221
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
222
|
+
});
|
|
223
|
+
if (_response.ok) {
|
|
224
|
+
return {
|
|
225
|
+
data: serializers.accounting.ExpenseReportResponse.parseOrThrow(_response.body, {
|
|
226
|
+
unrecognizedObjectKeys: "passthrough",
|
|
227
|
+
allowUnrecognizedUnionMembers: true,
|
|
228
|
+
allowUnrecognizedEnumValues: true,
|
|
229
|
+
skipValidation: true,
|
|
230
|
+
breadcrumbsPrefix: ["response"],
|
|
231
|
+
}),
|
|
232
|
+
rawResponse: _response.rawResponse,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (_response.error.reason === "status-code") {
|
|
236
|
+
throw new errors.MergeError({
|
|
237
|
+
statusCode: _response.error.statusCode,
|
|
238
|
+
body: _response.error.body,
|
|
239
|
+
rawResponse: _response.rawResponse,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
switch (_response.error.reason) {
|
|
243
|
+
case "non-json":
|
|
244
|
+
throw new errors.MergeError({
|
|
245
|
+
statusCode: _response.error.statusCode,
|
|
246
|
+
body: _response.error.rawBody,
|
|
247
|
+
rawResponse: _response.rawResponse,
|
|
248
|
+
});
|
|
249
|
+
case "timeout":
|
|
250
|
+
throw new errors.MergeTimeoutError("Timeout exceeded when calling POST /accounting/v1/expense-reports.");
|
|
251
|
+
case "unknown":
|
|
252
|
+
throw new errors.MergeError({
|
|
253
|
+
message: _response.error.errorMessage,
|
|
254
|
+
rawResponse: _response.rawResponse,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id.
|
|
261
|
+
*
|
|
262
|
+
* @param {string} expenseReportId
|
|
263
|
+
* @param {Merge.accounting.ExpenseReportsLinesListRequest} request
|
|
264
|
+
* @param {ExpenseReports.RequestOptions} requestOptions - Request-specific configuration.
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* await client.accounting.expenseReports.linesList("expense_report_id")
|
|
268
|
+
*/
|
|
269
|
+
linesList(expenseReportId, request = {}, requestOptions) {
|
|
270
|
+
return core.HttpResponsePromise.fromPromise(this.__linesList(expenseReportId, request, requestOptions));
|
|
271
|
+
}
|
|
272
|
+
__linesList(expenseReportId_1) {
|
|
273
|
+
return __awaiter(this, arguments, void 0, function* (expenseReportId, request = {}, requestOptions) {
|
|
274
|
+
var _a, _b, _c, _d;
|
|
275
|
+
const { cursor, expand, includeDeletedData, includeRemoteData, includeRemoteFields, includeShellData, pageSize, } = request;
|
|
276
|
+
const _queryParams = {};
|
|
277
|
+
if (cursor != null) {
|
|
278
|
+
_queryParams["cursor"] = cursor;
|
|
279
|
+
}
|
|
280
|
+
if (expand != null) {
|
|
281
|
+
_queryParams["expand"] = serializers.accounting.ExpenseReportsLinesListRequestExpand.jsonOrThrow(expand, {
|
|
282
|
+
unrecognizedObjectKeys: "strip",
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
if (includeDeletedData != null) {
|
|
286
|
+
_queryParams["include_deleted_data"] = includeDeletedData.toString();
|
|
287
|
+
}
|
|
288
|
+
if (includeRemoteData != null) {
|
|
289
|
+
_queryParams["include_remote_data"] = includeRemoteData.toString();
|
|
290
|
+
}
|
|
291
|
+
if (includeRemoteFields != null) {
|
|
292
|
+
_queryParams["include_remote_fields"] = includeRemoteFields.toString();
|
|
293
|
+
}
|
|
294
|
+
if (includeShellData != null) {
|
|
295
|
+
_queryParams["include_shell_data"] = includeShellData.toString();
|
|
296
|
+
}
|
|
297
|
+
if (pageSize != null) {
|
|
298
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
299
|
+
}
|
|
300
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
301
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MergeEnvironment.Production, `accounting/v1/expense-reports/${encodeURIComponent(expenseReportId)}/lines`),
|
|
302
|
+
method: "GET",
|
|
303
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
304
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
305
|
+
"X-Account-Token": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.accountToken,
|
|
306
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
307
|
+
queryParameters: _queryParams,
|
|
308
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
309
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
310
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
311
|
+
});
|
|
312
|
+
if (_response.ok) {
|
|
313
|
+
return {
|
|
314
|
+
data: serializers.accounting.PaginatedExpenseReportLineList.parseOrThrow(_response.body, {
|
|
315
|
+
unrecognizedObjectKeys: "passthrough",
|
|
316
|
+
allowUnrecognizedUnionMembers: true,
|
|
317
|
+
allowUnrecognizedEnumValues: true,
|
|
318
|
+
skipValidation: true,
|
|
319
|
+
breadcrumbsPrefix: ["response"],
|
|
320
|
+
}),
|
|
321
|
+
rawResponse: _response.rawResponse,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
if (_response.error.reason === "status-code") {
|
|
325
|
+
throw new errors.MergeError({
|
|
326
|
+
statusCode: _response.error.statusCode,
|
|
327
|
+
body: _response.error.body,
|
|
328
|
+
rawResponse: _response.rawResponse,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
switch (_response.error.reason) {
|
|
332
|
+
case "non-json":
|
|
333
|
+
throw new errors.MergeError({
|
|
334
|
+
statusCode: _response.error.statusCode,
|
|
335
|
+
body: _response.error.rawBody,
|
|
336
|
+
rawResponse: _response.rawResponse,
|
|
337
|
+
});
|
|
338
|
+
case "timeout":
|
|
339
|
+
throw new errors.MergeTimeoutError("Timeout exceeded when calling GET /accounting/v1/expense-reports/{expense_report_id}/lines.");
|
|
340
|
+
case "unknown":
|
|
341
|
+
throw new errors.MergeError({
|
|
342
|
+
message: _response.error.errorMessage,
|
|
343
|
+
rawResponse: _response.rawResponse,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Returns an `ExpenseReport` object with the given `id`.
|
|
350
|
+
*
|
|
351
|
+
* @param {string} id
|
|
352
|
+
* @param {Merge.accounting.ExpenseReportsRetrieveRequest} request
|
|
353
|
+
* @param {ExpenseReports.RequestOptions} requestOptions - Request-specific configuration.
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* await client.accounting.expenseReports.retrieve("id")
|
|
357
|
+
*/
|
|
358
|
+
retrieve(id, request = {}, requestOptions) {
|
|
359
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieve(id, request, requestOptions));
|
|
360
|
+
}
|
|
361
|
+
__retrieve(id_1) {
|
|
362
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
363
|
+
var _a, _b, _c, _d;
|
|
364
|
+
const { expand, includeRemoteData, includeRemoteFields, includeShellData } = request;
|
|
365
|
+
const _queryParams = {};
|
|
366
|
+
if (expand != null) {
|
|
367
|
+
_queryParams["expand"] = serializers.accounting.ExpenseReportsRetrieveRequestExpand.jsonOrThrow(expand, {
|
|
368
|
+
unrecognizedObjectKeys: "strip",
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
if (includeRemoteData != null) {
|
|
372
|
+
_queryParams["include_remote_data"] = includeRemoteData.toString();
|
|
373
|
+
}
|
|
374
|
+
if (includeRemoteFields != null) {
|
|
375
|
+
_queryParams["include_remote_fields"] = includeRemoteFields.toString();
|
|
376
|
+
}
|
|
377
|
+
if (includeShellData != null) {
|
|
378
|
+
_queryParams["include_shell_data"] = includeShellData.toString();
|
|
379
|
+
}
|
|
380
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
381
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MergeEnvironment.Production, `accounting/v1/expense-reports/${encodeURIComponent(id)}`),
|
|
382
|
+
method: "GET",
|
|
383
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
384
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
385
|
+
"X-Account-Token": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.accountToken,
|
|
386
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
387
|
+
queryParameters: _queryParams,
|
|
388
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
389
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
390
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
391
|
+
});
|
|
392
|
+
if (_response.ok) {
|
|
393
|
+
return {
|
|
394
|
+
data: serializers.accounting.ExpenseReport.parseOrThrow(_response.body, {
|
|
395
|
+
unrecognizedObjectKeys: "passthrough",
|
|
396
|
+
allowUnrecognizedUnionMembers: true,
|
|
397
|
+
allowUnrecognizedEnumValues: true,
|
|
398
|
+
skipValidation: true,
|
|
399
|
+
breadcrumbsPrefix: ["response"],
|
|
400
|
+
}),
|
|
401
|
+
rawResponse: _response.rawResponse,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
if (_response.error.reason === "status-code") {
|
|
405
|
+
throw new errors.MergeError({
|
|
406
|
+
statusCode: _response.error.statusCode,
|
|
407
|
+
body: _response.error.body,
|
|
408
|
+
rawResponse: _response.rawResponse,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
switch (_response.error.reason) {
|
|
412
|
+
case "non-json":
|
|
413
|
+
throw new errors.MergeError({
|
|
414
|
+
statusCode: _response.error.statusCode,
|
|
415
|
+
body: _response.error.rawBody,
|
|
416
|
+
rawResponse: _response.rawResponse,
|
|
417
|
+
});
|
|
418
|
+
case "timeout":
|
|
419
|
+
throw new errors.MergeTimeoutError("Timeout exceeded when calling GET /accounting/v1/expense-reports/{id}.");
|
|
420
|
+
case "unknown":
|
|
421
|
+
throw new errors.MergeError({
|
|
422
|
+
message: _response.error.errorMessage,
|
|
423
|
+
rawResponse: _response.rawResponse,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Returns a list of `RemoteFieldClass` objects.
|
|
430
|
+
*
|
|
431
|
+
* @param {Merge.accounting.ExpenseReportsLinesRemoteFieldClassesListRequest} request
|
|
432
|
+
* @param {ExpenseReports.RequestOptions} requestOptions - Request-specific configuration.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* await client.accounting.expenseReports.linesRemoteFieldClassesList()
|
|
436
|
+
*/
|
|
437
|
+
linesRemoteFieldClassesList(request = {}, requestOptions) {
|
|
438
|
+
return core.HttpResponsePromise.fromPromise(this.__linesRemoteFieldClassesList(request, requestOptions));
|
|
439
|
+
}
|
|
440
|
+
__linesRemoteFieldClassesList() {
|
|
441
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
442
|
+
var _a, _b, _c, _d;
|
|
443
|
+
const { cursor, includeDeletedData, includeRemoteData, includeShellData, isCommonModelField, isCustom, pageSize, } = request;
|
|
444
|
+
const _queryParams = {};
|
|
445
|
+
if (cursor != null) {
|
|
446
|
+
_queryParams["cursor"] = cursor;
|
|
447
|
+
}
|
|
448
|
+
if (includeDeletedData != null) {
|
|
449
|
+
_queryParams["include_deleted_data"] = includeDeletedData.toString();
|
|
450
|
+
}
|
|
451
|
+
if (includeRemoteData != null) {
|
|
452
|
+
_queryParams["include_remote_data"] = includeRemoteData.toString();
|
|
453
|
+
}
|
|
454
|
+
if (includeShellData != null) {
|
|
455
|
+
_queryParams["include_shell_data"] = includeShellData.toString();
|
|
456
|
+
}
|
|
457
|
+
if (isCommonModelField != null) {
|
|
458
|
+
_queryParams["is_common_model_field"] = isCommonModelField.toString();
|
|
459
|
+
}
|
|
460
|
+
if (isCustom != null) {
|
|
461
|
+
_queryParams["is_custom"] = isCustom.toString();
|
|
462
|
+
}
|
|
463
|
+
if (pageSize != null) {
|
|
464
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
465
|
+
}
|
|
466
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
467
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MergeEnvironment.Production, "accounting/v1/expense-reports/lines/remote-field-classes"),
|
|
468
|
+
method: "GET",
|
|
469
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
470
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
471
|
+
"X-Account-Token": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.accountToken,
|
|
472
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
473
|
+
queryParameters: _queryParams,
|
|
474
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
475
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
476
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
477
|
+
});
|
|
478
|
+
if (_response.ok) {
|
|
479
|
+
return {
|
|
480
|
+
data: serializers.accounting.PaginatedRemoteFieldClassList.parseOrThrow(_response.body, {
|
|
481
|
+
unrecognizedObjectKeys: "passthrough",
|
|
482
|
+
allowUnrecognizedUnionMembers: true,
|
|
483
|
+
allowUnrecognizedEnumValues: true,
|
|
484
|
+
skipValidation: true,
|
|
485
|
+
breadcrumbsPrefix: ["response"],
|
|
486
|
+
}),
|
|
487
|
+
rawResponse: _response.rawResponse,
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
if (_response.error.reason === "status-code") {
|
|
491
|
+
throw new errors.MergeError({
|
|
492
|
+
statusCode: _response.error.statusCode,
|
|
493
|
+
body: _response.error.body,
|
|
494
|
+
rawResponse: _response.rawResponse,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
switch (_response.error.reason) {
|
|
498
|
+
case "non-json":
|
|
499
|
+
throw new errors.MergeError({
|
|
500
|
+
statusCode: _response.error.statusCode,
|
|
501
|
+
body: _response.error.rawBody,
|
|
502
|
+
rawResponse: _response.rawResponse,
|
|
503
|
+
});
|
|
504
|
+
case "timeout":
|
|
505
|
+
throw new errors.MergeTimeoutError("Timeout exceeded when calling GET /accounting/v1/expense-reports/lines/remote-field-classes.");
|
|
506
|
+
case "unknown":
|
|
507
|
+
throw new errors.MergeError({
|
|
508
|
+
message: _response.error.errorMessage,
|
|
509
|
+
rawResponse: _response.rawResponse,
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Returns metadata for `ExpenseReport` POSTs.
|
|
516
|
+
*
|
|
517
|
+
* @param {ExpenseReports.RequestOptions} requestOptions - Request-specific configuration.
|
|
518
|
+
*
|
|
519
|
+
* @example
|
|
520
|
+
* await client.accounting.expenseReports.metaPostRetrieve()
|
|
521
|
+
*/
|
|
522
|
+
metaPostRetrieve(requestOptions) {
|
|
523
|
+
return core.HttpResponsePromise.fromPromise(this.__metaPostRetrieve(requestOptions));
|
|
524
|
+
}
|
|
525
|
+
__metaPostRetrieve(requestOptions) {
|
|
526
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
527
|
+
var _a, _b, _c, _d;
|
|
528
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
529
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MergeEnvironment.Production, "accounting/v1/expense-reports/meta/post"),
|
|
530
|
+
method: "GET",
|
|
531
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
532
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
533
|
+
"X-Account-Token": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.accountToken,
|
|
534
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
535
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
536
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
537
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
538
|
+
});
|
|
539
|
+
if (_response.ok) {
|
|
540
|
+
return {
|
|
541
|
+
data: serializers.accounting.MetaResponse.parseOrThrow(_response.body, {
|
|
542
|
+
unrecognizedObjectKeys: "passthrough",
|
|
543
|
+
allowUnrecognizedUnionMembers: true,
|
|
544
|
+
allowUnrecognizedEnumValues: true,
|
|
545
|
+
skipValidation: true,
|
|
546
|
+
breadcrumbsPrefix: ["response"],
|
|
547
|
+
}),
|
|
548
|
+
rawResponse: _response.rawResponse,
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
if (_response.error.reason === "status-code") {
|
|
552
|
+
throw new errors.MergeError({
|
|
553
|
+
statusCode: _response.error.statusCode,
|
|
554
|
+
body: _response.error.body,
|
|
555
|
+
rawResponse: _response.rawResponse,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
switch (_response.error.reason) {
|
|
559
|
+
case "non-json":
|
|
560
|
+
throw new errors.MergeError({
|
|
561
|
+
statusCode: _response.error.statusCode,
|
|
562
|
+
body: _response.error.rawBody,
|
|
563
|
+
rawResponse: _response.rawResponse,
|
|
564
|
+
});
|
|
565
|
+
case "timeout":
|
|
566
|
+
throw new errors.MergeTimeoutError("Timeout exceeded when calling GET /accounting/v1/expense-reports/meta/post.");
|
|
567
|
+
case "unknown":
|
|
568
|
+
throw new errors.MergeError({
|
|
569
|
+
message: _response.error.errorMessage,
|
|
570
|
+
rawResponse: _response.rawResponse,
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Returns a list of `RemoteFieldClass` objects.
|
|
577
|
+
*
|
|
578
|
+
* @param {Merge.accounting.ExpenseReportsRemoteFieldClassesListRequest} request
|
|
579
|
+
* @param {ExpenseReports.RequestOptions} requestOptions - Request-specific configuration.
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
* await client.accounting.expenseReports.remoteFieldClassesList()
|
|
583
|
+
*/
|
|
584
|
+
remoteFieldClassesList(request = {}, requestOptions) {
|
|
585
|
+
return core.HttpResponsePromise.fromPromise(this.__remoteFieldClassesList(request, requestOptions));
|
|
586
|
+
}
|
|
587
|
+
__remoteFieldClassesList() {
|
|
588
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
589
|
+
var _a, _b, _c, _d;
|
|
590
|
+
const { cursor, includeDeletedData, includeRemoteData, includeShellData, isCommonModelField, isCustom, pageSize, } = request;
|
|
591
|
+
const _queryParams = {};
|
|
592
|
+
if (cursor != null) {
|
|
593
|
+
_queryParams["cursor"] = cursor;
|
|
594
|
+
}
|
|
595
|
+
if (includeDeletedData != null) {
|
|
596
|
+
_queryParams["include_deleted_data"] = includeDeletedData.toString();
|
|
597
|
+
}
|
|
598
|
+
if (includeRemoteData != null) {
|
|
599
|
+
_queryParams["include_remote_data"] = includeRemoteData.toString();
|
|
600
|
+
}
|
|
601
|
+
if (includeShellData != null) {
|
|
602
|
+
_queryParams["include_shell_data"] = includeShellData.toString();
|
|
603
|
+
}
|
|
604
|
+
if (isCommonModelField != null) {
|
|
605
|
+
_queryParams["is_common_model_field"] = isCommonModelField.toString();
|
|
606
|
+
}
|
|
607
|
+
if (isCustom != null) {
|
|
608
|
+
_queryParams["is_custom"] = isCustom.toString();
|
|
609
|
+
}
|
|
610
|
+
if (pageSize != null) {
|
|
611
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
612
|
+
}
|
|
613
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
614
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MergeEnvironment.Production, "accounting/v1/expense-reports/remote-field-classes"),
|
|
615
|
+
method: "GET",
|
|
616
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
617
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
618
|
+
"X-Account-Token": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.accountToken,
|
|
619
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
620
|
+
queryParameters: _queryParams,
|
|
621
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
622
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
623
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
624
|
+
});
|
|
625
|
+
if (_response.ok) {
|
|
626
|
+
return {
|
|
627
|
+
data: serializers.accounting.PaginatedRemoteFieldClassList.parseOrThrow(_response.body, {
|
|
628
|
+
unrecognizedObjectKeys: "passthrough",
|
|
629
|
+
allowUnrecognizedUnionMembers: true,
|
|
630
|
+
allowUnrecognizedEnumValues: true,
|
|
631
|
+
skipValidation: true,
|
|
632
|
+
breadcrumbsPrefix: ["response"],
|
|
633
|
+
}),
|
|
634
|
+
rawResponse: _response.rawResponse,
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
if (_response.error.reason === "status-code") {
|
|
638
|
+
throw new errors.MergeError({
|
|
639
|
+
statusCode: _response.error.statusCode,
|
|
640
|
+
body: _response.error.body,
|
|
641
|
+
rawResponse: _response.rawResponse,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
switch (_response.error.reason) {
|
|
645
|
+
case "non-json":
|
|
646
|
+
throw new errors.MergeError({
|
|
647
|
+
statusCode: _response.error.statusCode,
|
|
648
|
+
body: _response.error.rawBody,
|
|
649
|
+
rawResponse: _response.rawResponse,
|
|
650
|
+
});
|
|
651
|
+
case "timeout":
|
|
652
|
+
throw new errors.MergeTimeoutError("Timeout exceeded when calling GET /accounting/v1/expense-reports/remote-field-classes.");
|
|
653
|
+
case "unknown":
|
|
654
|
+
throw new errors.MergeError({
|
|
655
|
+
message: _response.error.errorMessage,
|
|
656
|
+
rawResponse: _response.rawResponse,
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
_getAuthorizationHeader() {
|
|
662
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
663
|
+
return `Bearer ${yield core.Supplier.get(this._options.apiKey)}`;
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
exports.ExpenseReports = ExpenseReports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|