@silexpert/core 2.0.111 → 2.0.113

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 (63) hide show
  1. package/dist/api/resources/Authenticate.d.ts +6 -2
  2. package/dist/api/resources/Authenticate.d.ts.map +1 -1
  3. package/dist/api/resources/Authenticate.js +4 -0
  4. package/dist/api/resources/Authenticate.js.map +1 -1
  5. package/dist/api/resources/User.d.ts +1 -1
  6. package/dist/api/resources/User.d.ts.map +1 -1
  7. package/dist/api/resources/User.js.map +1 -1
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +0 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/Enum/ExternalAuthenticationLinkPurpose.d.ts +11 -0
  13. package/dist/types/Enum/ExternalAuthenticationLinkPurpose.d.ts.map +1 -0
  14. package/dist/types/Enum/ExternalAuthenticationLinkPurpose.js +13 -0
  15. package/dist/types/Enum/ExternalAuthenticationLinkPurpose.js.map +1 -0
  16. package/dist/types/Form/FormAuthenticate.d.ts.map +1 -1
  17. package/dist/types/Form/FormAuthenticate.js +5 -1
  18. package/dist/types/Form/FormAuthenticate.js.map +1 -1
  19. package/dist/types/Interface/api/authentification/ExchangeExternalAuthenticationLink.d.ts +5 -0
  20. package/dist/types/Interface/api/authentification/ExchangeExternalAuthenticationLink.d.ts.map +1 -0
  21. package/dist/types/Interface/api/authentification/ExchangeExternalAuthenticationLink.js +33 -0
  22. package/dist/types/Interface/api/authentification/ExchangeExternalAuthenticationLink.js.map +1 -0
  23. package/dist/types/Interface/api/authentification/ForgotPassword.d.ts +1 -0
  24. package/dist/types/Interface/api/authentification/ForgotPassword.d.ts.map +1 -1
  25. package/dist/types/Interface/api/authentification/ForgotPassword.js +8 -1
  26. package/dist/types/Interface/api/authentification/ForgotPassword.js.map +1 -1
  27. package/dist/types/Interface/api/commercialManagement/Create.d.ts +6 -1
  28. package/dist/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  29. package/dist/types/Interface/api/commercialManagement/Create.js +25 -1
  30. package/dist/types/Interface/api/commercialManagement/Create.js.map +1 -1
  31. package/dist/types/Interface/api/taxDeadline/QueryTaxDeadline.d.ts.map +1 -1
  32. package/dist/types/Interface/api/taxDeadline/QueryTaxDeadline.js +7 -1
  33. package/dist/types/Interface/api/taxDeadline/QueryTaxDeadline.js.map +1 -1
  34. package/dist/types/Interface/api/timeRecorder/CreateRecorder.d.ts +2 -2
  35. package/dist/types/Interface/api/timeRecorder/CreateRecorder.d.ts.map +1 -1
  36. package/dist/types/Interface/api/timeRecorder/CreateRecorder.js +11 -3
  37. package/dist/types/Interface/api/timeRecorder/CreateRecorder.js.map +1 -1
  38. package/dist/types/Interface/api/timeRecorder/UpdateRecorder.d.ts +2 -2
  39. package/dist/types/Interface/api/timeRecorder/UpdateRecorder.d.ts.map +1 -1
  40. package/dist/types/Interface/api/timeRecorder/UpdateRecorder.js +11 -3
  41. package/dist/types/Interface/api/timeRecorder/UpdateRecorder.js.map +1 -1
  42. package/dist/types/Interface/models/IExternalAuthenticationLink.d.ts +18 -0
  43. package/dist/types/Interface/models/IExternalAuthenticationLink.d.ts.map +1 -0
  44. package/dist/types/Interface/models/IExternalAuthenticationLink.js +2 -0
  45. package/dist/types/Interface/models/IExternalAuthenticationLink.js.map +1 -0
  46. package/dist/types/index.d.ts +3 -0
  47. package/dist/types/index.d.ts.map +1 -1
  48. package/dist/types/index.js +3 -0
  49. package/dist/types/index.js.map +1 -1
  50. package/package.json +1 -1
  51. package/ts/api/resources/Authenticate.ts +7 -1
  52. package/ts/api/resources/User.ts +1 -1
  53. package/ts/index.ts +0 -1
  54. package/ts/types/Enum/ExternalAuthenticationLinkPurpose.ts +11 -0
  55. package/ts/types/Form/FormAuthenticate.ts +5 -1
  56. package/ts/types/Interface/api/authentification/ExchangeExternalAuthenticationLink.ts +19 -0
  57. package/ts/types/Interface/api/authentification/ForgotPassword.ts +6 -1
  58. package/ts/types/Interface/api/commercialManagement/Create.ts +22 -2
  59. package/ts/types/Interface/api/taxDeadline/QueryTaxDeadline.ts +7 -1
  60. package/ts/types/Interface/api/timeRecorder/CreateRecorder.ts +20 -3
  61. package/ts/types/Interface/api/timeRecorder/UpdateRecorder.ts +20 -3
  62. package/ts/types/Interface/models/IExternalAuthenticationLink.ts +18 -0
  63. package/ts/types/index.ts +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "2.0.111",
3
+ "version": "2.0.113",
4
4
  "description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
5
5
  "keywords": [
6
6
  "accounting",
@@ -7,6 +7,7 @@ import {
7
7
  ReadByExternalId,
8
8
  ReadConnectAs,
9
9
  ProviderAuthDto,
10
+ ExchangeExternalAuthenticationLink,
10
11
  } from '../../types/index.js';
11
12
  import { Resource } from '../Resource.js';
12
13
 
@@ -34,7 +35,7 @@ export class Authenticate extends Resource {
34
35
  return this.axios.$post(`/authenticate/societies/${idSociety}`);
35
36
  }
36
37
 
37
- async forgotPassword(payload: PostForgotPassword): Promise<void> {
38
+ async forgotPassword(payload: PostForgotPassword): Promise<{ url: string } | void> {
38
39
  return this.axios.$post('/authenticate/forgot-password', payload);
39
40
  }
40
41
 
@@ -46,10 +47,15 @@ export class Authenticate extends Resource {
46
47
  return this.axios.$put('/authenticate/reset-password', payload);
47
48
  }
48
49
 
50
+ /** @deprecated Use exchangeExternalAuthenticationLink instead */
49
51
  async byExternalId(uuid: string, query: ConnectFromUUID): Promise<ReadByExternalId> {
50
52
  return this.axios.$get(`/authenticate/external/${uuid}`, { params: query });
51
53
  }
52
54
 
55
+ async exchangeExternalAuthenticationLink(payload: ExchangeExternalAuthenticationLink): Promise<ReadByExternalId> {
56
+ return this.axios.$post(`/authenticate/external/exchange`, payload);
57
+ }
58
+
53
59
  async providerLogin(payload: ProviderAuthDto): Promise<{ token: string }> {
54
60
  return this.axios.$post('/authenticate/providers/login', payload);
55
61
  }
@@ -30,7 +30,7 @@ import {
30
30
  } from '../../types/index.js';
31
31
 
32
32
  export class User extends Resource {
33
- confirm(params: QueryConfirm): Promise<IUser> {
33
+ confirm(params: QueryConfirm): Promise<void> {
34
34
  return this.axios.$put('user/confirm', params);
35
35
  }
36
36
  resendConfirmationEmailLink(params: QueryResendConfirmationLink): Promise<boolean> {
package/ts/index.ts CHANGED
@@ -1,4 +1,3 @@
1
- import 'reflect-metadata';
2
1
  export * from './utils/index.js';
3
2
  export * from './utils/commercialManagement/product.js';
4
3
  export * from './utils/commercialManagement/vat.js';
@@ -0,0 +1,11 @@
1
+ export enum ExternalAuthenticationLinkPurpose {
2
+ LOGIN = 'LOGIN',
3
+ APPOINTMENT = 'APPOINTMENT',
4
+ RESET_PASSWORD = 'RESET_PASSWORD',
5
+ }
6
+
7
+ export enum ExternalAuthenticationLinkPurposeExpiration {
8
+ LOGIN = 10, // 10 minutes
9
+ APPOINTMENT = 60 * 24 * 7, // 7 days
10
+ RESET_PASSWORD = 60 * 24 * 3, // 3 days
11
+ }
@@ -1,4 +1,4 @@
1
- import { IsBoolean, IsIP, IsNumber, IsOptional, IsString /* , ValidateNested */ } from 'class-validator';
1
+ import { ArrayMaxSize, ArrayMinSize, IsArray, IsBoolean, IsIP, IsNumber, IsOptional, IsString } from 'class-validator';
2
2
  import { ToBoolean } from '../../utils/transforms/boolean.transform.js';
3
3
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
4
4
 
@@ -34,6 +34,10 @@ export class FormAuthenticate {
34
34
 
35
35
  @ApiPropertyOptional()
36
36
  @IsOptional()
37
+ @IsArray()
38
+ @ArrayMinSize(2)
39
+ @ArrayMaxSize(2)
40
+ @IsNumber({}, { each: true })
37
41
  geolocation?: number[];
38
42
 
39
43
  @ApiPropertyOptional()
@@ -0,0 +1,19 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsOptional, IsString, Length, Matches } from 'class-validator';
3
+
4
+ export class ExchangeExternalAuthenticationLink {
5
+ @ApiProperty({
6
+ description: 'Secret base64url du lien de connexion',
7
+ minLength: 43,
8
+ maxLength: 43,
9
+ })
10
+ @IsString()
11
+ @Length(43, 43)
12
+ @Matches(/^[A-Za-z0-9_-]{43}$/)
13
+ token: string;
14
+
15
+ @ApiPropertyOptional()
16
+ @IsString()
17
+ @IsOptional()
18
+ identifier?: string;
19
+ }
@@ -1,8 +1,13 @@
1
- import { IsString } from 'class-validator';
1
+ import { IsBoolean, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiProperty } from '@nestjs/swagger';
3
3
 
4
4
  export class PostForgotPassword {
5
5
  @ApiProperty()
6
6
  @IsString()
7
7
  username: string;
8
+
9
+ @ApiProperty()
10
+ @IsBoolean()
11
+ @IsOptional()
12
+ returnUrl?: boolean;
8
13
  }
@@ -530,6 +530,17 @@ export class CreatePreSaleDocument extends CommercialDocumentInputs {
530
530
  advanceProducts?: [];
531
531
  language?: InvoiceLanguage;
532
532
  }
533
+
534
+ export class CreateOriginalInvoiceReference {
535
+ @ApiProperty({ description: "Référence de la facture d'origine" })
536
+ @IsString()
537
+ reference: string;
538
+
539
+ @ApiProperty({ description: "Date d'émission de la facture d'origine" })
540
+ @IsDateString()
541
+ emissionDate: string;
542
+ }
543
+
533
544
  export class CreateInvoiceDocument extends CommercialDocumentInputs {
534
545
  paymentLink?: string;
535
546
  deposit?: number;
@@ -553,6 +564,14 @@ export class CreateInvoiceDocument extends CommercialDocumentInputs {
553
564
  @IsOptional()
554
565
  @IsEnum(EstimateInvoiceTransmissionType)
555
566
  transmissionType?: EstimateInvoiceTransmissionType | null;
567
+
568
+ @ApiPropertyOptional({
569
+ type: CreateOriginalInvoiceReference,
570
+ description:
571
+ "Facture d'origine, à renseigner pour un avoir non lié à une facture émise via l'outil (nécessaire pour la FE)",
572
+ })
573
+ @IsOptional()
574
+ originalInvoice?: CreateOriginalInvoiceReference | null;
556
575
  }
557
576
 
558
577
  export class CreateRecurrence {
@@ -564,9 +583,10 @@ export class CreateRecurrence {
564
583
  @IsDateString()
565
584
  startDate: string;
566
585
 
567
- @ApiProperty()
586
+ @ApiPropertyOptional()
568
587
  @IsDateString()
569
- endDate: string;
588
+ @IsOptional()
589
+ endDate?: string;
570
590
 
571
591
  @ApiProperty()
572
592
  @ToBoolean()
@@ -1,4 +1,4 @@
1
- import { IsOptional, IsEnum, IsDateString, IsString, IsArray, IsBoolean, IsNumber } from 'class-validator';
1
+ import { IsOptional, IsEnum, IsDateString, IsString, IsArray, IsBoolean, IsNumber, Matches } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
3
3
  import { VatRegime, ToDoOrDone, BankCollectingState, RequiredQueryPaginate, TaxState } from '../../../index.js';
4
4
  import { ComptaType } from '../../../Enum/ComptaType.js';
@@ -30,9 +30,15 @@ export class QueryTaxDeadline {
30
30
  idBalanceSheetState?: BalanceSheetState | BalanceSheetState[];
31
31
 
32
32
  @ApiPropertyOptional({ description: 'Date de clôture (format MM)' })
33
+ @IsOptional()
34
+ @IsString({ each: true })
35
+ @Matches(/^(0[1-9]|1[0-2])$/, { each: true })
33
36
  closingDate?: string | string[];
34
37
 
35
38
  @ApiPropertyOptional({ description: 'Année de clôture (format YYYY)' })
39
+ @IsOptional()
40
+ @IsString({ each: true })
41
+ @Matches(/^\d{4}$/, { each: true })
36
42
  year?: string | string[];
37
43
 
38
44
  @ApiPropertyOptional({ description: 'Recherche par nom, code dia, id' })
@@ -1,4 +1,13 @@
1
- import { IsBoolean, IsDate, IsNumber, IsOptional, IsString } from 'class-validator';
1
+ import {
2
+ ArrayMaxSize,
3
+ ArrayMinSize,
4
+ IsArray,
5
+ IsBoolean,
6
+ IsDate,
7
+ IsNumber,
8
+ IsOptional,
9
+ IsString,
10
+ } from 'class-validator';
2
11
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
3
12
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform.js';
4
13
  // import { Point } from 'geojson';
@@ -39,7 +48,11 @@ export class CreateRecorder {
39
48
 
40
49
  @ApiPropertyOptional()
41
50
  @IsOptional()
42
- geolocationDetected?: any; // Point;
51
+ @IsArray()
52
+ @ArrayMinSize(2)
53
+ @ArrayMaxSize(2)
54
+ @IsNumber({}, { each: true })
55
+ geolocationDetected?: number[]; // Point;
43
56
 
44
57
  @ApiPropertyOptional()
45
58
  @IsOptional()
@@ -48,7 +61,11 @@ export class CreateRecorder {
48
61
 
49
62
  @ApiPropertyOptional()
50
63
  @IsOptional()
51
- geolocationFixed?: any; // Point;
64
+ @IsArray()
65
+ @ArrayMinSize(2)
66
+ @ArrayMaxSize(2)
67
+ @IsNumber({}, { each: true })
68
+ geolocationFixed?: number[]; // Point;
52
69
 
53
70
  @ApiPropertyOptional()
54
71
  @IsOptional()
@@ -1,4 +1,13 @@
1
- import { IsString, IsDateString, IsNumber, IsOptional, IsBoolean } from 'class-validator';
1
+ import {
2
+ ArrayMaxSize,
3
+ ArrayMinSize,
4
+ IsArray,
5
+ IsString,
6
+ IsDateString,
7
+ IsNumber,
8
+ IsOptional,
9
+ IsBoolean,
10
+ } from 'class-validator';
2
11
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
3
12
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform.js';
4
13
  // import { Point } from 'geojson';
@@ -31,7 +40,11 @@ export class UpdateRecorder {
31
40
 
32
41
  @ApiPropertyOptional()
33
42
  @IsOptional()
34
- geolocationDetected?: any; // Point;
43
+ @IsArray()
44
+ @ArrayMinSize(2)
45
+ @ArrayMaxSize(2)
46
+ @IsNumber({}, { each: true })
47
+ geolocationDetected?: number[]; // Point;
35
48
 
36
49
  @ApiPropertyOptional()
37
50
  @IsOptional()
@@ -40,7 +53,11 @@ export class UpdateRecorder {
40
53
 
41
54
  @ApiPropertyOptional()
42
55
  @IsOptional()
43
- geolocationFixed?: any; // Point;
56
+ @IsArray()
57
+ @ArrayMinSize(2)
58
+ @ArrayMaxSize(2)
59
+ @IsNumber({}, { each: true })
60
+ geolocationFixed?: number[]; // Point;
44
61
 
45
62
  @ApiPropertyOptional()
46
63
  @IsOptional()
@@ -0,0 +1,18 @@
1
+ import type { ExternalAuthenticationLinkPurpose } from '../../Enum/ExternalAuthenticationLinkPurpose.js';
2
+ import type { ISociety } from './ISociety.js';
3
+ import type { IUser } from './IUser.js';
4
+
5
+ export interface IExternalAuthenticationLink {
6
+ id?: number;
7
+ idUser: number;
8
+ idSociety: number | null;
9
+ purpose: ExternalAuthenticationLinkPurpose;
10
+ tokenDigest: string;
11
+ expiresAt: Date;
12
+ usedAt?: Date | null;
13
+ revokedAt?: Date | null;
14
+ createdAt?: Date;
15
+ updatedAt?: Date;
16
+ user?: IUser;
17
+ society?: ISociety | null;
18
+ }
package/ts/types/index.ts CHANGED
@@ -62,6 +62,7 @@ export * from './Interface/models/IExerciceComment.js';
62
62
  export * from './Interface/models/IExercice.js';
63
63
  export * from './Interface/models/IExercicePrestation.js';
64
64
  export * from './Interface/models/IExercicePrestationOffer.js';
65
+ export * from './Interface/models/IExternalAuthenticationLink.js';
65
66
  export * from './Interface/models/IFileType.js';
66
67
  export * from './Interface/models/IFile.js';
67
68
  export * from './Interface/models/IFiscalRegime.js';
@@ -540,6 +541,7 @@ export * from './Enum/UsersHistory.js';
540
541
  export * from './Enum/UrgencyLevel.js';
541
542
  export * from './Enum/Formalism.js';
542
543
  export * from './Enum/Kyc.js';
544
+ export * from './Enum/ExternalAuthenticationLinkPurpose.js';
543
545
 
544
546
  // Interfaces API
545
547
  export * from './Interface/api/accountingTransaction/Create.js';
@@ -1206,6 +1208,7 @@ export * from './Interface/api/docoon/Create.js';
1206
1208
  export * from './Interface/api/authentification/FinalizeMobileApprovalDto.js';
1207
1209
  export * from './Interface/api/formalism/Create.js';
1208
1210
  export * from './Interface/api/authentification/ProviderAuthDto.js';
1211
+ export * from './Interface/api/authentification/ExchangeExternalAuthenticationLink.js';
1209
1212
  export * from './Interface/api/kyc/Create.js';
1210
1213
  export * from './Interface/api/kyc/Read.js';
1211
1214
  export * from './Interface/api/kyc/kyc.js';