perimeterx-js-core 0.34.0 → 0.34.1

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.
@@ -15,4 +15,4 @@ exports.PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
15
15
  exports.EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
16
16
  exports.URL_REGEX = /^(https?:)\/\/(([^@\s:\/]+):?([^@\s\/]*)@)?(([^:\/?#]*)(?:\:([0-9]+))?)(\/?[^?#]*)(\?[^#]*|)(#.*|)$/;
17
17
  exports.REGEX_STRUCTURE = /^\/(.+?)\/([gimsuyvd]*)$/;
18
- exports.CORE_MODULE_VERSION = 'JS Core 0.34.0';
18
+ exports.CORE_MODULE_VERSION = 'JS Core 0.34.1';
@@ -12,4 +12,4 @@ export const PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
12
12
  export const EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
13
13
  export const URL_REGEX = /^(https?:)\/\/(([^@\s:\/]+):?([^@\s\/]*)@)?(([^:\/?#]*)(?:\:([0-9]+))?)(\/?[^?#]*)(\?[^#]*|)(#.*|)$/;
14
14
  export const REGEX_STRUCTURE = /^\/(.+?)\/([gimsuyvd]*)$/;
15
- export const CORE_MODULE_VERSION = 'JS Core 0.34.0';
15
+ export const CORE_MODULE_VERSION = 'JS Core 0.34.1';
@@ -1,5 +1,5 @@
1
1
  import { IConfiguration } from './IConfiguration';
2
- import { RemoteConfigurationParams, StaticConfigurationParams, AllConfigurationParams, RequiredAllConfigurationParams, ActiveConfigurationParams, CoreConfigurationParams } from './params';
2
+ import { RemoteConfigurationParams, StaticConfigurationParams, AllConfigurationParams, RequiredAllConfigurationParams, ActiveConfigurationParams, CoreConfigurationParams, CoreConfigurationParamsKeys } from './params';
3
3
  import { CustomParametersFunction, ResponseCustomParametersFunction } from '../custom_parameters';
4
4
  import { AdditionalActivityHandler } from '../additional_activity_handler';
5
5
  import { ILogger, LoggerSeverity } from '../logger';
@@ -11,6 +11,11 @@ import { ExtractGraphQLKeywordsFunction } from '../graphql';
11
11
  import { RemoteConfigData } from './remote_config';
12
12
  import { TokenVersion } from '../risk_token';
13
13
  import { CustomSnippetFunction } from '../snippet_injection';
14
+ type EmptyObjectStrict = Record<PropertyKey, never>;
15
+ type Unsupported<Supported extends string> = Exclude<CoreConfigurationParamsKeys, Supported>;
16
+ type RemovedParams<Supported extends string> = Unsupported<Supported> extends never ? EmptyObjectStrict : {
17
+ [K in Unsupported<Supported>]: undefined;
18
+ };
14
19
  /**
15
20
  * Base class for the enforcer configuration.
16
21
  */
@@ -19,7 +24,7 @@ export declare abstract class ConfigurationBase<Req, Res, Supported extends stri
19
24
  protected readonly staticConfigParams: StaticConfigurationParams<Req, Res, Supported, Added>;
20
25
  protected remoteConfigData?: RemoteConfigData<Req, Res, Supported, Added>;
21
26
  protected readonly defaultConfigParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>;
22
- protected readonly removedParams: Record<Exclude<keyof CoreConfigurationParams<Req, Res, Supported, Added>, Supported>, undefined>;
27
+ protected readonly removedParams: RemovedParams<Supported>;
23
28
  private internalLogger;
24
29
  /**
25
30
  * Returns the module version of the enforcer.
@@ -40,7 +45,7 @@ export declare abstract class ConfigurationBase<Req, Res, Supported extends stri
40
45
  * @param removedParams - A map of all removed (unsupported) configuration parameters set to undefined. This parameter can be generated automatically by your IDE.
41
46
  * @protected
42
47
  */
43
- protected constructor(params: StaticConfigurationParams<Req, Res, Supported, Added>, defaultParams: Required<Added> & Partial<CoreConfigurationParams<Req, Res, Supported, Added>>, removedParams: Record<Exclude<keyof CoreConfigurationParams<Req, Res, Supported, Added>, Supported>, undefined>);
48
+ protected constructor(params: StaticConfigurationParams<Req, Res, Supported, Added>, defaultParams: Required<Added> & Partial<CoreConfigurationParams<Req, Res, Supported, Added>>, removedParams: RemovedParams<Supported>);
44
49
  protected createActiveConfiguration(params: AllConfigurationParams<Req, Res, Supported, Added>, defaultParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>): RequiredAllConfigurationParams<Req, Res, Supported, Added>;
45
50
  protected throwIfMissingRequiredField(params: AllConfigurationParams<Req, Res, Supported, Added>): void;
46
51
  protected getValidConfigValue<K extends keyof RequiredAllConfigurationParams<Req, Res, Supported, Added>, V extends RequiredAllConfigurationParams<Req, Res, Supported, Added>[K]>(params: AllConfigurationParams<Req, Res, Supported, Added>, defaultParams: RequiredAllConfigurationParams<Req, Res, Supported, Added>, key: K): V;
@@ -148,3 +153,4 @@ export declare abstract class ConfigurationBase<Req, Res, Supported extends stri
148
153
  get awaitAsyncHttpRequests(): boolean;
149
154
  get isPostEnforceEnabled(): boolean;
150
155
  }
156
+ export {};
@@ -12,4 +12,4 @@ export declare const PUSH_DATA_FEATURE_HEADER_NAME = "x-px-feature";
12
12
  export declare const EMAIL_ADDRESS_REGEX: RegExp;
13
13
  export declare const URL_REGEX: RegExp;
14
14
  export declare const REGEX_STRUCTURE: RegExp;
15
- export declare const CORE_MODULE_VERSION = "JS Core 0.34.0";
15
+ export declare const CORE_MODULE_VERSION = "JS Core 0.34.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perimeterx-js-core",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "typesVersions": {
@@ -61,7 +61,7 @@
61
61
  "@typescript-eslint/eslint-plugin": "^8.38.0",
62
62
  "@typescript-eslint/parser": "^8.26.0",
63
63
  "c8": "^10.1.3",
64
- "chai": "^5.2.0",
64
+ "chai": "^6.2.0",
65
65
  "chai-as-promised": "^8.0.0",
66
66
  "core-js": "^3.19.1",
67
67
  "eslint": "^9.21.0",