groupdocs-parser-cloud 23.10.0 → 25.9.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.
- package/LICENSE +1 -1
- package/lib/api_client.d.ts +17 -17
- package/lib/api_client.js +135 -125
- package/lib/api_error.d.ts +56 -56
- package/lib/api_error.js +81 -80
- package/lib/auth.d.ts +23 -22
- package/lib/auth.js +96 -71
- package/lib/configuration.d.ts +39 -39
- package/lib/configuration.js +56 -55
- package/lib/model.d.ts +2211 -2206
- package/lib/model.js +2180 -2169
- package/lib/package_version.d.ts +4 -4
- package/lib/package_version.js +30 -29
- package/lib/parser_api.d.ts +269 -270
- package/lib/parser_api.js +903 -893
- package/lib/serializer.d.ts +14 -14
- package/lib/serializer.js +171 -170
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +16 -14
package/lib/serializer.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serializer
|
|
3
|
-
*/
|
|
4
|
-
export declare class Serializer {
|
|
5
|
-
/**
|
|
6
|
-
* Serialize object to json string.
|
|
7
|
-
*/
|
|
8
|
-
static serialize(data: any, type: string): any;
|
|
9
|
-
/**
|
|
10
|
-
* Construct object from json string
|
|
11
|
-
*/
|
|
12
|
-
static deserialize(data: any, type: string): any;
|
|
13
|
-
private static findCorrectType;
|
|
14
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Serializer
|
|
3
|
+
*/
|
|
4
|
+
export declare class Serializer {
|
|
5
|
+
/**
|
|
6
|
+
* Serialize object to json string.
|
|
7
|
+
*/
|
|
8
|
+
static serialize(data: any, type: string): any;
|
|
9
|
+
/**
|
|
10
|
+
* Construct object from json string
|
|
11
|
+
*/
|
|
12
|
+
static deserialize(data: any, type: string): any;
|
|
13
|
+
private static findCorrectType;
|
|
14
|
+
}
|
package/lib/serializer.js
CHANGED
|
@@ -1,170 +1,171 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* The MIT License (MIT)
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c)
|
|
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
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
subType =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
subType =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
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
|
+
exports.Serializer = void 0;
|
|
27
|
+
const model_1 = require("./model");
|
|
28
|
+
const primitives = [
|
|
29
|
+
"string",
|
|
30
|
+
"boolean",
|
|
31
|
+
"double",
|
|
32
|
+
"integer",
|
|
33
|
+
"long",
|
|
34
|
+
"float",
|
|
35
|
+
"number",
|
|
36
|
+
"any",
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Serializer
|
|
40
|
+
*/
|
|
41
|
+
class Serializer {
|
|
42
|
+
/**
|
|
43
|
+
* Serialize object to json string.
|
|
44
|
+
*/
|
|
45
|
+
static serialize(data, type) {
|
|
46
|
+
if (data === undefined) {
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
else if (primitives.indexOf(type.toLowerCase()) !== -1) {
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
|
|
53
|
+
let subType = type.replace("Array<", ""); // Array<Type> => Type>
|
|
54
|
+
subType = subType.substring(0, subType.length - 1); // Type> => Type
|
|
55
|
+
const transformedData = [];
|
|
56
|
+
for (const index in data) {
|
|
57
|
+
if (data.hasOwnProperty(index)) {
|
|
58
|
+
const date = data[index];
|
|
59
|
+
transformedData.push(Serializer.serialize(date, subType));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return transformedData;
|
|
63
|
+
}
|
|
64
|
+
else if (type === "Date") {
|
|
65
|
+
return data.toISOString();
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (model_1.enumsMap[type]) {
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
if (!model_1.typeMap[type]) { // in case we dont know the type
|
|
72
|
+
return data;
|
|
73
|
+
}
|
|
74
|
+
// get the map for the correct type.
|
|
75
|
+
const attributeTypes = model_1.typeMap[type].getAttributeTypeMap();
|
|
76
|
+
const instance = {};
|
|
77
|
+
for (const index in attributeTypes) {
|
|
78
|
+
if (attributeTypes.hasOwnProperty(index)) {
|
|
79
|
+
const attributeType = attributeTypes[index];
|
|
80
|
+
if (data[attributeType.name] instanceof Object) {
|
|
81
|
+
instance[attributeType.baseName] = Serializer.serialize(data[attributeType.name], data[attributeType.name].constructor.name);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
instance[attributeType.baseName] = Serializer.serialize(data[attributeType.name], attributeType.type);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return instance;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Construct object from json string
|
|
93
|
+
*/
|
|
94
|
+
static deserialize(data, type) {
|
|
95
|
+
// polymorphism may change the actual type.
|
|
96
|
+
type = Serializer.findCorrectType(data, type);
|
|
97
|
+
if (data === undefined || data === null) {
|
|
98
|
+
return data;
|
|
99
|
+
}
|
|
100
|
+
else if (primitives.indexOf(type.toLowerCase()) !== -1) {
|
|
101
|
+
return data;
|
|
102
|
+
}
|
|
103
|
+
else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
|
|
104
|
+
let subType = type.replace("Array<", ""); // Array<Type> => Type>
|
|
105
|
+
subType = subType.substring(0, subType.length - 1); // Type> => Type
|
|
106
|
+
const transformedData = [];
|
|
107
|
+
for (const index in data) {
|
|
108
|
+
if (data.hasOwnProperty(index)) {
|
|
109
|
+
const date = data[index];
|
|
110
|
+
transformedData.push(Serializer.deserialize(date, subType));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return transformedData;
|
|
114
|
+
}
|
|
115
|
+
else if (type === "Date") {
|
|
116
|
+
return new Date(Date.parse(data));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
if (model_1.enumsMap[type]) { // is Enum
|
|
120
|
+
return data;
|
|
121
|
+
}
|
|
122
|
+
if (!model_1.typeMap[type]) { // dont know the type
|
|
123
|
+
return data;
|
|
124
|
+
}
|
|
125
|
+
const instance = new model_1.typeMap[type]();
|
|
126
|
+
const attributeTypes = model_1.typeMap[type].getAttributeTypeMap();
|
|
127
|
+
for (const index in attributeTypes) {
|
|
128
|
+
if (attributeTypes.hasOwnProperty(index)) {
|
|
129
|
+
const attributeType = attributeTypes[index];
|
|
130
|
+
if (data.hasOwnProperty(attributeType.baseName)) {
|
|
131
|
+
instance[attributeType.name] = Serializer.deserialize(data[attributeType.baseName], attributeType.type);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return instance;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
static findCorrectType(data, expectedType) {
|
|
139
|
+
if (data === undefined) {
|
|
140
|
+
return expectedType;
|
|
141
|
+
}
|
|
142
|
+
else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
|
|
143
|
+
return expectedType;
|
|
144
|
+
}
|
|
145
|
+
else if (expectedType === "Date") {
|
|
146
|
+
return expectedType;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
if (model_1.enumsMap[expectedType]) {
|
|
150
|
+
return expectedType;
|
|
151
|
+
}
|
|
152
|
+
if (!model_1.typeMap[expectedType]) {
|
|
153
|
+
return expectedType; // w/e we don't know the type
|
|
154
|
+
}
|
|
155
|
+
// Check the discriminator
|
|
156
|
+
const discriminatorProperty = model_1.typeMap[expectedType].discriminator;
|
|
157
|
+
if (discriminatorProperty == null) {
|
|
158
|
+
return expectedType; // the type does not have a discriminator. use it.
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
if (data[discriminatorProperty]) {
|
|
162
|
+
return data[discriminatorProperty]; // use the type given in the discriminator
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
return expectedType; // discriminator was not present (or an empty string)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.Serializer = Serializer;
|
|
@@ -0,0 +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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groupdocs-parser-cloud",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.9.0",
|
|
4
4
|
"description": "GroupDocs.Parser Cloud SDK for Node.js",
|
|
5
5
|
"homepage": "https://products.groupdocs.cloud/parser",
|
|
6
6
|
"author": {
|
|
@@ -31,19 +31,21 @@
|
|
|
31
31
|
"build:package": "npm pack"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
34
|
+
"axios": "1.6.2",
|
|
35
|
+
"form-data": "*",
|
|
36
|
+
"jsonwebtoken": "9.0.1",
|
|
37
|
+
"qs": "6.11.2"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@types/chai": "^4.
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"chai": "^4.
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
40
|
+
"@types/chai": "^4.2.14",
|
|
41
|
+
"@types/jsonwebtoken": "9.0.1",
|
|
42
|
+
"@types/mocha": "^5.2.7",
|
|
43
|
+
"@types/node": "^12.19.15",
|
|
44
|
+
"@types/qs": "^6.9.7",
|
|
45
|
+
"chai": "^4.2.0",
|
|
46
|
+
"mocha": "^10.2.0",
|
|
47
|
+
"ts-node": "^8.6.2",
|
|
48
|
+
"tslint": "^5.17.0",
|
|
49
|
+
"typescript": "^5.1.6"
|
|
48
50
|
}
|
|
49
|
-
}
|
|
51
|
+
}
|