@sentio/api 1.0.2-rc.30 → 1.0.2-rc.32

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.
package/README.md CHANGED
@@ -13,29 +13,29 @@ pnpm add @sentio/api
13
13
  ### Example 1: get project list
14
14
 
15
15
  ```ts
16
- import { Configuration, WebApi } from "@sentio/api";
16
+ import { client, WebService } from "@sentio/api";
17
17
 
18
- const config = new Configuration({
19
- apiKey: process.env.SENTIO_API_KEY,
18
+ client.setConfig({
19
+ auth: process.env.SENTIO_API_KEY,
20
20
  });
21
- const api = new WebApi(config);
22
- const projects = await api.getProjectList();
21
+ const projects = await WebService.getProjectList();
23
22
  console.log(projects);
24
23
  ```
25
24
 
26
25
  ### Example 2: insight query
27
26
 
28
27
  ```ts
29
- import { Configuration, WebApi, DataApi } from "@sentio/api";
28
+ import { client, DataService } from "@sentio/api";
30
29
 
31
- const config = new Configuration({
32
- apiKey: process.env.SENTIO_API_KEY,
30
+ client.setConfig({
31
+ auth: process.env.SENTIO_API_KEY,
33
32
  });
34
33
 
35
- const dataApi = new DataApi(config);
36
- const res = await dataApi.query({
37
- owner: "sentio",
38
- slug: "coinbase",
34
+ const res = await DataService.query({
35
+ path: {
36
+ owner: "sentio",
37
+ slug: "coinbase",
38
+ },
39
39
  body: {
40
40
  timeRange: {
41
41
  start: "now-30d",
@@ -51,7 +51,7 @@ const res = await dataApi.query({
51
51
  alias: "",
52
52
  id: "a",
53
53
  labelSelector: {},
54
- aggregate: null,
54
+ aggregate: undefined,
55
55
  functions: [],
56
56
  disabled: false,
57
57
  },
@@ -67,6 +67,7 @@ const res = await dataApi.query({
67
67
  },
68
68
  },
69
69
  });
70
+ console.log(res);
70
71
  ```
71
72
 
72
73
  ## Documentation
@@ -1,2 +1,3 @@
1
1
  export * from './types.gen';
2
+ export * from './client.gen';
2
3
  export * from './sdk.gen';
package/dist/src/index.js CHANGED
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // This file is auto-generated by @hey-api/openapi-ts
18
18
  __exportStar(require("./types.gen"), exports);
19
+ __exportStar(require("./client.gen"), exports);
19
20
  __exportStar(require("./sdk.gen"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,8CAA4B;AAC5B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,8CAA4B;AAC5B,+CAA6B;AAC7B,4CAA0B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/api",
3
- "version": "1.0.2-rc.30",
3
+ "version": "1.0.2-rc.32",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  export * from './types.gen';
3
+ export * from './client.gen';
3
4
  export * from './sdk.gen';