@pageproof/sdk-pr 596.0.1753760086998 → 597.0.1754345488058
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/CHANGELOG.md +1 -5
- package/lib/api/Files.d.ts +2 -2
- package/lib/api/Files.js +1 -1
- package/lib/api/Proofs.d.ts +2 -1
- package/lib/api/Proofs.js +1 -1
- package/lib/enum/ResponseStatus.d.ts +0 -3
- package/lib/enum/ResponseStatus.js +1 -1
- package/lib/models/Proof.d.ts +6 -0
- package/lib/models/Proof.js +1 -1
- package/lib/network/Response.js +1 -1
- package/lib/pageproof.js +1 -1
- package/package.json +1 -1
- package/lib/util/errorMessages.d.ts +0 -76
- package/lib/util/errorMessages.js +0 -1
- package/lib/util/fileValidation.d.ts +0 -1
- package/lib/util/fileValidation.js +0 -1
package/package.json
CHANGED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get a user-friendly error message for an error code
|
|
3
|
-
* @param {number} code - The error code
|
|
4
|
-
* @param {string} fallbackMessage - Fallback message if code is not mapped
|
|
5
|
-
* @returns {string} User-friendly error message
|
|
6
|
-
*/
|
|
7
|
-
export function getErrorMessage(code: number, fallbackMessage: string): string;
|
|
8
|
-
export default ERROR_MESSAGES;
|
|
9
|
-
/**
|
|
10
|
-
* Error code to user-friendly message mapping
|
|
11
|
-
* Based on PageProofErrorCode enum
|
|
12
|
-
*/
|
|
13
|
-
declare const ERROR_MESSAGES: {
|
|
14
|
-
400: string;
|
|
15
|
-
401: string;
|
|
16
|
-
404: string;
|
|
17
|
-
406: string;
|
|
18
|
-
407: string;
|
|
19
|
-
1010: string;
|
|
20
|
-
1011: string;
|
|
21
|
-
1012: string;
|
|
22
|
-
1013: string;
|
|
23
|
-
1014: string;
|
|
24
|
-
1015: string;
|
|
25
|
-
1016: string;
|
|
26
|
-
1017: string;
|
|
27
|
-
1018: string;
|
|
28
|
-
1019: string;
|
|
29
|
-
1020: string;
|
|
30
|
-
1021: string;
|
|
31
|
-
1022: string;
|
|
32
|
-
1023: string;
|
|
33
|
-
1024: string;
|
|
34
|
-
4001: string;
|
|
35
|
-
4002: string;
|
|
36
|
-
4005: string;
|
|
37
|
-
4006: string;
|
|
38
|
-
4007: string;
|
|
39
|
-
4008: string;
|
|
40
|
-
100: string;
|
|
41
|
-
101: string;
|
|
42
|
-
102: string;
|
|
43
|
-
124: string;
|
|
44
|
-
125: string;
|
|
45
|
-
126: string;
|
|
46
|
-
402: string;
|
|
47
|
-
403: string;
|
|
48
|
-
1000: string;
|
|
49
|
-
1001: string;
|
|
50
|
-
1002: string;
|
|
51
|
-
1003: string;
|
|
52
|
-
1004: string;
|
|
53
|
-
1005: string;
|
|
54
|
-
2010: string;
|
|
55
|
-
2011: string;
|
|
56
|
-
3000: string;
|
|
57
|
-
6005: string;
|
|
58
|
-
3001: string;
|
|
59
|
-
3002: string;
|
|
60
|
-
3003: string;
|
|
61
|
-
3004: string;
|
|
62
|
-
5000: string;
|
|
63
|
-
6000: string;
|
|
64
|
-
6001: string;
|
|
65
|
-
6002: string;
|
|
66
|
-
6003: string;
|
|
67
|
-
6004: string;
|
|
68
|
-
6500: string;
|
|
69
|
-
106: string;
|
|
70
|
-
110: string;
|
|
71
|
-
120: string;
|
|
72
|
-
121: string;
|
|
73
|
-
122: string;
|
|
74
|
-
123: string;
|
|
75
|
-
7000: string;
|
|
76
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;exports.getErrorMessage=getErrorMessage;var ERROR_MESSAGES={400:"Bad request: The request contains invalid data.",401:"Unauthorized: Please log in to access this resource.",404:"Not found: The requested resource does not exist.",406:"Authentication failed.",407:"Authentication failed.",1010:"Authentication failed.",1011:"Authentication failed.",1012:"Operation failed. Please contact support.",1013:"Invalid format.",1014:"Too many requests. Please try again later.",1015:"Access unavailable. Please contact support.",1016:"System error. Please contact support.",1017:"Authentication failed.",1018:"Invalid or expired code.",1019:"Invalid or expired code.",1020:"System error. Please contact support.",1021:"Access denied. Please contact support.",1022:"Invalid or expired code.",1023:"Invalid or expired code.",1024:"System error. Please contact support.",4001:"File upload failed: Unable to queue file for processing.",4002:"File upload failed: Queueing process failed.",4005:"File upload failed: Invalid filename. Please use only letters, numbers, and standard characters.",4006:"File upload failed: This file is already attached to another proof.",4007:"File upload failed: File is missing a file extension. Please ensure your file has a proper extension (e.g., .pdf, .jpg).",4008:"File upload failed: Unsupported file type. Please check the supported file formats.",100:"Access denied. Please contact support if you believe this is an error.",101:"Access denied. Please contact support if you believe this is an error.",102:"Resource temporarily unavailable. Please try again later.",124:"Access denied. Please contact support if you believe this is an error.",125:"Access denied. Please contact support if you believe this is an error.",126:"Access denied. Please contact support if you believe this is an error.",402:"Access denied. Please contact support if you believe this is an error.",403:"Operation not supported.",1e3:"Resource not found.",1001:"Failed to create resource.",1002:"Failed to update resource.",1003:"Failed to delete resource.",1004:"Resource already exists.",1005:"System configuration error. Please contact support.",2010:"Invalid format.",2011:"Invalid request.",3e3:"Account upgrade required. Please contact support.",6005:"Feature not available. Please contact support.",3001:"Group workflow has already been started.",3002:"A group with this name already exists.",3003:"Cannot delete group: active proofs exist.",3004:"No proofs found for this group.",5e3:"Resource already exists.",6e3:"Invalid format. Please check your input.",6001:"Verification failed. Please contact support.",6002:"Invalid format. Please check your input.",6003:"Required information missing. Please contact support.",6004:"Resource unavailable. Please try a different option.",6500:"Prerequisites not met. Please contact support.",106:"System error. Please try again later.",110:"System error. Please try again later.",120:"System error. Please try again later.",121:"System error. Please try again later.",122:"Operation failed. Please try again.",123:"Operation failed. Please try again.",7e3:"Internal server error. Please try again later."};function getErrorMessage(code,fallbackMessage){return ERROR_MESSAGES[code]||fallbackMessage||"Unknown error occurred (Code: "+code+"). Please contact support."}exports.default=ERROR_MESSAGES;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};var _errorMessages=require("./errorMessages");var _ResponseStatus=require("../enum/ResponseStatus");var _ResponseStatus2=_interopRequireDefault(_ResponseStatus);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function createValidationError(code,fallbackMessage){var message=(0,_errorMessages.getErrorMessage)(code,fallbackMessage);return{error:true,code:code||-1,data:{ResponseStatus:code?Object.keys(_ResponseStatus2.default).find(function(key){return _ResponseStatus2.default[key]===code})||"UNKNOWN":"UNKNOWN",ResponseCode:code||-1},message:message,deprecated:null}}function parseFilename(filename){if(!filename||typeof filename!=="string"){var errorResponse=createValidationError(_ResponseStatus2.default.ERROR_FILE_UPLOAD_INVALID_FILENAME,"Filename must be a non-empty string");throw errorResponse}var extensionIndex=filename.lastIndexOf(".");if(extensionIndex===-1||extensionIndex===filename.length-1){var _errorResponse=createValidationError(_ResponseStatus2.default.ERROR_FILE_UPLOAD_MISSING_EXTENSION,'Invalid filename "'+filename+'". Filename must include a file extension');throw _errorResponse}if(extensionIndex===0){var _errorResponse2=createValidationError(_ResponseStatus2.default.ERROR_FILE_UPLOAD_INVALID_FILENAME);throw _errorResponse2}var name=filename.substring(0,extensionIndex);var extension=filename.substring(extensionIndex+1);if(!name.trim()){var _errorResponse3=createValidationError(_ResponseStatus2.default.ERROR_FILE_UPLOAD_INVALID_FILENAME);throw _errorResponse3}if(!extension.trim()){var _errorResponse4=createValidationError(_ResponseStatus2.default.ERROR_FILE_UPLOAD_MISSING_EXTENSION);throw _errorResponse4}return{name:name.trim(),extension:extension.trim().toLowerCase()}}function validateFiles(files){if(!Array.isArray(files)){var error=new Error("Files must be an array");throw error}files.forEach(function(file,index){if(!file||(typeof file==="undefined"?"undefined":_typeof(file))!=="object"){var _error=new Error("File at index "+index+" must be an object");throw _error}if(!file.name||typeof file.name!=="string"){var _error2=new Error("File at index "+index+" must have a valid name (string)");throw _error2}if(!file.contents){var _error3=new Error("File at index "+index+" must have contents");throw _error3}})}function addParsedFilenames(files){return files.map(function(file){var parsedFilename=null;if(!file.extension){try{parsedFilename=parseFilename(file.name)}catch(error){throw error}}return _extends({},file,{parsedFilename:parsedFilename})})}function prepareFilesForUpload(files){validateFiles(files);return addParsedFilenames(files)}module.exports={parseFilename:parseFilename,validateFiles:validateFiles,addParsedFilenames:addParsedFilenames,prepareFilesForUpload:prepareFilesForUpload};
|