Skip to content

Commit c4c7c20

Browse files
author
SSOfy
committed
v2.0.0 build
1 parent af5e98d commit c4c7c20

8 files changed

+28
-28
lines changed

build/Client.d.ts build/APIClient.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { ClientConfig } from "./ClientConfig";
1+
import { APIConfig } from "./APIConfig";
22
import { APIResponse } from "./Models/APIResponse";
3-
export declare class Client {
3+
export declare class APIClient {
44
private config;
55
private readonly cache;
66
private readonly signatureGenerator;
7-
constructor(config: ClientConfig);
7+
constructor(config: APIConfig);
88
verifyAuthentication(token: string): Promise<APIResponse>;
99
authenticatedUser(token: string, cache?: boolean): Promise<APIResponse>;
1010
findUserById(id: string, cache?: boolean): Promise<APIResponse>;

build/Client.js build/APIClient.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
5959
}
6060
};
6161
Object.defineProperty(exports, "__esModule", { value: true });
62-
exports.Client = void 0;
62+
exports.APIClient = void 0;
6363
var axios_1 = __importStar(require("axios"));
6464
var NullStorage_1 = require("./Storage/NullStorage");
6565
var InvalidTokenError_1 = require("./Errors/InvalidTokenError");
6666
var SignatureGenerator_1 = require("./SignatureGenerator");
6767
var SignatureVerificationError_1 = require("./Errors/SignatureVerificationError");
6868
var APIError_1 = require("./Errors/APIError");
6969
var SignatureValidator_1 = require("./SignatureValidator");
70-
var Client = /** @class */ (function () {
71-
function Client(config) {
70+
var APIClient = /** @class */ (function () {
71+
function APIClient(config) {
7272
this.config = config;
7373
this.config.cacheTtl = config.cacheTtl || 60 * 60 * 3;
7474
this.config.secure = config.secure || false;
@@ -80,7 +80,7 @@ var Client = /** @class */ (function () {
8080
}
8181
this.signatureGenerator = new SignatureGenerator_1.SignatureGenerator();
8282
}
83-
Client.prototype.verifyAuthentication = function (token) {
83+
APIClient.prototype.verifyAuthentication = function (token) {
8484
return __awaiter(this, void 0, void 0, function () {
8585
var path, response;
8686
return __generator(this, function (_a) {
@@ -97,7 +97,7 @@ var Client = /** @class */ (function () {
9797
});
9898
});
9999
};
100-
Client.prototype.authenticatedUser = function (token, cache) {
100+
APIClient.prototype.authenticatedUser = function (token, cache) {
101101
if (cache === void 0) { cache = false; }
102102
return __awaiter(this, void 0, void 0, function () {
103103
var path, response;
@@ -116,7 +116,7 @@ var Client = /** @class */ (function () {
116116
});
117117
});
118118
};
119-
Client.prototype.findUserById = function (id, cache) {
119+
APIClient.prototype.findUserById = function (id, cache) {
120120
if (cache === void 0) { cache = false; }
121121
return __awaiter(this, void 0, void 0, function () {
122122
var path, response;
@@ -136,22 +136,22 @@ var Client = /** @class */ (function () {
136136
});
137137
});
138138
};
139-
Client.prototype.invalidateTokenCache = function (token) {
139+
APIClient.prototype.invalidateTokenCache = function (token) {
140140
return __awaiter(this, void 0, void 0, function () {
141141
return __generator(this, function (_a) {
142142
switch (_a.label) {
143-
case 0: return [4 /*yield*/, this.cache.delete("v1/authenticated/verify:".concat(token))];
143+
case 0: return [4 /*yield*/, this.cache.delete("request:v1/authenticated/verify:".concat(token))];
144144
case 1:
145145
_a.sent();
146-
return [4 /*yield*/, this.cache.delete("v1/authenticated/user:".concat(token))];
146+
return [4 /*yield*/, this.cache.delete("request:v1/authenticated/user:".concat(token))];
147147
case 2:
148148
_a.sent();
149149
return [2 /*return*/];
150150
}
151151
});
152152
});
153153
};
154-
Client.prototype.purgeTokenCache = function () {
154+
APIClient.prototype.purgeTokenCache = function () {
155155
return __awaiter(this, void 0, void 0, function () {
156156
return __generator(this, function (_a) {
157157
switch (_a.label) {
@@ -163,7 +163,7 @@ var Client = /** @class */ (function () {
163163
});
164164
});
165165
};
166-
Client.prototype.requestAndCache = function (path, token, fields, cache) {
166+
APIClient.prototype.requestAndCache = function (path, token, fields, cache) {
167167
if (fields === void 0) { fields = {}; }
168168
if (cache === void 0) { cache = true; }
169169
return __awaiter(this, void 0, void 0, function () {
@@ -232,7 +232,7 @@ var Client = /** @class */ (function () {
232232
});
233233
});
234234
};
235-
Client.prototype.request = function (path, fields, post) {
235+
APIClient.prototype.request = function (path, fields, post) {
236236
if (path === void 0) { path = '/'; }
237237
if (fields === void 0) { fields = {}; }
238238
if (post === void 0) { post = false; }
@@ -289,17 +289,17 @@ var Client = /** @class */ (function () {
289289
});
290290
});
291291
};
292-
Client.prototype.sanitizeToken = function (token) {
292+
APIClient.prototype.sanitizeToken = function (token) {
293293
var arr = token.split(' ');
294294
return arr[arr.length - 1];
295295
};
296-
Client.prototype.forceCast = function (input) {
296+
APIClient.prototype.forceCast = function (input) {
297297
if (input.expires_at) {
298298
input.expires_at = new Date(input.expires_at);
299299
}
300300
// @ts-ignore
301301
return input;
302302
};
303-
return Client;
303+
return APIClient;
304304
}());
305-
exports.Client = Client;
305+
exports.APIClient = APIClient;

build/ClientConfig.d.ts build/APIConfig.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Storage } from "./Storage/Storage";
2-
export interface ClientConfig {
2+
export interface APIConfig {
33
domain: string;
44
key: string;
55
secret: string;
File renamed without changes.

build/SignatureValidator.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ClientConfig } from ".";
1+
import { APIConfig } from ".";
22
export declare class SignatureValidator {
33
private config;
44
private signatureGenerator;
5-
constructor(config: ClientConfig);
5+
constructor(config: APIConfig);
66
verifyBase64Signature(url: string, params: any, signature: string): Promise<boolean>;
77
}

build/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export { ClientConfig } from "./ClientConfig";
2-
export { Client } from "./Client";
1+
export { APIConfig } from "./APIConfig";
2+
export { APIClient } from "./APIClient";
33
export { SignatureGenerator } from "./SignatureGenerator";
44
export { SignatureValidator } from "./SignatureValidator";
55
export { FileStorage } from "./Storage/FileStorage";

build/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.NullStorage = exports.FileStorage = exports.SignatureValidator = exports.SignatureGenerator = exports.Client = void 0;
4-
var Client_1 = require("./Client");
5-
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } });
3+
exports.NullStorage = exports.FileStorage = exports.SignatureValidator = exports.SignatureGenerator = exports.APIClient = void 0;
4+
var APIClient_1 = require("./APIClient");
5+
Object.defineProperty(exports, "APIClient", { enumerable: true, get: function () { return APIClient_1.APIClient; } });
66
var SignatureGenerator_1 = require("./SignatureGenerator");
77
Object.defineProperty(exports, "SignatureGenerator", { enumerable: true, get: function () { return SignatureGenerator_1.SignatureGenerator; } });
88
var SignatureValidator_1 = require("./SignatureValidator");

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ssofy/node-sdk",
3-
"version": "1.1.8",
3+
"version": "2.0.0",
44
"description": "Official SSOfy Node.js SDK for instant and efficient API access.",
55
"keywords": [
66
"ssofy",

0 commit comments

Comments
 (0)