@prosopo/config 0.2.7 → 0.2.8

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,2 +1,2 @@
1
- export { default as testConfig } from './test.js';
1
+ export { default as getTestConfig } from './test.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAA"}
@@ -1,2 +1,2 @@
1
- export { default as testConfig } from './test.js';
1
+ export { default as getTestConfig } from './test.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAA"}
@@ -1,23 +1,21 @@
1
- declare const _default: {
1
+ export default function getTestConfig(): {
2
2
  logLevel: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
3
- contract: {
4
- abi: string;
5
- };
6
- defaultEnvironment: "development";
3
+ defaultEnvironment: "production" | "development" | "staging";
4
+ defaultNetwork: "development" | "rococo" | "shiden";
7
5
  account: {
8
- password: string;
9
- address: string;
10
- };
11
- networks: {
12
- development: {
13
- endpoint: string;
14
- contract: {
15
- address: string;
16
- name: string;
17
- };
18
- accounts: string[];
6
+ address?: string | undefined;
7
+ secret?: string | undefined;
8
+ password?: string | undefined;
9
+ };
10
+ networks: Record<"development" | "rococo" | "shiden", {
11
+ endpoint: string;
12
+ contract: {
13
+ address: string;
14
+ name: string;
19
15
  };
20
- };
16
+ pairType: "sr25519" | "ed25519" | "ecdsa" | "ethereum";
17
+ ss58Format: number;
18
+ }>;
21
19
  captchas: {
22
20
  solved: {
23
21
  count: number;
@@ -29,30 +27,21 @@ declare const _default: {
29
27
  captchaSolutions: {
30
28
  requiredNumberOfSolutions: number;
31
29
  solutionWinningPercentage: number;
32
- captchaFilePath: string;
33
30
  captchaBlockRecency: number;
34
31
  };
35
- database: {
36
- development: {
37
- type: "mongoMemory";
38
- endpoint: string;
39
- dbname: string;
40
- authSource: string;
41
- };
42
- };
43
- assets: {
44
- absolutePath: string;
45
- basePath: string;
32
+ batchCommit: {
33
+ interval: number;
34
+ maxBatchExtrinsicPercentage: number;
46
35
  };
47
36
  server: {
48
37
  baseURL: string;
49
38
  port: number;
50
- fileServePaths: string;
51
- };
52
- batchCommit: {
53
- interval: number;
54
- maxBatchExtrinsicPercentage: number;
55
39
  };
40
+ database?: Partial<Record<"production" | "development" | "staging", {
41
+ type: string;
42
+ endpoint: string;
43
+ dbname: string;
44
+ authSource: string;
45
+ }>> | undefined;
56
46
  };
57
- export default _default;
58
47
  //# sourceMappingURL=test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/provider/test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAiDC"}
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/provider/test.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BpC"}
@@ -1,53 +1,34 @@
1
- import { DatabaseTypes, EnvironmentTypesSchema } from '@prosopo/types';
1
+ import { DatabaseTypes, EnvironmentTypesSchema, NetworkNamesSchema, NetworkPairTypeSchema, ProsopoConfigSchema, } from '@prosopo/types';
2
2
  import { getLogLevel } from '@prosopo/common';
3
3
  const logLevel = getLogLevel();
4
- export default {
5
- logLevel,
6
- contract: { abi: '../contract/src/abi/prosopo.json' },
7
- defaultEnvironment: EnvironmentTypesSchema.Values.development,
8
- account: {
9
- password: '',
10
- address: '',
11
- },
12
- networks: {
13
- development: {
14
- endpoint: process.env.SUBSTRATE_NODE_URL || 'ws://localhost:9944',
15
- contract: {
16
- address: process.env.PROTOCOL_CONTRACT_ADDRESS || '',
17
- name: 'prosopo',
18
- },
19
- accounts: ['//Alice', '//Bob', '//Charlie', '//Dave', '//Eve', '//Ferdie'],
4
+ export default function getTestConfig() {
5
+ return ProsopoConfigSchema.parse({
6
+ logLevel,
7
+ defaultEnvironment: EnvironmentTypesSchema.Values.development,
8
+ defaultNetwork: NetworkNamesSchema.Values.development,
9
+ account: {
10
+ password: '',
11
+ address: '',
12
+ },
13
+ database: {
14
+ development: { type: DatabaseTypes.enum.mongoMemory, endpoint: '', dbname: 'prosopo_test', authSource: '' },
20
15
  },
21
- },
22
- captchas: {
23
- solved: {
24
- count: 1,
16
+ server: {
17
+ baseURL: 'http://localhost',
18
+ port: 9229,
19
+ fileServePaths: '[]',
25
20
  },
26
- unsolved: {
27
- count: 1,
21
+ networks: {
22
+ development: {
23
+ endpoint: 'ws://localhost:9944',
24
+ contract: {
25
+ address: process.env.PROTOCOL_CONTRACT_ADDRESS || '',
26
+ name: 'prosopo',
27
+ },
28
+ pairType: NetworkPairTypeSchema.parse('sr25519'),
29
+ ss58Format: 42,
30
+ },
28
31
  },
29
- },
30
- captchaSolutions: {
31
- requiredNumberOfSolutions: 3,
32
- solutionWinningPercentage: 80,
33
- captchaFilePath: './tests/mocks/data/captchas.json',
34
- captchaBlockRecency: 10,
35
- },
36
- database: {
37
- development: { type: DatabaseTypes.enum.mongoMemory, endpoint: '', dbname: 'prosopo_test', authSource: '' },
38
- },
39
- assets: {
40
- absolutePath: '',
41
- basePath: '',
42
- },
43
- server: {
44
- baseURL: 'http://localhost',
45
- port: 9229,
46
- fileServePaths: '[]',
47
- },
48
- batchCommit: {
49
- interval: 1000000,
50
- maxBatchExtrinsicPercentage: 59,
51
- },
52
- };
32
+ });
33
+ }
53
34
  //# sourceMappingURL=test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/provider/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;AAC9B,eAAe;IACX,QAAQ;IACR,QAAQ,EAAE,EAAE,GAAG,EAAE,kCAAkC,EAAE;IACrD,kBAAkB,EAAE,sBAAsB,CAAC,MAAM,CAAC,WAAW;IAC7D,OAAO,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,EAAE;KACd;IACD,QAAQ,EAAE;QACN,WAAW,EAAE;YACT,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,qBAAqB;YACjE,QAAQ,EAAE;gBACN,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,EAAE;gBACpD,IAAI,EAAE,SAAS;aAClB;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC;SAC7E;KACJ;IAED,QAAQ,EAAE;QACN,MAAM,EAAE;YACJ,KAAK,EAAE,CAAC;SACX;QACD,QAAQ,EAAE;YACN,KAAK,EAAE,CAAC;SACX;KACJ;IACD,gBAAgB,EAAE;QACd,yBAAyB,EAAE,CAAC;QAC5B,yBAAyB,EAAE,EAAE;QAC7B,eAAe,EAAE,kCAAkC;QACnD,mBAAmB,EAAE,EAAE;KAC1B;IACD,QAAQ,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ACN,WAAW,EAAE;gBACT,QAAQ,EAAE,qBAAqB;gBAC/B,QAAQ,EAAE;oBACN,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,EAAE;oBACpD,IAAI,EAAE,SAAS;iBAClB;gBACD,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC;gBAChD,UAAU,EAAE,EAAE;aACjB;SACJ;KACJ,CAAC,CAAA;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/config",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Prosopo config library",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -17,13 +17,13 @@
17
17
  "author": "Prosopo Limited",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@prosopo/common": "0.2.7",
21
- "@prosopo/types": "0.2.7",
20
+ "@prosopo/common": "0.2.8",
21
+ "@prosopo/types": "0.2.8",
22
22
  "glob": "^10.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@polkadot/dev": "^0.76.11",
26
- "@prosopo/util": "0.2.7",
26
+ "@prosopo/util": "0.2.8",
27
27
  "@rollup/plugin-alias": "^5.0.0",
28
28
  "@rollup/plugin-babel": "^6.0.3",
29
29
  "@rollup/plugin-commonjs": "^24.1.0",