@experteam-mx/ngx-services 0.1.1 → 16.0.0

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 (52) hide show
  1. package/README.md +7 -7
  2. package/{esm2020 → esm2022}/experteam-mx-ngx-services.mjs +4 -4
  3. package/esm2022/lib/apis/api-catalog.models.mjs +2 -0
  4. package/esm2022/lib/apis/api-companies.service.mjs +255 -0
  5. package/esm2022/lib/apis/api-security.service.mjs +128 -0
  6. package/esm2022/lib/apis/models/api-companies.interfaces.mjs +2 -0
  7. package/esm2022/lib/apis/models/api-companies.types.mjs +2 -0
  8. package/esm2022/lib/apis/models/api-security.interfaces.mjs +2 -0
  9. package/esm2022/lib/apis/models/api-security.types.mjs +2 -0
  10. package/esm2022/lib/apis/models/api.models.mjs +2 -0
  11. package/esm2022/lib/helpers/http.mjs +66 -0
  12. package/{esm2020 → esm2022}/lib/interceptors/api-headers.interceptor.mjs +34 -34
  13. package/{esm2020 → esm2022}/lib/interceptors/api-token.interceptor.mjs +35 -35
  14. package/esm2022/lib/interceptors/http-caching.interceptor.mjs +38 -0
  15. package/esm2022/lib/ngx-services.models.mjs +2 -0
  16. package/{esm2020 → esm2022}/lib/ngx-services.module.mjs +37 -37
  17. package/esm2022/public-api.mjs +20 -0
  18. package/fesm2022/experteam-mx-ngx-services.mjs +585 -0
  19. package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -0
  20. package/index.d.ts +5 -5
  21. package/lib/apis/api-catalog.models.d.ts +71 -5
  22. package/lib/apis/api-companies.service.d.ts +163 -0
  23. package/lib/apis/api-security.service.d.ts +79 -79
  24. package/lib/apis/models/api-companies.interfaces.d.ts +380 -0
  25. package/lib/apis/models/api-companies.types.d.ts +75 -0
  26. package/lib/apis/{api-security.models.d.ts → models/api-security.interfaces.d.ts} +55 -90
  27. package/lib/apis/models/api-security.types.d.ts +30 -0
  28. package/lib/apis/{api.models.d.ts → models/api.models.d.ts} +23 -31
  29. package/lib/helpers/http.d.ts +38 -31
  30. package/lib/interceptors/api-headers.interceptor.d.ts +16 -16
  31. package/lib/interceptors/api-token.interceptor.d.ts +19 -19
  32. package/lib/interceptors/http-caching.interceptor.d.ts +12 -0
  33. package/lib/ngx-services.models.d.ts +22 -21
  34. package/lib/ngx-services.module.d.ts +17 -17
  35. package/package.json +11 -16
  36. package/public-api.d.ts +12 -6
  37. package/esm2020/experteam-ngx-services.mjs +0 -5
  38. package/esm2020/lib/apis/api-catalog.models.mjs +0 -2
  39. package/esm2020/lib/apis/api-security.models.mjs +0 -2
  40. package/esm2020/lib/apis/api-security.service.mjs +0 -128
  41. package/esm2020/lib/apis/api.models.mjs +0 -2
  42. package/esm2020/lib/helpers/http.mjs +0 -45
  43. package/esm2020/lib/ngx-services.models.mjs +0 -2
  44. package/esm2020/public-api.mjs +0 -13
  45. package/fesm2015/experteam-mx-ngx-services.mjs +0 -283
  46. package/fesm2015/experteam-mx-ngx-services.mjs.map +0 -1
  47. package/fesm2015/experteam-ngx-services.mjs +0 -283
  48. package/fesm2015/experteam-ngx-services.mjs.map +0 -1
  49. package/fesm2020/experteam-mx-ngx-services.mjs +0 -280
  50. package/fesm2020/experteam-mx-ngx-services.mjs.map +0 -1
  51. package/fesm2020/experteam-ngx-services.mjs +0 -280
  52. package/fesm2020/experteam-ngx-services.mjs.map +0 -1
@@ -0,0 +1,380 @@
1
+ import { LaravelModel } from './api.models';
2
+ import { Currency, State } from '../api-catalog.models';
3
+ export interface Account extends LaravelModel {
4
+ number: string;
5
+ description: string;
6
+ account_type_id: number;
7
+ country_id: number;
8
+ is_default: boolean;
9
+ }
10
+ export interface Company extends LaravelModel {
11
+ id: number;
12
+ created_at: string;
13
+ updated_at: string;
14
+ name: string;
15
+ contact_name: string;
16
+ contact_email: string;
17
+ contact_phone: string;
18
+ state: string;
19
+ city: string;
20
+ county_name: string;
21
+ zip_code: string;
22
+ address1: string;
23
+ address2: string;
24
+ address3: string;
25
+ is_active: boolean;
26
+ }
27
+ export interface CompanyCountry extends LaravelModel {
28
+ company_id: number;
29
+ country_id: number;
30
+ headquarters_city_code: string;
31
+ lp_code: string;
32
+ company: Company;
33
+ contact_name: string;
34
+ contact_email: string;
35
+ contact_phone_code: string;
36
+ contact_phone_number: string;
37
+ state: string;
38
+ city: string;
39
+ zip_code: string;
40
+ county_name: string;
41
+ address1: string;
42
+ address2: string;
43
+ address3: string;
44
+ }
45
+ export interface CompanyCountryTax extends LaravelModel {
46
+ code: string;
47
+ name: string;
48
+ percentage: number;
49
+ company_country_id: number;
50
+ shipment_scopes: number[];
51
+ base_percentage: number;
52
+ tax_type: string;
53
+ }
54
+ export interface CountryCurrencyRate extends CountryReferenceCurrency {
55
+ rate: number;
56
+ }
57
+ export interface CountryReference extends LaravelModel {
58
+ language_id: number;
59
+ decimal_point: number;
60
+ decimal_separator: string;
61
+ thousands_separator: string;
62
+ use_billing: boolean;
63
+ use_payments: boolean;
64
+ restricted_import_countries: number[];
65
+ currency_id: number;
66
+ max_quantity_document_piece: number;
67
+ max_quantity_package_piece: number;
68
+ weight_restriction_piece: number;
69
+ restriction_shipment: number;
70
+ restriction_dimension: number;
71
+ max_declared_value: number;
72
+ territories: number[];
73
+ some_openings: boolean;
74
+ locale: string;
75
+ country_id: number;
76
+ label_printer_name: string;
77
+ receipt_printer_name: string;
78
+ others_printer_name: string;
79
+ }
80
+ export interface CountryReferenceCurrency extends LaravelModel {
81
+ country_id: number;
82
+ currency_id: number;
83
+ is_local: boolean;
84
+ can_transact: boolean;
85
+ code: string;
86
+ name: string;
87
+ is_default: boolean;
88
+ is_declared_insured: boolean;
89
+ currency: Currency;
90
+ }
91
+ export interface Employee extends LaravelModel {
92
+ name: string;
93
+ last_name: string;
94
+ number: string;
95
+ company_id: number;
96
+ country_id: number;
97
+ external: boolean;
98
+ phone_code: string;
99
+ phone_number: string;
100
+ is_active: boolean;
101
+ password: string;
102
+ roles: string[];
103
+ locations: Location[];
104
+ }
105
+ export interface Exchange extends LaravelModel {
106
+ company_country_currency_id: number;
107
+ valid_since: string;
108
+ valid_until: string | null;
109
+ value: number;
110
+ type: string;
111
+ }
112
+ export interface Installation extends LaravelModel {
113
+ system_id: number;
114
+ mac_address: string;
115
+ ip_address: string;
116
+ location_id: number;
117
+ }
118
+ export interface Location extends LaravelModel {
119
+ name: string;
120
+ contact_name: string;
121
+ email: string;
122
+ facility_code: string;
123
+ location_code: string;
124
+ type: string;
125
+ state_name: string;
126
+ state_id: number;
127
+ state_code: string;
128
+ city_name: string;
129
+ zip_code: string;
130
+ county_name: string;
131
+ address1: string;
132
+ address2: string;
133
+ address3: string;
134
+ service_area_code: string;
135
+ iata_code: string;
136
+ phone_code: string;
137
+ phone_number: string;
138
+ gmt_offset: string;
139
+ company_country_id: number;
140
+ country_zone_id: number;
141
+ country_region_id: number;
142
+ management_area_id: number;
143
+ google_maps_id: string;
144
+ route_number: string;
145
+ locker_enabled: boolean;
146
+ queue_manager_enabled: boolean;
147
+ commission_account: string;
148
+ service_point_id: string;
149
+ is_occurs: boolean;
150
+ accounts: Account[];
151
+ company_country: CompanyCountry;
152
+ state: State;
153
+ }
154
+ export interface LocationEmployee extends LaravelModel {
155
+ location_id: number;
156
+ employee_id: number;
157
+ is_active: boolean;
158
+ is_supervisor: boolean;
159
+ employee: Employee;
160
+ location: Location;
161
+ }
162
+ export interface Parameter {
163
+ name: string;
164
+ value: any;
165
+ status?: string;
166
+ }
167
+ export interface SupplyEntity extends LaravelModel {
168
+ name: string;
169
+ description: string;
170
+ country_id: number;
171
+ enabled_for_dropoff: boolean;
172
+ supply_type: SupplyType;
173
+ supply_packing: SupplyPacking;
174
+ }
175
+ export interface SupplyPacking extends LaravelModel {
176
+ value: number;
177
+ weight: number;
178
+ height: number;
179
+ depth: number;
180
+ width: number;
181
+ emobile_code: string | null;
182
+ }
183
+ export interface SupplyType extends LaravelModel {
184
+ name: string;
185
+ }
186
+ export interface Workflow {
187
+ page: string;
188
+ enabled: boolean;
189
+ }
190
+ export interface LocationEmployee extends LaravelModel {
191
+ location_id: number;
192
+ employee_id: number;
193
+ is_active: boolean;
194
+ is_supervisor: boolean;
195
+ employee: Employee;
196
+ location: Location;
197
+ }
198
+ export interface Employee extends LaravelModel {
199
+ name: string;
200
+ last_name: string;
201
+ number: string;
202
+ company_id: number;
203
+ country_id: number;
204
+ external: boolean;
205
+ phone_code: string;
206
+ phone_number: string;
207
+ is_active: boolean;
208
+ password: string;
209
+ roles: string[];
210
+ locations: Location[];
211
+ }
212
+ export interface Location extends LaravelModel {
213
+ name: string;
214
+ contact_name: string;
215
+ email: string;
216
+ facility_code: string;
217
+ location_code: string;
218
+ type: string;
219
+ state_name: string;
220
+ state_id: number;
221
+ state_code: string;
222
+ city_name: string;
223
+ zip_code: string;
224
+ county_name: string;
225
+ address1: string;
226
+ address2: string;
227
+ address3: string;
228
+ service_area_code: string;
229
+ iata_code: string;
230
+ phone_code: string;
231
+ phone_number: string;
232
+ gmt_offset: string;
233
+ company_country_id: number;
234
+ country_zone_id: number;
235
+ country_region_id: number;
236
+ management_area_id: number;
237
+ google_maps_id: string;
238
+ route_number: string;
239
+ locker_enabled: boolean;
240
+ queue_manager_enabled: boolean;
241
+ commission_account: string;
242
+ service_point_id: string;
243
+ is_occurs: boolean;
244
+ accounts: Account[];
245
+ company_country: CompanyCountry;
246
+ state: State;
247
+ }
248
+ export interface Company extends LaravelModel {
249
+ id: number;
250
+ created_at: string;
251
+ updated_at: string;
252
+ name: string;
253
+ contact_name: string;
254
+ contact_email: string;
255
+ contact_phone: string;
256
+ state: string;
257
+ city: string;
258
+ county_name: string;
259
+ zip_code: string;
260
+ address1: string;
261
+ address2: string;
262
+ address3: string;
263
+ is_active: boolean;
264
+ }
265
+ export interface CompanyCountry extends LaravelModel {
266
+ company_id: number;
267
+ country_id: number;
268
+ headquarters_city_code: string;
269
+ lp_code: string;
270
+ company: Company;
271
+ contact_name: string;
272
+ contact_email: string;
273
+ contact_phone_code: string;
274
+ contact_phone_number: string;
275
+ state: string;
276
+ city: string;
277
+ zip_code: string;
278
+ county_name: string;
279
+ address1: string;
280
+ address2: string;
281
+ address3: string;
282
+ }
283
+ export interface Installation extends LaravelModel {
284
+ system_id: number;
285
+ mac_address: string;
286
+ ip_address: string;
287
+ location_id: number;
288
+ }
289
+ export interface SupplyEntity extends LaravelModel {
290
+ name: string;
291
+ description: string;
292
+ country_id: number;
293
+ enabled_for_dropoff: boolean;
294
+ supply_type: SupplyType;
295
+ supply_packing: SupplyPacking;
296
+ }
297
+ export interface SupplyType extends LaravelModel {
298
+ name: string;
299
+ }
300
+ export interface SupplyPacking extends LaravelModel {
301
+ value: number;
302
+ weight: number;
303
+ height: number;
304
+ depth: number;
305
+ width: number;
306
+ emobile_code: string | null;
307
+ }
308
+ export interface Employee extends LaravelModel {
309
+ name: string;
310
+ last_name: string;
311
+ number: string;
312
+ company_id: number;
313
+ country_id: number;
314
+ external: boolean;
315
+ phone_code: string;
316
+ phone_number: string;
317
+ is_active: boolean;
318
+ password: string;
319
+ roles: string[];
320
+ locations: Location[];
321
+ }
322
+ export interface CountryReferenceCurrency extends LaravelModel {
323
+ country_id: number;
324
+ currency_id: number;
325
+ is_local: boolean;
326
+ can_transact: boolean;
327
+ code: string;
328
+ name: string;
329
+ is_default: boolean;
330
+ is_declared_insured: boolean;
331
+ currency: Currency;
332
+ }
333
+ export interface CompanyCountryTax extends LaravelModel {
334
+ code: string;
335
+ name: string;
336
+ percentage: number;
337
+ company_country_id: number;
338
+ shipment_scopes: number[];
339
+ base_percentage: number;
340
+ tax_type: string;
341
+ }
342
+ export interface Exchange extends LaravelModel {
343
+ company_country_currency_id: number;
344
+ valid_since: string;
345
+ valid_until: string | null;
346
+ value: number;
347
+ type: string;
348
+ }
349
+ export interface Parameter {
350
+ name: string;
351
+ value: any;
352
+ status?: string;
353
+ }
354
+ export interface CountryReference extends LaravelModel {
355
+ language_id: number;
356
+ decimal_point: number;
357
+ decimal_separator: string;
358
+ thousands_separator: string;
359
+ use_billing: boolean;
360
+ use_payments: boolean;
361
+ restricted_import_countries: number[];
362
+ currency_id: number;
363
+ max_quantity_document_piece: number;
364
+ max_quantity_package_piece: number;
365
+ weight_restriction_piece: number;
366
+ restriction_shipment: number;
367
+ restriction_dimension: number;
368
+ max_declared_value: number;
369
+ territories: number[];
370
+ some_openings: boolean;
371
+ locale: string;
372
+ country_id: number;
373
+ label_printer_name: string;
374
+ receipt_printer_name: string;
375
+ others_printer_name: string;
376
+ }
377
+ export interface Workflow {
378
+ page: string;
379
+ enabled: boolean;
380
+ }
@@ -0,0 +1,75 @@
1
+ import { Account, CompanyCountry, CompanyCountryTax, CountryReference, CountryReferenceCurrency, Employee, Exchange, Installation, Location, LocationEmployee, Parameter, SupplyEntity, Workflow } from './api-companies.interfaces';
2
+ export type LocationEmployeesData = {
3
+ location_employees: LocationEmployee[];
4
+ total: number;
5
+ };
6
+ export type InstallationsData = {
7
+ installations: Installation[];
8
+ total: number;
9
+ };
10
+ export type InstallationData = {
11
+ installation: Installation;
12
+ };
13
+ export type LocationsData = {
14
+ locations: Location[];
15
+ total: number;
16
+ };
17
+ export type LocationData = {
18
+ location: Location;
19
+ };
20
+ export type SupplyEntitiesData = {
21
+ supply_entities: SupplyEntity[];
22
+ total: number;
23
+ };
24
+ export type EmployeesData = {
25
+ employees: Employee[];
26
+ total: number;
27
+ };
28
+ export type EmployeeData = {
29
+ employee: Employee;
30
+ };
31
+ export type CompanyCountriesData = {
32
+ company_countries: CompanyCountry[];
33
+ total: number;
34
+ };
35
+ export type CompanyCountryData = {
36
+ company_country: CompanyCountry;
37
+ };
38
+ export type CountryReferenceCurrenciesData = {
39
+ country_reference_currencies: CountryReferenceCurrency[];
40
+ total: number;
41
+ };
42
+ export type CompanyCountryTaxesData = {
43
+ company_country_taxes: CompanyCountryTax[];
44
+ total: number;
45
+ };
46
+ export type ExchangesData = {
47
+ exchanges: Exchange[];
48
+ total: number;
49
+ };
50
+ export type AccountEntitiesData = {
51
+ account_entities: Account[];
52
+ total: number;
53
+ };
54
+ export type ParametersProps = {
55
+ paramNames: string[];
56
+ };
57
+ export type ParametersData = {
58
+ parameters: Parameter[];
59
+ total: number;
60
+ };
61
+ export type ParameterValueProps = {
62
+ paramName: string;
63
+ };
64
+ export type ParameterValueData = {
65
+ value: any;
66
+ };
67
+ export type CountryReferencesData = {
68
+ country_references: CountryReference[];
69
+ };
70
+ export type CountryReferenceData = {
71
+ country_reference: CountryReference;
72
+ };
73
+ export type WorkflowsData = {
74
+ workflow: Workflow[];
75
+ };
@@ -1,90 +1,55 @@
1
- import { LaravelModel } from './api.models';
2
- import { Language } from './api-catalog.models';
3
- export interface Session extends LaravelModel {
4
- name: string;
5
- username: string;
6
- email: string;
7
- model_type: string;
8
- model_id: number;
9
- auth_type: string;
10
- language_id: number;
11
- country_id: number;
12
- location_id: number;
13
- installation_id: number;
14
- company_country_id: number;
15
- company_country_currency_id: number;
16
- opening_id: number;
17
- locale: string;
18
- permissions: string[];
19
- roles: Role[];
20
- session: Session;
21
- }
22
- export interface Role extends LaravelModel {
23
- code: string;
24
- name: string;
25
- guard_name: string;
26
- permissions: Permission[];
27
- role_type_id: number;
28
- role_type: RoleType;
29
- company_country_id: number;
30
- }
31
- export interface RoleType extends LaravelModel {
32
- name: string;
33
- level: number;
34
- }
35
- export interface Permission extends LaravelModel {
36
- name: string;
37
- guard_name: string;
38
- pivot: {
39
- role_id: number;
40
- permission_id: number;
41
- };
42
- }
43
- export interface User extends LaravelModel {
44
- name: string;
45
- username: string;
46
- email: string;
47
- model_type: string;
48
- model_id: string;
49
- auth_type: string;
50
- language_id: number;
51
- permissions: string[];
52
- role: Role;
53
- session: Session;
54
- language: Language;
55
- }
56
- export type LoginIn = {
57
- username: string;
58
- password: string;
59
- role?: string;
60
- };
61
- export type LoginOut = {
62
- access_token: string;
63
- token_type: string;
64
- expires_in: number;
65
- };
66
- export type CreateSessionIn = {
67
- modelType: string;
68
- modelId: number;
69
- token?: string;
70
- };
71
- export type CreateSessionOut = {
72
- session: Session;
73
- };
74
- export type GetUserIn = {
75
- userId: number;
76
- };
77
- export type GetUserOut = {
78
- user: User;
79
- };
80
- export interface MeOut extends GetUserOut {
81
- }
82
- export type GetUserInfoIn = {
83
- token: string;
84
- };
85
- export type ChangeLanguageIn = {
86
- languageId: number;
87
- };
88
- export type ChangeLanguageOut = {
89
- user: User;
90
- };
1
+ import { LaravelModel } from './api.models';
2
+ import { Language } from '../api-catalog.models';
3
+ export interface Session extends LaravelModel {
4
+ name: string;
5
+ username: string;
6
+ email: string;
7
+ model_type: string;
8
+ model_id: number;
9
+ auth_type: string;
10
+ language_id: number;
11
+ country_id: number;
12
+ location_id: number;
13
+ installation_id: number;
14
+ company_country_id: number;
15
+ country_reference_currency_id: number;
16
+ opening_id: number;
17
+ locale: string;
18
+ permissions: string[];
19
+ roles: Role[];
20
+ session: Session;
21
+ }
22
+ export interface Role extends LaravelModel {
23
+ code: string;
24
+ name: string;
25
+ guard_name: string;
26
+ permissions: Permission[];
27
+ role_type_id: number;
28
+ role_type: RoleType;
29
+ company_country_id: number;
30
+ }
31
+ export interface RoleType extends LaravelModel {
32
+ name: string;
33
+ level: number;
34
+ }
35
+ export interface Permission extends LaravelModel {
36
+ name: string;
37
+ guard_name: string;
38
+ pivot: {
39
+ role_id: number;
40
+ permission_id: number;
41
+ };
42
+ }
43
+ export interface User extends LaravelModel {
44
+ name: string;
45
+ username: string;
46
+ email: string;
47
+ model_type: string;
48
+ model_id: number;
49
+ auth_type: string;
50
+ language_id: number;
51
+ permissions: string[];
52
+ role: Role;
53
+ session: Session;
54
+ language: Language;
55
+ }
@@ -0,0 +1,30 @@
1
+ import { Session, User } from './api-security.interfaces';
2
+ export type LoginIn = {
3
+ username: string;
4
+ password: string;
5
+ role?: string;
6
+ };
7
+ export type LoginOut = {
8
+ access_token: string;
9
+ token_type: string;
10
+ expires_in: number;
11
+ };
12
+ export type CreateSessionIn = {
13
+ modelType: string;
14
+ modelId: number;
15
+ token?: string;
16
+ };
17
+ export type CreateSessionOut = {
18
+ session: Session;
19
+ };
20
+ export type GetUserOut = {
21
+ user: User;
22
+ };
23
+ export interface MeOut extends GetUserOut {
24
+ }
25
+ export type GetUserInfoIn = {
26
+ token: string;
27
+ };
28
+ export type ChangeLanguageIn = {
29
+ languageId: number;
30
+ };
@@ -1,31 +1,23 @@
1
- export interface ApiResponse {
2
- status: 'success' | 'fail' | 'error';
3
- }
4
- export interface ApiSuccess<T> extends ApiResponse {
5
- status: 'success';
6
- data: T;
7
- }
8
- export interface ApiFail<T> extends ApiResponse {
9
- status: 'fail';
10
- data: T;
11
- }
12
- export interface ApiError extends ApiResponse {
13
- status: 'error';
14
- message: string;
15
- }
16
- export interface FailMessage {
17
- message: string;
18
- }
19
- export interface ApiModel {
20
- id: number;
21
- }
22
- export interface LaravelModel extends ApiModel {
23
- is_active: boolean;
24
- created_at: Date | string;
25
- updated_at: Date | string;
26
- }
27
- export interface SymfonyModel extends ApiModel {
28
- isActive: boolean;
29
- createdAt: Date | string;
30
- updatedAt: Date | string;
31
- }
1
+ export interface ApiResponse {
2
+ status: 'success' | 'fail' | 'error';
3
+ }
4
+ export interface ApiSuccess<T> extends ApiResponse {
5
+ status: 'success';
6
+ data: T;
7
+ }
8
+ export interface ApiModel {
9
+ id: number;
10
+ }
11
+ export interface LaravelModel extends ApiModel {
12
+ is_active: boolean;
13
+ created_at: Date | string;
14
+ updated_at: Date | string;
15
+ }
16
+ export interface SymfonyModel extends ApiModel {
17
+ isActive: boolean;
18
+ createdAt: Date | string;
19
+ updatedAt: Date | string;
20
+ }
21
+ export interface QueryParams {
22
+ [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
23
+ }