@juhuu/sdk-ts 1.2.220 → 1.2.222
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 +49 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +55 -9
- package/dist/index.mjs +55 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -1067,6 +1067,12 @@ declare class FlowsService extends Service {
|
|
1067
1067
|
execute(FlowExecuteParams: JUHUU.Flow.Execute.Params, FlowExecuteOptions?: JUHUU.Flow.Execute.Options): Promise<JUHUU.HttpResponse<JUHUU.Flow.Execute.Response>>;
|
1068
1068
|
}
|
1069
1069
|
|
1070
|
+
declare class FlowTracesService extends Service {
|
1071
|
+
constructor(config: JUHUU.SetupConfig);
|
1072
|
+
list(FlowTraceListParams: JUHUU.FlowTrace.List.Params, FlowTraceListOptions?: JUHUU.FlowTrace.List.Options): Promise<JUHUU.HttpResponse<JUHUU.FlowTrace.List.Response>>;
|
1073
|
+
retrieve(FlowTraceRetrieveParams: JUHUU.FlowTrace.Retrieve.Params, FlowTraceRetrieveOptions?: JUHUU.FlowTrace.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.FlowTrace.Retrieve.Response>>;
|
1074
|
+
}
|
1075
|
+
|
1070
1076
|
declare class MqttTopicsService extends Service {
|
1071
1077
|
constructor(config: JUHUU.SetupConfig);
|
1072
1078
|
create(params: JUHUU.MqttTopic.Create.Params, options?: JUHUU.MqttTopic.Create.Options): Promise<JUHUU.HttpResponse<JUHUU.MqttTopic.Create.Response>>;
|
@@ -1116,6 +1122,7 @@ declare class Juhuu {
|
|
1116
1122
|
readonly parameterAnomalyGroupTrackers: ParameterAnomalyGroupTrackersService;
|
1117
1123
|
readonly emz: EmzService;
|
1118
1124
|
readonly flows: FlowsService;
|
1125
|
+
readonly flowTraces: FlowTracesService;
|
1119
1126
|
readonly mqttTopics: MqttTopicsService;
|
1120
1127
|
}
|
1121
1128
|
declare namespace JUHUU {
|
@@ -3532,6 +3539,9 @@ declare namespace JUHUU {
|
|
3532
3539
|
deviceId?: string;
|
3533
3540
|
name?: string;
|
3534
3541
|
currentValue?: string | boolean | number;
|
3542
|
+
description?: string | null;
|
3543
|
+
enumArray?: string[];
|
3544
|
+
reference?: string | null;
|
3535
3545
|
};
|
3536
3546
|
type Options = JUHUU.RequestOptions;
|
3537
3547
|
type Response = {
|
@@ -3834,6 +3844,45 @@ declare namespace JUHUU {
|
|
3834
3844
|
};
|
3835
3845
|
}
|
3836
3846
|
}
|
3847
|
+
namespace FlowTrace {
|
3848
|
+
type Object = {
|
3849
|
+
id: string;
|
3850
|
+
readonly object: "flowTrace";
|
3851
|
+
startAt: Date;
|
3852
|
+
endAt: Date;
|
3853
|
+
input: Record<string, any>;
|
3854
|
+
output: Record<string, any>;
|
3855
|
+
flowId: string;
|
3856
|
+
propertyId: string;
|
3857
|
+
logArray: string[];
|
3858
|
+
error: string | null;
|
3859
|
+
successful: boolean;
|
3860
|
+
};
|
3861
|
+
namespace Retrieve {
|
3862
|
+
type Params = {
|
3863
|
+
flowTraceId: string;
|
3864
|
+
};
|
3865
|
+
type Options = JUHUU.RequestOptions;
|
3866
|
+
type Response = {
|
3867
|
+
flowTrace: JUHUU.FlowTrace.Object;
|
3868
|
+
};
|
3869
|
+
}
|
3870
|
+
namespace List {
|
3871
|
+
type Params = {
|
3872
|
+
propertyId?: string;
|
3873
|
+
flowId?: string;
|
3874
|
+
};
|
3875
|
+
type Options = {
|
3876
|
+
skip?: number;
|
3877
|
+
limit?: number;
|
3878
|
+
} & JUHUU.RequestOptions;
|
3879
|
+
type Response = {
|
3880
|
+
flowTraceArray: JUHUU.FlowTrace.Object[];
|
3881
|
+
count: number;
|
3882
|
+
hasMore: boolean;
|
3883
|
+
};
|
3884
|
+
}
|
3885
|
+
}
|
3837
3886
|
namespace DeviceTemplate {
|
3838
3887
|
type Object = {
|
3839
3888
|
id: string;
|
package/dist/index.d.ts
CHANGED
@@ -1067,6 +1067,12 @@ declare class FlowsService extends Service {
|
|
1067
1067
|
execute(FlowExecuteParams: JUHUU.Flow.Execute.Params, FlowExecuteOptions?: JUHUU.Flow.Execute.Options): Promise<JUHUU.HttpResponse<JUHUU.Flow.Execute.Response>>;
|
1068
1068
|
}
|
1069
1069
|
|
1070
|
+
declare class FlowTracesService extends Service {
|
1071
|
+
constructor(config: JUHUU.SetupConfig);
|
1072
|
+
list(FlowTraceListParams: JUHUU.FlowTrace.List.Params, FlowTraceListOptions?: JUHUU.FlowTrace.List.Options): Promise<JUHUU.HttpResponse<JUHUU.FlowTrace.List.Response>>;
|
1073
|
+
retrieve(FlowTraceRetrieveParams: JUHUU.FlowTrace.Retrieve.Params, FlowTraceRetrieveOptions?: JUHUU.FlowTrace.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.FlowTrace.Retrieve.Response>>;
|
1074
|
+
}
|
1075
|
+
|
1070
1076
|
declare class MqttTopicsService extends Service {
|
1071
1077
|
constructor(config: JUHUU.SetupConfig);
|
1072
1078
|
create(params: JUHUU.MqttTopic.Create.Params, options?: JUHUU.MqttTopic.Create.Options): Promise<JUHUU.HttpResponse<JUHUU.MqttTopic.Create.Response>>;
|
@@ -1116,6 +1122,7 @@ declare class Juhuu {
|
|
1116
1122
|
readonly parameterAnomalyGroupTrackers: ParameterAnomalyGroupTrackersService;
|
1117
1123
|
readonly emz: EmzService;
|
1118
1124
|
readonly flows: FlowsService;
|
1125
|
+
readonly flowTraces: FlowTracesService;
|
1119
1126
|
readonly mqttTopics: MqttTopicsService;
|
1120
1127
|
}
|
1121
1128
|
declare namespace JUHUU {
|
@@ -3532,6 +3539,9 @@ declare namespace JUHUU {
|
|
3532
3539
|
deviceId?: string;
|
3533
3540
|
name?: string;
|
3534
3541
|
currentValue?: string | boolean | number;
|
3542
|
+
description?: string | null;
|
3543
|
+
enumArray?: string[];
|
3544
|
+
reference?: string | null;
|
3535
3545
|
};
|
3536
3546
|
type Options = JUHUU.RequestOptions;
|
3537
3547
|
type Response = {
|
@@ -3834,6 +3844,45 @@ declare namespace JUHUU {
|
|
3834
3844
|
};
|
3835
3845
|
}
|
3836
3846
|
}
|
3847
|
+
namespace FlowTrace {
|
3848
|
+
type Object = {
|
3849
|
+
id: string;
|
3850
|
+
readonly object: "flowTrace";
|
3851
|
+
startAt: Date;
|
3852
|
+
endAt: Date;
|
3853
|
+
input: Record<string, any>;
|
3854
|
+
output: Record<string, any>;
|
3855
|
+
flowId: string;
|
3856
|
+
propertyId: string;
|
3857
|
+
logArray: string[];
|
3858
|
+
error: string | null;
|
3859
|
+
successful: boolean;
|
3860
|
+
};
|
3861
|
+
namespace Retrieve {
|
3862
|
+
type Params = {
|
3863
|
+
flowTraceId: string;
|
3864
|
+
};
|
3865
|
+
type Options = JUHUU.RequestOptions;
|
3866
|
+
type Response = {
|
3867
|
+
flowTrace: JUHUU.FlowTrace.Object;
|
3868
|
+
};
|
3869
|
+
}
|
3870
|
+
namespace List {
|
3871
|
+
type Params = {
|
3872
|
+
propertyId?: string;
|
3873
|
+
flowId?: string;
|
3874
|
+
};
|
3875
|
+
type Options = {
|
3876
|
+
skip?: number;
|
3877
|
+
limit?: number;
|
3878
|
+
} & JUHUU.RequestOptions;
|
3879
|
+
type Response = {
|
3880
|
+
flowTraceArray: JUHUU.FlowTrace.Object[];
|
3881
|
+
count: number;
|
3882
|
+
hasMore: boolean;
|
3883
|
+
};
|
3884
|
+
}
|
3885
|
+
}
|
3837
3886
|
namespace DeviceTemplate {
|
3838
3887
|
type Object = {
|
3839
3888
|
id: string;
|
package/dist/index.js
CHANGED
@@ -1677,20 +1677,21 @@ var TariffsService = class extends Service {
|
|
1677
1677
|
if (this.isFree(tariff) === true) {
|
1678
1678
|
return 0;
|
1679
1679
|
}
|
1680
|
-
if (tariff.interval === 0) {
|
1681
|
-
return tariff.amount[0];
|
1682
|
-
}
|
1683
1680
|
if (rentTimeSeconds > tariff.duration) {
|
1684
1681
|
console.warn("rentTimeS is greater than duration");
|
1685
1682
|
rentTimeSeconds = tariff.duration;
|
1686
1683
|
}
|
1687
1684
|
let sum = 0;
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1685
|
+
if (tariff.interval === 0) {
|
1686
|
+
sum = tariff.amount[0];
|
1687
|
+
} else {
|
1688
|
+
const startedIntervals = Math.ceil(rentTimeSeconds / tariff.interval);
|
1689
|
+
for (let i = 0; i < startedIntervals; i += 1) {
|
1690
|
+
if (i < tariff.amount.length) {
|
1691
|
+
sum += tariff.amount[i];
|
1692
|
+
} else {
|
1693
|
+
sum += tariff.continue;
|
1694
|
+
}
|
1694
1695
|
}
|
1695
1696
|
}
|
1696
1697
|
let serviceFee = Math.round(sum * tariff.serviceFeePercentage / 100);
|
@@ -2958,6 +2959,7 @@ var ParametersService = class extends Service {
|
|
2958
2959
|
body: {
|
2959
2960
|
name: ParameterUpdateParams.name,
|
2960
2961
|
currentValue: ParameterUpdateParams.currentValue,
|
2962
|
+
enumArray: ParameterUpdateParams.enumArray,
|
2961
2963
|
deviceId: ParameterUpdateParams.deviceId
|
2962
2964
|
},
|
2963
2965
|
authenticationNotOptional: true
|
@@ -3461,6 +3463,48 @@ var FlowsService = class extends Service {
|
|
3461
3463
|
}
|
3462
3464
|
};
|
3463
3465
|
|
3466
|
+
// src/flowTraces/flowTraces.service.ts
|
3467
|
+
var FlowTracesService = class extends Service {
|
3468
|
+
constructor(config) {
|
3469
|
+
super(config);
|
3470
|
+
}
|
3471
|
+
async list(FlowTraceListParams, FlowTraceListOptions) {
|
3472
|
+
const queryArray = [];
|
3473
|
+
if (FlowTraceListParams?.propertyId !== void 0) {
|
3474
|
+
queryArray.push("propertyId=" + FlowTraceListParams.propertyId);
|
3475
|
+
}
|
3476
|
+
if (FlowTraceListParams?.flowId !== void 0) {
|
3477
|
+
queryArray.push("flowId=" + FlowTraceListParams.flowId);
|
3478
|
+
}
|
3479
|
+
if (FlowTraceListOptions?.limit !== void 0) {
|
3480
|
+
queryArray.push("limit=" + FlowTraceListOptions.limit);
|
3481
|
+
}
|
3482
|
+
if (FlowTraceListOptions?.skip !== void 0) {
|
3483
|
+
queryArray.push("skip=" + FlowTraceListOptions.skip);
|
3484
|
+
}
|
3485
|
+
return await super.sendRequest(
|
3486
|
+
{
|
3487
|
+
method: "GET",
|
3488
|
+
url: "flowTraces?" + queryArray.join("&"),
|
3489
|
+
body: void 0,
|
3490
|
+
authenticationNotOptional: false
|
3491
|
+
},
|
3492
|
+
FlowTraceListOptions
|
3493
|
+
);
|
3494
|
+
}
|
3495
|
+
async retrieve(FlowTraceRetrieveParams, FlowTraceRetrieveOptions) {
|
3496
|
+
return await super.sendRequest(
|
3497
|
+
{
|
3498
|
+
method: "GET",
|
3499
|
+
url: "flowTraces/" + FlowTraceRetrieveParams.flowTraceId,
|
3500
|
+
body: void 0,
|
3501
|
+
authenticationNotOptional: false
|
3502
|
+
},
|
3503
|
+
FlowTraceRetrieveOptions
|
3504
|
+
);
|
3505
|
+
}
|
3506
|
+
};
|
3507
|
+
|
3464
3508
|
// src/mqttTopics/mqttTopics.service.ts
|
3465
3509
|
var MqttTopicsService = class extends Service {
|
3466
3510
|
constructor(config) {
|
@@ -3739,6 +3783,7 @@ var Juhuu = class {
|
|
3739
3783
|
this.parameterAnomalyGroupTrackers = new ParameterAnomalyGroupTrackersService(config);
|
3740
3784
|
this.emz = new EmzService(config);
|
3741
3785
|
this.flows = new FlowsService(config);
|
3786
|
+
this.flowTraces = new FlowTracesService(config);
|
3742
3787
|
this.mqttTopics = new MqttTopicsService(config);
|
3743
3788
|
}
|
3744
3789
|
/**
|
@@ -3778,6 +3823,7 @@ var Juhuu = class {
|
|
3778
3823
|
parameterAnomalyGroupTrackers;
|
3779
3824
|
emz;
|
3780
3825
|
flows;
|
3826
|
+
flowTraces;
|
3781
3827
|
mqttTopics;
|
3782
3828
|
};
|
3783
3829
|
var JUHUU;
|
package/dist/index.mjs
CHANGED
@@ -1633,20 +1633,21 @@ var TariffsService = class extends Service {
|
|
1633
1633
|
if (this.isFree(tariff) === true) {
|
1634
1634
|
return 0;
|
1635
1635
|
}
|
1636
|
-
if (tariff.interval === 0) {
|
1637
|
-
return tariff.amount[0];
|
1638
|
-
}
|
1639
1636
|
if (rentTimeSeconds > tariff.duration) {
|
1640
1637
|
console.warn("rentTimeS is greater than duration");
|
1641
1638
|
rentTimeSeconds = tariff.duration;
|
1642
1639
|
}
|
1643
1640
|
let sum = 0;
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1641
|
+
if (tariff.interval === 0) {
|
1642
|
+
sum = tariff.amount[0];
|
1643
|
+
} else {
|
1644
|
+
const startedIntervals = Math.ceil(rentTimeSeconds / tariff.interval);
|
1645
|
+
for (let i = 0; i < startedIntervals; i += 1) {
|
1646
|
+
if (i < tariff.amount.length) {
|
1647
|
+
sum += tariff.amount[i];
|
1648
|
+
} else {
|
1649
|
+
sum += tariff.continue;
|
1650
|
+
}
|
1650
1651
|
}
|
1651
1652
|
}
|
1652
1653
|
let serviceFee = Math.round(sum * tariff.serviceFeePercentage / 100);
|
@@ -2914,6 +2915,7 @@ var ParametersService = class extends Service {
|
|
2914
2915
|
body: {
|
2915
2916
|
name: ParameterUpdateParams.name,
|
2916
2917
|
currentValue: ParameterUpdateParams.currentValue,
|
2918
|
+
enumArray: ParameterUpdateParams.enumArray,
|
2917
2919
|
deviceId: ParameterUpdateParams.deviceId
|
2918
2920
|
},
|
2919
2921
|
authenticationNotOptional: true
|
@@ -3417,6 +3419,48 @@ var FlowsService = class extends Service {
|
|
3417
3419
|
}
|
3418
3420
|
};
|
3419
3421
|
|
3422
|
+
// src/flowTraces/flowTraces.service.ts
|
3423
|
+
var FlowTracesService = class extends Service {
|
3424
|
+
constructor(config) {
|
3425
|
+
super(config);
|
3426
|
+
}
|
3427
|
+
async list(FlowTraceListParams, FlowTraceListOptions) {
|
3428
|
+
const queryArray = [];
|
3429
|
+
if (FlowTraceListParams?.propertyId !== void 0) {
|
3430
|
+
queryArray.push("propertyId=" + FlowTraceListParams.propertyId);
|
3431
|
+
}
|
3432
|
+
if (FlowTraceListParams?.flowId !== void 0) {
|
3433
|
+
queryArray.push("flowId=" + FlowTraceListParams.flowId);
|
3434
|
+
}
|
3435
|
+
if (FlowTraceListOptions?.limit !== void 0) {
|
3436
|
+
queryArray.push("limit=" + FlowTraceListOptions.limit);
|
3437
|
+
}
|
3438
|
+
if (FlowTraceListOptions?.skip !== void 0) {
|
3439
|
+
queryArray.push("skip=" + FlowTraceListOptions.skip);
|
3440
|
+
}
|
3441
|
+
return await super.sendRequest(
|
3442
|
+
{
|
3443
|
+
method: "GET",
|
3444
|
+
url: "flowTraces?" + queryArray.join("&"),
|
3445
|
+
body: void 0,
|
3446
|
+
authenticationNotOptional: false
|
3447
|
+
},
|
3448
|
+
FlowTraceListOptions
|
3449
|
+
);
|
3450
|
+
}
|
3451
|
+
async retrieve(FlowTraceRetrieveParams, FlowTraceRetrieveOptions) {
|
3452
|
+
return await super.sendRequest(
|
3453
|
+
{
|
3454
|
+
method: "GET",
|
3455
|
+
url: "flowTraces/" + FlowTraceRetrieveParams.flowTraceId,
|
3456
|
+
body: void 0,
|
3457
|
+
authenticationNotOptional: false
|
3458
|
+
},
|
3459
|
+
FlowTraceRetrieveOptions
|
3460
|
+
);
|
3461
|
+
}
|
3462
|
+
};
|
3463
|
+
|
3420
3464
|
// src/mqttTopics/mqttTopics.service.ts
|
3421
3465
|
var MqttTopicsService = class extends Service {
|
3422
3466
|
constructor(config) {
|
@@ -3695,6 +3739,7 @@ var Juhuu = class {
|
|
3695
3739
|
this.parameterAnomalyGroupTrackers = new ParameterAnomalyGroupTrackersService(config);
|
3696
3740
|
this.emz = new EmzService(config);
|
3697
3741
|
this.flows = new FlowsService(config);
|
3742
|
+
this.flowTraces = new FlowTracesService(config);
|
3698
3743
|
this.mqttTopics = new MqttTopicsService(config);
|
3699
3744
|
}
|
3700
3745
|
/**
|
@@ -3734,6 +3779,7 @@ var Juhuu = class {
|
|
3734
3779
|
parameterAnomalyGroupTrackers;
|
3735
3780
|
emz;
|
3736
3781
|
flows;
|
3782
|
+
flowTraces;
|
3737
3783
|
mqttTopics;
|
3738
3784
|
};
|
3739
3785
|
var JUHUU;
|