zendesk_apps_tools 1.28.3 → 1.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app_template/manifest.json.tt +1 -1
- data/app_template/translations/en.json +10 -48
- data/app_template_iframe/README.md +14 -0
- data/app_template_iframe/assets/banner.png +0 -0
- data/app_template_iframe/assets/iframe.html +16 -0
- data/app_template_iframe/assets/logo-promotion.png +0 -0
- data/app_template_iframe/assets/logo-small.png +0 -0
- data/app_template_iframe/assets/logo.png +0 -0
- data/app_template_iframe/manifest.json.tt +15 -0
- data/app_template_iframe/translations/en.json +16 -0
- data/features/new.feature +94 -102
- data/features/step_definitions/app_steps.rb +1 -1
- data/lib/zendesk_apps_tools/command.rb +30 -5
- metadata +14 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36ee652e6e086cb84215c7031d59b74720297106
|
4
|
+
data.tar.gz: 276c247e757b2515224c95c8e70feda75d75d625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5674be616d6d6ae41363e1cd9ceba758ab128f526d6cdf25ba954831c48131370d3ccae91b3ba9e1f3eb4b9ddbd5ed5b7460713d7df143dfa26990dea1aed1b4
|
7
|
+
data.tar.gz: b3d2e7cae634d1259360574b76d5f215780b972329ec9d578fd9e1baf0f6859699ec680ad0d3f1e852c12927c6bf109b81ea87e32e62c26a34421957ad9df5a9
|
@@ -1,54 +1,16 @@
|
|
1
1
|
{
|
2
2
|
"app": {
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"value": "Play the famous zen tunes in your help desk.",
|
6
|
-
"title": "app description"
|
7
|
-
},
|
8
|
-
"name": {
|
9
|
-
"value": "Buddha Machine",
|
10
|
-
"title": "app name"
|
11
|
-
}
|
3
|
+
"description": "Play the famous zen tunes in your help desk.",
|
4
|
+
"name": "Buddha Machine"
|
12
5
|
},
|
13
|
-
|
14
|
-
"loading": {
|
15
|
-
"value": "Welcome to this Sample App",
|
16
|
-
"title": "loading placeholder"
|
17
|
-
},
|
18
|
-
|
6
|
+
"loading": "Welcome to this Sample App",
|
19
7
|
"fetch": {
|
20
|
-
"done":
|
21
|
-
|
22
|
-
"title": "fetch success"
|
23
|
-
},
|
24
|
-
"fail": {
|
25
|
-
"value": "failed to fetch information from the server",
|
26
|
-
"title": "fetch failure"
|
27
|
-
}
|
28
|
-
},
|
29
|
-
|
30
|
-
"id": {
|
31
|
-
"value": "ID",
|
32
|
-
"title": "user id"
|
33
|
-
},
|
34
|
-
|
35
|
-
"email": {
|
36
|
-
"value": "Email",
|
37
|
-
"title": "user email"
|
38
|
-
},
|
39
|
-
|
40
|
-
"name": {
|
41
|
-
"value": "Name",
|
42
|
-
"title": "user name"
|
43
|
-
},
|
44
|
-
|
45
|
-
"role": {
|
46
|
-
"value": "Role",
|
47
|
-
"title": "user role"
|
8
|
+
"done": "Good",
|
9
|
+
"fail": "failed to fetch information from the server"
|
48
10
|
},
|
49
|
-
|
50
|
-
"
|
51
|
-
|
52
|
-
|
53
|
-
|
11
|
+
"id": "ID",
|
12
|
+
"email": "Email",
|
13
|
+
"name": "Name",
|
14
|
+
"role": "Role",
|
15
|
+
"groups": "Groups"
|
54
16
|
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# App name
|
2
|
+
|
3
|
+
[brief description of the app]
|
4
|
+
|
5
|
+
### The following information is displayed:
|
6
|
+
|
7
|
+
* info1
|
8
|
+
* info2
|
9
|
+
* info3
|
10
|
+
|
11
|
+
Please submit bug reports to [Insert Link](). Pull requests are welcome.
|
12
|
+
|
13
|
+
### Screenshot(s):
|
14
|
+
[put your screenshots down here.]
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
|
4
|
+
<script type="text/javascript" src="http://assets.zendesk.com/apps/sdk/latest/zaf_sdk.js"></script>
|
5
|
+
<script>
|
6
|
+
// Initialise the Zendesk JavaScript API client
|
7
|
+
// https://developer.zendesk.com/apps/docs/agent/iframes_in_apps
|
8
|
+
var app = window.ZAFClient.init(function(context) {
|
9
|
+
var currentUser = context.currentUser;
|
10
|
+
console.log('Hi ' + currentUser.name);
|
11
|
+
});
|
12
|
+
app.postMessage('helloApp', { works: true });
|
13
|
+
</script>
|
14
|
+
<p>It works!</p>
|
15
|
+
</body>
|
16
|
+
</html>
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "<%= @app_name %>",
|
3
|
+
"author": {
|
4
|
+
"name": "<%= @author_name %>",
|
5
|
+
"email": "<%= @author_email %>",
|
6
|
+
"url": "<%= @author_url %>"
|
7
|
+
},
|
8
|
+
"defaultLocale": "en",
|
9
|
+
"private": true,
|
10
|
+
"location": { "zendesk":
|
11
|
+
{ "ticket_sidebar": "<%= @iframe_location %>" }
|
12
|
+
},
|
13
|
+
"version": "1.0",
|
14
|
+
"frameworkVersion": "1.0"
|
15
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"app": {
|
3
|
+
"description": "Play the famous zen tunes in your help desk.",
|
4
|
+
"name": "Buddha Machine"
|
5
|
+
},
|
6
|
+
"loading": "Welcome to this Sample App",
|
7
|
+
"fetch": {
|
8
|
+
"done": "Good",
|
9
|
+
"fail": "failed to fetch information from the server"
|
10
|
+
},
|
11
|
+
"id": "ID",
|
12
|
+
"email": "Email",
|
13
|
+
"name": "Name",
|
14
|
+
"role": "Role",
|
15
|
+
"groups": "Groups"
|
16
|
+
}
|
data/features/new.feature
CHANGED
@@ -13,113 +13,105 @@ Feature: create a template for a new zendesk app
|
|
13
13
|
Then the app file "manifest.json" is created
|
14
14
|
And I reset the working directory
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
Then the app file "tmp/aruba/manifest.json" is created with:
|
26
|
-
"""
|
27
|
-
{
|
28
|
-
"name": "John Test App",
|
29
|
-
"author": {
|
30
|
-
"name": "John Citizen",
|
31
|
-
"email": "john@example.com",
|
32
|
-
"url": "http://myapp.com"
|
33
|
-
},
|
34
|
-
"defaultLocale": "en",
|
35
|
-
"private": true,
|
36
|
-
"location": "ticket_sidebar",
|
37
|
-
"version": "1.0",
|
38
|
-
"frameworkVersion": "1.0"
|
39
|
-
}
|
40
|
-
"""
|
41
|
-
And the app file "tmp/aruba/app.js" is created with:
|
42
|
-
"""
|
43
|
-
(function() {
|
44
|
-
|
45
|
-
return {
|
46
|
-
events: {
|
47
|
-
'app.activated':'doSomething'
|
48
|
-
},
|
16
|
+
Scenario: create a template for a new zendesk app by running 'zat new' command
|
17
|
+
Given an app directory "tmp/aruba" exists
|
18
|
+
When I run "zat new" command with the following details:
|
19
|
+
| author name | John Citizen |
|
20
|
+
| author email | john@example.com |
|
21
|
+
| author url | http://myapp.com |
|
22
|
+
| app name | John Test App |
|
23
|
+
| app dir | tmp/aruba |
|
49
24
|
|
50
|
-
|
51
|
-
|
52
|
-
|
25
|
+
Then the app file "tmp/aruba/manifest.json" is created with:
|
26
|
+
"""
|
27
|
+
{
|
28
|
+
"name": "John Test App",
|
29
|
+
"author": {
|
30
|
+
"name": "John Citizen",
|
31
|
+
"email": "john@example.com",
|
32
|
+
"url": "http://myapp.com"
|
33
|
+
},
|
34
|
+
"defaultLocale": "en",
|
35
|
+
"private": true,
|
36
|
+
"location":["ticket_sidebar"],
|
37
|
+
"version": "1.0",
|
38
|
+
"frameworkVersion": "1.0"
|
39
|
+
}
|
40
|
+
"""
|
41
|
+
And the app file "tmp/aruba/app.js" is created with:
|
42
|
+
"""
|
43
|
+
(function() {
|
53
44
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<header>
|
59
|
-
<span class="logo"></span>
|
60
|
-
<h3>{{setting "name"}}</h3>
|
61
|
-
</header>
|
62
|
-
<section data-main></section>
|
63
|
-
<footer>
|
64
|
-
<a href="mailto:{{author.email}}">
|
65
|
-
{{author.name}}
|
66
|
-
</a>
|
67
|
-
</footer>
|
68
|
-
"""
|
69
|
-
And the app file "tmp/aruba/translations/en.json" is created with:
|
70
|
-
"""
|
71
|
-
{
|
72
|
-
"app": {
|
73
|
-
"package": "app_name",
|
74
|
-
"description": {
|
75
|
-
"value": "Play the famous zen tunes in your help desk.",
|
76
|
-
"title": "app description"
|
77
|
-
},
|
78
|
-
"name": {
|
79
|
-
"value": "Buddha Machine",
|
80
|
-
"title": "app name"
|
81
|
-
}
|
82
|
-
},
|
45
|
+
return {
|
46
|
+
events: {
|
47
|
+
'app.activated':'doSomething'
|
48
|
+
},
|
83
49
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
},
|
50
|
+
doSomething: function() {
|
51
|
+
}
|
52
|
+
};
|
88
53
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
54
|
+
}());
|
55
|
+
"""
|
56
|
+
And the app file "tmp/aruba/templates/layout.hdbs" is created with:
|
57
|
+
"""
|
58
|
+
<header>
|
59
|
+
<span class="logo"></span>
|
60
|
+
<h3>{{setting "name"}}</h3>
|
61
|
+
</header>
|
62
|
+
<section data-main></section>
|
63
|
+
<footer>
|
64
|
+
<a href="mailto:{{author.email}}">
|
65
|
+
{{author.name}}
|
66
|
+
</a>
|
67
|
+
</footer>
|
68
|
+
"""
|
69
|
+
And the app file "tmp/aruba/translations/en.json" is created with:
|
70
|
+
"""
|
71
|
+
{
|
72
|
+
"app": {
|
73
|
+
"description": "Play the famous zen tunes in your help desk.",
|
74
|
+
"name": "Buddha Machine"
|
75
|
+
},
|
76
|
+
"loading": "Welcome to this Sample App",
|
77
|
+
"fetch": {
|
78
|
+
"done": "Good",
|
79
|
+
"fail": "failed to fetch information from the server"
|
80
|
+
},
|
81
|
+
"id": "ID",
|
82
|
+
"email": "Email",
|
83
|
+
"name": "Name",
|
84
|
+
"role": "Role",
|
85
|
+
"groups": "Groups"
|
86
|
+
}
|
87
|
+
"""
|
99
88
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
89
|
+
Scenario: create a template for a new iframe only app by running 'zat new --iframe-only' command
|
90
|
+
Given an app directory "tmp/aruba" exists
|
91
|
+
And I move to the app directory
|
92
|
+
When I run "zat new --iframe-only" command with the following details:
|
93
|
+
| author name | John Citizen |
|
94
|
+
| author email | john@example.com |
|
95
|
+
| author url | http://myapp.com |
|
96
|
+
| app name | John Test App |
|
97
|
+
| iframe uri | assets/index.html |
|
98
|
+
| app dir | tmp/aruba |
|
104
99
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
"value": "Groups",
|
122
|
-
"title": "user groups"
|
123
|
-
}
|
100
|
+
Then the app file "tmp/aruba/manifest.json" is created with:
|
101
|
+
"""
|
102
|
+
{
|
103
|
+
"name": "John Test App",
|
104
|
+
"author": {
|
105
|
+
"name": "John Citizen",
|
106
|
+
"email": "john@example.com",
|
107
|
+
"url": "http://myapp.com"
|
108
|
+
},
|
109
|
+
"defaultLocale": "en",
|
110
|
+
"private": true,
|
111
|
+
"location": { "zendesk":
|
112
|
+
{ "ticket_sidebar": "assets/index.html" }
|
113
|
+
},
|
114
|
+
"version": "1.0",
|
115
|
+
"frameworkVersion": "1.0"
|
124
116
|
}
|
125
117
|
"""
|
@@ -80,7 +80,7 @@ Given /^I remove file "(.*?)"$/ do |file|
|
|
80
80
|
end
|
81
81
|
|
82
82
|
Then /^the zip file in "(.*?)" folder should not exist$/ do |path|
|
83
|
-
Dir[path + '/app-*.zip'].size.
|
83
|
+
expect(Dir[path + '/app-*.zip'].size).to eq 0
|
84
84
|
end
|
85
85
|
|
86
86
|
Then /^it should pass the validation$/ do
|
@@ -29,15 +29,40 @@ module ZendeskAppsTools
|
|
29
29
|
subcommand 'bump', Bump
|
30
30
|
|
31
31
|
desc 'new', 'Generate a new app'
|
32
|
+
method_option :'iframe-only', type: :boolean,
|
33
|
+
default: false,
|
34
|
+
desc: 'Create an iFrame Only app template',
|
35
|
+
aliases: '-i'
|
32
36
|
def new
|
33
|
-
|
34
|
-
|
35
|
-
@
|
36
|
-
|
37
|
+
enter = ->(variable) { "Enter this app author's #{variable}:\n" }
|
38
|
+
invalid = ->(variable) { "Invalid #{variable}, try again:" }
|
39
|
+
@author_name = get_value_from_stdin(enter.call('name'),
|
40
|
+
error_msg: invalid.call('name'))
|
41
|
+
@author_email = get_value_from_stdin(enter.call('email'),
|
42
|
+
valid_regex: /^.+@.+\..+$/,
|
43
|
+
error_msg: invalid.call('email'))
|
44
|
+
@author_url = get_value_from_stdin(enter.call('url'),
|
45
|
+
valid_regex: %r{^https?://.+$},
|
46
|
+
error_msg: invalid.call('url'),
|
47
|
+
allow_empty: true)
|
48
|
+
@app_name = get_value_from_stdin("Enter a name for this new app:\n",
|
49
|
+
error_msg: invalid.call('app name'))
|
50
|
+
|
51
|
+
@iframe_location = if options[:'iframe-only']
|
52
|
+
iframe_uri_text = 'Enter your iFrame URI or leave it blank to use'\
|
53
|
+
" a default local template page:\n"
|
54
|
+
value = get_value_from_stdin(iframe_uri_text, allow_empty: true)
|
55
|
+
value == '' ? 'assets/iframe.html' : value
|
56
|
+
else
|
57
|
+
'_legacy'
|
58
|
+
end
|
37
59
|
|
38
60
|
prompt_new_app_dir
|
39
61
|
|
40
|
-
|
62
|
+
skeleton = options[:'iframe-only'] ? 'app_template_iframe' : 'app_template'
|
63
|
+
is_custom_iframe = options[:'iframe-only'] && @iframe_location != 'assets/iframe.html'
|
64
|
+
directory_options = is_custom_iframe ? { exclude_pattern: /iframe.html/ } : {}
|
65
|
+
directory(skeleton, @app_dir, directory_options)
|
41
66
|
end
|
42
67
|
|
43
68
|
desc 'validate', 'Validate your app'
|
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.29.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-
|
14
|
+
date: 2016-02-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|
@@ -75,14 +75,14 @@ dependencies:
|
|
75
75
|
requirements:
|
76
76
|
- - "~>"
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: 1.
|
78
|
+
version: '1.23'
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - "~>"
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.
|
85
|
+
version: '1.23'
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: cucumber
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,6 +173,14 @@ files:
|
|
173
173
|
- app_template/manifest.json.tt
|
174
174
|
- app_template/templates/layout.hdbs
|
175
175
|
- app_template/translations/en.json
|
176
|
+
- app_template_iframe/README.md
|
177
|
+
- app_template_iframe/assets/banner.png
|
178
|
+
- app_template_iframe/assets/iframe.html
|
179
|
+
- app_template_iframe/assets/logo-promotion.png
|
180
|
+
- app_template_iframe/assets/logo-small.png
|
181
|
+
- app_template_iframe/assets/logo.png
|
182
|
+
- app_template_iframe/manifest.json.tt
|
183
|
+
- app_template_iframe/translations/en.json
|
176
184
|
- bin/zat
|
177
185
|
- features/clean.feature
|
178
186
|
- features/fixtures/quote_character_translation.json
|
@@ -218,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
226
|
version: 1.3.6
|
219
227
|
requirements: []
|
220
228
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.4.5
|
229
|
+
rubygems_version: 2.4.5.1
|
222
230
|
signing_key:
|
223
231
|
specification_version: 4
|
224
232
|
summary: Tools to help you develop Zendesk Apps.
|
@@ -230,3 +238,4 @@ test_files:
|
|
230
238
|
- features/step_definitions/app_steps.rb
|
231
239
|
- features/support/env.rb
|
232
240
|
- features/validate.feature
|
241
|
+
has_rdoc:
|