New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ridi/cms-sdk

Package Overview
Dependencies
Maintainers
11
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ridi/cms-sdk - npm Package Compare versions

Comparing version 2.2.6 to 2.3.1

63

CHANGELOG.md
# Ridibooks CMS SDK
All notable changes to this project will be documented in this file.
## 2.2.6 (2018-04-04)
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.3.1] - 2018-04-19
### Added
- [PHP, JS, Python] new `authorizeByTag` API
## [2.3.0] - 2018-04-10
### Added
- [PHP] Add new method `SetAdminID` with the purpose of test
### Deprecated
- [PHP] Remove token-introspect url endpoint (#46)
- Removed method `hasUrlAuth` from AdminAuthService class.
- Removed method `checkUserPassword`, `doLoginAction`, `doCmsLoginAction`, `requestTokenIntrospect`, `getTokenApiUrl` `getLoginPageUrl`, `isAuthRequired`, `validateLogin`, `createRedirectForLogin`, `setLoginContext` from LoginService class
## [2.2.6] - 2018-04-04
### Added
- [PHP, JS, Python] Add new tag APIs, `getAdminTag` and `getAdminTags`.
## 2.2.5 (2018-04-03)
## [2.2.5] - 2018-04-03
### Changed
- [PHP] `/token-refresh` does not redirect to CMS-RPC-URL (#43)
## 2.2.4 (2018-04-02)
## [2.2.4] - 2018-04-02
### Added
- [PHP] Add cookie header to Thrift request for debugger (#42)
## 2.2.3 (2018-03-27)
## [2.2.3] - 2018-03-27
### Fixed
- [PHP] Fix token-refresh failure due to domain mismatch
## 2.2.2 (2018-03-26)
## [2.2.2] - 2018-03-26
### Added
- [PHP] Redirect to /token-refresh on token expired
- [PHP] Handle 400 error on token introspect
## 2.2.1 (2018-03-12)
## [2.2.1] - 2018-03-12
### Fixed
- [PHP] Fix `MiniRouter` compatiblitiy issue
## 2.2.0 (2018-03-09)
## [2.2.0] - 2018-03-09
### Added
- [PHP] CmsApplication accepts config variables by the constructor
- [PHP] Add `setLoginContext()` for test
### Changed
- [PHP] Remove PHP warning if a cookie is not set
- [PHP] Add `setLoginContext()` for test
## 2.1.1 (2018-02-14)
## [2.1.1] - 2018-02-14
### Fixed
- [PHP] Fix compatibility error with Config class
## 2.1 (2018-02-13)
- [PHP] **Remove** deprecated method `AdminAuthService::getAdminTag`
## [2.1] - 2018-02-13
### Added
- [Node.js] Support Node.js
- [Python] Support Python
### Changed
- Use token-based Login
- Remove session server dependency
### Deprecated
- [PHP] Removed method `AdminAuthService::getAdminTag`
## 2.0 (2017-08-17)
## [2.0] - 2017-08-17
### BREAKING CHANGES
- [PHP] Namespace change not to include `\Platform`

@@ -102,8 +102,4 @@ //

this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.UserException) {
this.userException = args;
return;
}
this.unauthorizedException = null;
if (args instanceof Errors_ttypes.SystemException) {

@@ -113,2 +109,6 @@ this.systemException = args;

}
if (args instanceof Errors_ttypes.UnauthorizedException) {
this.unauthorizedException = args;
return;
}
if (args) {

@@ -118,8 +118,8 @@ if (args.success !== undefined && args.success !== null) {

}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
if (args.unauthorizedException !== undefined && args.unauthorizedException !== null) {
this.unauthorizedException = args.unauthorizedException;
}
}

@@ -150,4 +150,4 @@ };

if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.UserException();
this.userException.read(input);
this.systemException = new Errors_ttypes.SystemException();
this.systemException.read(input);
} else {

@@ -159,4 +159,4 @@ input.skip(ftype);

if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.SystemException();
this.systemException.read(input);
this.unauthorizedException = new Errors_ttypes.UnauthorizedException();
this.unauthorizedException.read(input);
} else {

@@ -182,12 +182,12 @@ input.skip(ftype);

}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException.write(output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 1);
this.systemException.write(output);
output.writeFieldEnd();
}
if (this.unauthorizedException !== null && this.unauthorizedException !== undefined) {
output.writeFieldBegin('unauthorizedException', Thrift.Type.STRUCT, 2);
this.unauthorizedException.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();

@@ -266,8 +266,3 @@ output.writeStructEnd();

this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.UserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.SystemException) {

@@ -281,5 +276,2 @@ this.systemException = args;

}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {

@@ -326,10 +318,2 @@ this.systemException = args.systemException;

if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.UserException();
this.userException.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.SystemException();

@@ -366,9 +350,4 @@ this.systemException.read(input);

}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException.write(output);
output.writeFieldEnd();
}
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 1);
this.systemException.write(output);

@@ -437,8 +416,3 @@ output.writeFieldEnd();

this.success = null;
this.userException = null;
this.systemException = null;
if (args instanceof Errors_ttypes.UserException) {
this.userException = args;
return;
}
if (args instanceof Errors_ttypes.SystemException) {

@@ -452,5 +426,2 @@ this.systemException = args;

}
if (args.userException !== undefined && args.userException !== null) {
this.userException = args.userException;
}
if (args.systemException !== undefined && args.systemException !== null) {

@@ -498,10 +469,2 @@ this.systemException = args.systemException;

if (ftype == Thrift.Type.STRUCT) {
this.userException = new Errors_ttypes.UserException();
this.userException.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.SystemException();

@@ -538,12 +501,250 @@ this.systemException.read(input);

}
if (this.userException !== null && this.userException !== undefined) {
output.writeFieldBegin('userException', Thrift.Type.STRUCT, 1);
this.userException.write(output);
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 1);
this.systemException.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var AdminAuthService_authorize_args = function(args) {
this.token = null;
this.methods = null;
this.check_url = null;
if (args) {
if (args.token !== undefined && args.token !== null) {
this.token = args.token;
}
if (args.methods !== undefined && args.methods !== null) {
this.methods = Thrift.copyList(args.methods, [null]);
}
if (args.check_url !== undefined && args.check_url !== null) {
this.check_url = args.check_url;
}
}
};
AdminAuthService_authorize_args.prototype = {};
AdminAuthService_authorize_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.token = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size16 = 0;
var _rtmp320;
this.methods = [];
var _etype19 = 0;
_rtmp320 = input.readListBegin();
_etype19 = _rtmp320.etype;
_size16 = _rtmp320.size;
for (var _i21 = 0; _i21 < _size16; ++_i21)
{
var elem22 = null;
elem22 = input.readString();
this.methods.push(elem22);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.check_url = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
AdminAuthService_authorize_args.prototype.write = function(output) {
output.writeStructBegin('AdminAuthService_authorize_args');
if (this.token !== null && this.token !== undefined) {
output.writeFieldBegin('token', Thrift.Type.STRING, 1);
output.writeString(this.token);
output.writeFieldEnd();
}
if (this.methods !== null && this.methods !== undefined) {
output.writeFieldBegin('methods', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRING, this.methods.length);
for (var iter23 in this.methods)
{
if (this.methods.hasOwnProperty(iter23))
{
iter23 = this.methods[iter23];
output.writeString(iter23);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.check_url !== null && this.check_url !== undefined) {
output.writeFieldBegin('check_url', Thrift.Type.STRING, 3);
output.writeString(this.check_url);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var AdminAuthService_authorize_result = function(args) {
this.systemException = null;
this.noTokenException = null;
this.malformedTokenException = null;
this.expiredTokenException = null;
this.unauthorizedException = null;
if (args instanceof Errors_ttypes.SystemException) {
this.systemException = args;
return;
}
if (args instanceof Errors_ttypes.NoTokenException) {
this.noTokenException = args;
return;
}
if (args instanceof Errors_ttypes.MalformedTokenException) {
this.malformedTokenException = args;
return;
}
if (args instanceof Errors_ttypes.ExpiredTokenException) {
this.expiredTokenException = args;
return;
}
if (args instanceof Errors_ttypes.UnauthorizedException) {
this.unauthorizedException = args;
return;
}
if (args) {
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
if (args.noTokenException !== undefined && args.noTokenException !== null) {
this.noTokenException = args.noTokenException;
}
if (args.malformedTokenException !== undefined && args.malformedTokenException !== null) {
this.malformedTokenException = args.malformedTokenException;
}
if (args.expiredTokenException !== undefined && args.expiredTokenException !== null) {
this.expiredTokenException = args.expiredTokenException;
}
if (args.unauthorizedException !== undefined && args.unauthorizedException !== null) {
this.unauthorizedException = args.unauthorizedException;
}
}
};
AdminAuthService_authorize_result.prototype = {};
AdminAuthService_authorize_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.SystemException();
this.systemException.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.noTokenException = new Errors_ttypes.NoTokenException();
this.noTokenException.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.malformedTokenException = new Errors_ttypes.MalformedTokenException();
this.malformedTokenException.read(input);
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.expiredTokenException = new Errors_ttypes.ExpiredTokenException();
this.expiredTokenException.read(input);
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.unauthorizedException = new Errors_ttypes.UnauthorizedException();
this.unauthorizedException.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
AdminAuthService_authorize_result.prototype.write = function(output) {
output.writeStructBegin('AdminAuthService_authorize_result');
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 2);
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 1);
this.systemException.write(output);
output.writeFieldEnd();
}
if (this.noTokenException !== null && this.noTokenException !== undefined) {
output.writeFieldBegin('noTokenException', Thrift.Type.STRUCT, 2);
this.noTokenException.write(output);
output.writeFieldEnd();
}
if (this.malformedTokenException !== null && this.malformedTokenException !== undefined) {
output.writeFieldBegin('malformedTokenException', Thrift.Type.STRUCT, 3);
this.malformedTokenException.write(output);
output.writeFieldEnd();
}
if (this.expiredTokenException !== null && this.expiredTokenException !== undefined) {
output.writeFieldBegin('expiredTokenException', Thrift.Type.STRUCT, 4);
this.expiredTokenException.write(output);
output.writeFieldEnd();
}
if (this.unauthorizedException !== null && this.unauthorizedException !== undefined) {
output.writeFieldBegin('unauthorizedException', Thrift.Type.STRUCT, 5);
this.unauthorizedException.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();

@@ -554,2 +755,229 @@ output.writeStructEnd();

var AdminAuthService_authorizeByTag_args = function(args) {
this.token = null;
this.tags = null;
if (args) {
if (args.token !== undefined && args.token !== null) {
this.token = args.token;
}
if (args.tags !== undefined && args.tags !== null) {
this.tags = Thrift.copyList(args.tags, [null]);
}
}
};
AdminAuthService_authorizeByTag_args.prototype = {};
AdminAuthService_authorizeByTag_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.token = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size24 = 0;
var _rtmp328;
this.tags = [];
var _etype27 = 0;
_rtmp328 = input.readListBegin();
_etype27 = _rtmp328.etype;
_size24 = _rtmp328.size;
for (var _i29 = 0; _i29 < _size24; ++_i29)
{
var elem30 = null;
elem30 = input.readString();
this.tags.push(elem30);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
AdminAuthService_authorizeByTag_args.prototype.write = function(output) {
output.writeStructBegin('AdminAuthService_authorizeByTag_args');
if (this.token !== null && this.token !== undefined) {
output.writeFieldBegin('token', Thrift.Type.STRING, 1);
output.writeString(this.token);
output.writeFieldEnd();
}
if (this.tags !== null && this.tags !== undefined) {
output.writeFieldBegin('tags', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRING, this.tags.length);
for (var iter31 in this.tags)
{
if (this.tags.hasOwnProperty(iter31))
{
iter31 = this.tags[iter31];
output.writeString(iter31);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var AdminAuthService_authorizeByTag_result = function(args) {
this.systemException = null;
this.noTokenException = null;
this.malformedTokenException = null;
this.expiredTokenException = null;
this.unauthorizedException = null;
if (args instanceof Errors_ttypes.SystemException) {
this.systemException = args;
return;
}
if (args instanceof Errors_ttypes.NoTokenException) {
this.noTokenException = args;
return;
}
if (args instanceof Errors_ttypes.MalformedTokenException) {
this.malformedTokenException = args;
return;
}
if (args instanceof Errors_ttypes.ExpiredTokenException) {
this.expiredTokenException = args;
return;
}
if (args instanceof Errors_ttypes.UnauthorizedException) {
this.unauthorizedException = args;
return;
}
if (args) {
if (args.systemException !== undefined && args.systemException !== null) {
this.systemException = args.systemException;
}
if (args.noTokenException !== undefined && args.noTokenException !== null) {
this.noTokenException = args.noTokenException;
}
if (args.malformedTokenException !== undefined && args.malformedTokenException !== null) {
this.malformedTokenException = args.malformedTokenException;
}
if (args.expiredTokenException !== undefined && args.expiredTokenException !== null) {
this.expiredTokenException = args.expiredTokenException;
}
if (args.unauthorizedException !== undefined && args.unauthorizedException !== null) {
this.unauthorizedException = args.unauthorizedException;
}
}
};
AdminAuthService_authorizeByTag_result.prototype = {};
AdminAuthService_authorizeByTag_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.systemException = new Errors_ttypes.SystemException();
this.systemException.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.noTokenException = new Errors_ttypes.NoTokenException();
this.noTokenException.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.malformedTokenException = new Errors_ttypes.MalformedTokenException();
this.malformedTokenException.read(input);
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.expiredTokenException = new Errors_ttypes.ExpiredTokenException();
this.expiredTokenException.read(input);
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.unauthorizedException = new Errors_ttypes.UnauthorizedException();
this.unauthorizedException.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
AdminAuthService_authorizeByTag_result.prototype.write = function(output) {
output.writeStructBegin('AdminAuthService_authorizeByTag_result');
if (this.systemException !== null && this.systemException !== undefined) {
output.writeFieldBegin('systemException', Thrift.Type.STRUCT, 1);
this.systemException.write(output);
output.writeFieldEnd();
}
if (this.noTokenException !== null && this.noTokenException !== undefined) {
output.writeFieldBegin('noTokenException', Thrift.Type.STRUCT, 2);
this.noTokenException.write(output);
output.writeFieldEnd();
}
if (this.malformedTokenException !== null && this.malformedTokenException !== undefined) {
output.writeFieldBegin('malformedTokenException', Thrift.Type.STRUCT, 3);
this.malformedTokenException.write(output);
output.writeFieldEnd();
}
if (this.expiredTokenException !== null && this.expiredTokenException !== undefined) {
output.writeFieldBegin('expiredTokenException', Thrift.Type.STRUCT, 4);
this.expiredTokenException.write(output);
output.writeFieldEnd();
}
if (this.unauthorizedException !== null && this.unauthorizedException !== undefined) {
output.writeFieldBegin('unauthorizedException', Thrift.Type.STRUCT, 5);
this.unauthorizedException.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var AdminAuthServiceClient = exports.Client = function(output, pClass) {

@@ -608,8 +1036,8 @@ this.output = output;

if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.unauthorizedException) {
return callback(result.unauthorizedException);
}
if (null !== result.success) {

@@ -663,5 +1091,2 @@ return callback(null, result.success);

if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {

@@ -717,5 +1142,2 @@ return callback(result.systemException);

if (null !== result.userException) {
return callback(result.userException);
}
if (null !== result.systemException) {

@@ -729,2 +1151,123 @@ return callback(result.systemException);

};
AdminAuthServiceClient.prototype.authorize = function(token, methods, check_url, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_authorize(token, methods, check_url);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_authorize(token, methods, check_url);
}
};
AdminAuthServiceClient.prototype.send_authorize = function(token, methods, check_url) {
var output = new this.pClass(this.output);
output.writeMessageBegin('authorize', Thrift.MessageType.CALL, this.seqid());
var args = new AdminAuthService_authorize_args();
args.token = token;
args.methods = methods;
args.check_url = check_url;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
AdminAuthServiceClient.prototype.recv_authorize = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x.read(input);
input.readMessageEnd();
return callback(x);
}
var result = new AdminAuthService_authorize_result();
result.read(input);
input.readMessageEnd();
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.noTokenException) {
return callback(result.noTokenException);
}
if (null !== result.malformedTokenException) {
return callback(result.malformedTokenException);
}
if (null !== result.expiredTokenException) {
return callback(result.expiredTokenException);
}
if (null !== result.unauthorizedException) {
return callback(result.unauthorizedException);
}
callback(null);
};
AdminAuthServiceClient.prototype.authorizeByTag = function(token, tags, callback) {
this._seqid = this.new_seqid();
if (callback === undefined) {
var _defer = Q.defer();
this._reqs[this.seqid()] = function(error, result) {
if (error) {
_defer.reject(error);
} else {
_defer.resolve(result);
}
};
this.send_authorizeByTag(token, tags);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_authorizeByTag(token, tags);
}
};
AdminAuthServiceClient.prototype.send_authorizeByTag = function(token, tags) {
var output = new this.pClass(this.output);
output.writeMessageBegin('authorizeByTag', Thrift.MessageType.CALL, this.seqid());
var args = new AdminAuthService_authorizeByTag_args();
args.token = token;
args.tags = tags;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
AdminAuthServiceClient.prototype.recv_authorizeByTag = function(input,mtype,rseqid) {
var callback = this._reqs[rseqid] || function() {};
delete this._reqs[rseqid];
if (mtype == Thrift.MessageType.EXCEPTION) {
var x = new Thrift.TApplicationException();
x.read(input);
input.readMessageEnd();
return callback(x);
}
var result = new AdminAuthService_authorizeByTag_result();
result.read(input);
input.readMessageEnd();
if (null !== result.systemException) {
return callback(result.systemException);
}
if (null !== result.noTokenException) {
return callback(result.noTokenException);
}
if (null !== result.malformedTokenException) {
return callback(result.malformedTokenException);
}
if (null !== result.expiredTokenException) {
return callback(result.expiredTokenException);
}
if (null !== result.unauthorizedException) {
return callback(result.unauthorizedException);
}
callback(null);
};
var AdminAuthServiceProcessor = exports.Processor = function(handler) {

@@ -763,3 +1306,3 @@ this._handler = handler;

var result;
if (err instanceof Errors_ttypes.UserException || err instanceof Errors_ttypes.SystemException) {
if (err instanceof Errors_ttypes.SystemException || err instanceof Errors_ttypes.UnauthorizedException) {
result = new AdminAuthService_hasHashAuth_result(err);

@@ -778,3 +1321,3 @@ output.writeMessageBegin("hasHashAuth", Thrift.MessageType.REPLY, seqid);

var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.UserException || err instanceof Errors_ttypes.SystemException) {
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.SystemException || err instanceof Errors_ttypes.UnauthorizedException) {
result_obj = new AdminAuthService_hasHashAuth_result((err !== null || typeof err === 'undefined') ? err : {success: result});

@@ -806,3 +1349,3 @@ output.writeMessageBegin("hasHashAuth", Thrift.MessageType.REPLY, seqid);

var result;
if (err instanceof Errors_ttypes.UserException || err instanceof Errors_ttypes.SystemException) {
if (err instanceof Errors_ttypes.SystemException) {
result = new AdminAuthService_getCurrentHashArray_result(err);

@@ -821,3 +1364,3 @@ output.writeMessageBegin("getCurrentHashArray", Thrift.MessageType.REPLY, seqid);

var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.UserException || err instanceof Errors_ttypes.SystemException) {
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.SystemException) {
result_obj = new AdminAuthService_getCurrentHashArray_result((err !== null || typeof err === 'undefined') ? err : {success: result});

@@ -849,3 +1392,3 @@ output.writeMessageBegin("getCurrentHashArray", Thrift.MessageType.REPLY, seqid);

var result;
if (err instanceof Errors_ttypes.UserException || err instanceof Errors_ttypes.SystemException) {
if (err instanceof Errors_ttypes.SystemException) {
result = new AdminAuthService_getAdminMenu_result(err);

@@ -864,3 +1407,3 @@ output.writeMessageBegin("getAdminMenu", Thrift.MessageType.REPLY, seqid);

var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.UserException || err instanceof Errors_ttypes.SystemException) {
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.SystemException) {
result_obj = new AdminAuthService_getAdminMenu_result((err !== null || typeof err === 'undefined') ? err : {success: result});

@@ -878,1 +1421,83 @@ output.writeMessageBegin("getAdminMenu", Thrift.MessageType.REPLY, seqid);

};
AdminAuthServiceProcessor.prototype.process_authorize = function(seqid, input, output) {
var args = new AdminAuthService_authorize_args();
args.read(input);
input.readMessageEnd();
if (this._handler.authorize.length === 3) {
Q.fcall(this._handler.authorize, args.token, args.methods, args.check_url)
.then(function(result) {
var result_obj = new AdminAuthService_authorize_result({success: result});
output.writeMessageBegin("authorize", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}, function (err) {
var result;
if (err instanceof Errors_ttypes.SystemException || err instanceof Errors_ttypes.NoTokenException || err instanceof Errors_ttypes.MalformedTokenException || err instanceof Errors_ttypes.ExpiredTokenException || err instanceof Errors_ttypes.UnauthorizedException) {
result = new AdminAuthService_authorize_result(err);
output.writeMessageBegin("authorize", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authorize", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.authorize(args.token, args.methods, args.check_url, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.SystemException || err instanceof Errors_ttypes.NoTokenException || err instanceof Errors_ttypes.MalformedTokenException || err instanceof Errors_ttypes.ExpiredTokenException || err instanceof Errors_ttypes.UnauthorizedException) {
result_obj = new AdminAuthService_authorize_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("authorize", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authorize", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
AdminAuthServiceProcessor.prototype.process_authorizeByTag = function(seqid, input, output) {
var args = new AdminAuthService_authorizeByTag_args();
args.read(input);
input.readMessageEnd();
if (this._handler.authorizeByTag.length === 2) {
Q.fcall(this._handler.authorizeByTag, args.token, args.tags)
.then(function(result) {
var result_obj = new AdminAuthService_authorizeByTag_result({success: result});
output.writeMessageBegin("authorizeByTag", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}, function (err) {
var result;
if (err instanceof Errors_ttypes.SystemException || err instanceof Errors_ttypes.NoTokenException || err instanceof Errors_ttypes.MalformedTokenException || err instanceof Errors_ttypes.ExpiredTokenException || err instanceof Errors_ttypes.UnauthorizedException) {
result = new AdminAuthService_authorizeByTag_result(err);
output.writeMessageBegin("authorizeByTag", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authorizeByTag", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.authorizeByTag(args.token, args.tags, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof Errors_ttypes.SystemException || err instanceof Errors_ttypes.NoTokenException || err instanceof Errors_ttypes.MalformedTokenException || err instanceof Errors_ttypes.ExpiredTokenException || err instanceof Errors_ttypes.UnauthorizedException) {
result_obj = new AdminAuthService_authorizeByTag_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("authorizeByTag", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("authorizeByTag", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};

@@ -162,1 +162,285 @@ //

var NoTokenException = module.exports.NoTokenException = function(args) {
Thrift.TException.call(this, "NoTokenException");
this.name = "NoTokenException";
this.code = null;
this.message = null;
if (args) {
if (args.code !== undefined && args.code !== null) {
this.code = args.code;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field code is unset!');
}
if (args.message !== undefined && args.message !== null) {
this.message = args.message;
}
}
};
Thrift.inherits(NoTokenException, Thrift.TException);
NoTokenException.prototype.name = 'NoTokenException';
NoTokenException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
NoTokenException.prototype.write = function(output) {
output.writeStructBegin('NoTokenException');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
output.writeI32(this.code);
output.writeFieldEnd();
}
if (this.message !== null && this.message !== undefined) {
output.writeFieldBegin('message', Thrift.Type.STRING, 2);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var MalformedTokenException = module.exports.MalformedTokenException = function(args) {
Thrift.TException.call(this, "MalformedTokenException");
this.name = "MalformedTokenException";
this.code = null;
this.message = null;
if (args) {
if (args.code !== undefined && args.code !== null) {
this.code = args.code;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field code is unset!');
}
if (args.message !== undefined && args.message !== null) {
this.message = args.message;
}
}
};
Thrift.inherits(MalformedTokenException, Thrift.TException);
MalformedTokenException.prototype.name = 'MalformedTokenException';
MalformedTokenException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
MalformedTokenException.prototype.write = function(output) {
output.writeStructBegin('MalformedTokenException');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
output.writeI32(this.code);
output.writeFieldEnd();
}
if (this.message !== null && this.message !== undefined) {
output.writeFieldBegin('message', Thrift.Type.STRING, 2);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ExpiredTokenException = module.exports.ExpiredTokenException = function(args) {
Thrift.TException.call(this, "ExpiredTokenException");
this.name = "ExpiredTokenException";
this.code = null;
this.message = null;
if (args) {
if (args.code !== undefined && args.code !== null) {
this.code = args.code;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field code is unset!');
}
if (args.message !== undefined && args.message !== null) {
this.message = args.message;
}
}
};
Thrift.inherits(ExpiredTokenException, Thrift.TException);
ExpiredTokenException.prototype.name = 'ExpiredTokenException';
ExpiredTokenException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ExpiredTokenException.prototype.write = function(output) {
output.writeStructBegin('ExpiredTokenException');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
output.writeI32(this.code);
output.writeFieldEnd();
}
if (this.message !== null && this.message !== undefined) {
output.writeFieldBegin('message', Thrift.Type.STRING, 2);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UnauthorizedException = module.exports.UnauthorizedException = function(args) {
Thrift.TException.call(this, "UnauthorizedException");
this.name = "UnauthorizedException";
this.code = null;
this.message = null;
if (args) {
if (args.code !== undefined && args.code !== null) {
this.code = args.code;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field code is unset!');
}
if (args.message !== undefined && args.message !== null) {
this.message = args.message;
}
}
};
Thrift.inherits(UnauthorizedException, Thrift.TException);
UnauthorizedException.prototype.name = 'UnauthorizedException';
UnauthorizedException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UnauthorizedException.prototype.write = function(output) {
output.writeStructBegin('UnauthorizedException');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
output.writeI32(this.code);
output.writeFieldEnd();
}
if (this.message !== null && this.message !== undefined) {
output.writeFieldBegin('message', Thrift.Type.STRING, 2);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
{
"name": "@ridi/cms-sdk",
"version": "2.2.6",
"version": "2.3.1",
"description": "Ridibooks CMS SDK",

@@ -5,0 +5,0 @@ "main": "./lib/js/dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc