'use strict';
30 |
31 | let crypto = require('crypto');
32 | let debug = require('debug')('TUPU');
33 | let request = require('request');
34 | let util = require('util');
35 | let fs = require('fs');
36 | let http = require('http');
37 | let Path = require('path');
38 |
39 | let tupu_public_key_path = Path.resolve(__filename + '/../tupu_public_key.pem');
40 | debug('tupu_public_key_path', tupu_public_key_path);
41 | const TUPU_SERVER_PUBLIC_KEY = fs.readFileSync(tupu_public_key_path).toString();
42 |
43 | /**
44 | * construct a TUPU API instance
45 | * @param secretId your secretId, contact us to apply your own secretId
46 | * @param privateKeyPath /path/to/your/private/key.pem
47 | * @param options default: <br/>
48 | * timeout: 30 * 1000 <br/>
49 | * domain: 'api.open.tuputech.com' (contact us for the other valid domains)
50 | * @constructor
51 | */
52 | function TUPU(secretId, privateKeyPath, options) {
53 | options = options || {};
54 |
55 | let domain = options.domain || 'api.open.tuputech.com'
56 | this.interface = 'http://' + domain + '/v3/recognition/' + secretId;
57 | this.secretId = secretId;
58 | this.privateKey = fs.readFileSync(privateKeyPath).toString();
59 |
60 | this.timeout = options.timeout || 30 * 1000;
61 |
62 | debug(this.interface, this.secretId, this.privateKey, this.timeout);
63 | }
64 | module.exports = TUPU;
65 |
66 | /**
67 | * call TUPU API by urls
68 | * @param urls [ 'http://sample.com/path/image.png', 'http://sample.com/path/images.zip' ]
69 | * @param cb function(data){}
70 | * 'data' is a json, detail specification can be found in:
71 | * <a target="_blank" href="https://www.tuputech.com/api/info">https://www.tuputech.com/api/info </a>
72 | * @returns {*}
73 | */
74 | TUPU.prototype.byURLs = function (urls, cb) {
75 | return this._api('url', cb, function (form) {
76 | urls.forEach(function (url) {
77 | form.append('image', url)
78 | })
79 | })
80 | }
81 |
82 | /**
83 | * call TUPU API by POST Files
84 | * @param files [ '/path/to/file1.jpg', '/path/to/file2.zip' ]
85 | * @param cb function(data){}
86 | * 'data' is a json, detail specification can be found in:
87 | * <a target="_blank" href="https://www.tuputech.com/api/info">https://www.tuputech.com/api/info </a>
88 | * @returns {*}
89 | */
90 | TUPU.prototype.byFiles = function (files, cb) {
91 | return this._api('file', cb, function (form) {
92 | files.forEach(function (file) {
93 | form.append('image', fs.createReadStream(file))
94 | })
95 | })
96 | }
97 |
98 | /**
99 | * call TUPU API by file streams
100 | * @param streams [ read stream1 , read stream2 ]
101 | * @param cb function(data){}
102 | * 'data' is a json, detail specification can be found in:
103 | * <a target="_blank" href="https://www.tuputech.com/api/info">https://www.tuputech.com/api/info </a>
104 | * @returns {*}
105 | */
106 | TUPU.prototype.byStreams = function (streams, cb) {
107 | return this._api('file', cb, function (form) {
108 | streams.forEach(function (stream) {
109 | form.append('image', stream)
110 | })
111 | })
112 | }
113 |
114 | let httpKeepAliveAgent = new http.Agent({keepAlive: true, maxSockets: 1000});
115 |
116 | TUPU.prototype._api = function (type, cb, imageFieldAppendFunc) {
117 |
118 | let signParams = [];
119 | let signer = crypto.createSign('RSA-SHA256');
120 | let timestamp = Math.round(new Date().getTime() / 1000);
121 | let nonce = Number(Math.random()).toString();
122 | let start = Date.now();
123 |
124 | // 1、push all sign params, by order: secretId, timestamp, nonce
125 | // 2、sign with 'RSA-SHA256' algorithms, and out put result in 'base64' format
126 |
127 | signParams.push(this.secretId, timestamp, nonce)
128 | signer.update(signParams.join(','), 'utf-8')
129 | let sendSignature = signer.sign(this.privateKey, 'base64')
130 |
131 | let params = {
132 | secretId: this.secretId, timestamp: timestamp, nonce: nonce, signature: sendSignature
133 | }
134 | debug(params)
135 |
136 | let options = {
137 | timeout: this.timeout
138 | , agent: httpKeepAliveAgent
139 | }
140 | let req = request.post(this.interface, options, function (err, httpResponse, body) {
141 | console.log('TUPU: API response total time ', (Date.now() - start), 'ms')
142 |
143 | if (err) {
144 | console.error('TUPU: return error:', err.message)
145 | return cb({
146 | code: 101
147 | , message: err.message
148 | })
149 | }
150 | debug(body)
151 |
152 | try {
153 | // 1、parse the receive body string to JSON format data
154 | body = JSON.parse(body)
155 |
156 | // 2、get signature and json fields
157 | let recvSignature = body.signature
158 | , json = body.json
159 | , verifier = crypto.createVerify('RSA-SHA256')
160 |
161 | debug(recvSignature)
162 | // 3、verify json with signature
163 | verifier.update(json, 'utf-8')
164 | if (verifier.verify(TUPU_SERVER_PUBLIC_KEY, recvSignature, 'base64')) {
165 | json = JSON.parse(json)
166 | debug('return json verify succeed ***********')
167 | debug(util.inspect(json, false, null))
168 | cb(json)
169 | } else {
170 | console('TUPU: return json verify failed ***********')
171 | cb({
172 | code: 101
173 | , message: 'return json verify failed'
174 | })
175 | }
176 | } catch (err) {
177 | console.error('TUPU: parse return json exception', err.message)
178 | console.error('TUPU', body)
179 | cb({
180 | code: 101
181 | , message: 'parse return json exception'
182 | })
183 | }
184 | })
185 |
186 | let form = req.form();
187 | for (let key in params) {
188 | form.append(key, params[key])
189 | }
190 | imageFieldAppendFunc(form)
191 | }
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
203 |
204 |
205 |
206 |
209 |
210 |
211 |
212 |
213 |
214 |
--------------------------------------------------------------------------------
/out/styles/jsdoc-default.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Open Sans';
3 | font-weight: normal;
4 | font-style: normal;
5 | src: url('../fonts/OpenSans-Regular-webfont.eot');
6 | src:
7 | local('Open Sans'),
8 | local('OpenSans'),
9 | url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
10 | url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
11 | url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
12 | }
13 |
14 | @font-face {
15 | font-family: 'Open Sans Light';
16 | font-weight: normal;
17 | font-style: normal;
18 | src: url('../fonts/OpenSans-Light-webfont.eot');
19 | src:
20 | local('Open Sans Light'),
21 | local('OpenSans Light'),
22 | url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
23 | url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
24 | url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
25 | }
26 |
27 | html
28 | {
29 | overflow: auto;
30 | background-color: #fff;
31 | font-size: 14px;
32 | }
33 |
34 | body
35 | {
36 | font-family: 'Open Sans', sans-serif;
37 | line-height: 1.5;
38 | color: #4d4e53;
39 | background-color: white;
40 | }
41 |
42 | a, a:visited, a:active {
43 | color: #0095dd;
44 | text-decoration: none;
45 | }
46 |
47 | a:hover {
48 | text-decoration: underline;
49 | }
50 |
51 | header
52 | {
53 | display: block;
54 | padding: 0px 4px;
55 | }
56 |
57 | tt, code, kbd, samp {
58 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
59 | }
60 |
61 | .class-description {
62 | font-size: 130%;
63 | line-height: 140%;
64 | margin-bottom: 1em;
65 | margin-top: 1em;
66 | }
67 |
68 | .class-description:empty {
69 | margin: 0;
70 | }
71 |
72 | #main {
73 | float: left;
74 | width: 70%;
75 | }
76 |
77 | article dl {
78 | margin-bottom: 40px;
79 | }
80 |
81 | section
82 | {
83 | display: block;
84 | background-color: #fff;
85 | padding: 12px 24px;
86 | border-bottom: 1px solid #ccc;
87 | margin-right: 30px;
88 | }
89 |
90 | .variation {
91 | display: none;
92 | }
93 |
94 | .signature-attributes {
95 | font-size: 60%;
96 | color: #aaa;
97 | font-style: italic;
98 | font-weight: lighter;
99 | }
100 |
101 | nav
102 | {
103 | display: block;
104 | float: right;
105 | margin-top: 28px;
106 | width: 30%;
107 | box-sizing: border-box;
108 | border-left: 1px solid #ccc;
109 | padding-left: 16px;
110 | }
111 |
112 | nav ul {
113 | font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
114 | font-size: 100%;
115 | line-height: 17px;
116 | padding: 0;
117 | margin: 0;
118 | list-style-type: none;
119 | }
120 |
121 | nav ul a, nav ul a:visited, nav ul a:active {
122 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
123 | line-height: 18px;
124 | color: #4D4E53;
125 | }
126 |
127 | nav h3 {
128 | margin-top: 12px;
129 | }
130 |
131 | nav li {
132 | margin-top: 6px;
133 | }
134 |
135 | footer {
136 | display: block;
137 | padding: 6px;
138 | margin-top: 12px;
139 | font-style: italic;
140 | font-size: 90%;
141 | }
142 |
143 | h1, h2, h3, h4 {
144 | font-weight: 200;
145 | margin: 0;
146 | }
147 |
148 | h1
149 | {
150 | font-family: 'Open Sans Light', sans-serif;
151 | font-size: 48px;
152 | letter-spacing: -2px;
153 | margin: 12px 24px 20px;
154 | }
155 |
156 | h2, h3
157 | {
158 | font-size: 30px;
159 | font-weight: 700;
160 | letter-spacing: -1px;
161 | margin-bottom: 12px;
162 | }
163 |
164 | h4
165 | {
166 | font-size: 18px;
167 | letter-spacing: -0.33px;
168 | margin-bottom: 12px;
169 | color: #4d4e53;
170 | }
171 |
172 | h5, .container-overview .subsection-title
173 | {
174 | font-size: 120%;
175 | font-weight: bold;
176 | letter-spacing: -0.01em;
177 | margin: 8px 0 3px 0;
178 | }
179 |
180 | h6
181 | {
182 | font-size: 100%;
183 | letter-spacing: -0.01em;
184 | margin: 6px 0 3px 0;
185 | font-style: italic;
186 | }
187 |
188 | .ancestors { color: #999; }
189 | .ancestors a
190 | {
191 | color: #999 !important;
192 | text-decoration: none;
193 | }
194 |
195 | .clear
196 | {
197 | clear: both;
198 | }
199 |
200 | .important
201 | {
202 | font-weight: bold;
203 | color: #950B02;
204 | }
205 |
206 | .yes-def {
207 | text-indent: -1000px;
208 | }
209 |
210 | .type-signature {
211 | color: #aaa;
212 | }
213 |
214 | .name, .signature {
215 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
216 | }
217 |
218 | .details { margin-top: 14px; border-left: 2px solid #DDD; }
219 | .details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
220 | .details dd { margin-left: 70px; }
221 | .details ul { margin: 0; }
222 | .details ul { list-style-type: none; }
223 | .details li { margin-left: 30px; padding-top: 6px; }
224 | .details pre.prettyprint { margin: 0 }
225 | .details .object-value { padding-top: 0; }
226 |
227 | .description {
228 | margin-bottom: 1em;
229 | margin-top: 1em;
230 | }
231 |
232 | .code-caption
233 | {
234 | font-style: italic;
235 | font-size: 107%;
236 | margin: 0;
237 | }
238 |
239 | .prettyprint
240 | {
241 | border: 1px solid #ddd;
242 | width: 80%;
243 | overflow: auto;
244 | }
245 |
246 | .prettyprint.source {
247 | width: inherit;
248 | }
249 |
250 | .prettyprint code
251 | {
252 | font-size: 100%;
253 | line-height: 18px;
254 | display: block;
255 | padding: 4px 12px;
256 | margin: 0;
257 | background-color: #fff;
258 | color: #4D4E53;
259 | }
260 |
261 | .prettyprint code span.line
262 | {
263 | display: inline-block;
264 | }
265 |
266 | .prettyprint.linenums
267 | {
268 | padding-left: 70px;
269 | -webkit-user-select: none;
270 | -moz-user-select: none;
271 | -ms-user-select: none;
272 | user-select: none;
273 | }
274 |
275 | .prettyprint.linenums ol
276 | {
277 | padding-left: 0;
278 | }
279 |
280 | .prettyprint.linenums li
281 | {
282 | border-left: 3px #ddd solid;
283 | }
284 |
285 | .prettyprint.linenums li.selected,
286 | .prettyprint.linenums li.selected *
287 | {
288 | background-color: lightyellow;
289 | }
290 |
291 | .prettyprint.linenums li *
292 | {
293 | -webkit-user-select: text;
294 | -moz-user-select: text;
295 | -ms-user-select: text;
296 | user-select: text;
297 | }
298 |
299 | .params, .props
300 | {
301 | border-spacing: 0;
302 | border: 0;
303 | border-collapse: collapse;
304 | }
305 |
306 | .params .name, .props .name, .name code {
307 | color: #4D4E53;
308 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
309 | font-size: 100%;
310 | }
311 |
312 | .params td, .params th, .props td, .props th
313 | {
314 | border: 1px solid #ddd;
315 | margin: 0px;
316 | text-align: left;
317 | vertical-align: top;
318 | padding: 4px 6px;
319 | display: table-cell;
320 | }
321 |
322 | .params thead tr, .props thead tr
323 | {
324 | background-color: #ddd;
325 | font-weight: bold;
326 | }
327 |
328 | .params .params thead tr, .props .props thead tr
329 | {
330 | background-color: #fff;
331 | font-weight: bold;
332 | }
333 |
334 | .params th, .props th { border-right: 1px solid #aaa; }
335 | .params thead .last, .props thead .last { border-right: 1px solid #ddd; }
336 |
337 | .params td.description > p:first-child,
338 | .props td.description > p:first-child
339 | {
340 | margin-top: 0;
341 | padding-top: 0;
342 | }
343 |
344 | .params td.description > p:last-child,
345 | .props td.description > p:last-child
346 | {
347 | margin-bottom: 0;
348 | padding-bottom: 0;
349 | }
350 |
351 | .disabled {
352 | color: #454545;
353 | }
354 |
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * TUPU Recognition API SDK
3 | * Copyright(c)2013-2016, TUPU Technology
4 | * https://www.tuputech.com
5 | *****************************************************************************/
6 |
7 | "use strict"
8 |
9 | let crypto = require("crypto")
10 | let debug = require("debug")("TUPU")
11 | let request = require("request")
12 | let util = require("util")
13 | let fs = require("fs")
14 | let http = require("http")
15 | let Path = require("path")
16 |
17 | const api = require("./api")
18 | const sign = require("./sign")
19 | const video = require("./video")
20 | const text = require("./text")
21 |
22 | let tupu_public_key_path = Path.resolve(__filename + "/../tupu_public_key.pem")
23 | debug("tupu_public_key_path", tupu_public_key_path)
24 | const TUPU_SERVER_PUBLIC_KEY = fs.readFileSync(tupu_public_key_path).toString()
25 |
26 | /**
27 | * construct a TUPU API instance
28 | * @param secretId your secretId, contact us to apply your own secretId
29 | * @param privateKeyPath /path/to/your/private/key.pem
30 | * @param options default:
31 | * timeout: 30 * 1000
32 | * domain: 'api.open.tuputech.com' (contact us for the other valid domains)
33 | * @constructor
34 | */
35 | function TUPU(secretId, privateKeyPath, options) {
36 | options = options || {}
37 |
38 | const domain = options.domain || "api.open.tuputech.com"
39 | const prefix = "http://" + domain + "/v3/recognition/"
40 | this.imageApi = prefix + secretId
41 |
42 | this.videoSyncApi = prefix + "video/syncscan/" + secretId
43 | this.videoAsyncApi = prefix + "video/asyncscan/" + secretId
44 | this.videoStreamApi = prefix + "video/stream/" + secretId
45 | this.videoCloseApi = prefix + "video/close/" + secretId
46 |
47 | this.textApi = prefix + "text/" + secretId
48 |
49 | this.secretId = secretId
50 | this.privateKey = options.privateKey || fs.readFileSync(privateKeyPath).toString()
51 |
52 | this.timeout = options.timeout || 30 * 1000
53 |
54 | debug(this.imageApi, this.secretId, this.privateKey, this.timeout)
55 | }
56 | module.exports = TUPU
57 |
58 | /**
59 | * call TUPU API by urls
60 | * @param urls [ 'http://sample.com/path/image.png', 'http://sample.com/path/images.zip' ]
61 | * @param options {tag: Array | String, uid: String}
62 | * @param cb function(data){}
63 | * 'data' is a json, detail specification can be found in:
64 | * https://www.tuputech.com/api/info
65 | * @returns {*}
66 | */
67 | TUPU.prototype.byURLs = function (urls, options, cb) {
68 | if (!cb && typeof options === "function") {
69 | cb = options
70 | options = {}
71 | }
72 | return this._api(cb, function (form) {
73 | appendOptions(options, form)
74 | urls.forEach(function (url) {
75 | form.append("image", url)
76 | })
77 | })
78 | }
79 |
80 | function appendOptions(options, form) {
81 | if (options.tag) {
82 | if (!Array.isArray(options.tag)) {
83 | options.tag = [options.tag]
84 | }
85 | options.tag.forEach(function (tag) {
86 | form.append("tag", tag)
87 | })
88 | }
89 |
90 | if (options.uid) {
91 | form.append("uid", options.uid)
92 | }
93 | }
94 |
95 | /**
96 | * call TUPU API by POST Files
97 | * @param files [ '/path/to/file1.jpg', '/path/to/file2.zip' ]
98 | * @param options {tag: Array | String, uid: String}
99 | * @param cb function(data){}
100 | * 'data' is a json, detail specification can be found in:
101 | * https://www.tuputech.com/api/info
102 | * @returns {*}
103 | */
104 | TUPU.prototype.byFiles = function (files, options, cb) {
105 | if (!cb && typeof options === "function") {
106 | cb = options
107 | options = {}
108 | }
109 | return this._api(cb, function (form) {
110 | appendOptions(options, form)
111 | files.forEach(function (file) {
112 | form.append("image", fs.createReadStream(file))
113 | })
114 | })
115 | }
116 |
117 | /**
118 | * call TUPU API by file streams
119 | * @param streams [ read stream1 , read stream2 ]
120 | * @param options {tag: Array | String, uid: String}
121 | * @param cb function(data){}
122 | * 'data' is a json, detail specification can be found in:
123 | * https://www.tuputech.com/api/info
124 | * @returns {*}
125 | */
126 | TUPU.prototype.byStreams = function (streams, options, cb) {
127 | if (!cb && typeof options === "function") {
128 | cb = options
129 | options = {}
130 | }
131 | return this._api(cb, function (form) {
132 | appendOptions(options, form)
133 | streams.forEach(function (stream) {
134 | form.append("image", stream)
135 | })
136 | })
137 | }
138 |
139 | let httpKeepAliveAgent = new http.Agent({ keepAlive: true, maxSockets: 1000 })
140 |
141 | TUPU.prototype._api = function (cb, imageFieldAppendFunc) {
142 | let signParams = []
143 | let signer = crypto.createSign("RSA-SHA256")
144 | let timestamp = Math.round(new Date().getTime() / 1000)
145 | let nonce = Number(Math.random()).toString()
146 | let start = Date.now()
147 |
148 | // 1、push all sign params, by order: secretId, timestamp, nonce
149 | // 2、sign with 'RSA-SHA256' algorithms, and out put result in 'base64' format
150 |
151 | signParams.push(this.secretId, timestamp, nonce)
152 | signer.update(signParams.join(","), "utf-8")
153 | let sendSignature = signer.sign(this.privateKey, "base64")
154 |
155 | let params = {
156 | secretId: this.secretId,
157 | timestamp: timestamp,
158 | nonce: nonce,
159 | signature: sendSignature
160 | }
161 | debug(params)
162 |
163 | let options = {
164 | timeout: this.timeout,
165 | agent: httpKeepAliveAgent
166 | }
167 | let req = request.post(this.imageApi, options, function (
168 | err,
169 | httpResponse,
170 | body
171 | ) {
172 | console.log("TUPU: API response total time ", Date.now() - start, "ms")
173 |
174 | if (err) {
175 | console.error("TUPU: return error:", err.message)
176 | return cb({
177 | code: 101,
178 | message: err.message
179 | })
180 | }
181 | debug(body)
182 |
183 | try {
184 | // 1、parse the receive body string to JSON format data
185 | body = JSON.parse(body)
186 |
187 | // 2、get signature and json fields
188 | let recvSignature = body.signature,
189 | json = body.json,
190 | verifier = crypto.createVerify("RSA-SHA256")
191 |
192 | debug(recvSignature)
193 | // 3、verify json with signature
194 | verifier.update(json, "utf-8")
195 | if (
196 | verifier.verify(TUPU_SERVER_PUBLIC_KEY, recvSignature, "base64")
197 | ) {
198 | json = JSON.parse(json)
199 | debug("return json verify succeed ***********")
200 | debug(util.inspect(json, false, null))
201 | cb(json)
202 | } else {
203 | console.error("TUPU: return json verify failed ***********")
204 | cb({
205 | code: 101,
206 | message: "return json verify failed"
207 | })
208 | }
209 | } catch (err) {
210 | console.error("TUPU: parse return json exception", err.message)
211 | console.error("TUPU", body)
212 | cb({
213 | code: 101,
214 | message: "parse return json exception"
215 | })
216 | }
217 | })
218 |
219 | let form = req.form()
220 | for (let key in params) {
221 | form.append(key, params[key])
222 | }
223 | imageFieldAppendFunc(form)
224 | }
225 |
226 | function mixin(dest, src) {
227 | for (const key in src) {
228 | if (dest.prototype.hasOwnProperty(key)) {
229 | throw new Error(
230 | "Don't allow override existed prototype method. method: " + key
231 | )
232 | }
233 | dest.prototype[key] = src[key]
234 | }
235 | }
236 |
237 | mixin(TUPU, api)
238 | mixin(TUPU, sign)
239 | mixin(TUPU, video)
240 | mixin(TUPU, text)
241 |
--------------------------------------------------------------------------------
/out/scripts/prettify/Apache-License-2.0.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/out/TUPU.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSDoc: Class: TUPU
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |