Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions hsproject.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"name": "project_name",
"srcDir": "src"
Copy link
Contributor Author

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 src folder is the srcDir. The user is able to override this default behavior though.

"name": "project_name"
}
File renamed without changes.
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 = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces example-card.json. It also replaces serverless.json b/c secrets is moved into this json. We no longer need a file that links the appFunction to the app config because they live in the same file.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Choose a reason for hiding this comment

The 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;

Expand Down Expand Up @@ -80,3 +94,8 @@ exports.main = async (context = {}, sendResponse) => {
});
}
};

exports.main = {
appConfig,
appFunction
}
File renamed without changes.
10 changes: 0 additions & 10 deletions src/app/app.functions/serverless.json

This file was deleted.

16 changes: 0 additions & 16 deletions src/app/example-card.json

This file was deleted.

11 changes: 1 addition & 10 deletions src/app/app.json → src/app/hsapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is replaced by new naming conventions:

  • app.functions -> app.extensions
  • example-card.js -> example-card.card.js

"crm": {
"cards": [
{
"file": "./example-card.json"
}
]
}
}
"public": false
}