@po-ui/ng-sync 5.22.3 → 6.2.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.
- package/README.md +22 -22
- package/{esm2015/lib/index.js → esm2020/lib/index.mjs} +15 -15
- package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +6 -6
- package/{esm2015/lib/models/po-data-message.model.js → esm2020/lib/models/po-data-message.model.mjs} +57 -57
- package/esm2020/lib/models/po-data-transform.model.mjs +22 -0
- package/esm2020/lib/models/po-entity/po-entity.model.mjs +214 -0
- package/{esm2015/lib/models/po-event-sourcing-error-response.model.js → esm2020/lib/models/po-event-sourcing-error-response.model.mjs} +17 -17
- package/{esm2015/lib/models/po-network-status.model.js → esm2020/lib/models/po-network-status.model.mjs} +44 -44
- package/{esm2015/lib/models/po-network-type.enum.js → esm2020/lib/models/po-network-type.enum.mjs} +30 -30
- package/esm2020/lib/models/po-query-builder/po-query-builder.model.mjs +238 -0
- package/{esm2015/lib/models/po-request-type.enum.js → esm2020/lib/models/po-request-type.enum.mjs} +16 -16
- package/esm2020/lib/po-sync.module.mjs +45 -0
- package/{esm2015/lib/services/po-event-sourcing/enums/po-event-sourcing-operation.enum.js → esm2020/lib/services/po-event-sourcing/enums/po-event-sourcing-operation.enum.mjs} +17 -17
- package/{esm2015/lib/services/po-event-sourcing/index.js → esm2020/lib/services/po-event-sourcing/index.mjs} +4 -4
- package/esm2020/lib/services/po-event-sourcing/interfaces/po-event-sourcing-item.interface.mjs +2 -0
- package/esm2020/lib/services/po-event-sourcing/interfaces/po-event-sourcing-summary-item.interface.mjs +2 -0
- package/esm2020/lib/services/po-event-sourcing/po-event-sourcing.service.mjs +372 -0
- package/{esm2015/lib/services/po-http-client/interfaces/po-http-header-option.interface.js → esm2020/lib/services/po-http-client/interfaces/po-http-header-option.interface.mjs} +11 -11
- package/esm2020/lib/services/po-http-client/interfaces/po-http-request-data.interface.mjs +2 -0
- package/esm2020/lib/services/po-http-client/interfaces/po-response-api.interface.mjs +2 -0
- package/esm2020/lib/services/po-http-client/po-http-client.service.mjs +148 -0
- package/{esm2015/lib/services/po-http-client/po-http-request-type.enum.js → esm2020/lib/services/po-http-client/po-http-request-type.enum.mjs} +25 -25
- package/esm2020/lib/services/po-network/po-network.service.mjs +58 -0
- package/{esm2015/lib/services/po-schema/index.js → esm2020/lib/services/po-schema/index.mjs} +4 -4
- package/esm2020/lib/services/po-schema/po-schema-definition/po-schema-definition.service.mjs +77 -0
- package/{esm2015/lib/services/po-schema/po-schema-util/po-schema-util.model.js → esm2020/lib/services/po-schema/po-schema-util/po-schema-util.model.mjs} +124 -124
- package/esm2020/lib/services/po-schema/po-schema.service.mjs +174 -0
- package/esm2020/lib/services/po-sync/interfaces/po-sync-config.interface.mjs +2 -0
- package/esm2020/lib/services/po-sync/interfaces/po-sync-field-options.interface.mjs +2 -0
- package/esm2020/lib/services/po-sync/interfaces/po-sync-response.interface.mjs +2 -0
- package/esm2020/lib/services/po-sync/interfaces/po-sync-schema.interface.mjs +2 -0
- package/esm2020/lib/services/po-sync/po-sync.service.mjs +325 -0
- package/{esm2015/lib/utils/utils.js → esm2020/lib/utils/utils.mjs} +63 -63
- package/esm2020/po-ui-ng-sync.mjs +5 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +2 -2
- package/fesm2015/{po-ui-ng-sync.js → po-ui-ng-sync.mjs} +2074 -2058
- package/fesm2015/po-ui-ng-sync.mjs.map +1 -0
- package/fesm2020/po-ui-ng-sync.mjs +2018 -0
- package/fesm2020/po-ui-ng-sync.mjs.map +1 -0
- package/lib/index.d.ts +14 -14
- package/lib/models/index.d.ts +5 -5
- package/lib/models/po-data-message.model.d.ts +46 -46
- package/lib/models/po-data-transform.model.d.ts +52 -52
- package/lib/models/po-entity/po-entity.model.d.ts +122 -122
- package/lib/models/po-event-sourcing-error-response.model.d.ts +20 -20
- package/lib/models/po-network-status.model.d.ts +25 -25
- package/lib/models/po-network-type.enum.d.ts +28 -28
- package/lib/models/po-query-builder/po-query-builder.model.d.ts +126 -126
- package/lib/models/po-request-type.enum.d.ts +14 -14
- package/lib/po-sync.module.d.ts +12 -7
- package/lib/services/po-event-sourcing/enums/po-event-sourcing-operation.enum.d.ts +11 -11
- package/lib/services/po-event-sourcing/index.d.ts +3 -3
- package/lib/services/po-event-sourcing/interfaces/po-event-sourcing-item.interface.d.ts +26 -26
- package/lib/services/po-event-sourcing/interfaces/po-event-sourcing-summary-item.interface.d.ts +16 -16
- package/lib/services/po-event-sourcing/po-event-sourcing.service.d.ts +74 -71
- package/lib/services/po-http-client/interfaces/po-http-header-option.interface.d.ts +15 -15
- package/lib/services/po-http-client/interfaces/po-http-request-data.interface.d.ts +24 -24
- package/lib/services/po-http-client/interfaces/po-response-api.interface.d.ts +14 -14
- package/lib/services/po-http-client/po-http-client.service.d.ts +78 -75
- package/lib/services/po-http-client/po-http-request-type.enum.d.ts +23 -23
- package/lib/services/po-network/po-network.service.d.ts +36 -33
- package/lib/services/po-schema/index.d.ts +3 -3
- package/lib/services/po-schema/po-schema-definition/po-schema-definition.service.d.ts +51 -48
- package/lib/services/po-schema/po-schema-util/po-schema-util.model.d.ts +79 -79
- package/lib/services/po-schema/po-schema.service.d.ts +98 -95
- package/lib/services/po-sync/interfaces/po-sync-config.interface.d.ts +24 -24
- package/lib/services/po-sync/interfaces/po-sync-field-options.interface.d.ts +15 -15
- package/lib/services/po-sync/interfaces/po-sync-response.interface.d.ts +20 -20
- package/lib/services/po-sync/interfaces/po-sync-schema.interface.d.ts +37 -37
- package/lib/services/po-sync/po-sync.service.d.ts +162 -159
- package/lib/utils/utils.d.ts +36 -36
- package/package.json +30 -15
- package/po-ui-ng-sync-6.2.0.tgz +0 -0
- package/po-ui-ng-sync.d.ts +5 -8
- package/public-api.d.ts +1 -1
- package/schematics/README.md +169 -169
- package/schematics/collection.json +15 -15
- package/schematics/migrations.json +30 -25
- package/schematics/ng-add/index.d.ts +7 -7
- package/schematics/ng-add/index.js +33 -33
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/index.spec.d.ts +1 -1
- package/schematics/ng-add/index.spec.js +62 -62
- package/schematics/ng-add/index.spec.js.map +1 -1
- package/schematics/ng-add/schema.json +7 -7
- package/schematics/ng-generate/schema/files/__path__/__name@dasherize__/__name@dasherize__.constants.ts.template +13 -13
- package/schematics/ng-generate/schema/index.d.ts +4 -4
- package/schematics/ng-generate/schema/index.js +12 -12
- package/schematics/ng-generate/schema/index.js.map +1 -1
- package/schematics/ng-generate/schema/index.spec.d.ts +1 -1
- package/schematics/ng-generate/schema/index.spec.js +44 -44
- package/schematics/ng-generate/schema/index.spec.js.map +1 -1
- package/schematics/ng-generate/schema/schema.d.ts +3 -3
- package/schematics/ng-generate/schema/schema.js +2 -2
- package/schematics/ng-generate/schema/schema.json +31 -31
- package/schematics/ng-update/v2/changes.d.ts +8 -8
- package/schematics/ng-update/v2/changes.js +20 -20
- package/schematics/ng-update/v2/index.d.ts +5 -5
- package/schematics/ng-update/v2/index.js +101 -101
- package/schematics/ng-update/v2/index.js.map +1 -1
- package/schematics/ng-update/v3/changes.d.ts +2 -2
- package/schematics/ng-update/v3/changes.js +14 -14
- package/schematics/ng-update/v3/index.d.ts +1 -1
- package/schematics/ng-update/v3/index.js +16 -16
- package/schematics/ng-update/v3/index.js.map +1 -1
- package/schematics/ng-update/v4/changes.d.ts +2 -2
- package/schematics/ng-update/v4/changes.js +14 -14
- package/schematics/ng-update/v4/index.d.ts +1 -1
- package/schematics/ng-update/v4/index.js +15 -15
- package/schematics/ng-update/v4/index.js.map +1 -1
- package/schematics/ng-update/v5/changes.d.ts +2 -2
- package/schematics/ng-update/v5/changes.js +13 -13
- package/schematics/ng-update/v5/index.d.ts +1 -1
- package/schematics/ng-update/v5/index.js +15 -15
- package/schematics/ng-update/v5/index.js.map +1 -1
- package/schematics/ng-update/v6/changes.d.ts +2 -0
- package/schematics/ng-update/v6/changes.js +14 -0
- package/schematics/ng-update/v6/changes.js.map +1 -0
- package/schematics/ng-update/v6/index.d.ts +1 -0
- package/schematics/ng-update/v6/index.js +16 -0
- package/schematics/ng-update/v6/index.js.map +1 -0
- package/bundles/po-ui-ng-sync.umd.js +0 -3002
- package/bundles/po-ui-ng-sync.umd.js.map +0 -1
- package/esm2015/lib/models/po-data-transform.model.js +0 -22
- package/esm2015/lib/models/po-entity/po-entity.model.js +0 -229
- package/esm2015/lib/models/po-query-builder/po-query-builder.model.js +0 -241
- package/esm2015/lib/po-sync.module.js +0 -31
- package/esm2015/lib/services/po-event-sourcing/interfaces/po-event-sourcing-item.interface.js +0 -2
- package/esm2015/lib/services/po-event-sourcing/interfaces/po-event-sourcing-summary-item.interface.js +0 -2
- package/esm2015/lib/services/po-event-sourcing/po-event-sourcing.service.js +0 -411
- package/esm2015/lib/services/po-http-client/interfaces/po-http-request-data.interface.js +0 -2
- package/esm2015/lib/services/po-http-client/interfaces/po-response-api.interface.js +0 -2
- package/esm2015/lib/services/po-http-client/po-http-client.service.js +0 -147
- package/esm2015/lib/services/po-network/po-network.service.js +0 -58
- package/esm2015/lib/services/po-schema/po-schema-definition/po-schema-definition.service.js +0 -80
- package/esm2015/lib/services/po-schema/po-schema.service.js +0 -198
- package/esm2015/lib/services/po-sync/interfaces/po-sync-config.interface.js +0 -2
- package/esm2015/lib/services/po-sync/interfaces/po-sync-field-options.interface.js +0 -2
- package/esm2015/lib/services/po-sync/interfaces/po-sync-response.interface.js +0 -2
- package/esm2015/lib/services/po-sync/interfaces/po-sync-schema.interface.js +0 -2
- package/esm2015/lib/services/po-sync/po-sync.service.js +0 -336
- package/esm2015/po-ui-ng-sync.js +0 -9
- package/fesm2015/po-ui-ng-sync.js.map +0 -1
- package/po-ui-ng-sync-5.22.3.tgz +0 -0
- package/po-ui-ng-sync.metadata.json +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @docsPrivate
|
|
3
|
-
*
|
|
4
|
-
* @description
|
|
5
|
-
*
|
|
6
|
-
* Método de requisição HTTP.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum PoRequestType {
|
|
9
|
-
GET = "get",
|
|
10
|
-
DELETE = "delete",
|
|
11
|
-
DIFF = "diff",
|
|
12
|
-
PATCH = "patch",
|
|
13
|
-
POST = "post"
|
|
14
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @docsPrivate
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
*
|
|
6
|
+
* Método de requisição HTTP.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum PoRequestType {
|
|
9
|
+
GET = "get",
|
|
10
|
+
DELETE = "delete",
|
|
11
|
+
DIFF = "diff",
|
|
12
|
+
PATCH = "patch",
|
|
13
|
+
POST = "post"
|
|
14
|
+
}
|
package/lib/po-sync.module.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* @
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common/http";
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
*
|
|
6
|
+
* Módulo do componente PoSync responsável pela sincronia de dados com backends
|
|
7
|
+
*/
|
|
8
|
+
export declare class PoSyncModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PoSyncModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PoSyncModule, never, [typeof i1.HttpClientModule], never>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PoSyncModule>;
|
|
12
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @docsPrivate
|
|
3
|
-
*
|
|
4
|
-
* Define as operações realizadas no sync.
|
|
5
|
-
*/
|
|
6
|
-
export declare enum PoEventSourcingOperation {
|
|
7
|
-
Delete = "DELETE",
|
|
8
|
-
Http = "HTTP",
|
|
9
|
-
Insert = "INSERT",
|
|
10
|
-
Update = "UPDATE"
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @docsPrivate
|
|
3
|
+
*
|
|
4
|
+
* Define as operações realizadas no sync.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PoEventSourcingOperation {
|
|
7
|
+
Delete = "DELETE",
|
|
8
|
+
Http = "HTTP",
|
|
9
|
+
Insert = "INSERT",
|
|
10
|
+
Update = "UPDATE"
|
|
11
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './po-event-sourcing.service';
|
|
2
|
-
export * from './enums/po-event-sourcing-operation.enum';
|
|
3
|
-
export * from './interfaces/po-event-sourcing-summary-item.interface';
|
|
1
|
+
export * from './po-event-sourcing.service';
|
|
2
|
+
export * from './enums/po-event-sourcing-operation.enum';
|
|
3
|
+
export * from './interfaces/po-event-sourcing-summary-item.interface';
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { PoEventSourcingOperation } from './../enums/po-event-sourcing-operation.enum';
|
|
2
|
-
import { PoHttpRequestData } from '../../po-http-client/interfaces/po-http-request-data.interface';
|
|
3
|
-
/**
|
|
4
|
-
* @description
|
|
5
|
-
*
|
|
6
|
-
* Classe que irá mapear as informações dos `EventSourcing` gerados pela aplicação.
|
|
7
|
-
*/
|
|
8
|
-
export interface PoEventSourcingItem {
|
|
9
|
-
/** Valor numérico correspondente ao horário da data em que o registro foi criado de acordo com o horário universal. */
|
|
10
|
-
dateTime: number;
|
|
11
|
-
/** Identificador do registro. */
|
|
12
|
-
id: number;
|
|
13
|
-
/** Identificador customizado do registro. */
|
|
14
|
-
customRequestId?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Especifica a operação que deverá ser realizada na API.
|
|
17
|
-
*/
|
|
18
|
-
operation: PoEventSourcingOperation;
|
|
19
|
-
/** Objeto *json* com os dados do registro.
|
|
20
|
-
*
|
|
21
|
-
* > Caso a operação seja do tipo HTTP, o registro deverá ter a assinatura da interface `PoHttpOperationData`.
|
|
22
|
-
*/
|
|
23
|
-
record: any | PoHttpRequestData;
|
|
24
|
-
/** Nome do *schema* à qual se refere o `EventSourcing`. */
|
|
25
|
-
schema?: string;
|
|
26
|
-
}
|
|
1
|
+
import { PoEventSourcingOperation } from './../enums/po-event-sourcing-operation.enum';
|
|
2
|
+
import { PoHttpRequestData } from '../../po-http-client/interfaces/po-http-request-data.interface';
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
*
|
|
6
|
+
* Classe que irá mapear as informações dos `EventSourcing` gerados pela aplicação.
|
|
7
|
+
*/
|
|
8
|
+
export interface PoEventSourcingItem {
|
|
9
|
+
/** Valor numérico correspondente ao horário da data em que o registro foi criado de acordo com o horário universal. */
|
|
10
|
+
dateTime: number;
|
|
11
|
+
/** Identificador do registro. */
|
|
12
|
+
id: number;
|
|
13
|
+
/** Identificador customizado do registro. */
|
|
14
|
+
customRequestId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Especifica a operação que deverá ser realizada na API.
|
|
17
|
+
*/
|
|
18
|
+
operation: PoEventSourcingOperation;
|
|
19
|
+
/** Objeto *json* com os dados do registro.
|
|
20
|
+
*
|
|
21
|
+
* > Caso a operação seja do tipo HTTP, o registro deverá ter a assinatura da interface `PoHttpOperationData`.
|
|
22
|
+
*/
|
|
23
|
+
record: any | PoHttpRequestData;
|
|
24
|
+
/** Nome do *schema* à qual se refere o `EventSourcing`. */
|
|
25
|
+
schema?: string;
|
|
26
|
+
}
|
package/lib/services/po-event-sourcing/interfaces/po-event-sourcing-summary-item.interface.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { PoEventSourcingOperation } from '../enums/po-event-sourcing-operation.enum';
|
|
2
|
-
/**
|
|
3
|
-
* @docsPrivate
|
|
4
|
-
*
|
|
5
|
-
* @description
|
|
6
|
-
*
|
|
7
|
-
* Define as informações de um evento para um determinado registro.
|
|
8
|
-
*/
|
|
9
|
-
export interface PoEventSourcingSummaryItem {
|
|
10
|
-
/** Identificador customizado do registro. */
|
|
11
|
-
customRequestId: string;
|
|
12
|
-
/** Especifica a operação que deverá ser realizada na API. */
|
|
13
|
-
operation: PoEventSourcingOperation;
|
|
14
|
-
/** Objeto *json* com os dados do registro. */
|
|
15
|
-
record: object;
|
|
16
|
-
}
|
|
1
|
+
import { PoEventSourcingOperation } from '../enums/po-event-sourcing-operation.enum';
|
|
2
|
+
/**
|
|
3
|
+
* @docsPrivate
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
*
|
|
7
|
+
* Define as informações de um evento para um determinado registro.
|
|
8
|
+
*/
|
|
9
|
+
export interface PoEventSourcingSummaryItem {
|
|
10
|
+
/** Identificador customizado do registro. */
|
|
11
|
+
customRequestId: string;
|
|
12
|
+
/** Especifica a operação que deverá ser realizada na API. */
|
|
13
|
+
operation: PoEventSourcingOperation;
|
|
14
|
+
/** Objeto *json* com os dados do registro. */
|
|
15
|
+
record: object;
|
|
16
|
+
}
|
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { PoStorageService } from '@po-ui/ng-storage';
|
|
3
|
-
import { PoEventSourcingSummaryItem } from './interfaces/po-event-sourcing-summary-item.interface';
|
|
4
|
-
import { PoHttpClientService } from './../po-http-client/po-http-client.service';
|
|
5
|
-
import { PoHttpRequestData } from '../po-http-client/interfaces/po-http-request-data.interface';
|
|
6
|
-
import { PoSchemaDefinitionService } from './../po-schema/po-schema-definition/po-schema-definition.service';
|
|
7
|
-
import { PoSchemaService } from './../po-schema/po-schema.service';
|
|
8
|
-
import { PoSyncConfig } from '../po-sync/interfaces/po-sync-config.interface';
|
|
9
|
-
import { PoSyncResponse } from '../po-sync/interfaces/po-sync-response.interface';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private
|
|
46
|
-
private
|
|
47
|
-
private
|
|
48
|
-
private
|
|
49
|
-
private
|
|
50
|
-
private
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
private
|
|
54
|
-
private
|
|
55
|
-
private
|
|
56
|
-
private
|
|
57
|
-
private
|
|
58
|
-
private
|
|
59
|
-
private
|
|
60
|
-
private
|
|
61
|
-
private
|
|
62
|
-
private
|
|
63
|
-
private
|
|
64
|
-
private
|
|
65
|
-
private
|
|
66
|
-
private
|
|
67
|
-
private
|
|
68
|
-
private
|
|
69
|
-
private
|
|
70
|
-
private
|
|
71
|
-
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { PoStorageService } from '@po-ui/ng-storage';
|
|
3
|
+
import { PoEventSourcingSummaryItem } from './interfaces/po-event-sourcing-summary-item.interface';
|
|
4
|
+
import { PoHttpClientService } from './../po-http-client/po-http-client.service';
|
|
5
|
+
import { PoHttpRequestData } from '../po-http-client/interfaces/po-http-request-data.interface';
|
|
6
|
+
import { PoSchemaDefinitionService } from './../po-schema/po-schema-definition/po-schema-definition.service';
|
|
7
|
+
import { PoSchemaService } from './../po-schema/po-schema.service';
|
|
8
|
+
import { PoSyncConfig } from '../po-sync/interfaces/po-sync-config.interface';
|
|
9
|
+
import { PoSyncResponse } from '../po-sync/interfaces/po-sync-response.interface';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export declare class PoEventSourcingService {
|
|
12
|
+
private poSchemaDefinition;
|
|
13
|
+
private poSchemaService;
|
|
14
|
+
private poStorage;
|
|
15
|
+
private poHttpClient;
|
|
16
|
+
static readonly event_sourcing_name: string;
|
|
17
|
+
private static readonly VALID_HTTP_STATUS_CODES;
|
|
18
|
+
config: PoSyncConfig;
|
|
19
|
+
stoppedQueueEventSourcing: boolean;
|
|
20
|
+
private emitter;
|
|
21
|
+
private eventSub;
|
|
22
|
+
private responseSubject;
|
|
23
|
+
private schemasSyncConfig;
|
|
24
|
+
constructor(poSchemaDefinition: PoSchemaDefinitionService, poSchemaService: PoSchemaService, poStorage: PoStorageService, poHttpClient: PoHttpClientService);
|
|
25
|
+
private static getUrl;
|
|
26
|
+
create(schemaName: string, newItem: any, customRequestId?: string): Promise<any>;
|
|
27
|
+
createBatchEvents(schemaName: string, eventList: Array<PoEventSourcingSummaryItem>): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Destrói a chave do *storage* que contém a fila de dados que estão esperando para serem enviados ao
|
|
30
|
+
* servidor *(EventSourcing)*.
|
|
31
|
+
*
|
|
32
|
+
* @returns {Promise<void>} Promessa que é resolvida quando a chave referente a fila de *EventSourcing* for destruída.
|
|
33
|
+
*/
|
|
34
|
+
destroyEventSourcingQueue(): Promise<void>;
|
|
35
|
+
httpCommand(httpOperationData: PoHttpRequestData, customRequestId?: string): Promise<number>;
|
|
36
|
+
responsesSubject(): Observable<PoSyncResponse>;
|
|
37
|
+
onSaveData(): Observable<null>;
|
|
38
|
+
remove(schemaName: string, itemToDelete: any, customRequestId?: string): Promise<any>;
|
|
39
|
+
removeEventSourcingItem(idEventSourcingItem: any): Promise<any>;
|
|
40
|
+
syncGet(): Promise<any>;
|
|
41
|
+
syncSend(): Promise<any>;
|
|
42
|
+
update(schemaName: string, itemUpdated: any, customRequestId?: string): Promise<any>;
|
|
43
|
+
private serializeBody;
|
|
44
|
+
private buildUrlParams;
|
|
45
|
+
private checkRecordIdExists;
|
|
46
|
+
private concatPageItems;
|
|
47
|
+
private createEventSourcingItem;
|
|
48
|
+
private createEventSourcingList;
|
|
49
|
+
private createSchemaSyncConfig;
|
|
50
|
+
private deleteOperation;
|
|
51
|
+
private diffServerItems;
|
|
52
|
+
private getBodyAndDate;
|
|
53
|
+
private getServerDiffRecords;
|
|
54
|
+
private httpOperation;
|
|
55
|
+
private insertEventSourcingQueue;
|
|
56
|
+
private insertOperation;
|
|
57
|
+
private isValidStatus;
|
|
58
|
+
private notifyEventCreation;
|
|
59
|
+
private paginateSchemaData;
|
|
60
|
+
private removeEventSourcingValidItem;
|
|
61
|
+
private selectOperation;
|
|
62
|
+
private sendResponseSubject;
|
|
63
|
+
private sendServerItem;
|
|
64
|
+
private createPoHttpRequestData;
|
|
65
|
+
private createFormData;
|
|
66
|
+
private updateOperation;
|
|
67
|
+
private updatePendingEventSourcing;
|
|
68
|
+
private updateRecords;
|
|
69
|
+
private updateRecordByServerRecord;
|
|
70
|
+
private updateStorageBySchema;
|
|
71
|
+
private updateStorageSchemas;
|
|
72
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PoEventSourcingService, never>;
|
|
73
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PoEventSourcingService>;
|
|
74
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @docsPrivate
|
|
3
|
-
*
|
|
4
|
-
* @usedBy PoHttpClientService
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
*
|
|
8
|
-
* Define o cabeçalho da requisição HTTP.
|
|
9
|
-
*/
|
|
10
|
-
export interface PoHttpHeaderOption {
|
|
11
|
-
/** Nome do cabeçalho. */
|
|
12
|
-
name: string;
|
|
13
|
-
/** Valor do cabeçalho. */
|
|
14
|
-
value: string;
|
|
15
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @docsPrivate
|
|
3
|
+
*
|
|
4
|
+
* @usedBy PoHttpClientService
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
*
|
|
8
|
+
* Define o cabeçalho da requisição HTTP.
|
|
9
|
+
*/
|
|
10
|
+
export interface PoHttpHeaderOption {
|
|
11
|
+
/** Nome do cabeçalho. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Valor do cabeçalho. */
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { PoHttpHeaderOption } from './po-http-header-option.interface';
|
|
2
|
-
import { PoHttpRequestType } from './../po-http-request-type.enum';
|
|
3
|
-
/**
|
|
4
|
-
* @usedBy PoSyncService
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
*
|
|
8
|
-
* Interface para definição de uma requisição HTTP.
|
|
9
|
-
*/
|
|
10
|
-
export interface PoHttpRequestData {
|
|
11
|
-
/** URL que será utilizada na requisição. */
|
|
12
|
-
url: string;
|
|
13
|
-
/** Cabeçalho da requisição. */
|
|
14
|
-
headers?: Array<PoHttpHeaderOption>;
|
|
15
|
-
/** Método HTTP que será utilizado. */
|
|
16
|
-
method: PoHttpRequestType;
|
|
17
|
-
/** Corpo da requisição. */
|
|
18
|
-
body?: any;
|
|
19
|
-
/** Nome da propriedade que conterá o arquivo enviado para o servidor */
|
|
20
|
-
formField?: string;
|
|
21
|
-
bodyType?: string;
|
|
22
|
-
mimeType?: string;
|
|
23
|
-
fileName?: string;
|
|
24
|
-
}
|
|
1
|
+
import { PoHttpHeaderOption } from './po-http-header-option.interface';
|
|
2
|
+
import { PoHttpRequestType } from './../po-http-request-type.enum';
|
|
3
|
+
/**
|
|
4
|
+
* @usedBy PoSyncService
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
*
|
|
8
|
+
* Interface para definição de uma requisição HTTP.
|
|
9
|
+
*/
|
|
10
|
+
export interface PoHttpRequestData {
|
|
11
|
+
/** URL que será utilizada na requisição. */
|
|
12
|
+
url: string;
|
|
13
|
+
/** Cabeçalho da requisição. */
|
|
14
|
+
headers?: Array<PoHttpHeaderOption>;
|
|
15
|
+
/** Método HTTP que será utilizado. */
|
|
16
|
+
method: PoHttpRequestType;
|
|
17
|
+
/** Corpo da requisição. */
|
|
18
|
+
body?: any;
|
|
19
|
+
/** Nome da propriedade que conterá o arquivo enviado para o servidor */
|
|
20
|
+
formField?: string;
|
|
21
|
+
bodyType?: string;
|
|
22
|
+
mimeType?: string;
|
|
23
|
+
fileName?: string;
|
|
24
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @usedBy PoQueryBuilder
|
|
3
|
-
*
|
|
4
|
-
* @description
|
|
5
|
-
*
|
|
6
|
-
* Interface que representa a estrutura de resposta de uma coleção de itens.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export interface PoResponseApi {
|
|
10
|
-
/** Lista de itens retornados. */
|
|
11
|
-
items: Array<object>;
|
|
12
|
-
/** Indica se existe uma próxima página com mais registros para aquela coleção de itens. */
|
|
13
|
-
hasNext: boolean;
|
|
14
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @usedBy PoQueryBuilder
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
*
|
|
6
|
+
* Interface que representa a estrutura de resposta de uma coleção de itens.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export interface PoResponseApi {
|
|
10
|
+
/** Lista de itens retornados. */
|
|
11
|
+
items: Array<object>;
|
|
12
|
+
/** Indica se existe uma próxima página com mais registros para aquela coleção de itens. */
|
|
13
|
+
hasNext: boolean;
|
|
14
|
+
}
|
|
@@ -1,75 +1,78 @@
|
|
|
1
|
-
import { HttpClient, HttpResponse } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { PoHttpHeaderOption } from './interfaces/po-http-header-option.interface';
|
|
4
|
-
import { PoHttpRequestData } from './interfaces/po-http-request-data.interface';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @param {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @param {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @param {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @param {
|
|
55
|
-
* @param {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* @param {
|
|
63
|
-
* @param {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @param {
|
|
71
|
-
* @param {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
import { HttpClient, HttpResponse } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { PoHttpHeaderOption } from './interfaces/po-http-header-option.interface';
|
|
4
|
+
import { PoHttpRequestData } from './interfaces/po-http-request-data.interface';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* @docsPrivate
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
*
|
|
11
|
+
* Serviço para execução de requisições HTTP.
|
|
12
|
+
*/
|
|
13
|
+
export declare class PoHttpClientService {
|
|
14
|
+
private httpClient;
|
|
15
|
+
constructor(httpClient: HttpClient);
|
|
16
|
+
/**
|
|
17
|
+
* Constrói uma requisição HTTP personalizada.
|
|
18
|
+
*
|
|
19
|
+
* @param {PoHttpRequestData} poHttpOperationData Parâmetros para a construção
|
|
20
|
+
* da requisição.
|
|
21
|
+
*/
|
|
22
|
+
createRequest(poHttpOperationData: PoHttpRequestData): Observable<HttpResponse<Object>>;
|
|
23
|
+
/**
|
|
24
|
+
* Constrói uma requisição com o método `delete`.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} url URL da requisição.
|
|
27
|
+
* @param {Array<PoHeaderOption>} httpHeaders Cabeçalhos da requisição.
|
|
28
|
+
*/
|
|
29
|
+
delete(url: string, httpHeaders?: Array<PoHttpHeaderOption>): Observable<HttpResponse<Object>>;
|
|
30
|
+
/**
|
|
31
|
+
* Constrói uma requisição com o método `get`.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} url URL da requisição.
|
|
34
|
+
* @param {Array<PoHeaderOption>} httpHeaders Cabeçalhos da requisição.
|
|
35
|
+
*/
|
|
36
|
+
get(url: string, httpHeaders?: Array<PoHttpHeaderOption>): Observable<HttpResponse<Object>>;
|
|
37
|
+
/**
|
|
38
|
+
* Constrói uma requisição com o método `head`.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} url URL da requisição.
|
|
41
|
+
* @param {Array<PoHeaderOption>} httpHeaders Cabeçalhos da requisição.
|
|
42
|
+
*/
|
|
43
|
+
head(url: string, httpHeaders?: Array<PoHttpHeaderOption>): Observable<HttpResponse<Object>>;
|
|
44
|
+
/**
|
|
45
|
+
* Constrói uma requisição com o método `options`.
|
|
46
|
+
*
|
|
47
|
+
* @param {string} url URL da requisição.
|
|
48
|
+
* @param {Array<PoHeaderOption>} httpHeaders Cabeçalhos da requisição.
|
|
49
|
+
*/
|
|
50
|
+
options(url: string, httpHeaders?: Array<PoHttpHeaderOption>): Observable<HttpResponse<Object>>;
|
|
51
|
+
/**
|
|
52
|
+
* Constrói uma requisição com o método `patch`.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} url URL da requisição.
|
|
55
|
+
* @param {any} body Corpo da requisição.
|
|
56
|
+
* @param {Array<PoHeaderOption>} httpHeaders Cabeçalhos da requisição.
|
|
57
|
+
*/
|
|
58
|
+
patch(url: string, body?: any, httpHeaders?: Array<PoHttpHeaderOption>): Observable<HttpResponse<Object>>;
|
|
59
|
+
/**
|
|
60
|
+
* Constrói uma requisição com o método `post`.
|
|
61
|
+
*
|
|
62
|
+
* @param {string} url URL da requisição.
|
|
63
|
+
* @param {any} body Corpo da requisição.
|
|
64
|
+
* @param {Array<PoHeaderOption>} httpHeaders Cabeçalhos da requisição.
|
|
65
|
+
*/
|
|
66
|
+
post(url: string, body?: any, httpHeaders?: Array<PoHttpHeaderOption>): Observable<HttpResponse<Object>>;
|
|
67
|
+
/**
|
|
68
|
+
* Constrói uma requisição com o método `put`.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} url URL da requisição.
|
|
71
|
+
* @param {any} body Corpo da requisição.
|
|
72
|
+
* @param {Array<PoHeaderOption>} httpHeaders Cabeçalhos da requisição.
|
|
73
|
+
*/
|
|
74
|
+
put(url: string, body?: any, httpHeaders?: Array<PoHttpHeaderOption>): Observable<HttpResponse<Object>>;
|
|
75
|
+
private createHttpHeaders;
|
|
76
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PoHttpClientService, never>;
|
|
77
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PoHttpClientService>;
|
|
78
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @usedBy PoHttpClientService, PoHttpCommandResponse, PoSyncService
|
|
3
|
-
*
|
|
4
|
-
* @description
|
|
5
|
-
*
|
|
6
|
-
* Define o método de requisição HTTP.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum PoHttpRequestType {
|
|
9
|
-
/** Método `delete` do protocolo HTTP. */
|
|
10
|
-
DELETE = "DELETE",
|
|
11
|
-
/** Método `get` do protocolo HTTP. */
|
|
12
|
-
GET = "GET",
|
|
13
|
-
/** Método `head` do protocolo HTTP. */
|
|
14
|
-
HEAD = "HEAD",
|
|
15
|
-
/** Método `options` do protocolo HTTP. */
|
|
16
|
-
OPTIONS = "OPTIONS",
|
|
17
|
-
/** Método `patch` do protocolo HTTP. */
|
|
18
|
-
PATCH = "PATCH",
|
|
19
|
-
/** Método `post` do protocolo HTTP. */
|
|
20
|
-
POST = "POST",
|
|
21
|
-
/** Método `put` do protocolo HTTP. */
|
|
22
|
-
PUT = "PUT"
|
|
23
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @usedBy PoHttpClientService, PoHttpCommandResponse, PoSyncService
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
*
|
|
6
|
+
* Define o método de requisição HTTP.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum PoHttpRequestType {
|
|
9
|
+
/** Método `delete` do protocolo HTTP. */
|
|
10
|
+
DELETE = "DELETE",
|
|
11
|
+
/** Método `get` do protocolo HTTP. */
|
|
12
|
+
GET = "GET",
|
|
13
|
+
/** Método `head` do protocolo HTTP. */
|
|
14
|
+
HEAD = "HEAD",
|
|
15
|
+
/** Método `options` do protocolo HTTP. */
|
|
16
|
+
OPTIONS = "OPTIONS",
|
|
17
|
+
/** Método `patch` do protocolo HTTP. */
|
|
18
|
+
PATCH = "PATCH",
|
|
19
|
+
/** Método `post` do protocolo HTTP. */
|
|
20
|
+
POST = "POST",
|
|
21
|
+
/** Método `put` do protocolo HTTP. */
|
|
22
|
+
PUT = "PUT"
|
|
23
|
+
}
|