groupdocs-parser-cloud 23.7.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/auth.js
CHANGED
|
@@ -1,71 +1,96 @@
|
|
|
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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
step(
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.OAuth = void 0;
|
|
36
|
+
const jwt = require("jsonwebtoken");
|
|
37
|
+
const api_client_1 = require("./api_client");
|
|
38
|
+
const qs = require("qs");
|
|
39
|
+
/**
|
|
40
|
+
* Implements OAuth authentication
|
|
41
|
+
*/
|
|
42
|
+
class OAuth {
|
|
43
|
+
/**
|
|
44
|
+
* Apply authentication settings to header and query params
|
|
45
|
+
*/
|
|
46
|
+
applyToRequest(requestOptions, configuration) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
if (this.accessToken == null || !this.isTokenValid()) {
|
|
49
|
+
yield this._requestToken(configuration);
|
|
50
|
+
}
|
|
51
|
+
if (requestOptions && requestOptions.headers) {
|
|
52
|
+
requestOptions.headers.Authorization = "Bearer " + this.accessToken;
|
|
53
|
+
}
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
_requestToken(configuration) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const requestOptions = {
|
|
60
|
+
method: "post",
|
|
61
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
62
|
+
maxBodyLength: Infinity,
|
|
63
|
+
url: configuration.apiBaseUrl + "/connect/token",
|
|
64
|
+
data: qs.stringify({
|
|
65
|
+
grant_type: "client_credentials",
|
|
66
|
+
client_id: configuration.appSid,
|
|
67
|
+
client_secret: configuration.appKey,
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
const response = yield (0, api_client_1.invokeApiMethod)(requestOptions, configuration, true);
|
|
71
|
+
this.accessToken = response.data.access_token;
|
|
72
|
+
return Promise.resolve();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
isTokenValid() {
|
|
76
|
+
try {
|
|
77
|
+
const decodedToken = jwt.decode(this.accessToken);
|
|
78
|
+
if (!decodedToken) {
|
|
79
|
+
console.log("Invalid token.");
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const expirationTime = decodedToken.exp;
|
|
83
|
+
const currentTime = Math.floor(Date.now() / 1000);
|
|
84
|
+
if (currentTime <= expirationTime) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.OAuth = OAuth;
|
package/lib/configuration.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { IAuthentication } from "./auth";
|
|
2
|
-
/**
|
|
3
|
-
* Words API configuration
|
|
4
|
-
*/
|
|
5
|
-
export declare class Configuration {
|
|
6
|
-
/**
|
|
7
|
-
* Authentication
|
|
8
|
-
*/
|
|
9
|
-
authentication: IAuthentication;
|
|
10
|
-
/**
|
|
11
|
-
* Application identifier (App SID)
|
|
12
|
-
*/
|
|
13
|
-
appSid: string;
|
|
14
|
-
/**
|
|
15
|
-
* Application private key (App Key)
|
|
16
|
-
*/
|
|
17
|
-
appKey: string;
|
|
18
|
-
/**
|
|
19
|
-
* API base URL, default is 'https://api.groupdocs.cloud'
|
|
20
|
-
*/
|
|
21
|
-
apiBaseUrl: string;
|
|
22
|
-
/**
|
|
23
|
-
* Gets or sets the API version
|
|
24
|
-
*/
|
|
25
|
-
apiVersion: string;
|
|
26
|
-
/**
|
|
27
|
-
* When enabled all requests and responses are logged to console
|
|
28
|
-
*/
|
|
29
|
-
debugging: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* @param appSid Application identifier (App SID)
|
|
32
|
-
* @param appKey Application private key (App Key)
|
|
33
|
-
*/
|
|
34
|
-
constructor(appSid: string, appKey: string);
|
|
35
|
-
/**
|
|
36
|
-
* Returns server url e.g "https://api.groupdocs.cloud/1.0"
|
|
37
|
-
*/
|
|
38
|
-
getServerUrl(): string;
|
|
39
|
-
}
|
|
1
|
+
import { IAuthentication } from "./auth";
|
|
2
|
+
/**
|
|
3
|
+
* Words API configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare class Configuration {
|
|
6
|
+
/**
|
|
7
|
+
* Authentication
|
|
8
|
+
*/
|
|
9
|
+
authentication: IAuthentication;
|
|
10
|
+
/**
|
|
11
|
+
* Application identifier (App SID)
|
|
12
|
+
*/
|
|
13
|
+
appSid: string;
|
|
14
|
+
/**
|
|
15
|
+
* Application private key (App Key)
|
|
16
|
+
*/
|
|
17
|
+
appKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* API base URL, default is 'https://api.groupdocs.cloud'
|
|
20
|
+
*/
|
|
21
|
+
apiBaseUrl: string;
|
|
22
|
+
/**
|
|
23
|
+
* Gets or sets the API version
|
|
24
|
+
*/
|
|
25
|
+
apiVersion: string;
|
|
26
|
+
/**
|
|
27
|
+
* When enabled all requests and responses are logged to console
|
|
28
|
+
*/
|
|
29
|
+
debugging: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @param appSid Application identifier (App SID)
|
|
32
|
+
* @param appKey Application private key (App Key)
|
|
33
|
+
*/
|
|
34
|
+
constructor(appSid: string, appKey: string);
|
|
35
|
+
/**
|
|
36
|
+
* Returns server url e.g "https://api.groupdocs.cloud/1.0"
|
|
37
|
+
*/
|
|
38
|
+
getServerUrl(): string;
|
|
39
|
+
}
|
package/lib/configuration.js
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* @param
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
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.Configuration = void 0;
|
|
27
|
+
const auth_1 = require("./auth");
|
|
28
|
+
/**
|
|
29
|
+
* Words API configuration
|
|
30
|
+
*/
|
|
31
|
+
class Configuration {
|
|
32
|
+
/**
|
|
33
|
+
* @param appSid Application identifier (App SID)
|
|
34
|
+
* @param appKey Application private key (App Key)
|
|
35
|
+
*/
|
|
36
|
+
constructor(appSid, appKey) {
|
|
37
|
+
/**
|
|
38
|
+
* API base URL, default is 'https://api.groupdocs.cloud'
|
|
39
|
+
*/
|
|
40
|
+
this.apiBaseUrl = "https://api-qa.groupdocs.cloud";
|
|
41
|
+
/**
|
|
42
|
+
* Gets or sets the API version
|
|
43
|
+
*/
|
|
44
|
+
this.apiVersion = "/v1.0";
|
|
45
|
+
this.appSid = appSid;
|
|
46
|
+
this.appKey = appKey;
|
|
47
|
+
this.authentication = new auth_1.OAuth();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns server url e.g "https://api.groupdocs.cloud/1.0"
|
|
51
|
+
*/
|
|
52
|
+
getServerUrl() {
|
|
53
|
+
return this.apiBaseUrl + this.apiVersion;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.Configuration = Configuration;
|