@shieldiot/pulse-lib 1.0.5 → 1.0.7
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/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/common/SeverityIntervalTuple.d.ts +1 -1
- package/dist/lib/common/TimeSeriesOfFloat.d.ts +1 -1
- package/dist/lib/common/TokenData.d.ts +1 -1
- package/dist/lib/entities/Account.d.ts +1 -1
- package/dist/lib/entities/Account.js.map +1 -1
- package/dist/lib/entities/AccountDTO.d.ts +3 -3
- package/dist/lib/entities/AccountDTO.js.map +1 -1
- package/dist/lib/entities/AccountSettings.d.ts +1 -1
- package/dist/lib/entities/Alert.d.ts +4 -4
- package/dist/lib/entities/Alert.js.map +1 -1
- package/dist/lib/entities/AlertWithDevice.d.ts +4 -4
- package/dist/lib/entities/AlertWithDevice.js.map +1 -1
- package/dist/lib/entities/ApiKey.d.ts +1 -1
- package/dist/lib/entities/ApiKey.js.map +1 -1
- package/dist/lib/entities/DeviceWithEvents.d.ts +2 -2
- package/dist/lib/entities/DeviceWithEvents.js.map +1 -1
- package/dist/lib/entities/Event.d.ts +3 -3
- package/dist/lib/entities/Event.js.map +1 -1
- package/dist/lib/entities/EventWithDevice.d.ts +7 -7
- package/dist/lib/entities/EventWithDevice.js.map +1 -1
- package/dist/lib/entities/Feature.d.ts +1 -1
- package/dist/lib/entities/Feature.js.map +1 -1
- package/dist/lib/entities/Insight.d.ts +1 -1
- package/dist/lib/entities/Insight.js.map +1 -1
- package/dist/lib/entities/Integration.d.ts +2 -2
- package/dist/lib/entities/Integration.js.map +1 -1
- package/dist/lib/entities/Rule.d.ts +1 -1
- package/dist/lib/entities/Rule.js.map +1 -1
- package/dist/lib/entities/RuleTemplate.d.ts +1 -1
- package/dist/lib/entities/RuleTemplate.js.map +1 -1
- package/dist/lib/entities/StreamAnalyticsConfig.d.ts +2 -2
- package/dist/lib/entities/StreamAnalyticsConfig.js.map +1 -1
- package/dist/lib/entities/StreamConfig.d.ts +2 -2
- package/dist/lib/services/sysAccountsService.d.ts +2 -2
- package/dist/lib/services/sysFeaturesService.d.ts +1 -1
- package/dist/lib/services/sysRulesService.d.ts +1 -1
- package/dist/lib/services/sysUsersService.d.ts +2 -2
- package/dist/lib/services/usrAlertsService.d.ts +9 -9
- package/dist/lib/services/usrDevicesService.d.ts +7 -7
- package/dist/lib/services/usrEventsService.d.ts +8 -8
- package/dist/lib/services/usrRulesService.d.ts +1 -1
- package/dist/lib/services/usrUserService.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -3
- package/dist/public-api.d.ts +0 -3
- package/dist/public-api.js +0 -7
- package/dist/public-api.js.map +0 -1
- package/src/config.d.ts +0 -6
- package/src/config.d.ts.map +0 -1
- package/src/config.js +0 -6
- package/src/config.js.map +0 -1
- package/src/index.d.ts +0 -3
- package/src/index.d.ts.map +0 -1
- package/src/index.js +0 -3
- package/src/index.js.map +0 -1
- package/src/lib/common/AccountRole.ts +0 -25
- package/src/lib/common/ConsumptionData.ts +0 -24
- package/src/lib/common/ConsumptionTimeDataPoint.ts +0 -21
- package/src/lib/common/DeviceConfig.ts +0 -22
- package/src/lib/common/DeviceScoreConfig.ts +0 -24
- package/src/lib/common/DevicesAtRiskConfig.ts +0 -16
- package/src/lib/common/EventSeverityConfig.ts +0 -17
- package/src/lib/common/FloatKeyValue.ts +0 -20
- package/src/lib/common/GeoData.ts +0 -38
- package/src/lib/common/GraphSeries.ts +0 -21
- package/src/lib/common/Indicator.ts +0 -32
- package/src/lib/common/IntKeySeriesDataValue.ts +0 -21
- package/src/lib/common/IntKeyValue.ts +0 -20
- package/src/lib/common/Interval.ts +0 -20
- package/src/lib/common/Link.ts +0 -41
- package/src/lib/common/Location.ts +0 -20
- package/src/lib/common/LoginParams.ts +0 -24
- package/src/lib/common/MaliciousIPCard.ts +0 -45
- package/src/lib/common/MaliciousIPData.ts +0 -28
- package/src/lib/common/NetworkMap.ts +0 -22
- package/src/lib/common/Node.ts +0 -54
- package/src/lib/common/SeriesData.ts +0 -22
- package/src/lib/common/SessionTransform.ts +0 -29
- package/src/lib/common/SeverityIntervalTuple.ts +0 -22
- package/src/lib/common/ShieldexConfig.ts +0 -36
- package/src/lib/common/StringIntValue.ts +0 -20
- package/src/lib/common/StringKeyIntValue.ts +0 -20
- package/src/lib/common/StringKeyValue.ts +0 -20
- package/src/lib/common/Thresholds.ts +0 -16
- package/src/lib/common/TimeDataPoint.ts +0 -20
- package/src/lib/common/TimeDataPoint2D.ts +0 -21
- package/src/lib/common/TimeDataPointFloat.ts +0 -20
- package/src/lib/common/TimeFrame.ts +0 -20
- package/src/lib/common/TimeSeries.ts +0 -26
- package/src/lib/common/TimeSeriesOf2D.ts +0 -26
- package/src/lib/common/TimeSeriesOfDataConsumption.ts +0 -26
- package/src/lib/common/TimeSeriesOfFloat.ts +0 -26
- package/src/lib/common/TokenData.ts +0 -39
- package/src/lib/common/Tuple.ts +0 -20
- package/src/lib/common/UsageTransform.ts +0 -37
- package/src/lib/common/ZScore.ts +0 -20
- package/src/lib/common/index.ts +0 -41
- package/src/lib/entities/Account.ts +0 -45
- package/src/lib/entities/AccountDTO.ts +0 -49
- package/src/lib/entities/AccountSettings.ts +0 -31
- package/src/lib/entities/Action.ts +0 -30
- package/src/lib/entities/Alert.ts +0 -91
- package/src/lib/entities/AlertWithDevice.ts +0 -92
- package/src/lib/entities/ApiKey.ts +0 -33
- package/src/lib/entities/AuditLog.ts +0 -39
- package/src/lib/entities/BaseEntity.ts +0 -24
- package/src/lib/entities/BulkDevices.ts +0 -17
- package/src/lib/entities/Checkpoint.ts +0 -71
- package/src/lib/entities/ComplianceReportSettings.ts +0 -28
- package/src/lib/entities/Condition.ts +0 -28
- package/src/lib/entities/ConfigParam.ts +0 -15
- package/src/lib/entities/DNSRecord.ts +0 -40
- package/src/lib/entities/DataIngestion.ts +0 -63
- package/src/lib/entities/DataPointOfDeviceReport.ts +0 -21
- package/src/lib/entities/Device.ts +0 -82
- package/src/lib/entities/DeviceReport.ts +0 -29
- package/src/lib/entities/DeviceWithEvents.ts +0 -86
- package/src/lib/entities/Distribution.ts +0 -25
- package/src/lib/entities/Event.ts +0 -98
- package/src/lib/entities/EventOccurrence.ts +0 -34
- package/src/lib/entities/EventWithDevice.ts +0 -97
- package/src/lib/entities/Feature.ts +0 -18
- package/src/lib/entities/FeaturesGroup.ts +0 -18
- package/src/lib/entities/Group.ts +0 -24
- package/src/lib/entities/Image.ts +0 -18
- package/src/lib/entities/Insight.ts +0 -49
- package/src/lib/entities/InsightQuery.ts +0 -29
- package/src/lib/entities/InsightSpec.ts +0 -28
- package/src/lib/entities/IntDistribution.ts +0 -25
- package/src/lib/entities/Integration.ts +0 -81
- package/src/lib/entities/Member.ts +0 -22
- package/src/lib/entities/Radius.ts +0 -45
- package/src/lib/entities/Report.ts +0 -37
- package/src/lib/entities/Rule.ts +0 -65
- package/src/lib/entities/RuleTemplate.ts +0 -38
- package/src/lib/entities/SIM.ts +0 -32
- package/src/lib/entities/ServiceStatus.ts +0 -26
- package/src/lib/entities/SessionRecord.ts +0 -71
- package/src/lib/entities/Shieldex.ts +0 -23
- package/src/lib/entities/Stream.ts +0 -31
- package/src/lib/entities/StreamAnalyticsConfig.ts +0 -30
- package/src/lib/entities/StreamConfig.ts +0 -52
- package/src/lib/entities/TeaserPopUpSettings.ts +0 -24
- package/src/lib/entities/TimeSeriesOfDeviceReport.ts +0 -26
- package/src/lib/entities/UsageRecord.ts +0 -101
- package/src/lib/entities/User.ts +0 -45
- package/src/lib/entities/UserMembership.ts +0 -38
- package/src/lib/entities/UserMemberships.ts +0 -38
- package/src/lib/entities/index.ts +0 -51
- package/src/lib/enums/AccountStatusCode.ts +0 -35
- package/src/lib/enums/AccountTypeCode.ts +0 -40
- package/src/lib/enums/DataSourceCode.ts +0 -35
- package/src/lib/enums/DeviceActionCode.ts +0 -40
- package/src/lib/enums/DeviceCreationCode.ts +0 -40
- package/src/lib/enums/DeviceIdentityCode.ts +0 -55
- package/src/lib/enums/DeviceStatusCode.ts +0 -40
- package/src/lib/enums/DeviceTypeCode.ts +0 -90
- package/src/lib/enums/DirectionContextCode.ts +0 -40
- package/src/lib/enums/EventCategoryCode.ts +0 -30
- package/src/lib/enums/EventStatusCode.ts +0 -40
- package/src/lib/enums/EventTypeCode.ts +0 -115
- package/src/lib/enums/FeatureCode.ts +0 -70
- package/src/lib/enums/HomePageViewCode.ts +0 -35
- package/src/lib/enums/HttpMethodCode.ts +0 -45
- package/src/lib/enums/InsightStatusCode.ts +0 -35
- package/src/lib/enums/InsightTypeCode.ts +0 -30
- package/src/lib/enums/IntegrationTriggerCode.ts +0 -30
- package/src/lib/enums/IntegrationTypeCode.ts +0 -40
- package/src/lib/enums/MemberRoleCode.ts +0 -40
- package/src/lib/enums/NetworkMapTypeCode.ts +0 -35
- package/src/lib/enums/OperatorCode.ts +0 -75
- package/src/lib/enums/PermissionCode.ts +0 -45
- package/src/lib/enums/ReportTypeCode.ts +0 -35
- package/src/lib/enums/RuleTypeCode.ts +0 -35
- package/src/lib/enums/SeverityTypeCode.ts +0 -40
- package/src/lib/enums/TrafficDirectionCode.ts +0 -35
- package/src/lib/enums/UserStatusCode.ts +0 -40
- package/src/lib/enums/UserTypeCode.ts +0 -40
- package/src/lib/enums/index.ts +0 -29
- package/src/lib/index.ts +0 -4
- package/src/lib/pulse-client.ts +0 -190
- package/src/lib/services/index.ts +0 -26
- package/src/lib/services/services.export.ts +0 -54
- package/src/lib/services/supportStreamAnalyticsConfig.ts +0 -63
- package/src/lib/services/sysAccountsService.ts +0 -90
- package/src/lib/services/sysAuditLogService.ts +0 -72
- package/src/lib/services/sysCheckpointsService.ts +0 -62
- package/src/lib/services/sysConfigService.ts +0 -63
- package/src/lib/services/sysFeaturesService.ts +0 -77
- package/src/lib/services/sysGroupsService.ts +0 -85
- package/src/lib/services/sysInsightsService.ts +0 -122
- package/src/lib/services/sysKeysService.ts +0 -71
- package/src/lib/services/sysMembersService.ts +0 -66
- package/src/lib/services/sysRuleTemplatesService.ts +0 -63
- package/src/lib/services/sysRulesService.ts +0 -79
- package/src/lib/services/sysStatisticsService.ts +0 -50
- package/src/lib/services/sysStreamsService.ts +0 -64
- package/src/lib/services/sysUsersService.ts +0 -89
- package/src/lib/services/usrAlertsService.ts +0 -382
- package/src/lib/services/usrDevicesService.ts +0 -303
- package/src/lib/services/usrEventsService.ts +0 -355
- package/src/lib/services/usrInsightsService.ts +0 -29
- package/src/lib/services/usrIntegrationsService.ts +0 -79
- package/src/lib/services/usrMembersService.ts +0 -77
- package/src/lib/services/usrNetworkService.ts +0 -59
- package/src/lib/services/usrReportsService.ts +0 -114
- package/src/lib/services/usrRulesService.ts +0 -78
- package/src/lib/services/usrUserService.ts +0 -114
- package/src/public-api.d.ts +0 -4
- package/src/public-api.d.ts.map +0 -1
- package/src/public-api.js +0 -7
- package/src/public-api.js.map +0 -1
- package/src/public-api.ts +0 -9
- package/src/utils/ActionResponse.d.ts +0 -6
- package/src/utils/ActionResponse.d.ts.map +0 -1
- package/src/utils/ActionResponse.js +0 -9
- package/src/utils/ActionResponse.js.map +0 -1
- package/src/utils/BaseRestResponse.d.ts +0 -5
- package/src/utils/BaseRestResponse.d.ts.map +0 -1
- package/src/utils/BaseRestResponse.js +0 -8
- package/src/utils/BaseRestResponse.js.map +0 -1
- package/src/utils/EntitiesResponse.d.ts +0 -9
- package/src/utils/EntitiesResponse.d.ts.map +0 -1
- package/src/utils/EntitiesResponse.js +0 -15
- package/src/utils/EntitiesResponse.js.map +0 -1
- package/src/utils/EntityResponse.d.ts +0 -9
- package/src/utils/EntityResponse.d.ts.map +0 -1
- package/src/utils/EntityResponse.js +0 -15
- package/src/utils/EntityResponse.js.map +0 -1
- package/src/utils/index.d.ts +0 -6
- package/src/utils/index.d.ts.map +0 -1
- package/src/utils/index.js +0 -6
- package/src/utils/index.js.map +0 -1
- package/src/utils/rest-axios-setup.d.ts +0 -4
- package/src/utils/rest-axios-setup.d.ts.map +0 -1
- package/src/utils/rest-axios-setup.js +0 -8
- package/src/utils/rest-axios-setup.js.map +0 -1
- package/src/utils/rest-util.d.ts +0 -16
- package/src/utils/rest-util.d.ts.map +0 -1
- package/src/utils/rest-util.js +0 -101
- package/src/utils/rest-util.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { AuditLog } from '../entities';
|
|
5
|
-
import { TimeSeriesOfFloat } from '../common';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// List of audit log queries for system administrator only
|
|
10
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
11
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
12
|
-
export class SysAuditLogService {
|
|
13
|
-
|
|
14
|
-
// URL to web api
|
|
15
|
-
private baseUrl = '/sys/audit-log';
|
|
16
|
-
|
|
17
|
-
// Class constructor
|
|
18
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
19
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Get single log entry by id
|
|
25
|
-
*/
|
|
26
|
-
get(id?: string) {
|
|
27
|
-
return this.rest.get<EntityResponse<AuditLog>>(`${this.baseUrl}/${id}`);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Find list of log entries by query
|
|
32
|
-
*/
|
|
33
|
-
find(from?: number, to?: number, accountId?: string, userId?: string, action?: string, itemType?: string, itemId?: string, itemName?: string, search?: string, sort?: string, page?: number, size?: number) {
|
|
34
|
-
const params = [];
|
|
35
|
-
if (from != null) { params.push(`from=${from}`); }
|
|
36
|
-
if (to != null) { params.push(`to=${to}`); }
|
|
37
|
-
if (accountId != null) { params.push(`accountId=${accountId}`); }
|
|
38
|
-
if (userId != null) { params.push(`userId=${userId}`); }
|
|
39
|
-
if (action != null) { params.push(`action=${action}`); }
|
|
40
|
-
if (itemType != null) { params.push(`itemType=${itemType}`); }
|
|
41
|
-
if (itemId != null) { params.push(`itemId=${itemId}`); }
|
|
42
|
-
if (itemName != null) { params.push(`itemName=${itemName}`); }
|
|
43
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
44
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
45
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
46
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
47
|
-
|
|
48
|
-
return this.rest.get<EntitiesResponse<AuditLog>>(`${this.baseUrl}`, ...params);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Get histogram of audit log entries over time
|
|
53
|
-
*/
|
|
54
|
-
getTimeline(from?: number, to?: number, accountId?: string, userId?: string, action?: string, itemType?: string, itemId?: string, itemName?: string, search?: string, sort?: string, page?: number, size?: number) {
|
|
55
|
-
const params = [];
|
|
56
|
-
if (from != null) { params.push(`from=${from}`); }
|
|
57
|
-
if (to != null) { params.push(`to=${to}`); }
|
|
58
|
-
if (accountId != null) { params.push(`accountId=${accountId}`); }
|
|
59
|
-
if (userId != null) { params.push(`userId=${userId}`); }
|
|
60
|
-
if (action != null) { params.push(`action=${action}`); }
|
|
61
|
-
if (itemType != null) { params.push(`itemType=${itemType}`); }
|
|
62
|
-
if (itemId != null) { params.push(`itemId=${itemId}`); }
|
|
63
|
-
if (itemName != null) { params.push(`itemName=${itemName}`); }
|
|
64
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
65
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
66
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
67
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
68
|
-
|
|
69
|
-
return this.rest.get<EntityResponse<TimeSeriesOfFloat>>(`${this.baseUrl}/timeline`, ...params);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { Checkpoint } from '../entities';
|
|
5
|
-
import { TimeSeriesOfFloat } from '../common';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// List of checkpoints queries for system administrator only
|
|
10
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
11
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
12
|
-
export class SysCheckpointsService {
|
|
13
|
-
|
|
14
|
-
// URL to web api
|
|
15
|
-
private baseUrl = '/sys/checkpoints';
|
|
16
|
-
|
|
17
|
-
// Class constructor
|
|
18
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
19
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Get a single checkpoint entry by id
|
|
25
|
-
*/
|
|
26
|
-
get(id?: string) {
|
|
27
|
-
return this.rest.get<EntityResponse<Checkpoint>>(`${this.baseUrl}/${id}`);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Find a list of checkpoint entries by query
|
|
32
|
-
*/
|
|
33
|
-
find(from?: number, to?: number, accountId?: string, streamId?: string, search?: string, sort?: string, page?: number, size?: number) {
|
|
34
|
-
const params = [];
|
|
35
|
-
if (from != null) { params.push(`from=${from}`); }
|
|
36
|
-
if (to != null) { params.push(`to=${to}`); }
|
|
37
|
-
if (accountId != null) { params.push(`accountId=${accountId}`); }
|
|
38
|
-
if (streamId != null) { params.push(`streamId=${streamId}`); }
|
|
39
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
40
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
41
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
42
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
43
|
-
|
|
44
|
-
return this.rest.get<EntitiesResponse<Checkpoint>>(`${this.baseUrl}`, ...params);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Get histogram of checkpoints over time
|
|
49
|
-
*/
|
|
50
|
-
checkpointsTimeline(from?: number, to?: number, accountId?: string, streamId?: string, field?: string, timeField?: string) {
|
|
51
|
-
const params = [];
|
|
52
|
-
if (from != null) { params.push(`from=${from}`); }
|
|
53
|
-
if (to != null) { params.push(`to=${to}`); }
|
|
54
|
-
if (accountId != null) { params.push(`accountId=${accountId}`); }
|
|
55
|
-
if (streamId != null) { params.push(`streamId=${streamId}`); }
|
|
56
|
-
if (field != null) { params.push(`field=${field}`); }
|
|
57
|
-
if (timeField != null) { params.push(`timeField=${timeField}`); }
|
|
58
|
-
|
|
59
|
-
return this.rest.get<EntityResponse<TimeSeriesOfFloat>>(`${this.baseUrl}/timeline`, ...params);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { ConfigParam } from '../entities';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// List of system configuration parameters related actions for system administrator only
|
|
9
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
10
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
11
|
-
export class SysConfigService {
|
|
12
|
-
|
|
13
|
-
// URL to web api
|
|
14
|
-
private baseUrl = '/sys/config';
|
|
15
|
-
|
|
16
|
-
// Class constructor
|
|
17
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
18
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Create new configuration parameter
|
|
24
|
-
*/
|
|
25
|
-
create(body?: ConfigParam) {
|
|
26
|
-
return this.rest.put<EntityResponse<ConfigParam>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Update existing configuration parameter in the system
|
|
31
|
-
*/
|
|
32
|
-
update(body?: ConfigParam) {
|
|
33
|
-
return this.rest.patch<EntityResponse<ConfigParam>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Delete a configuration parameter from the system
|
|
38
|
-
*/
|
|
39
|
-
delete(id?: string) {
|
|
40
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get single configuration parameter by id
|
|
45
|
-
*/
|
|
46
|
-
get(id?: string) {
|
|
47
|
-
return this.rest.get<EntityResponse<ConfigParam>>(`${this.baseUrl}/${id}`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Find list of configuration parameters by query
|
|
52
|
-
*/
|
|
53
|
-
find(search?: string, sort?: string, page?: number, size?: number) {
|
|
54
|
-
const params = [];
|
|
55
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
56
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
57
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
58
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
59
|
-
|
|
60
|
-
return this.rest.get<EntitiesResponse<ConfigParam>>(`${this.baseUrl}`, ...params);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { Feature } from '../entities';
|
|
5
|
-
import { FeaturesGroup } from '../entities';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// List of features actions for system administrator only
|
|
10
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
11
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
12
|
-
export class SysFeaturesService {
|
|
13
|
-
|
|
14
|
-
// URL to web api
|
|
15
|
-
private baseUrl = '/sys/features';
|
|
16
|
-
|
|
17
|
-
// Class constructor
|
|
18
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
19
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Find list of feature
|
|
25
|
-
*/
|
|
26
|
-
findFeatures(search?: string, sort?: string, page?: number, size?: number) {
|
|
27
|
-
const params = [];
|
|
28
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
29
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
30
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
31
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
32
|
-
|
|
33
|
-
return this.rest.get<EntitiesResponse<Feature>>(`${this.baseUrl}`, ...params);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Create new features group
|
|
38
|
-
*/
|
|
39
|
-
createFeaturesGroup(body?: FeaturesGroup) {
|
|
40
|
-
return this.rest.put<EntityResponse<FeaturesGroup>>(`${this.baseUrl}/groups`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Update existing features group
|
|
45
|
-
*/
|
|
46
|
-
updateFeaturesGroup(body?: FeaturesGroup) {
|
|
47
|
-
return this.rest.patch<EntityResponse<FeaturesGroup>>(`${this.baseUrl}/groups`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Delete features group from the system
|
|
52
|
-
*/
|
|
53
|
-
deleteFeaturesGroup(id?: string) {
|
|
54
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/groups/${id}`);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Get single features group by id
|
|
59
|
-
*/
|
|
60
|
-
getFeaturesGroup(id?: string) {
|
|
61
|
-
return this.rest.get<EntityResponse<FeaturesGroup>>(`${this.baseUrl}/groups/${id}`);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Find list of features groups
|
|
66
|
-
*/
|
|
67
|
-
findFeaturesGroups(search?: string, sort?: string, page?: number, size?: number) {
|
|
68
|
-
const params = [];
|
|
69
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
70
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
71
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
72
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
73
|
-
|
|
74
|
-
return this.rest.get<EntitiesResponse<FeaturesGroup>>(`${this.baseUrl}/groups`, ...params);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { Group } from '../entities';
|
|
5
|
-
import { User } from '../entities';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// List of groups related actions for system administrator only
|
|
10
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
11
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
12
|
-
export class SysGroupsService {
|
|
13
|
-
|
|
14
|
-
// URL to web api
|
|
15
|
-
private baseUrl = '/sys/groups';
|
|
16
|
-
|
|
17
|
-
// Class constructor
|
|
18
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
19
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create new groups
|
|
25
|
-
*/
|
|
26
|
-
create(body?: Group) {
|
|
27
|
-
return this.rest.put<EntityResponse<Group>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Update existing group in the system
|
|
32
|
-
*/
|
|
33
|
-
update(body?: Group) {
|
|
34
|
-
return this.rest.patch<EntityResponse<Group>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Delete a group from the system
|
|
39
|
-
*/
|
|
40
|
-
delete(id?: string) {
|
|
41
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Get single group by id
|
|
46
|
-
*/
|
|
47
|
-
get(id?: string) {
|
|
48
|
-
return this.rest.get<EntityResponse<Group>>(`${this.baseUrl}/${id}`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Find list of groups by query
|
|
53
|
-
*/
|
|
54
|
-
find(search?: string, sort?: string, page?: number, size?: number) {
|
|
55
|
-
const params = [];
|
|
56
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
57
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
58
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
59
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
60
|
-
|
|
61
|
-
return this.rest.get<EntitiesResponse<Group>>(`${this.baseUrl}`, ...params);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Get list of all users in the group
|
|
66
|
-
*/
|
|
67
|
-
getUsers(id?: string) {
|
|
68
|
-
return this.rest.get<EntityResponse<User>>(`${this.baseUrl}/${id}/users`);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Add user to the group
|
|
73
|
-
*/
|
|
74
|
-
setDefaultAccount(id?: string, userId?: string) {
|
|
75
|
-
return this.rest.put<ActionResponse>(`${this.baseUrl}/${id}/users/${userId}`, '');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Remove user from the group
|
|
80
|
-
*/
|
|
81
|
-
getAccessToken(id?: string, userId?: string) {
|
|
82
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}/users/${userId}`);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { InsightQuery } from '../entities';
|
|
5
|
-
import { InsightSpec } from '../entities';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// List of insight queries related actions for system administrator only
|
|
10
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
11
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
12
|
-
export class SysInsightsService {
|
|
13
|
-
|
|
14
|
-
// URL to web api
|
|
15
|
-
private baseUrl = '/sys/insights';
|
|
16
|
-
|
|
17
|
-
// Class constructor
|
|
18
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
19
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create new insight query
|
|
25
|
-
*/
|
|
26
|
-
createQuery(body?: InsightQuery) {
|
|
27
|
-
return this.rest.put<EntityResponse<InsightQuery>>(`${this.baseUrl}/query`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Update existing insight query
|
|
32
|
-
*/
|
|
33
|
-
updateQuery(body?: InsightQuery) {
|
|
34
|
-
return this.rest.patch<EntityResponse<InsightQuery>>(`${this.baseUrl}/query`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Delete insight query from the system
|
|
39
|
-
*/
|
|
40
|
-
deleteQuery(id?: string) {
|
|
41
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/query/${id}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Get single insight query by id
|
|
46
|
-
*/
|
|
47
|
-
getQuery(id?: string) {
|
|
48
|
-
return this.rest.get<EntityResponse<InsightQuery>>(`${this.baseUrl}/query/${id}`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Find list of insight queries
|
|
53
|
-
*/
|
|
54
|
-
findQueries(search?: string, sort?: string, page?: number, size?: number) {
|
|
55
|
-
const params = [];
|
|
56
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
57
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
58
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
59
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
60
|
-
|
|
61
|
-
return this.rest.get<EntitiesResponse<InsightQuery>>(`${this.baseUrl}/query`, ...params);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Create new insight spec
|
|
66
|
-
*/
|
|
67
|
-
createSpec(body?: InsightSpec) {
|
|
68
|
-
return this.rest.put<EntityResponse<InsightSpec>>(`${this.baseUrl}/spec`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Update existing insight spec
|
|
73
|
-
*/
|
|
74
|
-
updateSpec(body?: InsightSpec) {
|
|
75
|
-
return this.rest.patch<EntityResponse<InsightSpec>>(`${this.baseUrl}/spec`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Delete insight spec from the system
|
|
80
|
-
*/
|
|
81
|
-
deleteSpec(id?: string) {
|
|
82
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/spec/${id}`);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Get single insight spec by id
|
|
87
|
-
*/
|
|
88
|
-
getSpec(id?: string) {
|
|
89
|
-
return this.rest.get<EntityResponse<InsightSpec>>(`${this.baseUrl}/spec/${id}`);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Find list of insight specs
|
|
94
|
-
*/
|
|
95
|
-
findSpecs(accountId?: string, streamId?: string, search?: string, sort?: string, page?: number, size?: number) {
|
|
96
|
-
const params = [];
|
|
97
|
-
if (accountId != null) { params.push(`accountId=${accountId}`); }
|
|
98
|
-
if (streamId != null) { params.push(`streamId=${streamId}`); }
|
|
99
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
100
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
101
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
102
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
103
|
-
|
|
104
|
-
return this.rest.get<EntitiesResponse<InsightSpec>>(`${this.baseUrl}/spec`, ...params);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Find list of insight specs
|
|
109
|
-
*/
|
|
110
|
-
findSpecsQueries(accountId?: string, streamId?: string, search?: string, sort?: string, page?: number, size?: number) {
|
|
111
|
-
const params = [];
|
|
112
|
-
if (accountId != null) { params.push(`accountId=${accountId}`); }
|
|
113
|
-
if (streamId != null) { params.push(`streamId=${streamId}`); }
|
|
114
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
115
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
116
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
117
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
118
|
-
|
|
119
|
-
return this.rest.get<EntitiesResponse<InsightQuery>>(`${this.baseUrl}/spec-queries`, ...params);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { ApiKey } from '../entities';
|
|
5
|
-
import { StringIntValue } from '../common';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// List of API keys related actions for system administrator only
|
|
10
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
11
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
12
|
-
export class SysKeysService {
|
|
13
|
-
|
|
14
|
-
// URL to web api
|
|
15
|
-
private baseUrl = '/sys/keys';
|
|
16
|
-
|
|
17
|
-
// Class constructor
|
|
18
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
19
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create new API key
|
|
25
|
-
*/
|
|
26
|
-
create(body?: ApiKey) {
|
|
27
|
-
return this.rest.put<EntityResponse<ApiKey>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Update existing API key in the system
|
|
32
|
-
*/
|
|
33
|
-
update(body?: ApiKey) {
|
|
34
|
-
return this.rest.patch<EntityResponse<ApiKey>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Delete API key from the system
|
|
39
|
-
*/
|
|
40
|
-
delete(id?: string) {
|
|
41
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Get single API key by id
|
|
46
|
-
*/
|
|
47
|
-
get(id?: string) {
|
|
48
|
-
return this.rest.get<EntityResponse<ApiKey>>(`${this.baseUrl}/${id}`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Find list of API keys by free test search
|
|
53
|
-
*/
|
|
54
|
-
find(search?: string, sort?: string, page?: number, size?: number) {
|
|
55
|
-
const params = [];
|
|
56
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
57
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
58
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
59
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
60
|
-
|
|
61
|
-
return this.rest.get<EntitiesResponse<ApiKey>>(`${this.baseUrl}`, ...params);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Get list of services for the ACL
|
|
66
|
-
*/
|
|
67
|
-
listServices() {
|
|
68
|
-
return this.rest.get<EntitiesResponse<StringIntValue>>(`${this.baseUrl}/services`);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { Member } from '../entities';
|
|
5
|
-
import { MemberRoleCode } from '../enums';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// List of members related actions for system administrator only
|
|
10
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
11
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
12
|
-
export class SysMembersService {
|
|
13
|
-
|
|
14
|
-
// URL to web api
|
|
15
|
-
private baseUrl = '/sys/members';
|
|
16
|
-
|
|
17
|
-
// Class constructor
|
|
18
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
19
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create new member
|
|
25
|
-
*/
|
|
26
|
-
create(body?: Member) {
|
|
27
|
-
return this.rest.put<EntityResponse<Member>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Update existing member in the system
|
|
32
|
-
*/
|
|
33
|
-
update(body?: Member) {
|
|
34
|
-
return this.rest.patch<EntityResponse<Member>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Delete member from the system
|
|
39
|
-
*/
|
|
40
|
-
delete(id?: string) {
|
|
41
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Get single member by id
|
|
46
|
-
*/
|
|
47
|
-
get(id?: string) {
|
|
48
|
-
return this.rest.get<EntityResponse<Member>>(`${this.baseUrl}/${id}`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Find list of members by query
|
|
53
|
-
*/
|
|
54
|
-
find(accountId?: string, userId?: string, role?: MemberRoleCode[], sort?: string, page?: number, size?: number) {
|
|
55
|
-
const params = [];
|
|
56
|
-
if (accountId != null) { params.push(`accountId=${accountId}`); }
|
|
57
|
-
if (userId != null) { params.push(`userId=${userId}`); }
|
|
58
|
-
if (role != null) { params.push(`role=${role}`); }
|
|
59
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
60
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
61
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
62
|
-
|
|
63
|
-
return this.rest.get<EntitiesResponse<Member>>(`${this.baseUrl}`, ...params);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { RestUtil, EntityResponse, EntitiesResponse, ActionResponse } from '../../utils';
|
|
2
|
-
import { PulseConfig } from '../../config';
|
|
3
|
-
|
|
4
|
-
import { RuleTemplate } from '../entities';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// List of rule templates related actions for system administrator only
|
|
9
|
-
// @RequestHeader X-API-KEY The key to identify the application (console)
|
|
10
|
-
// @RequestHeader X-ACCESS-TOKEN The token to identify the logged-in user
|
|
11
|
-
export class SysRuleTemplatesService {
|
|
12
|
-
|
|
13
|
-
// URL to web api
|
|
14
|
-
private baseUrl = '/sys/rule-templates';
|
|
15
|
-
|
|
16
|
-
// Class constructor
|
|
17
|
-
constructor(private config: PulseConfig, private rest: RestUtil) {
|
|
18
|
-
this.baseUrl = this.config.api + this.baseUrl;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Create new rule template
|
|
24
|
-
*/
|
|
25
|
-
create(body?: RuleTemplate) {
|
|
26
|
-
return this.rest.put<EntityResponse<RuleTemplate>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Update existing rule template
|
|
31
|
-
*/
|
|
32
|
-
update(body?: RuleTemplate) {
|
|
33
|
-
return this.rest.patch<EntityResponse<RuleTemplate>>(`${this.baseUrl}`, typeof body === 'object' ? JSON.stringify(body) : body);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Delete a rule template from the system
|
|
38
|
-
*/
|
|
39
|
-
delete(id?: string) {
|
|
40
|
-
return this.rest.delete<ActionResponse>(`${this.baseUrl}/${id}`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get single rule template by id
|
|
45
|
-
*/
|
|
46
|
-
get(id?: string) {
|
|
47
|
-
return this.rest.get<EntityResponse<RuleTemplate>>(`${this.baseUrl}/${id}`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Find list of rule templates by query
|
|
52
|
-
*/
|
|
53
|
-
find(search?: string, sort?: string, page?: number, size?: number) {
|
|
54
|
-
const params = [];
|
|
55
|
-
if (search != null) { params.push(`search=${search}`); }
|
|
56
|
-
if (sort != null) { params.push(`sort=${sort}`); }
|
|
57
|
-
if (page != null) { params.push(`page=${page}`); }
|
|
58
|
-
if (size != null) { params.push(`size=${size}`); }
|
|
59
|
-
|
|
60
|
-
return this.rest.get<EntitiesResponse<RuleTemplate>>(`${this.baseUrl}`, ...params);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
}
|