impossiblefxv1 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/HOWTO-PUBLISH.txt +15 -0
  2. package/README.md +21 -0
  3. package/apis/edit-2016-06-02.json +15 -0
  4. package/apis/metadata.json +31 -0
  5. package/apis/project-2016-06-01.json +56 -0
  6. package/apis/project-2016-06-02.json +767 -0
  7. package/apis/project-2023-03-07.json +767 -0
  8. package/apis/project-2023-12-11.json +767 -0
  9. package/apis/render-2016-06-02.json +764 -0
  10. package/apis/render-2023-12-11.json +764 -0
  11. package/dist/fx-sdk-latest.js +22494 -0
  12. package/dist-tools/build-browser.js +109 -0
  13. package/dist-tools/build-sdk.sh +6 -0
  14. package/dist-tools/es6-promise.js +957 -0
  15. package/dist-tools/foo.sh +4 -0
  16. package/dist-tools/publish.sh +6 -0
  17. package/lib/browser.js +58 -0
  18. package/lib/config.js +125 -0
  19. package/lib/core.js +15 -0
  20. package/lib/credentials/chain.js +54 -0
  21. package/lib/credentials/environment.js +69 -0
  22. package/lib/credentials/inifile.js +57 -0
  23. package/lib/credentials/token.js +38 -0
  24. package/lib/credentials.js +53 -0
  25. package/lib/encoding.js +36 -0
  26. package/lib/endpoint.js +18 -0
  27. package/lib/fx.js +50 -0
  28. package/lib/http/node.js +69 -0
  29. package/lib/http/xhr.js +12 -0
  30. package/lib/http.js +57 -0
  31. package/lib/proto.js +38 -0
  32. package/lib/protocol.js +56 -0
  33. package/lib/request.js +252 -0
  34. package/lib/response.js +24 -0
  35. package/lib/service.js +182 -0
  36. package/lib/services/batch.js +5 -0
  37. package/lib/services/edit.js +9 -0
  38. package/lib/services/project.js +102 -0
  39. package/lib/services/render.js +63 -0
  40. package/lib/services/story.js +5 -0
  41. package/lib/services.js +30 -0
  42. package/lib/util.js +126 -0
  43. package/package.json +37 -0
  44. package/package.json.save +36 -0
  45. package/proto/Movie.proto +4081 -0
  46. package/proto/fx.proto +43 -0
  47. package/templates/config.html +91 -0
  48. package/templates/examples.html +69 -0
  49. package/templates/getstarted.html +30 -0
  50. package/templates/index.html +6 -0
  51. package/templates/makeexample.py +57 -0
  52. package/templates/makerequests.html +210 -0
  53. package/templates/operation.html +36 -0
  54. package/templates/service.html +9 -0
  55. package/templates/services.html +19 -0
  56. package/templates/version.html +12 -0
  57. package/templates/versions.html +10 -0
  58. package/templates/workservice.html +68 -0
  59. package/test/circles.mp4 +0 -0
  60. package/test/config.js +131 -0
  61. package/test/index.html +35 -0
  62. package/test/mocha.opts +4 -0
  63. package/test/project.js +148 -0
  64. package/test/render.js +136 -0
  65. package/test/retry.js +53 -0
  66. package/test/sdktests.js +62 -0
  67. package/test/sdl.js +125 -0
  68. package/test/servertest/simple.js +20 -0
package/proto/fx.proto ADDED
@@ -0,0 +1,43 @@
1
+
2
+ import "Movie.proto";
3
+
4
+ package fx;
5
+
6
+ extend JetSDL.Proto.Movie {
7
+ optional string prerender = 1000;
8
+ optional string postrender = 1001;
9
+ }
10
+
11
+ extend JetSDL.Proto.Scene {
12
+ optional string mode = 1000;
13
+ optional int32 frames = 1001;
14
+ optional string id = 1002;
15
+ }
16
+
17
+ extend JetSDL.Proto.VisualTrack {
18
+ optional string color = 1000;
19
+ }
20
+
21
+ extend JetSDL.Proto.ImageProvider {
22
+ optional string type = 1000;
23
+ optional string ref = 1001;
24
+ }
25
+
26
+ extend JetSDL.Proto.StringVariable {
27
+ optional string name = 1000;
28
+ }
29
+
30
+ message MotionTracker {
31
+
32
+ }
33
+
34
+ message Composition{
35
+ required JetSDL.Proto.Movie movie=1;
36
+ repeated KVPair meta = 2;
37
+ }
38
+
39
+
40
+ message KVPair{
41
+ optional string key = 1;
42
+ optional string value = 2;
43
+ }
@@ -0,0 +1,91 @@
1
+ {% extends "templates/docs.html" %}
2
+
3
+ {% block doc_content %}
4
+ <h1>Configuring the SDK</h1>
5
+
6
+ <h2>The Configuration Object</h2>
7
+ <p>
8
+ Configuration in the SDK can be done in two ways:
9
+ <ol>
10
+ <li>Global configuration on FX.config, or,</li>
11
+ <li>Passing extra configuration to a service object</li>
12
+ </ol>
13
+
14
+ Setting global configuration with FX.config is often easier to get up and running with, but service level configuration can provide much more control over your requests. Both of these configuration mechanisms are discussed.
15
+
16
+ </p>
17
+
18
+ <h2>Global Configuration</h2>
19
+ <p>
20
+ By default, you can set global configuration by updating the FX.config object with new settings. The most common settings are:
21
+ <ul class="topics">
22
+ <li>apikey, secretkey — for credential management (Only services that require authentication).</li>
23
+ <li>region — to set the region for requests</li>
24
+ <li>sslEnabled — whether SSL is enabled or not</li>
25
+ <li>maxRetries — to control the number of retries for a request</li>
26
+ <li>logger — a logger object to write debug information to. Set to process.stdout to get logging information about service requests.</li>
27
+ </ul>
28
+ </p>
29
+
30
+ <p>More configuration settings can be found in the reference documentation.</p>
31
+
32
+ <p>The only things you need to set in order to use the SDK are credentials and the region value. Let's discuss how to do that.</p>
33
+
34
+ <h2>Setting Credentials</h2>
35
+ <pre class="prettyprint" style="padding:1em !important">
36
+ FX.config.update({apikey: 'apikey', apisecret: 'apisecret'})
37
+ </pre>
38
+
39
+ <h2>Setting the region</h2>
40
+ <pre class="prettyprint" style="padding:1em !important">
41
+ FX.config.update({region: 'us-west-2'})
42
+ </pre>
43
+
44
+ <h2>Locking API Versions</h2>
45
+ <p class="note">For more information on API version locking in the SDK, see the <a href="workservice.html">Working With Services</a> section.</p>
46
+
47
+ <p>
48
+ You can globally configure a set of API versions to use for each service by specifying the <code>apiVersions</code> parameter in FX.config. For example, you can choose to set specific versions of the Project and Render services, while selecting the "latest" version of the Batch Service:
49
+ </p>
50
+ <pre class="prettyprint" style="padding:1em !important">
51
+ FX.config.apiVersions = {
52
+ project: '2016-06-02',
53
+ render: '2016-06-02',
54
+ batch: 'latest'
55
+ }
56
+ </pre>
57
+
58
+ <p>
59
+ Note that by default, the SDK will use the "latest" available API version when constructing a service, i.e. if you don't specify a version.
60
+ </p>
61
+
62
+ <p>You can also lock all services at a specific point in time by using a "fuzzy version":</p>
63
+
64
+ <pre class="prettyprint" style="padding:1em !important">
65
+ // Try to use latest available APIs before this date
66
+ FX.config.apiVersion = '2016-10-12';
67
+ </pre>
68
+
69
+ <h2>Service-Specific Configuration</h2>
70
+
71
+ <p>
72
+ Occasionally, you might want to apply configuration only to one service. For instance, you want to use multiple Project objects in different regions. You can do this by passing configuration data directly to the service object constructor:
73
+ </p>
74
+
75
+ <pre class="prettyprint" style="padding:1em !important">
76
+ var sydneyProjects = new FX.Project({region: 'ap-southeast-2', maxRetries: 15});
77
+ </pre>
78
+
79
+ <p>
80
+ Note that the constructor takes all of the same configuration data as the FX.config object described above, including credential information.
81
+ </p>
82
+
83
+ <h2>Immutable Configuration Data</h2>
84
+
85
+ <p>Global configuration changes apply to all requests for all newly created services. Any newly created service will merge its local options on top of the global configuration data at the time of creation. This means that any future updates to the global FX.config object will not apply to existing service objects. These services would have to be manually updated with the new configuration data, or recreated using the following command (assuming an existing prj service object):</p>
86
+
87
+ <pre class="prettyprint" style="padding:1em !important">
88
+ prj = new FX.Project(prj.config);
89
+ </pre>
90
+
91
+ {% endblock %}
@@ -0,0 +1,69 @@
1
+ {% extends "templates/docs.html" %}
2
+
3
+ {% block doc_content %}
4
+
5
+ <style>
6
+ code {font-size: 18px; font-weight: bold}
7
+ .red {color: red}
8
+ </style>
9
+
10
+ <h1>Common Examples</h1>
11
+ <p>
12
+ All of these examples assume that the FX SDK is required, credentials are loaded, and the region is set. Some of the examples also assume that you run a HTTP server framework like <a href="http://expressjs.com/">Express</a>, <a href="http://hapijs.com/">Hapi</a> or <a href="https://www.npmjs.com/package/httpdispatcher" >httpdispatcher</a> to handle requests.
13
+ </p>
14
+
15
+ <p>The common preamble code can be summarized as follows:</p>
16
+
17
+ <pre class="prettyprint lang-javascript">
18
+ FX = require('impossiblefx-sdk');
19
+ FX.config.apikey = 'APIKEYXXXX';
20
+ FX.config.apisecret = 'ApiSecretXxXxXxX';
21
+ FX.config.region = 'eu-west-1';
22
+
23
+ express = require('express');
24
+ app = express();
25
+ </pre>
26
+
27
+ <h2>Basic Usage</h2>
28
+ <p>The following examples how to request a poster frame from a dynamic movie:</p>
29
+ <pre class="prettyprint lang-javascript">
30
+ var render = new FX.Render({params: {ProjectId: '<span class="red">PROJECT_ID</span>', Movie: '<span class="red">MOVIE_NAME</span>'}});
31
+ var frame_number = 100;
32
+
33
+ render.getPosterFrameURL({
34
+ Params: {name: req.query['name']}
35
+ Frame: <span class="red">frame_number</span>
36
+ }, function(err, data){
37
+ console.log("Poster frame URL is:", data.URL)
38
+ })
39
+ </pre>
40
+
41
+ <h2>Usage in a Node.js Express Server</h2>
42
+
43
+ <p>The following example shows how to handle a client request, create a FX render request and to return the generated video URL in a server:</p>
44
+ <pre class="prettyprint lang-javascript">
45
+ var render = new FX.Render({params: {ProjectId: '<span class="red">PROJECT_ID</span>', Movie: '<span class="red">MOVIE_NAME</span>'}});
46
+
47
+ app.get('/video', function(req, res) {
48
+ render.getRenderURL({
49
+ Params: {name: req.query['name']}
50
+ }, function(err, data){
51
+ res.send(data.URL)
52
+ })
53
+ });
54
+ </pre>
55
+
56
+
57
+ <h2>Create a Project and Movie programmatically</h2>
58
+ <p></p>
59
+ <pre class="prettyprint lang-javascript">
60
+ var prj = new FX.Project()
61
+ prj.createProject({Name: "PROJECT_NAME"}, function(err, data){
62
+
63
+ })
64
+ </pre>
65
+
66
+
67
+
68
+
69
+ {% endblock %}
@@ -0,0 +1,30 @@
1
+ {% extends "templates/docs.html" %}
2
+
3
+ {% block doc_content %}
4
+ <h1>Getting Started</h1>
5
+
6
+ <h2>Installation with npm</h2>
7
+ <p>
8
+ The easiest way to install the FX SDK for Javascript in node.js is to use the <a href="http://npmjs.org">npm Package Manager</a>.
9
+ </p>
10
+
11
+ <pre class="prettyprint" style="padding:1em !important">
12
+ npm install impossiblefx
13
+ </pre>
14
+
15
+
16
+ <h2>Loading the SDK</h2>
17
+ After you've installed the SDK, you can require the FX package in your node application using require():
18
+ <pre class="prettyprint" style="padding:1em !important">
19
+ var FX = require('impossiblefx')
20
+ </pre>
21
+
22
+ <h2>Next Steps</h2>
23
+ <p>
24
+ Now that you have installed and loaded the SDK, continue on to learn how to configure and use the SDK to make requests to API operations on services.
25
+ </p>
26
+ <ul class="topics">
27
+ <li><a href="config.html">Configuring the SDK</a></li>
28
+ <li><a href="makerequests.html">Making Requests</a></li>
29
+ <li><a href="workservice.html">Working with Services</a></li>
30
+ {% endblock %}
@@ -0,0 +1,6 @@
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="refresh" content="0; url=getstarted.html">
4
+ </head>
5
+ <h1 style="display:none">Javascript SDK</h1>
6
+ </html>
@@ -0,0 +1,57 @@
1
+ from cStringIO import StringIO
2
+
3
+ TypePlaceholder = {
4
+ 'string': "'STRING_VALUE'",
5
+ 'number': "number",
6
+ 'boolean': "true || false",
7
+ 'blob': "Buffer || Stream || Binary",
8
+ 'map': "{{key: value, ...}}",
9
+ 'Movie': "MOVIE_OBJECT",
10
+ 'List<String>': "['Tag1', 'Tag2']"
11
+ }
12
+
13
+
14
+ def makeexample(domain, svcname, opname, operation):
15
+ input = operation.get('input', {})
16
+ params = input.get('members', {})
17
+
18
+ try:
19
+ pnames = sorted(params.keys(), reverse=True, key=lambda n: params[n].get('required'))
20
+
21
+ io = StringIO()
22
+ if len(pnames):
23
+ io.write("var parameters = {{\n")
24
+ lastName = pnames[-1]
25
+ for pname in pnames:
26
+ param = params[pname]
27
+ if param.get('hidden'):
28
+ continue
29
+ required = ""
30
+ if param.get('required'):
31
+ required = " // required"
32
+ localName = pname # pname[0].lower() + pname[1:]
33
+ io.write(" {}: {}".format(localName, TypePlaceholder[param['type']]))
34
+ if pname != lastName:
35
+ io.write(',')
36
+ if required:
37
+ io.write(required)
38
+ io.write("\n")
39
+
40
+ io.write("}}\n")
41
+
42
+ if len(pnames):
43
+ io.write("{serviceName}.{opname}(parameters, function(err, data) {{")
44
+ else:
45
+ io.write("{serviceName}.{opname}(function(err, data) {{")
46
+
47
+ io.write("""
48
+ if(err) {{
49
+ console.log(err); // an error occurred
50
+ }} else {{
51
+ console.log(data); // successful response
52
+ }}
53
+ }});
54
+ """)
55
+ return io.getvalue().format(serviceName=svcname, opname=opname)
56
+ finally:
57
+ io.close()
@@ -0,0 +1,210 @@
1
+ {% extends "templates/docs.html" %}
2
+
3
+ {% block doc_content %}
4
+ <h1>Making Requests</h1>
5
+ <p>
6
+ A "request" to an FX service includes the full request and response lifecycle of a call to an operation on a service object, including any retries that are transparently attempted on your behalf. A request is encapsulated in the SDK by the FX.Request object. The semantics of a request are described below, specifically, the support for callbacks, events, and streaming of raw HTTP response data.
7
+ </p>
8
+
9
+
10
+ <h2>Asynchronous Callbacks</h2>
11
+ <p>
12
+ All requests made through the SDK are asynchronous and use a callback interface. Each service method that kicks off a request can accept a callback as the last parameter with the signature <code>function(error, data) { ... }</code>. This callback will be called when the response or error data is available.
13
+ </p>
14
+
15
+ <p>For example, the following service method can be called with a standard callback to retrieve the response data or error:</p>
16
+
17
+ <pre class="prettyprint" style="padding:1em !important">
18
+ new FX.Project().listProjects(function(error, data) {
19
+ if (error) {
20
+ console.log(error); // an error occurred
21
+ } else {
22
+ console.log(data); // request succeeded
23
+ }
24
+ });
25
+ </pre>
26
+
27
+ <p>The error and data parameters are described in the "Response Object" section below.</p>
28
+
29
+ <p>Note that if you do not specify a callback, the operation will return an FX.Request object that must be manually sent using the send() method:</p>
30
+
31
+ <pre class="prettyprint" style="padding:1em !important">
32
+ // create the FX.Request object
33
+ var request = new FX.Project().listProjects();
34
+
35
+ // register a callback to report on the data
36
+ request.on('success', function(resp) {
37
+ console.log(resp.data); // log the successful data response
38
+ });
39
+
40
+ // send the request
41
+ request.send();
42
+ </pre>
43
+
44
+
45
+ <h2>The Response Object (FX.Response)</h2>
46
+ <p>The response object is passed into each callback function so that you can access response data. The FX.Response object that is passed in contains two important properties to get at this data.</p>
47
+
48
+ <p>When using the standard callback mechanism, the two properties will be made available as parameters on the callback method in the form: <code>function(error, data) { ... }</code></p>
49
+
50
+ <h3>The <code>data</code> property</h3>
51
+
52
+ The <code>response.data</code> property contains the serialized object data retrieved from the service request. For instance, for an FX.Project <code>listProjects</code> method call, the response data might look like this:
53
+
54
+ <pre class="prettyprint" style="padding:1em !important">
55
+ > response.data
56
+ {
57
+ Projects: [
58
+ {
59
+ ProjectId: ...
60
+ Name: ...
61
+ },
62
+
63
+ {
64
+ ProjectId: ...
65
+ Name: ...
66
+ }
67
+ ]
68
+ }
69
+ </pre>
70
+
71
+ <p>
72
+ The data property can be null if an error occurs (see below).
73
+ </p>
74
+
75
+ <h3>The <code>error</code> property</h3>
76
+
77
+
78
+ <p>In the event of a service error (or transfer error), the response.error property will be filled with the given error data in the form:</p>
79
+
80
+ <pre class="prettyprint" style="padding:1em !important">
81
+ { code: 'SHORT_UNIQUE_ERROR_CODE',
82
+ message: 'Some human readable error message' }
83
+ </pre>
84
+
85
+ <p>In the case of an error, the data property will be null. Note that if you handle events that can be in a failure state, you should always check whether response.error is set before attempting to access the response.data property.</p>
86
+
87
+
88
+ <h3>The <code>request</code> property</h3>
89
+
90
+ <p>Access to the originating request object is available through this property. For example, to access the parameters that were sent with a request:</p>
91
+
92
+ <pre class="prettyprint" style="padding:1em !important">
93
+ prj.getAsset({Name: 'aName'}).on('success', function(response) {
94
+ console.log("Name was", response.request.params.Name);
95
+ }).send();
96
+ </pre>
97
+
98
+
99
+ <h2>Simplified Callback Method</h2>
100
+
101
+ <p>Each operation supports a simplified callback that can be passed as the last parameter to any service operation. The callback function should accept an error parameter, followed by the data from the response.</p>
102
+
103
+ <p>For example:</p>
104
+ <pre class="prettyprint" style="padding:1em !important">
105
+ prj.listProjects(function(error, data) {
106
+ if (error) {
107
+ console.log(error); // error is Response.error
108
+ } else {
109
+ console.log(data); // data is Response.data
110
+ }
111
+ });
112
+ </pre>
113
+
114
+ <p>
115
+ The error and data parameters accepted are equivalent to the error and data properties discussed in the FX.Response response object section above.
116
+ </p>
117
+ <p>
118
+ If you are passing parameters to the operation, the callback should be placed after the parameters:
119
+ </p>
120
+ <pre class="prettyprint" style="padding:1em !important">
121
+ prj.getAsset({ProjectId: '123456789-abcd-4321-98876fecb',
122
+ Name: "video.mp4"}, function(error, data) {
123
+ // ...
124
+ });
125
+ </pre>
126
+
127
+ <h2>FX.Request Events</h2>
128
+ <p>You can alternatively register callbacks on events provided by the FX.Request object returned by each service operation method. This request object exposes the success and error events, each taking a callback that accepts the response object.</p>
129
+
130
+ <p>Note that if you omit the simplified callback parameter on the operation method, you must call send() on the returned request object in order to kick off the request to the remote server.</p>
131
+
132
+ <h3>Event: 'success'</h3>
133
+ <p>This event triggers when a successful response from the server is returned. The response contains a .data field with the serialized response data from the service.</p>
134
+ <pre class="prettyprint" style="padding:1em !important">
135
+ var req = prj.listProjects()
136
+ req.on('success', function(response){
137
+ console.log(response.data);
138
+ })
139
+ req.send();
140
+ </pre>
141
+
142
+ <h3>Event: 'error'</h3>
143
+ <p>This event triggers when a successful response from the server is returned. The response contains a .error field with the serialized error data from the service.</p>
144
+ <pre class="prettyprint" style="padding:1em !important">
145
+ var req = prj.listProjects()
146
+ req.on('error', function(response){
147
+ console.log(response.error);
148
+ })
149
+ req.send();
150
+ </pre>
151
+
152
+ <h2>Multiple Callbacks and Chaining</h2>
153
+ <p>You can register multiple callbacks on any request object. The callbacks can be registered for different events, or all for the same event. In addition, you can chain callback registration, for example:</p>
154
+ <pre class="prettyprint" style="padding:1em !important">
155
+ prj.listProjects()
156
+ .on('error', function(response){
157
+ console.log("Error!");
158
+ })
159
+ .on('success', function(response){
160
+ console.log("Success!");
161
+ })
162
+ .on('complete', function(response){
163
+ console.log("Complete!");
164
+ })
165
+ .send();
166
+ </pre>
167
+ <p>
168
+ The above example will print either "Success! Complete!", or "Error! Complete!", depending on whether the request succeeded or not.
169
+ </p>
170
+
171
+ <h2>Support for Promises</h2>
172
+ <p>Each operation supports returning a promise if promises are globally available when the SDK in imported or a Promises implementation is provided to the SDK.</p>
173
+
174
+
175
+ <h3>Setting a Promise Dependency</h3>
176
+ <p>By default, the SDK will add the promise() method to FX.Request if the Promise constructor is available globally, either natively or pulled in by a 3rd party library. It is also possible to configure the SDK to use a 3rd party implementation of promises, such as bluebird, instead:</p>
177
+
178
+ <pre class="prettyprint" style="padding:1em !important">
179
+ // Bluebird already loaded
180
+ FX.config.promisesDependency = Promise;
181
+ </pre>
182
+
183
+ <p>Pass in your favorite Promise library to FX.config.setPromisesDependency or call it without a parameter to revert back to whichever Promise implementation is globally available.</p>
184
+
185
+ <h2>Returned Promise Method</h2>
186
+ <p>The promise() method is called directly on a FX.Request object. Remember that a request is returned when an operation is called without a callback function supplied. Callbacks can still be registered to events emitted by the request. Calling the promise() method will immediately send then the request, and return a promise that is fulfilled with the response data property or rejected with the response error property:</p>
187
+
188
+
189
+ <pre class="prettyprint" style="padding:1em !important">
190
+ // create the FX.Request object
191
+ var request = new FX.Project().listProjects();
192
+
193
+ // create the promise object
194
+ var promise = request.promise();
195
+
196
+ // handle promise's fulfilled/rejected states
197
+ promise.then(
198
+ function(data) {
199
+ /* process the data */
200
+ },
201
+ function(error) {
202
+ /* handle the error */
203
+ }
204
+ );
205
+ </pre>
206
+
207
+
208
+
209
+
210
+ {% endblock %}
@@ -0,0 +1,36 @@
1
+ {{% extends "templates/docs.html" %}}
2
+
3
+ {{% block doc_content %}}
4
+
5
+ <style>
6
+ code {{font-size: 18px; font-weight: bold}}
7
+ </style>
8
+
9
+ <h1>{title}</h1>
10
+ <p>
11
+ {description}
12
+ </p>
13
+
14
+ <pre class="prettyprint lang-javascript">
15
+ {example}
16
+ </pre>
17
+
18
+ <h2>Parameters</h2>
19
+ {params}
20
+
21
+ <h2>Callback</h2>
22
+ <ul class="api">
23
+ <li>
24
+ <code>err</code>
25
+ <p style="display: inline">(Error) - the error object returned from the request. Set to null if the request is successful.</p>
26
+ </li>
27
+ <li>
28
+ <code>data</code>
29
+ <p style="display: inline">(Object) — the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:</p>
30
+ {result}
31
+ </li>
32
+ </ul>
33
+
34
+
35
+
36
+ {{% endblock %}}
@@ -0,0 +1,9 @@
1
+ {{% extends "templates/docs.html" %}}
2
+
3
+ {{% block doc_content %}}
4
+ <h1>{service}</h1>
5
+ Version: {version}
6
+ <p>
7
+ </p>
8
+
9
+ {{% endblock %}}
@@ -0,0 +1,19 @@
1
+ {{% extends "templates/docs.html" %}}
2
+
3
+ {{% block doc_content %}}
4
+ <h1>Service Reference</h1>
5
+ <p>
6
+ The SDK currently supports the following services:
7
+ </p>
8
+
9
+ <table class="table table-striped">
10
+ <tr>
11
+ <th>Service Name</th>
12
+ <th>Description</th>
13
+ <th>Class Name</th>
14
+ <th>Latest API Version</th>
15
+ </tr>
16
+ {services}
17
+ </table>
18
+
19
+ {{% endblock %}}
@@ -0,0 +1,12 @@
1
+ {{% extends "templates/docs.html" %}}
2
+
3
+ {{% block doc_content %}}
4
+ <h1>{version}</h1>
5
+ Name: {name}
6
+ Version: {version}
7
+
8
+ <p>
9
+ List of operations
10
+ </p>
11
+
12
+ {{% endblock %}}
@@ -0,0 +1,10 @@
1
+ {{% extends "templates/docs.html" %}}
2
+
3
+ {{% block doc_content %}}
4
+ <h1>Previous Versions</h1>
5
+
6
+ <p>
7
+ List of versions
8
+ </p>
9
+
10
+ {{% endblock %}}
@@ -0,0 +1,68 @@
1
+ {% extends "templates/docs.html" %}
2
+
3
+ {% block doc_content %}
4
+ <h1>Working with Services</h1>
5
+ <p>
6
+ </p>
7
+ <h2>Constructing a Service</h2>
8
+
9
+ <p>Each service can be constructed with runtime configuration data that is specific to that service object. The service-specific configuration data will be merged on top of global configuration, so there is no need to re-specify any global settings. For example, an Project object can be created for a specific region:</p>
10
+
11
+ <pre class="prettyprint" style="padding:1em !important">
12
+ var prj = new FX.Project({region: 'us-west-2'});
13
+ </pre>
14
+
15
+ <p>This object will continue to use the globally provided credentials.</p>
16
+
17
+
18
+ <h2>Locking API Versions</h2>
19
+ <p>Services released by Impossible Software use API versions to keep track of API compatibility. API versions in FX services can be identified by a YYYY-mm-dd formatted date string, i.e., 2016-06-02 for the Project Service. It is recommended to lock into an API version for a service if you are relying on it for production code. This way, you can isolate yourself from service changes in updates of the SDK.</p>
20
+
21
+ <p>In order to lock into an API version of a given service, simply pass the apiVersion parameter when constructing the object, for example:</p>
22
+
23
+ <pre class="prettyprint" style="padding:1em !important">
24
+ var render = new FX.Render({apiVersion: '2016-06-02'});
25
+ </pre>
26
+
27
+ <p>Note that versions can also be locked globally by specifying the apiVersion or apiVersions global configuration parameters. This is documented with more detail in the <a href="config.html">Configuring</a> section.</p>
28
+
29
+
30
+
31
+ <h2>Fuzzy Versions and Date Locking</h2>
32
+
33
+ <p>Since FX has many services with many different API versions, the SDK allows for the specification of "fuzzy versions" instead of exact API version matches. This allows you to specify any date after the API version date, and the SDK will look for the last available matching API version when loading the service object.</p>
34
+
35
+ <p>You can also use this strategy to globally lock your application to a point in time. For instance, if you begin developing your application on 2016-07-05, you can add the following global apiVersion lock value:</p>
36
+
37
+ <pre class="prettyprint" style="padding:1em !important">
38
+ FX.config.apiVersion = '2016-07-05';
39
+ </pre>
40
+
41
+ <p>This will allow all created service objects to use the latest available API versions at the specified lock time. You can override any API versions if you need a newer version, or if the service had not yet been released, by adding the apiVersion parameter to the constructor call as normal:</p>
42
+
43
+ <pre class="prettyprint" style="padding:1em !important">
44
+ // FX Story Service was not yet released as of 2016-06-02
45
+ var story = new FX.Story({apiVersion: '2016-07-10'});
46
+ </pre>
47
+
48
+ <h2>Passing Parameters to a Service Operation</h2>
49
+ <p>When calling a method to a service, you should pass parameters in as option values, similar to the way configuration is passed. For example, to get an asset for a given project and name, you can pass the following parameters to the getAsset method:</p>
50
+
51
+ <pre class="prettyprint" style="padding:1em !important">
52
+ prj.getAsset({ProjectId: '123456-789-abcdef-0123-abcd', Name: 'assetName'});
53
+ </pre>
54
+
55
+ <p>Note that the full parameter documentation for each method is found in each service page in the complete API reference documentation.</p>
56
+
57
+
58
+ <h2>Bound Parameters</h2>
59
+ <p>Parameters can be automatically passed to service operations by binding them directly when constructing the service object. To do this, pass the <code>params</code> parameter to your constructed service with the map of default parameter values like so:</p>
60
+
61
+ <pre class="prettyprint" style="padding:1em !important">
62
+ var myProject = new FX.Project({ params: {ProjectId: '123456-789-abcdef-0123-abcd'} });
63
+ </pre>
64
+
65
+ <p>The <code>myProject</code> object will now represent a FX Project service object bound to a project identified by the project ID <code>'123456-789-abcdef-0123-abcd'</code>. Any operation that takes the <code>projectId</code> parameter will now have it auto-filled with this value. This value can be overridden by passing a new value in the service operation. Additionally, operations that do not require a <code>projectId</code> parameter will automatically ignore this bound parameter, so the <code>myProject</code> object can still be used to call <code>listProjects</code>, for instance.</p>
66
+
67
+
68
+ {% endblock %}
Binary file