perimeterx-js-core 0.18.2 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/lib/cjs/additional_activity_handler/AdditionalActivityHandlerUtils.js +1 -1
  2. package/lib/cjs/blocker/utils.js +1 -3
  3. package/lib/cjs/config/ConfigurationBase.js +112 -91
  4. package/lib/cjs/config/ConfigurationBuilderBase.js +8 -7
  5. package/lib/cjs/config/defaults/DefaultCommonConfigurationParams.js +3 -1
  6. package/lib/cjs/config/defaults/DefaultStaticConfigurationParams.js +0 -1
  7. package/lib/cjs/config/remote_config/DefaultRemoteConfigUpdater.js +1 -1
  8. package/lib/cjs/config/remote_config/RemoteConfigUtils.js +1 -1
  9. package/lib/cjs/context/DefaultContext.js +4 -1
  10. package/lib/cjs/custom_parameters/CustomParametersUtils.js +1 -1
  11. package/lib/cjs/graphql/DefaultGraphQLParser.js +155 -30
  12. package/lib/cjs/graphql/ExtractGraphQLKeywordsFunction.js +2 -0
  13. package/lib/cjs/graphql/index.js +1 -0
  14. package/lib/cjs/telemetry/DefaultTelemetry.js +14 -4
  15. package/lib/cjs/utils/constants.js +1 -1
  16. package/lib/cjs/utils/utils.js +25 -1
  17. package/lib/esm/additional_activity_handler/AdditionalActivityHandlerUtils.js +1 -1
  18. package/lib/esm/blocker/utils.js +1 -2
  19. package/lib/esm/config/ConfigurationBase.js +106 -91
  20. package/lib/esm/config/ConfigurationBuilderBase.js +7 -6
  21. package/lib/esm/config/defaults/DefaultCommonConfigurationParams.js +3 -1
  22. package/lib/esm/config/defaults/DefaultStaticConfigurationParams.js +0 -1
  23. package/lib/esm/config/remote_config/DefaultRemoteConfigUpdater.js +1 -1
  24. package/lib/esm/config/remote_config/RemoteConfigUtils.js +1 -1
  25. package/lib/esm/context/DefaultContext.js +5 -2
  26. package/lib/esm/custom_parameters/CustomParametersUtils.js +1 -1
  27. package/lib/esm/graphql/DefaultGraphQLParser.js +109 -25
  28. package/lib/esm/graphql/ExtractGraphQLKeywordsFunction.js +1 -0
  29. package/lib/esm/graphql/index.js +1 -0
  30. package/lib/esm/telemetry/DefaultTelemetry.js +15 -5
  31. package/lib/esm/utils/constants.js +1 -1
  32. package/lib/esm/utils/utils.js +23 -0
  33. package/lib/types/activities/utils.d.ts +60 -30
  34. package/lib/types/blocker/utils.d.ts +6 -3
  35. package/lib/types/config/ConfigurationBase.d.ts +12 -4
  36. package/lib/types/config/IConfiguration.d.ts +28 -8
  37. package/lib/types/config/params/CommonConfigurationParams.d.ts +4 -1
  38. package/lib/types/config/params/StaticConfigurationParams.d.ts +0 -1
  39. package/lib/types/graphql/DefaultGraphQLParser.d.ts +20 -11
  40. package/lib/types/graphql/ExtractGraphQLKeywordsFunction.d.ts +1 -0
  41. package/lib/types/graphql/index.d.ts +1 -0
  42. package/lib/types/graphql/model/GraphQLData.d.ts +2 -1
  43. package/lib/types/monitored_request/MonitoredRequestUtils.d.ts +18 -9
  44. package/lib/types/pxhd/PXHDUtils.d.ts +12 -6
  45. package/lib/types/sensitive_request/SensitiveRequestUtils.d.ts +12 -6
  46. package/lib/types/telemetry/model/TelemetryActivity.d.ts +7 -2
  47. package/lib/types/utils/constants.d.ts +1 -1
  48. package/lib/types/utils/utils.d.ts +1 -0
  49. package/package.json +1 -1
@@ -2,10 +2,11 @@ import { ModuleMode } from '../utils';
2
2
  import { ILogger, LoggerSeverity } from '../logger';
3
3
  import { CustomParametersFunction } from '../custom_parameters';
4
4
  import { AdditionalActivityHandler } from '../additional_activity_handler';
5
- import { ConfigurationParams } from './params';
5
+ import { ConfigurationParams, RemoteConfigurationParams } from './params';
6
6
  import { CustomPreflightHandler, CustomBlockResponseHeadersHandler } from '../cors';
7
7
  import { CredentialEndpointConfiguration, CredentialIntelligenceVersion, CustomLoginSuccessfulCallback, LoginSuccessfulReportingMethod } from '../products';
8
8
  import { CustomRequestFunction } from './CustomRequestFunction';
9
+ import { ExtractGraphQLKeywordsFunction } from '../graphql/ExtractGraphQLKeywordsFunction';
9
10
  export interface IConfiguration<Req, Res, ParamsType extends ConfigurationParams<Req, Res> = ConfigurationParams<Req, Res>> {
10
11
  /**
11
12
  * The application ID.
@@ -215,15 +216,26 @@ export interface IConfiguration<Req, Res, ParamsType extends ConfigurationParams
215
216
  */
216
217
  readonly graphqlRoutes: Array<string | RegExp>;
217
218
  /**
218
- * An array of GraphQL operation names that should trigger a risk API call
219
+ * An array of GraphQL operation names and keywords that should trigger a risk API call
219
220
  * even if a valid, unexpired, low-score risk cookie is present.
220
221
  */
221
- readonly sensitiveGraphqlOperationNames: string[];
222
+ readonly sensitiveGraphqlOperationNames: Array<string | RegExp>;
222
223
  /**
223
224
  * An array of GraphQL operation types (e.g., mutation) that should trigger a risk API call
224
225
  * even if a valid, unexpired, low-score risk cookie is present.
225
226
  */
226
227
  readonly sensitiveGraphqlOperationTypes: string[];
228
+ /**
229
+ * An array of strings or regular expressions representing important keywords in the GraphQL
230
+ * query that should be extracted by the enforcer.
231
+ */
232
+ readonly graphqlKeywords: Array<string | RegExp>;
233
+ /**
234
+ * A custom function that receives the GraphQL query as a string and returns the extracted
235
+ * keywords from the query. This function may be called multiple times if the HTTP request
236
+ * contains multiple GraphQL queries.
237
+ */
238
+ readonly extractGraphQLKeywords: ExtractGraphQLKeywordsFunction<Req>;
227
239
  /**
228
240
  * A function returning CustomParameters that will be added to the enforcer activities.
229
241
  */
@@ -333,10 +345,6 @@ export interface IConfiguration<Req, Res, ParamsType extends ConfigurationParams
333
345
  * The authentication token for the remote configuration service.
334
346
  */
335
347
  readonly remoteConfigAuthToken: string;
336
- /**
337
- * The secret used for validating remote config update requests.
338
- */
339
- readonly remoteConfigSecret: string;
340
348
  /**
341
349
  * The ID of the remote configuration.
342
350
  */
@@ -364,5 +372,17 @@ export interface IConfiguration<Req, Res, ParamsType extends ConfigurationParams
364
372
  /**
365
373
  * Returns an object representation of the current configuration.
366
374
  */
367
- toParams(): ParamsType;
375
+ getActiveConfig(): ParamsType;
376
+ /**
377
+ * Returns an object representation of the static configuration.
378
+ */
379
+ getStaticConfig(): ParamsType;
380
+ /**
381
+ * Returns an object representation of the remote configuration.
382
+ */
383
+ getRemoteConfig(): ParamsType;
384
+ /**
385
+ * Adds a remote configuration to the current configuration.
386
+ */
387
+ addRemoteConfig(remoteConfigurationParams: RemoteConfigurationParams): void;
368
388
  }
@@ -6,6 +6,7 @@ import { AdditionalActivityHandler } from '../../additional_activity_handler';
6
6
  import { CustomParametersFunction } from '../../custom_parameters';
7
7
  import { CustomBlockResponseHeadersHandler, CustomPreflightHandler } from '../../cors';
8
8
  import { CustomRequestFunction } from '../CustomRequestFunction';
9
+ import { ExtractGraphQLKeywordsFunction } from '../../graphql/ExtractGraphQLKeywordsFunction';
9
10
  export type CommonConfigurationParams<Req, Res> = {
10
11
  px_s2s_timeout?: number;
11
12
  px_backend_url?: string;
@@ -64,7 +65,8 @@ export type CommonConfigurationParams<Req, Res> = {
64
65
  px_jwt_header_additional_field_names?: string[];
65
66
  px_graphql_enabled?: boolean;
66
67
  px_graphql_routes?: Array<string | RegExp>;
67
- px_sensitive_graphql_operation_names?: string[];
68
+ px_graphql_keywords?: Array<string | RegExp>;
69
+ px_sensitive_graphql_operation_names?: Array<string | RegExp>;
68
70
  px_sensitive_graphql_operation_types?: Array<'query' | 'mutation' | 'subscription' | GraphQLOperationType>;
69
71
  px_cors_support_enabled?: boolean;
70
72
  px_cors_preflight_request_filter_enabled?: boolean;
@@ -81,4 +83,5 @@ export type CommonConfigurationParams<Req, Res> = {
81
83
  px_custom_is_monitored_request?: CustomRequestFunction<Req>;
82
84
  px_custom_is_enforced_request?: CustomRequestFunction<Req>;
83
85
  px_custom_is_filtered_request?: CustomRequestFunction<Req>;
86
+ px_extract_graphql_keywords?: ExtractGraphQLKeywordsFunction<Req>;
84
87
  };
@@ -3,6 +3,5 @@ export type StaticConfigurationParams = {
3
3
  px_cookie_secret: string;
4
4
  px_auth_token: string;
5
5
  px_logger_auth_token?: string;
6
- px_remote_config_secret?: string;
7
6
  px_remote_config_auth_token?: string;
8
7
  };
@@ -1,19 +1,28 @@
1
1
  import { ReadonlyContext } from '../context';
2
2
  import { IConfiguration } from '../config';
3
+ import { IIncomingRequest } from '../http';
3
4
  import { IGraphQLParser } from './IGraphQLParser';
4
- import { GraphQLData } from './model';
5
+ import { GraphQLData, GraphQLOperation, GraphQLOperationType } from './model';
5
6
  export declare class DefaultGraphQLParser<Req, Res> implements IGraphQLParser<Req, Res> {
6
- private readonly graphqlRoutes;
7
- private readonly sensitiveOperationTypes;
8
- private readonly sensitiveOperationNames;
7
+ protected readonly config: IConfiguration<Req, Res>;
8
+ protected readonly maxCharactersInGraphqlKeyword: number;
9
+ protected readonly maxGraphqlKeywordCount: number;
9
10
  constructor(config: IConfiguration<Req, Res>);
10
11
  isGraphQLRequest({ requestData }: ReadonlyContext<Req, Res>): boolean;
11
12
  parseGraphQLRequest(context: ReadonlyContext<Req, Res>): Promise<GraphQLData[]>;
12
- private getGraphQLOperationsFromBody;
13
- private parseGraphQLOperations;
14
- private parseGraphQlOperation;
15
- private getOperationNameToTypeMap;
16
- private getGraphQLData;
17
- private isSensitiveOperation;
18
- private extractGraphQLVariableNames;
13
+ protected getGraphQLOperationsFromBody(request: IIncomingRequest<Req>, context: ReadonlyContext<Req, Res>): Promise<Array<GraphQLOperation>>;
14
+ protected parseGraphQLOperations(operations: GraphQLOperation[], context: ReadonlyContext<Req, Res>): Promise<GraphQLData[]>;
15
+ protected parseGraphQLOperation(operation: GraphQLOperation, context: ReadonlyContext<Req, Res>): Promise<GraphQLData | null>;
16
+ protected getOperationNameToTypeMap(query: string): Record<string, GraphQLOperationType> | null;
17
+ protected getGraphQLData(operationNameToTypeMap: Record<string, GraphQLOperationType>, operation: GraphQLOperation, context: ReadonlyContext<Req, Res>): Promise<GraphQLData>;
18
+ protected getOperationType(operation: GraphQLOperation, operationName: string, operationNameToTypeMap: Record<string, GraphQLOperationType>): GraphQLOperationType;
19
+ protected isGraphqlQueryShorthand(query: string): boolean;
20
+ protected getOperationName(operationNameToTypeMap: Record<string, GraphQLOperationType>, operation: GraphQLOperation): string;
21
+ protected getQueryKeywords(query: string, context: ReadonlyContext<Req, Res>): Promise<string[]>;
22
+ protected cleanKeywords(keywords: string[]): string[];
23
+ protected getQueryKeywordsFromCustomFunction(query: string, context: ReadonlyContext<Req, Res>): Promise<string[]>;
24
+ protected getQueryKeywordsFromArray(query: string, context: ReadonlyContext<Req, Res>): string[];
25
+ protected isSensitiveOperation(operationName: string, operationType: GraphQLOperationType, keywords: string[]): boolean;
26
+ protected extractGraphQLVariableNames(variables: Record<string, unknown>): string[];
27
+ protected toGlobalRegExp(pattern: string | RegExp): RegExp;
19
28
  }
@@ -0,0 +1 @@
1
+ export type ExtractGraphQLKeywordsFunction<Req> = (graphqlQuery: string) => string[] | Promise<string[]>;
@@ -1,3 +1,4 @@
1
1
  export * from './model';
2
2
  export * from './IGraphQLParser';
3
3
  export * from './DefaultGraphQLParser';
4
+ export * from './ExtractGraphQLKeywordsFunction';
@@ -1,6 +1,7 @@
1
1
  import { GraphQLOperationType } from './GraphQLOperationType';
2
2
  export type GraphQLData = {
3
- type: GraphQLOperationType;
3
+ type?: GraphQLOperationType;
4
+ keywords?: string[];
4
5
  name?: string;
5
6
  sensitive?: boolean;
6
7
  variables?: string[];
@@ -264,7 +264,8 @@ export declare namespace MonitoredRequestUtils {
264
264
  readonly is_hype_sale?: boolean;
265
265
  };
266
266
  readonly graphqlData?: readonly {
267
- readonly type: import("..").GraphQLOperationType;
267
+ readonly type?: import("..").GraphQLOperationType;
268
+ readonly keywords?: readonly string[];
268
269
  readonly name?: string;
269
270
  readonly sensitive?: boolean;
270
271
  readonly variables?: readonly string[];
@@ -490,7 +491,8 @@ export declare namespace MonitoredRequestUtils {
490
491
  readonly is_hype_sale?: boolean;
491
492
  };
492
493
  readonly graphqlData?: readonly {
493
- readonly type: import("..").GraphQLOperationType;
494
+ readonly type?: import("..").GraphQLOperationType;
495
+ readonly keywords?: readonly string[];
494
496
  readonly name?: string;
495
497
  readonly sensitive?: boolean;
496
498
  readonly variables?: readonly string[];
@@ -647,7 +649,8 @@ export declare namespace MonitoredRequestUtils {
647
649
  readonly is_hype_sale?: boolean;
648
650
  };
649
651
  readonly graphqlData?: readonly {
650
- readonly type: import("..").GraphQLOperationType;
652
+ readonly type?: import("..").GraphQLOperationType;
653
+ readonly keywords?: readonly string[];
651
654
  readonly name?: string;
652
655
  readonly sensitive?: boolean;
653
656
  readonly variables?: readonly string[];
@@ -932,7 +935,8 @@ export declare namespace MonitoredRequestUtils {
932
935
  readonly is_hype_sale?: boolean;
933
936
  };
934
937
  readonly graphqlData?: readonly {
935
- readonly type: import("..").GraphQLOperationType;
938
+ readonly type?: import("..").GraphQLOperationType;
939
+ readonly keywords?: readonly string[];
936
940
  readonly name?: string;
937
941
  readonly sensitive?: boolean;
938
942
  readonly variables?: readonly string[];
@@ -1158,7 +1162,8 @@ export declare namespace MonitoredRequestUtils {
1158
1162
  readonly is_hype_sale?: boolean;
1159
1163
  };
1160
1164
  readonly graphqlData?: readonly {
1161
- readonly type: import("..").GraphQLOperationType;
1165
+ readonly type?: import("..").GraphQLOperationType;
1166
+ readonly keywords?: readonly string[];
1162
1167
  readonly name?: string;
1163
1168
  readonly sensitive?: boolean;
1164
1169
  readonly variables?: readonly string[];
@@ -1315,7 +1320,8 @@ export declare namespace MonitoredRequestUtils {
1315
1320
  readonly is_hype_sale?: boolean;
1316
1321
  };
1317
1322
  readonly graphqlData?: readonly {
1318
- readonly type: import("..").GraphQLOperationType;
1323
+ readonly type?: import("..").GraphQLOperationType;
1324
+ readonly keywords?: readonly string[];
1319
1325
  readonly name?: string;
1320
1326
  readonly sensitive?: boolean;
1321
1327
  readonly variables?: readonly string[];
@@ -1598,7 +1604,8 @@ export declare namespace MonitoredRequestUtils {
1598
1604
  readonly is_hype_sale?: boolean;
1599
1605
  };
1600
1606
  readonly graphqlData?: readonly {
1601
- readonly type: import("..").GraphQLOperationType;
1607
+ readonly type?: import("..").GraphQLOperationType;
1608
+ readonly keywords?: readonly string[];
1602
1609
  readonly name?: string;
1603
1610
  readonly sensitive?: boolean;
1604
1611
  readonly variables?: readonly string[];
@@ -1824,7 +1831,8 @@ export declare namespace MonitoredRequestUtils {
1824
1831
  readonly is_hype_sale?: boolean;
1825
1832
  };
1826
1833
  readonly graphqlData?: readonly {
1827
- readonly type: import("..").GraphQLOperationType;
1834
+ readonly type?: import("..").GraphQLOperationType;
1835
+ readonly keywords?: readonly string[];
1828
1836
  readonly name?: string;
1829
1837
  readonly sensitive?: boolean;
1830
1838
  readonly variables?: readonly string[];
@@ -1981,7 +1989,8 @@ export declare namespace MonitoredRequestUtils {
1981
1989
  readonly is_hype_sale?: boolean;
1982
1990
  };
1983
1991
  readonly graphqlData?: readonly {
1984
- readonly type: import("..").GraphQLOperationType;
1992
+ readonly type?: import("..").GraphQLOperationType;
1993
+ readonly keywords?: readonly string[];
1985
1994
  readonly name?: string;
1986
1995
  readonly sensitive?: boolean;
1987
1996
  readonly variables?: readonly string[];
@@ -266,7 +266,8 @@ export declare namespace PXHDUtils {
266
266
  readonly is_hype_sale?: boolean;
267
267
  };
268
268
  readonly graphqlData?: readonly {
269
- readonly type: import("..").GraphQLOperationType;
269
+ readonly type?: import("..").GraphQLOperationType;
270
+ readonly keywords?: readonly string[];
270
271
  readonly name?: string;
271
272
  readonly sensitive?: boolean;
272
273
  readonly variables?: readonly string[];
@@ -492,7 +493,8 @@ export declare namespace PXHDUtils {
492
493
  readonly is_hype_sale?: boolean;
493
494
  };
494
495
  readonly graphqlData?: readonly {
495
- readonly type: import("..").GraphQLOperationType;
496
+ readonly type?: import("..").GraphQLOperationType;
497
+ readonly keywords?: readonly string[];
496
498
  readonly name?: string;
497
499
  readonly sensitive?: boolean;
498
500
  readonly variables?: readonly string[];
@@ -649,7 +651,8 @@ export declare namespace PXHDUtils {
649
651
  readonly is_hype_sale?: boolean;
650
652
  };
651
653
  readonly graphqlData?: readonly {
652
- readonly type: import("..").GraphQLOperationType;
654
+ readonly type?: import("..").GraphQLOperationType;
655
+ readonly keywords?: readonly string[];
653
656
  readonly name?: string;
654
657
  readonly sensitive?: boolean;
655
658
  readonly variables?: readonly string[];
@@ -932,7 +935,8 @@ export declare namespace PXHDUtils {
932
935
  readonly is_hype_sale?: boolean;
933
936
  };
934
937
  readonly graphqlData?: readonly {
935
- readonly type: import("..").GraphQLOperationType;
938
+ readonly type?: import("..").GraphQLOperationType;
939
+ readonly keywords?: readonly string[];
936
940
  readonly name?: string;
937
941
  readonly sensitive?: boolean;
938
942
  readonly variables?: readonly string[];
@@ -1158,7 +1162,8 @@ export declare namespace PXHDUtils {
1158
1162
  readonly is_hype_sale?: boolean;
1159
1163
  };
1160
1164
  readonly graphqlData?: readonly {
1161
- readonly type: import("..").GraphQLOperationType;
1165
+ readonly type?: import("..").GraphQLOperationType;
1166
+ readonly keywords?: readonly string[];
1162
1167
  readonly name?: string;
1163
1168
  readonly sensitive?: boolean;
1164
1169
  readonly variables?: readonly string[];
@@ -1315,7 +1320,8 @@ export declare namespace PXHDUtils {
1315
1320
  readonly is_hype_sale?: boolean;
1316
1321
  };
1317
1322
  readonly graphqlData?: readonly {
1318
- readonly type: import("..").GraphQLOperationType;
1323
+ readonly type?: import("..").GraphQLOperationType;
1324
+ readonly keywords?: readonly string[];
1319
1325
  readonly name?: string;
1320
1326
  readonly sensitive?: boolean;
1321
1327
  readonly variables?: readonly string[];
@@ -265,7 +265,8 @@ export declare namespace SensitiveRequestUtils {
265
265
  readonly is_hype_sale?: boolean;
266
266
  };
267
267
  readonly graphqlData?: readonly {
268
- readonly type: import("../graphql").GraphQLOperationType;
268
+ readonly type?: import("../graphql").GraphQLOperationType;
269
+ readonly keywords?: readonly string[];
269
270
  readonly name?: string;
270
271
  readonly sensitive?: boolean;
271
272
  readonly variables?: readonly string[];
@@ -491,7 +492,8 @@ export declare namespace SensitiveRequestUtils {
491
492
  readonly is_hype_sale?: boolean;
492
493
  };
493
494
  readonly graphqlData?: readonly {
494
- readonly type: import("../graphql").GraphQLOperationType;
495
+ readonly type?: import("../graphql").GraphQLOperationType;
496
+ readonly keywords?: readonly string[];
495
497
  readonly name?: string;
496
498
  readonly sensitive?: boolean;
497
499
  readonly variables?: readonly string[];
@@ -648,7 +650,8 @@ export declare namespace SensitiveRequestUtils {
648
650
  readonly is_hype_sale?: boolean;
649
651
  };
650
652
  readonly graphqlData?: readonly {
651
- readonly type: import("../graphql").GraphQLOperationType;
653
+ readonly type?: import("../graphql").GraphQLOperationType;
654
+ readonly keywords?: readonly string[];
652
655
  readonly name?: string;
653
656
  readonly sensitive?: boolean;
654
657
  readonly variables?: readonly string[];
@@ -933,7 +936,8 @@ export declare namespace SensitiveRequestUtils {
933
936
  readonly is_hype_sale?: boolean;
934
937
  };
935
938
  readonly graphqlData?: readonly {
936
- readonly type: import("../graphql").GraphQLOperationType;
939
+ readonly type?: import("../graphql").GraphQLOperationType;
940
+ readonly keywords?: readonly string[];
937
941
  readonly name?: string;
938
942
  readonly sensitive?: boolean;
939
943
  readonly variables?: readonly string[];
@@ -1159,7 +1163,8 @@ export declare namespace SensitiveRequestUtils {
1159
1163
  readonly is_hype_sale?: boolean;
1160
1164
  };
1161
1165
  readonly graphqlData?: readonly {
1162
- readonly type: import("../graphql").GraphQLOperationType;
1166
+ readonly type?: import("../graphql").GraphQLOperationType;
1167
+ readonly keywords?: readonly string[];
1163
1168
  readonly name?: string;
1164
1169
  readonly sensitive?: boolean;
1165
1170
  readonly variables?: readonly string[];
@@ -1316,7 +1321,8 @@ export declare namespace SensitiveRequestUtils {
1316
1321
  readonly is_hype_sale?: boolean;
1317
1322
  };
1318
1323
  readonly graphqlData?: readonly {
1319
- readonly type: import("../graphql").GraphQLOperationType;
1324
+ readonly type?: import("../graphql").GraphQLOperationType;
1325
+ readonly keywords?: readonly string[];
1320
1326
  readonly name?: string;
1321
1327
  readonly sensitive?: boolean;
1322
1328
  readonly variables?: readonly string[];
@@ -1,7 +1,7 @@
1
1
  import { ActivityType } from '../../activities';
2
- import { ConfigurationParams } from '../../config';
2
+ import { CommonConfigurationParams, ConfigurationParams, RemoteConfigurationParams, StaticConfigurationParams } from '../../config';
3
3
  export type TelemetryActivityDetails = {
4
- enforcer_configs: ConfigurationParams<unknown, unknown>;
4
+ enforcer_configs: TelemetryEnforcerConfiguration;
5
5
  module_version: string;
6
6
  update_reason: 'command';
7
7
  node_name?: string;
@@ -13,3 +13,8 @@ export type TelemetryActivity = {
13
13
  px_app_id: string;
14
14
  details: TelemetryActivityDetails;
15
15
  };
16
+ export type TelemetryEnforcerConfiguration = {
17
+ active_config: ConfigurationParams<unknown, unknown>;
18
+ static_config: StaticConfigurationParams & CommonConfigurationParams<unknown, unknown>;
19
+ remote_config: RemoteConfigurationParams & CommonConfigurationParams<unknown, unknown>;
20
+ };
@@ -10,4 +10,4 @@ export declare const PUSH_DATA_HMAC_HEADER_NAME = "x-px-pushdata";
10
10
  export declare const PUSH_DATA_FEATURE_HEADER_NAME = "x-px-feature";
11
11
  export declare const EMAIL_ADDRESS_REGEX: RegExp;
12
12
  export declare const URL_REGEX: RegExp;
13
- export declare const CORE_MODULE_VERSION = "JS Core 0.18.2";
13
+ export declare const CORE_MODULE_VERSION = "JS Core 0.20.0";
@@ -20,3 +20,4 @@ export declare const getPropertyFromObject: <T>(object: any, ...keys: Array<stri
20
20
  export declare const sleep: (ms: number) => Promise<void>;
21
21
  export declare const algoToSubtleCryptoString: (algo: Algorithm) => string;
22
22
  export declare const algoToCryptoString: (algo: Algorithm) => string;
23
+ export declare const telemetryConfigReplacer: (key: string, value: any) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perimeterx-js-core",
3
- "version": "0.18.2",
3
+ "version": "0.20.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "typesVersions": {