@ampsec/platform-client 74.12.0 → 74.13.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/build/src/dto/connectorSyncs.dto.d.ts +8 -0
- package/build/src/dto/connectorSyncs.dto.js +8 -1
- package/build/src/dto/connectorSyncs.dto.js.map +1 -1
- package/build/src/services/AmpSdk.d.ts +2 -1
- package/build/src/services/AmpSdk.js +1 -0
- package/build/src/services/AmpSdk.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/connectorSyncs.dto.ts +8 -1
- package/src/services/AmpSdk.ts +4 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ConnectorSyncKind, ConnectorSyncStatus } from './enums';
|
|
3
|
+
/**
|
|
4
|
+
* @property {string} cid - connector ID
|
|
5
|
+
* @property {ConnectorSyncKind} kind
|
|
6
|
+
* @property {string} syncInterval - 'ms' compatible string indicating duration between consecutive sync operations
|
|
7
|
+
* @property {ConnectorSyncStatus} [status]
|
|
8
|
+
* @property {string} [lastSyncAt] - ISO 8601 string indicating last sync time
|
|
9
|
+
* @property {unknown} [syncResumeContext] - state/data required for next sync
|
|
10
|
+
*/
|
|
3
11
|
export declare const _ConnectorSyncUpsertDto: z.ZodObject<z.objectUtil.extendShape<{
|
|
4
12
|
id: z.ZodOptional<z.ZodString>;
|
|
5
13
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
@@ -4,13 +4,20 @@ exports._SyncConfig = exports._ConnectorSyncDto = exports._ConnectorSyncUpsertDt
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const base_dto_1 = require("./base.dto");
|
|
6
6
|
const enums_1 = require("./enums");
|
|
7
|
+
/**
|
|
8
|
+
* @property {string} cid - connector ID
|
|
9
|
+
* @property {ConnectorSyncKind} kind
|
|
10
|
+
* @property {string} syncInterval - 'ms' compatible string indicating duration between consecutive sync operations
|
|
11
|
+
* @property {ConnectorSyncStatus} [status]
|
|
12
|
+
* @property {string} [lastSyncAt] - ISO 8601 string indicating last sync time
|
|
13
|
+
* @property {unknown} [syncResumeContext] - state/data required for next sync
|
|
14
|
+
*/
|
|
7
15
|
exports._ConnectorSyncUpsertDto = base_dto_1._BaseUpsertDto.merge(zod_1.z.object({
|
|
8
16
|
cid: zod_1.z.string(),
|
|
9
17
|
kind: zod_1.z.nativeEnum(enums_1.ConnectorSyncKind),
|
|
10
18
|
syncInterval: zod_1.z.string(),
|
|
11
19
|
status: zod_1.z.nativeEnum(enums_1.ConnectorSyncStatus).optional(),
|
|
12
20
|
lastSyncAt: zod_1.z.string().optional(),
|
|
13
|
-
// state/data required for next sync
|
|
14
21
|
syncResumeContext: zod_1.z.unknown().optional(),
|
|
15
22
|
}));
|
|
16
23
|
exports._ConnectorSyncDto = exports._ConnectorSyncUpsertDto.merge(base_dto_1._BaseDto);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectorSyncs.dto.js","sourceRoot":"","sources":["../../../src/dto/connectorSyncs.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,yCAAoD;AACpD,mCAA+D;
|
|
1
|
+
{"version":3,"file":"connectorSyncs.dto.js","sourceRoot":"","sources":["../../../src/dto/connectorSyncs.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,yCAAoD;AACpD,mCAA+D;AAE/D;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAAG,yBAAc,CAAC,KAAK,CACzD,OAAC,CAAC,MAAM,CAAC;IACP,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,yBAAiB,CAAC;IACrC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,2BAAmB,CAAC,CAAC,QAAQ,EAAE;IACpD,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,iBAAiB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CACH,CAAC;AAIW,QAAA,iBAAiB,GAAG,+BAAuB,CAAC,KAAK,CAAC,mBAAQ,CAAC,CAAC;AAI5D,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,yBAAiB,CAAC;IACrC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlatformActionExecutionDto, PlatformActionExecutionUpsertDto, PlatformCustomActionDto, PlatformCustomActionUpsertDto, PlatformCustomScoreCohortDto, PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreValueDto, PlatformCustomScoreValueUpsertDto, PlatformFindingSpecDto, PlatformFindingSpecUpsertDto, PlatformFlowSpecDto, PlatformFlowSpecUpsertDto, PlatformFlowStateDto, PlatformFlowStateUpsertDto, PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto, PlatformJobSpecDto, PlatformJobSpecUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformStagedSaasAssetDto, PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasUserDto, PlatformStagedSaasUserUpsertDto, PlatformTokenDto, PlatformTokenUpsertDto, ProviderDto } from '../dto';
|
|
1
|
+
import { PlatformActionExecutionDto, PlatformActionExecutionUpsertDto, PlatformConnectorSyncDto, PlatformConnectorSyncUpsertDto, PlatformCustomActionDto, PlatformCustomActionUpsertDto, PlatformCustomScoreCohortDto, PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreValueDto, PlatformCustomScoreValueUpsertDto, PlatformFindingSpecDto, PlatformFindingSpecUpsertDto, PlatformFlowSpecDto, PlatformFlowSpecUpsertDto, PlatformFlowStateDto, PlatformFlowStateUpsertDto, PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto, PlatformJobSpecDto, PlatformJobSpecUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformStagedSaasAssetDto, PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasUserDto, PlatformStagedSaasUserUpsertDto, PlatformTokenDto, PlatformTokenUpsertDto, ProviderDto } from '../dto';
|
|
2
2
|
import { AmpEntityService, AmpSdkAssetService, AmpSdkTenantService, AmpSdkUserService, TenantNotesService, TruncatableAmpEntityService } from './entity.service';
|
|
3
3
|
import { AmpRestClientOptions, RestClient } from './rest';
|
|
4
4
|
import { EnumService } from './rest/EnumService';
|
|
@@ -25,6 +25,7 @@ export declare class AmpSdkServices {
|
|
|
25
25
|
readonly agents: PlatformAgentService;
|
|
26
26
|
readonly asset: AmpSdkAssetService;
|
|
27
27
|
readonly connectors: PlatformConnectorService;
|
|
28
|
+
readonly connectorSyncs: AmpEntityService<PlatformConnectorSyncUpsertDto, PlatformConnectorSyncDto>;
|
|
28
29
|
readonly contentful: ContentfulService;
|
|
29
30
|
readonly customActions: AmpEntityService<PlatformCustomActionUpsertDto, PlatformCustomActionDto>;
|
|
30
31
|
readonly customScoreCohorts: AmpEntityService<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>;
|
|
@@ -28,6 +28,7 @@ class AmpSdkServices {
|
|
|
28
28
|
this.agents = new AgentsService_1.PlatformAgentService(rest);
|
|
29
29
|
this.asset = new entity_service_1.AmpSdkAssetService(rest, constants_1.TARGET_API_PLATFORM);
|
|
30
30
|
this.connectors = new connector_platform_service_1.PlatformConnectorService(rest);
|
|
31
|
+
this.connectorSyncs = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.CONNECTOR_SYNCS, constants_1.TARGET_API_PLATFORM);
|
|
31
32
|
this.contentful = new contentful_service_1.ContentfulService();
|
|
32
33
|
this.customActions = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.CUSTOM_ACTIONS, constants_1.TARGET_API_PLATFORM);
|
|
33
34
|
this.customScoreCohorts = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.CUSTOM_SCORE_COHORTS, constants_1.TARGET_API_PLATFORM);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AAwCA,qDAS0B;AAC1B,iCAA0E;AAC1E,2CAAsD;AACtD,oDAAmE;AACnE,yDAAyD;AACzD,6DAA+J;AAC/J,6DAAuD;AACvD,yEAAmE;AACnE,6EAAsE;AACtE,mDAAqD;AACrD,0DAAqD;AACrD,yDAAmD;AAInD;;;;;;;;GAQG;AACH,MAAa,cAAc;IAkCzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,qCAAoB,CAA+D,IAAI,EAAE,gBAAI,CAAC,gBAAgB,EAAE,+BAAmB,CAAC,CAAC;QACjK,IAAI,CAAC,MAAM,GAAG,IAAI,oCAAoB,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,mCAAkB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,IAAI,qDAAwB,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,IAAI,qCAAoB,CAA2D,IAAI,EAAE,gBAAI,CAAC,eAAe,EAAE,+BAAmB,CAAC,CAAC;QAC1J,IAAI,CAAC,UAAU,GAAG,IAAI,s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CAAC;QACrE,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAoB,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QACzH,IAAI,CAAC,KAAK,GAAG,IAAI,kCAAiB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAsB;QACpC,MAAM,IAAI,GAAG,IAAA,uBAAgB,EAAC,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AA9ED,wCA8EC"}
|
package/package.json
CHANGED
|
@@ -2,6 +2,14 @@ import {z} from 'zod';
|
|
|
2
2
|
import {_BaseDto, _BaseUpsertDto} from './base.dto';
|
|
3
3
|
import {ConnectorSyncKind, ConnectorSyncStatus} from './enums';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @property {string} cid - connector ID
|
|
7
|
+
* @property {ConnectorSyncKind} kind
|
|
8
|
+
* @property {string} syncInterval - 'ms' compatible string indicating duration between consecutive sync operations
|
|
9
|
+
* @property {ConnectorSyncStatus} [status]
|
|
10
|
+
* @property {string} [lastSyncAt] - ISO 8601 string indicating last sync time
|
|
11
|
+
* @property {unknown} [syncResumeContext] - state/data required for next sync
|
|
12
|
+
*/
|
|
5
13
|
export const _ConnectorSyncUpsertDto = _BaseUpsertDto.merge(
|
|
6
14
|
z.object({
|
|
7
15
|
cid: z.string(),
|
|
@@ -9,7 +17,6 @@ export const _ConnectorSyncUpsertDto = _BaseUpsertDto.merge(
|
|
|
9
17
|
syncInterval: z.string(),
|
|
10
18
|
status: z.nativeEnum(ConnectorSyncStatus).optional(),
|
|
11
19
|
lastSyncAt: z.string().optional(),
|
|
12
|
-
// state/data required for next sync
|
|
13
20
|
syncResumeContext: z.unknown().optional(),
|
|
14
21
|
})
|
|
15
22
|
);
|
package/src/services/AmpSdk.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PlatformActionExecutionDto,
|
|
3
3
|
PlatformActionExecutionUpsertDto,
|
|
4
|
+
PlatformConnectorSyncDto,
|
|
5
|
+
PlatformConnectorSyncUpsertDto,
|
|
4
6
|
PlatformCustomActionDto,
|
|
5
7
|
PlatformCustomActionUpsertDto,
|
|
6
8
|
PlatformCustomScoreCohortDto,
|
|
@@ -74,6 +76,7 @@ export class AmpSdkServices {
|
|
|
74
76
|
readonly agents: PlatformAgentService;
|
|
75
77
|
readonly asset: AmpSdkAssetService;
|
|
76
78
|
readonly connectors: PlatformConnectorService;
|
|
79
|
+
readonly connectorSyncs: AmpEntityService<PlatformConnectorSyncUpsertDto, PlatformConnectorSyncDto>;
|
|
77
80
|
readonly contentful: ContentfulService;
|
|
78
81
|
readonly customActions: AmpEntityService<PlatformCustomActionUpsertDto, PlatformCustomActionDto>;
|
|
79
82
|
readonly customScoreCohorts: AmpEntityService<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>;
|
|
@@ -107,6 +110,7 @@ export class AmpSdkServices {
|
|
|
107
110
|
this.agents = new PlatformAgentService(rest);
|
|
108
111
|
this.asset = new AmpSdkAssetService(rest, TARGET_API_PLATFORM);
|
|
109
112
|
this.connectors = new PlatformConnectorService(rest);
|
|
113
|
+
this.connectorSyncs = new AmpEntityServiceImpl<PlatformConnectorSyncUpsertDto, PlatformConnectorSyncDto>(rest, KIND.CONNECTOR_SYNCS, TARGET_API_PLATFORM);
|
|
110
114
|
this.contentful = new ContentfulService();
|
|
111
115
|
this.customActions = new AmpEntityServiceImpl<PlatformCustomActionUpsertDto, PlatformCustomActionDto>(rest, KIND.CUSTOM_ACTIONS, TARGET_API_PLATFORM);
|
|
112
116
|
this.customScoreCohorts = new AmpEntityServiceImpl<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>(rest, KIND.CUSTOM_SCORE_COHORTS, TARGET_API_PLATFORM);
|