groupdocs-parser-cloud 25.9.0 → 26.2.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 (48) hide show
  1. package/lib/{model.d.ts → src/model.d.ts} +37 -0
  2. package/lib/{model.js → src/model.js} +38 -2
  3. package/lib/{package_version.js → src/package_version.js} +1 -1
  4. package/lib/{parser_api.d.ts → src/parser_api.d.ts} +5 -0
  5. package/lib/{parser_api.js → src/parser_api.js} +27 -0
  6. package/lib/test/api/test_auth_api.d.ts +1 -0
  7. package/lib/test/api/test_auth_api.js +45 -0
  8. package/lib/test/api/test_barcode_api.d.ts +1 -0
  9. package/lib/test/api/test_barcode_api.js +64 -0
  10. package/lib/test/api/test_file_api.d.ts +1 -0
  11. package/lib/test/api/test_file_api.js +95 -0
  12. package/lib/test/api/test_folder_api.d.ts +1 -0
  13. package/lib/test/api/test_folder_api.js +84 -0
  14. package/lib/test/api/test_formats_api.d.ts +1 -0
  15. package/lib/test/api/test_formats_api.js +60 -0
  16. package/lib/test/api/test_parser_container_api.d.ts +1 -0
  17. package/lib/test/api/test_parser_container_api.js +134 -0
  18. package/lib/test/api/test_parser_image_api.d.ts +1 -0
  19. package/lib/test/api/test_parser_image_api.js +179 -0
  20. package/lib/test/api/test_parser_info_api.d.ts +1 -0
  21. package/lib/test/api/test_parser_info_api.js +112 -0
  22. package/lib/test/api/test_parser_parse_api.d.ts +1 -0
  23. package/lib/test/api/test_parser_parse_api.js +184 -0
  24. package/lib/test/api/test_parser_template_api.d.ts +1 -0
  25. package/lib/test/api/test_parser_template_api.js +168 -0
  26. package/lib/test/api/test_parser_text_api.d.ts +1 -0
  27. package/lib/test/api/test_parser_text_api.js +180 -0
  28. package/lib/test/api/test_storage_api.d.ts +1 -0
  29. package/lib/test/api/test_storage_api.js +76 -0
  30. package/lib/test/test_context.d.ts +30 -0
  31. package/lib/test/test_context.js +156 -0
  32. package/lib/test/test_coverage.d.ts +1 -0
  33. package/lib/test/test_coverage.js +77 -0
  34. package/lib/test/test_file.d.ts +50 -0
  35. package/lib/test/test_file.js +92 -0
  36. package/lib/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +3 -3
  38. /package/lib/{api_client.d.ts → src/api_client.d.ts} +0 -0
  39. /package/lib/{api_client.js → src/api_client.js} +0 -0
  40. /package/lib/{api_error.d.ts → src/api_error.d.ts} +0 -0
  41. /package/lib/{api_error.js → src/api_error.js} +0 -0
  42. /package/lib/{auth.d.ts → src/auth.d.ts} +0 -0
  43. /package/lib/{auth.js → src/auth.js} +0 -0
  44. /package/lib/{configuration.d.ts → src/configuration.d.ts} +0 -0
  45. /package/lib/{configuration.js → src/configuration.js} +0 -0
  46. /package/lib/{package_version.d.ts → src/package_version.d.ts} +0 -0
  47. /package/lib/{serializer.d.ts → src/serializer.d.ts} +0 -0
  48. /package/lib/{serializer.js → src/serializer.js} +0 -0
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) Aspose Pty Ltd
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ require("mocha");
27
+ const assert_1 = require("assert");
28
+ const fs = require("fs");
29
+ const TestContext = require("./test_context");
30
+ const testFolder = "./test/";
31
+ describe("API method coverage", () => {
32
+ it("each api method should be covered with at least 1 test'", () => {
33
+ const methods = getAllMethods(TestContext.getParseApi()).concat(getAllMethods(TestContext.getInfoApi())).concat(getAllMethods(TestContext.getTemplateApi()));
34
+ const filesWithTests = getFileList(testFolder, null).filter((p) => p.endsWith(".ts"));
35
+ methods.forEach((method) => {
36
+ let usageOfMethodFound = false;
37
+ filesWithTests.forEach((file) => {
38
+ const fileContent = fs.readFileSync(file, "utf8");
39
+ if (fileContent.indexOf("." + method) > 0) {
40
+ usageOfMethodFound = true;
41
+ }
42
+ });
43
+ if (!usageOfMethodFound) {
44
+ (0, assert_1.fail)("usage of api method '" + method + "' not found");
45
+ }
46
+ });
47
+ });
48
+ });
49
+ const getAllMethods = (obj) => {
50
+ let props = [];
51
+ do {
52
+ const l = Object.getOwnPropertyNames(obj)
53
+ .concat(Object.getOwnPropertySymbols(obj).map((s) => s.toString()))
54
+ .sort()
55
+ .filter((p, i, arr) => typeof obj[p] === "function" && // only the methods
56
+ p !== "constructor" && // not the constructor
57
+ (i === 0 || p !== arr[i - 1]) && // not overriding in this prototype
58
+ props.indexOf(p) === -1); // not overridden in a child
59
+ props = props.concat(l);
60
+ obj = Object.getPrototypeOf(obj); // walk-up the prototype chain
61
+ } while (Object.getPrototypeOf(obj) // not the the Object prototype methods (hasOwnProperty, etc...)
62
+ );
63
+ return props;
64
+ };
65
+ const getFileList = (dir, fileList) => {
66
+ const files = fs.readdirSync(dir);
67
+ fileList = fileList || [];
68
+ files.forEach((file) => {
69
+ if (fs.statSync(dir + "/" + file).isDirectory()) {
70
+ fileList = fileList.concat(getFileList(dir + "/" + file, []));
71
+ }
72
+ else {
73
+ fileList.push(dir + "/" + file);
74
+ }
75
+ });
76
+ return fileList;
77
+ };
@@ -0,0 +1,50 @@
1
+ import { FileInfo } from "../src/model";
2
+ /**
3
+ * Describes test file
4
+ */
5
+ export declare class TestFile {
6
+ static PasswordProtected: TestFile;
7
+ static FourPages: TestFile;
8
+ static OnePage: TestFile;
9
+ static TemplateDocumentDocx: TestFile;
10
+ static FormattedDocument: TestFile;
11
+ static EncodingDetection: TestFile;
12
+ static Zip: TestFile;
13
+ static ZipWithEmailImagePdf: TestFile;
14
+ static JpegFile: TestFile;
15
+ static ImageAndAttachment: TestFile;
16
+ static Pdf: TestFile;
17
+ static PdfContainer: TestFile;
18
+ static Rar: TestFile;
19
+ static Tar: TestFile;
20
+ static Md: TestFile;
21
+ static Video: TestFile;
22
+ static NotExist: TestFile;
23
+ static Invoice: TestFile;
24
+ /**
25
+ * File name
26
+ */
27
+ fileName: string;
28
+ /**
29
+ * Folder where file is located
30
+ */
31
+ folder: string;
32
+ /**
33
+ * File password
34
+ */
35
+ password?: string;
36
+ /**
37
+ * Returns test file path
38
+ */
39
+ GetPath(): string;
40
+ /**
41
+ * Returns FileInfo
42
+ */
43
+ ToFileInfo(): FileInfo;
44
+ /**
45
+ * Attachment password
46
+ */
47
+ attachmentPassword: string | undefined;
48
+ private constructor();
49
+ static GetTestFiles(): TestFile[];
50
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TestFile = void 0;
4
+ /*
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright (c) Aspose Pty Ltd
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+ const model_1 = require("../src/model");
28
+ /**
29
+ * Describes test file
30
+ */
31
+ class TestFile {
32
+ /**
33
+ * Returns test file path
34
+ */
35
+ GetPath() {
36
+ return this.folder + this.fileName;
37
+ }
38
+ /**
39
+ * Returns FileInfo
40
+ */
41
+ ToFileInfo() {
42
+ let fileInfo = new model_1.FileInfo();
43
+ fileInfo.filePath = this.GetPath();
44
+ if (this.password)
45
+ fileInfo.password = this.password;
46
+ return fileInfo;
47
+ }
48
+ constructor(fileName, folder, password) {
49
+ this.fileName = fileName;
50
+ this.folder = folder;
51
+ this.password = password;
52
+ }
53
+ static GetTestFiles() {
54
+ return [
55
+ TestFile.PasswordProtected,
56
+ TestFile.FourPages,
57
+ TestFile.OnePage,
58
+ TestFile.TemplateDocumentDocx,
59
+ TestFile.FormattedDocument,
60
+ TestFile.EncodingDetection,
61
+ TestFile.Zip,
62
+ TestFile.ZipWithEmailImagePdf,
63
+ TestFile.JpegFile,
64
+ TestFile.ImageAndAttachment,
65
+ TestFile.Pdf,
66
+ TestFile.PdfContainer,
67
+ TestFile.Rar,
68
+ TestFile.Tar,
69
+ TestFile.Md,
70
+ TestFile.Invoice
71
+ ];
72
+ }
73
+ }
74
+ exports.TestFile = TestFile;
75
+ TestFile.PasswordProtected = new TestFile("password-protected.docx", "words/docx/", "password");
76
+ TestFile.FourPages = new TestFile("four-pages.docx", "words/docx/");
77
+ TestFile.OnePage = new TestFile("one-page.docx", "words/docx/");
78
+ TestFile.TemplateDocumentDocx = new TestFile("template-document.docx", "words/docx/");
79
+ TestFile.FormattedDocument = new TestFile("formatted-document.docx", "words/docx/");
80
+ TestFile.EncodingDetection = new TestFile("encoding-detection.txt", "words/txt/");
81
+ TestFile.Zip = new TestFile("docx.zip", "containers/archive/");
82
+ TestFile.ZipWithEmailImagePdf = new TestFile("zip-eml-jpg-pdf.zip", "containers/archive/");
83
+ TestFile.JpegFile = new TestFile("document.jpeg", "image/jpeg/");
84
+ TestFile.ImageAndAttachment = new TestFile("embedded-image-and-attachment.eml", "email/eml/");
85
+ TestFile.Pdf = new TestFile("template-document.pdf", "pdf/");
86
+ TestFile.PdfContainer = new TestFile("PDF with attachements.pdf", "pdf/", "password");
87
+ TestFile.Rar = new TestFile("sample.rar", "containers/archive/");
88
+ TestFile.Tar = new TestFile("sample.tar", "containers/archive/");
89
+ TestFile.Md = new TestFile("sample.md", "words/docx/");
90
+ TestFile.Video = new TestFile("sample.avi", "video/avi/");
91
+ TestFile.NotExist = new TestFile("file-not-exist.pdf", "folder/");
92
+ TestFile.Invoice = new TestFile("Invoice.xlsx", "cells/");
@@ -1 +1 @@
1
- {"root":["../src/api_client.ts","../src/api_error.ts","../src/auth.ts","../src/configuration.ts","../src/model.ts","../src/package_version.ts","../src/parser_api.ts","../src/serializer.ts"],"version":"5.9.2"}
1
+ {"root":["../src/api_client.ts","../src/api_error.ts","../src/auth.ts","../src/configuration.ts","../src/model.ts","../src/package_version.ts","../src/parser_api.ts","../src/serializer.ts","../test/test_context.ts","../test/test_coverage.ts","../test/test_file.ts","../test/api/test_auth_api.ts","../test/api/test_barcode_api.ts","../test/api/test_file_api.ts","../test/api/test_folder_api.ts","../test/api/test_formats_api.ts","../test/api/test_parser_container_api.ts","../test/api/test_parser_image_api.ts","../test/api/test_parser_info_api.ts","../test/api/test_parser_parse_api.ts","../test/api/test_parser_template_api.ts","../test/api/test_parser_text_api.ts","../test/api/test_storage_api.ts"],"version":"5.9.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groupdocs-parser-cloud",
3
- "version": "25.9.0",
3
+ "version": "26.2.0",
4
4
  "description": "GroupDocs.Parser Cloud SDK for Node.js",
5
5
  "homepage": "https://products.groupdocs.cloud/parser",
6
6
  "author": {
@@ -31,10 +31,10 @@
31
31
  "build:package": "npm pack"
32
32
  },
33
33
  "dependencies": {
34
- "axios": "1.6.2",
34
+ "axios": "1.13.5",
35
35
  "form-data": "*",
36
36
  "jsonwebtoken": "9.0.1",
37
- "qs": "6.11.2"
37
+ "qs": "6.14.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/chai": "^4.2.14",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes