@bisondesk/documents-sdk 1.0.373 → 1.0.375
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 +2 -0
- package/lib/apis/document-drafts.d.ts.map +1 -1
- package/lib/apis/document-drafts.js +19 -0
- package/lib/apis/document-drafts.js.map +1 -1
- package/lib/apis/documents-search.d.ts.map +1 -1
- package/lib/apis/documents.d.ts.map +1 -1
- package/lib/constants.d.ts +3 -2
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +4 -3
- package/lib/constants.js.map +1 -1
- package/lib/schemas.js +1 -1
- package/lib/schemas.js.map +1 -1
- package/lib/types/ai.d.ts +1 -0
- package/lib/types/ai.d.ts.map +1 -1
- package/lib/types/ai.js +1 -0
- package/lib/types/ai.js.map +1 -1
- package/lib/types/documents.d.ts +13 -1
- package/lib/types/documents.d.ts.map +1 -1
- package/lib/types/documents.js.map +1 -1
- package/lib/types/legacy.d.ts +4 -0
- package/lib/types/legacy.d.ts.map +1 -1
- package/lib/types/legacy.js.map +1 -1
- package/lib/types/rules.d.ts +2 -1
- package/lib/types/rules.d.ts.map +1 -1
- package/lib/types/rules.js +1 -0
- package/lib/types/rules.js.map +1 -1
- package/lib/types/search.d.ts +7 -0
- package/lib/types/search.d.ts.map +1 -1
- package/lib/types/search.js +7 -0
- package/lib/types/search.js.map +1 -1
- package/lib/utils/finance.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/apis/document-drafts.ts +29 -0
- package/src/constants.ts +4 -3
- package/src/schemas.ts +1 -1
- package/src/types/ai.ts +1 -0
- package/src/types/documents.ts +16 -1
- package/src/types/legacy.ts +5 -0
- package/src/types/rules.ts +2 -0
- package/src/types/search.ts +8 -0
- package/tsconfig.tsbuildinfo +1 -1
package/src/schemas.ts
CHANGED
|
@@ -72,7 +72,7 @@ export const newFinanceDocV2Schema = Joi.object({
|
|
|
72
72
|
category: Joi.string().required(),
|
|
73
73
|
organizationSummary: orgSummarySchema.required(),
|
|
74
74
|
transferDescription: Joi.string(),
|
|
75
|
-
invoiceId: Joi.string().uuid(),
|
|
75
|
+
invoiceId: Joi.string().uuid().empty(''),
|
|
76
76
|
notes: Joi.string().empty(''),
|
|
77
77
|
salesperson: Joi.object({
|
|
78
78
|
name: Joi.string().required(),
|
package/src/types/ai.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AdministrativeDocument, DocumentDraft, FinanceDocumentV2 } from './docu
|
|
|
3
3
|
|
|
4
4
|
export enum LLMModel {
|
|
5
5
|
gpt35Turbo = 'gpt-3.5-turbo',
|
|
6
|
+
gpt4oMini = 'gpt-4o-mini-2024-07-18',
|
|
6
7
|
anthropicClaudeInstantV1 = 'anthropic.claude-instant-v1',
|
|
7
8
|
anthropicClaude3Sonnet = 'anthropic.claude-3-sonnet-20240229-v1:0',
|
|
8
9
|
anthropicClaude3Haiku = 'anthropic.claude-3-haiku-20240307-v1:0',
|
package/src/types/documents.ts
CHANGED
|
@@ -158,6 +158,21 @@ export type ValidationRulesResult = {
|
|
|
158
158
|
skipped?: string[];
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
+
export type DocumentValidationRulesResults = {
|
|
162
|
+
[DraftProcessStatus.BusinessValid]: ValidationRulesResult | undefined;
|
|
163
|
+
[DraftProcessStatus.AccountingValid]: ValidationRulesResult | undefined;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type NewDraftRemarks = {
|
|
167
|
+
accounting?: string;
|
|
168
|
+
business?: string;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export type DraftRemarks = NewDraftRemarks & {
|
|
172
|
+
at: string;
|
|
173
|
+
by: string;
|
|
174
|
+
};
|
|
175
|
+
|
|
161
176
|
type DraftProcessing = {
|
|
162
177
|
status: DraftProcessStatus;
|
|
163
178
|
documentType?: DocumentType;
|
|
@@ -169,7 +184,7 @@ type DraftProcessing = {
|
|
|
169
184
|
lastCompletedAt?: string;
|
|
170
185
|
|
|
171
186
|
validationRulesResult?: ValidationRulesResult;
|
|
172
|
-
|
|
187
|
+
remarks?: DraftRemarks;
|
|
173
188
|
};
|
|
174
189
|
|
|
175
190
|
export enum DocumentType {
|
package/src/types/legacy.ts
CHANGED
package/src/types/rules.ts
CHANGED
|
@@ -7,6 +7,7 @@ export enum ValidationRuleType {
|
|
|
7
7
|
MaxAmountSupplier = 'max-amount-supplier-rule',
|
|
8
8
|
PurchasePrice = 'purchase-price-rule',
|
|
9
9
|
RecurrentVehicleInvoice = 'recurrent-vehicle-invoice-rule',
|
|
10
|
+
RemarksBlock = 'remarks-block-rule',
|
|
10
11
|
TransportCostExternal = 'transport-cost-external-rule',
|
|
11
12
|
TransportCostInternal = 'transport-cost-internal-rule',
|
|
12
13
|
}
|
|
@@ -38,6 +39,7 @@ export type RuleConfig = { categoryId?: string } & (
|
|
|
38
39
|
| ValidationRuleType.GarageCostInternal
|
|
39
40
|
| ValidationRuleType.GarageCostExternal
|
|
40
41
|
| ValidationRuleType.PurchasePrice
|
|
42
|
+
| ValidationRuleType.RemarksBlock
|
|
41
43
|
| ValidationRuleType.TransportCostInternal
|
|
42
44
|
| ValidationRuleType.TransportCostExternal;
|
|
43
45
|
}
|
package/src/types/search.ts
CHANGED
|
@@ -36,6 +36,13 @@ export enum FinanceDocumentSource {
|
|
|
36
36
|
Bisondesk = 'Bisondesk',
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export enum AutoValidatedInfo {
|
|
40
|
+
Business = 'business',
|
|
41
|
+
Accounting = 'accounting',
|
|
42
|
+
None = 'none',
|
|
43
|
+
All = 'all',
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
export type SearchFinanceDocument = {
|
|
40
47
|
permissions: SearchPermissions;
|
|
41
48
|
org?: Organization;
|
|
@@ -43,6 +50,7 @@ export type SearchFinanceDocument = {
|
|
|
43
50
|
booking?: FinanceBooking;
|
|
44
51
|
vehicle?: SearchDocumentVehicleRef[];
|
|
45
52
|
custom: {
|
|
53
|
+
autoValidated?: AutoValidatedInfo[];
|
|
46
54
|
isBooked: boolean;
|
|
47
55
|
source: FinanceDocumentSource;
|
|
48
56
|
};
|