-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New team_id
type, updates to built-ins, updated builtin function generation script instructions
#327
Merged
Merged
New team_id
type, updates to built-ins, updated builtin function generation script instructions
#327
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fb63340
incrementing build shiet
cb2efec
tweaks
5a4140f
Alphabetize slack types, add team ID type
fb5e6a4
Built in function updates:
ea604cf
model is_hidden on builtin function parameters.
348d679
warn of hidden parameters during generation
3bb52fb
remove hidden openform param
3a84dad
tweak instructions around how to deal with hidden parameter warnings …
5e56b41
tighten up warning for hidden params, update generation script readme…
12a514c
dont warn on hidden params, instead filter them out, but, have a spec…
3b8b514
deno fmt
8bbd3e1
get rid of console log
402a42d
on_submit is actually not exposed and hidden so :shhhhh:
dbdf44b
woopsie
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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,50 @@ | ||
/** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New built-in that's been public for a little bit. |
||
import { DefineFunction } from "../../../functions/mod.ts"; | ||
import SchemaTypes from "../../schema_types.ts"; | ||
import SlackTypes from "../schema_types.ts"; | ||
|
||
export default DefineFunction({ | ||
callback_id: "slack#/functions/add_bookmark", | ||
source_file: "", | ||
title: "Add a bookmark", | ||
input_parameters: { | ||
properties: { | ||
channel_id: { | ||
type: SlackTypes.channel_id, | ||
description: "Search all channels", | ||
title: "Select a channel", | ||
}, | ||
name: { | ||
type: SchemaTypes.string, | ||
description: "Enter the bookmark name", | ||
title: "Bookmark name", | ||
}, | ||
link: { | ||
type: SchemaTypes.string, | ||
description: "https://docs.acme.com", | ||
title: "Bookmark Link", | ||
}, | ||
}, | ||
required: ["channel_id", "name", "link"], | ||
}, | ||
output_parameters: { | ||
properties: { | ||
channel_id: { | ||
type: SlackTypes.channel_id, | ||
description: "Channel", | ||
title: "Channel", | ||
}, | ||
bookmark_name: { | ||
type: SchemaTypes.string, | ||
description: "Bookmark name", | ||
title: "Bookmark name", | ||
}, | ||
bookmark_link: { | ||
type: SchemaTypes.string, | ||
description: "Bookmark link", | ||
title: "Bookmark link", | ||
}, | ||
}, | ||
required: ["channel_id", "bookmark_name", "bookmark_link"], | ||
}, | ||
}); |
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,102 @@ | ||
/** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ | ||
import { | ||
assertEquals, | ||
assertExists, | ||
assertNotStrictEquals, | ||
} from "../../../dev_deps.ts"; | ||
import { DefineWorkflow } from "../../../workflows/mod.ts"; | ||
import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; | ||
import SchemaTypes from "../../schema_types.ts"; | ||
import SlackTypes from "../schema_types.ts"; | ||
import AddBookmark from "./add_bookmark.ts"; | ||
|
||
Deno.test("AddBookmark generates valid FunctionManifest", () => { | ||
assertEquals( | ||
AddBookmark.definition.callback_id, | ||
"slack#/functions/add_bookmark", | ||
); | ||
const expected: ManifestFunctionSchema = { | ||
source_file: "", | ||
title: "Add a bookmark", | ||
input_parameters: { | ||
properties: { | ||
channel_id: { | ||
type: SlackTypes.channel_id, | ||
description: "Search all channels", | ||
title: "Select a channel", | ||
}, | ||
name: { | ||
type: SchemaTypes.string, | ||
description: "Enter the bookmark name", | ||
title: "Bookmark name", | ||
}, | ||
link: { | ||
type: SchemaTypes.string, | ||
description: "https://docs.acme.com", | ||
title: "Bookmark Link", | ||
}, | ||
}, | ||
required: ["channel_id", "name", "link"], | ||
}, | ||
output_parameters: { | ||
properties: { | ||
channel_id: { | ||
type: SlackTypes.channel_id, | ||
description: "Channel", | ||
title: "Channel", | ||
}, | ||
bookmark_name: { | ||
type: SchemaTypes.string, | ||
description: "Bookmark name", | ||
title: "Bookmark name", | ||
}, | ||
bookmark_link: { | ||
type: SchemaTypes.string, | ||
description: "Bookmark link", | ||
title: "Bookmark link", | ||
}, | ||
}, | ||
required: ["channel_id", "bookmark_name", "bookmark_link"], | ||
}, | ||
}; | ||
const actual = AddBookmark.export(); | ||
|
||
assertNotStrictEquals(actual, expected); | ||
}); | ||
|
||
Deno.test("AddBookmark can be used as a Slack function in a workflow step", () => { | ||
const testWorkflow = DefineWorkflow({ | ||
callback_id: "test_AddBookmark_slack_function", | ||
title: "Test AddBookmark", | ||
description: "This is a generated test to test AddBookmark", | ||
}); | ||
testWorkflow.addStep(AddBookmark, { | ||
channel_id: "test", | ||
name: "test", | ||
link: "test", | ||
}); | ||
const actual = testWorkflow.steps[0].export(); | ||
|
||
assertEquals(actual.function_id, "slack#/functions/add_bookmark"); | ||
assertEquals(actual.inputs, { | ||
channel_id: "test", | ||
name: "test", | ||
link: "test", | ||
}); | ||
}); | ||
|
||
Deno.test("All outputs of Slack function AddBookmark should exist", () => { | ||
const testWorkflow = DefineWorkflow({ | ||
callback_id: "test_AddBookmark_slack_function", | ||
title: "Test AddBookmark", | ||
description: "This is a generated test to test AddBookmark", | ||
}); | ||
const step = testWorkflow.addStep(AddBookmark, { | ||
channel_id: "test", | ||
name: "test", | ||
link: "test", | ||
}); | ||
assertExists(step.outputs.channel_id); | ||
assertExists(step.outputs.bookmark_name); | ||
assertExists(step.outputs.bookmark_link); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flattening out
deno.jsonc
to remove deprecation warnings fromdeno
output