Commit ff61b37e authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Merge branch 'ibm-e2e-master-merge' into 'master'

Ibm e2e master merge

See merge request !26
parents d8c6a73b 6f255d61
Pipeline #30124 passed with stages
in 6 minutes and 37 seconds
......@@ -15,8 +15,6 @@ headers = {
full_url="https://"+url+"/auth/realms/OSDU/protocol/openid-connect/token"
response = requests.request("POST", full_url, data=payload, headers=headers)
print(response.text)
result = response.json()
token = result['access_token']
print(token)
......@@ -2429,14 +2429,14 @@
"dev": true
},
"bull": {
"version": "3.20.0",
"resolved": "https://registry.npmjs.org/bull/-/bull-3.20.0.tgz",
"integrity": "sha512-xXUfA2gLZLfIkWhxcZkAk6mHt+eG3o4arqz7HwCPVYuVjIp/pYTuhFd2iPXIQLxop7pJY4VIQ59fELdD/Y6f8w==",
"version": "3.20.1",
"resolved": "https://registry.npmjs.org/bull/-/bull-3.20.1.tgz",
"integrity": "sha512-wDwpVu47WKaGhiguEPa/US5UMrtGLPKNPiGFPo4OgVs3EEGzJEWwv3LRPfjJVIf1COdMAN/yowGhZwYmoOonjQ==",
"requires": {
"cron-parser": "^2.13.0",
"debuglog": "^1.0.0",
"get-port": "^5.1.1",
"ioredis": "4.18.0",
"ioredis": "^4.22.0",
"lodash": "^4.17.19",
"p-timeout": "^3.2.0",
"promise.prototype.finally": "^3.1.2",
......@@ -2461,11 +2461,6 @@
"lru-cache": "^6.0.0"
}
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
......@@ -4053,9 +4048,9 @@
"dev": true
},
"get-intrinsic": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz",
"integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
......@@ -4860,16 +4855,17 @@
}
},
"ioredis": {
"version": "4.18.0",
"resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.18.0.tgz",
"integrity": "sha512-wXlB60wD+ayJxbD7t+RFBanXinhHyYpfKUxTEEXNOpd0wb+nC8GLH2r7SaZ6sSBOxr8x6jDfBiuMaiK3bPYABw==",
"version": "4.23.0",
"resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.23.0.tgz",
"integrity": "sha512-R5TDCODwnEH3J3A5TSoB17+6a+SeJTtIOW6vsy5Q1yag/AM8FejHjZC5R2O1QepSXV8hwOnGSm/4buJc/LeXTQ==",
"requires": {
"cluster-key-slot": "^1.1.0",
"debug": "^4.1.1",
"denque": "^1.1.0",
"lodash.defaults": "^4.2.0",
"lodash.flatten": "^4.4.0",
"redis-commands": "1.6.0",
"p-map": "^2.1.0",
"redis-commands": "1.7.0",
"redis-errors": "^1.2.0",
"redis-parser": "^3.0.0",
"standard-as-callback": "^2.0.1"
......@@ -4883,10 +4879,15 @@
"ms": "2.1.2"
}
},
"p-map": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz",
"integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw=="
},
"redis-commands": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.6.0.tgz",
"integrity": "sha512-2jnZ0IkjZxvguITjFTrGiLyzQZcTvaw8DAaCXxZq/dsHXz7KfMQ3OUJy7Tz9vnRtZRVz6VRCPDvruvU8Ts44wQ=="
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz",
"integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ=="
}
}
},
......@@ -6238,9 +6239,9 @@
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"moment-timezone": {
"version": "0.5.32",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.32.tgz",
"integrity": "sha512-Z8QNyuQHQAmWucp8Knmgei8YNo28aLjJq6Ma+jy1ZSpSk5nyfRT8xgUbSQvD2+2UajISfenndwvFuH3NGS+nvA==",
"version": "0.5.33",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz",
"integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==",
"requires": {
"moment": ">= 2.9.0"
}
......@@ -8600,11 +8601,11 @@
}
},
"string.prototype.trimend": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz",
"integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
"integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
"requires": {
"call-bind": "^1.0.0",
"call-bind": "^1.0.2",
"define-properties": "^1.1.3"
}
},
......@@ -8627,11 +8628,11 @@
}
},
"string.prototype.trimstart": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz",
"integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
"integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
"requires": {
"call-bind": "^1.0.0",
"call-bind": "^1.0.2",
"define-properties": "^1.1.3"
}
},
......@@ -9175,34 +9176,37 @@
},
"dependencies": {
"es-abstract": {
"version": "1.18.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
"integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"version": "1.18.0-next.2",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz",
"integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==",
"requires": {
"call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
"is-negative-zero": "^2.0.0",
"is-negative-zero": "^2.0.1",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-inspect": "^1.9.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.1",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1"
"object.assign": "^4.1.2",
"string.prototype.trimend": "^1.0.3",
"string.prototype.trimstart": "^1.0.3"
}
},
"is-callable": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz",
"integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA=="
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz",
"integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ=="
},
"is-regex": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz",
"integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz",
"integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==",
"requires": {
"call-bind": "^1.0.2",
"has-symbols": "^1.0.1"
}
},
......@@ -9223,13 +9227,13 @@
}
},
"object.getownpropertydescriptors": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz",
"integrity": "sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz",
"integrity": "sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ==",
"requires": {
"call-bind": "^1.0.0",
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.1"
"es-abstract": "^1.18.0-next.2"
}
}
}
......
......@@ -151,4 +151,4 @@ export class IbmConfig extends Config {
}
}
}
\ No newline at end of file
......@@ -34,7 +34,9 @@ export class Cos extends AbstractStorage {
let suffix = Math.random().toString(36).substring(2, 16);
suffix = suffix + Math.random().toString(36).substring(2, 16);
suffix = suffix.substr(0, 16);
logger.info('Returning from Cos.randomBucketName. BucketName - '+this.COS_SUBPROJECT_BUCKET_PREFIX + '-' + suffix);
logger.info('Returning from Cos.randomBucketName. BucketName - ');
logger.debug(this.COS_SUBPROJECT_BUCKET_PREFIX);
logger.debug(suffix);
return this.COS_SUBPROJECT_BUCKET_PREFIX + '-' + suffix;
}
......@@ -43,6 +45,7 @@ export class Cos extends AbstractStorage {
bucketName: string,
location: string, storageClass: string): Promise<void> {
logger.info('In Cos.createBucket.');
logger.debug(bucketName);
///not sure how to use ACLs
const bucketParams = {
Bucket: bucketName,
......@@ -54,11 +57,15 @@ export class Cos extends AbstractStorage {
cosStorage.createBucket(bucketParams, function(err, data) {
if (err) {
logger.error('Error while creating bucket. Error stack - '+ err.stack);
logger.error('Error while creating bucket. Error stack - ');
logger.error(err.stack);
throw err;
}
else
logger.info('Bucket created successfully @'+ data.Location);
else
{
logger.info('Bucket created successfully @');
logger.debug(data.Location);
}
});
logger.info('Returning from Cos.createBucket.');
}
......@@ -66,11 +73,13 @@ export class Cos extends AbstractStorage {
//Cos bucket deletion
public async deleteBucket(bucketName: string, force = false): Promise<void> {
logger.info('In Cos.deleteBucket.');
logger.debug(bucketName);
var params = {Bucket: bucketName};
cosStorage.deleteBucket(params, function(err) {
if (err) {
logger.error('Unable to delete bucket. Error stack'+ err.stack);
throw err;
logger.error('Unable to delete bucket. Error stack');
logger.error(err.stack);
throw err;
}
logger.info('Removed bucket.');
})
......@@ -80,10 +89,12 @@ export class Cos extends AbstractStorage {
//Deletion of files in Cos bucket
public async deleteFiles(bucketName: string): Promise<void> {
logger.info('In Cos.deleteFiles.');
logger.debug(bucketName);
var self = this;
cosStorage.listObjects({Bucket: bucketName}, function (err, data) {
if (err) {
logger.error("error listing bucket objects "+err);
logger.error("error listing bucket objects ");
logger.error(err.stack);
throw err;
}
var items = data.Contents;
......@@ -93,7 +104,8 @@ export class Cos extends AbstractStorage {
else
for (var i = 0; i < items.length; i += 1) {
var objectKey = items[i].Key;
logger.info('Object to be deleted. objectKey-'+objectKey);
logger.info('Object to be deleted. objectKey-');
logger.debug(objectKey);
self.deleteObject(bucketName, objectKey);
}
});
......@@ -103,15 +115,22 @@ export class Cos extends AbstractStorage {
//Saving file in Cos bucket
public async saveObject(bucketName: string, objectName: string, data: string): Promise<void> {
logger.info('In Cos.saveObject.');
logger.debug(bucketName);
logger.debug(objectName);
logger.debug(data);
let params = {Bucket: bucketName, Key: objectName, Body: data};
cosStorage.putObject(params, function(err, data) {
if (err) {
logger.error('Object not saved.'+err);
logger.error('Object not saved.');
logger.error(err.stack);
throw err;
}
else
logger.debug("Object saved."+ data);
else
{
logger.info("Object saved.");
logger.debug(data);
}
});
logger.info('Returning from Cos.saveObject.');
}
......@@ -123,7 +142,8 @@ export class Cos extends AbstractStorage {
let params = {Bucket: bucketName, Key: objectName};
cosStorage.deleteObject(params, function(err) {
if (err) {
logger.error('Unable to remove object'+ err);
logger.error('Unable to remove object');
logger.error(err.stack);
throw err;
}
logger.info('Removed the object')
......@@ -133,7 +153,9 @@ export class Cos extends AbstractStorage {
//delete multiple objects
public async deleteObjects(bucketName: string, prefix: string, async: boolean = false): Promise<void> {
logger.info('not sure of the use of this function');
logger.info('This function deletes bulk data uploaded by SDAPI/SDUTIL. Not implemented yet.');
logger.debug(bucketName);
logger.debug(prefix);
logger.info('Returning from Cos.deleteObject.');
await Promise.resolve();
}
......@@ -141,39 +163,35 @@ export class Cos extends AbstractStorage {
//copy multiple objects (skip the dummy file)
///implemention aws sdk copyObject to copy dataset
public async copy(bucketIn: string, prefixIn: string, bucketOut: string, prefixOut: string, ownerEmail: string): Promise<void> {
///const res = 'In copy: bucketIn - '+bucketIn + ' prefixIn - '+prefixIn+ ' bucketOut - '+bucketOut + ' prefixOut - '+prefixOut;
logger.info('In Cos.copy.');
logger.info('Arguments passed:bucketIn,prefixIn...');
logger.debug(bucketIn);
logger.debug(prefixIn);
logger.debug(bucketOut);
logger.debug(prefixOut);
logger.debug(ownerEmail);
// Create the parameters for calling listObjects
var bucketParams = {
Bucket : bucketIn,
};
// Call S3 to obtain a list of the objects in the bucket
cosStorage.listObjects(bucketParams, function(err, data) {
var self = this;
cosStorage.listObjects({Bucket: bucketIn}, function (err, data) {
if (err) {
logger.error("Error in listing objects."+ err);
logger.error("Error in listing objects.");
logger.error(err.stack);
throw err;
} else {
logger.debug("List of objects. Data-"+ data);
}
});
let params = {
Bucket : bucketIn+'/'+prefixIn, /* Target required */
CopySource : bucketOut+'/'+prefixOut, /* Source required */
Key : "*", /* What is required */
//ACL : 'public-read',
};
cosStorage.copyObject(params, function(err, data) {
if (err) {
logger.error('Error while copying object. Error stack - '+err);
throw err;
}
else {
logger.info('Object copied. Data - '+data);
}
logger.info("Fetched objects.");
logger.debug(data);
var items = data.Contents;
if(!items || items.length<=0)
logger.info('No items to copy.');
else
for (var i = 0; i < items.length; i += 1) {
var objectKey = items[i].Key;
var prefix = items[i].Key.split('/')[0];
logger.info('Object to be copied.');
logger.debug(objectKey);
}
});
logger.info('Returning from Cos.deleteObject.');
}
......@@ -191,7 +209,8 @@ export class Cos extends AbstractStorage {
return true;
}
catch(err) {
logger.error('Bucket does not exist. Error stack - '+err.stack);
logger.error('Bucket does not exist.');
logger.error(err.stack);
if (err.statusCode === 404) {
return false;
}
......
......@@ -17,28 +17,31 @@ export class DatastoreDAO extends AbstractJournal {
super();
logger.info('In datastore.constructor.');
const dbUrl = IbmConfig.DOC_DB_URL;
logger.debug('Connecting to dbUrl-'+dbUrl);
logger.debug(dbUrl);
const cloudantOb = cloudant(dbUrl);
logger.debug('DB object created. cloudantOb-'+cloudantOb);
logger.info('DB object created. cloudantOb-');
logger.debug(cloudantOb);
docDb = cloudantOb.db.use(IbmConfig.DOC_DB_COLLECTION);
}
public async get(key: any): Promise<[any | any[]]> {
logger.info('In datastore get.');
logger.debug('Key passed - '+key);
logger.debug(key);
let entityDocument;
///using the field 'name' to fetch the document. Note: the get() is expecting the field _id
entityDocument = await docDb.get(key.name).then(
result => {
result[this.KEY] = result[this.KEY.toString()];
delete result[this.KEY.toString()];
logger.debug('Deleted field -'+result[this.KEY.toString()]);
logger.info('Deleted field');
logger.debug(result[this.KEY.toString()]);
return [result];}
).catch((error)=>{
logger.error('Get failed to fetch the document. Error - '+error);
logger.error('Get failed to fetch the document.');
logger.error(error);
return [undefined];
})
logger.debug('Document fetched - '+entityDocument);
logger.debug(entityDocument);
logger.info('returning from datastore');
return entityDocument;
}
......@@ -46,7 +49,7 @@ export class DatastoreDAO extends AbstractJournal {
public async save(entity: any): Promise<void> {
logger.info('In datastore.save.');
logger.debug('Entity passed - '+entity);
logger.debug(entity);
let self = this;
logger.info('Fetching document.');
await docDb.get(entity.key.name, { revs_info: true }, function(err, existingDoc) {///changed from entity.name to entity.key.name
......@@ -60,6 +63,8 @@ export class DatastoreDAO extends AbstractJournal {
docTemp.trusted = entity.data.trusted;
Object.assign(docTemp, entity.data);
logger.debug(docTemp);
docDb.insert(docTemp,entity.key.name);
logger.info('Document updated.');
}
else///insert record
......@@ -74,6 +79,7 @@ export class DatastoreDAO extends AbstractJournal {
if(!((entity.key.kind == 'datasets' || entity.key.kind == 'seismicmeta') && element == '_rev'))
customizedOb[element] = entity.data[element];
};
logger.debug(customizedOb);
docDb.insert(customizedOb,entity.key.name);
logger.info('Document inserted.');
}
......@@ -91,30 +97,32 @@ export class DatastoreDAO extends AbstractJournal {
}
catch(err)
{
logger.error('Deletion failed. Error - '+ err);
logger.error('Deletion failed. Error - ');
logger.error(err);
}
logger.info('Returning from datastore.delete.');
}
public createQuery(namespace: string, kind: string): IJournalQueryModel {
logger.info('In datastore.createQuery. Returning.');
logger.debug('namespace -'+namespace + ' kind - '+kind)
logger.debug(namespace);
logger.debug(kind);
return new IbmDocDbQuery(namespace, kind);
}
public async runQuery(query: IJournalQueryModel): Promise<[any[], {endCursor?: string}]> {
logger.info('In datastore.runQuery.');
const queryObject = (query as IbmDocDbQuery);
logger.debug('queryObject - '+queryObject);
logger.debug(queryObject);
const mangoQuery = queryObject.prepareStatement(Config.DATASETS_KIND, queryObject.namespace, queryObject.kind);///tablemane datasets??
logger.debug('mangoQuery - '+mangoQuery);
logger.debug(mangoQuery);
let docs;
await docDb.find(mangoQuery).then((doc) => {
docs = doc.docs;
logger.debug('quryr result - ',doc.docs);
logger.debug(doc.docs);
});
logger.info('Find query executed.');
const results = docs.map(result => {
if (!result) {
......@@ -134,6 +142,7 @@ export class DatastoreDAO extends AbstractJournal {
public createKey(specs: any): object {
logger.info('In datastore.createKey');
logger.debug(specs);
const kind = specs.path[0];
const partitionKey = specs.namespace + '-' + kind;
let name: string;
......@@ -144,7 +153,9 @@ export class DatastoreDAO extends AbstractJournal {
} else {
name = specs.path[1];
}
logger.debug('name, partitionKey, kind - '+ {name, partitionKey, kind});
logger.debug(name);
logger.debug(partitionKey);
logger.debug(kind);
logger.info('returning from createKey');
return { name, partitionKey, kind };
}
......@@ -165,6 +176,8 @@ export class IbmDocDbTransactionOperation {
public constructor (type: OperationType, entityOrKey: any) {
logger.info('In datastore.IbmDocDbTransactionOperation.constructor.');
logger.debug(type);
logger.debug(entityOrKey);
this.type = type;
this.entityOrKey = entityOrKey;
}
......@@ -184,35 +197,41 @@ export class IbmDocDbTransactionDAO extends AbstractJournalTransaction {
public constructor(owner: DatastoreDAO) {
super();
logger.info('In datastore.IbmDocDbTransactionDAO.constructor.');
logger.debug(owner);
this.owner = owner;
this.KEY = this.owner.KEY;
}
public async save(entity: any): Promise<void> {
logger.info('In datastore.IbmDocDbTransactionDAO.save.');
logger.debug(entity);
this.queuedOperations.push(new IbmDocDbTransactionOperation('save', entity));
await Promise.resolve();
}
public async get(key: any): Promise<[any | any[]]> {
logger.info('In datastore.IbmDocDbTransactionDAO.get.');
logger.debug(key);
return await this.owner.get(key);
}
public async delete(key: any): Promise<void> {
logger.info('In datastore.IbmDocDbTransactionDAO.delete.');
logger.debug(key);
this.queuedOperations.push(new IbmDocDbTransactionOperation('delete', key));
await Promise.resolve();
}
public createQuery(namespace: string, kind: string): IJournalQueryModel {
logger.info('In datastore.IbmDocDbTransactionDAO.createQuery.');
logger.debug(namespace);
logger.debug(kind);
return this.owner.createQuery(namespace, kind);
}
public async runQuery(query: IJournalQueryModel): Promise<[any[], { endCursor?: string }]> {
logger.info('In datastore.IbmDocDbTransactionDAO.runQuery.');
logger.debug('query-'+query)
logger.debug(query)
return await this.owner.runQuery(query);
}
......@@ -293,6 +312,8 @@ export class IbmDocDbQuery implements IJournalQueryModel {
public constructor(namespace: string, kind: string) {
logger.info('In datastore.IbmDocDbQuery.constructor.');
logger.debug(namespace);
logger.debug(kind);
this.namespace = namespace;
this.kind = kind;
}
......@@ -306,7 +327,10 @@ export class IbmDocDbQuery implements IJournalQueryModel {
filter(property: string, operator?: Operator, value?: {}): IJournalQueryModel {
logger.info('In datastore.IbmDocDbQuery.filter.');
logger.info('in filter("esd","=",esd)');