@silexpert/core 2.0.100 → 2.0.101

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/api/resources/Search.d.ts +2 -1
  2. package/dist/api/resources/Search.d.ts.map +1 -1
  3. package/dist/api/resources/Search.js +3 -0
  4. package/dist/api/resources/Search.js.map +1 -1
  5. package/dist/api/resources/SocietyCreationCheckout.d.ts +7 -0
  6. package/dist/api/resources/SocietyCreationCheckout.d.ts.map +1 -0
  7. package/dist/api/resources/SocietyCreationCheckout.js +10 -0
  8. package/dist/api/resources/SocietyCreationCheckout.js.map +1 -0
  9. package/dist/api/resources.d.ts +2 -0
  10. package/dist/api/resources.d.ts.map +1 -1
  11. package/dist/api/resources.js +2 -0
  12. package/dist/api/resources.js.map +1 -1
  13. package/dist/types/Enum/Constants.d.ts +2 -0
  14. package/dist/types/Enum/Constants.d.ts.map +1 -1
  15. package/dist/types/Enum/Constants.js +2 -0
  16. package/dist/types/Enum/Constants.js.map +1 -1
  17. package/dist/types/Enum/MailAuto.d.ts +2 -1
  18. package/dist/types/Enum/MailAuto.d.ts.map +1 -1
  19. package/dist/types/Enum/MailAuto.js +1 -0
  20. package/dist/types/Enum/MailAuto.js.map +1 -1
  21. package/dist/types/Enum/SocietyCreationCheckoutStatus.d.ts +9 -0
  22. package/dist/types/Enum/SocietyCreationCheckoutStatus.d.ts.map +1 -0
  23. package/dist/types/Enum/SocietyCreationCheckoutStatus.js +10 -0
  24. package/dist/types/Enum/SocietyCreationCheckoutStatus.js.map +1 -0
  25. package/dist/types/Interface/api/pappers/ReadPappers.d.ts +1 -0
  26. package/dist/types/Interface/api/pappers/ReadPappers.d.ts.map +1 -1
  27. package/dist/types/Interface/api/pappers/ReadPappers.js +1 -0
  28. package/dist/types/Interface/api/pappers/ReadPappers.js.map +1 -1
  29. package/dist/types/Interface/api/society/CreateSociety.d.ts +1 -0
  30. package/dist/types/Interface/api/society/CreateSociety.d.ts.map +1 -1
  31. package/dist/types/Interface/api/society/CreateSociety.js +5 -0
  32. package/dist/types/Interface/api/society/CreateSociety.js.map +1 -1
  33. package/dist/types/Interface/api/societyCreationCheckout/SocietyCreationCheckout.d.ts +32 -0
  34. package/dist/types/Interface/api/societyCreationCheckout/SocietyCreationCheckout.d.ts.map +1 -0
  35. package/dist/types/Interface/api/societyCreationCheckout/SocietyCreationCheckout.js +83 -0
  36. package/dist/types/Interface/api/societyCreationCheckout/SocietyCreationCheckout.js.map +1 -0
  37. package/dist/types/Interface/api/stripe/Create.d.ts +1 -0
  38. package/dist/types/Interface/api/stripe/Create.d.ts.map +1 -1
  39. package/dist/types/Interface/api/stripe/Create.js +7 -0
  40. package/dist/types/Interface/api/stripe/Create.js.map +1 -1
  41. package/dist/types/Interface/models/ISocietyCreationCheckout.d.ts +23 -0
  42. package/dist/types/Interface/models/ISocietyCreationCheckout.d.ts.map +1 -0
  43. package/dist/types/Interface/models/ISocietyCreationCheckout.js +2 -0
  44. package/dist/types/Interface/models/ISocietyCreationCheckout.js.map +1 -0
  45. package/dist/types/index.d.ts +3 -0
  46. package/dist/types/index.d.ts.map +1 -1
  47. package/dist/types/index.js +3 -0
  48. package/dist/types/index.js.map +1 -1
  49. package/package.json +1 -1
  50. package/ts/api/resources/Search.ts +9 -1
  51. package/ts/api/resources/SocietyCreationCheckout.ts +16 -0
  52. package/ts/api/resources.ts +2 -0
  53. package/ts/types/Enum/Constants.ts +3 -0
  54. package/ts/types/Enum/MailAuto.ts +1 -0
  55. package/ts/types/Enum/SocietyCreationCheckoutStatus.ts +8 -0
  56. package/ts/types/Interface/api/pappers/ReadPappers.ts +1 -0
  57. package/ts/types/Interface/api/society/CreateSociety.ts +3 -0
  58. package/ts/types/Interface/api/societyCreationCheckout/SocietyCreationCheckout.ts +66 -0
  59. package/ts/types/Interface/api/stripe/Create.ts +5 -0
  60. package/ts/types/Interface/models/ISocietyCreationCheckout.ts +23 -0
  61. 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.100",
3
+ "version": "2.0.101",
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",
@@ -1,10 +1,18 @@
1
- import { QueryGetBusinessPappers, ReadBusinessPappers, QueryGetBusinessDocumentPappers } from '../../types/index.js';
1
+ import {
2
+ QueryGetBusinessPappers,
3
+ QuerySearchBusinessPappers,
4
+ ReadBusinessPappers,
5
+ QueryGetBusinessDocumentPappers,
6
+ } from '../../types/index.js';
2
7
  import { Resource } from '../Resource.js';
3
8
 
4
9
  export class Search extends Resource {
5
10
  getBusiness(query: QueryGetBusinessPappers): Promise<ReadBusinessPappers> {
6
11
  return this.axios.$get('/search/business', { params: query });
7
12
  }
13
+ searchBusiness(query: QuerySearchBusinessPappers): Promise<ReadBusinessPappers[]> {
14
+ return this.axios.$get('/search/businesses', { params: query });
15
+ }
8
16
  getDocumentFromToken(query: QueryGetBusinessDocumentPappers): Promise<void> {
9
17
  return this.axios.$get('/search/business/document', { params: query });
10
18
  }
@@ -0,0 +1,16 @@
1
+ import {
2
+ CreateSocietyCreationCheckout,
3
+ CreateSocietyCreationCheckoutResponse,
4
+ ReadSocietyCreationCheckout,
5
+ } from '../../types/index.js';
6
+ import { Resource } from '../Resource.js';
7
+
8
+ export class SocietyCreationCheckout extends Resource {
9
+ create(payload: CreateSocietyCreationCheckout): Promise<CreateSocietyCreationCheckoutResponse> {
10
+ return this.axios.$post('/society-creation-checkouts', payload);
11
+ }
12
+
13
+ get(token: string): Promise<ReadSocietyCreationCheckout> {
14
+ return this.axios.$get(`/society-creation-checkouts/${encodeURIComponent(token)}`);
15
+ }
16
+ }
@@ -195,6 +195,7 @@ import { ZendeskTicket } from './resources/zendesk/Ticket.js';
195
195
  import { Vialink } from './resources/Vialink.js';
196
196
  import { KycMandate } from './resources/KycMandate.js';
197
197
  import { PartneredAccountant } from './resources/PartneredAccountant.js';
198
+ import { SocietyCreationCheckout } from './resources/SocietyCreationCheckout.js';
198
199
 
199
200
  export const resources = {
200
201
  budgetInsight: BudgetInsight,
@@ -394,4 +395,5 @@ export const resources = {
394
395
  vialink: Vialink,
395
396
  kycMandate: KycMandate,
396
397
  partneredAccountant: PartneredAccountant,
398
+ societyCreationCheckout: SocietyCreationCheckout,
397
399
  };
@@ -35,3 +35,6 @@ export const ClementineSources = [
35
35
  { value: 9, text: 'Salon' },
36
36
  { value: 10, text: 'Kandbaz' },
37
37
  ];
38
+
39
+ export const SOCIETY_CREATION_CHECKOUT_METADATA_KEY = 'societyCreationCheckoutToken';
40
+ export const SOCIETY_CREATION_CHECKOUT_QUERY_PARAMETER = 'societyCreationCheckout';
@@ -145,6 +145,7 @@ export enum MailAuto {
145
145
  ID_APPROBATION_UNPAID_ARCHIVES = 173,
146
146
  ASK_DOCUMENTS_BANK_STATEMENT = 174,
147
147
  RELAUNCH_DOCUMENTS_BANK_STATEMENT = 175,
148
+ SOCIETY_ADDED = 176,
148
149
  }
149
150
 
150
151
  export enum MailAutoType {
@@ -0,0 +1,8 @@
1
+ export enum SocietyCreationCheckoutStatus {
2
+ PENDING = 'pending',
3
+ CHECKOUT_CREATED = 'checkout_created',
4
+ PROCESSING = 'processing',
5
+ COMPLETED = 'completed',
6
+ FAILED = 'failed',
7
+ EXPIRED = 'expired',
8
+ }
@@ -45,6 +45,7 @@ export type ReadHeadOfficePappers = {
45
45
 
46
46
  export class ReadBusinessPappers {
47
47
  siren: string | null;
48
+ siret: string | null;
48
49
  name: string | null;
49
50
  firstname: string | null;
50
51
  lastname: string | null;
@@ -18,6 +18,9 @@ export class CreateSociety {
18
18
  @ApiPropertyOptional()
19
19
  name?: string;
20
20
 
21
+ @ApiPropertyOptional()
22
+ siret?: string;
23
+
21
24
  @ApiPropertyOptional()
22
25
  address?: string;
23
26
 
@@ -0,0 +1,66 @@
1
+ import { IsNotEmpty, IsOptional, IsString, Matches, MaxLength, ValidateNested } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
3
+ import { SocietyCreationCheckoutStatus } from '../../../Enum/SocietyCreationCheckoutStatus.js';
4
+
5
+ export class CreateSocietyCreationCheckoutCompany {
6
+ @ApiProperty()
7
+ @IsString()
8
+ @Matches(/^\d{9}$/)
9
+ siren: string;
10
+
11
+ @ApiPropertyOptional()
12
+ @IsOptional()
13
+ @IsString()
14
+ @Matches(/^\d{14}$/)
15
+ siret?: string;
16
+ }
17
+
18
+ export class CreateSocietyCreationCheckout {
19
+ @ApiProperty({ type: CreateSocietyCreationCheckoutCompany })
20
+ @ValidateNested()
21
+ company: CreateSocietyCreationCheckoutCompany;
22
+
23
+ @ApiProperty()
24
+ @IsString()
25
+ @IsNotEmpty()
26
+ @MaxLength(255)
27
+ stripePriceId: string;
28
+
29
+ @ApiProperty()
30
+ @IsString()
31
+ @Matches(/^\/(?!\/)/)
32
+ @MaxLength(1024)
33
+ returnPath: string;
34
+ }
35
+
36
+ export class CreateSocietyCreationCheckoutResponse {
37
+ @ApiProperty()
38
+ token: string;
39
+
40
+ @ApiProperty()
41
+ url: string;
42
+ }
43
+
44
+ export class ReadSocietyCreationCheckout {
45
+ @ApiProperty()
46
+ token: string;
47
+
48
+ @ApiProperty({ enum: SocietyCreationCheckoutStatus })
49
+ status: SocietyCreationCheckoutStatus;
50
+
51
+ @ApiPropertyOptional()
52
+ idSociety: number | null;
53
+ }
54
+
55
+ export interface SocietyCreationData {
56
+ idUser: number;
57
+ idTypeCompta: number;
58
+ name: string;
59
+ siret: string;
60
+ nafCode?: string;
61
+ address?: string;
62
+ addressComplement?: string;
63
+ zipCode?: string;
64
+ city?: string;
65
+ idLegalForm?: number;
66
+ }
@@ -48,6 +48,11 @@ export class CreateSubscriptionSession {
48
48
  @ApiProperty()
49
49
  @IsString()
50
50
  priceId: string;
51
+
52
+ @ApiPropertyOptional()
53
+ @IsOptional()
54
+ @IsString()
55
+ returnUrl?: string;
51
56
  }
52
57
 
53
58
  export class CreateCommercialSession {
@@ -0,0 +1,23 @@
1
+ import type { SocietyCreationCheckoutStatus } from '../../Enum/SocietyCreationCheckoutStatus.js';
2
+ import type { SocietyCreationData } from '../api/societyCreationCheckout/SocietyCreationCheckout.js';
3
+ import type { ISociety } from './ISociety.js';
4
+ import type { IUser } from './IUser.js';
5
+
6
+ export interface ISocietyCreationCheckout {
7
+ id?: number;
8
+ token: string;
9
+ idOwner: number;
10
+ societyData: SocietyCreationData;
11
+ stripePriceId: string;
12
+ stripeCheckoutSessionId?: string | null;
13
+ idSociety?: number | null;
14
+ status: SocietyCreationCheckoutStatus;
15
+ processingStartedAt?: Date | null;
16
+ attemptCount: number;
17
+ internalError?: string | null;
18
+ expiresAt: Date;
19
+ createdAt?: Date;
20
+ updatedAt?: Date;
21
+ owner?: IUser;
22
+ society?: ISociety | null;
23
+ }
package/ts/types/index.ts CHANGED
@@ -4,6 +4,7 @@ export * from './Interface/models/IBusinessLineUser.js';
4
4
  export * from './Interface/models/IVisualizedInformation.js';
5
5
  export * from './Interface/models/IApiError.js';
6
6
  export * from './Interface/models/ILoginApproval.js';
7
+ export * from './Interface/models/ISocietyCreationCheckout.js';
7
8
  export * from './Interface/models/ISms.js';
8
9
  export * from './Interface/models/IAccessToken.js';
9
10
  export * from './Interface/models/IAccountDetail.js';
@@ -311,6 +312,7 @@ export * from './Enum/AutomaticRegistration.js';
311
312
  export * from './Enum/IntermediateManagementRebate.js';
312
313
  export * from './Enum/Das.js';
313
314
  export * from './Enum/LoginApprovalStatus.js';
315
+ export * from './Enum/SocietyCreationCheckoutStatus.js';
314
316
  export * from './Enum/MfaMode.js';
315
317
  export * from './Enum/ChangeLog.js';
316
318
  export * from './Enum/VisualizedInformation.js';
@@ -993,6 +995,7 @@ export * from './Interface/api/qonto/Query.js';
993
995
  export * from './Interface/api/qonto/Create.js';
994
996
  export * from './Interface/api/stripe/Create.js';
995
997
  export * from './Interface/api/stripe/Update.js';
998
+ export * from './Interface/api/societyCreationCheckout/SocietyCreationCheckout.js';
996
999
  export * from './Interface/api/qonto/UpdateConnection.js';
997
1000
  export * from './Interface/api/qonto/GetConnectionInformation.js';
998
1001
  export * from './Interface/api/qonto/Read.js';