dcp-client 4.2.26 → 4.2.28

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.
@@ -10,20 +10,23 @@
10
10
  const fs = require('fs');
11
11
 
12
12
  const dcpClient = require('..');
13
+ const assert = require('assert');
13
14
  const { Address } = require('dcp/wallet');
14
- const kvin = require('kvin');
15
+ const kvin = require('dcp/internal/kvin');
15
16
 
16
17
  let outputFd = +(process.env.BUILD_DCP_CONFIG_OUTPUT_FD || "3");
17
18
 
18
19
  async function main() {
19
- const custom = new kvin.KVIN();
20
- custom.userCtors.dcpEth$$Address = Address;
20
+ const custom = dcpClient.__KVIN;
21
+ assert(custom.userCtors.dcpEth$$Address);
22
+ assert(custom.userCtors.dcpUrl$$DcpURL);
21
23
 
22
24
  dcpClient._initHead();
23
25
 
24
26
  const input = fs.readFileSync(process.stdin.fd, 'utf-8');
25
27
  const { initConfig, options } = custom.deserialize(input);
26
- const outputObjects = await dcpClient.createAggregateConfig(initConfig, options);
28
+ const outputObjects = await dcpClient.createConfigFragments(initConfig, options);
29
+ delete outputObjects.internalConfig;
27
30
  const output = await custom.serializeAsync(outputObjects);
28
31
 
29
32
  try {
package/dcp-client.js CHANGED
@@ -12,21 +12,7 @@
12
12
  * @author Wes Garland, wes@kingsds.network
13
13
  * @date Aug 2019
14
14
  */
15
- const allScripts = document.getElementsByTagName('SCRIPT');
16
- const thisScript = allScripts[allScripts.length - 1];
17
-
18
- if (thisScript.getAttribute('data-autoinit') === 'false')
19
- {
20
- thisScript.removeAttribute('data-autoinit');
21
- window.dcp = { init: namespace };
22
- }
23
- else
24
- {
25
- namespace();
26
- }
27
-
28
- function namespace()
29
- {
15
+ (function namespaceIIFE() {
30
16
 
31
17
  console.log(`%c
32
18
  _____ _____ ___________ _
@@ -45,6 +31,8 @@ https://distributed.computer/`, "font-weight: bold; font-size: 1.2em; color: #00
45
31
  var _dcpConfig = typeof dcpConfig === 'object' ? dcpConfig : undefined;
46
32
 
47
33
  {
34
+ let allScripts = document.getElementsByTagName('SCRIPT');
35
+ let thisScript = allScripts[allScripts.length - 1];
48
36
  let thisScriptURL = new URL(thisScript.src)
49
37
  let schedulerURL;
50
38
  let dcpConfigHref = thisScript.getAttribute('dcpConfig');
@@ -189,5 +177,5 @@ https://distributed.computer/`, "font-weight: bold; font-size: 1.2em; color: #00
189
177
  loadBundle(shimCallback);
190
178
  loadLinks();
191
179
  }
192
- };
180
+ })();
193
181