@sentio/sdk 1.26.3 → 1.27.0

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.
Files changed (52) hide show
  1. package/lib/aptos/aptos-processor.d.ts +1 -1
  2. package/lib/aptos/aptos-processor.js +2 -2
  3. package/lib/aptos/aptos-processor.js.map +1 -1
  4. package/lib/aptos/index.d.ts +1 -1
  5. package/lib/aptos/index.js +2 -1
  6. package/lib/aptos/index.js.map +1 -1
  7. package/lib/aptos-codegen/codegen.js +37 -15
  8. package/lib/aptos-codegen/codegen.js.map +1 -1
  9. package/lib/builtin/aptos/0x1.d.ts +89 -84
  10. package/lib/builtin/aptos/0x1.js +257 -251
  11. package/lib/builtin/aptos/0x1.js.map +1 -1
  12. package/lib/builtin/aptos/0x3.d.ts +8 -8
  13. package/lib/builtin/aptos/0x3.js +35 -35
  14. package/lib/builtin/aptos/0x3.js.map +1 -1
  15. package/lib/cli/cli.js +3 -3
  16. package/lib/cli/cli.js.map +1 -1
  17. package/lib/cli/commands/login-server.d.ts +7 -0
  18. package/lib/cli/commands/login-server.js +134 -0
  19. package/lib/cli/commands/login-server.js.map +1 -0
  20. package/lib/cli/commands/run-login.js +77 -27
  21. package/lib/cli/commands/run-login.js.map +1 -1
  22. package/lib/cli/config.d.ts +5 -0
  23. package/lib/cli/config.js +28 -1
  24. package/lib/cli/config.js.map +1 -1
  25. package/lib/core/exporter.d.ts +4 -9
  26. package/lib/core/exporter.js +8 -8
  27. package/lib/core/exporter.js.map +1 -1
  28. package/lib/gen/processor/protos/processor.d.ts +2 -9
  29. package/lib/gen/processor/protos/processor.js +15 -54
  30. package/lib/gen/processor/protos/processor.js.map +1 -1
  31. package/lib/service.js +2 -3
  32. package/lib/service.js.map +1 -1
  33. package/lib/tests/erc20.js +1 -5
  34. package/lib/tests/erc20.js.map +1 -1
  35. package/lib/tests/types/aptos/souffle.d.ts +2 -2
  36. package/lib/tests/types/aptos/souffle.js +12 -12
  37. package/lib/tests/types/aptos/souffle.js.map +1 -1
  38. package/package.json +7 -2
  39. package/src/aptos/aptos-processor.ts +2 -2
  40. package/src/aptos/index.ts +1 -1
  41. package/src/aptos-codegen/codegen.ts +43 -17
  42. package/src/builtin/aptos/0x1.ts +301 -283
  43. package/src/builtin/aptos/0x3.ts +47 -47
  44. package/src/cli/cli.ts +3 -3
  45. package/src/cli/commands/login-server.ts +120 -0
  46. package/src/cli/commands/run-login.ts +59 -28
  47. package/src/cli/config.ts +29 -0
  48. package/src/core/exporter.ts +9 -14
  49. package/src/gen/processor/protos/processor.ts +15 -59
  50. package/src/service.ts +2 -3
  51. package/src/tests/erc20.ts +1 -5
  52. package/src/tests/types/aptos/souffle.ts +12 -12
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -7,10 +30,13 @@ exports.runLogin = void 0;
7
30
  const command_line_args_1 = __importDefault(require("command-line-args"));
8
31
  const command_line_usage_1 = __importDefault(require("command-line-usage"));
9
32
  const config_1 = require("../config");
33
+ const login_server_1 = require("./login-server");
34
+ const url_1 = __importStar(require("url"));
35
+ const crypto = __importStar(require("crypto"));
10
36
  const chalk_1 = __importDefault(require("chalk"));
11
- const https_1 = __importDefault(require("https"));
12
- const http_1 = __importDefault(require("http"));
13
37
  const key_1 = require("../key");
38
+ const node_fetch_1 = __importDefault(require("node-fetch"));
39
+ const port = 20000;
14
40
  function runLogin(argv) {
15
41
  const optionDefinitions = [
16
42
  {
@@ -20,22 +46,22 @@ function runLogin(argv) {
20
46
  description: 'Display this usage guide.',
21
47
  },
22
48
  {
23
- name: 'api-key',
49
+ name: 'host',
50
+ description: '(Optional) Override Sentio Host name',
24
51
  type: String,
25
- description: '(Required) Your API key',
26
52
  },
27
53
  {
28
- name: 'host',
29
- description: '(Optional) Override Sentio Host name',
54
+ name: 'api-key',
30
55
  type: String,
56
+ description: '(Optional) Your API key',
31
57
  },
32
58
  ];
33
59
  const options = (0, command_line_args_1.default)(optionDefinitions, { argv });
34
- if (options.help || !options['api-key']) {
60
+ if (options.help) {
35
61
  const usage = (0, command_line_usage_1.default)([
36
62
  {
37
63
  header: 'Login to Sentio',
38
- content: 'sentio login --api-key=<key>',
64
+ content: 'sentio login',
39
65
  },
40
66
  {
41
67
  header: 'Options',
@@ -44,34 +70,58 @@ function runLogin(argv) {
44
70
  ]);
45
71
  console.log(usage);
46
72
  }
47
- else {
73
+ else if (options['api-key']) {
48
74
  const host = (0, config_1.getFinalizedHost)(options.host);
49
75
  console.log(chalk_1.default.blue('login to ' + host));
50
- const url = new URL(host);
51
- const reqOptions = {
52
- hostname: url.hostname,
53
- port: url.port,
54
- path: '/api/v1/processors/check_key',
55
- method: 'HEAD',
56
- headers: {
57
- 'api-key': options['api-key'],
58
- },
59
- };
60
- const h = url.protocol == 'https:' ? https_1.default : http_1.default;
61
- const req = h.request(reqOptions, (res) => {
62
- if (res.statusCode == 200) {
63
- (0, key_1.WriteKey)(host, options['api-key']);
76
+ const apiKey = options['api-key'];
77
+ checkKey(host, apiKey).then((res) => {
78
+ if (res.status == 200) {
79
+ (0, key_1.WriteKey)(host, apiKey);
64
80
  console.log(chalk_1.default.green('login success'));
65
81
  }
66
82
  else {
67
- console.error(chalk_1.default.red('login failed, code:', res.statusCode, res.statusMessage));
83
+ console.error(chalk_1.default.red('login failed, code:', res.status, res.statusText));
68
84
  }
69
85
  });
70
- req.on('error', (error) => {
71
- console.error(error);
86
+ }
87
+ else {
88
+ // https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow-with-pkce
89
+ const verifier = base64URLEncode(crypto.randomBytes(32));
90
+ const challenge = base64URLEncode(sha256(verifier));
91
+ const conf = (0, config_1.getAuthConfig)(options.host);
92
+ const authURL = new url_1.URL(conf.domain + `/authorize?`);
93
+ const params = new url_1.default.URLSearchParams({
94
+ response_type: 'code',
95
+ code_challenge: challenge,
96
+ code_challenge_method: 'S256',
97
+ client_id: conf.clientId,
98
+ redirect_uri: `http://localhost:${port}/callback`,
99
+ audience: conf.audience,
100
+ prompt: 'login',
101
+ });
102
+ authURL.search = params.toString();
103
+ console.log('Continue your authorization here: ' + authURL.toString());
104
+ (0, login_server_1.startServer)({
105
+ serverPort: port,
106
+ sentioHost: options.host,
107
+ codeVerifier: verifier,
72
108
  });
73
- req.end();
74
109
  }
75
110
  }
76
111
  exports.runLogin = runLogin;
112
+ function base64URLEncode(str) {
113
+ return str.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
114
+ }
115
+ function sha256(str) {
116
+ return crypto.createHash('sha256').update(str).digest();
117
+ }
118
+ async function checkKey(host, apiKey) {
119
+ const checkApiKeyUrl = new url_1.URL('/api/v1/processors/check_key', host);
120
+ return (0, node_fetch_1.default)(checkApiKeyUrl, {
121
+ method: 'HEAD',
122
+ headers: {
123
+ 'api-key': apiKey,
124
+ },
125
+ });
126
+ }
77
127
  //# sourceMappingURL=run-login.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-login.js","sourceRoot":"","sources":["../../../src/cli/commands/run-login.ts"],"names":[],"mappings":";;;;;;AAAA,0EAA+C;AAC/C,4EAAiD;AACjD,sCAA4C;AAC5C,kDAAyB;AACzB,kDAAyB;AACzB,gDAAuB;AACvB,gCAAiC;AAEjC,SAAgB,QAAQ,CAAC,IAAc;IACrC,MAAM,iBAAiB,GAAG;QACxB;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,2BAA2B;SACzC;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,yBAAyB;SACvC;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,MAAM;SACb;KACF,CAAA;IACD,MAAM,OAAO,GAAG,IAAA,2BAAe,EAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IAE5D,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QACvC,MAAM,KAAK,GAAG,IAAA,4BAAgB,EAAC;YAC7B;gBACE,MAAM,EAAE,iBAAiB;gBACzB,OAAO,EAAE,8BAA8B;aACxC;YACD;gBACE,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,iBAAiB;aAC9B;SACF,CAAC,CAAA;QACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;KACnB;SAAM;QACL,MAAM,IAAI,GAAG,IAAA,yBAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC3C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAA;QAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAA;QACzB,MAAM,UAAU,GAAG;YACjB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,IAAI,EAAE,8BAA8B;YACpC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC;aAC9B;SACF,CAAA;QACD,MAAM,CAAC,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,eAAK,CAAC,CAAC,CAAC,cAAI,CAAA;QACjD,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;YACxC,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,EAAE;gBACzB,IAAA,cAAQ,EAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAA;gBAClC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAA;aAC1C;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,qBAAqB,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAA;aACnF;QACH,CAAC,CAAC,CAAA;QAEF,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACxB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACtB,CAAC,CAAC,CAAA;QACF,GAAG,CAAC,GAAG,EAAE,CAAA;KACV;AACH,CAAC;AA7DD,4BA6DC","sourcesContent":["import commandLineArgs from 'command-line-args'\nimport commandLineUsage from 'command-line-usage'\nimport { getFinalizedHost } from '../config'\nimport chalk from 'chalk'\nimport https from 'https'\nimport http from 'http'\nimport { WriteKey } from '../key'\n\nexport function runLogin(argv: string[]) {\n const optionDefinitions = [\n {\n name: 'help',\n alias: 'h',\n type: Boolean,\n description: 'Display this usage guide.',\n },\n {\n name: 'api-key',\n type: String,\n description: '(Required) Your API key',\n },\n {\n name: 'host',\n description: '(Optional) Override Sentio Host name',\n type: String,\n },\n ]\n const options = commandLineArgs(optionDefinitions, { argv })\n\n if (options.help || !options['api-key']) {\n const usage = commandLineUsage([\n {\n header: 'Login to Sentio',\n content: 'sentio login --api-key=<key>',\n },\n {\n header: 'Options',\n optionList: optionDefinitions,\n },\n ])\n console.log(usage)\n } else {\n const host = getFinalizedHost(options.host)\n console.log(chalk.blue('login to ' + host))\n const url = new URL(host)\n const reqOptions = {\n hostname: url.hostname,\n port: url.port,\n path: '/api/v1/processors/check_key',\n method: 'HEAD',\n headers: {\n 'api-key': options['api-key'],\n },\n }\n const h = url.protocol == 'https:' ? https : http\n const req = h.request(reqOptions, (res) => {\n if (res.statusCode == 200) {\n WriteKey(host, options['api-key'])\n console.log(chalk.green('login success'))\n } else {\n console.error(chalk.red('login failed, code:', res.statusCode, res.statusMessage))\n }\n })\n\n req.on('error', (error) => {\n console.error(error)\n })\n req.end()\n }\n}\n"]}
1
+ {"version":3,"file":"run-login.js","sourceRoot":"","sources":["../../../src/cli/commands/run-login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA+C;AAC/C,4EAAiD;AACjD,sCAA2D;AAC3D,iDAA4C;AAC5C,2CAA8B;AAC9B,+CAAgC;AAChC,kDAAyB;AACzB,gCAAiC;AACjC,4DAA8B;AAE9B,MAAM,IAAI,GAAG,KAAK,CAAA;AAElB,SAAgB,QAAQ,CAAC,IAAc;IACrC,MAAM,iBAAiB,GAAG;QACxB;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,2BAA2B;SACzC;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,MAAM;SACb;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,MAAM;YACZ,WAAW,E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Ac,GAAG,IAAI,SAAG,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAA;IACpE,OAAO,IAAA,oBAAK,EAAC,cAAc,EAAE;QAC3B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,SAAS,EAAE,MAAM;SAClB;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import commandLineArgs from 'command-line-args'\nimport commandLineUsage from 'command-line-usage'\nimport { getAuthConfig, getFinalizedHost } from '../config'\nimport { startServer } from './login-server'\nimport url, { URL } from 'url'\nimport * as crypto from 'crypto'\nimport chalk from 'chalk'\nimport { WriteKey } from '../key'\nimport fetch from 'node-fetch'\n\nconst port = 20000\n\nexport function runLogin(argv: string[]) {\n const optionDefinitions = [\n {\n name: 'help',\n alias: 'h',\n type: Boolean,\n description: 'Display this usage guide.',\n },\n {\n name: 'host',\n description: '(Optional) Override Sentio Host name',\n type: String,\n },\n {\n name: 'api-key',\n type: String,\n description: '(Optional) Your API key',\n },\n ]\n const options = commandLineArgs(optionDefinitions, { argv })\n\n if (options.help) {\n const usage = commandLineUsage([\n {\n header: 'Login to Sentio',\n content: 'sentio login',\n },\n {\n header: 'Options',\n optionList: optionDefinitions,\n },\n ])\n console.log(usage)\n } else if (options['api-key']) {\n const host = getFinalizedHost(options.host)\n console.log(chalk.blue('login to ' + host))\n const apiKey = options['api-key']\n checkKey(host, apiKey).then((res) => {\n if (res.status == 200) {\n WriteKey(host, apiKey)\n console.log(chalk.green('login success'))\n } else {\n console.error(chalk.red('login failed, code:', res.status, res.statusText))\n }\n })\n } else {\n // https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow-with-pkce\n const verifier = base64URLEncode(crypto.randomBytes(32))\n const challenge = base64URLEncode(sha256(verifier))\n\n const conf = getAuthConfig(options.host)\n const authURL = new URL(conf.domain + `/authorize?`)\n const params = new url.URLSearchParams({\n response_type: 'code',\n code_challenge: challenge,\n code_challenge_method: 'S256',\n client_id: conf.clientId,\n redirect_uri: `http://localhost:${port}/callback`,\n audience: conf.audience,\n prompt: 'login',\n })\n authURL.search = params.toString()\n console.log('Continue your authorization here: ' + authURL.toString())\n\n startServer({\n serverPort: port,\n sentioHost: options.host,\n codeVerifier: verifier,\n })\n }\n}\n\nfunction base64URLEncode(str: Buffer) {\n return str.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '')\n}\n\nfunction sha256(str: string) {\n return crypto.createHash('sha256').update(str).digest()\n}\n\nasync function checkKey(host: string, apiKey: string) {\n const checkApiKeyUrl = new URL('/api/v1/processors/check_key', host)\n return fetch(checkApiKeyUrl, {\n method: 'HEAD',\n headers: {\n 'api-key': apiKey,\n },\n })\n}\n"]}
@@ -4,5 +4,10 @@ export interface SentioProjectConfig {
4
4
  build: boolean;
5
5
  }
6
6
  export declare function getFinalizedHost(host: string): string;
7
+ export declare function getAuthConfig(host: string): {
8
+ domain: string;
9
+ clientId: string;
10
+ audience: string;
11
+ };
7
12
  export declare function finalizeHost(config: SentioProjectConfig): void;
8
13
  export declare function FinalizeProjectName(config: SentioProjectConfig, owner: string | undefined): void;
package/lib/cli/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FinalizeProjectName = exports.finalizeHost = exports.getFinalizedHost = void 0;
3
+ exports.FinalizeProjectName = exports.finalizeHost = exports.getAuthConfig = exports.getFinalizedHost = void 0;
4
4
  function getFinalizedHost(host) {
5
5
  switch (host) {
6
6
  case undefined:
@@ -17,6 +17,33 @@ function getFinalizedHost(host) {
17
17
  return host;
18
18
  }
19
19
  exports.getFinalizedHost = getFinalizedHost;
20
+ function getAuthConfig(host) {
21
+ let domain = '', clientId = '', audience = '';
22
+ switch (host) {
23
+ case 'local':
24
+ domain = 'https://sentio-dev.us.auth0.com';
25
+ clientId = 'qGDisObqQbcPeRA8k02POPZ2Df4KVCna';
26
+ audience = 'http://localhost:8080/v1';
27
+ break;
28
+ case '':
29
+ case undefined:
30
+ case 'prod':
31
+ domain = 'https://auth.sentio.xyz';
32
+ clientId = 'xd80PeuvuZVHpBFh7yEdlSZdtE5mTpGe';
33
+ audience = 'https://app.sentio.xyz/api/v1';
34
+ break;
35
+ case 'test':
36
+ case 'staging':
37
+ domain = 'https://auth.test.sentio.xyz';
38
+ clientId = 'qXVvovHaOE37SndxTZJxCKgZjw1axPax';
39
+ audience = 'https://test.sentio.xyz/api/v1';
40
+ break;
41
+ default:
42
+ break;
43
+ }
44
+ return { domain, clientId, audience };
45
+ }
46
+ exports.getAuthConfig = getAuthConfig;
20
47
  function finalizeHost(config) {
21
48
  config.host = getFinalizedHost(config.host);
22
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":";;;AAQA,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS,CAAC;QACf,KAAK,EAAE,CAAC;QACR,KAAK,MAAM;YACT,OAAO,wBAAwB,CAAA;QACjC,KAAK,MAAM;YACT,OAAO,yBAAyB,CAAA;QAClC,KAAK,SAAS;YACZ,OAAO,4BAA4B,CAAA;QACrC,KAAK,OAAO;YACV,OAAO,wBAAwB,CAAA;KAClC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAdD,4CAcC;AAED,SAAgB,YAAY,CAAC,MAA2B;IACtD,MAAM,CAAC,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC7C,CAAC;AAFD,oCAEC;AAED,SAAgB,mBAAmB,CAAC,MAA2B,EAAE,KAAyB;IACxF,IAAI,KAAK,EAAE;QACT,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAA;QACzB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACtB,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;SACpC;QACD,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACzC;AACH,CAAC;AARD,kDAQC;AAED,4BAA4B;AAC5B,kBAAkB;AAClB,qBAAqB;AACrB,IAAI;AACJ,EAAE;AACF,wCAAwC;AACxC,2BAA2B;AAC3B,iCAAiC","sourcesContent":["export interface SentioProjectConfig {\n project: string\n host: string\n // source: string\n build: boolean\n // targets: Target[]\n}\n\nexport function getFinalizedHost(host: string): string {\n switch (host) {\n case undefined:\n case '':\n case 'prod':\n return 'https://app.sentio.xyz'\n case 'test':\n return 'https://test.sentio.xyz'\n case 'staging':\n return 'https://staging.sentio.xyz'\n case 'local':\n return 'http://localhost:10000'\n }\n return host\n}\n\nexport function finalizeHost(config: SentioProjectConfig) {\n config.host = getFinalizedHost(config.host)\n}\n\nexport function FinalizeProjectName(config: SentioProjectConfig, owner: string | undefined) {\n if (owner) {\n let name = config.project\n if (name.includes('/')) {\n name = config.project.split('/')[1]\n }\n config.project = [owner, name].join('/')\n }\n}\n\n// export interface Target {\n// chain: string\n// abisDir?: string\n// }\n//\n// // Supported target chain, lower case\n// export const EVM = 'evm'\n// export const SOLANA = 'solana'\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":";;;AAQA,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS,CAAC;QACf,KAAK,EAAE,CAAC;QACR,KAAK,MAAM;YACT,OAAO,wBAAwB,CAAA;QACjC,KAAK,MAAM;YACT,OAAO,yBAAyB,CAAA;QAClC,KAAK,SAAS;YACZ,OAAO,4BAA4B,CAAA;QACrC,KAAK,OAAO;YACV,OAAO,wBAAwB,CAAA;KAClC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAdD,4CAcC;AAED,SAAgB,aAAa,CAAC,IAAY;IACxC,IAAI,MAAM,G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rB,IAAI;AACJ,EAAE;AACF,wCAAwC;AACxC,2BAA2B;AAC3B,iCAAiC","sourcesContent":["export interface SentioProjectConfig {\n project: string\n host: string\n // source: string\n build: boolean\n // targets: Target[]\n}\n\nexport function getFinalizedHost(host: string): string {\n switch (host) {\n case undefined:\n case '':\n case 'prod':\n return 'https://app.sentio.xyz'\n case 'test':\n return 'https://test.sentio.xyz'\n case 'staging':\n return 'https://staging.sentio.xyz'\n case 'local':\n return 'http://localhost:10000'\n }\n return host\n}\n\nexport function getAuthConfig(host: string): { domain: string; clientId: string; audience: string } {\n let domain = '',\n clientId = '',\n audience = ''\n switch (host) {\n case 'local':\n domain = 'https://sentio-dev.us.auth0.com'\n clientId = 'qGDisObqQbcPeRA8k02POPZ2Df4KVCna'\n audience = 'http://localhost:8080/v1'\n break\n case '':\n case undefined:\n case 'prod':\n domain = 'https://auth.sentio.xyz'\n clientId = 'xd80PeuvuZVHpBFh7yEdlSZdtE5mTpGe'\n audience = 'https://app.sentio.xyz/api/v1'\n break\n case 'test':\n case 'staging':\n domain = 'https://auth.test.sentio.xyz'\n clientId = 'qXVvovHaOE37SndxTZJxCKgZjw1axPax'\n audience = 'https://test.sentio.xyz/api/v1'\n break\n default:\n break\n }\n return { domain, clientId, audience }\n}\n\nexport function finalizeHost(config: SentioProjectConfig) {\n config.host = getFinalizedHost(config.host)\n}\n\nexport function FinalizeProjectName(config: SentioProjectConfig, owner: string | undefined) {\n if (owner) {\n let name = config.project\n if (name.includes('/')) {\n name = config.project.split('/')[1]\n }\n config.project = [owner, name].join('/')\n }\n}\n\n// export interface Target {\n// chain: string\n// abisDir?: string\n// }\n//\n// // Supported target chain, lower case\n// export const EVM = 'evm'\n// export const SOLANA = 'solana'\n"]}
@@ -1,14 +1,9 @@
1
1
  import { BaseContext } from './context';
2
- import { ExportConfig_ExportType } from '@sentio/sdk';
3
2
  export declare type Export = Record<string, any>;
4
- export interface ExporterOptions {
5
- exportType: ExportConfig_ExportType;
6
- exportUrl: string;
7
- }
8
3
  export declare class Exporter {
9
- static register(exporterName: string, options: ExporterOptions): Exporter;
10
- exportName: string;
11
- options: ExporterOptions;
12
- protected constructor(eventName: string, options: ExporterOptions);
4
+ static register(name: string, channel: string): Exporter;
5
+ name: string;
6
+ channel: string;
7
+ protected constructor(name: string, channel: string);
13
8
  emit(ctx: BaseContext, data: Export): void;
14
9
  }
@@ -3,20 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Exporter = void 0;
4
4
  const sdk_1 = require("@sentio/sdk");
5
5
  class Exporter {
6
- static register(exporterName, options) {
7
- const exporter = new Exporter(exporterName, options);
6
+ static register(name, channel) {
7
+ const exporter = new Exporter(name, channel);
8
8
  global.PROCESSOR_STATE.exporters.push(exporter);
9
9
  return exporter;
10
10
  }
11
- exportName;
12
- options;
13
- constructor(eventName, options) {
14
- this.exportName = eventName;
15
- this.options = options;
11
+ name;
12
+ channel;
13
+ constructor(name, channel) {
14
+ this.name = name;
15
+ this.channel = channel;
16
16
  }
17
17
  emit(ctx, data) {
18
18
  const res = {
19
- metadata: ctx.getMetaData(sdk_1.DataDescriptor.fromPartial({ name: this.exportName }), {}),
19
+ metadata: ctx.getMetaData(sdk_1.DataDescriptor.fromPartial({ name: this.name }), {}),
20
20
  payload: JSON.stringify(data),
21
21
  runtimeInfo: undefined,
22
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../src/core/exporter.ts"],"names":[],"mappings":";;;AACA,qCAAmF;AASnF,MAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QAC5D,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;QACpD,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC/C,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,UAAU,CAAQ;IAClB,OAAO,CAAiB;IACxB,YAAsB,SAAiB,EAAE,OAAwB;QAC/D,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,IAAI,CAAC,GAAgB,EAAE,IAAY;QACjC,MAAM,GAAG,GAAiB;YACxB,QAAQ,EAAE,GAAG,CAAC,WAAW,CAAC,oBAAc,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;YACpF,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC7B,WAAW,EAAE,SAAS;SACvB,CAAA;QACD,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CACF;AAtBD,4BAsBC","sourcesContent":["import { BaseContext } from './context'\nimport { DataDescriptor, ExportResult, ExportConfig_ExportType } from '@sentio/sdk'\n\nexport type Export = Record<string, any>\n\nexport interface ExporterOptions {\n exportType: ExportConfig_ExportType\n exportUrl: string\n}\n\nexport class Exporter {\n static register(exporterName: string, options: ExporterOptions) {\n const exporter = new Exporter(exporterName, options)\n global.PROCESSOR_STATE.exporters.push(exporter)\n return exporter\n }\n\n exportName: string\n options: ExporterOptions\n protected constructor(eventName: string, options: ExporterOptions) {\n this.exportName = eventName\n this.options = options\n }\n\n emit(ctx: BaseContext, data: Export) {\n const res: ExportResult = {\n metadata: ctx.getMetaData(DataDescriptor.fromPartial({ name: this.exportName }), {}),\n payload: JSON.stringify(data),\n runtimeInfo: undefined,\n }\n ctx.res.exports.push(res)\n }\n}\n"]}
1
+ {"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../src/core/exporter.ts"],"names":[],"mappings":";;;AACA,qCAA0D;AAI1D,MAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,IAAY,EAAE,OAAe;QAC3C,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC5C,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC/C,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,IAAI,CAAQ;IACZ,OAAO,CAAQ;IACf,YAAsB,IAAY,EAAE,OAAe;QACjD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,IAAI,CAAC,GAAgB,EAAE,IAAY;QACjC,MAAM,GAAG,GAAiB;YACxB,QAAQ,EAAE,GAAG,CAAC,WAAW,CAAC,oBAAc,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9E,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC7B,WAAW,EAAE,SAAS;SACvB,CAAA;QACD,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CACF;AAtBD,4BAsBC","sourcesContent":["import { BaseContext } from './context'\nimport { DataDescriptor, ExportResult } from '@sentio/sdk'\n\nexport type Export = Record<string, any>\n\nexport class Exporter {\n static register(name: string, channel: string) {\n const exporter = new Exporter(name, channel)\n global.PROCESSOR_STATE.exporters.push(exporter)\n return exporter\n }\n\n name: string\n channel: string\n protected constructor(name: string, channel: string) {\n this.name = name\n this.channel = channel\n }\n\n emit(ctx: BaseContext, data: Export) {\n const res: ExportResult = {\n metadata: ctx.getMetaData(DataDescriptor.fromPartial({ name: this.name }), {}),\n payload: JSON.stringify(data),\n runtimeInfo: undefined,\n }\n ctx.res.exports.push(res)\n }\n}\n"]}
@@ -75,16 +75,9 @@ export interface EventTrackingConfig {
75
75
  retentionConfig: RetentionConfig | undefined;
76
76
  }
77
77
  export interface ExportConfig {
78
- exportName: string;
79
- exportType: ExportConfig_ExportType;
80
- exportUrl: string;
81
- }
82
- export declare enum ExportConfig_ExportType {
83
- WEBHOOK = 0,
84
- UNRECOGNIZED = -1
78
+ name: string;
79
+ channel: string;
85
80
  }
86
- export declare function exportConfig_ExportTypeFromJSON(object: any): ExportConfig_ExportType;
87
- export declare function exportConfig_ExportTypeToJSON(object: ExportConfig_ExportType): string;
88
81
  export interface MetricConfig {
89
82
  name: string;
90
83
  description: string;
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DataDescriptor = exports.ProcessResult = exports.RawBlock = exports.BlockBinding = exports.DataBinding = exports.Data = exports.Instruction = exports.RawTransaction = exports.ProcessBindingResponse = exports.ProcessBindingsRequest = exports.ProcessBlocksRequest = exports.ProcessInstructionsRequest = exports.ProcessTransactionsRequest = exports.Topic = exports.AptosCallFilter = exports.AptosCallHandlerConfig = exports.AptosEventFilter = exports.AptosEventHandlerConfig = exports.InstructionHandlerConfig = exports.LogFilter = exports.LogHandlerConfig = exports.TraceHandlerConfig = exports.BlockHandlerConfig = exports.StartRequest = exports.TemplateInstance = exports.ContractInfo = exports.AptosOnIntervalConfig = exports.OnIntervalConfig = exports.AccountConfig = exports.MetricConfig = exports.ExportConfig = exports.EventTrackingConfig = exports.RetentionConfig = exports.TotalPerEntityAggregation = exports.ContractConfig = exports.ProcessConfigResponse = exports.ProcessConfigRequest = exports.ProjectConfig = exports.exportConfig_ExportTypeToJSON = exports.exportConfig_ExportTypeFromJSON = exports.ExportConfig_ExportType = exports.totalPerEntityAggregation_TypeToJSON = exports.totalPerEntityAggregation_TypeFromJSON = exports.TotalPerEntityAggregation_Type = exports.logLevelToJSON = exports.logLevelFromJSON = exports.LogLevel = exports.handlerTypeToJSON = exports.handlerTypeFromJSON = exports.HandlerType = void 0;
7
- exports.ProcessorDefinition = exports.ExportResult = exports.EventTrackingResult = exports.LogResult = exports.CounterResult = exports.GaugeResult = exports.RuntimeInfo = exports.BigInteger = exports.MetricValue = exports.RecordMetaData_LabelsEntry = exports.RecordMetaData = void 0;
6
+ exports.MetricValue = exports.RecordMetaData_LabelsEntry = exports.RecordMetaData = exports.DataDescriptor = exports.ProcessResult = exports.RawBlock = exports.BlockBinding = exports.DataBinding = exports.Data = exports.Instruction = exports.RawTransaction = exports.ProcessBindingResponse = exports.ProcessBindingsRequest = exports.ProcessBlocksRequest = exports.ProcessInstructionsRequest = exports.ProcessTransactionsRequest = exports.Topic = exports.AptosCallFilter = exports.AptosCallHandlerConfig = exports.AptosEventFilter = exports.AptosEventHandlerConfig = exports.InstructionHandlerConfig = exports.LogFilter = exports.LogHandlerConfig = exports.TraceHandlerConfig = exports.BlockHandlerConfig = exports.StartRequest = exports.TemplateInstance = exports.ContractInfo = exports.AptosOnIntervalConfig = exports.OnIntervalConfig = exports.AccountConfig = exports.MetricConfig = exports.ExportConfig = exports.EventTrackingConfig = exports.RetentionConfig = exports.TotalPerEntityAggregation = exports.ContractConfig = exports.ProcessConfigResponse = exports.ProcessConfigRequest = exports.ProjectConfig = exports.totalPerEntityAggregation_TypeToJSON = exports.totalPerEntityAggregation_TypeFromJSON = exports.TotalPerEntityAggregation_Type = exports.logLevelToJSON = exports.logLevelFromJSON = exports.LogLevel = exports.handlerTypeToJSON = exports.handlerTypeFromJSON = exports.HandlerType = void 0;
7
+ exports.ProcessorDefinition = exports.ExportResult = exports.EventTrackingResult = exports.LogResult = exports.CounterResult = exports.GaugeResult = exports.RuntimeInfo = exports.BigInteger = void 0;
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const empty_1 = require("../../google/protobuf/empty");
10
10
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
@@ -167,33 +167,6 @@ function totalPerEntityAggregation_TypeToJSON(object) {
167
167
  }
168
168
  }
169
169
  exports.totalPerEntityAggregation_TypeToJSON = totalPerEntityAggregation_TypeToJSON;
170
- var ExportConfig_ExportType;
171
- (function (ExportConfig_ExportType) {
172
- ExportConfig_ExportType[ExportConfig_ExportType["WEBHOOK"] = 0] = "WEBHOOK";
173
- ExportConfig_ExportType[ExportConfig_ExportType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
174
- })(ExportConfig_ExportType = exports.ExportConfig_ExportType || (exports.ExportConfig_ExportType = {}));
175
- function exportConfig_ExportTypeFromJSON(object) {
176
- switch (object) {
177
- case 0:
178
- case "WEBHOOK":
179
- return ExportConfig_ExportType.WEBHOOK;
180
- case -1:
181
- case "UNRECOGNIZED":
182
- default:
183
- return ExportConfig_ExportType.UNRECOGNIZED;
184
- }
185
- }
186
- exports.exportConfig_ExportTypeFromJSON = exportConfig_ExportTypeFromJSON;
187
- function exportConfig_ExportTypeToJSON(object) {
188
- switch (object) {
189
- case ExportConfig_ExportType.WEBHOOK:
190
- return "WEBHOOK";
191
- case ExportConfig_ExportType.UNRECOGNIZED:
192
- default:
193
- return "UNRECOGNIZED";
194
- }
195
- }
196
- exports.exportConfig_ExportTypeToJSON = exportConfig_ExportTypeToJSON;
197
170
  function createBaseProjectConfig() {
198
171
  return { name: "", version: "" };
199
172
  }
@@ -866,18 +839,15 @@ exports.EventTrackingConfig = {
866
839
  },
867
840
  };
868
841
  function createBaseExportConfig() {
869
- return { exportName: "", exportType: 0, exportUrl: "" };
842
+ return { name: "", channel: "" };
870
843
  }
871
844
  exports.ExportConfig = {
872
845
  encode(message, writer = minimal_1.default.Writer.create()) {
873
- if (message.exportName !== "") {
874
- writer.uint32(10).string(message.exportName);
875
- }
876
- if (message.exportType !== 0) {
877
- writer.uint32(16).int32(message.exportType);
846
+ if (message.name !== "") {
847
+ writer.uint32(10).string(message.name);
878
848
  }
879
- if (message.exportUrl !== "") {
880
- writer.uint32(26).string(message.exportUrl);
849
+ if (message.channel !== "") {
850
+ writer.uint32(18).string(message.channel);
881
851
  }
882
852
  return writer;
883
853
  },
@@ -889,13 +859,10 @@ exports.ExportConfig = {
889
859
  const tag = reader.uint32();
890
860
  switch (tag >>> 3) {
891
861
  case 1:
892
- message.exportName = reader.string();
862
+ message.name = reader.string();
893
863
  break;
894
864
  case 2:
895
- message.exportType = reader.int32();
896
- break;
897
- case 3:
898
- message.exportUrl = reader.string();
865
+ message.channel = reader.string();
899
866
  break;
900
867
  default:
901
868
  reader.skipType(tag & 7);
@@ -906,26 +873,20 @@ exports.ExportConfig = {
906
873
  },
907
874
  fromJSON(object) {
908
875
  return {
909
- exportName: isSet(object.exportName) ? String(object.exportName) : "",
910
- exportType: isSet(object.exportType)
911
- ? exportConfig_ExportTypeFromJSON(object.exportType)
912
- : 0,
913
- exportUrl: isSet(object.exportUrl) ? String(object.exportUrl) : "",
876
+ name: isSet(object.name) ? String(object.name) : "",
877
+ channel: isSet(object.channel) ? String(object.channel) : "",
914
878
  };
915
879
  },
916
880
  toJSON(message) {
917
881
  const obj = {};
918
- message.exportName !== undefined && (obj.exportName = message.exportName);
919
- message.exportType !== undefined &&
920
- (obj.exportType = exportConfig_ExportTypeToJSON(message.exportType));
921
- message.exportUrl !== undefined && (obj.exportUrl = message.exportUrl);
882
+ message.name !== undefined && (obj.name = message.name);
883
+ message.channel !== undefined && (obj.channel = message.channel);
922
884
  return obj;
923
885
  },
924
886
  fromPartial(object) {
925
887
  const message = createBaseExportConfig();
926
- message.exportName = object.exportName ?? "";
927
- message.exportType = object.exportType ?? 0;
928
- message.exportUrl = object.exportUrl ?? "";
888
+ message.name = object.name ?? "";
889
+ message.channel = object.channel ?? "";
929
890
  return message;
930
891
  },
931
892
  };