From d63156a0d6b6d9276484f93c1d658e502bbb8fc9 Mon Sep 17 00:00:00 2001 From: Rai Date: Sat, 27 Aug 2022 13:40:01 -0700 Subject: [PATCH 1/3] Add some docs to note.js (for backend scripting docs) --- src/becca/entities/note.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/becca/entities/note.js b/src/becca/entities/note.js index 595e41052..e1ff8c227 100644 --- a/src/becca/entities/note.js +++ b/src/becca/entities/note.js @@ -1018,6 +1018,13 @@ class Note extends AbstractEntity { } /** + * Adds a new attribute to this note. The attribute is saved and returned. + * See addLabel, addRelation for more specific methods. + * + * @param {string} type - attribute type (label / relation) + * @param {string} name - name of the attribute, not including the leading ~/# + * @param {string} [value] - value of the attribute - text for labels, target note ID for relations; optional. + * * @return {Attribute} */ addAttribute(type, name, value = "", isInheritable = false, position = 1000) { @@ -1033,10 +1040,27 @@ class Note extends AbstractEntity { }).save(); } + /** + * Adds a new label to this note. The label attribute is saved and returned. + * + * @param {string} name - name of the label, not including the leading # + * @param {string} [value] - text value of the label; optional + * + * @return {Attribute} + */ addLabel(name, value = "", isInheritable = false) { return this.addAttribute(LABEL, name, value, isInheritable); } + /** + * Adds a new relation to this note. The relation attribute is saved and + * returned. + * + * @param {string} name - name of the relation, not including the leading ~ + * @param {string} value - ID of the target note of the relation + * + * @return {Attribute} + */ addRelation(name, targetNoteId, isInheritable = false) { return this.addAttribute(RELATION, name, targetNoteId, isInheritable); } From afb6180cce7ec63a20f54ab0713c898b4f5242af Mon Sep 17 00:00:00 2001 From: Rai Date: Sat, 27 Aug 2022 13:42:44 -0700 Subject: [PATCH 2/3] update docs --- docs/backend_api/Note.html | 525 ++++++++++++++++++- docs/backend_api/becca_entities_note.js.html | 24 + 2 files changed, 539 insertions(+), 10 deletions(-) diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html index c5eea4f2f..e9312b9e1 100644 --- a/docs/backend_api/Note.html +++ b/docs/backend_api/Note.html @@ -1582,13 +1582,17 @@ -

addAttribute() → {Attribute}

+

addAttribute(type, name, valueopt) → {Attribute}

+
+ Adds a new attribute to this note. The attribute is saved and returned. +See addLabel, addRelation for more specific methods. +
@@ -1598,6 +1602,130 @@ +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + + + + + attribute type (label / relation)
name + + +string + + + + + + + + + + name of the attribute, not including the leading ~/#
value + + +string + + + + + + <optional>
+ + + + + +
value of the attribute - text for labels, target note ID for relations; optional.
+ + + @@ -1630,7 +1758,384 @@
Source:
+ + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + + + + +

addLabel(name, valueopt) → {Attribute}

+ + + + + + +
+ Adds a new label to this note. The label attribute is saved and returned. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + + name of the label, not including the leading #
value + + +string + + + + + + <optional>
+ + + + + +
text value of the label; optional
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + + + + +

addRelation(name, value) → {Attribute}

+ + + + + + +
+ Adds a new relation to this note. The relation attribute is saved and +returned. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + name of the relation, not including the leading ~
value + + +string + + + + ID of the target note of the relation
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -1830,7 +2335,7 @@
Source:
@@ -9036,7 +9541,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -9216,7 +9721,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -9718,7 +10223,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -9878,7 +10383,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10120,7 +10625,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10331,7 +10836,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10542,7 +11047,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
diff --git a/docs/backend_api/becca_entities_note.js.html b/docs/backend_api/becca_entities_note.js.html index 3af1da710..683a14527 100644 --- a/docs/backend_api/becca_entities_note.js.html +++ b/docs/backend_api/becca_entities_note.js.html @@ -1046,6 +1046,13 @@ class Note extends AbstractEntity { } /** + * Adds a new attribute to this note. The attribute is saved and returned. + * See addLabel, addRelation for more specific methods. + * + * @param {string} type - attribute type (label / relation) + * @param {string} name - name of the attribute, not including the leading ~/# + * @param {string} [value] - value of the attribute - text for labels, target note ID for relations; optional. + * * @return {Attribute} */ addAttribute(type, name, value = "", isInheritable = false, position = 1000) { @@ -1061,10 +1068,27 @@ class Note extends AbstractEntity { }).save(); } + /** + * Adds a new label to this note. The label attribute is saved and returned. + * + * @param {string} name - name of the label, not including the leading # + * @param {string} [value] - text value of the label; optional + * + * @return {Attribute} + */ addLabel(name, value = "", isInheritable = false) { return this.addAttribute(LABEL, name, value, isInheritable); } + /** + * Adds a new relation to this note. The relation attribute is saved and + * returned. + * + * @param {string} name - name of the relation, not including the leading ~ + * @param {string} value - ID of the target note of the relation + * + * @return {Attribute} + */ addRelation(name, targetNoteId, isInheritable = false) { return this.addAttribute(RELATION, name, targetNoteId, isInheritable); } From 4af55d055eaa5e30e63753774fe4f55e213d7360 Mon Sep 17 00:00:00 2001 From: Rai Date: Sat, 27 Aug 2022 13:46:16 -0700 Subject: [PATCH 3/3] revert --- package-lock.json | 41 ++--------------------------------------- package.json | 2 -- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index ab4876465..de0fcd415 100644 --- a/package-lock.json +++ b/package-lock.json @@ -146,8 +146,6 @@ "debug": "^4.1.1", "env-paths": "^2.2.0", "fs-extra": "^8.1.0", - "global-agent": "^2.0.2", - "global-tunnel-ng": "^2.7.1", "got": "^9.6.0", "progress": "^2.0.3", "semver": "^6.2.0", @@ -240,7 +238,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -754,7 +751,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -1653,7 +1649,6 @@ "integrity": "sha512-vyxPxP5arcAqN4F/ebHd/HhwnAiZtwhglvdmc7BR2f0ywbVNTOpSeyhLDbGXtE/y58hv1oC75TaNIXutnsOZsQ==", "devOptional": true, "dependencies": { - "@types/glob": "^7.1.1", "chromium-pickle-js": "^0.2.0", "commander": "^5.0.0", "glob": "^7.1.6", @@ -2491,7 +2486,6 @@ "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -3758,7 +3752,6 @@ "optional": true, "dependencies": { "@malept/cross-spawn-promise": "^1.0.0", - "@types/fs-extra": "^9.0.1", "asar": "^3.0.0", "debug": "^4.1.1", "fs-extra": "^9.0.0", @@ -3799,7 +3792,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "optional": true, "dependencies": { - "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -3895,7 +3887,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "optional": true, "dependencies": { - "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -4027,7 +4018,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -4151,7 +4141,6 @@ "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, "dependencies": { - "@types/yauzl": "^2.9.1", "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" @@ -4202,7 +4191,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -4504,22 +4492,7 @@ "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", "integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==", "dependencies": { - "debug": "^4.1.1", - "env-paths": "^2.2.0", - "fs-extra": "^8.1.0", - "global-agent": "^3.0.0", - "global-tunnel-ng": "^2.7.1", - "got": "^9.6.0", - "progress": "^2.0.3", - "semver": "^6.2.0", - "sumchecker": "^3.0.1" - }, - "engines": { - "node": ">=8.6" - }, - "optionalDependencies": { - "global-agent": "^3.0.0", - "global-tunnel-ng": "^2.7.1" + "shimmer": "^1.2.0" } }, "node_modules/emoji-regex": { @@ -4674,8 +4647,7 @@ "esprima": "^4.0.1", "estraverse": "^5.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -5341,7 +5313,6 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dependencies": { - "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -6686,9 +6657,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dependencies": { - "graceful-fs": "^4.1.6" - }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -7289,12 +7257,7 @@ "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", "dev": true, "dependencies": { -<<<<<<< Updated upstream "minipass": "^3.1.6", -======= - "encoding": "^0.1.12", - "minipass": "^3.1.0", ->>>>>>> Stashed changes "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, diff --git a/package.json b/package.json index 322f92a38..b1a0b6976 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,6 @@ "ejs": "3.1.8", "electron-debug": "3.2.0", "electron-dl": "3.3.1", - "electron-find": "1.0.7", - "electron-installer-debian": "3.1.0", "electron-window-state": "5.0.3", "express": "4.18.1", "express-partial-content": "1.0.2",