@juhuu/sdk-ts 1.0.4 → 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];
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];
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;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juhuu/sdk-ts",
3
- "version": "1.0.4",
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",