@juhuu/sdk-ts 1.2.147 → 1.2.149
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/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +15 -1
- package/dist/index.mjs +15 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -661,6 +661,7 @@ declare class DevicesService extends Service {
|
|
661
661
|
message(DeviceMessageParams: JUHUU.Device.Message.Params, DeviceMessageOptions?: JUHUU.Device.Message.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Message.Response>>;
|
662
662
|
parameterUpdate(DeviceParameterParams: JUHUU.Device.ParameterUpdate.Params, DeviceParameterOptions?: JUHUU.Device.ParameterUpdate.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.ParameterUpdate.Response>>;
|
663
663
|
commandExecute(DeviceCommandExecuteParams: JUHUU.Device.CommandExecute.Params, DeviceCommandExecuteOptions?: JUHUU.Device.CommandExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.CommandExecute.Response>>;
|
664
|
+
nodeExecute(DeviceNodeExecuteParams: JUHUU.Device.NodeExecute.Params, DeviceNodeExecuteOptions?: JUHUU.Device.NodeExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.NodeExecute.Response>>;
|
664
665
|
delete(DeviceDeleteParams: JUHUU.Device.Delete.Params, DeviceDeleteOptions?: JUHUU.Device.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Delete.Response>>;
|
665
666
|
}
|
666
667
|
|
@@ -2943,6 +2944,16 @@ declare namespace JUHUU {
|
|
2943
2944
|
device: JUHUU.Device.Object;
|
2944
2945
|
};
|
2945
2946
|
}
|
2947
|
+
namespace NodeExecute {
|
2948
|
+
type Params = {
|
2949
|
+
deviceId: string;
|
2950
|
+
nodeId: string;
|
2951
|
+
};
|
2952
|
+
type Options = JUHUU.RequestOptions;
|
2953
|
+
type Response = {
|
2954
|
+
device: JUHUU.Device.Object;
|
2955
|
+
};
|
2956
|
+
}
|
2946
2957
|
namespace Delete {
|
2947
2958
|
type Params = {
|
2948
2959
|
deviceId?: string;
|
package/dist/index.d.ts
CHANGED
@@ -661,6 +661,7 @@ declare class DevicesService extends Service {
|
|
661
661
|
message(DeviceMessageParams: JUHUU.Device.Message.Params, DeviceMessageOptions?: JUHUU.Device.Message.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Message.Response>>;
|
662
662
|
parameterUpdate(DeviceParameterParams: JUHUU.Device.ParameterUpdate.Params, DeviceParameterOptions?: JUHUU.Device.ParameterUpdate.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.ParameterUpdate.Response>>;
|
663
663
|
commandExecute(DeviceCommandExecuteParams: JUHUU.Device.CommandExecute.Params, DeviceCommandExecuteOptions?: JUHUU.Device.CommandExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.CommandExecute.Response>>;
|
664
|
+
nodeExecute(DeviceNodeExecuteParams: JUHUU.Device.NodeExecute.Params, DeviceNodeExecuteOptions?: JUHUU.Device.NodeExecute.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.NodeExecute.Response>>;
|
664
665
|
delete(DeviceDeleteParams: JUHUU.Device.Delete.Params, DeviceDeleteOptions?: JUHUU.Device.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Device.Delete.Response>>;
|
665
666
|
}
|
666
667
|
|
@@ -2943,6 +2944,16 @@ declare namespace JUHUU {
|
|
2943
2944
|
device: JUHUU.Device.Object;
|
2944
2945
|
};
|
2945
2946
|
}
|
2947
|
+
namespace NodeExecute {
|
2948
|
+
type Params = {
|
2949
|
+
deviceId: string;
|
2950
|
+
nodeId: string;
|
2951
|
+
};
|
2952
|
+
type Options = JUHUU.RequestOptions;
|
2953
|
+
type Response = {
|
2954
|
+
device: JUHUU.Device.Object;
|
2955
|
+
};
|
2956
|
+
}
|
2946
2957
|
namespace Delete {
|
2947
2958
|
type Params = {
|
2948
2959
|
deviceId?: string;
|
package/dist/index.js
CHANGED
@@ -102,6 +102,7 @@ var Service = class {
|
|
102
102
|
}
|
103
103
|
}
|
104
104
|
}
|
105
|
+
console.log("authenticationMode", this.authenticationMode);
|
105
106
|
if (currentOptions.refreshTokensIfNecessary === void 0) {
|
106
107
|
switch (this.authenticationMode) {
|
107
108
|
case "jwt": {
|
@@ -202,9 +203,11 @@ var Service = class {
|
|
202
203
|
responseObject = {
|
203
204
|
ok: false,
|
204
205
|
data: await response?.json(),
|
205
|
-
statusText: response?.statusText ?? "
|
206
|
+
statusText: response?.statusText ?? "",
|
206
207
|
status: response?.status ?? 0
|
207
208
|
};
|
209
|
+
console.log("refreshTokensIfNecessary", options.refreshTokensIfNecessary);
|
210
|
+
console.log("responseObject.status", responseObject.status);
|
208
211
|
if (responseObject.status === 403 && options.refreshTokensIfNecessary === true) {
|
209
212
|
console.log("refreshing tokens...");
|
210
213
|
const oldRefreshToken = await this.getRefreshToken();
|
@@ -1256,6 +1259,17 @@ var DevicesService = class extends Service {
|
|
1256
1259
|
DeviceCommandExecuteOptions
|
1257
1260
|
);
|
1258
1261
|
}
|
1262
|
+
async nodeExecute(DeviceNodeExecuteParams, DeviceNodeExecuteOptions) {
|
1263
|
+
return await super.sendRequest(
|
1264
|
+
{
|
1265
|
+
method: "POST",
|
1266
|
+
url: "devices/" + DeviceNodeExecuteParams.deviceId + "/node/" + DeviceNodeExecuteParams.nodeId,
|
1267
|
+
body: {},
|
1268
|
+
authenticationNotOptional: true
|
1269
|
+
},
|
1270
|
+
DeviceNodeExecuteOptions
|
1271
|
+
);
|
1272
|
+
}
|
1259
1273
|
async delete(DeviceDeleteParams, DeviceDeleteOptions) {
|
1260
1274
|
return await super.sendRequest(
|
1261
1275
|
{
|
package/dist/index.mjs
CHANGED
@@ -58,6 +58,7 @@ var Service = class {
|
|
58
58
|
}
|
59
59
|
}
|
60
60
|
}
|
61
|
+
console.log("authenticationMode", this.authenticationMode);
|
61
62
|
if (currentOptions.refreshTokensIfNecessary === void 0) {
|
62
63
|
switch (this.authenticationMode) {
|
63
64
|
case "jwt": {
|
@@ -158,9 +159,11 @@ var Service = class {
|
|
158
159
|
responseObject = {
|
159
160
|
ok: false,
|
160
161
|
data: await response?.json(),
|
161
|
-
statusText: response?.statusText ?? "
|
162
|
+
statusText: response?.statusText ?? "",
|
162
163
|
status: response?.status ?? 0
|
163
164
|
};
|
165
|
+
console.log("refreshTokensIfNecessary", options.refreshTokensIfNecessary);
|
166
|
+
console.log("responseObject.status", responseObject.status);
|
164
167
|
if (responseObject.status === 403 && options.refreshTokensIfNecessary === true) {
|
165
168
|
console.log("refreshing tokens...");
|
166
169
|
const oldRefreshToken = await this.getRefreshToken();
|
@@ -1212,6 +1215,17 @@ var DevicesService = class extends Service {
|
|
1212
1215
|
DeviceCommandExecuteOptions
|
1213
1216
|
);
|
1214
1217
|
}
|
1218
|
+
async nodeExecute(DeviceNodeExecuteParams, DeviceNodeExecuteOptions) {
|
1219
|
+
return await super.sendRequest(
|
1220
|
+
{
|
1221
|
+
method: "POST",
|
1222
|
+
url: "devices/" + DeviceNodeExecuteParams.deviceId + "/node/" + DeviceNodeExecuteParams.nodeId,
|
1223
|
+
body: {},
|
1224
|
+
authenticationNotOptional: true
|
1225
|
+
},
|
1226
|
+
DeviceNodeExecuteOptions
|
1227
|
+
);
|
1228
|
+
}
|
1215
1229
|
async delete(DeviceDeleteParams, DeviceDeleteOptions) {
|
1216
1230
|
return await super.sendRequest(
|
1217
1231
|
{
|