@silexpert/core 1.3.98 → 1.3.99-1

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 (55) hide show
  1. package/dist/cjs/api/resources/Qonto.d.ts +1 -11
  2. package/dist/cjs/api/resources/Qonto.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Qonto.js +0 -29
  4. package/dist/cjs/api/resources/Qonto.js.map +1 -1
  5. package/dist/cjs/types/Form/FormConnector.d.ts +1 -0
  6. package/dist/cjs/types/Form/FormConnector.d.ts.map +1 -1
  7. package/dist/cjs/types/Form/FormConnector.js +85 -0
  8. package/dist/cjs/types/Form/FormConnector.js.map +1 -1
  9. package/dist/cjs/types/Interface/api/connector/OAuthTokenRequest.d.ts +12 -0
  10. package/dist/cjs/types/Interface/api/connector/OAuthTokenRequest.d.ts.map +1 -0
  11. package/dist/cjs/types/Interface/api/connector/OAuthTokenRequest.js +3 -0
  12. package/dist/cjs/types/Interface/api/connector/OAuthTokenRequest.js.map +1 -0
  13. package/dist/cjs/types/Interface/api/qonto/Create.d.ts +0 -34
  14. package/dist/cjs/types/Interface/api/qonto/Create.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/qonto/Create.js +1 -155
  16. package/dist/cjs/types/Interface/api/qonto/Create.js.map +1 -1
  17. package/dist/cjs/types/Interface/api/qonto/Query.d.ts +0 -44
  18. package/dist/cjs/types/Interface/api/qonto/Query.d.ts.map +1 -1
  19. package/dist/cjs/types/Interface/api/qonto/Query.js +1 -4
  20. package/dist/cjs/types/Interface/api/qonto/Query.js.map +1 -1
  21. package/dist/cjs/types/Interface/api/sellsy/SellsyConnectionStatus.d.ts +11 -0
  22. package/dist/cjs/types/Interface/api/sellsy/SellsyConnectionStatus.d.ts.map +1 -0
  23. package/dist/cjs/types/Interface/api/sellsy/SellsyConnectionStatus.js +3 -0
  24. package/dist/cjs/types/Interface/api/sellsy/SellsyConnectionStatus.js.map +1 -0
  25. package/dist/mjs/api/resources/Qonto.d.ts +1 -11
  26. package/dist/mjs/api/resources/Qonto.d.ts.map +1 -1
  27. package/dist/mjs/api/resources/Qonto.js +0 -29
  28. package/dist/mjs/api/resources/Qonto.js.map +1 -1
  29. package/dist/mjs/types/Form/FormConnector.d.ts +1 -0
  30. package/dist/mjs/types/Form/FormConnector.d.ts.map +1 -1
  31. package/dist/mjs/types/Form/FormConnector.js +86 -11
  32. package/dist/mjs/types/Form/FormConnector.js.map +1 -1
  33. package/dist/mjs/types/Interface/api/connector/OAuthTokenRequest.d.ts +12 -0
  34. package/dist/mjs/types/Interface/api/connector/OAuthTokenRequest.d.ts.map +1 -0
  35. package/dist/mjs/types/Interface/api/connector/OAuthTokenRequest.js +2 -0
  36. package/dist/mjs/types/Interface/api/connector/OAuthTokenRequest.js.map +1 -0
  37. package/dist/mjs/types/Interface/api/qonto/Create.d.ts +0 -34
  38. package/dist/mjs/types/Interface/api/qonto/Create.d.ts.map +1 -1
  39. package/dist/mjs/types/Interface/api/qonto/Create.js +1 -178
  40. package/dist/mjs/types/Interface/api/qonto/Create.js.map +1 -1
  41. package/dist/mjs/types/Interface/api/qonto/Query.d.ts +0 -44
  42. package/dist/mjs/types/Interface/api/qonto/Query.d.ts.map +1 -1
  43. package/dist/mjs/types/Interface/api/qonto/Query.js +0 -9
  44. package/dist/mjs/types/Interface/api/qonto/Query.js.map +1 -1
  45. package/dist/mjs/types/Interface/api/sellsy/SellsyConnectionStatus.d.ts +11 -0
  46. package/dist/mjs/types/Interface/api/sellsy/SellsyConnectionStatus.d.ts.map +1 -0
  47. package/dist/mjs/types/Interface/api/sellsy/SellsyConnectionStatus.js +2 -0
  48. package/dist/mjs/types/Interface/api/sellsy/SellsyConnectionStatus.js.map +1 -0
  49. package/package.json +1 -1
  50. package/ts/api/resources/Qonto.ts +0 -43
  51. package/ts/types/Form/FormConnector.ts +41 -11
  52. package/ts/types/Interface/api/connector/OAuthTokenRequest.ts +12 -0
  53. package/ts/types/Interface/api/qonto/Create.ts +1 -128
  54. package/ts/types/Interface/api/qonto/Query.ts +0 -64
  55. package/ts/types/Interface/api/sellsy/SellsyConnectionStatus.ts +10 -0
@@ -5,15 +5,8 @@ import {
5
5
  GetConnectionInformation,
6
6
  GetQontoOrganization,
7
7
  IBankAccount,
8
- IBankConnection,
9
8
  ReadCreateConnection,
10
- UpdateConnection,
11
9
  CreateImportationResult,
12
- CreateQontoRegistration,
13
- ReadQontoRegistration,
14
- CreateRegistrationFile,
15
- CreateWebhookConfig,
16
- ReadQontoWebhookConfig,
17
10
  } from '../../types';
18
11
  import { Resource } from '../Resource';
19
12
 
@@ -37,40 +30,4 @@ export class Qonto extends Resource {
37
30
  create(payload: CreateQontoConnection): Promise<ReadCreateConnection> {
38
31
  return this.axios.$post('connectors/qonto/connections', payload);
39
32
  }
40
-
41
- /**
42
- * @deprecated use create
43
- */
44
- updateConnection(idBankConnection: number, payload: UpdateConnection): Promise<IBankConnection> {
45
- return this.axios.$put(`connectors/qonto/connections/${idBankConnection}`, payload);
46
- }
47
-
48
- createRegistration(params: CreateQontoRegistration): Promise<ReadQontoRegistration> {
49
- return this.axios.$post('connectors/qonto/registrations', params);
50
- }
51
-
52
- getRegistration(idRegistration: string): Promise<ReadQontoRegistration> {
53
- return this.axios.$post(`connectors/qonto/registrations/${idRegistration}`);
54
- }
55
-
56
- createRegistrationFile(idRegistration: string, params: CreateRegistrationFile): Promise<ReadQontoRegistration> {
57
- return this.axios.$post(`connectors/qonto/registrations/${idRegistration}/files`, params, {
58
- responseType: 'arraybuffer',
59
- headers: {
60
- Accept: 'application/pdf',
61
- },
62
- });
63
- }
64
-
65
- getRegistrationFileBuffer(idRegistration: string, idFile: string): Promise<Buffer> {
66
- return this.axios.$get(`connectors/qonto/registrations/${idRegistration}/files/${idFile}/download`);
67
- }
68
-
69
- createWebhookConfig(params: CreateWebhookConfig): Promise<ReadQontoWebhookConfig> {
70
- return this.axios.$post('connectors/qonto/registrations/webhooks-configs', params);
71
- }
72
-
73
- triggerNewMailForRegistrationLink(idRegistration: string): Promise<void> {
74
- return this.axios.$post(`connectors/qonto/registrations/${idRegistration}/email`);
75
- }
76
33
  }
@@ -1,36 +1,66 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsString, IsOptional, IsNumber, IsDate, IsEnum } from 'class-validator';
3
+ import { Type } from 'class-transformer';
1
4
  import { ConnectorType } from '../Enum/ConnectorType';
2
5
 
3
6
  export class FormConnector {
4
- // @ApiProperty()
7
+ @ApiPropertyOptional()
8
+ @IsOptional()
9
+ @IsNumber()
5
10
  id?: number;
6
11
 
7
- // @ApiProperty()
12
+ @ApiPropertyOptional()
13
+ @IsOptional()
14
+ @IsString()
8
15
  username?: string;
9
16
 
10
- // @ApiProperty()
17
+ @ApiPropertyOptional()
18
+ @IsOptional()
19
+ @IsString()
11
20
  pass?: string;
12
21
 
13
- // @ApiProperty()
22
+ @ApiPropertyOptional()
23
+ @IsOptional()
24
+ @IsString()
14
25
  url?: string;
15
26
 
16
- // @ApiProperty()
27
+ @ApiPropertyOptional()
28
+ @IsOptional()
29
+ @IsString()
17
30
  token?: string;
18
31
 
19
- // @ApiProperty()
32
+ @ApiPropertyOptional()
33
+ @IsOptional()
34
+ @IsString()
20
35
  token2?: string;
21
36
 
22
- // @ApiProperty()
37
+ @ApiPropertyOptional()
38
+ @IsOptional()
39
+ @IsString()
23
40
  token3?: string;
24
41
 
25
- // @ApiProperty()
42
+ @ApiPropertyOptional()
43
+ @IsOptional()
44
+ @IsString()
26
45
  token4?: string;
27
46
 
28
- // @ApiProperty()
47
+ @ApiPropertyOptional({ type: String, format: 'date-time' })
48
+ @IsOptional()
49
+ @IsDate()
50
+ @Type(() => Date)
29
51
  date?: Date;
30
52
 
31
- // @ApiProperty()
53
+ @ApiProperty({ enum: ConnectorType })
54
+ @IsEnum(ConnectorType)
32
55
  idTypeConnector: ConnectorType;
33
56
 
34
- // @ApiProperty()
57
+ @ApiPropertyOptional()
58
+ @IsOptional()
59
+ @IsNumber()
35
60
  idSociety?: number;
61
+
62
+ @ApiPropertyOptional()
63
+ @IsOptional()
64
+ @IsNumber()
65
+ expiresIn?: number;
36
66
  }
@@ -0,0 +1,12 @@
1
+ export interface OAuthTokenRequest {
2
+ clientId: string;
3
+ redirectUri: string;
4
+ codeVerifier: string;
5
+ code: string;
6
+ }
7
+
8
+ export interface SellsyTokenResponse {
9
+ access_token: string;
10
+ refresh_token: string;
11
+ expires_in: number;
12
+ }
@@ -1,8 +1,5 @@
1
- import { IsDateString, IsOptional, IsString, IsArray, IsBoolean, IsNumber } from 'class-validator';
1
+ import { IsDateString, IsOptional, IsString, IsArray } from 'class-validator';
2
2
  import { ApiPropertyOptional, ApiProperty } from '../../../../utils';
3
- import { RegistrationFileType, ReadStakeHolders } from './Query';
4
- import { TFile } from '../file/TFile';
5
- import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
6
3
 
7
4
  export class CreateImportation {
8
5
  @ApiPropertyOptional()
@@ -35,127 +32,3 @@ export class ProcessBankAccount {
35
32
  @IsArray()
36
33
  idsSlugToRemove: Array<string>;
37
34
  }
38
-
39
- export class CreateQontoRegistration {
40
- @ApiProperty()
41
- @IsString()
42
- legalFlow: 'company_creation' | 'existing_company';
43
-
44
- @ApiProperty()
45
- @IsString()
46
- locale: 'en' | 'fr' | 'it' | 'es' | 'de';
47
-
48
- @ApiPropertyOptional()
49
- @IsString()
50
- @IsOptional()
51
- firstName?: string | null;
52
-
53
- @ApiPropertyOptional()
54
- @IsString()
55
- @IsOptional()
56
- lastName?: string | null;
57
-
58
- @ApiPropertyOptional()
59
- @IsString()
60
- @IsOptional()
61
- email?: string | null;
62
-
63
- @ApiProperty()
64
- @IsString()
65
- entityType: 'freelancer' | 'company';
66
-
67
- @ApiPropertyOptional()
68
- @IsString()
69
- @IsOptional()
70
- legalName?: string | null;
71
-
72
- @ApiPropertyOptional()
73
- @IsString()
74
- @IsOptional()
75
- legalForm?: string | null;
76
-
77
- @ApiPropertyOptional()
78
- @IsString()
79
- @IsOptional()
80
- number?: string | null;
81
-
82
- @ApiPropertyOptional()
83
- @IsString()
84
- @IsOptional()
85
- sector?: string | null;
86
-
87
- @ApiPropertyOptional()
88
- @IsString()
89
- @IsOptional()
90
- registrationDate?: string | null;
91
-
92
- @ApiPropertyOptional()
93
- @IsString()
94
- @IsOptional()
95
- vatNumber?: string | null;
96
-
97
- @ApiPropertyOptional()
98
- @IsString()
99
- @IsOptional()
100
- addressStreet?: string | null;
101
-
102
- @ApiPropertyOptional()
103
- @IsString()
104
- @IsOptional()
105
- addressStreet2?: string | null;
106
-
107
- @ApiPropertyOptional()
108
- @IsString()
109
- @IsOptional()
110
- postalCode?: string | null;
111
-
112
- @ApiPropertyOptional()
113
- @IsString()
114
- @IsOptional()
115
- city?: string | null;
116
-
117
- @ApiPropertyOptional()
118
- @IsString()
119
- @IsOptional()
120
- country?: string | null;
121
-
122
- @ApiProperty()
123
- @IsString()
124
- totalCapitalAmount: string;
125
-
126
- @ApiProperty()
127
- stakeHolders: ReadStakeHolders;
128
-
129
- @ApiProperty()
130
- @IsNumber()
131
- idSociety: number;
132
- }
133
-
134
- export class CreateRegistrationFile {
135
- @ApiProperty()
136
- file: TFile;
137
-
138
- @ApiProperty()
139
- fileType: RegistrationFileType;
140
-
141
- @ApiPropertyOptional()
142
- @IsString()
143
- @IsOptional()
144
- stakeholderId?: string;
145
- }
146
-
147
- export class CreateWebhookConfig {
148
- @ApiProperty()
149
- @IsString()
150
- callbackUrl: string;
151
-
152
- @ApiProperty()
153
- @IsString()
154
- secret: string;
155
-
156
- @ApiPropertyOptional()
157
- @IsBoolean()
158
- @ToBoolean()
159
- @IsOptional()
160
- enabled: boolean;
161
- }
@@ -79,43 +79,6 @@ export type GetQontoAttachment = {
79
79
  };
80
80
  };
81
81
 
82
- export type ReadQontoRegistration = {
83
- id: string;
84
- legal_flow: string; // Registration type => company_creation (Company in creation), existing_company (Company already exists)
85
- flow: {
86
- type: 'manual' | 'seamless'; // which type of flow the user will be redirected
87
- breakdown: {
88
- code: string;
89
- detail: string;
90
- source: {
91
- pointer: string;
92
- };
93
- } | null;
94
- };
95
- status:
96
- | 'created'
97
- | 'pending'
98
- | 'user_started'
99
- | 'price_plan_selected'
100
- | 'contract_signed'
101
- | 'submitted'
102
- | 'capital_deposit_activated'
103
- | 'capital_deposit_request_signed'
104
- | 'capital_deposit_certificate_signed'
105
- | 'completed';
106
- redirection_link: string; // link where the user is redirected
107
- created_at: string;
108
- updated_at: string;
109
- locale: string;
110
- partner_user: {
111
- first_name: string | null;
112
- last_name: string | null;
113
- email: string | null;
114
- };
115
- organization: ReadOrganization;
116
- stakeholders: ReadStakeHolder[];
117
- };
118
-
119
82
  export type ReadOrganization = {
120
83
  id?: string;
121
84
  entity_type: 'freelancer' | 'company';
@@ -167,30 +130,3 @@ export class ReadStakeHolder {
167
130
  }
168
131
 
169
132
  export type ReadStakeHolders = ReadStakeHolder[];
170
-
171
- export class ReadQontoRegistrationFile {
172
- id: string;
173
- filename: string;
174
- filesize_bytes: number;
175
- url: string; // TTL of 2 hours
176
- created_at: string;
177
- file_type: string;
178
- stakeholder_id: string | null;
179
- }
180
-
181
- export type ReadQontoWebhookConfig = {
182
- id: string;
183
- created_at: string;
184
- updated_at: string;
185
- callback_url: string;
186
- enabled: boolean;
187
- secret: string;
188
- };
189
-
190
- export type RegistrationFileType =
191
- | 'organization-deposit-certificate'
192
- | 'organization-proof-of-address'
193
- | 'organization-by-laws'
194
- | 'organization-kbis'
195
- | 'stakeholder-proof-of-identity'
196
- | 'stakeholder-residence-permit';
@@ -0,0 +1,10 @@
1
+ export interface SellsyConnectionStatus {
2
+ connected: boolean;
3
+ refreshed?: boolean;
4
+ needReauth?: boolean;
5
+ lastSync?: Date | string;
6
+ expiresAt?: Date;
7
+ expiresIn?: number;
8
+ message?: string;
9
+ error?: string;
10
+ }