celitech-sdk 1.1.73 → 1.1.75
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/.manifest.json +9 -9
- package/README.md +2 -2
- package/dist/http/hooks/custom-hook.d.ts.map +1 -1
- package/dist/http/hooks/custom-hook.js +7 -1
- package/dist/http/hooks/custom-hook.js.map +1 -1
- package/examples/package.json +1 -1
- package/package.json +1 -1
- package/src/http/hooks/custom-hook.ts +13 -1
package/.manifest.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"liblabVersion": "2.1.23",
|
|
3
|
-
"date": "2024-07-
|
|
3
|
+
"date": "2024-07-24T19:16:15.928Z",
|
|
4
4
|
"config": {
|
|
5
|
-
"apiId":
|
|
5
|
+
"apiId": 954,
|
|
6
6
|
"sdkName": "Celitech",
|
|
7
|
-
"sdkVersion": "1.1.
|
|
7
|
+
"sdkVersion": "1.1.75",
|
|
8
8
|
"liblabVersion": "2",
|
|
9
9
|
"deliveryMethods": ["zip"],
|
|
10
10
|
"languages": ["typescript"],
|
|
11
|
-
"apiVersion": "1.1.
|
|
11
|
+
"apiVersion": "1.1.75",
|
|
12
12
|
"specFilePath": "swagger.yaml",
|
|
13
13
|
"languageOptions": {
|
|
14
14
|
"python": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"pypiPackageName": "celitech-sdk",
|
|
27
27
|
"githubRepoName": "CelitechSDKPython",
|
|
28
28
|
"liblabVersion": "2",
|
|
29
|
-
"sdkVersion": "1.1.
|
|
29
|
+
"sdkVersion": "1.1.75"
|
|
30
30
|
},
|
|
31
31
|
"php": {
|
|
32
32
|
"packageName": "celitech-sdk/sdk",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"githubRepoName": "CelitechSDKPHP",
|
|
44
44
|
"liblabVersion": "2",
|
|
45
|
-
"sdkVersion": "1.1.
|
|
45
|
+
"sdkVersion": "1.1.75"
|
|
46
46
|
},
|
|
47
47
|
"typescript": {
|
|
48
48
|
"bundle": false,
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
],
|
|
62
62
|
"githubRepoName": "CelitechSDKTypeScript",
|
|
63
63
|
"liblabVersion": "2",
|
|
64
|
-
"sdkVersion": "1.1.
|
|
64
|
+
"sdkVersion": "1.1.75"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"publishing": {
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
},
|
|
102
102
|
"multiTenant": true,
|
|
103
103
|
"hooksLocation": {
|
|
104
|
-
"bucketKey": "
|
|
104
|
+
"bucketKey": "6374/hooks.zip",
|
|
105
105
|
"bucketName": "prod-liblab-api-stack-hooks"
|
|
106
106
|
},
|
|
107
|
-
"specUrl": "https://prod-liblab-api-stack-specs.s3.us-east-1.amazonaws.com/
|
|
107
|
+
"specUrl": "https://prod-liblab-api-stack-specs.s3.us-east-1.amazonaws.com/954/open-api-spec.yaml?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA5P3QKKDKGVNIJ2H7%2F20240724%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240724T191609Z&X-Amz-Expires=43200&X-Amz-Signature=0c00d31bf60658f87069ceebb261f0f3bf78aa85b9a7a4475795e1ea776ade33&X-Amz-SignedHeaders=host&x-id=GetObject",
|
|
108
108
|
"includeWatermark": false,
|
|
109
109
|
"language": "typescript",
|
|
110
110
|
"deliveryMethod": "zip",
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# Celitech TypeScript SDK 1.1.
|
|
1
|
+
# Celitech TypeScript SDK 1.1.75
|
|
2
2
|
|
|
3
3
|
Welcome to the Celitech SDK documentation. This guide will help you get started with integrating and using the Celitech SDK in your project.
|
|
4
4
|
|
|
5
5
|
## Versions
|
|
6
6
|
|
|
7
7
|
- API version: `1.1.0`
|
|
8
|
-
- SDK version: `1.1.
|
|
8
|
+
- SDK version: `1.1.75`
|
|
9
9
|
|
|
10
10
|
## About the API
|
|
11
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-hook.d.ts","sourceRoot":"","sources":["../../../src/http/hooks/custom-hook.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAK9D,qBAAa,UAAW,YAAW,IAAI;IACxB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"custom-hook.d.ts","sourceRoot":"","sources":["../../../src/http/hooks/custom-hook.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAK9D,qBAAa,UAAW,YAAW,IAAI;IACxB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAoD7F,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB3B,aAAa,CACxB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,EAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAIhB,OAAO,CAClB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,EAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,OAAO,CAAC,SAAS,CAAC;CAGtB"}
|
|
@@ -15,10 +15,14 @@ let CURRENT_EXPIRY = -1;
|
|
|
15
15
|
class CustomHook {
|
|
16
16
|
beforeRequest(request, params) {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
console.log('request', request);
|
|
19
|
+
console.log('params', params);
|
|
18
20
|
if (request.path.endsWith('/oauth/token'))
|
|
19
21
|
return request;
|
|
20
22
|
const clientId = params.get('clientId') || '';
|
|
21
23
|
const clientSecret = params.get('clientSecret') || '';
|
|
24
|
+
console.log('clientId', clientId);
|
|
25
|
+
console.log('clientSecret', clientSecret);
|
|
22
26
|
if (!clientId || !clientSecret) {
|
|
23
27
|
throw new Error('Missing clientId and/or clientSecret constructor parameters');
|
|
24
28
|
}
|
|
@@ -32,7 +36,8 @@ class CustomHook {
|
|
|
32
36
|
// Fetch a fresh Oauth token
|
|
33
37
|
// Retrieve the new access token and expiry, and set them to the global variables
|
|
34
38
|
const tokenResponse = yield this.getToken(input);
|
|
35
|
-
|
|
39
|
+
console.log('tokenResponse', tokenResponse);
|
|
40
|
+
const { expires_in, access_token } = tokenResponse;
|
|
36
41
|
if (!expires_in || !access_token) {
|
|
37
42
|
throw new Error('There is an issue with getting the oauth token');
|
|
38
43
|
}
|
|
@@ -41,6 +46,7 @@ class CustomHook {
|
|
|
41
46
|
}
|
|
42
47
|
// Set the Bearer token in the request header
|
|
43
48
|
const authorization = `Bearer ${CURRENT_TOKEN}`;
|
|
49
|
+
console.log('authorization', authorization);
|
|
44
50
|
if (!request.headers) {
|
|
45
51
|
request.headers = new Map();
|
|
46
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-hook.js","sourceRoot":"","sources":["../../../src/http/hooks/custom-hook.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,IAAI,aAAa,GAAG,EAAE,CAAC;AACvB,IAAI,cAAc,GAAG,CAAC,CAAC,CAAC;AAExB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ACjC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBACjB,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,KAAK,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC;KAAA;IAEY,aAAa,CACxB,OAAoB,EACpB,QAA2B,EAC3B,MAA2B;;YAE3B,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;IAEY,OAAO,CAClB,OAAoB,EACpB,QAA2B,EAC3B,MAA2B;;YAE3B,OAAO,IAAI,eAAe,CAAC,wBAAwB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC1E,CAAC;KAAA;CACF;AApFD,gCAoFC;AAED,MAAM,eAAe;IACnB,YACS,KAAa,EACb,QAAsB;QADtB,UAAK,GAAL,KAAK,CAAQ;QACb,aAAQ,GAAR,QAAQ,CAAc;IAC5B,CAAC;CACL"}
|
package/examples/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "celitech-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.75",
|
|
4
4
|
"description": "Welcome to the CELITECH API documentation! Useful links: [Homepage](https://www.celitech.com) | [Support email](mailto:support@celitech.com) | [Blog](https://www.celitech.com/blog/) ",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -7,10 +7,17 @@ let CURRENT_EXPIRY = -1;
|
|
|
7
7
|
|
|
8
8
|
export class CustomHook implements Hook {
|
|
9
9
|
public async beforeRequest(request: HttpRequest, params: Map<string, string>): Promise<HttpRequest> {
|
|
10
|
+
console.log('request', request);
|
|
11
|
+
console.log('params', params);
|
|
12
|
+
|
|
10
13
|
if (request.path.endsWith('/oauth/token')) return request;
|
|
11
14
|
|
|
12
15
|
const clientId = params.get('clientId') || '';
|
|
13
16
|
const clientSecret = params.get('clientSecret') || '';
|
|
17
|
+
|
|
18
|
+
console.log('clientId', clientId);
|
|
19
|
+
console.log('clientSecret', clientSecret);
|
|
20
|
+
|
|
14
21
|
if (!clientId || !clientSecret) {
|
|
15
22
|
throw new Error('Missing clientId and/or clientSecret constructor parameters');
|
|
16
23
|
}
|
|
@@ -26,7 +33,10 @@ export class CustomHook implements Hook {
|
|
|
26
33
|
// Fetch a fresh Oauth token
|
|
27
34
|
// Retrieve the new access token and expiry, and set them to the global variables
|
|
28
35
|
const tokenResponse = await this.getToken(input);
|
|
29
|
-
|
|
36
|
+
|
|
37
|
+
console.log('tokenResponse', tokenResponse);
|
|
38
|
+
|
|
39
|
+
const { expires_in, access_token } = tokenResponse;
|
|
30
40
|
|
|
31
41
|
if (!expires_in || !access_token) {
|
|
32
42
|
throw new Error('There is an issue with getting the oauth token');
|
|
@@ -38,6 +48,8 @@ export class CustomHook implements Hook {
|
|
|
38
48
|
// Set the Bearer token in the request header
|
|
39
49
|
const authorization = `Bearer ${CURRENT_TOKEN}`;
|
|
40
50
|
|
|
51
|
+
console.log('authorization', authorization);
|
|
52
|
+
|
|
41
53
|
if (!request.headers) {
|
|
42
54
|
request.headers = new Map();
|
|
43
55
|
}
|