perimeterx-js-core 0.6.2 → 0.7.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.
Files changed (117) hide show
  1. package/lib/action/ActionData.d.ts +1 -1
  2. package/lib/action/Decision.d.ts +1 -1
  3. package/lib/action/ProductAction.d.ts +1 -1
  4. package/lib/activities/model/Activity.d.ts +1 -1
  5. package/lib/activities/model/ActivityDetails.d.ts +5 -5
  6. package/lib/activities/utils.js +1 -1
  7. package/lib/additional_activity_handler/AdditionalActivityHandler.d.ts +1 -1
  8. package/lib/config/ConfigurationParams.d.ts +2 -1
  9. package/lib/config/DefaultConfigurations.js +1 -0
  10. package/lib/config/IConfiguration.d.ts +4 -0
  11. package/lib/config/StaticConfigurationBase.d.ts +1 -0
  12. package/lib/config/StaticConfigurationBase.js +3 -0
  13. package/lib/context/DefaultContext.d.ts +4 -1
  14. package/lib/context/DefaultContext.js +6 -3
  15. package/lib/context/interfaces/MobileData.d.ts +1 -1
  16. package/lib/context/interfaces/ReadonlyContext.d.ts +1 -1
  17. package/lib/context/interfaces/RequestData.d.ts +6 -1
  18. package/lib/context/interfaces/RiskApiData.d.ts +1 -1
  19. package/lib/context/interfaces/ServerData.d.ts +1 -1
  20. package/lib/context/interfaces/TlsData.d.ts +1 -1
  21. package/lib/context/interfaces/TokenData.d.ts +1 -1
  22. package/lib/cors/CustomBlockResponseHeadersHandler.d.ts +1 -1
  23. package/lib/cors/CustomPreflightHandler.d.ts +1 -1
  24. package/lib/custom_parameters/CustomParameters.d.ts +1 -1
  25. package/lib/custom_parameters/CustomParametersFunction.d.ts +1 -1
  26. package/lib/enforcer/EnforcerBase.d.ts +2 -1
  27. package/lib/enforcer/EnforcerBase.js +13 -3
  28. package/lib/enforcer/options/EnforcerBaseOptions.d.ts +3 -1
  29. package/lib/enforcer/options/EnforcerOptionsType.d.ts +1 -1
  30. package/lib/enforcer/options/EnforcerV2Options.d.ts +1 -1
  31. package/lib/enforcer/options/EnforcerV3Options.d.ts +1 -1
  32. package/lib/first_party/FirstPartyData.d.ts +1 -1
  33. package/lib/graphql/model/GraphQLData.d.ts +1 -1
  34. package/lib/graphql/model/GraphQLOperation.d.ts +1 -1
  35. package/lib/http/impl/FormDataImpl.js +2 -2
  36. package/lib/http/impl/MinimalResponseImpl.d.ts +1 -1
  37. package/lib/http/impl/OutgoingRequestImpl.d.ts +1 -1
  38. package/lib/http/interfaces/IHttpClient.d.ts +1 -1
  39. package/lib/http/interfaces/ReadonlyHeaders.d.ts +1 -1
  40. package/lib/logger/HttpLogServiceClient.d.ts +17 -0
  41. package/lib/logger/HttpLogServiceClient.js +60 -0
  42. package/lib/logger/ILogServiceClient.d.ts +6 -0
  43. package/lib/logger/ILogServiceClient.js +1 -0
  44. package/lib/logger/ILogger.d.ts +6 -0
  45. package/lib/logger/LoggerBase.d.ts +6 -2
  46. package/lib/logger/LoggerBase.js +12 -1
  47. package/lib/logger/constants.d.ts +2 -0
  48. package/lib/logger/constants.js +2 -0
  49. package/lib/logger/index.d.ts +4 -0
  50. package/lib/logger/index.js +3 -0
  51. package/lib/logger/model/EnrichedLogRecord.d.ts +3 -0
  52. package/lib/logger/model/EnrichedLogRecord.js +1 -0
  53. package/lib/logger/model/LogMetadata.d.ts +9 -0
  54. package/lib/logger/model/LogMetadata.js +1 -0
  55. package/lib/logger/model/LogRecord.d.ts +6 -0
  56. package/lib/logger/model/LogRecord.js +1 -0
  57. package/lib/logger/model/index.d.ts +3 -0
  58. package/lib/logger/model/index.js +3 -0
  59. package/lib/phase/PhaseResult.d.ts +1 -1
  60. package/lib/phase/flow/EndEnforcerFlow.d.ts +6 -0
  61. package/lib/phase/flow/EndEnforcerFlow.js +10 -0
  62. package/lib/phase/flow/index.d.ts +1 -0
  63. package/lib/phase/flow/index.js +1 -0
  64. package/lib/phase/impl/SendLogsPhase.d.ts +11 -0
  65. package/lib/phase/impl/SendLogsPhase.js +26 -0
  66. package/lib/phase/impl/index.d.ts +1 -0
  67. package/lib/phase/impl/index.js +1 -0
  68. package/lib/products/account_defender/AccountDefender.d.ts +1 -1
  69. package/lib/products/account_defender/AccountDefenderData.d.ts +1 -1
  70. package/lib/products/account_defender/JwtData.d.ts +1 -1
  71. package/lib/products/bot_defender/BotDefender.d.ts +1 -1
  72. package/lib/products/bot_defender/BotDefenderData.d.ts +1 -1
  73. package/lib/products/bot_defender/block/model/BlockData.d.ts +1 -1
  74. package/lib/products/bot_defender/block/model/JsonBlockPayload.d.ts +1 -1
  75. package/lib/products/bot_defender/block/model/MobileBlockPayload.d.ts +1 -1
  76. package/lib/products/bot_defender/block/utils.js +5 -4
  77. package/lib/products/bot_defender/filter/DefaultBotDefenderFilter.js +5 -1
  78. package/lib/products/bot_defender/reasons/BotDefenderReasonType.d.ts +1 -1
  79. package/lib/products/credential_intelligence/endpoint/CredentialEndpointConfiguration.d.ts +1 -1
  80. package/lib/products/credential_intelligence/endpoint/login_successful/CustomLoginSuccessfulCallback.d.ts +1 -1
  81. package/lib/products/credential_intelligence/model/CredentialData.d.ts +1 -1
  82. package/lib/products/credential_intelligence/model/CredentialIntelligenceData.d.ts +1 -1
  83. package/lib/products/credential_intelligence/model/Credentials.d.ts +1 -1
  84. package/lib/products/credential_intelligence/model/CustomExtractionCallback.d.ts +1 -1
  85. package/lib/products/interfaces/ProductData.d.ts +1 -1
  86. package/lib/products/interfaces/ProductDataType.d.ts +1 -1
  87. package/lib/products/interfaces/ProductType.d.ts +1 -1
  88. package/lib/products/interfaces/Products.d.ts +1 -1
  89. package/lib/pxde/model/PXDE.d.ts +1 -1
  90. package/lib/pxde/model/PxdeData.d.ts +1 -1
  91. package/lib/pxhd/model/PXHD.d.ts +1 -1
  92. package/lib/risk_api/client/PostRiskApiClientBase.js +1 -1
  93. package/lib/risk_api/model/RiskActivity.d.ts +4 -4
  94. package/lib/risk_api/risk_response/RiskResponsePayloadType.d.ts +1 -1
  95. package/lib/risk_api/risk_response/v2/RiskResponseV2Payload.d.ts +1 -1
  96. package/lib/risk_api/risk_response/v3/RiskResponseV3Payload.d.ts +1 -1
  97. package/lib/risk_token/parser/DefaultTokenV2Parser.d.ts +1 -1
  98. package/lib/risk_token/parser/DefaultTokenV3Parser.d.ts +1 -1
  99. package/lib/risk_token/parser/TokenParserOptions.d.ts +1 -1
  100. package/lib/risk_token/token/TokenPayloadType.d.ts +1 -1
  101. package/lib/risk_token/token/v2/TokenV2Payload.d.ts +1 -1
  102. package/lib/risk_token/token/v3/TokenV3Payload.d.ts +1 -1
  103. package/lib/telemetry/model/TelemetryActivity.d.ts +2 -2
  104. package/lib/utils/cipher/ICipherUtils.d.ts +1 -1
  105. package/lib/utils/constants.d.ts +1 -1
  106. package/lib/utils/constants.js +1 -1
  107. package/lib/utils/index.d.ts +1 -0
  108. package/lib/utils/index.js +1 -0
  109. package/lib/utils/url_parser/DefaultUrlParser.d.ts +13 -0
  110. package/lib/utils/url_parser/DefaultUrlParser.js +21 -0
  111. package/lib/utils/url_parser/IURLParser.d.ts +4 -0
  112. package/lib/utils/url_parser/IURLParser.js +1 -0
  113. package/lib/utils/url_parser/index.d.ts +2 -0
  114. package/lib/utils/url_parser/index.js +2 -0
  115. package/lib/utils/utils.d.ts +5 -0
  116. package/lib/utils/utils.js +5 -1
  117. package/package.json +4 -4
@@ -0,0 +1,4 @@
1
+ import { IURL } from '../../http';
2
+ export interface IURLParser {
3
+ parse(rawUrl: string): IURL;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './IURLParser';
2
+ export * from './DefaultUrlParser';
@@ -0,0 +1,2 @@
1
+ export * from './IURLParser';
2
+ export * from './DefaultUrlParser';
@@ -6,6 +6,11 @@ export declare const getScoreApiDomain: (appId: string) => string;
6
6
  export declare const getCollectorDomain: (appId: string) => string;
7
7
  export declare const getAuthorizationHeader: (authToken: string) => string;
8
8
  export declare const getExtension: (route: string) => string;
9
+ /**
10
+ *
11
+ * @param rawUrl
12
+ * @deprecated use {@link IURLParser} instead.
13
+ */
9
14
  export declare const getDecodedUrl: (rawUrl: string) => IURL;
10
15
  export declare const removeSensitiveFields: <T extends Record<string, any>>(object: T, sensitiveFields: (keyof T)[]) => T;
11
16
  export declare const removeSensitiveHeaders: (headers: ReadonlyHeaders, sensitiveHeaderNames: string[]) => Record<string, string[]>;
@@ -39,8 +39,12 @@ export const getExtension = (route) => {
39
39
  }
40
40
  return endOfPath.substring(extensionIndex);
41
41
  };
42
+ /**
43
+ *
44
+ * @param rawUrl
45
+ * @deprecated use {@link IURLParser} instead.
46
+ */
42
47
  export const getDecodedUrl = (rawUrl) => {
43
- rawUrl = rawUrl.replace(/%/g, '%25');
44
48
  try {
45
49
  return new URL(decodeURIComponent(rawUrl));
46
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perimeterx-js-core",
3
- "version": "0.6.2",
3
+ "version": "0.7.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -35,7 +35,7 @@
35
35
  "@types/crypto-js": "^4.1.1",
36
36
  "@types/mocha": "^10.0.0",
37
37
  "@types/sinon": "^10.0.13",
38
- "@types/uuid": "^8.3.4",
38
+ "@types/uuid": "^9.0.2",
39
39
  "@typescript-eslint/eslint-plugin": "^5.40.0",
40
40
  "@typescript-eslint/parser": "^5.40.0",
41
41
  "chai": "^4.3.6",
@@ -49,10 +49,10 @@
49
49
  "mocha": "^10.0.0",
50
50
  "nyc": "^15.1.0",
51
51
  "prettier": "^2.7.1",
52
- "sinon": "^14.0.1",
52
+ "sinon": "^15.2.0",
53
53
  "ts-loader": "^9.4.1",
54
54
  "ts-node": "^10.9.1",
55
- "typescript": "^4.4.4"
55
+ "typescript": "^5.1.6"
56
56
  },
57
57
  "lint-staged": {
58
58
  "*.ts": "npm run lint:fix"