-
Notifications
You must be signed in to change notification settings - Fork 12
Quick poc for new project config #19
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| { | ||
| "name": "project_name", | ||
| "srcDir": "src" | ||
| "name": "project_name" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,21 @@ | ||
| // For external API calls | ||
| const axios = require("axios"); | ||
|
|
||
| exports.main = async (context = {}, sendResponse) => { | ||
| const appConfig = { | ||
|
Contributor
Author
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. This replaces example-card.json. It also replaces serverless.json b/c
Contributor
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. I like this first version. I'm sure you all will discuss more and iterate on this, but pumped to see where it's going. 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. Does app config in code invite dynamicism? |
||
| title: "Example CRM Card", | ||
| location: "crm.record.tab", | ||
| fetch: { | ||
| objectTypes: [ | ||
| { | ||
| "name": "contacts", | ||
| "propertiesToSend": ["firstname"] | ||
| } | ||
| ] | ||
| }, | ||
| secrets: [] | ||
| }; | ||
|
|
||
| const appFunction = async (context = {}, sendResponse) => { | ||
| // Store contact firstname, configured as propertiesToSend in crm-card.json | ||
| const { firstname } = context.propertiesToSend; | ||
|
|
||
|
|
@@ -80,3 +94,8 @@ exports.main = async (context = {}, sendResponse) => { | |
| }); | ||
| } | ||
| }; | ||
|
|
||
| exports.main = { | ||
| appConfig, | ||
| appFunction | ||
| } | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,14 +2,5 @@ | |
| "name": "Example App", | ||
| "description": "An example private app that contains a single card extension.", | ||
| "scopes": ["crm.objects.contacts.read", "crm.objects.contacts.write"], | ||
| "public": false, | ||
| "extensions": { | ||
|
Contributor
Author
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. This is replaced by new naming conventions:
|
||
| "crm": { | ||
| "cards": [ | ||
| { | ||
| "file": "./example-card.json" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| "public": false | ||
| } | ||
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.
This is an example of where we can implement convention over configuration. By default we will assume the
srcfolder is the srcDir. The user is able to override this default behavior though.