@camstack/addon-provider-bosch 0.1.20 → 0.1.22
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/{account-integration-offline-DvuqXgc8.mjs → account-integration-offline-34gaYDfb.mjs} +44 -2
- package/dist/{account-integration-offline-7DUtQrPy.js → account-integration-offline-DZLHsBZF.js} +55 -1
- package/dist/{dist-CYBUFKeW.js → dist-CRlugVId.js} +569 -104
- package/dist/{dist-B75tWQLF.mjs → dist-DGlq0nuG.mjs} +552 -105
- package/dist/home-connect/addon.js +128 -106
- package/dist/home-connect/addon.mjs +128 -106
- package/dist/homecom/addon.js +557 -433
- package/dist/homecom/addon.mjs +557 -433
- package/dist/shc/addon.js +331 -38
- package/dist/shc/addon.mjs +331 -38
- package/i18n/en.json +23 -19
- package/i18n/it.json +23 -19
- package/package.json +4 -1
package/dist/{account-integration-offline-DvuqXgc8.mjs → account-integration-offline-34gaYDfb.mjs}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { w as errMsg } from "./dist-DGlq0nuG.mjs";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
2
3
|
//#region src/shared/oauth-callback.ts
|
|
3
4
|
/** A code on its own: no scheme, no query, no separators. */
|
|
4
5
|
var BARE_CODE = /^[A-Za-z0-9._~-]+$/;
|
|
@@ -62,6 +63,47 @@ function parseOAuthCallback(input, expectedState) {
|
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|
|
66
|
+
//#region src/shared/sign-in-attempt.ts
|
|
67
|
+
/** A sign-in code is only valid for a few minutes; the attempt dies with it. */
|
|
68
|
+
var SIGN_IN_ATTEMPT_TTL_MS = 600 * 1e3;
|
|
69
|
+
function createSignInAttemptStore(ttlMs = SIGN_IN_ATTEMPT_TTL_MS) {
|
|
70
|
+
const attempts = /* @__PURE__ */ new Map();
|
|
71
|
+
return {
|
|
72
|
+
put(verifier, state, nowMs) {
|
|
73
|
+
const attemptId = randomBytes(16).toString("base64url");
|
|
74
|
+
attempts.set(attemptId, {
|
|
75
|
+
verifier,
|
|
76
|
+
state,
|
|
77
|
+
expiresAtMs: nowMs + ttlMs
|
|
78
|
+
});
|
|
79
|
+
return attemptId;
|
|
80
|
+
},
|
|
81
|
+
take(attemptId, nowMs) {
|
|
82
|
+
const stored = attempts.get(attemptId);
|
|
83
|
+
if (stored === void 0) return {
|
|
84
|
+
ok: false,
|
|
85
|
+
reason: "missing"
|
|
86
|
+
};
|
|
87
|
+
attempts.delete(attemptId);
|
|
88
|
+
if (nowMs > stored.expiresAtMs) return {
|
|
89
|
+
ok: false,
|
|
90
|
+
reason: "expired"
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
ok: true,
|
|
94
|
+
attempt: {
|
|
95
|
+
verifier: stored.verifier,
|
|
96
|
+
state: stored.state
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** Expired attempts use the same operator text as an expired authorization code. */
|
|
103
|
+
function loginFailureForAttempt(reason) {
|
|
104
|
+
return reason === "expired" ? "code-rejected" : "state-mismatch";
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
65
107
|
//#region src/shared/account-integration-cascade.ts
|
|
66
108
|
async function cascadeRemoveDevicesForIntegration(input) {
|
|
67
109
|
const { reg, devices, addonId, system, integrationId, logger } = input;
|
|
@@ -99,4 +141,4 @@ function setIntegrationDevicesOnline(devices, system, integrationId, online) {
|
|
|
99
141
|
return count;
|
|
100
142
|
}
|
|
101
143
|
//#endregion
|
|
102
|
-
export { cascadeRemoveDevicesForIntegration as n,
|
|
144
|
+
export { parseOAuthCallback as a, loginFailureForAttempt as i, cascadeRemoveDevicesForIntegration as n, createSignInAttemptStore as r, setIntegrationDevicesOnline as t };
|
package/dist/{account-integration-offline-7DUtQrPy.js → account-integration-offline-DZLHsBZF.js}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-CRlugVId.js");
|
|
2
|
+
let node_crypto = require("node:crypto");
|
|
2
3
|
//#region src/shared/oauth-callback.ts
|
|
3
4
|
/** A code on its own: no scheme, no query, no separators. */
|
|
4
5
|
var BARE_CODE = /^[A-Za-z0-9._~-]+$/;
|
|
@@ -62,6 +63,47 @@ function parseOAuthCallback(input, expectedState) {
|
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|
|
66
|
+
//#region src/shared/sign-in-attempt.ts
|
|
67
|
+
/** A sign-in code is only valid for a few minutes; the attempt dies with it. */
|
|
68
|
+
var SIGN_IN_ATTEMPT_TTL_MS = 600 * 1e3;
|
|
69
|
+
function createSignInAttemptStore(ttlMs = SIGN_IN_ATTEMPT_TTL_MS) {
|
|
70
|
+
const attempts = /* @__PURE__ */ new Map();
|
|
71
|
+
return {
|
|
72
|
+
put(verifier, state, nowMs) {
|
|
73
|
+
const attemptId = (0, node_crypto.randomBytes)(16).toString("base64url");
|
|
74
|
+
attempts.set(attemptId, {
|
|
75
|
+
verifier,
|
|
76
|
+
state,
|
|
77
|
+
expiresAtMs: nowMs + ttlMs
|
|
78
|
+
});
|
|
79
|
+
return attemptId;
|
|
80
|
+
},
|
|
81
|
+
take(attemptId, nowMs) {
|
|
82
|
+
const stored = attempts.get(attemptId);
|
|
83
|
+
if (stored === void 0) return {
|
|
84
|
+
ok: false,
|
|
85
|
+
reason: "missing"
|
|
86
|
+
};
|
|
87
|
+
attempts.delete(attemptId);
|
|
88
|
+
if (nowMs > stored.expiresAtMs) return {
|
|
89
|
+
ok: false,
|
|
90
|
+
reason: "expired"
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
ok: true,
|
|
94
|
+
attempt: {
|
|
95
|
+
verifier: stored.verifier,
|
|
96
|
+
state: stored.state
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** Expired attempts use the same operator text as an expired authorization code. */
|
|
103
|
+
function loginFailureForAttempt(reason) {
|
|
104
|
+
return reason === "expired" ? "code-rejected" : "state-mismatch";
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
65
107
|
//#region src/shared/account-integration-cascade.ts
|
|
66
108
|
async function cascadeRemoveDevicesForIntegration(input) {
|
|
67
109
|
const { reg, devices, addonId, system, integrationId, logger } = input;
|
|
@@ -105,6 +147,18 @@ Object.defineProperty(exports, "cascadeRemoveDevicesForIntegration", {
|
|
|
105
147
|
return cascadeRemoveDevicesForIntegration;
|
|
106
148
|
}
|
|
107
149
|
});
|
|
150
|
+
Object.defineProperty(exports, "createSignInAttemptStore", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function() {
|
|
153
|
+
return createSignInAttemptStore;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "loginFailureForAttempt", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function() {
|
|
159
|
+
return loginFailureForAttempt;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
108
162
|
Object.defineProperty(exports, "parseOAuthCallback", {
|
|
109
163
|
enumerable: true,
|
|
110
164
|
get: function() {
|