core.js
2.43 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* The main AWS namespace
*/
var AWS = { util: require('./util') };
/**
* @api private
* @!macro [new] nobrowser
* @note This feature is not supported in the browser environment of the SDK.
*/
var _hidden = {}; _hidden.toString(); // hack to parse macro
/**
* @api private
*/
module.exports = AWS;
AWS.util.update(AWS, {
/**
* @constant
*/
VERSION: '2.573.0',
/**
* @api private
*/
Signers: {},
/**
* @api private
*/
Protocol: {
Json: require('./protocol/json'),
Query: require('./protocol/query'),
Rest: require('./protocol/rest'),
RestJson: require('./protocol/rest_json'),
RestXml: require('./protocol/rest_xml')
},
/**
* @api private
*/
XML: {
Builder: require('./xml/builder'),
Parser: null // conditionally set based on environment
},
/**
* @api private
*/
JSON: {
Builder: require('./json/builder'),
Parser: require('./json/parser')
},
/**
* @api private
*/
Model: {
Api: require('./model/api'),
Operation: require('./model/operation'),
Shape: require('./model/shape'),
Paginator: require('./model/paginator'),
ResourceWaiter: require('./model/resource_waiter')
},
/**
* @api private
*/
apiLoader: require('./api_loader'),
/**
* @api private
*/
EndpointCache: require('../vendor/endpoint-cache').EndpointCache
});
require('./sequential_executor');
require('./service');
require('./config');
require('./http');
require('./event_listeners');
require('./request');
require('./response');
require('./resource_waiter');
require('./signers/request_signer');
require('./param_validator');
/**
* @readonly
* @return [AWS.SequentialExecutor] a collection of global event listeners that
* are attached to every sent request.
* @see AWS.Request AWS.Request for a list of events to listen for
* @example Logging the time taken to send a request
* AWS.events.on('send', function startSend(resp) {
* resp.startTime = new Date().getTime();
* }).on('complete', function calculateTime(resp) {
* var time = (new Date().getTime() - resp.startTime) / 1000;
* console.log('Request took ' + time + ' seconds');
* });
*
* new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds'
*/
AWS.events = new AWS.SequentialExecutor();
//create endpoint cache lazily
AWS.util.memoizedProperty(AWS, 'endpointCache', function() {
return new AWS.EndpointCache(AWS.config.endpointCacheSize);
}, true);