This repository has been archived by the owner on Apr 21, 2021. It is now read-only.
/
index.mustache
executable file
·72 lines (68 loc) · 3.72 KB
/
index.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{{>licenseInfo}}
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient'{{#models}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('./ApiClient'){{#models}}, require('./{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'){{/models}}{{#apiInfo}}{{#apis}}, require('./{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'){{/apis}}{{/apiInfo}});
}
}(function(ApiClient{{#models}}{{#model}}, {{classFilename}}{{/model}}{{/models}}{{#apiInfo}}{{#apis}}, {{importPath}}{{/apis}}{{/apiInfo}}) {
'use strict';
{{#emitJSDoc}} /**{{#projectDescription}}
* {{projectDescription}}.<br>{{/projectDescription}}
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
* <p>
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
* <pre>
* var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
* var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
* var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
* </pre>
* <em>*NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...})
* and put the application logic within the callback function.</em>
* </p>
* <p>
* A non-AMD browser application (discouraged) might do something like this:
* <pre>
* var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
* var yyy = new {{moduleName}}.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
* </pre>
* </p>
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index
* @version {{projectVersion}}
*/{{/emitJSDoc}}
{{=< >=}} var exports = {<#emitJSDoc>
/**
* The ApiClient constructor.
* @property {module:<#invokerPackage><invokerPackage>/</invokerPackage>ApiClient}
*/</emitJSDoc>
ApiClient: ApiClient<#models>,<#emitJSDoc>
/**
* The <importPath> model constructor.
* @property {module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><importPath>}
*/</emitJSDoc>
<importPath>: <importPath></models><#apiInfo><#apis>,<#emitJSDoc>
/**
* The <importPath> service constructor.
* @property {module:<#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><importPath>}
*/</emitJSDoc>
<importPath>: <importPath></apis></apiInfo>
};
exports.setBasicAuth = function(username, password) {
exports.ApiClient.instance.authentications['basic'].username = username;
exports.ApiClient.instance.authentications['basic'].password = password;
};
exports.setAccessToken = function(token) {
exports.ApiClient.instance.authentications['customer_accessCode'].accessToken = token;
};
return exports;<={{ }}=>
}));