@uoa/lambda-tracing 1.2.0 → 1.3.0
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.
- package/dist/uoaHttps.js +12 -8
- package/package.json +1 -1
- package/uoaHttps.ts +12 -8
package/dist/uoaHttps.js
CHANGED
|
@@ -44,14 +44,15 @@ function request(...args) {
|
|
|
44
44
|
return https.request(args[0], args[1]);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function doGetRequest(hostname, path, headers) {
|
|
47
|
+
function doGetRequest(hostname, path, headers, port = 443) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
49
|
return new Promise(function (resolve, reject) {
|
|
50
50
|
const options = {
|
|
51
51
|
"method": "GET",
|
|
52
52
|
"hostname": hostname,
|
|
53
53
|
"path": path,
|
|
54
|
-
"headers": headers
|
|
54
|
+
"headers": headers,
|
|
55
|
+
"port": port
|
|
55
56
|
};
|
|
56
57
|
api_1.propagation.inject(api_1.context.active(), options.headers);
|
|
57
58
|
const req = https.request(options, function (response) {
|
|
@@ -72,14 +73,15 @@ function doGetRequest(hostname, path, headers) {
|
|
|
72
73
|
});
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
|
-
function doPostRequest(hostname, path, headers, data) {
|
|
76
|
+
function doPostRequest(hostname, path, headers, data, port = 443) {
|
|
76
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
78
|
return new Promise(function (resolve, reject) {
|
|
78
79
|
const options = {
|
|
79
80
|
"method": "POST",
|
|
80
81
|
"hostname": hostname,
|
|
81
82
|
"path": path,
|
|
82
|
-
"headers": headers
|
|
83
|
+
"headers": headers,
|
|
84
|
+
"port": port
|
|
83
85
|
};
|
|
84
86
|
api_1.propagation.inject(api_1.context.active(), options.headers);
|
|
85
87
|
const req = https.request(options, function (response) {
|
|
@@ -121,14 +123,15 @@ function doPostRequest(hostname, path, headers, data) {
|
|
|
121
123
|
});
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
|
-
function doPutRequest(hostname, path, headers, data) {
|
|
126
|
+
function doPutRequest(hostname, path, headers, data, port = 443) {
|
|
125
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
126
128
|
return new Promise(function (resolve, reject) {
|
|
127
129
|
const options = {
|
|
128
130
|
"method": "PUT",
|
|
129
131
|
"hostname": hostname,
|
|
130
132
|
"path": path,
|
|
131
|
-
"headers": headers
|
|
133
|
+
"headers": headers,
|
|
134
|
+
"port": port
|
|
132
135
|
};
|
|
133
136
|
api_1.propagation.inject(api_1.context.active(), options.headers);
|
|
134
137
|
const req = https.request(options, function (response) {
|
|
@@ -170,14 +173,15 @@ function doPutRequest(hostname, path, headers, data) {
|
|
|
170
173
|
});
|
|
171
174
|
});
|
|
172
175
|
}
|
|
173
|
-
function doDeleteRequest(hostname, path, headers) {
|
|
176
|
+
function doDeleteRequest(hostname, path, headers, port = 443) {
|
|
174
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
178
|
return new Promise(function (resolve, reject) {
|
|
176
179
|
const options = {
|
|
177
180
|
"method": "DELETE",
|
|
178
181
|
"hostname": hostname,
|
|
179
182
|
"path": path,
|
|
180
|
-
"headers": headers
|
|
183
|
+
"headers": headers,
|
|
184
|
+
"port": port
|
|
181
185
|
};
|
|
182
186
|
api_1.propagation.inject(api_1.context.active(), options.headers);
|
|
183
187
|
const req = https.request(options, function (response) {
|
package/package.json
CHANGED
package/uoaHttps.ts
CHANGED
|
@@ -16,13 +16,14 @@ function request(...args: any[]): http.ClientRequest {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
async function doGetRequest(hostname: string, path: string, headers: any) {
|
|
19
|
+
async function doGetRequest(hostname: string, path: string, headers: any, port: number | string = 443) {
|
|
20
20
|
return new Promise(function (resolve, reject) {
|
|
21
21
|
const options = {
|
|
22
22
|
"method": "GET",
|
|
23
23
|
"hostname": hostname,
|
|
24
24
|
"path": path,
|
|
25
|
-
"headers": headers
|
|
25
|
+
"headers": headers,
|
|
26
|
+
"port": port
|
|
26
27
|
}
|
|
27
28
|
propagation.inject(context.active(), options.headers);
|
|
28
29
|
|
|
@@ -48,13 +49,14 @@ async function doGetRequest(hostname: string, path: string, headers: any) {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
async function doPostRequest(hostname: string, path: string, headers: any, data: any) {
|
|
52
|
+
async function doPostRequest(hostname: string, path: string, headers: any, data: any, port: number | string = 443) {
|
|
52
53
|
return new Promise(function (resolve, reject) {
|
|
53
54
|
const options = {
|
|
54
55
|
"method": "POST",
|
|
55
56
|
"hostname": hostname,
|
|
56
57
|
"path": path,
|
|
57
|
-
"headers": headers
|
|
58
|
+
"headers": headers,
|
|
59
|
+
"port": port
|
|
58
60
|
}
|
|
59
61
|
propagation.inject(context.active(), options.headers);
|
|
60
62
|
|
|
@@ -98,13 +100,14 @@ async function doPostRequest(hostname: string, path: string, headers: any, data:
|
|
|
98
100
|
});
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
async function doPutRequest(hostname: string, path: string, headers: any, data: any) {
|
|
103
|
+
async function doPutRequest(hostname: string, path: string, headers: any, data: any, port: number | string = 443) {
|
|
102
104
|
return new Promise(function (resolve, reject) {
|
|
103
105
|
const options = {
|
|
104
106
|
"method": "PUT",
|
|
105
107
|
"hostname": hostname,
|
|
106
108
|
"path": path,
|
|
107
|
-
"headers": headers
|
|
109
|
+
"headers": headers,
|
|
110
|
+
"port": port
|
|
108
111
|
}
|
|
109
112
|
propagation.inject(context.active(), options.headers);
|
|
110
113
|
|
|
@@ -148,13 +151,14 @@ async function doPutRequest(hostname: string, path: string, headers: any, data:
|
|
|
148
151
|
});
|
|
149
152
|
}
|
|
150
153
|
|
|
151
|
-
async function doDeleteRequest(hostname: string, path: string, headers: any) {
|
|
154
|
+
async function doDeleteRequest(hostname: string, path: string, headers: any, port: number | string = 443) {
|
|
152
155
|
return new Promise(function (resolve, reject) {
|
|
153
156
|
const options = {
|
|
154
157
|
"method": "DELETE",
|
|
155
158
|
"hostname": hostname,
|
|
156
159
|
"path": path,
|
|
157
|
-
"headers": headers
|
|
160
|
+
"headers": headers,
|
|
161
|
+
"port": port
|
|
158
162
|
}
|
|
159
163
|
propagation.inject(context.active(), options.headers);
|
|
160
164
|
|