@juhuu/sdk-ts 1.2.40 → 1.2.42

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 CHANGED
@@ -661,6 +661,10 @@ declare class TariffsService extends Service {
661
661
  */
662
662
  calculateAmount(tariff: JUHUU.Tariff.Object, rentTimeSeconds: number): number;
663
663
  calculateMaximumAmount(tariff: JUHUU.Tariff.Object): number;
664
+ /**
665
+ * Returns a date object containing the timestamp that a session would have to end at if it was created right now
666
+ */
667
+ getEndDate(tariff: JUHUU.Tariff.Object): Date;
664
668
  }
665
669
 
666
670
  declare class ProductService extends Service {
@@ -824,14 +828,21 @@ declare namespace JUHUU {
824
828
  type DeepNullable<T> = {
825
829
  [P in keyof T]?: DeepNullable<T[P]> | null;
826
830
  };
827
- enum Purpose {
828
- Purpose1 = "Purpose 1",
829
- Purpose2 = "Purpose 2"
830
- }
831
- enum Technology {
832
- Tech1 = "Technology 1",
833
- Tech2 = "Technology 2"
834
- }
831
+ const ReadonlySectorArray: readonly ["tourism", "mobility", "sport"];
832
+ type Sector = (typeof ReadonlySectorArray)[number];
833
+ const ReadonlyTechnologyArray: readonly ["analog", "digital"];
834
+ type Technology = (typeof ReadonlyTechnologyArray)[number];
835
+ const ReadonlyCategoryArray: readonly ["bike", "car", "scooter", "boat", "moped"];
836
+ type Category = (typeof ReadonlyCategoryArray)[number];
837
+ const ReadonlyModalityArray: readonly ["charge", "store", "share", "wash", "repair"];
838
+ type Modality = (typeof ReadonlyModalityArray)[number];
839
+ type Purpose = {
840
+ sector: Sector;
841
+ category: Category;
842
+ modality: Modality;
843
+ };
844
+ const ReadonlyIntegrationStateArray: readonly ["full", "partial"];
845
+ type IntegrationState = (typeof ReadonlyIntegrationStateArray)[number];
835
846
  namespace Session {
836
847
  type Base = {
837
848
  id: string;
@@ -2283,4 +2294,4 @@ declare namespace JUHUU {
2283
2294
  }
2284
2295
  }
2285
2296
 
2286
- export { type AccessControlListElement, type Address, type AutoRenewMode, type BusinessType, type Category, type Circumstance, type Color, type ColorScheme, type Command, type Condition, ConditionType, type CountryCode, CountryCodeArray, type CurrencyCode, CurrencyCodeArray, type CustomClaims, type DeepNullable, type DeviceStatus, type DeviceType, type Environment, type EnvironmentSettings, type ExtractType, type FuelType, type GeneralSettings, type GeoPoint, type GraphNode, type IntegrationState, JUHUU, Juhuu, type LanguageCode, LanguageCodeArray, Layout, type LayoutBlock, type LicenseTariffIdMap, type LinkType, type LocaleString, type MapFilter, type Modality, type Offer, type OfferTime, type Parameter, type Party, type PaymentMethod, type PaymentReason, type PaymentServiceProvider, type PaymentStatus, type PayoutSettings, type PayoutStatus, type PermissionTypes, type Person, type Platform, type PlatformUrl, type PostingRow, Purpose, type PushToken, ReadonlyCategoryArray, ReadonlyIntegrationStateArray, ReadonlyModalityArray, ReadonlySectorArray, type RefundReason, type RefundStatus, type Sector, type SessionCannotTerminateReason, type SessionSettings, type SessionStatus, type SessionTerminatedByType, type SessionType, type Settings, type SimStatus, type StarRating, type TarifType, type TimeZone, type Unit, type UserType, type Utilization, type VeloBrushDeviceDocumentUserManualStep, type Viewport, type ViewportPolygon, type hexColor };
2297
+ export { type AccessControlListElement, type Address, type AutoRenewMode, type BusinessType, type Category, type Circumstance, type Color, type ColorScheme, type Command, type Condition, ConditionType, type CountryCode, CountryCodeArray, type CurrencyCode, CurrencyCodeArray, type CustomClaims, type DeepNullable, type DeviceStatus, type DeviceType, type Environment, type EnvironmentSettings, type ExtractType, type FuelType, type GeneralSettings, type GeoPoint, type GraphNode, type IntegrationState, JUHUU, Juhuu, type LanguageCode, LanguageCodeArray, Layout, type LayoutBlock, type LicenseTariffIdMap, type LinkType, type LocaleString, type MapFilter, type Modality, type Offer, type OfferTime, type Parameter, type Party, type PaymentMethod, type PaymentReason, type PaymentServiceProvider, type PaymentStatus, type PayoutSettings, type PayoutStatus, type PermissionTypes, type Person, type Platform, type PlatformUrl, type PostingRow, type Purpose, type PushToken, ReadonlyCategoryArray, ReadonlyIntegrationStateArray, ReadonlyModalityArray, ReadonlySectorArray, type RefundReason, type RefundStatus, type Sector, type SessionCannotTerminateReason, type SessionSettings, type SessionStatus, type SessionTerminatedByType, type SessionType, type Settings, type SimStatus, type StarRating, type TarifType, type TimeZone, type Unit, type UserType, type Utilization, type VeloBrushDeviceDocumentUserManualStep, type Viewport, type ViewportPolygon, type hexColor };
package/dist/index.d.ts CHANGED
@@ -661,6 +661,10 @@ declare class TariffsService extends Service {
661
661
  */
662
662
  calculateAmount(tariff: JUHUU.Tariff.Object, rentTimeSeconds: number): number;
663
663
  calculateMaximumAmount(tariff: JUHUU.Tariff.Object): number;
664
+ /**
665
+ * Returns a date object containing the timestamp that a session would have to end at if it was created right now
666
+ */
667
+ getEndDate(tariff: JUHUU.Tariff.Object): Date;
664
668
  }
665
669
 
666
670
  declare class ProductService extends Service {
@@ -824,14 +828,21 @@ declare namespace JUHUU {
824
828
  type DeepNullable<T> = {
825
829
  [P in keyof T]?: DeepNullable<T[P]> | null;
826
830
  };
827
- enum Purpose {
828
- Purpose1 = "Purpose 1",
829
- Purpose2 = "Purpose 2"
830
- }
831
- enum Technology {
832
- Tech1 = "Technology 1",
833
- Tech2 = "Technology 2"
834
- }
831
+ const ReadonlySectorArray: readonly ["tourism", "mobility", "sport"];
832
+ type Sector = (typeof ReadonlySectorArray)[number];
833
+ const ReadonlyTechnologyArray: readonly ["analog", "digital"];
834
+ type Technology = (typeof ReadonlyTechnologyArray)[number];
835
+ const ReadonlyCategoryArray: readonly ["bike", "car", "scooter", "boat", "moped"];
836
+ type Category = (typeof ReadonlyCategoryArray)[number];
837
+ const ReadonlyModalityArray: readonly ["charge", "store", "share", "wash", "repair"];
838
+ type Modality = (typeof ReadonlyModalityArray)[number];
839
+ type Purpose = {
840
+ sector: Sector;
841
+ category: Category;
842
+ modality: Modality;
843
+ };
844
+ const ReadonlyIntegrationStateArray: readonly ["full", "partial"];
845
+ type IntegrationState = (typeof ReadonlyIntegrationStateArray)[number];
835
846
  namespace Session {
836
847
  type Base = {
837
848
  id: string;
@@ -2283,4 +2294,4 @@ declare namespace JUHUU {
2283
2294
  }
2284
2295
  }
2285
2296
 
2286
- export { type AccessControlListElement, type Address, type AutoRenewMode, type BusinessType, type Category, type Circumstance, type Color, type ColorScheme, type Command, type Condition, ConditionType, type CountryCode, CountryCodeArray, type CurrencyCode, CurrencyCodeArray, type CustomClaims, type DeepNullable, type DeviceStatus, type DeviceType, type Environment, type EnvironmentSettings, type ExtractType, type FuelType, type GeneralSettings, type GeoPoint, type GraphNode, type IntegrationState, JUHUU, Juhuu, type LanguageCode, LanguageCodeArray, Layout, type LayoutBlock, type LicenseTariffIdMap, type LinkType, type LocaleString, type MapFilter, type Modality, type Offer, type OfferTime, type Parameter, type Party, type PaymentMethod, type PaymentReason, type PaymentServiceProvider, type PaymentStatus, type PayoutSettings, type PayoutStatus, type PermissionTypes, type Person, type Platform, type PlatformUrl, type PostingRow, Purpose, type PushToken, ReadonlyCategoryArray, ReadonlyIntegrationStateArray, ReadonlyModalityArray, ReadonlySectorArray, type RefundReason, type RefundStatus, type Sector, type SessionCannotTerminateReason, type SessionSettings, type SessionStatus, type SessionTerminatedByType, type SessionType, type Settings, type SimStatus, type StarRating, type TarifType, type TimeZone, type Unit, type UserType, type Utilization, type VeloBrushDeviceDocumentUserManualStep, type Viewport, type ViewportPolygon, type hexColor };
2297
+ export { type AccessControlListElement, type Address, type AutoRenewMode, type BusinessType, type Category, type Circumstance, type Color, type ColorScheme, type Command, type Condition, ConditionType, type CountryCode, CountryCodeArray, type CurrencyCode, CurrencyCodeArray, type CustomClaims, type DeepNullable, type DeviceStatus, type DeviceType, type Environment, type EnvironmentSettings, type ExtractType, type FuelType, type GeneralSettings, type GeoPoint, type GraphNode, type IntegrationState, JUHUU, Juhuu, type LanguageCode, LanguageCodeArray, Layout, type LayoutBlock, type LicenseTariffIdMap, type LinkType, type LocaleString, type MapFilter, type Modality, type Offer, type OfferTime, type Parameter, type Party, type PaymentMethod, type PaymentReason, type PaymentServiceProvider, type PaymentStatus, type PayoutSettings, type PayoutStatus, type PermissionTypes, type Person, type Platform, type PlatformUrl, type PostingRow, type Purpose, type PushToken, ReadonlyCategoryArray, ReadonlyIntegrationStateArray, ReadonlyModalityArray, ReadonlySectorArray, type RefundReason, type RefundStatus, type Sector, type SessionCannotTerminateReason, type SessionSettings, type SessionStatus, type SessionTerminatedByType, type SessionType, type Settings, type SimStatus, type StarRating, type TarifType, type TimeZone, type Unit, type UserType, type Utilization, type VeloBrushDeviceDocumentUserManualStep, type Viewport, type ViewportPolygon, type hexColor };
package/dist/index.js CHANGED
@@ -1182,6 +1182,17 @@ var TariffsService = class extends Service {
1182
1182
  calculateMaximumAmount(tariff) {
1183
1183
  return this.calculateAmount(tariff, tariff.duration);
1184
1184
  }
1185
+ /**
1186
+ * Returns a date object containing the timestamp that a session would have to end at if it was created right now
1187
+ */
1188
+ getEndDate(tariff) {
1189
+ if (tariff.roundToMidnight === false) {
1190
+ return new Date(Date.now() + tariff.duration * 1e3);
1191
+ }
1192
+ const end = new Date(Date.now() + tariff.duration * 1e3);
1193
+ end.setHours(23, 59, 59, 999);
1194
+ return end;
1195
+ }
1185
1196
  };
1186
1197
 
1187
1198
  // src/products/products.service.ts
@@ -2005,16 +2016,23 @@ var Juhuu = class {
2005
2016
  };
2006
2017
  var JUHUU;
2007
2018
  ((JUHUU2) => {
2008
- let Purpose;
2009
- ((Purpose3) => {
2010
- Purpose3["Purpose1"] = "Purpose 1";
2011
- Purpose3["Purpose2"] = "Purpose 2";
2012
- })(Purpose = JUHUU2.Purpose || (JUHUU2.Purpose = {}));
2013
- let Technology;
2014
- ((Technology2) => {
2015
- Technology2["Tech1"] = "Technology 1";
2016
- Technology2["Tech2"] = "Technology 2";
2017
- })(Technology = JUHUU2.Technology || (JUHUU2.Technology = {}));
2019
+ JUHUU2.ReadonlySectorArray = ["tourism", "mobility", "sport"];
2020
+ JUHUU2.ReadonlyTechnologyArray = ["analog", "digital"];
2021
+ JUHUU2.ReadonlyCategoryArray = [
2022
+ "bike",
2023
+ "car",
2024
+ "scooter",
2025
+ "boat",
2026
+ "moped"
2027
+ ];
2028
+ JUHUU2.ReadonlyModalityArray = [
2029
+ "charge",
2030
+ "store",
2031
+ "share",
2032
+ "wash",
2033
+ "repair"
2034
+ ];
2035
+ JUHUU2.ReadonlyIntegrationStateArray = ["full", "partial"];
2018
2036
  })(JUHUU || (JUHUU = {}));
2019
2037
  // Annotate the CommonJS export names for ESM import in node:
2020
2038
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -1137,6 +1137,17 @@ var TariffsService = class extends Service {
1137
1137
  calculateMaximumAmount(tariff) {
1138
1138
  return this.calculateAmount(tariff, tariff.duration);
1139
1139
  }
1140
+ /**
1141
+ * Returns a date object containing the timestamp that a session would have to end at if it was created right now
1142
+ */
1143
+ getEndDate(tariff) {
1144
+ if (tariff.roundToMidnight === false) {
1145
+ return new Date(Date.now() + tariff.duration * 1e3);
1146
+ }
1147
+ const end = new Date(Date.now() + tariff.duration * 1e3);
1148
+ end.setHours(23, 59, 59, 999);
1149
+ return end;
1150
+ }
1140
1151
  };
1141
1152
 
1142
1153
  // src/products/products.service.ts
@@ -1960,16 +1971,23 @@ var Juhuu = class {
1960
1971
  };
1961
1972
  var JUHUU;
1962
1973
  ((JUHUU2) => {
1963
- let Purpose;
1964
- ((Purpose3) => {
1965
- Purpose3["Purpose1"] = "Purpose 1";
1966
- Purpose3["Purpose2"] = "Purpose 2";
1967
- })(Purpose = JUHUU2.Purpose || (JUHUU2.Purpose = {}));
1968
- let Technology;
1969
- ((Technology2) => {
1970
- Technology2["Tech1"] = "Technology 1";
1971
- Technology2["Tech2"] = "Technology 2";
1972
- })(Technology = JUHUU2.Technology || (JUHUU2.Technology = {}));
1974
+ JUHUU2.ReadonlySectorArray = ["tourism", "mobility", "sport"];
1975
+ JUHUU2.ReadonlyTechnologyArray = ["analog", "digital"];
1976
+ JUHUU2.ReadonlyCategoryArray = [
1977
+ "bike",
1978
+ "car",
1979
+ "scooter",
1980
+ "boat",
1981
+ "moped"
1982
+ ];
1983
+ JUHUU2.ReadonlyModalityArray = [
1984
+ "charge",
1985
+ "store",
1986
+ "share",
1987
+ "wash",
1988
+ "repair"
1989
+ ];
1990
+ JUHUU2.ReadonlyIntegrationStateArray = ["full", "partial"];
1973
1991
  })(JUHUU || (JUHUU = {}));
1974
1992
  export {
1975
1993
  ConditionType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juhuu/sdk-ts",
3
- "version": "1.2.40",
3
+ "version": "1.2.42",
4
4
  "description": "Typescript wrapper for JUHUU services",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",