homebridge-carrier-infinity 1.8.0 → 1.9.0-beta.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.
Files changed (76) hide show
  1. package/.devcontainer/.uix-hb-service-homebridge-startup.json.example +5 -0
  2. package/.devcontainer/README.md +211 -0
  3. package/.devcontainer/config.json.example +28 -0
  4. package/.devcontainer/devcontainer.json +55 -0
  5. package/.devcontainer/setup-homebridge.sh +51 -0
  6. package/.devcontainer/start-homebridge.sh +29 -0
  7. package/.devcontainer/stop-homebridge.sh +7 -0
  8. package/CLAUDE.md +186 -0
  9. package/dist/accessory_base.d.ts +2 -2
  10. package/dist/accessory_base.d.ts.map +1 -1
  11. package/dist/accessory_base.js.map +1 -1
  12. package/dist/api/graphql_client.d.ts +71 -0
  13. package/dist/api/graphql_client.d.ts.map +1 -0
  14. package/dist/api/graphql_client.js +261 -0
  15. package/dist/api/graphql_client.js.map +1 -0
  16. package/dist/api/graphql_operations.d.ts +56 -0
  17. package/dist/api/graphql_operations.d.ts.map +1 -0
  18. package/dist/api/graphql_operations.js +325 -0
  19. package/dist/api/graphql_operations.js.map +1 -0
  20. package/dist/api/interface_graphql_mutations.d.ts +149 -0
  21. package/dist/api/interface_graphql_mutations.d.ts.map +1 -0
  22. package/dist/api/interface_graphql_mutations.js +8 -0
  23. package/dist/api/interface_graphql_mutations.js.map +1 -0
  24. package/dist/api/interface_graphql_system.d.ts +287 -0
  25. package/dist/api/interface_graphql_system.d.ts.map +1 -0
  26. package/dist/api/interface_graphql_system.js +9 -0
  27. package/dist/api/interface_graphql_system.js.map +1 -0
  28. package/dist/api/models_graphql.d.ts +167 -0
  29. package/dist/api/models_graphql.d.ts.map +1 -0
  30. package/dist/api/models_graphql.js +590 -0
  31. package/dist/api/models_graphql.js.map +1 -0
  32. package/dist/api/oauth2.d.ts +45 -0
  33. package/dist/api/oauth2.d.ts.map +1 -0
  34. package/dist/api/oauth2.js +35 -0
  35. package/dist/api/oauth2.js.map +1 -0
  36. package/dist/characteristics_base.d.ts +2 -2
  37. package/dist/characteristics_base.d.ts.map +1 -1
  38. package/dist/characteristics_base.js.map +1 -1
  39. package/dist/platform.d.ts +4 -4
  40. package/dist/platform.d.ts.map +1 -1
  41. package/dist/platform.js +7 -12
  42. package/dist/platform.js.map +1 -1
  43. package/dist/settings.d.ts +6 -3
  44. package/dist/settings.d.ts.map +1 -1
  45. package/dist/settings.js +7 -4
  46. package/dist/settings.js.map +1 -1
  47. package/eslint.config.mjs +172 -0
  48. package/package.json +24 -26
  49. package/dist/api/interface_config.d.ts +0 -185
  50. package/dist/api/interface_config.d.ts.map +0 -1
  51. package/dist/api/interface_config.js +0 -5
  52. package/dist/api/interface_config.js.map +0 -1
  53. package/dist/api/interface_locations.d.ts +0 -45
  54. package/dist/api/interface_locations.d.ts.map +0 -1
  55. package/dist/api/interface_locations.js +0 -5
  56. package/dist/api/interface_locations.js.map +0 -1
  57. package/dist/api/interface_profile.d.ts +0 -80
  58. package/dist/api/interface_profile.d.ts.map +0 -1
  59. package/dist/api/interface_profile.js +0 -5
  60. package/dist/api/interface_profile.js.map +0 -1
  61. package/dist/api/interface_status.d.ts +0 -90
  62. package/dist/api/interface_status.d.ts.map +0 -1
  63. package/dist/api/interface_status.js +0 -5
  64. package/dist/api/interface_status.js.map +0 -1
  65. package/dist/api/models.d.ts +0 -111
  66. package/dist/api/models.d.ts.map +0 -1
  67. package/dist/api/models.js +0 -572
  68. package/dist/api/models.js.map +0 -1
  69. package/dist/api/oauth.d.ts +0 -6
  70. package/dist/api/oauth.d.ts.map +0 -1
  71. package/dist/api/oauth.js +0 -49
  72. package/dist/api/oauth.js.map +0 -1
  73. package/dist/api/rest_client.d.ts +0 -15
  74. package/dist/api/rest_client.d.ts.map +0 -1
  75. package/dist/api/rest_client.js +0 -120
  76. package/dist/api/rest_client.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql_client.d.ts","sourceRoot":"","sources":["../../src/api/graphql_client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC;;;;;;GAMG;AACH,qBAAa,qBAAqB;IAWvB,QAAQ,EAAE,MAAM;IACvB,OAAO,CAAC,QAAQ;aACA,GAAG,EAAE,MAAM;IAZ7B,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,iBAAiB,CAAK;IAEvB,KAAK,EAAE,aAAa,CAAC;IAC5B,OAAO,CAAC,WAAW,CAAgB;gBAG1B,QAAQ,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EACR,GAAG,EAAE,MAAM;IAkE7B;;;;;OAKG;IAEG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAanC;;;;;OAKG;IAOG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBxC;;OAEG;YACW,mBAAmB;IAiCjC;;OAEG;YACW,qBAAqB;IAuCnC;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAsB9E;;;;;;OAMG;IACG,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAsBlF;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAGzB"}
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+ /**
3
+ * GraphQL Client for Carrier Infinity API
4
+ *
5
+ * This replaces the InfinityRestClient with a GraphQL-based implementation
6
+ * using OAuth 2.0 Bearer token authentication instead of OAuth 1.0 HMAC signatures.
7
+ */
8
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
9
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.InfinityGraphQLClient = void 0;
19
+ const settings_1 = require("../settings");
20
+ const oauth2_1 = require("./oauth2");
21
+ const graphql_operations_1 = require("./graphql_operations");
22
+ const axios_1 = __importDefault(require("axios"));
23
+ const typescript_memoize_1 = require("typescript-memoize");
24
+ const typescript_retry_decorator_1 = require("typescript-retry-decorator");
25
+ /**
26
+ * GraphQL Client for Carrier Infinity API
27
+ *
28
+ * Handles OAuth 2.0 authentication and GraphQL query/mutation execution.
29
+ * Much simpler than the old REST client - no XML parsing, no OAuth signatures,
30
+ * no custom certificates, no activation endpoint.
31
+ */
32
+ class InfinityGraphQLClient {
33
+ constructor(username, password, log) {
34
+ this.username = username;
35
+ this.password = password;
36
+ this.log = log;
37
+ this.access_token = '';
38
+ this.refresh_token = '';
39
+ this.token_type = 'Bearer';
40
+ this.token_expires_in = 0;
41
+ this.token_acquired_at = 0;
42
+ // Create authenticated Axios instance (for GraphQL queries after login)
43
+ this.axios = axios_1.default.create({
44
+ baseURL: settings_1.INFINITY_GRAPHQL_ENDPOINT,
45
+ headers: {
46
+ 'Content-Type': 'application/json',
47
+ Accept: 'application/json',
48
+ },
49
+ });
50
+ // Create no-auth Axios instance (for login mutation)
51
+ this.axiosNoAuth = axios_1.default.create({
52
+ baseURL: settings_1.INFINITY_GRAPHQL_NO_AUTH_ENDPOINT,
53
+ headers: {
54
+ 'Content-Type': 'application/json',
55
+ Accept: 'application/json',
56
+ },
57
+ });
58
+ // Response interceptor for debug logging
59
+ this.axios.interceptors.response.use(response => {
60
+ var _a, _b;
61
+ this.log.debug(`[GraphQL] ${(_a = response.request) === null || _a === void 0 ? void 0 : _a.method} ${response.request.host}${(_b = response.request) === null || _b === void 0 ? void 0 : _b.path}`, `${response.status} ${response.statusText}`);
62
+ return response;
63
+ }, error => {
64
+ var _a, _b, _c, _d, _e;
65
+ if (axios_1.default.isAxiosError(error)) {
66
+ this.log.debug(`[GraphQL] ${(_a = error.request) === null || _a === void 0 ? void 0 : _a.method} ${(_b = error.request) === null || _b === void 0 ? void 0 : _b.host}${(_c = error.request) === null || _c === void 0 ? void 0 : _c.path}`, `${(_d = error.response) === null || _d === void 0 ? void 0 : _d.status} ${(_e = error.response) === null || _e === void 0 ? void 0 : _e.statusText}`);
67
+ }
68
+ return Promise.reject(error);
69
+ });
70
+ // Same for no-auth instance
71
+ this.axiosNoAuth.interceptors.response.use(response => {
72
+ var _a, _b;
73
+ this.log.debug(`[GraphQL-NoAuth] ${(_a = response.request) === null || _a === void 0 ? void 0 : _a.method} ${response.request.host}${(_b = response.request) === null || _b === void 0 ? void 0 : _b.path}`, `${response.status} ${response.statusText}`);
74
+ return response;
75
+ }, error => {
76
+ var _a, _b, _c, _d, _e;
77
+ if (axios_1.default.isAxiosError(error)) {
78
+ this.log.debug(`[GraphQL-NoAuth] ${(_a = error.request) === null || _a === void 0 ? void 0 : _a.method} ${(_b = error.request) === null || _b === void 0 ? void 0 : _b.host}${(_c = error.request) === null || _c === void 0 ? void 0 : _c.path}`, `${(_d = error.response) === null || _d === void 0 ? void 0 : _d.status} ${(_e = error.response) === null || _e === void 0 ? void 0 : _e.statusText}`);
79
+ }
80
+ return Promise.reject(error);
81
+ });
82
+ // OAuth 2.0 Bearer token injection for authenticated instance
83
+ this.axios.interceptors.request.use(config => {
84
+ return oauth2_1.OAuth2Headers.intercept(config, this.access_token, this.token_type);
85
+ });
86
+ }
87
+ /**
88
+ * Refresh OAuth 2.0 token with memoization (24 hours)
89
+ *
90
+ * This is called before every API request to ensure we have a valid token.
91
+ * The memoization ensures we only refresh once per day unless the token expires.
92
+ */
93
+ async refreshToken() {
94
+ try {
95
+ await this.forceRefreshToken();
96
+ this.log.info('Completed login / token refresh successfully.');
97
+ }
98
+ catch (error) {
99
+ this.log.error('[API] Could not refresh access token: ', axios_1.default.isAxiosError(error) ? error.message : error);
100
+ throw error;
101
+ }
102
+ }
103
+ /**
104
+ * Force refresh OAuth 2.0 token with retry logic
105
+ *
106
+ * If we have a refresh token, use the Okta token endpoint.
107
+ * Otherwise, use the assistedLogin mutation to get a new token.
108
+ */
109
+ async forceRefreshToken() {
110
+ this.log.info('Attempting login / token refresh.');
111
+ // Check if we can use refresh token
112
+ const now = Date.now() / 1000;
113
+ const tokenAge = now - this.token_acquired_at;
114
+ const tokenExpired = tokenAge >= this.token_expires_in;
115
+ if (this.refresh_token && !tokenExpired) {
116
+ // Use Okta refresh token endpoint
117
+ try {
118
+ await this.refreshTokenViaOkta();
119
+ return;
120
+ }
121
+ catch (error) {
122
+ this.log.warn('Okta token refresh failed, falling back to assistedLogin:', error);
123
+ // Fall through to assistedLogin
124
+ }
125
+ }
126
+ // Use assistedLogin mutation
127
+ await this.loginViaAssistedLogin();
128
+ }
129
+ /**
130
+ * Refresh token via Okta OAuth2 endpoint
131
+ */
132
+ async refreshTokenViaOkta() {
133
+ const response = await axios_1.default.post(settings_1.INFINITY_OAUTH_TOKEN_ENDPOINT, {
134
+ client_id: settings_1.INFINITY_OAUTH_CLIENT_ID,
135
+ grant_type: 'refresh_token',
136
+ refresh_token: this.refresh_token,
137
+ scope: 'offline_access',
138
+ }, {
139
+ headers: {
140
+ 'Content-Type': 'application/json',
141
+ },
142
+ });
143
+ if (response.data.access_token) {
144
+ this.access_token = response.data.access_token;
145
+ this.token_type = response.data.token_type;
146
+ this.token_expires_in = response.data.expires_in;
147
+ this.token_acquired_at = Date.now() / 1000;
148
+ // Okta may return a new refresh token
149
+ if (response.data.refresh_token) {
150
+ this.refresh_token = response.data.refresh_token;
151
+ }
152
+ this.log.debug('Token refreshed via Okta endpoint.');
153
+ }
154
+ else {
155
+ throw new Error('Okta token refresh did not return access_token.');
156
+ }
157
+ }
158
+ /**
159
+ * Login via assistedLogin GraphQL mutation
160
+ */
161
+ async loginViaAssistedLogin() {
162
+ var _a;
163
+ const input = {
164
+ username: this.username,
165
+ password: this.password,
166
+ };
167
+ const response = await this.axiosNoAuth.post('', {
168
+ query: graphql_operations_1.ASSISTED_LOGIN,
169
+ variables: { input },
170
+ });
171
+ // Check for GraphQL errors
172
+ if (response.data.errors && response.data.errors.length > 0) {
173
+ const errorMessages = response.data.errors.map(e => e.message).join(', ');
174
+ throw new Error(`GraphQL errors during login: ${errorMessages}`);
175
+ }
176
+ // Check for mutation-level errors
177
+ const result = (_a = response.data.data) === null || _a === void 0 ? void 0 : _a.assistedLogin;
178
+ if (!result || !result.success) {
179
+ const errorMessage = (result === null || result === void 0 ? void 0 : result.errorMessage) || 'Unknown error';
180
+ throw new Error(`assistedLogin failed: ${errorMessage}`);
181
+ }
182
+ // Extract tokens
183
+ const tokenData = result.data;
184
+ if (!tokenData.access_token) {
185
+ throw new Error('assistedLogin did not return access_token.');
186
+ }
187
+ this.access_token = tokenData.access_token;
188
+ this.refresh_token = tokenData.refresh_token;
189
+ this.token_type = tokenData.token_type;
190
+ this.token_expires_in = tokenData.expires_in;
191
+ this.token_acquired_at = Date.now() / 1000;
192
+ this.log.debug('Token acquired via assistedLogin mutation.');
193
+ }
194
+ /**
195
+ * Execute a GraphQL query
196
+ *
197
+ * @param query - GraphQL query string
198
+ * @param variables - Query variables
199
+ * @returns GraphQL response data
200
+ */
201
+ async query(query, variables) {
202
+ // Ensure we have a valid token
203
+ await this.refreshToken();
204
+ const response = await this.axios.post('', {
205
+ query,
206
+ variables,
207
+ });
208
+ // Check for GraphQL errors
209
+ if (response.data.errors && response.data.errors.length > 0) {
210
+ const errorMessages = response.data.errors.map(e => e.message).join(', ');
211
+ throw new Error(`GraphQL query errors: ${errorMessages}`);
212
+ }
213
+ if (!response.data.data) {
214
+ throw new Error('GraphQL query returned no data.');
215
+ }
216
+ return response.data.data;
217
+ }
218
+ /**
219
+ * Execute a GraphQL mutation
220
+ *
221
+ * @param mutation - GraphQL mutation string
222
+ * @param variables - Mutation variables
223
+ * @returns GraphQL response data
224
+ */
225
+ async mutate(mutation, variables) {
226
+ // Ensure we have a valid token
227
+ await this.refreshToken();
228
+ const response = await this.axios.post('', {
229
+ query: mutation,
230
+ variables,
231
+ });
232
+ // Check for GraphQL errors
233
+ if (response.data.errors && response.data.errors.length > 0) {
234
+ const errorMessages = response.data.errors.map(e => e.message).join(', ');
235
+ throw new Error(`GraphQL mutation errors: ${errorMessages}`);
236
+ }
237
+ if (!response.data.data) {
238
+ throw new Error('GraphQL mutation returned no data.');
239
+ }
240
+ return response.data.data;
241
+ }
242
+ /**
243
+ * Helper to check if GraphQL response has errors
244
+ */
245
+ hasGraphQLErrors(errors) {
246
+ return !!(errors && errors.length > 0);
247
+ }
248
+ }
249
+ exports.InfinityGraphQLClient = InfinityGraphQLClient;
250
+ __decorate([
251
+ (0, typescript_memoize_1.MemoizeExpiring)(24 * 60 * 60 * 1000) // every 24 hrs
252
+ ], InfinityGraphQLClient.prototype, "refreshToken", null);
253
+ __decorate([
254
+ (0, typescript_retry_decorator_1.Retryable)({
255
+ maxAttempts: 5,
256
+ backOffPolicy: typescript_retry_decorator_1.BackOffPolicy.ExponentialBackOffPolicy,
257
+ backOff: 1000,
258
+ exponentialOption: { maxInterval: 5 * 60 * 1000, multiplier: 5 },
259
+ })
260
+ ], InfinityGraphQLClient.prototype, "forceRefreshToken", null);
261
+ //# sourceMappingURL=graphql_client.js.map
@@ -0,0 +1 @@
1
+ {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 * GraphQL Operations for Carrier Infinity API
3
+ *
4
+ * This file contains all GraphQL queries and mutations used to interact with
5
+ * the Carrier Infinity GraphQL API at dataservice.infinity.iot.carrier.com
6
+ */
7
+ /**
8
+ * Authentication mutation - used to obtain OAuth tokens
9
+ * Endpoint: https://dataservice.infinity.iot.carrier.com/graphql-no-auth
10
+ * No authentication required (this IS the authentication)
11
+ */
12
+ export declare const ASSISTED_LOGIN = "\n mutation assistedLogin($input: AssistedLoginInput!) {\n assistedLogin(input: $input) {\n success\n status\n errorMessage\n data {\n token_type\n expires_in\n access_token\n scope\n refresh_token\n }\n }\n }\n";
13
+ /**
14
+ * User information query - fetches user profile and location data
15
+ * Used to discover systems associated with a user account
16
+ */
17
+ export declare const GET_USER = "\n query getUser($userName: String!, $appVersion: String, $brand: String, $os: String, $osVersion: String) {\n user(\n userName: $userName\n appVersion: $appVersion\n brand: $brand\n os: $os\n osVersion: $osVersion\n ) {\n username\n identityId\n first\n last\n email\n emailVerified\n postal\n locations {\n locationId\n name\n systems {\n config {\n zones {\n id\n enabled\n }\n }\n profile {\n serial\n name\n }\n status {\n isDisconnected\n }\n }\n devices {\n deviceId\n type\n thingName\n name\n connectionStatus\n }\n }\n }\n }\n";
18
+ /**
19
+ * Infinity Systems query - fetches complete system data (profile + status + config)
20
+ * This single query replaces the old REST API's separate profile, status, and config endpoints
21
+ */
22
+ export declare const GET_INFINITY_SYSTEMS = "\n query getInfinitySystems($userName: String!) {\n infinitySystems(userName: $userName) {\n profile {\n serial\n name\n firmware\n model\n brand\n indoorModel\n indoorSerial\n idutype\n idusource\n outdoorModel\n outdoorSerial\n odutype\n }\n status {\n localTime\n localTimeOffset\n utcTime\n wcTime\n isDisconnected\n cfgem\n mode\n vacatrunning\n oat\n odu {\n type\n opstat\n }\n filtrlvl\n idu {\n type\n opstat\n cfm\n statpress\n blwrpm\n }\n vent\n ventlvl\n humid\n humlvl\n uvlvl\n zones {\n id\n rt\n rh\n fan\n htsp\n clsp\n hold\n enabled\n currentActivity\n zoneconditioning\n }\n }\n config {\n etag\n mode\n cfgem\n cfgdead\n cfgvent\n cfghumid\n cfguv\n cfgfan\n heatsource\n vacat\n vacstart\n vacend\n vacmint\n vacmaxt\n vacfan\n fueltype\n gasunit\n filtertype\n filterinterval\n humidityVacation {\n rclgovercool\n ventspdclg\n ventclg\n rhtg\n humidifier\n humid\n venthtg\n rclg\n ventspdhtg\n }\n zones {\n id\n name\n enabled\n hold\n holdActivity\n otmr\n occEnabled\n program {\n id\n day {\n id\n zoneId\n period {\n id\n zoneId\n dayId\n activity\n time\n enabled\n }\n }\n }\n activities {\n id\n zoneId\n type\n fan\n htsp\n clsp\n }\n }\n humidityAway {\n humid\n humidifier\n rhtg\n rclg\n rclgovercool\n }\n humidityHome {\n humid\n humidifier\n rhtg\n rclg\n rclgovercool\n }\n }\n }\n }\n";
23
+ /**
24
+ * Energy data query - fetches energy usage and efficiency data
25
+ * This is new functionality not available in the old REST API
26
+ */
27
+ export declare const GET_INFINITY_ENERGY = "\n query getInfinityEnergy($serial: String!) {\n infinityEnergy(serial: $serial) {\n energyConfig {\n cooling {\n display\n enabled\n }\n eheat {\n display\n enabled\n }\n fan {\n display\n enabled\n }\n fangas {\n display\n enabled\n }\n gas {\n display\n enabled\n }\n hpheat {\n display\n enabled\n }\n looppump {\n display\n enabled\n }\n reheat {\n display\n enabled\n }\n hspf\n seer\n }\n energyPeriods {\n energyPeriodType\n eHeatKwh\n coolingKwh\n fanGasKwh\n fanKwh\n hPHeatKwh\n loopPumpKwh\n gasKwh\n reheatKwh\n }\n }\n }\n";
28
+ /**
29
+ * Update system configuration mutation
30
+ * Used for system-level settings like mode, humidity, heat source, etc.
31
+ *
32
+ * Example inputs:
33
+ * - Set mode: { serial, mode: "cool" }
34
+ * - Set humidity: { serial, humidityHome: { humidifier: "on", rhtg: 8 } }
35
+ * - Set heat source: { serial, heatsource: "system" }
36
+ */
37
+ export declare const UPDATE_INFINITY_CONFIG = "\n mutation updateInfinityConfig($input: InfinityConfigInput!) {\n updateInfinityConfig(input: $input) {\n etag\n }\n }\n";
38
+ /**
39
+ * Update zone activity mutation
40
+ * Used for changing zone activity type, setpoints, and fan mode
41
+ *
42
+ * Example inputs:
43
+ * - Set manual activity: { serial, zoneId, activityType: "manual", clsp: "75", htsp: "68", fan: "med" }
44
+ * - Update fan: { serial, zoneId, activityType: "manual", fan: "high" }
45
+ */
46
+ export declare const UPDATE_INFINITY_ZONE_ACTIVITY = "\n mutation updateInfinityZoneActivity($input: InfinityZoneActivityInput!) {\n updateInfinityZoneActivity(input: $input) {\n etag\n }\n }\n";
47
+ /**
48
+ * Update zone configuration mutation
49
+ * Used for zone-level settings like hold status, schedule, etc.
50
+ *
51
+ * Example inputs:
52
+ * - Set hold: { serial, zoneId, hold: "on", holdActivity: "manual", otmr: "2024-01-30T18:00:00" }
53
+ * - Cancel hold: { serial, zoneId, hold: "off", holdActivity: null, otmr: null }
54
+ */
55
+ export declare const UPDATE_INFINITY_ZONE_CONFIG = "\n mutation updateInfinityZoneConfig($input: InfinityZoneConfigInput!) {\n updateInfinityZoneConfig(input: $input) {\n etag\n }\n }\n";
56
+ //# sourceMappingURL=graphql_operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql_operations.d.ts","sourceRoot":"","sources":["../../src/api/graphql_operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc,4RAe1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,40BA4CpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,q5EAyIhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,s4BAoD/B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,2IAMlC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,6JAMzC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,uJAMvC,CAAC"}
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ /**
3
+ * GraphQL Operations for Carrier Infinity API
4
+ *
5
+ * This file contains all GraphQL queries and mutations used to interact with
6
+ * the Carrier Infinity GraphQL API at dataservice.infinity.iot.carrier.com
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.UPDATE_INFINITY_ZONE_CONFIG = exports.UPDATE_INFINITY_ZONE_ACTIVITY = exports.UPDATE_INFINITY_CONFIG = exports.GET_INFINITY_ENERGY = exports.GET_INFINITY_SYSTEMS = exports.GET_USER = exports.ASSISTED_LOGIN = void 0;
10
+ /**
11
+ * Authentication mutation - used to obtain OAuth tokens
12
+ * Endpoint: https://dataservice.infinity.iot.carrier.com/graphql-no-auth
13
+ * No authentication required (this IS the authentication)
14
+ */
15
+ exports.ASSISTED_LOGIN = `
16
+ mutation assistedLogin($input: AssistedLoginInput!) {
17
+ assistedLogin(input: $input) {
18
+ success
19
+ status
20
+ errorMessage
21
+ data {
22
+ token_type
23
+ expires_in
24
+ access_token
25
+ scope
26
+ refresh_token
27
+ }
28
+ }
29
+ }
30
+ `;
31
+ /**
32
+ * User information query - fetches user profile and location data
33
+ * Used to discover systems associated with a user account
34
+ */
35
+ exports.GET_USER = `
36
+ query getUser($userName: String!, $appVersion: String, $brand: String, $os: String, $osVersion: String) {
37
+ user(
38
+ userName: $userName
39
+ appVersion: $appVersion
40
+ brand: $brand
41
+ os: $os
42
+ osVersion: $osVersion
43
+ ) {
44
+ username
45
+ identityId
46
+ first
47
+ last
48
+ email
49
+ emailVerified
50
+ postal
51
+ locations {
52
+ locationId
53
+ name
54
+ systems {
55
+ config {
56
+ zones {
57
+ id
58
+ enabled
59
+ }
60
+ }
61
+ profile {
62
+ serial
63
+ name
64
+ }
65
+ status {
66
+ isDisconnected
67
+ }
68
+ }
69
+ devices {
70
+ deviceId
71
+ type
72
+ thingName
73
+ name
74
+ connectionStatus
75
+ }
76
+ }
77
+ }
78
+ }
79
+ `;
80
+ /**
81
+ * Infinity Systems query - fetches complete system data (profile + status + config)
82
+ * This single query replaces the old REST API's separate profile, status, and config endpoints
83
+ */
84
+ exports.GET_INFINITY_SYSTEMS = `
85
+ query getInfinitySystems($userName: String!) {
86
+ infinitySystems(userName: $userName) {
87
+ profile {
88
+ serial
89
+ name
90
+ firmware
91
+ model
92
+ brand
93
+ indoorModel
94
+ indoorSerial
95
+ idutype
96
+ idusource
97
+ outdoorModel
98
+ outdoorSerial
99
+ odutype
100
+ }
101
+ status {
102
+ localTime
103
+ localTimeOffset
104
+ utcTime
105
+ wcTime
106
+ isDisconnected
107
+ cfgem
108
+ mode
109
+ vacatrunning
110
+ oat
111
+ odu {
112
+ type
113
+ opstat
114
+ }
115
+ filtrlvl
116
+ idu {
117
+ type
118
+ opstat
119
+ cfm
120
+ statpress
121
+ blwrpm
122
+ }
123
+ vent
124
+ ventlvl
125
+ humid
126
+ humlvl
127
+ uvlvl
128
+ zones {
129
+ id
130
+ rt
131
+ rh
132
+ fan
133
+ htsp
134
+ clsp
135
+ hold
136
+ enabled
137
+ currentActivity
138
+ zoneconditioning
139
+ }
140
+ }
141
+ config {
142
+ etag
143
+ mode
144
+ cfgem
145
+ cfgdead
146
+ cfgvent
147
+ cfghumid
148
+ cfguv
149
+ cfgfan
150
+ heatsource
151
+ vacat
152
+ vacstart
153
+ vacend
154
+ vacmint
155
+ vacmaxt
156
+ vacfan
157
+ fueltype
158
+ gasunit
159
+ filtertype
160
+ filterinterval
161
+ humidityVacation {
162
+ rclgovercool
163
+ ventspdclg
164
+ ventclg
165
+ rhtg
166
+ humidifier
167
+ humid
168
+ venthtg
169
+ rclg
170
+ ventspdhtg
171
+ }
172
+ zones {
173
+ id
174
+ name
175
+ enabled
176
+ hold
177
+ holdActivity
178
+ otmr
179
+ occEnabled
180
+ program {
181
+ id
182
+ day {
183
+ id
184
+ zoneId
185
+ period {
186
+ id
187
+ zoneId
188
+ dayId
189
+ activity
190
+ time
191
+ enabled
192
+ }
193
+ }
194
+ }
195
+ activities {
196
+ id
197
+ zoneId
198
+ type
199
+ fan
200
+ htsp
201
+ clsp
202
+ }
203
+ }
204
+ humidityAway {
205
+ humid
206
+ humidifier
207
+ rhtg
208
+ rclg
209
+ rclgovercool
210
+ }
211
+ humidityHome {
212
+ humid
213
+ humidifier
214
+ rhtg
215
+ rclg
216
+ rclgovercool
217
+ }
218
+ }
219
+ }
220
+ }
221
+ `;
222
+ /**
223
+ * Energy data query - fetches energy usage and efficiency data
224
+ * This is new functionality not available in the old REST API
225
+ */
226
+ exports.GET_INFINITY_ENERGY = `
227
+ query getInfinityEnergy($serial: String!) {
228
+ infinityEnergy(serial: $serial) {
229
+ energyConfig {
230
+ cooling {
231
+ display
232
+ enabled
233
+ }
234
+ eheat {
235
+ display
236
+ enabled
237
+ }
238
+ fan {
239
+ display
240
+ enabled
241
+ }
242
+ fangas {
243
+ display
244
+ enabled
245
+ }
246
+ gas {
247
+ display
248
+ enabled
249
+ }
250
+ hpheat {
251
+ display
252
+ enabled
253
+ }
254
+ looppump {
255
+ display
256
+ enabled
257
+ }
258
+ reheat {
259
+ display
260
+ enabled
261
+ }
262
+ hspf
263
+ seer
264
+ }
265
+ energyPeriods {
266
+ energyPeriodType
267
+ eHeatKwh
268
+ coolingKwh
269
+ fanGasKwh
270
+ fanKwh
271
+ hPHeatKwh
272
+ loopPumpKwh
273
+ gasKwh
274
+ reheatKwh
275
+ }
276
+ }
277
+ }
278
+ `;
279
+ /**
280
+ * Update system configuration mutation
281
+ * Used for system-level settings like mode, humidity, heat source, etc.
282
+ *
283
+ * Example inputs:
284
+ * - Set mode: { serial, mode: "cool" }
285
+ * - Set humidity: { serial, humidityHome: { humidifier: "on", rhtg: 8 } }
286
+ * - Set heat source: { serial, heatsource: "system" }
287
+ */
288
+ exports.UPDATE_INFINITY_CONFIG = `
289
+ mutation updateInfinityConfig($input: InfinityConfigInput!) {
290
+ updateInfinityConfig(input: $input) {
291
+ etag
292
+ }
293
+ }
294
+ `;
295
+ /**
296
+ * Update zone activity mutation
297
+ * Used for changing zone activity type, setpoints, and fan mode
298
+ *
299
+ * Example inputs:
300
+ * - Set manual activity: { serial, zoneId, activityType: "manual", clsp: "75", htsp: "68", fan: "med" }
301
+ * - Update fan: { serial, zoneId, activityType: "manual", fan: "high" }
302
+ */
303
+ exports.UPDATE_INFINITY_ZONE_ACTIVITY = `
304
+ mutation updateInfinityZoneActivity($input: InfinityZoneActivityInput!) {
305
+ updateInfinityZoneActivity(input: $input) {
306
+ etag
307
+ }
308
+ }
309
+ `;
310
+ /**
311
+ * Update zone configuration mutation
312
+ * Used for zone-level settings like hold status, schedule, etc.
313
+ *
314
+ * Example inputs:
315
+ * - Set hold: { serial, zoneId, hold: "on", holdActivity: "manual", otmr: "2024-01-30T18:00:00" }
316
+ * - Cancel hold: { serial, zoneId, hold: "off", holdActivity: null, otmr: null }
317
+ */
318
+ exports.UPDATE_INFINITY_ZONE_CONFIG = `
319
+ mutation updateInfinityZoneConfig($input: InfinityZoneConfigInput!) {
320
+ updateInfinityZoneConfig(input: $input) {
321
+ etag
322
+ }
323
+ }
324
+ `;
325
+ //# sourceMappingURL=graphql_operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql_operations.js","sourceRoot":"","sources":["../../src/api/graphql_operations.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH;;;;GAIG;AACU,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;CAe7B,CAAC;AAEF;;;GAGG;AACU,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CvB,CAAC;AAEF;;;GAGG;AACU,QAAA,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyInC,CAAC;AAEF;;;GAGG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDlC,CAAC;AAEF;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAG;;;;;;CAMrC,CAAC;AAEF;;;;;;;GAOG;AACU,QAAA,6BAA6B,GAAG;;;;;;CAM5C,CAAC;AAEF;;;;;;;GAOG;AACU,QAAA,2BAA2B,GAAG;;;;;;CAM1C,CAAC"}