@textury/ardb
Advanced tools
Comparing version 1.1.0 to 1.1.1
import Arweave from 'arweave'; | ||
import { fieldType } from './faces/fields'; | ||
import { IGlobalOptions, RequestType } from './faces/options'; | ||
import { Block } from './models/block'; | ||
import { Transaction } from './models/transaction'; | ||
import ArdbBlock from './models/block'; | ||
import ArdbTransaction from './models/transaction'; | ||
import { LOGS } from './utils/log'; | ||
@@ -137,3 +137,3 @@ /** | ||
*/ | ||
find(filters?: IGlobalOptions): Promise<Transaction[] | Block[]>; | ||
find(filters?: IGlobalOptions): Promise<ArdbTransaction[] | ArdbBlock[]>; | ||
/** | ||
@@ -144,10 +144,10 @@ * Find a single | ||
*/ | ||
findOne(filters?: IGlobalOptions): Promise<Transaction | Block>; | ||
findAll(filters?: IGlobalOptions): Promise<Transaction[] | Block[]>; | ||
findOne(filters?: IGlobalOptions): Promise<ArdbTransaction | ArdbBlock>; | ||
findAll(filters?: IGlobalOptions): Promise<ArdbTransaction[] | ArdbBlock[]>; | ||
/** | ||
* To run with the cursor | ||
*/ | ||
next(): Promise<Transaction | Block | Transaction[] | Block[]>; | ||
run(query: string): Promise<Transaction[] | Block[]>; | ||
runAll(query: string): Promise<Transaction[] | Block[]>; | ||
next(): Promise<ArdbTransaction | ArdbBlock | ArdbTransaction[] | ArdbBlock[]>; | ||
run(query: string): Promise<ArdbTransaction[] | ArdbBlock[]>; | ||
runAll(query: string): Promise<ArdbTransaction[] | ArdbBlock[]>; | ||
/** Helpers */ | ||
@@ -154,0 +154,0 @@ private checkSearchType; |
@@ -11,5 +11,8 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const block_1 = require("./models/block"); | ||
const transaction_1 = require("./models/transaction"); | ||
const block_1 = __importDefault(require("./models/block")); | ||
const transaction_1 = __importDefault(require("./models/transaction")); | ||
const log_1 = require("./utils/log"); | ||
@@ -363,6 +366,6 @@ /** | ||
if (res.transaction) { | ||
return [new transaction_1.Transaction(res.transaction, this.arweave)]; | ||
return [new transaction_1.default(res.transaction, this.arweave)]; | ||
} | ||
else if (res.block) { | ||
return [new block_1.Block(res.block)]; | ||
return [new block_1.default(res.block)]; | ||
} | ||
@@ -377,3 +380,3 @@ else if (res.transactions) { | ||
} | ||
return edges.map((edge) => new transaction_1.Transaction(edge.node, this.arweave)); | ||
return edges.map((edge) => new transaction_1.default(edge.node, this.arweave)); | ||
} | ||
@@ -388,3 +391,3 @@ else if (res.blocks) { | ||
} | ||
return edges.map((edge) => new block_1.Block(edge.node)); | ||
return edges.map((edge) => new block_1.default(edge.node)); | ||
} | ||
@@ -407,6 +410,6 @@ }); | ||
if (res.transaction) { | ||
return [new transaction_1.Transaction(res.transaction, this.arweave)]; | ||
return [new transaction_1.default(res.transaction, this.arweave)]; | ||
} | ||
else if (res.block) { | ||
return [new block_1.Block(res.block)]; | ||
return [new block_1.default(res.block)]; | ||
} | ||
@@ -434,6 +437,6 @@ else if (res.transactions) { | ||
if (isTx) { | ||
return edges.map((edge) => new transaction_1.Transaction(edge.node, this.arweave)); | ||
return edges.map((edge) => new transaction_1.default(edge.node, this.arweave)); | ||
} | ||
else { | ||
return edges.map((edge) => new block_1.Block(edge.node)); | ||
return edges.map((edge) => new block_1.default(edge.node)); | ||
} | ||
@@ -440,0 +443,0 @@ }); |
import { GQLBlockInterface } from '../faces/gql'; | ||
export declare class Block implements GQLBlockInterface { | ||
export default class ArdbBlock implements GQLBlockInterface { | ||
private _id; | ||
@@ -4,0 +4,0 @@ private _timestamp; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Block = void 0; | ||
const log_1 = require("../utils/log"); | ||
class Block { | ||
class ArdbBlock { | ||
constructor(obj) { | ||
@@ -34,2 +33,2 @@ this._id = obj.id; | ||
} | ||
exports.Block = Block; | ||
exports.default = ArdbBlock; |
import Arweave from 'arweave'; | ||
import { GQLAmountInterface, GQLBlockInterface, GQLMetaDataInterface, GQLOwnerInterface, GQLTagInterface, GQLTransactionInterface } from '../faces/gql'; | ||
export declare class Transaction implements GQLTransactionInterface { | ||
export default class ArdbTransaction implements GQLTransactionInterface { | ||
private _id; | ||
@@ -16,3 +16,2 @@ private _anchor; | ||
private arweave; | ||
constructor(obj: Partial<GQLTransactionInterface>, arweave: Arweave); | ||
get id(): string; | ||
@@ -31,2 +30,3 @@ get anchor(): string; | ||
}; | ||
constructor(obj: Partial<GQLTransactionInterface>, arweave: Arweave); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Transaction = void 0; | ||
const log_1 = require("../utils/log"); | ||
class Transaction { | ||
class ArdbTransaction { | ||
constructor(obj, arweave) { | ||
@@ -17,3 +16,5 @@ this._id = obj.id; | ||
this._block = obj.block; | ||
this._parent = obj.parent; | ||
if (obj.parent && obj.parent.id) { | ||
this._parent = obj.parent; | ||
} | ||
this.arweave = arweave; | ||
@@ -78,2 +79,2 @@ } | ||
} | ||
exports.Transaction = Transaction; | ||
exports.default = ArdbTransaction; |
{ | ||
"name": "@textury/ardb", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"main": "lib/ardb.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/textury/ardb.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44977
1145