@internxt/sdk 1.17.2 → 1.17.3
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/drive/index.d.ts
CHANGED
package/dist/drive/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
2
|
+
import { PhotoDevice } from './types';
|
|
3
|
+
export declare class Photos {
|
|
4
|
+
private readonly client;
|
|
5
|
+
private readonly appDetails;
|
|
6
|
+
private readonly apiSecurity;
|
|
7
|
+
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Photos;
|
|
8
|
+
private constructor();
|
|
9
|
+
listDevices(): Promise<PhotoDevice[]>;
|
|
10
|
+
createDevice(deviceName: string): Promise<PhotoDevice>;
|
|
11
|
+
getDevice(uuid: string): Promise<PhotoDevice>;
|
|
12
|
+
deleteDevice(uuid: string): Promise<void>;
|
|
13
|
+
renameDevice(uuid: string, deviceName: string): Promise<PhotoDevice>;
|
|
14
|
+
private headers;
|
|
15
|
+
}
|
|
16
|
+
export * from './types';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Photos = void 0;
|
|
18
|
+
const headers_1 = require("../../shared/headers");
|
|
19
|
+
const client_1 = require("../../shared/http/client");
|
|
20
|
+
class Photos {
|
|
21
|
+
client;
|
|
22
|
+
appDetails;
|
|
23
|
+
apiSecurity;
|
|
24
|
+
static client(apiUrl, appDetails, apiSecurity) {
|
|
25
|
+
return new Photos(apiUrl, appDetails, apiSecurity);
|
|
26
|
+
}
|
|
27
|
+
constructor(apiUrl, appDetails, apiSecurity) {
|
|
28
|
+
this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback, apiSecurity.retryOptions);
|
|
29
|
+
this.appDetails = appDetails;
|
|
30
|
+
this.apiSecurity = apiSecurity;
|
|
31
|
+
}
|
|
32
|
+
listDevices() {
|
|
33
|
+
return this.client.get('/photos/devices', this.headers());
|
|
34
|
+
}
|
|
35
|
+
createDevice(deviceName) {
|
|
36
|
+
return this.client.post('/photos/devices', { deviceName }, this.headers());
|
|
37
|
+
}
|
|
38
|
+
getDevice(uuid) {
|
|
39
|
+
return this.client.get(`/photos/devices/${uuid}`, this.headers());
|
|
40
|
+
}
|
|
41
|
+
deleteDevice(uuid) {
|
|
42
|
+
return this.client.delete(`/photos/devices/${uuid}`, this.headers());
|
|
43
|
+
}
|
|
44
|
+
renameDevice(uuid, deviceName) {
|
|
45
|
+
return this.client.patch(`/photos/devices/${uuid}`, { deviceName }, this.headers());
|
|
46
|
+
}
|
|
47
|
+
headers() {
|
|
48
|
+
return (0, headers_1.headersWithToken)({
|
|
49
|
+
clientName: this.appDetails.clientName,
|
|
50
|
+
clientVersion: this.appDetails.clientVersion,
|
|
51
|
+
token: this.apiSecurity.token,
|
|
52
|
+
workspaceToken: this.apiSecurity.workspaceToken,
|
|
53
|
+
desktopToken: this.appDetails.desktopHeader,
|
|
54
|
+
customHeaders: this.appDetails.customHeaders,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Photos = Photos;
|
|
59
|
+
__exportStar(require("./types"), exports);
|