@silexpert/core 1.3.94-6 → 1.3.94-7

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.
Files changed (61) hide show
  1. package/dist/cjs/api/resources/BankDedup.d.ts +2 -2
  2. package/dist/cjs/api/resources/BankDedup.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/BankDedup.js.map +1 -1
  4. package/dist/cjs/api/resources/Refund.d.ts +1 -1
  5. package/dist/cjs/api/resources/Refund.d.ts.map +1 -1
  6. package/dist/cjs/api/resources/Refund.js.map +1 -1
  7. package/dist/cjs/api/resources/Society.d.ts.map +1 -1
  8. package/dist/cjs/api/resources/Society.js.map +1 -1
  9. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +1 -0
  10. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
  11. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.js +7 -0
  12. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
  13. package/dist/cjs/types/Interface/api/config/ConfigType.d.ts +0 -3
  14. package/dist/cjs/types/Interface/api/config/ConfigType.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/config/ConfigType.js.map +1 -1
  16. package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts +1 -0
  17. package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
  18. package/dist/cjs/types/Interface/api/registration/CreateRegistration.js +6 -0
  19. package/dist/cjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
  20. package/dist/cjs/types/Interface/api/shopify/InvoicesShopify.d.ts +5 -4
  21. package/dist/cjs/types/Interface/api/shopify/InvoicesShopify.d.ts.map +1 -1
  22. package/dist/cjs/types/Interface/api/shopify/InvoicesShopify.js +13 -0
  23. package/dist/cjs/types/Interface/api/shopify/InvoicesShopify.js.map +1 -1
  24. package/dist/cjs/types/Interface/models/IBankDedup.d.ts +85 -61
  25. package/dist/cjs/types/Interface/models/IBankDedup.d.ts.map +1 -1
  26. package/dist/cjs/types/Interface/models/IBankDedup.js.map +1 -1
  27. package/dist/mjs/api/resources/BankDedup.d.ts +2 -2
  28. package/dist/mjs/api/resources/BankDedup.d.ts.map +1 -1
  29. package/dist/mjs/api/resources/BankDedup.js.map +1 -1
  30. package/dist/mjs/api/resources/Refund.d.ts +1 -1
  31. package/dist/mjs/api/resources/Refund.d.ts.map +1 -1
  32. package/dist/mjs/api/resources/Refund.js.map +1 -1
  33. package/dist/mjs/api/resources/Society.d.ts.map +1 -1
  34. package/dist/mjs/api/resources/Society.js.map +1 -1
  35. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +1 -0
  36. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
  37. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.js +8 -0
  38. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
  39. package/dist/mjs/types/Interface/api/config/ConfigType.d.ts +0 -3
  40. package/dist/mjs/types/Interface/api/config/ConfigType.d.ts.map +1 -1
  41. package/dist/mjs/types/Interface/api/config/ConfigType.js.map +1 -1
  42. package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts +1 -0
  43. package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
  44. package/dist/mjs/types/Interface/api/registration/CreateRegistration.js +7 -0
  45. package/dist/mjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
  46. package/dist/mjs/types/Interface/api/shopify/InvoicesShopify.d.ts +5 -4
  47. package/dist/mjs/types/Interface/api/shopify/InvoicesShopify.d.ts.map +1 -1
  48. package/dist/mjs/types/Interface/api/shopify/InvoicesShopify.js +14 -0
  49. package/dist/mjs/types/Interface/api/shopify/InvoicesShopify.js.map +1 -1
  50. package/dist/mjs/types/Interface/models/IBankDedup.d.ts +85 -61
  51. package/dist/mjs/types/Interface/models/IBankDedup.d.ts.map +1 -1
  52. package/dist/mjs/types/Interface/models/IBankDedup.js.map +1 -1
  53. package/package.json +1 -1
  54. package/ts/api/resources/BankDedup.ts +2 -2
  55. package/ts/api/resources/Refund.ts +1 -1
  56. package/ts/api/resources/Society.ts +0 -2
  57. package/ts/types/Interface/api/accountingFiles/queryAccountingFiles.ts +6 -0
  58. package/ts/types/Interface/api/config/ConfigType.ts +0 -3
  59. package/ts/types/Interface/api/registration/CreateRegistration.ts +5 -0
  60. package/ts/types/Interface/api/shopify/InvoicesShopify.ts +19 -4
  61. package/ts/types/Interface/models/IBankDedup.ts +89 -61
@@ -1 +1 @@
1
- {"version":3,"file":"IBankDedup.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankDedup.ts"],"names":[],"mappings":"","sourcesContent":["export type TransactionRow = {\n label: string;\n dateValue: string; // ex \"2025-06-30\" ou \"30/06/2025\"\n credit: number; // positifs\n debit: number; // positifs\n};\n\nexport type PreparedRow = TransactionRow & {\n row_id: number;\n date_parsed: Date | null;\n credit_f: number;\n debit_f: number;\n delta: number; // credit_f - debit_f\n label_n: string;\n};\n\nexport type AnalyzeParams = {\n initial: number;\n target: number; // solde final attendu\n days: number; // fenêtre ±N jours\n amount_tol: number; // tolérance € (0.01)\n min_sim: number; // seuil de similarité [0..1]\n useEmbeddings?: boolean; // default true si clé dispo\n exact?: boolean; // tenter solveur exact\n exactTimeLimitMs?: number; // limite pour le backtracking\n};\n\nexport type CandidatePair = {\n row_id_a: number;\n row_id_b: number;\n date_a: string;\n date_b: string;\n label_a: string;\n label_b: string;\n delta_a: number;\n delta_b: number;\n pair_sum: number; // delta_a + delta_b\n score: number; // [0..1]\n reason: string; // texte explicatif\n};\n\nexport type AnalyzeBody = {\n csv: string;\n initial: number;\n target: number;\n params: Omit<AnalyzeParams, 'initial' | 'target'>;\n};\n\nexport type AnalyzeResult = {\n summary: {\n lines_before: number;\n lines_after: number;\n dups_candidates: number;\n initial_balance: number;\n final_before: number;\n gap_before: number;\n final_after: number;\n gap_after: number;\n exact_used: boolean;\n };\n artifacts: {\n preview_before: Array<any>;\n preview_after: Array<any>;\n duplicates_detailed: CandidatePair[];\n exact_selection?: CandidatePair[];\n };\n textual_summary?: string;\n};\n\nexport type PairIndex = { idx: number; rows: Set<number>; sum_cents: number; score: number };\n"]}
1
+ {"version":3,"file":"IBankDedup.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankDedup.ts"],"names":[],"mappings":"","sourcesContent":["export interface IBankDedupRequest {\n csv: string; // CSV en string (avec header: label,dateValue,credit,debit)\n initial: number; // solde initial\n target: number; // solde cible\n}\n\nexport interface BankTx {\n id: string; // id interne généré\n label: string;\n dateValue: string; // YYYY-MM-DD\n credit: number; // >= 0\n debit: number; // >= 0\n sign: 1 | -1; // 1 = crédit net, -1 = débit net\n amount: number; // valeur absolue du mouvement (en positif)\n cents: number; // amount en centimes pour calculs exacts\n}\n\nexport interface DuplicateGroup {\n id: string;\n transactions: BankTx[];\n amount: number; // montant commun\n cents: number; // montant en centimes\n sign: 1 | -1; // signe commun\n confidence: number; // score de confiance [0..1]\n method: 'exact' | 'fuzzy_high' | 'fuzzy_medium' | 'fuzzy_low'; // méthode de détection\n}\n\nexport interface IBankDedupResult {\n success: true;\n initial: number;\n target: number;\n finalRaw: number;\n finalAfterDedup: number;\n diffBefore: number; // target - finalRaw\n diffAfter: number; // target - finalAfterDedup (DOIT être exactement 0, aucune tolérance)\n removedGroups: {\n id: string;\n removedTransactions: {\n id: string;\n label: string;\n amount: number;\n dateValue: string;\n }[];\n keptTransaction: {\n id: string;\n label: string;\n amount: number;\n dateValue: string;\n };\n confidence: number;\n method: string;\n }[];\n removedCount: number;\n keptCount: number;\n csvDeduped: string;\n allGroups: {\n id: string;\n confidence: number;\n method: string;\n amount: number;\n transactionCount: number;\n isSelected: boolean;\n transactions: {\n id: string;\n label: string;\n dateValue: string;\n isKept: boolean;\n }[];\n }[];\n debug: {\n totalGroups: number;\n selectedGroups: number;\n iterations: number;\n strategiesUsed: string[];\n };\n}\n\nexport interface IBankDedupImpossible {\n success: false;\n reason: 'NO_EXACT_COMBINATION' | 'CSV_PARSE_ERROR' | 'INVALID_INPUT' | 'INSUFFICIENT_DUPLICATES';\n message: string;\n initial?: number;\n target?: number;\n finalRaw?: number;\n diffBefore?: number;\n bestAttempt?: {\n finalAfterDedup: number;\n diffAfter: number; // Sera != 0 puisque pas de solution exacte\n removedCount: number;\n };\n stats?: {\n totalTx?: number;\n totalGroups?: number;\n strategiesTried?: string[];\n };\n}\n\nexport type IBankDedupResponse = IBankDedupResult | IBankDedupImpossible;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.3.94-6",
3
+ "version": "1.3.94-7",
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": "dist/cjs/index.js",
@@ -1,11 +1,11 @@
1
- import { AnalyzeBody, AnalyzeResult } from '../../types/Interface/models/IBankDedup';
1
+ import { IBankDedupRequest, IBankDedupResponse } from '../../types/Interface/models/IBankDedup';
2
2
  import { Resource } from '../Resource';
3
3
 
4
4
  export class BankDedup extends Resource {
5
5
  /**
6
6
  * Analyze bank transactions for deduplication
7
7
  */
8
- public getAnalysis(body: AnalyzeBody): Promise<AnalyzeResult> {
8
+ public getAnalysis(body: IBankDedupRequest): Promise<IBankDedupResponse> {
9
9
  return this.axios.$post('/bank-dedup/analyze', body);
10
10
  }
11
11
  }
@@ -9,7 +9,7 @@ export class Refund extends Resource {
9
9
  return this.axios.$patch(`/refunds/${id}`, { ...params });
10
10
  }
11
11
 
12
- public getPaginated(query: QueryRefundPaginated, signal?: AbortSignal): Promise<BasePaginate<Refund>> {
12
+ public getPaginated(query: QueryRefundPaginated, signal?: AbortSignal): Promise<BasePaginate<IRefund>> {
13
13
  return this.axios.$get('/refunds', { params: query, ...(signal ? { signal } : {}) });
14
14
  }
15
15
 
@@ -29,10 +29,8 @@ import {
29
29
  ReadSocietyUnpaidStats,
30
30
  DataCustomersCsv,
31
31
  ReadCurrentPrestations,
32
- IComment,
33
32
  } from '../../types';
34
33
  import { CancelToken } from 'axios';
35
- import { User } from './User';
36
34
 
37
35
  export class Society extends Resource {
38
36
  public get(params: QuerySociety): Promise<ISociety> {
@@ -86,4 +86,10 @@ export class QueryPaginatedAccountingFile {
86
86
  @IsDateString()
87
87
  @IsOptional()
88
88
  endDate?: string;
89
+
90
+ @ApiPropertyOptional()
91
+ @IsBoolean()
92
+ @ToBoolean()
93
+ @IsOptional()
94
+ notAttached?: boolean;
89
95
  }
@@ -135,7 +135,6 @@ interface Shine {
135
135
  hostV3: string;
136
136
  publicHost: string;
137
137
  clientId: string;
138
- clientSecret: string;
139
138
  redirect_uris: string[];
140
139
  status: string;
141
140
  scope: string;
@@ -186,7 +185,6 @@ interface Access2 {
186
185
 
187
186
  interface Test {
188
187
  login: string;
189
- password: string;
190
188
  editor: string;
191
189
  software: string;
192
190
  wsdl: Wsdl;
@@ -198,7 +196,6 @@ interface Wsdl {
198
196
 
199
197
  interface Production {
200
198
  login: string;
201
- password: string;
202
199
  editor: string;
203
200
  software: string;
204
201
  wsdl: Wsdl2;
@@ -245,6 +245,11 @@ export class CreateAndSendVatMail {
245
245
  @ApiProperty()
246
246
  @IsArray()
247
247
  idFiles: number[];
248
+
249
+ @ApiPropertyOptional()
250
+ @IsNumber()
251
+ @IsOptional()
252
+ sendByUserId?: number;
248
253
  }
249
254
 
250
255
  export class DownloadExternalFile {
@@ -1,12 +1,27 @@
1
+ import { IsBoolean, IsOptional } from 'class-validator';
1
2
  import { ApiPropertyOptional } from '../../../../utils';
3
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
2
4
 
3
5
  export class InvoicesShopify {
4
6
  @ApiPropertyOptional()
5
- order: string;
7
+ @IsOptional()
8
+ order?: string;
9
+
6
10
  @ApiPropertyOptional()
7
- limit: number;
11
+ @IsOptional()
12
+ limit?: number;
13
+
8
14
  @ApiPropertyOptional()
9
- ids: number[];
15
+ @IsOptional()
16
+ ids?: number[];
17
+
18
+ @ApiPropertyOptional()
19
+ @IsOptional()
20
+ idSociety?: number;
21
+
10
22
  @ApiPropertyOptional()
11
- idSociety: number;
23
+ @IsOptional()
24
+ @IsBoolean()
25
+ @ToBoolean()
26
+ debug?: boolean;
12
27
  }
@@ -1,70 +1,98 @@
1
- export type TransactionRow = {
2
- label: string;
3
- dateValue: string; // ex "2025-06-30" ou "30/06/2025"
4
- credit: number; // positifs
5
- debit: number; // € positifs
6
- };
7
-
8
- export type PreparedRow = TransactionRow & {
9
- row_id: number;
10
- date_parsed: Date | null;
11
- credit_f: number;
12
- debit_f: number;
13
- delta: number; // credit_f - debit_f
14
- label_n: string;
15
- };
1
+ export interface IBankDedupRequest {
2
+ csv: string; // CSV en string (avec header: label,dateValue,credit,debit)
3
+ initial: number; // solde initial
4
+ target: number; // solde cible
5
+ }
16
6
 
17
- export type AnalyzeParams = {
18
- initial: number;
19
- target: number; // solde final attendu
20
- days: number; // fenêtre ±N jours
21
- amount_tol: number; // tolérance € (0.01)
22
- min_sim: number; // seuil de similarité [0..1]
23
- useEmbeddings?: boolean; // default true si clé dispo
24
- exact?: boolean; // tenter solveur exact
25
- exactTimeLimitMs?: number; // limite pour le backtracking
26
- };
7
+ export interface BankTx {
8
+ id: string; // id interne généré
9
+ label: string;
10
+ dateValue: string; // YYYY-MM-DD
11
+ credit: number; // >= 0
12
+ debit: number; // >= 0
13
+ sign: 1 | -1; // 1 = crédit net, -1 = débit net
14
+ amount: number; // valeur absolue du mouvement (en positif)
15
+ cents: number; // amount en centimes pour calculs exacts
16
+ }
27
17
 
28
- export type CandidatePair = {
29
- row_id_a: number;
30
- row_id_b: number;
31
- date_a: string;
32
- date_b: string;
33
- label_a: string;
34
- label_b: string;
35
- delta_a: number;
36
- delta_b: number;
37
- pair_sum: number; // delta_a + delta_b
38
- score: number; // [0..1]
39
- reason: string; // texte explicatif
40
- };
18
+ export interface DuplicateGroup {
19
+ id: string;
20
+ transactions: BankTx[];
21
+ amount: number; // montant commun
22
+ cents: number; // montant en centimes
23
+ sign: 1 | -1; // signe commun
24
+ confidence: number; // score de confiance [0..1]
25
+ method: 'exact' | 'fuzzy_high' | 'fuzzy_medium' | 'fuzzy_low'; // méthode de détection
26
+ }
41
27
 
42
- export type AnalyzeBody = {
43
- csv: string;
28
+ export interface IBankDedupResult {
29
+ success: true;
44
30
  initial: number;
45
31
  target: number;
46
- params: Omit<AnalyzeParams, 'initial' | 'target'>;
47
- };
32
+ finalRaw: number;
33
+ finalAfterDedup: number;
34
+ diffBefore: number; // target - finalRaw
35
+ diffAfter: number; // target - finalAfterDedup (DOIT être exactement 0, aucune tolérance)
36
+ removedGroups: {
37
+ id: string;
38
+ removedTransactions: {
39
+ id: string;
40
+ label: string;
41
+ amount: number;
42
+ dateValue: string;
43
+ }[];
44
+ keptTransaction: {
45
+ id: string;
46
+ label: string;
47
+ amount: number;
48
+ dateValue: string;
49
+ };
50
+ confidence: number;
51
+ method: string;
52
+ }[];
53
+ removedCount: number;
54
+ keptCount: number;
55
+ csvDeduped: string;
56
+ allGroups: {
57
+ id: string;
58
+ confidence: number;
59
+ method: string;
60
+ amount: number;
61
+ transactionCount: number;
62
+ isSelected: boolean;
63
+ transactions: {
64
+ id: string;
65
+ label: string;
66
+ dateValue: string;
67
+ isKept: boolean;
68
+ }[];
69
+ }[];
70
+ debug: {
71
+ totalGroups: number;
72
+ selectedGroups: number;
73
+ iterations: number;
74
+ strategiesUsed: string[];
75
+ };
76
+ }
48
77
 
49
- export type AnalyzeResult = {
50
- summary: {
51
- lines_before: number;
52
- lines_after: number;
53
- dups_candidates: number;
54
- initial_balance: number;
55
- final_before: number;
56
- gap_before: number;
57
- final_after: number;
58
- gap_after: number;
59
- exact_used: boolean;
78
+ export interface IBankDedupImpossible {
79
+ success: false;
80
+ reason: 'NO_EXACT_COMBINATION' | 'CSV_PARSE_ERROR' | 'INVALID_INPUT' | 'INSUFFICIENT_DUPLICATES';
81
+ message: string;
82
+ initial?: number;
83
+ target?: number;
84
+ finalRaw?: number;
85
+ diffBefore?: number;
86
+ bestAttempt?: {
87
+ finalAfterDedup: number;
88
+ diffAfter: number; // Sera != 0 puisque pas de solution exacte
89
+ removedCount: number;
60
90
  };
61
- artifacts: {
62
- preview_before: Array<any>;
63
- preview_after: Array<any>;
64
- duplicates_detailed: CandidatePair[];
65
- exact_selection?: CandidatePair[];
91
+ stats?: {
92
+ totalTx?: number;
93
+ totalGroups?: number;
94
+ strategiesTried?: string[];
66
95
  };
67
- textual_summary?: string;
68
- };
96
+ }
69
97
 
70
- export type PairIndex = { idx: number; rows: Set<number>; sum_cents: number; score: number };
98
+ export type IBankDedupResponse = IBankDedupResult | IBankDedupImpossible;