@juhuu/sdk-ts 1.2.2656 → 1.3.1

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.mjs CHANGED
@@ -93,7 +93,7 @@ var Service = class {
93
93
  }
94
94
  this.logger("accessToken:", token);
95
95
  if ((token === null || token === void 0) && authenticationNotOptional === true) {
96
- console.error(
96
+ this.logger(
97
97
  "endpoint",
98
98
  url,
99
99
  "should use authentication but no token was found"
@@ -112,7 +112,7 @@ var Service = class {
112
112
  apiKey = currentRequestOptions.apiKey;
113
113
  }
114
114
  if (apiKey === null) {
115
- console.error(
115
+ this.logger(
116
116
  "endpoint",
117
117
  url,
118
118
  "should use authentication but no apiKey was found"
@@ -165,7 +165,7 @@ var Service = class {
165
165
  status: response.status
166
166
  };
167
167
  } catch (error) {
168
- console.error("JUHUU SDK, error sending request: ", error);
168
+ this.logger("JUHUU SDK, error sending request: ", error);
169
169
  responseObject = {
170
170
  ok: false,
171
171
  data: await response?.json(),
@@ -332,12 +332,6 @@ var Service = class {
332
332
  const uri = this.wssBaseUrl + url;
333
333
  this.logger("connecting to websocket", uri);
334
334
  const socket = io(uri, { transports: ["websocket"] });
335
- socket.on("connect", () => {
336
- this.logger("connected to websocket", uri);
337
- });
338
- socket.on("connect_error", (error) => {
339
- console.error("Connection error:", error);
340
- });
341
335
  return socket;
342
336
  }
343
337
  disconnectFromWebsocket(socket) {
@@ -492,7 +486,10 @@ var SessionService = class extends Service {
492
486
  autoRenew: SessionCreateParams.autoRenew,
493
487
  type: SessionCreateParams.sessionType,
494
488
  isOffSession: SessionCreateParams.isOffSession,
495
- userId: SessionCreateParams.userId
489
+ userId: SessionCreateParams.userId,
490
+ propertyId: SessionCreateParams.propertyId,
491
+ scheduledReadyAt: SessionCreateParams.scheduledReadyAt,
492
+ metadata: SessionCreateParams.metadata
496
493
  },
497
494
  authenticationNotOptional: true
498
495
  },
@@ -671,6 +668,21 @@ var SessionService = class extends Service {
671
668
  }
672
669
  };
673
670
  }
671
+ async checkAvailability(SessionCheckAvailabilityParams, SessionCheckAvailabilityOptions) {
672
+ return await super.sendRequest(
673
+ {
674
+ method: "POST",
675
+ url: "sessions/checkAvailability",
676
+ body: {
677
+ locationId: SessionCheckAvailabilityParams.locationId,
678
+ tariffId: SessionCheckAvailabilityParams.tariffId,
679
+ autoRenew: SessionCheckAvailabilityParams.autoRenew
680
+ },
681
+ authenticationNotOptional: false
682
+ },
683
+ SessionCheckAvailabilityOptions
684
+ );
685
+ }
674
686
  };
675
687
 
676
688
  // src/links/links.service.ts
@@ -701,7 +713,9 @@ var LinkService = class extends Service {
701
713
  body: {
702
714
  propertyId: LinkCreateParams.propertyId,
703
715
  name: LinkCreateParams.name,
704
- fiveLetterQr: LinkCreateParams.fiveLetterQr
716
+ fiveLetterQr: LinkCreateParams.fiveLetterQr,
717
+ referenceObject: LinkCreateParams.referenceObject,
718
+ referenceObjectId: LinkCreateParams.referenceObjectId
705
719
  },
706
720
  authenticationNotOptional: true
707
721
  },
@@ -747,7 +761,9 @@ var LinkService = class extends Service {
747
761
  method: "PATCH",
748
762
  url: "links/" + LinkUpdateParams.linkId,
749
763
  body: {
750
- name: LinkUpdateParams.name
764
+ name: LinkUpdateParams.name,
765
+ referenceObject: LinkUpdateParams.referenceObject,
766
+ referenceObjectId: LinkUpdateParams.referenceObjectId
751
767
  },
752
768
  authenticationNotOptional: true
753
769
  },
@@ -900,7 +916,8 @@ var UsersService = class extends Service {
900
916
  billingAddress: UserUpdateParams?.billingAddress,
901
917
  taxCodeArray: UserUpdateParams?.taxCodeArray,
902
918
  acceptedTermIdArray: UserUpdateParams?.acceptedTermIdArray,
903
- group: UserUpdateParams?.group
919
+ group: UserUpdateParams?.group,
920
+ expoPushTokenArray: UserUpdateParams?.expoPushTokenArray
904
921
  },
905
922
  authenticationNotOptional: true
906
923
  },
@@ -943,6 +960,19 @@ var UsersService = class extends Service {
943
960
  UserDeleteOptions
944
961
  );
945
962
  }
963
+ async createIdentityVerificationUrl(UserCreateIdentityVerificationUrlParams, UserCreateIdentityVerificationUrlOptions) {
964
+ return await super.sendRequest(
965
+ {
966
+ method: "POST",
967
+ url: "users/" + UserCreateIdentityVerificationUrlParams.userId + "/createIdentityVerificationUrl",
968
+ body: {
969
+ propertyId: UserCreateIdentityVerificationUrlParams.propertyId
970
+ },
971
+ authenticationNotOptional: true
972
+ },
973
+ UserCreateIdentityVerificationUrlOptions
974
+ );
975
+ }
946
976
  };
947
977
 
948
978
  // src/payments/payments.service.ts
@@ -950,6 +980,26 @@ var PaymentsService = class extends Service {
950
980
  constructor(config) {
951
981
  super(config);
952
982
  }
983
+ async create(PaymentCreateParams, PaymentCreateOptions) {
984
+ return await super.sendRequest(
985
+ {
986
+ method: "POST",
987
+ url: "payments",
988
+ body: {
989
+ accountingAreaId: PaymentCreateParams.accountingAreaId,
990
+ amountWithoutServiceFee: PaymentCreateParams.amountWithoutServiceFee,
991
+ currencyCode: PaymentCreateParams.currencyCode,
992
+ propertyId: PaymentCreateParams.propertyId,
993
+ isOffSession: PaymentCreateParams.isOffSession,
994
+ salesTaxPercentage: PaymentCreateParams.salesTaxPercentage,
995
+ userId: PaymentCreateParams.userId,
996
+ postingRowArray: PaymentCreateParams.postingRowArray
997
+ },
998
+ authenticationNotOptional: true
999
+ },
1000
+ PaymentCreateOptions
1001
+ );
1002
+ }
953
1003
  async list(PaymentListParams, PaymentListOptions) {
954
1004
  const queryArray = [];
955
1005
  if (PaymentListParams.userId !== void 0) {
@@ -1075,8 +1125,7 @@ var PropertiesService = class extends Service {
1075
1125
  url: "properties",
1076
1126
  body: {
1077
1127
  userId: PropertyCreateParams.userId,
1078
- name: PropertyCreateParams.name,
1079
- type: PropertyCreateParams.type
1128
+ name: PropertyCreateParams.name
1080
1129
  },
1081
1130
  authenticationNotOptional: true
1082
1131
  },
@@ -1250,6 +1299,13 @@ var PointsService = class extends Service {
1250
1299
  if (PointListParams?.propertyId !== void 0) {
1251
1300
  queryArray.push("propertyId=" + PointListParams.propertyId);
1252
1301
  }
1302
+ if (PointListParams?.invalidAt !== void 0) {
1303
+ if (PointListParams.invalidAt === null) {
1304
+ queryArray.push("invalidAt=");
1305
+ } else {
1306
+ queryArray.push("invalidAt=" + PointListParams.invalidAt.toISOString());
1307
+ }
1308
+ }
1253
1309
  return await super.sendRequest(
1254
1310
  {
1255
1311
  method: "GET",
@@ -1305,7 +1361,8 @@ var DevicesService = class extends Service {
1305
1361
  propertyId: DeviceCreateParams.propertyId,
1306
1362
  deviceTemplateId: DeviceCreateParams.deviceTemplateId,
1307
1363
  name: DeviceCreateParams.name,
1308
- acceptTerms: DeviceCreateParams.acceptTerms
1364
+ acceptTerms: DeviceCreateParams.acceptTerms,
1365
+ panelId: DeviceCreateParams.panelId
1309
1366
  },
1310
1367
  authenticationNotOptional: true
1311
1368
  },
@@ -1373,7 +1430,9 @@ var DevicesService = class extends Service {
1373
1430
  parameterIdArray: DeviceUpdateParams.parameterIdArray,
1374
1431
  permissionArray: DeviceUpdateParams.permissionArray,
1375
1432
  proximityStrategyArray: DeviceUpdateParams.proximityStrategyArray,
1376
- simIdArray: DeviceUpdateParams.simIdArray
1433
+ simIdArray: DeviceUpdateParams.simIdArray,
1434
+ panelId: DeviceUpdateParams.panelId,
1435
+ adminQuickActionArray: DeviceUpdateParams.adminQuickActionArray
1377
1436
  },
1378
1437
  authenticationNotOptional: true
1379
1438
  },
@@ -1947,39 +2006,109 @@ var WebsocketsService = class extends Service {
1947
2006
  }
1948
2007
  connect(WebsocketConnectOptions) {
1949
2008
  const socket = super.connectToWebsocket({ url: "websocket" });
1950
- const pendingRpcResponses = /* @__PURE__ */ new Map();
1951
- socket.on("rpc.response", (message) => {
1952
- const resolver = pendingRpcResponses.get(message.id);
1953
- if (resolver !== void 0) {
1954
- resolver(message);
1955
- pendingRpcResponses.delete(message.id);
2009
+ socket.on("connect", () => {
2010
+ this.logger("connected to websocket");
2011
+ });
2012
+ socket.on(
2013
+ "subscription_success",
2014
+ (message) => {
2015
+ this.logger("Subscription success:", message);
2016
+ }
2017
+ );
2018
+ socket.on(
2019
+ "unsubscription_success",
2020
+ (message) => {
2021
+ this.logger("Unsubscription success:", message);
1956
2022
  }
2023
+ );
2024
+ socket.on("error", (error) => {
2025
+ this.logger("WebSocket error:", error);
1957
2026
  });
1958
- const onQueryUpdate = (callback) => {
1959
- socket.on("query.update", (message) => {
2027
+ const onLocationUpdate = (callback) => {
2028
+ socket.on(
2029
+ "location_update",
2030
+ (message) => {
2031
+ callback(message);
2032
+ }
2033
+ );
2034
+ };
2035
+ const onParameterUpdate = (callback) => {
2036
+ socket.on(
2037
+ "parameter_update",
2038
+ (message) => {
2039
+ callback(message);
2040
+ }
2041
+ );
2042
+ };
2043
+ const onSessionUpdate = (callback) => {
2044
+ socket.on("session_update", (message) => {
1960
2045
  callback(message);
1961
2046
  });
1962
2047
  };
2048
+ const onConnect = (callback) => {
2049
+ socket.on("connect", callback);
2050
+ };
2051
+ const onDisconnect = (callback) => {
2052
+ socket.on("disconnect", callback);
2053
+ };
2054
+ const onReconnect = (callback) => {
2055
+ socket.on("reconnect", callback);
2056
+ };
2057
+ const onConnectError = (callback) => {
2058
+ socket.on("connect_error", callback);
2059
+ };
2060
+ const onReconnectAttempt = (callback) => {
2061
+ socket.on("reconnect_attempt", callback);
2062
+ };
2063
+ const onReconnectError = (callback) => {
2064
+ socket.on("reconnect_error", callback);
2065
+ };
2066
+ const onReconnectFailed = (callback) => {
2067
+ socket.on("reconnect_failed", callback);
2068
+ };
1963
2069
  return {
1964
- subscribe: (rooms) => {
1965
- socket.emit("subscribe", { rooms });
2070
+ subscribe: (locationIdArray, parameterIdArray, sessionIdArray) => {
2071
+ socket.emit("subscribe", {
2072
+ locationIdArray: locationIdArray || [],
2073
+ parameterIdArray: parameterIdArray || [],
2074
+ sessionIdArray: sessionIdArray || []
2075
+ });
1966
2076
  },
1967
- unsubscribe: (rooms) => {
1968
- socket.emit("unsubscribe", { rooms });
2077
+ unsubscribeFromLocations: (locationIdArray) => {
2078
+ socket.emit("unsubscribe", { locationIdArray });
1969
2079
  },
1970
- subscribeQuery: (payload) => {
1971
- socket.emit("subscribeQuery", payload);
2080
+ unsubscribeFromParameters: (parameterIdArray) => {
2081
+ socket.emit("unsubscribe", { parameterIdArray });
1972
2082
  },
1973
- unsubscribeQuery: (payload) => {
1974
- socket.emit("unsubscribeQuery", payload);
2083
+ unsubscribeFromSessions: (sessionIdArray) => {
2084
+ socket.emit("unsubscribe", { sessionIdArray });
1975
2085
  },
1976
- rpc: async (payload) => {
1977
- return await new Promise((resolve) => {
1978
- pendingRpcResponses.set(payload.id, resolve);
1979
- socket.emit("rpc", payload);
2086
+ unsubscribe: (locationIdArray, parameterIdArray, sessionIdArray) => {
2087
+ socket.emit("unsubscribe", {
2088
+ locationIdArray: locationIdArray || [],
2089
+ parameterIdArray: parameterIdArray || [],
2090
+ sessionIdArray: sessionIdArray || []
1980
2091
  });
1981
2092
  },
1982
- onQueryUpdate,
2093
+ ping: (data) => {
2094
+ socket.emit("ping", data);
2095
+ },
2096
+ onLocationUpdate,
2097
+ onParameterUpdate,
2098
+ onSessionUpdate,
2099
+ onConnect,
2100
+ onDisconnect,
2101
+ onReconnect,
2102
+ onConnectError,
2103
+ onReconnectAttempt,
2104
+ onReconnectError,
2105
+ onReconnectFailed,
2106
+ onPong: (callback) => {
2107
+ socket.on("pong", callback);
2108
+ },
2109
+ isConnected: () => {
2110
+ return socket.connected;
2111
+ },
1983
2112
  close: () => {
1984
2113
  socket.close();
1985
2114
  }
@@ -2447,6 +2576,19 @@ var ArticlesService = class extends Service {
2447
2576
  ArticleTranslateOptions
2448
2577
  );
2449
2578
  }
2579
+ async pdf(ArticlePdfParams, ArticlePdfOptions) {
2580
+ return await super.sendRequest(
2581
+ {
2582
+ method: "POST",
2583
+ url: "articles/" + ArticlePdfParams.articleId + "/pdf",
2584
+ body: {
2585
+ languageCodeArray: ArticlePdfParams.languageCodeArray
2586
+ },
2587
+ authenticationNotOptional: false
2588
+ },
2589
+ ArticlePdfOptions
2590
+ );
2591
+ }
2450
2592
  };
2451
2593
 
2452
2594
  // src/chats/chats.service.ts
@@ -3228,6 +3370,8 @@ var IncidentsService = class extends Service {
3228
3370
  type: IncidentCreateParams.type,
3229
3371
  deviceId: IncidentCreateParams.deviceId,
3230
3372
  locationId: IncidentCreateParams.locationId,
3373
+ parameterAnomalyGroupId: IncidentCreateParams.parameterAnomalyGroupId,
3374
+ simId: IncidentCreateParams.simId,
3231
3375
  incidentTemplateId: IncidentCreateParams.incidentTemplateId,
3232
3376
  severity: IncidentCreateParams.severity
3233
3377
  },
@@ -3292,6 +3436,19 @@ var IncidentsService = class extends Service {
3292
3436
  IncidentUpdateOptions
3293
3437
  );
3294
3438
  }
3439
+ async notifyAffected(IncidentNotifyAffectedParams, IncidentNotifyAffectedOptions) {
3440
+ return await super.sendRequest(
3441
+ {
3442
+ method: "POST",
3443
+ url: "incidents/" + IncidentNotifyAffectedParams.incidentId + "/notifyAffected",
3444
+ body: {
3445
+ message: IncidentNotifyAffectedParams.message
3446
+ },
3447
+ authenticationNotOptional: true
3448
+ },
3449
+ IncidentNotifyAffectedOptions
3450
+ );
3451
+ }
3295
3452
  };
3296
3453
 
3297
3454
  // src/parameterAnomalyGroups/parameterAnomalyGroups.service.ts
@@ -3366,7 +3523,9 @@ var ParameterAnomalyGroupsService = class extends Service {
3366
3523
  method: "PATCH",
3367
3524
  url: "parameterAnomalyGroups/" + ParameterAnomalyGroupUpdateParams.parameterAnomalyGroupId,
3368
3525
  body: {
3369
- parameterAnomalyGroupId: ParameterAnomalyGroupUpdateParams.parameterAnomalyGroupId
3526
+ parameterAnomalyGroupTrackerId: ParameterAnomalyGroupUpdateParams.parameterAnomalyGroupTrackerId,
3527
+ name: ParameterAnomalyGroupUpdateParams.name,
3528
+ featureReferenceParameterIdArray: ParameterAnomalyGroupUpdateParams.featureReferenceParameterIdArray
3370
3529
  },
3371
3530
  authenticationNotOptional: true
3372
3531
  },
@@ -3397,7 +3556,8 @@ var ParameterAnomalyGroupTrackersService = class extends Service {
3397
3556
  method: "POST",
3398
3557
  url: "parameterAnomalyGroupTrackers",
3399
3558
  body: {
3400
- propertyId: ParameterAnomalyGroupTrackerCreateParams.propertyId
3559
+ propertyId: ParameterAnomalyGroupTrackerCreateParams.propertyId,
3560
+ name: ParameterAnomalyGroupTrackerCreateParams.name
3401
3561
  },
3402
3562
  authenticationNotOptional: true
3403
3563
  },
@@ -3450,7 +3610,9 @@ var ParameterAnomalyGroupTrackersService = class extends Service {
3450
3610
  method: "PATCH",
3451
3611
  url: "parameterAnomalyGroupTrackers/" + ParameterAnomalyGroupTrackerUpdateParams.parameterAnomalyGroupTrackerId,
3452
3612
  body: {
3453
- name: ParameterAnomalyGroupTrackerUpdateParams.name
3613
+ name: ParameterAnomalyGroupTrackerUpdateParams.name,
3614
+ description: ParameterAnomalyGroupTrackerUpdateParams.description,
3615
+ dataType: ParameterAnomalyGroupTrackerUpdateParams.dataType
3454
3616
  },
3455
3617
  authenticationNotOptional: true
3456
3618
  },
@@ -3481,6 +3643,59 @@ var ParameterAnomalyGroupTrackersService = class extends Service {
3481
3643
  }
3482
3644
  };
3483
3645
 
3646
+ // src/parameterAnomalyGroupTrackerTraces/parameterAnomalyGroupTrackerTraces.service.ts
3647
+ var ParameterAnomalyGroupTrackerTracesService = class extends Service {
3648
+ constructor(config) {
3649
+ super(config);
3650
+ }
3651
+ async list(ParameterAnomalyGroupTrackerTraceListParams, ParameterAnomalyGroupTrackerTraceListOptions) {
3652
+ const queryArray = [];
3653
+ if (ParameterAnomalyGroupTrackerTraceListParams?.propertyId !== void 0) {
3654
+ queryArray.push("propertyId=" + ParameterAnomalyGroupTrackerTraceListParams.propertyId);
3655
+ }
3656
+ if (ParameterAnomalyGroupTrackerTraceListParams?.parameterAnomalyGroupTrackerId !== void 0) {
3657
+ queryArray.push("parameterAnomalyGroupTrackerId=" + ParameterAnomalyGroupTrackerTraceListParams.parameterAnomalyGroupTrackerId);
3658
+ }
3659
+ if (ParameterAnomalyGroupTrackerTraceListOptions?.limit !== void 0) {
3660
+ queryArray.push("limit=" + ParameterAnomalyGroupTrackerTraceListOptions.limit);
3661
+ }
3662
+ if (ParameterAnomalyGroupTrackerTraceListOptions?.skip !== void 0) {
3663
+ queryArray.push("skip=" + ParameterAnomalyGroupTrackerTraceListOptions.skip);
3664
+ }
3665
+ return await super.sendRequest(
3666
+ {
3667
+ method: "GET",
3668
+ url: "parameterAnomalyGroupTrackerTraces?" + queryArray.join("&"),
3669
+ body: void 0,
3670
+ authenticationNotOptional: false
3671
+ },
3672
+ ParameterAnomalyGroupTrackerTraceListOptions
3673
+ );
3674
+ }
3675
+ async retrieve(ParameterAnomalyGroupTrackerTraceRetrieveParams, ParameterAnomalyGroupTrackerTraceRetrieveOptions) {
3676
+ return await super.sendRequest(
3677
+ {
3678
+ method: "GET",
3679
+ url: "parameterAnomalyGroupTrackerTraces/" + ParameterAnomalyGroupTrackerTraceRetrieveParams.parameterAnomalyGroupTrackerTraceId,
3680
+ body: void 0,
3681
+ authenticationNotOptional: false
3682
+ },
3683
+ ParameterAnomalyGroupTrackerTraceRetrieveOptions
3684
+ );
3685
+ }
3686
+ async delete(ParameterAnomalyGroupTrackerTraceDeleteParams, ParameterAnomalyGroupTrackerTraceDeleteOptions) {
3687
+ return await super.sendRequest(
3688
+ {
3689
+ method: "DELETE",
3690
+ url: "parameterAnomalyGroupTrackerTraces/" + ParameterAnomalyGroupTrackerTraceDeleteParams.parameterAnomalyGroupTrackerTraceId,
3691
+ body: void 0,
3692
+ authenticationNotOptional: false
3693
+ },
3694
+ ParameterAnomalyGroupTrackerTraceDeleteOptions
3695
+ );
3696
+ }
3697
+ };
3698
+
3484
3699
  // src/emz/emz.service.ts
3485
3700
  var EmzService = class extends Service {
3486
3701
  constructor(config) {
@@ -3612,22 +3827,6 @@ var FlowsService = class extends Service {
3612
3827
  FlowExecuteOptions
3613
3828
  );
3614
3829
  }
3615
- areInputsAvailable(block, outputStore, edgeArray) {
3616
- if (block.in === null || block.in === void 0) {
3617
- return true;
3618
- }
3619
- return Object.values(block.in).every((edgeId) => {
3620
- const edge = edgeArray.find((e) => e.id === edgeId);
3621
- if (edge === void 0) {
3622
- return false;
3623
- }
3624
- if (edge.type === "control") {
3625
- return true;
3626
- }
3627
- const srcOutputs = outputStore[edge.from.blockId];
3628
- return srcOutputs !== null && srcOutputs !== void 0 && edge.from.output in srcOutputs;
3629
- });
3630
- }
3631
3830
  resolveInputs(block, outputStore, edgeArray) {
3632
3831
  const inputs = {};
3633
3832
  if (block.in === void 0) {
@@ -3674,9 +3873,7 @@ var FlowsService = class extends Service {
3674
3873
  for (const param of defs) {
3675
3874
  const value = context[param.name];
3676
3875
  if (value === void 0 && param.required) {
3677
- throw new Error(
3678
- `Missing required input parameter '${param.name}'`
3679
- );
3876
+ throw new Error(`Missing required input parameter '${param.name}'`);
3680
3877
  }
3681
3878
  outputs[param.name] = value;
3682
3879
  }
@@ -3709,212 +3906,283 @@ var FlowsService = class extends Service {
3709
3906
  }
3710
3907
  execInput[key] = value;
3711
3908
  }
3712
- const { output } = await this.executeLocally(finalFlowId, execInput);
3713
- return { output };
3909
+ const response = await this.execute({
3910
+ flowId: finalFlowId,
3911
+ input: execInput
3912
+ });
3913
+ if (response.ok === false) {
3914
+ throw new Error(
3915
+ `Failed to execute flow: ${response.data?.message || "Unknown error"}`
3916
+ );
3917
+ }
3918
+ return { output: response.data.output };
3714
3919
  },
3715
3920
  "end.custom": async (inputs) => {
3716
3921
  return { output: { ...inputs } };
3717
3922
  },
3718
- // Placeholder implementations for other block types (they will throw errors if used)
3719
- "start.quickAction.location": async () => {
3720
- throw new Error("Block type not implemented in executeLocally");
3721
- },
3722
- "start.session.update": async () => {
3723
- throw new Error("Block type not implemented in executeLocally");
3724
- },
3725
- "start.location.update": async () => {
3726
- throw new Error("Block type not implemented in executeLocally");
3727
- },
3728
- "start.parameter.update": async () => {
3729
- throw new Error("Block type not implemented in executeLocally");
3730
- },
3731
- "const.number": async () => {
3732
- throw new Error("Block type not implemented in executeLocally");
3733
- },
3734
- "const.text": async () => {
3735
- throw new Error("Block type not implemented in executeLocally");
3736
- },
3737
- "const.boolean": async () => {
3738
- throw new Error("Block type not implemented in executeLocally");
3739
- },
3740
- "math.add": async () => {
3741
- throw new Error("Block type not implemented in executeLocally");
3742
- },
3743
- "math.subtract": async () => {
3744
- throw new Error("Block type not implemented in executeLocally");
3923
+ "const.number": async (_inputs, block) => {
3924
+ const { data } = block;
3925
+ return { output: { value: data?.value } };
3745
3926
  },
3746
- "math.multiply": async () => {
3747
- throw new Error("Block type not implemented in executeLocally");
3927
+ "const.text": async (_inputs, block) => {
3928
+ const { data } = block;
3929
+ return { output: { value: data?.value } };
3748
3930
  },
3749
- "math.divide": async () => {
3750
- throw new Error("Block type not implemented in executeLocally");
3931
+ "const.boolean": async (_inputs, block) => {
3932
+ const { data } = block;
3933
+ return { output: { value: data?.value } };
3751
3934
  },
3752
- "map.destructure": async () => {
3753
- throw new Error("Block type not implemented in executeLocally");
3935
+ "math.add": async (inputs, block) => {
3936
+ const mb = block;
3937
+ const inA = inputs.a;
3938
+ const inB = inputs.b;
3939
+ const defaultA = mb.data.a ?? 0;
3940
+ const defaultB = mb.data.b ?? 0;
3941
+ const a = inA !== void 0 ? inA : defaultA;
3942
+ const b = inB !== void 0 ? inB : defaultB;
3943
+ return { output: { result: a + b } };
3754
3944
  },
3755
- "parameter.retrieve": async () => {
3756
- throw new Error("Block type not implemented in executeLocally");
3945
+ "math.subtract": async (inputs, block) => {
3946
+ const mb = block;
3947
+ const inA = inputs.a;
3948
+ const inB = inputs.b;
3949
+ const defaultA = mb.data.a ?? 0;
3950
+ const defaultB = mb.data.b ?? 0;
3951
+ const a = inA !== void 0 ? inA : defaultA;
3952
+ const b = inB !== void 0 ? inB : defaultB;
3953
+ return { output: { result: a - b } };
3757
3954
  },
3758
- "property.retrieve": async () => {
3759
- throw new Error("Block type not implemented in executeLocally");
3955
+ "math.multiply": async (inputs, block) => {
3956
+ const mb = block;
3957
+ const inA = inputs.a;
3958
+ const inB = inputs.b;
3959
+ const defaultA = mb.data.a ?? 0;
3960
+ const defaultB = mb.data.b ?? 0;
3961
+ const a = inA !== void 0 ? inA : defaultA;
3962
+ const b = inB !== void 0 ? inB : defaultB;
3963
+ return { output: { result: a * b } };
3760
3964
  },
3761
- "location.retrieve": async () => {
3762
- throw new Error("Block type not implemented in executeLocally");
3965
+ "math.divide": async (inputs, block) => {
3966
+ const mb = block;
3967
+ const inA = inputs.a;
3968
+ const inB = inputs.b;
3969
+ const defaultA = mb.data.a ?? 0;
3970
+ const defaultB = mb.data.b ?? 1;
3971
+ const a = inA !== void 0 ? inA : defaultA;
3972
+ const b = inB !== void 0 ? inB : defaultB;
3973
+ return { output: { result: a / b } };
3763
3974
  },
3764
- "session.retrieve": async () => {
3765
- throw new Error("Block type not implemented in executeLocally");
3766
- },
3767
- "device.retrieve": async () => {
3768
- throw new Error("Block type not implemented in executeLocally");
3769
- },
3770
- "user.retrieve": async () => {
3771
- throw new Error("Block type not implemented in executeLocally");
3772
- },
3773
- "user.create": async () => {
3774
- throw new Error("Block type not implemented in executeLocally");
3775
- },
3776
- "incident.retrieve": async () => {
3777
- throw new Error("Block type not implemented in executeLocally");
3778
- },
3779
- "parameter.update": async () => {
3780
- throw new Error("Block type not implemented in executeLocally");
3781
- },
3782
- "device.update": async () => {
3783
- throw new Error("Block type not implemented in executeLocally");
3784
- },
3785
- "location.update": async () => {
3786
- throw new Error("Block type not implemented in executeLocally");
3787
- },
3788
- "property.update": async () => {
3789
- throw new Error("Block type not implemented in executeLocally");
3790
- },
3791
- "session.terminate": async () => {
3792
- throw new Error("Block type not implemented in executeLocally");
3793
- },
3794
- "system.log": async () => {
3795
- throw new Error("Block type not implemented in executeLocally");
3796
- },
3797
- "ui.navigate.screen": async () => {
3798
- throw new Error("Block type not implemented in executeLocally");
3799
- },
3800
- "incident.create": async () => {
3801
- throw new Error("Block type not implemented in executeLocally");
3802
- },
3803
- "control.switch": async () => {
3804
- throw new Error("Block type not implemented in executeLocally");
3805
- },
3806
- "http.patch": async () => {
3807
- throw new Error("Block type not implemented in executeLocally");
3808
- },
3809
- "http.get": async () => {
3810
- throw new Error("Block type not implemented in executeLocally");
3811
- },
3812
- "http.post": async () => {
3813
- throw new Error("Block type not implemented in executeLocally");
3975
+ "map.destructure": async (inputs, block) => {
3976
+ if (block.type !== "map.destructure") {
3977
+ throw new Error(
3978
+ `Expected block type 'map.destructure', got '${block.type}'`
3979
+ );
3980
+ }
3981
+ const source = inputs.map;
3982
+ const mb = block;
3983
+ const outputs = {};
3984
+ const keys = mb.data.keys ?? [];
3985
+ for (const key of keys) {
3986
+ outputs[key] = source[key];
3987
+ }
3988
+ return { output: outputs };
3814
3989
  },
3815
- "http.delete": async () => {
3816
- throw new Error("Block type not implemented in executeLocally");
3990
+ "map.construct": async (inputs, block) => {
3991
+ if (block.type !== "map.construct") {
3992
+ throw new Error(
3993
+ `Expected block type 'map.construct', got '${block.type}'`
3994
+ );
3995
+ }
3996
+ const mb = block;
3997
+ const constructedMap = {};
3998
+ const keys = mb.data.keys ?? [];
3999
+ const inputValues = inputs;
4000
+ for (const key of keys) {
4001
+ constructedMap[key] = inputValues[key];
4002
+ }
4003
+ return { output: { map: constructedMap } };
3817
4004
  },
3818
- "http.put": async () => {
3819
- throw new Error("Block type not implemented in executeLocally");
4005
+ "variable.set": async (inputs, block, context) => {
4006
+ const { key, value } = inputs;
4007
+ const typedBlock = block;
4008
+ const finalKey = this.isInputConnected(typedBlock, "key") ? key : typedBlock.data?.key;
4009
+ const finalValue = this.isInputConnected(typedBlock, "value") ? value : typedBlock.data?.value;
4010
+ if (finalKey === void 0 || finalKey === null) {
4011
+ throw new Error("Variable key is required");
4012
+ }
4013
+ if (!context.variables) {
4014
+ context.variables = /* @__PURE__ */ new Map();
4015
+ }
4016
+ if (finalKey.includes(".")) {
4017
+ const keys = finalKey.split(".");
4018
+ const rootKey = keys[0];
4019
+ let rootValue = context.variables.get(rootKey);
4020
+ if (rootValue === void 0 || rootValue === null) {
4021
+ rootValue = {};
4022
+ context.variables.set(rootKey, rootValue);
4023
+ }
4024
+ const finalPropertyKey = keys[keys.length - 1];
4025
+ const parentKeys = keys.slice(1, -1);
4026
+ let current = rootValue;
4027
+ for (const key2 of parentKeys) {
4028
+ if (current[key2] === void 0 || current[key2] === null) {
4029
+ current[key2] = {};
4030
+ }
4031
+ current = current[key2];
4032
+ }
4033
+ current[finalPropertyKey] = finalValue;
4034
+ } else {
4035
+ context.variables.set(finalKey, finalValue);
4036
+ }
4037
+ return { output: { success: true } };
3820
4038
  },
3821
- "mqtt.send": async () => {
3822
- throw new Error("Block type not implemented in executeLocally");
4039
+ "variable.get": async (inputs, block, context) => {
4040
+ const { key } = inputs;
4041
+ const typedBlock = block;
4042
+ const finalKey = this.isInputConnected(typedBlock, "key") ? key : typedBlock.data?.key;
4043
+ if (finalKey === void 0 || finalKey === null) {
4044
+ throw new Error("Variable key is required");
4045
+ }
4046
+ if (!context.variables) {
4047
+ context.variables = /* @__PURE__ */ new Map();
4048
+ }
4049
+ let retrievedValue;
4050
+ if (finalKey.includes(".")) {
4051
+ const keys = finalKey.split(".");
4052
+ const rootKey = keys[0];
4053
+ const rootValue = context.variables.get(rootKey);
4054
+ if (rootValue !== void 0 && rootValue !== null) {
4055
+ retrievedValue = keys.slice(1).reduce((obj, key2) => {
4056
+ return obj && obj[key2];
4057
+ }, rootValue);
4058
+ } else {
4059
+ retrievedValue = void 0;
4060
+ }
4061
+ } else {
4062
+ retrievedValue = context.variables.get(finalKey);
4063
+ }
4064
+ return { output: { value: retrievedValue } };
3823
4065
  }
3824
4066
  };
3825
- async executeLocally(flowId, context = {}) {
4067
+ async executeLocally(FlowExecuteLocallyParams, FlowExecuteLocallyOptions) {
3826
4068
  const logArray = [];
3827
4069
  logArray.push({
3828
4070
  createdAt: /* @__PURE__ */ new Date(),
3829
- message: `Starting local execution of flow '${flowId}'`,
4071
+ message: `Starting local execution of flow '${FlowExecuteLocallyParams.flowId}'`,
3830
4072
  severity: "info"
3831
4073
  });
3832
- const flowResponse = await this.retrieve({ flowId });
3833
- if (!flowResponse.ok) {
3834
- throw new Error(`Failed to retrieve flow: ${flowResponse.data?.message || "Unknown error"}`);
3835
- }
3836
- const flow = flowResponse.data.flow;
3837
- const blocksById = new Map(
3838
- flow.nodeArray.map((b) => [b.id, b])
3839
- );
3840
- blocksById.set(flow.startNode.id, flow.startNode);
3841
- const edgeArray = flow.edgeArray;
3842
- const outputStore = {};
3843
- const runBlock = async (block) => {
3844
- logArray.push({
3845
- createdAt: /* @__PURE__ */ new Date(),
3846
- message: `Running block ${block.type} (${block.id})`,
3847
- severity: "info"
3848
- });
3849
- const inputs = this.resolveInputs(block, outputStore, edgeArray);
3850
- const executor = this.blockExecutors[block.type];
3851
- if (executor === void 0 || executor === null) {
3852
- throw new Error(`No executor for ${block.type}`);
3853
- }
3854
- const raw = await executor(inputs, block, context);
3855
- const { flowBranch, output } = raw;
3856
- outputStore[block.id] = output;
3857
- if (raw.logArray !== void 0) {
3858
- logArray.push(...raw.logArray);
3859
- }
3860
- logArray.push({
3861
- createdAt: /* @__PURE__ */ new Date(),
3862
- message: `Block ${block.type} (${block.id}) executed successfully`,
3863
- severity: "info"
4074
+ try {
4075
+ const flowResponse = await this.retrieve({
4076
+ flowId: FlowExecuteLocallyParams.flowId
3864
4077
  });
3865
- return flowBranch ?? null;
3866
- };
3867
- const getNext = (fromId, branch) => {
3868
- let ce = edgeArray.find(
3869
- (e) => e.type === "control" && e.from.blockId === fromId && (e.from.output ?? null) === branch
3870
- );
3871
- if ((ce === null || ce === void 0) && branch === null) {
3872
- ce = edgeArray.find(
3873
- (e) => e.type === "control" && e.from.blockId === fromId
4078
+ if (!flowResponse.ok) {
4079
+ throw new Error(
4080
+ `Failed to retrieve flow: ${flowResponse.data?.message || "Unknown error"}`
3874
4081
  );
3875
4082
  }
3876
- if (ce === null || ce === void 0) {
3877
- return null;
3878
- }
3879
- return blocksById.get(ce.to.blockId) ?? null;
3880
- };
3881
- if (flow.startNode.type.startsWith("start.") === false) {
3882
- throw new Error(
3883
- `Flow ${flowId} has an invalid start block that is not of type 'start.'`
4083
+ const flow = flowResponse.data.flow;
4084
+ const blocksById = new Map(
4085
+ flow.nodeArray.map((b) => [b.id, b])
3884
4086
  );
3885
- }
3886
- let current = flow.startNode;
3887
- await runBlock(current);
3888
- const next = getNext(current.id, null);
3889
- if (next === null) {
3890
- return {
3891
- output: {},
3892
- logArray
4087
+ blocksById.set(flow.startNode.id, flow.startNode);
4088
+ const edgeArray = flow.edgeArray;
4089
+ const outputStore = {};
4090
+ const mergedBlockExecutors = {
4091
+ ...this.blockExecutors,
4092
+ ...FlowExecuteLocallyOptions?.blockExecutors || {}
3893
4093
  };
3894
- }
3895
- current = next;
3896
- while (current.type.startsWith("end.") === false) {
3897
- const branch = await runBlock(current);
3898
- const next2 = getNext(current.id, branch);
3899
- if (next2 === null) {
4094
+ const runBlock = async (block) => {
4095
+ logArray.push({
4096
+ createdAt: /* @__PURE__ */ new Date(),
4097
+ message: `Running block ${block.type} (${block.id})`,
4098
+ severity: "info"
4099
+ });
4100
+ const inputs = this.resolveInputs(block, outputStore, edgeArray);
4101
+ const executor = mergedBlockExecutors[block.type];
4102
+ if (executor === void 0 || executor === null) {
4103
+ throw new Error(
4104
+ `Block type '${block.type}' is not implemented in the local executor`
4105
+ );
4106
+ }
4107
+ const raw = await executor(
4108
+ inputs,
4109
+ block,
4110
+ FlowExecuteLocallyParams.input ?? {}
4111
+ );
4112
+ const { flowBranch, output } = raw;
4113
+ outputStore[block.id] = output;
4114
+ if (raw.logArray !== void 0) {
4115
+ logArray.push(...raw.logArray);
4116
+ }
4117
+ logArray.push({
4118
+ createdAt: /* @__PURE__ */ new Date(),
4119
+ message: `Block ${block.type} (${block.id}) executed successfully`,
4120
+ severity: "info"
4121
+ });
4122
+ return flowBranch ?? null;
4123
+ };
4124
+ const getNext = (fromId, branch) => {
4125
+ let ce = edgeArray.find(
4126
+ (e) => e.type === "control" && e.from.blockId === fromId && (e.from.output ?? null) === branch
4127
+ );
4128
+ if ((ce === null || ce === void 0) && branch === null) {
4129
+ ce = edgeArray.find(
4130
+ (e) => e.type === "control" && e.from.blockId === fromId
4131
+ );
4132
+ }
4133
+ if (ce === null || ce === void 0) {
4134
+ return null;
4135
+ }
4136
+ return blocksById.get(ce.to.blockId) ?? null;
4137
+ };
4138
+ if (flow.startNode.type.startsWith("start.") === false) {
4139
+ throw new Error(
4140
+ `Flow ${FlowExecuteLocallyParams.flowId} has an invalid start block that is not of type 'start.'`
4141
+ );
4142
+ }
4143
+ let current = flow.startNode;
4144
+ await runBlock(current);
4145
+ const next = getNext(current.id, null);
4146
+ if (next === null) {
3900
4147
  return {
3901
4148
  output: {},
3902
4149
  logArray
3903
4150
  };
3904
4151
  }
3905
- current = next2;
3906
- }
3907
- await runBlock(current);
3908
- const endBlock = current;
3909
- const result = {};
3910
- const definitions = endBlock.data.outputParamDefinitionArray ?? [];
3911
- for (const def of definitions) {
3912
- result[def.name] = outputStore[current.id]?.[def.name] ?? null;
4152
+ current = next;
4153
+ while (current.type.startsWith("end.") === false) {
4154
+ const branch = await runBlock(current);
4155
+ const next2 = getNext(current.id, branch);
4156
+ if (next2 === null) {
4157
+ return {
4158
+ output: {},
4159
+ logArray
4160
+ };
4161
+ }
4162
+ current = next2;
4163
+ }
4164
+ await runBlock(current);
4165
+ const endBlock = current;
4166
+ const result = {};
4167
+ const definitions = endBlock.data.outputParamDefinitionArray ?? [];
4168
+ for (const def of definitions) {
4169
+ result[def.name] = outputStore[current.id]?.[def.name] ?? null;
4170
+ }
4171
+ return {
4172
+ output: result,
4173
+ logArray
4174
+ };
4175
+ } catch (error) {
4176
+ logArray.push({
4177
+ createdAt: /* @__PURE__ */ new Date(),
4178
+ message: `Flow execution failed: ${error instanceof Error ? error.message : String(error)}`,
4179
+ severity: "error"
4180
+ });
4181
+ return {
4182
+ output: {},
4183
+ logArray
4184
+ };
3913
4185
  }
3914
- return {
3915
- output: result,
3916
- logArray
3917
- };
3918
4186
  }
3919
4187
  };
3920
4188
 
@@ -4472,26 +4740,14 @@ var BenefitCardsService = class extends Service {
4472
4740
  method: "POST",
4473
4741
  url: "benefitCards",
4474
4742
  body: {
4743
+ propertyId: params.propertyId,
4744
+ name: params.name,
4745
+ imageLight: params.imageLight,
4746
+ imageDark: params.imageDark,
4475
4747
  userId: params.userId,
4476
- cardNumber: params.cardNumber,
4477
- cardHolderName: params.cardHolderName,
4478
- type: params.type,
4479
- status: params.status,
4480
- benefits: params.benefits,
4481
- limits: params.limits,
4482
- metadata: params.metadata,
4483
- pointsBalance: params.pointsBalance,
4484
- cashbackBalance: params.cashbackBalance,
4485
- totalSavings: params.totalSavings,
4486
- totalSpent: params.totalSpent,
4487
- transactionCount: params.transactionCount,
4488
- expiresAt: params.expiresAt,
4489
- isDigital: params.isDigital,
4490
- isTransferable: params.isTransferable,
4491
- requiresPin: params.requiresPin,
4492
- pin: params.pin,
4493
- qrCode: params.qrCode,
4494
- barcode: params.barcode
4748
+ reference: params.reference,
4749
+ text: params.text,
4750
+ metadata: params.metadata
4495
4751
  },
4496
4752
  authenticationNotOptional: true
4497
4753
  },
@@ -4500,38 +4756,14 @@ var BenefitCardsService = class extends Service {
4500
4756
  }
4501
4757
  async list(params, options) {
4502
4758
  const queryArray = [];
4759
+ if (params?.propertyId !== void 0) {
4760
+ queryArray.push("propertyId=" + params.propertyId);
4761
+ }
4503
4762
  if (params?.userId !== void 0) {
4504
4763
  queryArray.push("userId=" + params.userId);
4505
4764
  }
4506
- if (params?.cardNumber !== void 0) {
4507
- queryArray.push("cardNumber=" + params.cardNumber);
4508
- }
4509
- if (params?.cardHolderName !== void 0) {
4510
- queryArray.push("cardHolderName=" + params.cardHolderName);
4511
- }
4512
- if (params?.type !== void 0) {
4513
- queryArray.push("type=" + params.type);
4514
- }
4515
- if (params?.status !== void 0) {
4516
- queryArray.push("status=" + params.status);
4517
- }
4518
- if (params?.issuer !== void 0) {
4519
- queryArray.push("issuer=" + params.issuer);
4520
- }
4521
- if (params?.brand !== void 0) {
4522
- queryArray.push("brand=" + params.brand);
4523
- }
4524
- if (params?.level !== void 0) {
4525
- queryArray.push("level=" + params.level);
4526
- }
4527
- if (params?.isDigital !== void 0) {
4528
- queryArray.push("isDigital=" + params.isDigital);
4529
- }
4530
- if (params?.isTransferable !== void 0) {
4531
- queryArray.push("isTransferable=" + params.isTransferable);
4532
- }
4533
- if (params?.requiresPin !== void 0) {
4534
- queryArray.push("requiresPin=" + params.requiresPin);
4765
+ if (params?.text !== void 0) {
4766
+ queryArray.push("text=" + params.text);
4535
4767
  }
4536
4768
  if (options?.limit !== void 0) {
4537
4769
  queryArray.push("limit=" + options.limit);
@@ -4544,19 +4776,18 @@ var BenefitCardsService = class extends Service {
4544
4776
  method: "GET",
4545
4777
  url: "benefitCards?" + queryArray.join("&"),
4546
4778
  body: void 0,
4547
- authenticationNotOptional: false
4779
+ authenticationNotOptional: true
4548
4780
  },
4549
4781
  options
4550
4782
  );
4551
4783
  }
4552
4784
  async retrieve(params, options) {
4553
- const queryArray = [];
4554
4785
  return await super.sendRequest(
4555
4786
  {
4556
4787
  method: "GET",
4557
- url: "benefitCards/" + params.benefitCardId + "?" + queryArray.join("&"),
4788
+ url: "benefitCards/" + params.benefitCardId,
4558
4789
  body: void 0,
4559
- authenticationNotOptional: false
4790
+ authenticationNotOptional: true
4560
4791
  },
4561
4792
  options
4562
4793
  );
@@ -4567,26 +4798,13 @@ var BenefitCardsService = class extends Service {
4567
4798
  method: "PATCH",
4568
4799
  url: "benefitCards/" + params.benefitCardId,
4569
4800
  body: {
4801
+ name: params.name,
4802
+ imageLight: params.imageLight,
4803
+ imageDark: params.imageDark,
4570
4804
  userId: params.userId,
4571
- cardNumber: params.cardNumber,
4572
- cardHolderName: params.cardHolderName,
4573
- type: params.type,
4574
- status: params.status,
4575
- benefits: params.benefits,
4576
- limits: params.limits,
4577
- metadata: params.metadata,
4578
- pointsBalance: params.pointsBalance,
4579
- cashbackBalance: params.cashbackBalance,
4580
- totalSavings: params.totalSavings,
4581
- totalSpent: params.totalSpent,
4582
- transactionCount: params.transactionCount,
4583
- expiresAt: params.expiresAt,
4584
- isDigital: params.isDigital,
4585
- isTransferable: params.isTransferable,
4586
- requiresPin: params.requiresPin,
4587
- pin: params.pin,
4588
- qrCode: params.qrCode,
4589
- barcode: params.barcode
4805
+ reference: params.reference,
4806
+ text: params.text,
4807
+ metadata: params.metadata
4590
4808
  },
4591
4809
  authenticationNotOptional: true
4592
4810
  },
@@ -4604,6 +4822,17 @@ var BenefitCardsService = class extends Service {
4604
4822
  options
4605
4823
  );
4606
4824
  }
4825
+ async copy(params, options) {
4826
+ return await super.sendRequest(
4827
+ {
4828
+ method: "POST",
4829
+ url: "benefitCards/" + params.benefitCardId + "/copy",
4830
+ authenticationNotOptional: true,
4831
+ body: void 0
4832
+ },
4833
+ options
4834
+ );
4835
+ }
4607
4836
  };
4608
4837
 
4609
4838
  // src/catalogs/catalogs.service.ts
@@ -4927,15 +5156,32 @@ var KitsService = class extends Service {
4927
5156
  super(config);
4928
5157
  }
4929
5158
  async create(params, options) {
5159
+ const body = {
5160
+ name: params.name,
5161
+ propertyId: params.propertyId,
5162
+ type: params.type
5163
+ };
5164
+ if (params.type === "controlKitV1") {
5165
+ body.simIdArray = params.simIdArray;
5166
+ body.signalStrengthPercentage = params.signalStrengthPercentage;
5167
+ body.teltonikaSerialNumber = params.teltonikaSerialNumber;
5168
+ } else if (params.type === "tapkeyV1") {
5169
+ body.physicalLockId = params.physicalLockId;
5170
+ body.boundLockId = params.boundLockId;
5171
+ body.ownerAccountId = params.ownerAccountId;
5172
+ body.ipId = params.ipId;
5173
+ } else if (params.type === "emzV1") {
5174
+ body.contractId = params.contractId;
5175
+ body.targetHardwareId = params.targetHardwareId;
5176
+ body.userId = params.userId;
5177
+ body.username = params.username;
5178
+ body.password = params.password;
5179
+ }
4930
5180
  return await super.sendRequest(
4931
5181
  {
4932
5182
  method: "POST",
4933
5183
  url: "kits",
4934
- body: {
4935
- name: params.name,
4936
- propertyId: params.propertyId,
4937
- template: params.template
4938
- },
5184
+ body,
4939
5185
  authenticationNotOptional: true
4940
5186
  },
4941
5187
  options
@@ -4983,7 +5229,8 @@ var KitsService = class extends Service {
4983
5229
  method: "PATCH",
4984
5230
  url: "kits/" + params.kitId,
4985
5231
  body: {
4986
- name: params.name
5232
+ name: params.name,
5233
+ flowIdArray: params.flowIdArray
4987
5234
  },
4988
5235
  authenticationNotOptional: true
4989
5236
  },
@@ -5001,6 +5248,30 @@ var KitsService = class extends Service {
5001
5248
  options
5002
5249
  );
5003
5250
  }
5251
+ async attachProperty(params, options) {
5252
+ return await super.sendRequest(
5253
+ {
5254
+ method: "PATCH",
5255
+ url: "kits/" + params.kitId + "/attachProperty",
5256
+ body: {
5257
+ propertyId: params.propertyId
5258
+ },
5259
+ authenticationNotOptional: true
5260
+ },
5261
+ options
5262
+ );
5263
+ }
5264
+ async detachProperty(params, options) {
5265
+ return await super.sendRequest(
5266
+ {
5267
+ method: "PATCH",
5268
+ url: "kits/" + params.kitId + "/detachProperty",
5269
+ body: void 0,
5270
+ authenticationNotOptional: true
5271
+ },
5272
+ options
5273
+ );
5274
+ }
5004
5275
  };
5005
5276
 
5006
5277
  // src/panels/panels.service.ts
@@ -5018,7 +5289,10 @@ var PanelsService = class extends Service {
5018
5289
  name: params.name,
5019
5290
  layoutBlockArray: params.layoutBlockArray,
5020
5291
  highlightLayoutBlockArray: params.highlightLayoutBlockArray,
5021
- localParameterArray: params.localParameterArray
5292
+ variables: params.variables,
5293
+ display: params.display,
5294
+ permissionArray: params.permissionArray,
5295
+ proximityStrategyArray: params.proximityStrategyArray
5022
5296
  },
5023
5297
  authenticationNotOptional: true
5024
5298
  },
@@ -5048,6 +5322,9 @@ var PanelsService = class extends Service {
5048
5322
  }
5049
5323
  async retrieve(params, options) {
5050
5324
  const queryArray = [];
5325
+ if (options?.expand !== void 0) {
5326
+ queryArray.push("expand=" + options.expand.join(","));
5327
+ }
5051
5328
  return await super.sendRequest(
5052
5329
  {
5053
5330
  method: "GET",
@@ -5067,8 +5344,10 @@ var PanelsService = class extends Service {
5067
5344
  name: params.name,
5068
5345
  layoutBlockArray: params.layoutBlockArray,
5069
5346
  highlightLayoutBlockArray: params.highlightLayoutBlockArray,
5070
- localParameterArray: params.localParameterArray,
5071
- display: params.display
5347
+ variables: params.variables,
5348
+ display: params.display,
5349
+ permissionArray: params.permissionArray,
5350
+ proximityStrategyArray: params.proximityStrategyArray
5072
5351
  },
5073
5352
  authenticationNotOptional: true
5074
5353
  },
@@ -5239,6 +5518,83 @@ var PricesService = class extends Service {
5239
5518
  }
5240
5519
  };
5241
5520
 
5521
+ // src/applications/applications.service.ts
5522
+ var ApplicationsService = class extends Service {
5523
+ constructor(config) {
5524
+ super(config);
5525
+ }
5526
+ async create(ApplicationCreateParams, ApplicationOptions) {
5527
+ return await super.sendRequest(
5528
+ {
5529
+ method: "POST",
5530
+ url: "applications",
5531
+ body: {
5532
+ propertyId: ApplicationCreateParams.propertyId,
5533
+ colorScheme: ApplicationCreateParams.colorScheme,
5534
+ appIconLight: ApplicationCreateParams.appIconLight,
5535
+ appIconDark: ApplicationCreateParams.appIconDark
5536
+ },
5537
+ authenticationNotOptional: true
5538
+ },
5539
+ ApplicationOptions
5540
+ );
5541
+ }
5542
+ async retrieve(ApplicationRetrieveParams, ApplicationRetrieveOptions) {
5543
+ const queryArray = [];
5544
+ return await super.sendRequest(
5545
+ {
5546
+ method: "GET",
5547
+ url: "applications/" + ApplicationRetrieveParams.applicationId + "?" + queryArray.join("&"),
5548
+ body: void 0,
5549
+ authenticationNotOptional: false
5550
+ },
5551
+ ApplicationRetrieveOptions
5552
+ );
5553
+ }
5554
+ async list(ApplicationListParams, ApplicationListOptions) {
5555
+ const queryArray = [];
5556
+ if (ApplicationListParams?.propertyId !== void 0) {
5557
+ queryArray.push("propertyId=" + ApplicationListParams.propertyId);
5558
+ }
5559
+ return await super.sendRequest(
5560
+ {
5561
+ method: "GET",
5562
+ url: "applications?" + queryArray.join("&"),
5563
+ body: void 0,
5564
+ authenticationNotOptional: false
5565
+ },
5566
+ ApplicationListOptions
5567
+ );
5568
+ }
5569
+ async update(ApplicationUpdateParams, ApplicationUpdateOptions) {
5570
+ return await super.sendRequest(
5571
+ {
5572
+ method: "PATCH",
5573
+ url: "applications/" + ApplicationUpdateParams.applicationId,
5574
+ body: {
5575
+ colorScheme: ApplicationUpdateParams.colorScheme,
5576
+ appIconLight: ApplicationUpdateParams.appIconLight,
5577
+ appIconDark: ApplicationUpdateParams.appIconDark,
5578
+ status: ApplicationUpdateParams.status
5579
+ },
5580
+ authenticationNotOptional: true
5581
+ },
5582
+ ApplicationUpdateOptions
5583
+ );
5584
+ }
5585
+ async delete(ApplicationDeleteParams, ApplicationDeleteOptions) {
5586
+ return await super.sendRequest(
5587
+ {
5588
+ method: "DELETE",
5589
+ url: "applications/" + ApplicationDeleteParams.applicationId,
5590
+ authenticationNotOptional: true,
5591
+ body: void 0
5592
+ },
5593
+ ApplicationDeleteOptions
5594
+ );
5595
+ }
5596
+ };
5597
+
5242
5598
  // src/types/types.ts
5243
5599
  var LanguageCodeArray = [
5244
5600
  "en",
@@ -5422,6 +5778,7 @@ var Juhuu = class {
5422
5778
  this.incidents = new IncidentsService(config);
5423
5779
  this.parameterAnomalyGroups = new ParameterAnomalyGroupsService(config);
5424
5780
  this.parameterAnomalyGroupTrackers = new ParameterAnomalyGroupTrackersService(config);
5781
+ this.parameterAnomalyGroupTrackerTraces = new ParameterAnomalyGroupTrackerTracesService(config);
5425
5782
  this.emz = new EmzService(config);
5426
5783
  this.flows = new FlowsService(config);
5427
5784
  this.flowTraces = new FlowTracesService(config);
@@ -5436,6 +5793,7 @@ var Juhuu = class {
5436
5793
  this.kits = new KitsService(config);
5437
5794
  this.panels = new PanelsService(config);
5438
5795
  this.prices = new PricesService(config);
5796
+ this.applications = new ApplicationsService(config);
5439
5797
  }
5440
5798
  /**
5441
5799
  * Top Level Resources
@@ -5473,6 +5831,7 @@ var Juhuu = class {
5473
5831
  incidents;
5474
5832
  parameterAnomalyGroups;
5475
5833
  parameterAnomalyGroupTrackers;
5834
+ parameterAnomalyGroupTrackerTraces;
5476
5835
  emz;
5477
5836
  flows;
5478
5837
  flowTraces;
@@ -5487,6 +5846,7 @@ var Juhuu = class {
5487
5846
  kits;
5488
5847
  panels;
5489
5848
  prices;
5849
+ applications;
5490
5850
  };
5491
5851
  var JUHUU;
5492
5852
  ((JUHUU2) => {