Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cafc4e6
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*{ | ||
"author": "Brian Hicks", | ||
"targets": ["omnifocus"], | ||
"type": "action", | ||
"identifier": "zone.bytes.linear.pull", | ||
"version": "0.1", | ||
"description": "Pull assigned tasks from Linear, creating projects and tags as necessary", | ||
"label": "Pull from Linear", | ||
"mediumLabel": "Pull from Linear", | ||
"longLabel": "Pull from Linear", | ||
"paletteLabel": "Pull from Linear", | ||
}*/ | ||
(() => { | ||
// var query = "{ viewer { assignedIssues(filter: {state: {type: {nin: ["completed","canceled"]}}}) { nodes { identifier title url team { name } project { name } } } } }"; | ||
let creds = new Credentials(); | ||
let linearService = "api.linear.app"; | ||
|
||
var action = new PlugIn.Action(async () => { | ||
console.log(app.optionKeyDown); | ||
let stored = creds.read(linearService); | ||
|
||
let key = null; | ||
if (stored === null) { | ||
let credsForm = new Form(); | ||
credsForm.addField(new Form.Field.Password("key", "API Key")); | ||
|
||
await credsForm.show("Please create a personal API key in the Linear settings and paste it here\n(hold option while activating this workflow in the future to reset this)", "Save Key"); | ||
key = credsForm.values.key; | ||
|
||
creds.write(linearService, "", key); | ||
} | ||
|
||
console.log("before", new Date()); | ||
var alert = new Alert("title", "body"); | ||
await alert.show(); | ||
console.log("after", new Date()); | ||
}); | ||
|
||
// If needed, uncomment, and add a function that returns true if the current selection is appropriate for the action. | ||
/* | ||
action.validate = function(selection){ | ||
|
||
}; | ||
*/ | ||
|
||
return action; | ||
})(); |