@silexpert/core 0.4.209 → 0.4.212
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/es/api/resources/Connector.d.ts +2 -2
- package/es/api/resources/Connector.d.ts.map +1 -1
- package/es/api/resources/Connector.js +2 -2
- package/es/api/resources/Connector.js.map +1 -1
- package/es/types/Interface/api/revision/ReadRevisionTransactionDetail.d.ts +1 -0
- package/es/types/Interface/api/revision/ReadRevisionTransactionDetail.d.ts.map +1 -1
- package/es/types/Interface/api/revision/ReadRevisionTransactionDetail.js.map +1 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.d.ts.map +1 -1
- package/es/utils/index.js +1 -0
- package/es/utils/index.js.map +1 -1
- package/es/utils/social.d.ts +2 -0
- package/es/utils/social.d.ts.map +1 -0
- package/es/utils/social.js +23 -0
- package/es/utils/social.js.map +1 -0
- package/js/api/resources/Connector.js +2 -2
- package/js/api/resources/Connector.js.map +1 -1
- package/js/utils/index.js +12 -0
- package/js/utils/index.js.map +1 -1
- package/js/utils/social.js +32 -0
- package/js/utils/social.js.map +1 -0
- package/package.json +1 -1
- package/ts/api/resources/Connector.ts +3 -3
- package/ts/types/Interface/api/revision/ReadRevisionTransactionDetail.ts +1 -0
- package/ts/utils/index.ts +1 -0
- package/ts/utils/social.ts +22 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IAccountingTransaction } from '../../types';
|
|
1
|
+
import { IAccountingTransaction, ImportBankAccount } from '../../types';
|
|
2
2
|
import { Resource } from '../Resource';
|
|
3
3
|
export declare class Connector extends Resource {
|
|
4
4
|
test(id: number): Promise<boolean>;
|
|
5
|
-
importManually(idBankAccount: number): Promise<IAccountingTransaction[]>;
|
|
5
|
+
importManually(idBankAccount: number, payload: ImportBankAccount): Promise<IAccountingTransaction[]>;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=Connector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connector.d.ts","sourceRoot":"","sources":["../../../ts/api/resources/Connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Connector.d.ts","sourceRoot":"","sources":["../../../ts/api/resources/Connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,SAAU,SAAQ,QAAQ;IACrC,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAGlC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;CAGrG"}
|
|
@@ -3,8 +3,8 @@ export class Connector extends Resource {
|
|
|
3
3
|
test(id) {
|
|
4
4
|
return this.axios.$post(`/connector/${id}/test`);
|
|
5
5
|
}
|
|
6
|
-
importManually(idBankAccount) {
|
|
7
|
-
return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import
|
|
6
|
+
importManually(idBankAccount, payload) {
|
|
7
|
+
return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import`, payload);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=Connector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connector.js","sourceRoot":"","sources":["../../../ts/api/resources/Connector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,SAAU,SAAQ,QAAQ;IACrC,IAAI,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IACD,cAAc,CAAC,aAAqB;
|
|
1
|
+
{"version":3,"file":"Connector.js","sourceRoot":"","sources":["../../../ts/api/resources/Connector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,SAAU,SAAQ,QAAQ;IACrC,IAAI,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IACD,cAAc,CAAC,aAAqB,EAAE,OAA0B;QAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,6BAA6B,aAAa,SAAS,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;CACF","sourcesContent":["import { IAccountingTransaction, ImportBankAccount } from '../../types';\nimport { Resource } from '../Resource';\n\nexport class Connector extends Resource {\n test(id: number): Promise<boolean> {\n return this.axios.$post(`/connector/${id}/test`);\n }\n importManually(idBankAccount: number, payload: ImportBankAccount): Promise<IAccountingTransaction[]> {\n return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import`, payload);\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadRevisionTransactionDetail.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/revision/ReadRevisionTransactionDetail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACrB,iBAAiB,EAAE,yBAAyB,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"ReadRevisionTransactionDetail.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/revision/ReadRevisionTransactionDetail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACrB,iBAAiB,EAAE,yBAAyB,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadRevisionTransactionDetail.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/revision/ReadRevisionTransactionDetail.ts"],"names":[],"mappings":"","sourcesContent":["import { IFile } from '../../..';\n\nexport interface ReadRevisionTransactionDetail {\n id: number;\n label: string | null;\n reference: string | null;\n dateValue: Date;\n dateLocked: Date | null;\n dateVerified: Date | null;\n originalValue: number | null;\n idUser: number | null;\n isBlocked: boolean;\n isMerged: boolean;\n isAsset: boolean;\n exported: Date | null;\n kilometers: number | null;\n internComment: string | null;\n invoiceRequested: boolean;\n idBankAccount: number | null;\n idSociety: number;\n idCurrency?: number | null;\n idSocietyVehicle: number | null;\n idSocietyPartner: number | null;\n idRule: number | null;\n idAccountingJournal: number;\n idEstimateInvoice: number | null;\n idEAF: number | null;\n file: IFile[] | null;\n accountingEntries: RevisionAccountingEntries[];\n}\n\nexport interface RevisionAccountingEntries {\n id: number;\n master: boolean;\n dateValue: Date;\n designation: string;\n comment: string | null;\n debit: number;\n credit: number;\n isPerso: boolean;\n idInherit: number | null;\n idAccount: number | null;\n idThirdParty: number | null;\n idVat: number | null;\n idImmobilization?: number | null;\n account: RevisionAccount;\n}\n\nexport interface RevisionAccount {\n id: number;\n number: number;\n name: string;\n idParentAccount: number | null;\n idVat: number | null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ReadRevisionTransactionDetail.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/revision/ReadRevisionTransactionDetail.ts"],"names":[],"mappings":"","sourcesContent":["import { IFile } from '../../..';\n\nexport interface ReadRevisionTransactionDetail {\n id: number;\n invoiceNumber: string | null;\n label: string | null;\n reference: string | null;\n dateValue: Date;\n dateLocked: Date | null;\n dateVerified: Date | null;\n originalValue: number | null;\n idUser: number | null;\n isBlocked: boolean;\n isMerged: boolean;\n isAsset: boolean;\n exported: Date | null;\n kilometers: number | null;\n internComment: string | null;\n invoiceRequested: boolean;\n idBankAccount: number | null;\n idSociety: number;\n idCurrency?: number | null;\n idSocietyVehicle: number | null;\n idSocietyPartner: number | null;\n idRule: number | null;\n idAccountingJournal: number;\n idEstimateInvoice: number | null;\n idEAF: number | null;\n file: IFile[] | null;\n accountingEntries: RevisionAccountingEntries[];\n}\n\nexport interface RevisionAccountingEntries {\n id: number;\n master: boolean;\n dateValue: Date;\n designation: string;\n comment: string | null;\n debit: number;\n credit: number;\n isPerso: boolean;\n idInherit: number | null;\n idAccount: number | null;\n idThirdParty: number | null;\n idVat: number | null;\n idImmobilization?: number | null;\n account: RevisionAccount;\n}\n\nexport interface RevisionAccount {\n id: number;\n number: number;\n name: string;\n idParentAccount: number | null;\n idVat: number | null;\n}\n"]}
|
package/es/utils/index.d.ts
CHANGED
package/es/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
package/es/utils/index.js
CHANGED
package/es/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC","sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './task';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC","sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './task';\nexport * from './social';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../ts/utils/social.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,CAe5E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const diffHours = (start, end) => {
|
|
2
|
+
let diff = (start.getTime() - end.getTime()) / 1000;
|
|
3
|
+
diff /= 60 * 60;
|
|
4
|
+
return Math.abs(Math.round(diff));
|
|
5
|
+
};
|
|
6
|
+
export function getBusinessDatesCount(startDate, endDate) {
|
|
7
|
+
const day = startDate;
|
|
8
|
+
let businessDays = 0;
|
|
9
|
+
// eslint-disable-next-line no-unmodified-loop-condition
|
|
10
|
+
while (day <= endDate) {
|
|
11
|
+
if (day.getDay() !== 0 && day.getDay() !== 6) {
|
|
12
|
+
if (diffHours(day, endDate) <= 4) {
|
|
13
|
+
businessDays += 0.5;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
businessDays += 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
day.setDate(day.getDate() + 1);
|
|
20
|
+
}
|
|
21
|
+
return businessDays;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=social.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social.js","sourceRoot":"","sources":["../../ts/utils/social.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,CAAC,KAAW,EAAE,GAAS,EAAU,EAAE;IACnD,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IACpD,IAAI,IAAI,EAAE,GAAG,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,SAAe,EAAE,OAAa;IAClE,MAAM,GAAG,GAAG,SAAS,CAAC;IACtB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,wDAAwD;IACxD,OAAO,GAAG,IAAI,OAAO,EAAE;QACrB,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;YAC5C,IAAI,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE;gBAChC,YAAY,IAAI,GAAG,CAAC;aACrB;iBAAM;gBACL,YAAY,IAAI,CAAC,CAAC;aACnB;SACF;QACD,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;KAChC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["const diffHours = (start: Date, end: Date): number => {\n let diff = (start.getTime() - end.getTime()) / 1000;\n diff /= 60 * 60;\n return Math.abs(Math.round(diff));\n};\n\nexport function getBusinessDatesCount(startDate: Date, endDate: Date): number {\n const day = startDate;\n let businessDays = 0;\n // eslint-disable-next-line no-unmodified-loop-condition\n while (day <= endDate) {\n if (day.getDay() !== 0 && day.getDay() !== 6) {\n if (diffHours(day, endDate) <= 4) {\n businessDays += 0.5;\n } else {\n businessDays += 1;\n }\n }\n day.setDate(day.getDate() + 1);\n }\n return businessDays;\n}"]}
|
|
@@ -12,8 +12,8 @@ class Connector extends _Resource.Resource {
|
|
|
12
12
|
return this.axios.$post(`/connector/${id}/test`);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
importManually(idBankAccount) {
|
|
16
|
-
return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import
|
|
15
|
+
importManually(idBankAccount, payload) {
|
|
16
|
+
return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import`, payload);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connector.js","mappings":";;;;;;;AACA;;AAEM,MAAOA,SAAP,SAAyBC,kBAAzB,CAAiC;EACrCC,IAAI,CAACC,EAAD,EAAW;IACb,OAAO,KAAKC,KAAL,CAAWC,KAAX,CAAiB,cAAcF,EAAE,OAAjC,CAAP;EACD;;EACDG,cAAc,CAACC,aAAD,
|
|
1
|
+
{"version":3,"file":"Connector.js","mappings":";;;;;;;AACA;;AAEM,MAAOA,SAAP,SAAyBC,kBAAzB,CAAiC;EACrCC,IAAI,CAACC,EAAD,EAAW;IACb,OAAO,KAAKC,KAAL,CAAWC,KAAX,CAAiB,cAAcF,EAAE,OAAjC,CAAP;EACD;;EACDG,cAAc,CAACC,aAAD,EAAwBC,OAAxB,EAAkD;IAC9D,OAAO,KAAKJ,KAAL,CAAWC,KAAX,CAAiB,6BAA6BE,aAAa,SAA3D,EAAsEC,OAAtE,CAAP;EACD;;AANoC;;QAA1BR,S,GAAAA,S","names":["Connector","Resource","test","id","axios","$post","importManually","idBankAccount","payload"],"sourceRoot":"","sources":["../../../ts/api/resources/Connector.ts"],"sourcesContent":["import { IAccountingTransaction, ImportBankAccount } from '../../types';\nimport { Resource } from '../Resource';\n\nexport class Connector extends Resource {\n test(id: number): Promise<boolean> {\n return this.axios.$post(`/connector/${id}/test`);\n }\n importManually(idBankAccount: number, payload: ImportBankAccount): Promise<IAccountingTransaction[]> {\n return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import`, payload);\n }\n}"]}
|
package/js/utils/index.js
CHANGED
|
@@ -99,4 +99,16 @@ Object.keys(_task).forEach(function (key) {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
|
+
|
|
103
|
+
var _social = require("./social");
|
|
104
|
+
|
|
105
|
+
Object.keys(_social).forEach(function (key) {
|
|
106
|
+
if (key === "default" || key === "__esModule") return;
|
|
107
|
+
Object.defineProperty(exports, key, {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function () {
|
|
110
|
+
return _social[key];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
102
114
|
//# sourceMappingURL=index.js.map
|
package/js/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA","names":[],"sourceRoot":"","sources":["../../ts/utils/index.ts"],"sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './task';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA","names":[],"sourceRoot":"","sources":["../../ts/utils/index.ts"],"sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './task';\nexport * from './social';\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getBusinessDatesCount = getBusinessDatesCount;
|
|
7
|
+
|
|
8
|
+
const diffHours = (start, end) => {
|
|
9
|
+
let diff = (start.getTime() - end.getTime()) / 1000;
|
|
10
|
+
diff /= 60 * 60;
|
|
11
|
+
return Math.abs(Math.round(diff));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function getBusinessDatesCount(startDate, endDate) {
|
|
15
|
+
const day = startDate;
|
|
16
|
+
let businessDays = 0; // eslint-disable-next-line no-unmodified-loop-condition
|
|
17
|
+
|
|
18
|
+
while (day <= endDate) {
|
|
19
|
+
if (day.getDay() !== 0 && day.getDay() !== 6) {
|
|
20
|
+
if (diffHours(day, endDate) <= 4) {
|
|
21
|
+
businessDays += 0.5;
|
|
22
|
+
} else {
|
|
23
|
+
businessDays += 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
day.setDate(day.getDate() + 1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return businessDays;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=social.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social.js","mappings":";;;;;QAMgBA,qB,GAAAA,qB;;AANhB,MAAMC,SAAS,GAAG,CAACC,KAAD,EAAcC,GAAd,KAAmC;EACnD,IAAIC,IAAI,GAAG,CAACF,KAAK,CAACG,OAAN,KAAkBF,GAAG,CAACE,OAAJ,EAAnB,IAAoC,IAA/C;EACAD,IAAI,IAAI,KAAK,EAAb;EACA,OAAOE,IAAI,CAACC,GAAL,CAASD,IAAI,CAACE,KAAL,CAAWJ,IAAX,CAAT,CAAP;AACD,CAJD;;AAMM,SAAUJ,qBAAV,CAAgCS,SAAhC,EAAiDC,OAAjD,EAA8D;EAClE,MAAMC,GAAG,GAAGF,SAAZ;EACA,IAAIG,YAAY,GAAG,CAAnB,CAFkE,CAGlE;;EACA,OAAOD,GAAG,IAAID,OAAd,EAAuB;IACrB,IAAIC,GAAG,CAACE,MAAJ,OAAiB,CAAjB,IAAsBF,GAAG,CAACE,MAAJ,OAAiB,CAA3C,EAA8C;MAC5C,IAAIZ,SAAS,CAACU,GAAD,EAAMD,OAAN,CAAT,IAA2B,CAA/B,EAAkC;QAChCE,YAAY,IAAI,GAAhB;MACD,CAFD,MAEO;QACLA,YAAY,IAAI,CAAhB;MACD;IACF;;IACDD,GAAG,CAACG,OAAJ,CAAYH,GAAG,CAACI,OAAJ,KAAgB,CAA5B;EACD;;EACD,OAAOH,YAAP;AACD","names":["getBusinessDatesCount","diffHours","start","end","diff","getTime","Math","abs","round","startDate","endDate","day","businessDays","getDay","setDate","getDate"],"sourceRoot":"","sources":["../../ts/utils/social.ts"],"sourcesContent":["const diffHours = (start: Date, end: Date): number => {\n let diff = (start.getTime() - end.getTime()) / 1000;\n diff /= 60 * 60;\n return Math.abs(Math.round(diff));\n};\n\nexport function getBusinessDatesCount(startDate: Date, endDate: Date): number {\n const day = startDate;\n let businessDays = 0;\n // eslint-disable-next-line no-unmodified-loop-condition\n while (day <= endDate) {\n if (day.getDay() !== 0 && day.getDay() !== 6) {\n if (diffHours(day, endDate) <= 4) {\n businessDays += 0.5;\n } else {\n businessDays += 1;\n }\n }\n day.setDate(day.getDate() + 1);\n }\n return businessDays;\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.212",
|
|
4
4
|
"description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
|
|
5
5
|
"homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
|
|
6
6
|
"main": "js/index.js",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IAccountingTransaction } from '../../types';
|
|
1
|
+
import { IAccountingTransaction, ImportBankAccount } from '../../types';
|
|
2
2
|
import { Resource } from '../Resource';
|
|
3
3
|
|
|
4
4
|
export class Connector extends Resource {
|
|
5
5
|
test(id: number): Promise<boolean> {
|
|
6
6
|
return this.axios.$post(`/connector/${id}/test`);
|
|
7
7
|
}
|
|
8
|
-
importManually(idBankAccount: number): Promise<IAccountingTransaction[]> {
|
|
9
|
-
return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import
|
|
8
|
+
importManually(idBankAccount: number, payload: ImportBankAccount): Promise<IAccountingTransaction[]> {
|
|
9
|
+
return this.axios.$post(`/connectors/bank-accounts/${idBankAccount}/import`, payload);
|
|
10
10
|
}
|
|
11
11
|
}
|
package/ts/utils/index.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const diffHours = (start: Date, end: Date): number => {
|
|
2
|
+
let diff = (start.getTime() - end.getTime()) / 1000;
|
|
3
|
+
diff /= 60 * 60;
|
|
4
|
+
return Math.abs(Math.round(diff));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function getBusinessDatesCount(startDate: Date, endDate: Date): number {
|
|
8
|
+
const day = startDate;
|
|
9
|
+
let businessDays = 0;
|
|
10
|
+
// eslint-disable-next-line no-unmodified-loop-condition
|
|
11
|
+
while (day <= endDate) {
|
|
12
|
+
if (day.getDay() !== 0 && day.getDay() !== 6) {
|
|
13
|
+
if (diffHours(day, endDate) <= 4) {
|
|
14
|
+
businessDays += 0.5;
|
|
15
|
+
} else {
|
|
16
|
+
businessDays += 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
day.setDate(day.getDate() + 1);
|
|
20
|
+
}
|
|
21
|
+
return businessDays;
|
|
22
|
+
}
|