@bisondesk/documents-sdk 1.0.318 → 1.0.319
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/lib/apis/document-drafts.d.ts +4 -0
- package/lib/apis/document-drafts.d.ts.map +1 -0
- package/lib/apis/document-drafts.js +45 -0
- package/lib/apis/document-drafts.js.map +1 -0
- package/lib/apis/documents.d.ts +3 -0
- package/lib/apis/documents.d.ts.map +1 -1
- package/lib/apis/documents.js +41 -3
- package/lib/apis/documents.js.map +1 -1
- package/lib/schemas.d.ts +6 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +105 -0
- package/lib/schemas.js.map +1 -0
- package/lib/types/booking.d.ts +9 -3
- package/lib/types/booking.d.ts.map +1 -1
- package/lib/types/booking.js.map +1 -1
- package/lib/types/document-categories.d.ts +23 -5
- package/lib/types/document-categories.d.ts.map +1 -1
- package/lib/types/document-categories.js.map +1 -1
- package/lib/types/documents.d.ts +23 -3
- package/lib/types/documents.d.ts.map +1 -1
- package/lib/types/documents.js +7 -0
- package/lib/types/documents.js.map +1 -1
- package/lib/types/events.d.ts +2 -2
- package/lib/types/events.d.ts.map +1 -1
- package/lib/types/events.js.map +1 -1
- package/lib/types/legacy.d.ts +1 -0
- package/lib/types/legacy.d.ts.map +1 -1
- package/lib/types/legacy.js.map +1 -1
- package/lib/types/search.d.ts +9 -8
- package/lib/types/search.d.ts.map +1 -1
- package/lib/types/search.js.map +1 -1
- package/lib/types/vat.d.ts +1 -1
- package/lib/types/vat.d.ts.map +1 -1
- package/lib/types/vat.js.map +1 -1
- package/lib/utils/associations.d.ts +6 -0
- package/lib/utils/associations.d.ts.map +1 -0
- package/lib/utils/associations.js +9 -0
- package/lib/utils/associations.js.map +1 -0
- package/lib/{utils.d.ts → utils/previews.d.ts} +1 -1
- package/lib/utils/previews.d.ts.map +1 -0
- package/lib/{utils.js → utils/previews.js} +1 -1
- package/lib/utils/previews.js.map +1 -0
- package/package.json +1 -1
- package/src/apis/document-drafts.ts +68 -0
- package/src/apis/documents.ts +60 -3
- package/src/schemas.ts +112 -0
- package/src/types/booking.ts +4 -3
- package/src/types/document-categories.ts +28 -6
- package/src/types/documents.ts +33 -3
- package/src/types/events.ts +2 -2
- package/src/types/legacy.ts +1 -0
- package/src/types/search.ts +10 -8
- package/src/types/vat.ts +1 -1
- package/src/utils/associations.ts +21 -0
- package/tsconfig.deploy.tsbuildinfo +1 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- /package/src/{utils.ts → utils/previews.ts} +0 -0
package/src/types/search.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';
|
|
2
|
+
import { PaginatedRequest, SearchPermissions } from '@bisondesk/commons-sdk/types';
|
|
2
3
|
import { Organization } from '@bisondesk/core-sdk/types/crm';
|
|
3
4
|
import { PublicSearchDefinition } from '@bisondesk/core-sdk/types/definitions';
|
|
4
5
|
import { FinanceBooking } from './booking.js';
|
|
5
|
-
import { AdministrativeDocument, FinanceDocument } from './documents.js';
|
|
6
|
+
import { AdministrativeDocument, DocumentType, FinanceDocument } from './documents.js';
|
|
6
7
|
|
|
7
8
|
export type SearchDocumentVehicleRef = {
|
|
8
9
|
id: string;
|
|
@@ -14,9 +15,7 @@ export type InputSearchFinanceDocument = SearchFinanceDocument & {
|
|
|
14
15
|
permissions: SearchPermissions;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
export type InputSearchAdministrativeDocument = SearchAdministrativeDocument
|
|
18
|
-
permissions: SearchPermissions;
|
|
19
|
-
};
|
|
18
|
+
export type InputSearchAdministrativeDocument = SearchAdministrativeDocument;
|
|
20
19
|
|
|
21
20
|
export type DocsSearchDefinitions = {
|
|
22
21
|
searchFinanceDoc: PublicSearchDefinition;
|
|
@@ -31,12 +30,15 @@ export type SearchFinanceDocument = {
|
|
|
31
30
|
org?: Organization;
|
|
32
31
|
doc: FinanceDocument;
|
|
33
32
|
booking?: FinanceBooking;
|
|
34
|
-
vehicle?: SearchDocumentVehicleRef[];
|
|
35
33
|
};
|
|
36
34
|
|
|
37
35
|
export type SearchAdministrativeDocument = {
|
|
38
36
|
doc: AdministrativeDocument;
|
|
39
37
|
permissions: SearchPermissions;
|
|
40
|
-
org?: Organization;
|
|
41
|
-
vehicle?: SearchDocumentVehicleRef[];
|
|
42
38
|
};
|
|
39
|
+
|
|
40
|
+
export type RelatedDocumentsRequest = {
|
|
41
|
+
businessEntityId: BusinessEntityIds;
|
|
42
|
+
recordId: string;
|
|
43
|
+
docTypes?: DocumentType[];
|
|
44
|
+
} & PaginatedRequest;
|
package/src/types/vat.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type VatCode = {
|
|
|
19
19
|
default: boolean;
|
|
20
20
|
description: string;
|
|
21
21
|
rate: string;
|
|
22
|
-
|
|
22
|
+
eInvoiceCode?: InternationalTaxCodes;
|
|
23
23
|
|
|
24
24
|
reason?: string; // legal text added when this code is used
|
|
25
25
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';
|
|
2
|
+
import {
|
|
3
|
+
GlobalBusinessEntity,
|
|
4
|
+
getDescriptionForBusinessEntity,
|
|
5
|
+
getTagsForBusinessEntity,
|
|
6
|
+
getTitleForBusinessEntity,
|
|
7
|
+
} from '@bisondesk/core-sdk/utils/search';
|
|
8
|
+
import { Association } from '../types/documents.js';
|
|
9
|
+
|
|
10
|
+
export type SupportedAssociationEntity = GlobalBusinessEntity;
|
|
11
|
+
|
|
12
|
+
export const getAssociationForBusinessEntity = (
|
|
13
|
+
businessEntityId: BusinessEntityIds,
|
|
14
|
+
record: SupportedAssociationEntity
|
|
15
|
+
): Association => ({
|
|
16
|
+
businessEntityId,
|
|
17
|
+
recordId: record.id,
|
|
18
|
+
title: getTitleForBusinessEntity(businessEntityId, record),
|
|
19
|
+
description: getDescriptionForBusinessEntity(businessEntityId, record),
|
|
20
|
+
tags: getTagsForBusinessEntity(businessEntityId, record),
|
|
21
|
+
});
|