zendesk_apps_tools 1.31.1 → 1.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -13
- data/app_template_iframe/assets/iframe.html +6 -9
- data/features/new.feature +2 -2
- data/lib/zendesk_apps_tools/command.rb +1 -1
- data/lib/zendesk_apps_tools/server.rb +14 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 905f51cc9ffcf70b1a6df1de22eb0023786238a5
|
4
|
+
data.tar.gz: 3fee92c2981350c12f52bce5a3dd4eb938088529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc6043a99f828a98dc300e630fee32e81c3aff6429d1069cc1b389f18fba83f099e06d844f03216e579e7401ad9bc1c6431aa843479ac9a33e8e849f232e6ec9
|
7
|
+
data.tar.gz: fed72c3e4d2eb82de52930b11523c6bbf50e87d305922cb874e4ec7259f5823046666ce7a0740db6841644f80a1fd774e6bc8a3f7c43eee87762f941c54b7d72
|
data/README.md
CHANGED
@@ -1,26 +1,30 @@
|
|
1
1
|
# Zendesk Apps Tools
|
2
2
|
|
3
|
-
|
3
|
+
## Description
|
4
|
+
Zendesk Apps Tools (ZAT) is the only tool needed for developing Zendesk Apps. It makes it easy to develop [Zendesk Apps](http://developer.zendesk.com/documentation/apps/). We have a [guide](http://developer.zendesk.com/documentation/apps/reference/tools.html) that explains how to use this tool.
|
4
5
|
|
5
|
-
|
6
|
+
## Owners
|
7
|
+
This repo is owned and maintained by the Zendesk Apps team. You can reach us on vegemite@zendesk.com. We are located in Melbourne!
|
6
8
|
|
7
|
-
|
9
|
+
## Getting Started To **Use** ZAT
|
10
|
+
If you want to **use** this tool, all you need to do is `gem install zendesk_apps_tools` and periodically run `gem update zendesk_apps_tools` because we will keep updating this tool.
|
8
11
|
|
9
|
-
|
12
|
+
## Getting Started To **Develop** ZAT
|
13
|
+
When you want to help **develop** this tool, you will need to clone this repo and run `bundle install` to get it going.
|
10
14
|
|
11
|
-
|
15
|
+
ZAT uses a gem called [ZAS](https://github.com/zendesk/zendesk_apps_support/). In the case you are developing ZAT, it is likely you want to edit code in ZAS too, which means you will need to clone the ZAS repo and change the `Gemfile` (in the ZAT project) to say `gem 'zendesk_apps_support', path: '../zendesk_apps_support'`. The path should point to your local ZAS directory. This way your clone of ZAT will use a local version of ZAS which is very helpful for development. Run a `bundle install` after changing the Gemfile.
|
12
16
|
|
13
|
-
|
17
|
+
## Testing
|
18
|
+
This project uses rspec, which can be run with `bundle exec rake`.
|
14
19
|
|
15
|
-
|
20
|
+
## Contribute
|
21
|
+
Improvements are always welcome. To contribute, please:
|
16
22
|
|
17
|
-
|
23
|
+
* Put up a PR into the master branch.
|
24
|
+
* CC and get two +1 from @zendesk/vegemite.
|
18
25
|
|
19
|
-
|
20
|
-
|
21
|
-
# Issues
|
22
|
-
|
23
|
-
Please <a href="https://support.zendesk.com/requests/new">submit bug reports to Zendesk</a>.
|
26
|
+
## Bugs
|
27
|
+
Bugs can be reported as an issue here on github, or submitted to support@zendesk.com. By mentioning this project it will assigned to the right team.
|
24
28
|
|
25
29
|
# Copyright and license
|
26
30
|
Copyright 2013 Zendesk
|
@@ -1,16 +1,13 @@
|
|
1
1
|
<html>
|
2
2
|
<body>
|
3
|
+
<h2>Zendesk Apps Tools Iframe Scaffold</h2>
|
3
4
|
<!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
|
4
|
-
<script type="text/javascript" src="http://assets.zendesk.com/apps/sdk/
|
5
|
+
<script type="text/javascript" src="http://assets.zendesk.com/apps/sdk/2.0.0-beta1/zaf_sdk.js"></script>
|
5
6
|
<script>
|
6
|
-
|
7
|
-
|
8
|
-
var
|
9
|
-
|
10
|
-
console.log('Hi ' + currentUser.name);
|
11
|
-
});
|
12
|
-
app.postMessage('helloApp', { works: true });
|
7
|
+
// Initialise the Zendesk JavaScript API client
|
8
|
+
// https://developer.zendesk.com/apps/docs/agent/zaf_v2
|
9
|
+
var client = ZAFClient.init();
|
10
|
+
client.invoke('resize', { width: '100%', height: '400px' });
|
13
11
|
</script>
|
14
|
-
<p>It works!</p>
|
15
12
|
</body>
|
16
13
|
</html>
|
data/features/new.feature
CHANGED
@@ -86,10 +86,10 @@ Feature: create a template for a new zendesk app
|
|
86
86
|
}
|
87
87
|
"""
|
88
88
|
|
89
|
-
Scenario: create a template for a new iframe only app by running 'zat new --
|
89
|
+
Scenario: create a template for a new iframe only app by running 'zat new --v2' command
|
90
90
|
Given an app directory "tmp/aruba" exists
|
91
91
|
And I move to the app directory
|
92
|
-
When I run "zat new --
|
92
|
+
When I run "zat new --v2" command with the following details:
|
93
93
|
| author name | John Citizen |
|
94
94
|
| author email | john@example.com |
|
95
95
|
| author url | http://myapp.com |
|
@@ -32,7 +32,7 @@ module ZendeskAppsTools
|
|
32
32
|
method_option :'iframe-only', type: :boolean,
|
33
33
|
default: false,
|
34
34
|
desc: 'Create an iFrame Only app template',
|
35
|
-
aliases: '-i'
|
35
|
+
aliases: ['-i', '--v2']
|
36
36
|
def new
|
37
37
|
enter = ->(variable) { "Enter this app author's #{variable}:\n" }
|
38
38
|
invalid = ->(variable) { "Invalid #{variable}, try again:" }
|
@@ -4,7 +4,6 @@ require 'zendesk_apps_support/package'
|
|
4
4
|
module ZendeskAppsTools
|
5
5
|
class Server < Sinatra::Base
|
6
6
|
set :protection, :except => :frame_options
|
7
|
-
set :public_folder, proc { "#{settings.root}/assets" }
|
8
7
|
last_mtime = Time.new(0)
|
9
8
|
ZENDESK_DOMAINS_REGEX = /^http(?:s)?:\/\/[a-z0-9-]+\.(?:zendesk|zopim|zd-(?:dev|master|staging))\.com$/
|
10
9
|
|
@@ -44,6 +43,20 @@ module ZendeskAppsTools
|
|
44
43
|
ZendeskAppsSupport::Installed.new([app_js], [installation]).compile_js
|
45
44
|
end
|
46
45
|
|
46
|
+
get "/:file" do |file|
|
47
|
+
access_control_allow_origin
|
48
|
+
send_file File.join(settings.root, 'assets', file)
|
49
|
+
end
|
50
|
+
|
51
|
+
# This is for any preflight request
|
52
|
+
# It reads 'Access-Control-Request-Headers' to set 'Access-Control-Allow-Headers'
|
53
|
+
# And also sets 'Access-Control-Allow-Origin' header
|
54
|
+
options "*" do
|
55
|
+
access_control_allow_origin
|
56
|
+
headers 'Access-Control-Allow-Headers' => request.env['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'] if request.env['HTTP_ORIGIN'] =~ ZENDESK_DOMAINS_REGEX
|
57
|
+
end
|
58
|
+
|
59
|
+
# This sets the 'Access-Control-Allow-Origin' header for requests coming from zendesk
|
47
60
|
def access_control_allow_origin
|
48
61
|
origin = request.env['HTTP_ORIGIN']
|
49
62
|
headers 'Access-Control-Allow-Origin' => origin if origin =~ ZENDESK_DOMAINS_REGEX
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_apps_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Rosen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-05-
|
14
|
+
date: 2016-05-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
version: 1.3.6
|
227
227
|
requirements: []
|
228
228
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.
|
229
|
+
rubygems_version: 2.4.5.1
|
230
230
|
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: Tools to help you develop Zendesk Apps.
|
@@ -238,3 +238,4 @@ test_files:
|
|
238
238
|
- features/step_definitions/app_steps.rb
|
239
239
|
- features/support/env.rb
|
240
240
|
- features/validate.feature
|
241
|
+
has_rdoc:
|