pathchain 1.0.37 → 1.0.39

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 (3) hide show
  1. package/index.js +4 -4
  2. package/maker.js +11 -11
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -191,8 +191,8 @@ exports.getNodeObj = (xnode, xauthor="") => {
191
191
  *
192
192
  * @return {string} path_buffer
193
193
  */
194
- exports.makePath = (xauthor = "", text ="", head="", ancestor="", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
195
- const path_buffer = maker.path(xauthor, text, head, ancestor, format);
194
+ exports.makePath = (text ="", head="", xauthor = "", ancestor="", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
195
+ const path_buffer = maker.path(text, head, xauthor, ancestor, format);
196
196
  return path_buffer;
197
197
  }
198
198
 
@@ -244,8 +244,8 @@ exports.getLabelObj = (xlabel, xauthor="") => {
244
244
  *
245
245
  * @return {string} nodelink_buffer
246
246
  */
247
- exports.makeNodelink = (xauthor = "", ancestor = "", first="", second="", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
248
- const nodelink_buffer = maker.nodelink(xauthor, ancestor, first, second, format);
247
+ exports.makeNodelink = (first="", second="", xauthor = "", ancestor = "", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
248
+ const nodelink_buffer = maker.nodelink(first, second, xauthor, ancestor, format);
249
249
  return nodelink_buffer;
250
250
  }
251
251
 
package/maker.js CHANGED
@@ -260,7 +260,7 @@ function node(text, author, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
260
260
  *
261
261
  * @return {string} path_hash
262
262
  */
263
- function path(author, text, head, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
263
+ function path(text, head, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
264
264
  var path_pb = pb(fs.readFileSync('node_modules/pathchain/proto/path.proto'))
265
265
 
266
266
  var author_folder = author;
@@ -286,9 +286,9 @@ function path(author, text, head, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]
286
286
  register: "moments/"+register_moment_hash,
287
287
  author: author,
288
288
  text: text,
289
- head: head,
290
- ancestor: ancestor,
291
- tag: "paths/"+path_hash,
289
+ head: "nodelinks/" + head,
290
+ ancestor: author_folder + "paths/" + ancestor,
291
+ tag: author_folder + "paths/" + path_hash,
292
292
  })
293
293
 
294
294
  checker.checkDir("files/" + author_folder + "paths/") // checking
@@ -334,8 +334,8 @@ function label(text, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
334
334
  register: "moments/" + register_moment_hash,
335
335
  author: "etities/" + author,
336
336
  text: text,
337
- ancestor: ancestor,
338
- tag: "labels/" + label_hash
337
+ ancestor: author_folder + "labels/" + ancestor,
338
+ tag: author_folder + "labels/" + label_hash
339
339
  })
340
340
 
341
341
  checker.checkDir("files/" + author_folder + "labels/") // checking
@@ -354,7 +354,7 @@ function label(text, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
354
354
  *
355
355
  * @return {string} nodelink_hash
356
356
  */
357
- function nodelink(author, ancestor, first, second, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
357
+ function nodelink(first, second, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
358
358
  var nodelink_pb = pb(fs.readFileSync('node_modules/pathchain/proto/nodelink.proto'))
359
359
 
360
360
  if(first == "" || second == "") return "Two nodes are required to create a nodelink";
@@ -381,10 +381,10 @@ function nodelink(author, ancestor, first, second, format = 'MM DD YYYY HH:mm:SS
381
381
  var buffer = nodelink_pb.nodelink.encode({
382
382
  register: "moments/" + register_moment_hash,
383
383
  author: "etities/" + author,
384
- first: first,
385
- second: second,
386
- ancestor: ancestor,
387
- tag: "nodelinks/" + nodelink_hash
384
+ first: "nodes/" + first,
385
+ second: "nodes/" + second,
386
+ ancestor: author_folder + "nodelinks/" + ancestor,
387
+ tag: author_folder + "nodelinks/" + nodelink_hash
388
388
  })
389
389
 
390
390
  checker.checkDir("files/" + author_folder + "nodelinks/") // checking
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pathchain",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "dependencies": {
5
5
  "date-and-time": "^3.0.2",
6
6
  "empty-dir": "^3.0.0",