Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ If applicable, add screenshots to help explain your problem.

### Additional Context

Add any other context about the problem here.
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/chore.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ What specific changes are needed?

### Additional Notes

Add any other relevant information here.
Add any other relevant information here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blank_issues_enabled: false
contact_links:
- name: Screenly Zapier Integration
url: https://developer.screenly.io/api_v4_1/
url: https://developer.screenly.io/api_v4_1/
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ A clear and concise description of any alternative solutions or features you've

### Additional Context

Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
8 changes: 4 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Please include a summary of the changes and which issue is fixed. Please also include relevant motivation and context.

* Fixes #(issue-1)
* Fixes #(issue-2)
* Fixes #(issue-n)
- Fixes #(issue-1)
- Fixes #(issue-2)
- Fixes #(issue-n)

### How Has This Been Tested?

Expand All @@ -22,4 +22,4 @@ Please describe the tests that you ran to verify your changes. Provide instructi

### Screenshots

If applicable, add screenshots to help explain your changes.
If applicable, add screenshots to help explain your changes.
1 change: 0 additions & 1 deletion .github/workflows/check-workflow-syntax.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Check GitHub Actions Workflow Syntax

on:
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
npm test
npx prettier --check .
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ Thank you for your interest in contributing to the Screenly Zapier Integration!
## Development Workflow

1. Create a new branch for your feature/fix:

```bash
git checkout -b feature/your-feature-name
```

1. Make your changes and ensure:

- All tests pass: `npm test`
- Code is properly linted: `npm run lint`
- Security audit passes: `npm audit`
Expand Down
4 changes: 2 additions & 2 deletions actions/cleanup-zapier-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const cleanupZapierContent = {

// Get all playlists associated with the Zapier tag
const playlistToLabelMappings = await utils.getPlaylistsByLabel(z, bundle, {
labelId: label.id
labelId: label.id,
});

const playListIds = playlistToLabelMappings.map(mapping => mapping.playlist_id);
const playListIds = playlistToLabelMappings.map((mapping) => mapping.playlist_id);
let successfulDeletions = 0;

// Delete each playlist
Expand Down
8 changes: 4 additions & 4 deletions actions/complete-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const completeWorkflow = {
const labelQueryResponse = await z.request({
url: `https://api.screenlyapp.com/api/v4/labels?name=eq.${ZAPIER_TAG}`,
headers: {
'Authorization': `Token ${bundle.authData.api_key}`,
'Prefer': 'return=representation',
Authorization: `Token ${bundle.authData.api_key}`,
Prefer: 'return=representation',
},
});

Expand All @@ -97,8 +97,8 @@ const completeWorkflow = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Token ${bundle.authData.api_key}`,
'Prefer': 'return=representation',
Authorization: `Token ${bundle.authData.api_key}`,
Prefer: 'return=representation',
},
body: {
name: ZAPIER_TAG,
Expand Down
2 changes: 1 addition & 1 deletion constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
ZAPIER_TAG: 'created_by_zapier',
READY_STATES: ['downloading', 'processing', 'finished'],
};
};
3 changes: 2 additions & 1 deletion docs/common-use-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- Disable rain-specific promotions

### Setup Steps:

1. Create weather-specific playlists in Screenly:
- "Summer Treats" - cold items
- "Winter Warmers" - hot items
Expand All @@ -63,4 +64,4 @@
- Increase sales with contextual promotions
- Show relevant products at the right time
- Create urgency with weather-specific offers
- No manual playlist management needed
- No manual playlist management needed
4 changes: 2 additions & 2 deletions docs/cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ This documentation is a collection of how-to guides for using the Screenly integ

## Quick Links

* [Uploading an Asset via Google Drive](uploading-an-asset-via-google-drive.md)
* [Uploading an Asset via Dropbox](uploading-an-asset-via-dropbox.md)
- [Uploading an Asset via Google Drive](uploading-an-asset-via-google-drive.md)
- [Uploading an Asset via Dropbox](uploading-an-asset-via-dropbox.md)
54 changes: 29 additions & 25 deletions docs/cookbook/uploading-an-asset-via-dropbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,45 @@ Click **New Zap** from the dropdown menu. You will be redirected to the Zap edit
Click the **Trigger** button. In the modal that appears, search for and select **Dropbox**.

During setup, you'll need to configure:
* **Trigger Event**: Select **New File in Folder**
* **Account**: Click **Sign In** and authenticate with your Dropbox account. When prompted, allow Zapier to access your Dropbox files.
* Click **Continue**

- **Trigger Event**: Select **New File in Folder**
- **Account**: Click **Sign In** and authenticate with your Dropbox account. When prompted, allow Zapier to access your Dropbox files.
- Click **Continue**

![Dropbox trigger setup](/docs/cookbook/images/zapier-dropbox-01-trigger-setup.png)

For configuration:
* Select the **Space** and **Folder** you want to monitor.
* Select **False** for **Include files in subfolders?**
* Keep **Include file contents?** set to **Yes**
* Keep **Include sharing link?** set to **Yes**
* Click **Continue**
* Click **Test Trigger** (or **Skip Test** to proceed without testing)

- Select the **Space** and **Folder** you want to monitor.
- Select **False** for **Include files in subfolders?**
- Keep **Include file contents?** set to **Yes**
- Keep **Include sharing link?** set to **Yes**
- Click **Continue**
- Click **Test Trigger** (or **Skip Test** to proceed without testing)

![Dropbox trigger configuration](/docs/cookbook/images/zapier-dropbox-02-trigger-configure.png)

## Step 3 — Select The Action Event

* Click the **Action** button
* Search for and select **Screenly (x.y.z)**
* For **Action Event**, select **Upload Asset**
- Click the **Action** button
- Search for and select **Screenly (x.y.z)**
- For **Action Event**, select **Upload Asset**

For **Account**:
* Click **Sign In**
* In the new window, enter your Screenly API key
* Click **Yes, Continue to Screenly (x.y.z)**
* Click **Continue**

- Click **Sign In**
- In the new window, enter your Screenly API key
- Click **Yes, Continue to Screenly (x.y.z)**
- Click **Continue**

![Screenly action setup](/docs/cookbook/images/zapier-dropbox-03-action-setup.png)

Configure the action:
* For **File URL**: Click **+** and select **Link**
* For **Title**: Click **+** and select **File Name**
* Click **Continue**
* Click **Test Step** (or **Skip Test** to proceed without testing)

- For **File URL**: Click **+** and select **Link**
- For **Title**: Click **+** and select **File Name**
- Click **Continue**
- Click **Test Step** (or **Skip Test** to proceed without testing)

![Screenly action configuration](/docs/cookbook/images/zapier-dropbox-04-action-configure.png)

Expand All @@ -55,11 +59,11 @@ using the toggle switch.

## Step 5 — Test Your Zap

* Upload a file to your selected Dropbox folder
* Wait a few minutes for processing
* Visit [screenly.io](https://www.screenly.io/) and sign in
* Click **Content** in the menu bar
* Verify that your new asset appears
- Upload a file to your selected Dropbox folder
- Wait a few minutes for processing
- Visit [screenly.io](https://www.screenly.io/) and sign in
- Click **Content** in the menu bar
- Verify that your new asset appears

You can monitor the Zap's execution in the [Zap history](https://zapier.com/app/history).

Expand Down
48 changes: 26 additions & 22 deletions docs/cookbook/uploading-an-asset-via-google-drive.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,43 @@ Click **New Zap** from the dropdown menu. You will be redirected to the Zap edit
Click the **Trigger** button. In the modal that appears, search for and select **Google Drive**.

During setup, you'll need to configure:
* **Trigger Event**: Select **New File in Folder**
* **Account**: Click **Sign In** and authenticate with your preferred Google account.

- **Trigger Event**: Select **New File in Folder**
- **Account**: Click **Sign In** and authenticate with your preferred Google account.
When prompted, allow Zapier to access your Google Drive.
* Click **Continue**
- Click **Continue**

![Google Drive trigger setup](/docs/cookbook/images/zapier-google-drive-01-trigger-setup.png)

For configuration:
* Select the **Drive** and **Folder** you want to monitor
* Click **Continue**
* Click **Test Trigger** (or **Skip Test** to proceed without testing)

- Select the **Drive** and **Folder** you want to monitor
- Click **Continue**
- Click **Test Trigger** (or **Skip Test** to proceed without testing)

![Google Drive trigger configuration](/docs/cookbook/images/zapier-google-drive-02-trigger-configure.png)

## Step 3 — Select The Action Event

* Click the **Action** button
* Search for and select **Screenly (x.y.z)**
* For **Action Event**, select **Upload Asset**
- Click the **Action** button
- Search for and select **Screenly (x.y.z)**
- For **Action Event**, select **Upload Asset**

For **Account**:
* Click **Sign In**
* In the new window, enter your Screenly API key
* Click **Yes, Continue to Screenly (x.y.z)**
* Click **Continue**

- Click **Sign In**
- In the new window, enter your Screenly API key
- Click **Yes, Continue to Screenly (x.y.z)**
- Click **Continue**

![Screenly action setup](/docs/cookbook/images/zapier-google-drive-03-action-setup.png)

Configure the action:
* For **File URL**: Click **+** and select **File**
* For **Title**: Click **+** and select **Title**
* Click **Continue**
* Click **Test Step** (or **Skip Test** to proceed without testing)

- For **File URL**: Click **+** and select **File**
- For **Title**: Click **+** and select **Title**
- Click **Continue**
- Click **Test Step** (or **Skip Test** to proceed without testing)

![Screenly action configuration](/docs/cookbook/images/zapier-google-drive-04-action-configure.png)

Expand All @@ -53,11 +57,11 @@ using the toggle switch.

## Step 5 — Test Your Zap

* Upload a file to your selected Google Drive folder
* Wait a few minutes for processing
* Visit [screenly.io](https://www.screenly.io/) and sign in
* Click **Content** in the menu bar
* Verify that your new asset appears
- Upload a file to your selected Google Drive folder
- Wait a few minutes for processing
- Visit [screenly.io](https://www.screenly.io/) and sign in
- Click **Content** in the menu bar
- Verify that your new asset appears

You can monitor the Zap's execution in the [Zap history](https://zapier.com/app/history).

Expand Down
2 changes: 1 addition & 1 deletion docs/example-integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
2. **Content Rotation**
- Trigger: Schedule or SharePoint/Dropbox/Box update
- Action: Complete Workflow with end dates
- Use Case: Automatically rotate content based on schedules
- Use Case: Automatically rotate content based on schedules
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const authentication = {
type: 'string',
required: true,
label: 'API Key',
helpText: 'See [this page](https://support.screenly.io/hc/en-us/articles/35897560148371-How-to-Generate-a-Screenly-API-Token) for a guide on how to generate an API key for your Screenly account.',
helpText:
'See [this page](https://support.screenly.io/hc/en-us/articles/35897560148371-How-to-Generate-a-Screenly-API-Token) for a guide on how to generate an API key for your Screenly account.',
},
],
};
Expand Down
2 changes: 1 addition & 1 deletion test/authentication.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ describe('Authentication', () => {

await expect(appTester(App.authentication.test, bundle)).rejects.toThrow();
});
});
});
14 changes: 8 additions & 6 deletions test/cleanup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ describe('Cleanup', () => {
nock('https://api.screenlyapp.com')
.get('/api/v4/labels/?name=eq.created_by_zapier')
.matchHeader('Authorization', `Token ${TEST_API_KEY}`)
.reply(200, [{
id: 'label-123',
name: 'created_by_zapier'
}]);
.reply(200, [
{
id: 'label-123',
name: 'created_by_zapier',
},
]);

// Mock playlist to label mappings
nock('https://api.screenlyapp.com')
.get('/api/v4/labels/playlists?label_id=eq.label-123')
.matchHeader('Authorization', `Token ${TEST_API_KEY}`)
.reply(200, [
{ playlist_id: 'playlist-1', label_id: 'label-123' },
{ playlist_id: 'playlist-2', label_id: 'label-123' }
{ playlist_id: 'playlist-2', label_id: 'label-123' },
]);

// Mock playlist deletions
Expand Down Expand Up @@ -87,4 +89,4 @@ describe('Cleanup', () => {
appTester(App.creates.cleanup_zapier_content.operation.perform, bundle)
).rejects.toThrow('No labels returned from the Screenly API');
});
});
});
Loading
Loading