@internxt/sdk 1.12.5 → 1.12.6
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.
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiUrl } from '../../shared';
|
|
2
2
|
export interface UserLocation {
|
|
3
3
|
ip: string;
|
|
4
4
|
location: string;
|
|
5
5
|
}
|
|
6
6
|
export declare class Location {
|
|
7
7
|
private readonly client;
|
|
8
|
-
private readonly appDetails;
|
|
9
8
|
private constructor();
|
|
10
|
-
static client(apiUrl: ApiUrl
|
|
9
|
+
static client(apiUrl: ApiUrl): Location;
|
|
11
10
|
getUserLocation(): Promise<UserLocation>;
|
|
12
|
-
private basicUserHeaders;
|
|
13
11
|
}
|
|
@@ -37,31 +37,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Location = void 0;
|
|
40
|
-
var headers_1 = require("../../shared/headers");
|
|
41
40
|
var client_1 = require("../../shared/http/client");
|
|
42
41
|
var Location = /** @class */ (function () {
|
|
43
|
-
function Location(apiUrl
|
|
44
|
-
this.client = client_1.HttpClient.create(apiUrl
|
|
45
|
-
this.appDetails = appDetails;
|
|
42
|
+
function Location(apiUrl) {
|
|
43
|
+
this.client = client_1.HttpClient.create(apiUrl);
|
|
46
44
|
}
|
|
47
|
-
Location.client = function (apiUrl
|
|
48
|
-
return new Location(apiUrl
|
|
45
|
+
Location.client = function (apiUrl) {
|
|
46
|
+
return new Location(apiUrl);
|
|
49
47
|
};
|
|
50
48
|
Location.prototype.getUserLocation = function () {
|
|
51
49
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
50
|
return __generator(this, function (_a) {
|
|
53
|
-
return [2 /*return*/, this.client.get('',
|
|
51
|
+
return [2 /*return*/, this.client.get('/', {})];
|
|
54
52
|
});
|
|
55
53
|
});
|
|
56
54
|
};
|
|
57
|
-
Location.prototype.basicUserHeaders = function () {
|
|
58
|
-
return (0, headers_1.basicHeaders)({
|
|
59
|
-
clientName: this.appDetails.clientName,
|
|
60
|
-
clientVersion: this.appDetails.clientVersion,
|
|
61
|
-
desktopToken: this.appDetails.desktopHeader,
|
|
62
|
-
customHeaders: this.appDetails.customHeaders,
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
55
|
return Location;
|
|
66
56
|
}());
|
|
67
57
|
exports.Location = Location;
|