@blocklet/sdk 1.16.3 → 1.16.4-beta-8682e092

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.
@@ -1,13 +1,13 @@
1
- import { DataStore as BaseStore, DataStoreOptions } from '@nedb/core';
2
- declare class DataBase extends BaseStore {
1
+ import { AnyObject, DataStore as BaseStore, DataStoreOptions, FilterQuery, ProjectionQuery, SortQuery } from '@nedb/core';
2
+ declare class DataBase<T = AnyObject> extends BaseStore<T> {
3
3
  constructor(name: string, options?: DataStoreOptions);
4
- exists(...args: any[]): Promise<boolean>;
5
- paginate({ condition, sort, page, size, projection }: {
6
- condition?: {};
7
- sort?: {};
4
+ exists(query: FilterQuery<T>): Promise<boolean>;
5
+ paginate({ condition, sort, page, size, projection, }: {
6
+ condition?: FilterQuery<T>;
7
+ sort?: SortQuery<T>;
8
8
  page?: number;
9
9
  size?: number;
10
- projection?: {};
11
- }): Promise<import("@nedb/core").Row<import("@nedb/core").AnyObject>[]>;
10
+ projection?: ProjectionQuery<T>;
11
+ }): Promise<import("@nedb/core").Row<T>[]>;
12
12
  }
13
13
  export = DataBase;
@@ -30,11 +30,11 @@ class DataBase extends core_1.DataStore {
30
30
  this.persistence.setAutoCompactionInterval(compactInterval, console.warn);
31
31
  }
32
32
  }
33
- async exists(...args) {
34
- const doc = await this.findOne(...args);
33
+ async exists(query) {
34
+ const doc = await this.findOne(query);
35
35
  return !!doc;
36
36
  }
37
- async paginate({ condition = {}, sort = {}, page = 1, size = 100, projection = {} }) {
37
+ async paginate({ condition = {}, sort = {}, page = 1, size = 100, projection = {}, }) {
38
38
  return this.cursor(condition)
39
39
  .sort(sort)
40
40
  .skip(Math.max(page * size - size, 0))
package/lib/did.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import toBlockletDid from '@blocklet/meta/lib/did';
2
+ import { getAliasAccountFromUser, getAliasDidFromUser, getMainDidFromUser, getWalletAccountFromUser, getWalletDidFromUser } from '@blocklet/meta/lib/did-utils';
3
+ export { toBlockletDid, getAliasAccountFromUser, getAliasDidFromUser, getMainDidFromUser, getWalletAccountFromUser, getWalletDidFromUser, };
package/lib/did.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getWalletDidFromUser = exports.getWalletAccountFromUser = exports.getMainDidFromUser = exports.getAliasDidFromUser = exports.getAliasAccountFromUser = exports.toBlockletDid = void 0;
7
+ const did_1 = __importDefault(require("@blocklet/meta/lib/did"));
8
+ exports.toBlockletDid = did_1.default;
9
+ const did_utils_1 = require("@blocklet/meta/lib/did-utils");
10
+ Object.defineProperty(exports, "getAliasAccountFromUser", { enumerable: true, get: function () { return did_utils_1.getAliasAccountFromUser; } });
11
+ Object.defineProperty(exports, "getAliasDidFromUser", { enumerable: true, get: function () { return did_utils_1.getAliasDidFromUser; } });
12
+ Object.defineProperty(exports, "getMainDidFromUser", { enumerable: true, get: function () { return did_utils_1.getMainDidFromUser; } });
13
+ Object.defineProperty(exports, "getWalletAccountFromUser", { enumerable: true, get: function () { return did_utils_1.getWalletAccountFromUser; } });
14
+ Object.defineProperty(exports, "getWalletDidFromUser", { enumerable: true, get: function () { return did_utils_1.getWalletDidFromUser; } });
package/lib/index.d.ts CHANGED
@@ -33,6 +33,7 @@ declare global {
33
33
  blocklet: {
34
34
  [x: string]: any;
35
35
  appId: string;
36
+ appIds: string[];
36
37
  appPid: string;
37
38
  appName: string;
38
39
  appDescription: string;
package/lib/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare const version = "1.16.3";
1
+ declare const version = "1.16.4";
2
2
  export { version };
3
3
  declare const _default: {
4
4
  version: string;
package/lib/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- const version = '1.16.3';
4
+ const version = '1.16.4';
5
5
  exports.version = version;
6
6
  exports.default = { version };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.3",
6
+ "version": "1.16.4-beta-8682e092",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
@@ -26,20 +26,20 @@
26
26
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@abtnode/client": "1.16.3",
30
- "@abtnode/constant": "1.16.3",
31
- "@arcblock/did": "1.18.65",
32
- "@arcblock/did-auth": "1.18.65",
33
- "@arcblock/jwt": "1.18.65",
34
- "@arcblock/ws": "1.18.65",
35
- "@blocklet/constant": "1.16.3",
36
- "@blocklet/env": "1.16.3",
37
- "@blocklet/meta": "1.16.3",
38
- "@did-connect/authenticator": "^2.1.47",
39
- "@did-connect/handler": "^2.1.47",
29
+ "@abtnode/client": "1.16.4-beta-8682e092",
30
+ "@abtnode/constant": "1.16.4-beta-8682e092",
31
+ "@arcblock/did": "1.18.67",
32
+ "@arcblock/did-auth": "1.18.67",
33
+ "@arcblock/jwt": "1.18.67",
34
+ "@arcblock/ws": "1.18.67",
35
+ "@blocklet/constant": "1.16.4-beta-8682e092",
36
+ "@blocklet/env": "1.16.4-beta-8682e092",
37
+ "@blocklet/meta": "1.16.4-beta-8682e092",
38
+ "@did-connect/authenticator": "^2.1.49",
39
+ "@did-connect/handler": "^2.1.49",
40
40
  "@nedb/core": "^2.1.5",
41
- "@ocap/mcrypto": "1.18.65",
42
- "@ocap/wallet": "1.18.65",
41
+ "@ocap/mcrypto": "1.18.67",
42
+ "@ocap/wallet": "1.18.67",
43
43
  "axios": "^0.27.2",
44
44
  "cheerio": "^1.0.0-rc.12",
45
45
  "fs-extra": "^10.1.0",
@@ -72,5 +72,5 @@
72
72
  "ts-node": "^10.9.1",
73
73
  "typescript": "^4.8.4"
74
74
  },
75
- "gitHead": "a21d48225c6f89963796871f404a2318a335701d"
75
+ "gitHead": "ab6fc7aeaec32f14ec2153976f2121aa893486b5"
76
76
  }