@juhuu/sdk-ts 1.0.3 → 1.0.5

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
@@ -176,7 +176,7 @@ interface Party extends Person {
176
176
  type VeloBrushDeviceDocumentUserManualStep = "prepareBike1" | "prepareBike2" | "chooseCycleType" | "openDoors1" | "extendBikeDrawer1" | "unfoldRamp1" | "placeBike1" | "fixBike1" | "fixBike2" | "retractBikeDrawer1" | "closeDoors1" | "selectWashProgram" | "waitForWashProgram" | "openDoors2" | "extendBikeDrawer2" | "dryBike1" | "dryBike2" | "releaseBike" | "unloadBike" | "retractBikeDrawer2" | "closeDoors2" | "lockDoors" | "error" | "emergencyStop" | "waitingForSession";
177
177
  type PaymentStatus = "waitingForConfirmation" | "waitingForAmountFinalization" | "waitingForCapture" | "waitingForTransitConfirmation" | "inTransitToProvider" | "captured" | "inTransitToProperty" | "payedOut";
178
178
  type PaymentServiceProvider = "stripe";
179
- type PayoutStatus = "awaitingApproval" | "inTransitToProperty" | "payedOut";
179
+ type PayoutStatus = "waitingForApproval" | "inTransitToProperty" | "payedOut";
180
180
  type BusinessType = "individual" | "company" | "non_profit" | "government_entity";
181
181
  declare const ReadonlySectorArray: readonly ["tourism", "mobility", "sport"];
182
182
  type Sector = (typeof ReadonlySectorArray)[number];
@@ -655,6 +655,11 @@ declare class ProductService extends Service {
655
655
  retrieve(params: JUHUU.Product.Retrieve.Params, options?: JUHUU.Product.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Product.Retrieve.Response>>;
656
656
  }
657
657
 
658
+ declare class SettingsService extends Service {
659
+ constructor(config: JUHUU.SetupConfig);
660
+ retrieve(): Promise<JUHUU.HttpResponse<Settings>>;
661
+ }
662
+
658
663
  declare class Juhuu {
659
664
  constructor(config: JUHUU.SetupConfig);
660
665
  /**
@@ -672,6 +677,7 @@ declare class Juhuu {
672
677
  readonly terms: TermsService;
673
678
  readonly tariffs: TariffsService;
674
679
  readonly products: ProductService;
680
+ readonly settings: SettingsService;
675
681
  }
676
682
  declare namespace JUHUU {
677
683
  interface SetupConfig {
package/dist/index.d.ts CHANGED
@@ -176,7 +176,7 @@ interface Party extends Person {
176
176
  type VeloBrushDeviceDocumentUserManualStep = "prepareBike1" | "prepareBike2" | "chooseCycleType" | "openDoors1" | "extendBikeDrawer1" | "unfoldRamp1" | "placeBike1" | "fixBike1" | "fixBike2" | "retractBikeDrawer1" | "closeDoors1" | "selectWashProgram" | "waitForWashProgram" | "openDoors2" | "extendBikeDrawer2" | "dryBike1" | "dryBike2" | "releaseBike" | "unloadBike" | "retractBikeDrawer2" | "closeDoors2" | "lockDoors" | "error" | "emergencyStop" | "waitingForSession";
177
177
  type PaymentStatus = "waitingForConfirmation" | "waitingForAmountFinalization" | "waitingForCapture" | "waitingForTransitConfirmation" | "inTransitToProvider" | "captured" | "inTransitToProperty" | "payedOut";
178
178
  type PaymentServiceProvider = "stripe";
179
- type PayoutStatus = "awaitingApproval" | "inTransitToProperty" | "payedOut";
179
+ type PayoutStatus = "waitingForApproval" | "inTransitToProperty" | "payedOut";
180
180
  type BusinessType = "individual" | "company" | "non_profit" | "government_entity";
181
181
  declare const ReadonlySectorArray: readonly ["tourism", "mobility", "sport"];
182
182
  type Sector = (typeof ReadonlySectorArray)[number];
@@ -655,6 +655,11 @@ declare class ProductService extends Service {
655
655
  retrieve(params: JUHUU.Product.Retrieve.Params, options?: JUHUU.Product.Retrieve.Options): Promise<JUHUU.HttpResponse<JUHUU.Product.Retrieve.Response>>;
656
656
  }
657
657
 
658
+ declare class SettingsService extends Service {
659
+ constructor(config: JUHUU.SetupConfig);
660
+ retrieve(): Promise<JUHUU.HttpResponse<Settings>>;
661
+ }
662
+
658
663
  declare class Juhuu {
659
664
  constructor(config: JUHUU.SetupConfig);
660
665
  /**
@@ -672,6 +677,7 @@ declare class Juhuu {
672
677
  readonly terms: TermsService;
673
678
  readonly tariffs: TariffsService;
674
679
  readonly products: ProductService;
680
+ readonly settings: SettingsService;
675
681
  }
676
682
  declare namespace JUHUU {
677
683
  interface SetupConfig {
package/dist/index.js CHANGED
@@ -88,22 +88,22 @@ var Service = class {
88
88
  options.refreshTokensIfNecessary = true;
89
89
  }
90
90
  let token = null;
91
- if (useAuthentication === true && options.accessToken === void 0) {
91
+ if (options.accessToken === void 0) {
92
92
  token = await this.getAccessToken();
93
- if (token === null) {
94
- console.error(
95
- "endpoint",
96
- url,
97
- "should use authentication but no token was found"
98
- );
99
- return {
100
- ok: false,
101
- data: null
102
- };
103
- }
104
- } else if (useAuthentication === true && options.accessToken !== void 0) {
93
+ } else {
105
94
  token = options.accessToken;
106
95
  }
96
+ if (token === null && useAuthentication === true) {
97
+ console.error(
98
+ "endpoint",
99
+ url,
100
+ "should use authentication but no token was found"
101
+ );
102
+ return {
103
+ ok: false,
104
+ data: null
105
+ };
106
+ }
107
107
  const uri = this.httpBaseUrl + url;
108
108
  let response = null;
109
109
  let responseObject = null;
@@ -1050,6 +1050,21 @@ var ProductService = class extends Service {
1050
1050
  }
1051
1051
  };
1052
1052
 
1053
+ // src/settings/settings.service.ts
1054
+ var SettingsService = class extends Service {
1055
+ constructor(config) {
1056
+ super(config);
1057
+ }
1058
+ async retrieve() {
1059
+ return await super.sendRequest({
1060
+ method: "GET",
1061
+ url: "sessions/",
1062
+ body: void 0,
1063
+ useAuthentication: false
1064
+ });
1065
+ }
1066
+ };
1067
+
1053
1068
  // src/types/types.ts
1054
1069
  var LanguageCodeArray = [
1055
1070
  "en",
@@ -1216,6 +1231,7 @@ var Juhuu = class {
1216
1231
  this.terms = new TermsService(config);
1217
1232
  this.tariffs = new TariffsService(config);
1218
1233
  this.products = new ProductService(config);
1234
+ this.settings = new SettingsService(config);
1219
1235
  }
1220
1236
  /**
1221
1237
  * Top Level Resources
@@ -1232,6 +1248,7 @@ var Juhuu = class {
1232
1248
  terms;
1233
1249
  tariffs;
1234
1250
  products;
1251
+ settings;
1235
1252
  };
1236
1253
  var JUHUU;
1237
1254
  ((JUHUU2) => {
package/dist/index.mjs CHANGED
@@ -43,22 +43,22 @@ var Service = class {
43
43
  options.refreshTokensIfNecessary = true;
44
44
  }
45
45
  let token = null;
46
- if (useAuthentication === true && options.accessToken === void 0) {
46
+ if (options.accessToken === void 0) {
47
47
  token = await this.getAccessToken();
48
- if (token === null) {
49
- console.error(
50
- "endpoint",
51
- url,
52
- "should use authentication but no token was found"
53
- );
54
- return {
55
- ok: false,
56
- data: null
57
- };
58
- }
59
- } else if (useAuthentication === true && options.accessToken !== void 0) {
48
+ } else {
60
49
  token = options.accessToken;
61
50
  }
51
+ if (token === null && useAuthentication === true) {
52
+ console.error(
53
+ "endpoint",
54
+ url,
55
+ "should use authentication but no token was found"
56
+ );
57
+ return {
58
+ ok: false,
59
+ data: null
60
+ };
61
+ }
62
62
  const uri = this.httpBaseUrl + url;
63
63
  let response = null;
64
64
  let responseObject = null;
@@ -1005,6 +1005,21 @@ var ProductService = class extends Service {
1005
1005
  }
1006
1006
  };
1007
1007
 
1008
+ // src/settings/settings.service.ts
1009
+ var SettingsService = class extends Service {
1010
+ constructor(config) {
1011
+ super(config);
1012
+ }
1013
+ async retrieve() {
1014
+ return await super.sendRequest({
1015
+ method: "GET",
1016
+ url: "sessions/",
1017
+ body: void 0,
1018
+ useAuthentication: false
1019
+ });
1020
+ }
1021
+ };
1022
+
1008
1023
  // src/types/types.ts
1009
1024
  var LanguageCodeArray = [
1010
1025
  "en",
@@ -1171,6 +1186,7 @@ var Juhuu = class {
1171
1186
  this.terms = new TermsService(config);
1172
1187
  this.tariffs = new TariffsService(config);
1173
1188
  this.products = new ProductService(config);
1189
+ this.settings = new SettingsService(config);
1174
1190
  }
1175
1191
  /**
1176
1192
  * Top Level Resources
@@ -1187,6 +1203,7 @@ var Juhuu = class {
1187
1203
  terms;
1188
1204
  tariffs;
1189
1205
  products;
1206
+ settings;
1190
1207
  };
1191
1208
  var JUHUU;
1192
1209
  ((JUHUU2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juhuu/sdk-ts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Typescript wrapper for juhuu services",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",