@experteam-mx/ngx-services 18.4.0 → 18.4.2

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 (53) hide show
  1. package/esm2022/lib/apis/api-billing-do.service.mjs +41 -0
  2. package/esm2022/lib/apis/api-billing-mx.service.mjs +62 -0
  3. package/esm2022/lib/apis/api-companies.service.mjs +21 -22
  4. package/esm2022/lib/apis/api-external-pickups.service.mjs +74 -0
  5. package/esm2022/lib/apis/api-invoices.service.mjs +79 -9
  6. package/esm2022/lib/apis/api-open-items.service.mjs +62 -0
  7. package/esm2022/lib/apis/api-reports.service.mjs +48 -2
  8. package/esm2022/lib/apis/api-security.service.mjs +56 -39
  9. package/esm2022/lib/apis/api-shipments.service.mjs +13 -3
  10. package/esm2022/lib/apis/models/api-billing.interfaces.mjs +2 -0
  11. package/esm2022/lib/apis/models/api-billing.types.mjs +2 -0
  12. package/esm2022/lib/apis/models/api-catalog.interfaces.mjs +1 -1
  13. package/esm2022/lib/apis/models/api-companies.types.mjs +1 -1
  14. package/esm2022/lib/apis/models/api-external-pickups.types.mjs +2 -0
  15. package/esm2022/lib/apis/models/api-invoices.interfaces.mjs +1 -1
  16. package/esm2022/lib/apis/models/api-invoices.types.mjs +1 -1
  17. package/esm2022/lib/apis/models/api-open-items.interfaces.mjs +2 -0
  18. package/esm2022/lib/apis/models/api-open-items.types.mjs +2 -0
  19. package/esm2022/lib/apis/models/api-reports.interfaces.mjs +1 -1
  20. package/esm2022/lib/apis/models/api-reports.types.mjs +1 -1
  21. package/esm2022/lib/apis/models/api-security.types.mjs +1 -1
  22. package/esm2022/lib/apis/models/api-shipments.types.mjs +1 -1
  23. package/esm2022/lib/ngx-services.models.mjs +1 -1
  24. package/esm2022/lib/websockets/web-sockets.service.mjs +115 -0
  25. package/esm2022/public-api.mjs +11 -1
  26. package/fesm2022/experteam-mx-ngx-services.mjs +615 -137
  27. package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
  28. package/lib/apis/api-billing-do.service.d.ts +24 -0
  29. package/lib/apis/api-billing-mx.service.d.ts +39 -0
  30. package/lib/apis/api-companies.service.d.ts +9 -9
  31. package/lib/apis/api-external-pickups.service.d.ts +46 -0
  32. package/lib/apis/api-invoices.service.d.ts +59 -9
  33. package/lib/apis/api-open-items.service.d.ts +41 -0
  34. package/lib/apis/api-reports.service.d.ts +24 -1
  35. package/lib/apis/api-security.service.d.ts +45 -32
  36. package/lib/apis/api-shipments.service.d.ts +10 -3
  37. package/lib/apis/models/api-billing.interfaces.d.ts +41 -0
  38. package/lib/apis/models/api-billing.types.d.ts +17 -0
  39. package/lib/apis/models/api-catalog.interfaces.d.ts +6 -0
  40. package/lib/apis/models/api-companies.types.d.ts +7 -13
  41. package/lib/apis/models/api-external-pickups.types.d.ts +31 -0
  42. package/lib/apis/models/api-invoices.interfaces.d.ts +35 -1
  43. package/lib/apis/models/api-invoices.types.d.ts +57 -5
  44. package/lib/apis/models/api-open-items.interfaces.d.ts +32 -0
  45. package/lib/apis/models/api-open-items.types.d.ts +58 -0
  46. package/lib/apis/models/api-reports.interfaces.d.ts +149 -0
  47. package/lib/apis/models/api-reports.types.d.ts +13 -4
  48. package/lib/apis/models/api-security.types.d.ts +9 -8
  49. package/lib/apis/models/api-shipments.types.d.ts +41 -0
  50. package/lib/ngx-services.models.d.ts +16 -5
  51. package/lib/websockets/web-sockets.service.d.ts +49 -0
  52. package/package.json +11 -2
  53. package/public-api.d.ts +9 -0
@@ -0,0 +1,32 @@
1
+ import { CustomerOpenItem, CustomerOtherInvoice, OpenItems, OtherInvoices, PaymentDetail } from './api-open-items.types';
2
+ export interface OpenItem {
3
+ id: number;
4
+ invoice_number: string;
5
+ shipment_tracking_number: string;
6
+ invoice_issue_datetime: Date | string;
7
+ invoice_expiration_datetime: Date | string;
8
+ customer_identification_number: string;
9
+ customer_company_name: string;
10
+ account: string;
11
+ country_reference_currency_id: number;
12
+ pending_value: number;
13
+ payed_value: number;
14
+ is_cash: boolean;
15
+ status: string;
16
+ origin: string;
17
+ user_id: string | null;
18
+ }
19
+ export interface OpenItemIn {
20
+ payments: PaymentDetail[];
21
+ customer: CustomerOpenItem | CustomerOtherInvoice;
22
+ document_type_range_id: number;
23
+ document_number: string;
24
+ observation: string;
25
+ document_date: Date;
26
+ }
27
+ export interface PaymentOpenItemIn extends OpenItemIn {
28
+ open_items: OpenItems[];
29
+ }
30
+ export interface OtherInvoiceIn extends OpenItemIn {
31
+ other_invoices: OtherInvoices[];
32
+ }
@@ -0,0 +1,58 @@
1
+ import { OpenItem } from './api-open-items.interfaces';
2
+ import { Document } from './api-invoices.interfaces';
3
+ export type CustomerOpenItem = {
4
+ company_name: string;
5
+ full_name: string;
6
+ email: string;
7
+ phone_code: string;
8
+ phone_number: string;
9
+ address_line1: string;
10
+ address_line2: string;
11
+ address_line3: string;
12
+ identification_number: string;
13
+ identification_type_id: number;
14
+ postal_code: string;
15
+ state: string;
16
+ county_name: string;
17
+ city_name: string;
18
+ country_id: number;
19
+ };
20
+ export type CustomerOtherInvoice = {
21
+ identification_number: string;
22
+ company_name: string;
23
+ full_name: string;
24
+ account_number: string;
25
+ country_id: number;
26
+ };
27
+ export type OpenItems = {
28
+ id: string;
29
+ payed_value: number;
30
+ };
31
+ export type OpenItemsOut = {
32
+ open_items: OpenItem[];
33
+ total: number;
34
+ };
35
+ export type OtherInvoices = {
36
+ invoice_number: string;
37
+ shipment_tracking_number: string;
38
+ invoice_issue_datetime: string;
39
+ pending_value: number;
40
+ customer_identification_number: string;
41
+ };
42
+ export type PaymentDetail = {
43
+ amount: number;
44
+ received: number;
45
+ country_reference_currency_id: number;
46
+ exchange: string | number;
47
+ country_payment_type_id: number;
48
+ due_date: string;
49
+ details: {
50
+ [key: string]: string;
51
+ };
52
+ };
53
+ export type PaymentOut = {
54
+ document: Document;
55
+ };
56
+ export type OtherInvoiceOut = {
57
+ document: Document;
58
+ };
@@ -1,4 +1,5 @@
1
1
  import { LaravelModel, Translations } from './api.models';
2
+ import { DocumentPayment } from './api-invoices.interfaces';
2
3
  export interface CollectionPayment extends LaravelModel {
3
4
  _id: number;
4
5
  country_code: string;
@@ -45,3 +46,151 @@ export interface DocumentCategory extends LaravelModel {
45
46
  updated_at: string;
46
47
  translations: Translations;
47
48
  }
49
+ export interface Shipment {
50
+ id: number;
51
+ document_id: number;
52
+ shipment_scope_name: string;
53
+ is_document: boolean;
54
+ origin_service_area_code: string;
55
+ origin_facility_code: string;
56
+ destination_facility_code: string;
57
+ destination_service_area_code: string;
58
+ shipment_pieces_tracking_numbers: string[];
59
+ shipment_tracking_number: string;
60
+ shipper_full_name: string;
61
+ shipper_company_name: string;
62
+ shipper_email: string;
63
+ shipper_phone_number: string;
64
+ shipper_phone_code: string;
65
+ shipper_full_phone_number: string;
66
+ shipper_address_line1: string;
67
+ shipper_address_line2: string;
68
+ shipper_city_name: string;
69
+ shipper_state_name: string;
70
+ shipper_state_code: string;
71
+ shipper_postal_code: string;
72
+ receiver_full_name: string;
73
+ receiver_company_name: string;
74
+ receiver_address_line1: string;
75
+ receiver_address_line2: string;
76
+ receiver_city_name: string;
77
+ receiver_state_name: string;
78
+ receiver_state_code: string;
79
+ receiver_postal_code: string;
80
+ shipper_account: string;
81
+ promotion_code: string;
82
+ customer_identification_type_id: number;
83
+ customer_identification_number: string;
84
+ customer_email: string;
85
+ customer_full_phone_number: string;
86
+ price_override_approver_id: number;
87
+ price_override_reason_id: number;
88
+ price_override_approver_name: string;
89
+ price_override_reason_name: string;
90
+ is_proforma: boolean;
91
+ is_kiosk: boolean;
92
+ to_landing: boolean;
93
+ is_price_override: boolean;
94
+ is_promotion_code: boolean;
95
+ is_retail_rate: boolean;
96
+ payment_type_1: string;
97
+ payment_code_1: string;
98
+ amount_1: number;
99
+ reference_1: string;
100
+ payment_type_2: string;
101
+ payment_code_2: string;
102
+ amount_2: number;
103
+ reference_2: string;
104
+ document_payments?: DocumentPayment[];
105
+ location_id: number;
106
+ installation_id: number;
107
+ user_id: number;
108
+ user_username: string;
109
+ company_id: number;
110
+ country_id: number;
111
+ company_country_id: number;
112
+ country_name: string;
113
+ company_name: string;
114
+ country_code: string;
115
+ location_name: string;
116
+ location_facility_code: string;
117
+ installation_number: number;
118
+ product_global_code: string;
119
+ product_local_code: string;
120
+ shipment_gmt_offset: string;
121
+ shipment_pieces_number: number;
122
+ shipment_bill_weight: number;
123
+ total_published_value: number;
124
+ total_partner_account_value: number;
125
+ question_id: number;
126
+ question_description: string;
127
+ question_type: string;
128
+ amount_collected: number;
129
+ shipment_value: number;
130
+ declared_value: number;
131
+ insured_value: number;
132
+ shipment_status_id: number;
133
+ transaction_id: string;
134
+ shipment_type: string;
135
+ ein_number: string;
136
+ itn_number: string;
137
+ created_at: string;
138
+ updated_at: string;
139
+ retail_rate_adjustment: number;
140
+ shipment_status_code: string;
141
+ shipment_status_description: string;
142
+ shipment_status_translations: {
143
+ description: {
144
+ [key: string]: string;
145
+ };
146
+ };
147
+ authorization_numbers: string[];
148
+ is_term_condition: boolean;
149
+ is_marketing_consent: boolean;
150
+ is_manual: boolean;
151
+ commercial_invoice: boolean;
152
+ shipment_id: number;
153
+ date: string;
154
+ date_og: string;
155
+ invoice_document_id?: number | null;
156
+ currency_code: string | null;
157
+ send_to_api_inventories: boolean;
158
+ selected?: boolean;
159
+ delivery_date_time: string;
160
+ product_subtotal: number;
161
+ product_tax: number;
162
+ product_total: number;
163
+ product_taxes: {
164
+ code: string;
165
+ percent: number;
166
+ base_amount: number;
167
+ amount: number;
168
+ }[];
169
+ shipment_company_country_extra_charges: {
170
+ _id: number;
171
+ subtotal: number;
172
+ tax: number;
173
+ total: number;
174
+ extra_charge_id: number;
175
+ taxes: {
176
+ code: string;
177
+ percent: number;
178
+ base_amount: number;
179
+ amount: number;
180
+ }[];
181
+ created_at: string;
182
+ updated_at: string;
183
+ global_service_code: string;
184
+ local_service_code: string;
185
+ global_service_name: string;
186
+ local_service_name: string;
187
+ is_discount: false;
188
+ }[];
189
+ additional_documents: {
190
+ country_id: number;
191
+ include_indemnity_letter: boolean;
192
+ include_pdf: boolean;
193
+ shipment_content_type_id: number;
194
+ shipment_scope_id: number;
195
+ };
196
+ }
@@ -1,6 +1,15 @@
1
- import { LaravelModel } from './api.models';
2
- import { CollectionPayment } from './api-reports.interfaces';
3
- export interface CollectionPaymentsOut extends LaravelModel {
1
+ import { CollectionPayment, Shipment } from './api-reports.interfaces';
2
+ export type CollectionPaymentsOut = {
4
3
  collection_payments: CollectionPayment[];
5
4
  total: number;
6
- }
5
+ };
6
+ export type ShipmentsReportOut = {
7
+ shipments: Shipment[];
8
+ total: number;
9
+ };
10
+ export type ExistPendingPaymentsIn = {
11
+ installation_id: number;
12
+ };
13
+ export type ExistPendingInvoicesIn = {
14
+ installation_id: number;
15
+ };
@@ -1,26 +1,27 @@
1
1
  import { Module, Role, RoleType, Session, User } from './api-security.interfaces';
2
- export type LoginIn = {
2
+ export type AuthLoginIn = {
3
3
  username: string;
4
4
  password: string;
5
5
  role?: string;
6
+ system_name?: string;
6
7
  };
7
- export type LoginOut = {
8
+ export type AuthLoginOut = {
8
9
  access_token: string;
9
10
  token_type: string;
10
11
  expires_in: number;
11
12
  };
12
- export type CreateSessionIn = {
13
+ export type SessionIn = {
13
14
  modelType: string;
14
15
  modelId: number;
15
16
  token?: string;
16
17
  };
17
- export type CreateSessionOut = {
18
+ export type SessionOut = {
18
19
  session: Session;
19
20
  };
20
21
  export type GetUserOut = {
21
22
  user: User;
22
23
  };
23
- export interface MeOut extends GetUserOut {
24
+ export interface AuthMeOut extends GetUserOut {
24
25
  }
25
26
  export type ChangeLanguageIn = {
26
27
  languageId: number;
@@ -36,10 +37,10 @@ export type Pivot = {
36
37
  module_id: string;
37
38
  permission_id: string;
38
39
  };
39
- export type RoleByIdOut = {
40
+ export type RoleOut = {
40
41
  role: Role;
41
42
  };
42
- export type RolePermissionsIn = {
43
+ export type RoleIn = {
43
44
  name: string;
44
45
  role_type_id: number;
45
46
  company_country_id: number;
@@ -51,7 +52,7 @@ export type RoleTypesOut = {
51
52
  role_types: RoleType[];
52
53
  total: number;
53
54
  };
54
- export type ModulePermissionsOut = {
55
+ export type ModulesOut = {
55
56
  modules: Module[];
56
57
  total: number;
57
58
  };
@@ -30,3 +30,44 @@ export type ValidateAccountOut = {
30
30
  account: AccountResponse;
31
31
  transactionId: string;
32
32
  };
33
+ export type ManifestMultipleIn = {
34
+ shipmentIds: number[];
35
+ customer: {
36
+ companyName: string;
37
+ fullName: string;
38
+ email: string;
39
+ phoneCode: string;
40
+ phoneNumber: string;
41
+ addressLine1: string;
42
+ addressLine2?: string;
43
+ addressLine3?: string;
44
+ identificationNumber?: string;
45
+ identificationTypeId?: number;
46
+ countryCode: string;
47
+ stateCode?: string;
48
+ postalCode?: string;
49
+ cityName?: string;
50
+ countyName?: string;
51
+ };
52
+ paymentDetails: {
53
+ totalAmount: number;
54
+ payments: {
55
+ amount: number;
56
+ received: number;
57
+ countryReferenceCurrencyId: number;
58
+ exchange: number;
59
+ countryPaymentTypeId: number;
60
+ dueDate: string;
61
+ details: Record<string, string>;
62
+ }[];
63
+ };
64
+ priceOverrideApproverId: number | null;
65
+ priceOverrideReasonId: number | null;
66
+ isPendingInvoice?: boolean;
67
+ };
68
+ export type ManifestMultipleOut = {
69
+ shipmentManifests: {
70
+ documentId: number;
71
+ };
72
+ transactionId: string;
73
+ };
@@ -15,15 +15,26 @@ import { InjectionToken } from '@angular/core';
15
15
  * - secretKey: A secret key used for authentication or other secure operations.
16
16
  */
17
17
  export type Environment = {
18
- apiCompaniesUrl: string;
19
- apiInvoicesUrl: string;
20
- apiReportsUrl: string;
21
- apiSecurityUrl: string;
22
- apiShipmentUrl: string;
18
+ apiBillingDO?: string;
19
+ apiBillingMX?: string;
20
+ apiCompaniesUrl?: string;
21
+ apiExternalOperationsKey?: string;
22
+ apiExternalOperationsUrl?: string;
23
+ apiInvoicesUrl?: string;
24
+ apiOpenItemsUrl?: string;
25
+ apiReportsUrl?: string;
26
+ apiSecurityUrl?: string;
27
+ apiShipmentUrl?: string;
23
28
  authCookie: string;
24
29
  cacheTtl?: number;
25
30
  printUrl?: string;
26
31
  secretKey: string;
32
+ sockets?: {
33
+ app_key: string;
34
+ debug?: boolean;
35
+ port: number;
36
+ url: string;
37
+ };
27
38
  };
28
39
  /**
29
40
  * Injection token used to inject environment configurations.
@@ -0,0 +1,49 @@
1
+ import { Channel } from 'pusher-js';
2
+ import { Observable } from 'rxjs';
3
+ import { Environment } from '../ngx-services.models';
4
+ import * as i0 from "@angular/core";
5
+ export declare class WebSocketsService {
6
+ private environments;
7
+ private pusher;
8
+ constructor(environments: Environment);
9
+ /**
10
+ * Publishes an event to the specified channel with the given data.
11
+ *
12
+ * @param {Channel} channel - The channel instance where the event will be published.
13
+ * @param {string} eventName - The name of the event to be published.
14
+ * @param {T} data - The payload data to be sent with the event.
15
+ * @return {Promise<boolean>} A promise that resolves to a boolean indicating
16
+ * whether the event was successfully triggered on the channel.
17
+ */
18
+ pub<T>(channel: Channel, eventName: string, data: T): Promise<boolean>;
19
+ /**
20
+ * Subscribes to a specified channel, retrying multiple times upon failure.
21
+ *
22
+ * @param {string} channelName - The name of the channel to be subscribed to.
23
+ * @return {Promise<Channel>} A promise that resolves to the subscribed channel object if successful.
24
+ * @throws {Error} If the subscription fails after the maximum number of retry attempts.
25
+ */
26
+ channelSub(channelName: string): Promise<Channel>;
27
+ /**
28
+ * Binds an event listener to a specified event on a given channel using Pusher or a Channel object,
29
+ * and returns an Observable that emits event data of type T.
30
+ *
31
+ * @param {Channel|string} channel - The channel to bind the event to. It can be a Channel object or a string representing the channel name.
32
+ * @param {string} event - The name of the event to bind to the channel.
33
+ * @return {Observable<T>} An Observable that emits data of type T when the specified event is triggered.
34
+ */
35
+ eventBind<T>(channel: Channel | string, event: string): Observable<T>;
36
+ /**
37
+ * Unbinds an event from the specified channel and returns an observable
38
+ * that emits data when the event callback is triggered.
39
+ *
40
+ * @param {Channel} channel - The channel object from which the event should be unbound.
41
+ * @param {string} event - The name of the event to unbind.
42
+ * @return {Observable<T>} An observable that emits data from the unbound event callback.
43
+ */
44
+ eventUnbind<T>(channel: Channel, event: string): Observable<unknown>;
45
+ private connect;
46
+ private wait;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebSocketsService, never>;
48
+ static ɵprov: i0.ɵɵInjectableDeclaration<WebSocketsService>;
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.4.0",
3
+ "version": "18.4.2",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [
@@ -22,6 +22,14 @@
22
22
  {
23
23
  "name": "Byron Bladimir Taco Taco",
24
24
  "email": "metal82fest@hotmail.com"
25
+ },
26
+ {
27
+ "name": "Gianni Santucci",
28
+ "email": "gianni.d.santucci@gmail.com"
29
+ },
30
+ {
31
+ "name": "Jefferson Morocho",
32
+ "email": "morochoji5@hotmail.com"
25
33
  }
26
34
  ],
27
35
  "repository": {
@@ -35,7 +43,8 @@
35
43
  "peerDependencies": {
36
44
  "@angular/common": "^18.2.0",
37
45
  "@angular/core": "^18.2.0",
38
- "ngx-cookie-service": "^18.0.0"
46
+ "ngx-cookie-service": "^18.0.0",
47
+ "pusher-js": "^7.5.0"
39
48
  },
40
49
  "sideEffects": false,
41
50
  "module": "fesm2022/experteam-mx-ngx-services.mjs",
package/public-api.d.ts CHANGED
@@ -1,19 +1,28 @@
1
1
  export * from './lib/ngx-services.models';
2
2
  export * from './lib/ngx-services.module';
3
+ export * from './lib/apis/api-billing-do.service';
4
+ export * from './lib/apis/api-billing-mx.service';
3
5
  export * from './lib/apis/api-companies.service';
6
+ export * from './lib/apis/api-external-pickups.service';
4
7
  export * from './lib/apis/api-invoices.service';
8
+ export * from './lib/apis/api-open-items.service';
5
9
  export * from './lib/apis/api-reports.service';
6
10
  export * from './lib/apis/api-security.service';
7
11
  export * from './lib/apis/api-shipments.service';
12
+ export * from './lib/apis/models/api-billing.types';
8
13
  export * from './lib/apis/models/api-companies.interfaces';
9
14
  export * from './lib/apis/models/api-companies.types';
15
+ export * from './lib/apis/models/api-external-pickups.types';
10
16
  export * from './lib/apis/models/api-invoices.interfaces';
11
17
  export * from './lib/apis/models/api-invoices.types';
18
+ export * from './lib/apis/models/api-open-items.interfaces';
19
+ export * from './lib/apis/models/api-open-items.types';
12
20
  export * from './lib/apis/models/api-reports.interfaces';
13
21
  export * from './lib/apis/models/api-security.interfaces';
14
22
  export * from './lib/apis/models/api-security.types';
15
23
  export * from './lib/apis/models/api-shipments.types';
16
24
  export * from './lib/apis/models/api.models';
25
+ export * from './lib/websockets/web-sockets.service';
17
26
  export * from './lib/cypher/crypto.service';
18
27
  export * from './lib/interceptors/api-headers.interceptor';
19
28
  export * from './lib/interceptors/api-token.interceptor';