@telemetryos/root-sdk 1.2.0 → 1.4.0
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/CHANGELOG.md +16 -0
- package/README.md +68 -13
- package/dist/client.d.ts +44 -3
- package/dist/device.d.ts +26 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +53 -8
- package/dist/index.js +447 -198
- package/dist/media.d.ts +13 -24
- package/dist/proxy.d.ts +48 -0
- package/dist/root-settings-navigation.d.ts +1 -1
- package/dist/users.d.ts +1 -4
- package/dist/weather.d.ts +214 -0
- package/package.json +1 -1
package/dist/media.d.ts
CHANGED
|
@@ -30,42 +30,31 @@ export declare class Media {
|
|
|
30
30
|
_client: Client;
|
|
31
31
|
constructor(client: Client);
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Retrieves all media folders in the account.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
* such as name, ID, or other folder properties.
|
|
37
|
-
*
|
|
38
|
-
* @param query An object with partial MediaFolder properties to match against
|
|
39
|
-
* @returns A promise that resolves to an array of matching media folders
|
|
40
|
-
*/
|
|
41
|
-
queryFolders(query: Partial<MediaFolder>): Promise<MediaFolder[]>;
|
|
42
|
-
/**
|
|
43
|
-
* Retrieves media folders that have been tagged with a specific tag.
|
|
44
|
-
*
|
|
45
|
-
* @param tagName The name of the tag to search for
|
|
46
|
-
* @returns A promise that resolves to an array of media folders with the specified tag
|
|
35
|
+
* @returns A promise that resolves to an array of all media folders
|
|
47
36
|
*/
|
|
48
|
-
|
|
37
|
+
getAllFolders(): Promise<MediaFolder[]>;
|
|
49
38
|
/**
|
|
50
|
-
* Retrieves
|
|
39
|
+
* Retrieves all media content within a specific folder.
|
|
51
40
|
*
|
|
52
|
-
* @param
|
|
53
|
-
* @returns A promise that resolves to
|
|
41
|
+
* @param folderId The unique identifier of the folder
|
|
42
|
+
* @returns A promise that resolves to an array of media content in the folder
|
|
54
43
|
*/
|
|
55
|
-
|
|
44
|
+
getAllByFolderId(folderId: string): Promise<MediaContent[]>;
|
|
56
45
|
/**
|
|
57
|
-
* Retrieves
|
|
46
|
+
* Retrieves media content that has been tagged with a specific tag.
|
|
58
47
|
*
|
|
59
|
-
* @param
|
|
60
|
-
* @returns A promise that resolves to an array of media content
|
|
48
|
+
* @param tagName The name of the tag to search for
|
|
49
|
+
* @returns A promise that resolves to an array of media content with the specified tag
|
|
61
50
|
*/
|
|
62
|
-
|
|
51
|
+
getAllByTag(tagName: string): Promise<MediaContent[]>;
|
|
63
52
|
/**
|
|
64
53
|
* Retrieves a specific media content item by its ID.
|
|
65
54
|
*
|
|
66
55
|
* @param id The unique identifier of the media content to retrieve
|
|
67
|
-
* @returns A promise that resolves to the media content
|
|
56
|
+
* @returns A promise that resolves to the media content with the specified ID
|
|
68
57
|
*/
|
|
69
|
-
|
|
58
|
+
getById(id: string): Promise<MediaContent>;
|
|
70
59
|
}
|
|
71
60
|
export {};
|
package/dist/proxy.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Client } from './client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a proxy API for fetching third-party content through the TelemetryOS proxy service.
|
|
4
|
+
*
|
|
5
|
+
* This API allows applications to fetch content from external URLs through the platform's
|
|
6
|
+
* proxy service, which handles authentication, caching, bandwidth quotas, and CORS issues.
|
|
7
|
+
* The proxy is useful for accessing external APIs or content that may have CORS restrictions.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Proxy {
|
|
10
|
+
_client: Client;
|
|
11
|
+
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Fetches content from an external URL through the TelemetryOS proxy service.
|
|
14
|
+
*
|
|
15
|
+
* This method has the same interface as the native `fetch()` API but routes the request through
|
|
16
|
+
* the platform's proxy service. This is useful for:
|
|
17
|
+
* - Accessing external APIs that have CORS restrictions
|
|
18
|
+
* - Fetching content with platform authentication
|
|
19
|
+
* - Benefiting from platform caching and bandwidth management
|
|
20
|
+
* - Proxying content from external sources
|
|
21
|
+
*
|
|
22
|
+
* @param input The URL to fetch from (as a string or URL object)
|
|
23
|
+
* @param init Optional fetch options (method, headers, body, signal, etc.)
|
|
24
|
+
* @returns A promise that resolves to a standard Response object
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Fetch JSON from an external API
|
|
28
|
+
* const response = await proxy().fetch('https://api.example.com/data');
|
|
29
|
+
* const data = await response.json();
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // POST data to an external API
|
|
33
|
+
* const response = await proxy().fetch('https://api.example.com/submit', {
|
|
34
|
+
* method: 'POST',
|
|
35
|
+
* headers: { 'Content-Type': 'application/json' },
|
|
36
|
+
* body: JSON.stringify({ key: 'value' })
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Fetch an image through the proxy
|
|
41
|
+
* const response = await proxy().fetch('https://example.com/image.jpg');
|
|
42
|
+
* const blob = await response.blob();
|
|
43
|
+
* const imageUrl = URL.createObjectURL(blob);
|
|
44
|
+
*/
|
|
45
|
+
fetch(input: string, init?: RequestInit): Promise<Response>;
|
|
46
|
+
fetch(input: URL, init?: RequestInit): Promise<Response>;
|
|
47
|
+
fetch(input: Request, init?: RequestInit): Promise<Response>;
|
|
48
|
+
}
|
|
@@ -12,7 +12,7 @@ type RootSettingsNavigationOpts = {
|
|
|
12
12
|
entries: RootSettingsNavigationEntry[];
|
|
13
13
|
};
|
|
14
14
|
export type RootSettingsApplicationNavigationState = {
|
|
15
|
-
|
|
15
|
+
applicationSpecifier: string;
|
|
16
16
|
entries: RootSettingsNavigationEntry[];
|
|
17
17
|
};
|
|
18
18
|
type RootSettingsNavigationState = Record<string, RootSettingsApplicationNavigationState>;
|
package/dist/users.d.ts
CHANGED
|
@@ -2,9 +2,6 @@ import { Client } from './index.js';
|
|
|
2
2
|
type CurrentUser = {
|
|
3
3
|
id: string;
|
|
4
4
|
};
|
|
5
|
-
type GetCurrentUserResult = {
|
|
6
|
-
user: CurrentUser;
|
|
7
|
-
};
|
|
8
5
|
export declare class Users {
|
|
9
6
|
_client: Client;
|
|
10
7
|
constructor(client: Client);
|
|
@@ -20,6 +17,6 @@ export declare class Users {
|
|
|
20
17
|
* const userResult = await users.getCurrent();
|
|
21
18
|
* console.log(`Current user ID: ${userResult.user.id}`);
|
|
22
19
|
*/
|
|
23
|
-
getCurrent(): Promise<
|
|
20
|
+
getCurrent(): Promise<CurrentUser>;
|
|
24
21
|
}
|
|
25
22
|
export {};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import type { Client } from './client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Weather condition data with current conditions
|
|
4
|
+
*/
|
|
5
|
+
export type WeatherConditions = {
|
|
6
|
+
/** City name (localized) */
|
|
7
|
+
CityLocalized: string;
|
|
8
|
+
/** City name (English) */
|
|
9
|
+
CityEnglish: string;
|
|
10
|
+
/** Wind abbreviation */
|
|
11
|
+
WindAbbr: string;
|
|
12
|
+
/** ISO country code */
|
|
13
|
+
CountryCode: string;
|
|
14
|
+
/** Timezone */
|
|
15
|
+
Timezone: string;
|
|
16
|
+
/** Weather description text */
|
|
17
|
+
WeatherText: string;
|
|
18
|
+
/** State/Province */
|
|
19
|
+
State: string;
|
|
20
|
+
/** Part of day (day/night indicator) */
|
|
21
|
+
Pod: string;
|
|
22
|
+
/** Weather code (internal mapping) */
|
|
23
|
+
WeatherCode: string;
|
|
24
|
+
/** Wind direction in degrees */
|
|
25
|
+
WindDirectionDegrees: string;
|
|
26
|
+
/** Wind direction (cardinal direction in English) */
|
|
27
|
+
WindDirectionEnglish: string;
|
|
28
|
+
/** Wind direction (localized) */
|
|
29
|
+
WindDirectionLocalized: string;
|
|
30
|
+
/** Relative humidity percentage */
|
|
31
|
+
RelativeHumidity: number;
|
|
32
|
+
/** Unix timestamp */
|
|
33
|
+
Timestamp: number;
|
|
34
|
+
/** Longitude */
|
|
35
|
+
Longitude: number;
|
|
36
|
+
/** Latitude */
|
|
37
|
+
Latitude: number;
|
|
38
|
+
/** Temperature */
|
|
39
|
+
Temp: number;
|
|
40
|
+
/** Atmospheric pressure */
|
|
41
|
+
Pressure: number;
|
|
42
|
+
/** Wind speed */
|
|
43
|
+
WindSpeed: number;
|
|
44
|
+
/** Visibility distance */
|
|
45
|
+
Visibility: number;
|
|
46
|
+
/** Precipitation amount */
|
|
47
|
+
Precip: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Weather forecast data point
|
|
51
|
+
*/
|
|
52
|
+
export type WeatherForecast = {
|
|
53
|
+
/** ISO datetime string */
|
|
54
|
+
Datetime: string;
|
|
55
|
+
/** Part of day (day/night indicator) */
|
|
56
|
+
Pod: string;
|
|
57
|
+
/** Weather description label */
|
|
58
|
+
Label: string;
|
|
59
|
+
/** Weather code */
|
|
60
|
+
WeatherCode: string;
|
|
61
|
+
/** Unix timestamp */
|
|
62
|
+
Timestamp: number;
|
|
63
|
+
/** Temperature */
|
|
64
|
+
Temp: number;
|
|
65
|
+
/** Minimum temperature */
|
|
66
|
+
MinTemp: number;
|
|
67
|
+
/** Maximum temperature */
|
|
68
|
+
MaxTemp: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Parameters for weather requests
|
|
72
|
+
*/
|
|
73
|
+
export type WeatherRequestParams = {
|
|
74
|
+
/** City name (can include state/country: "city, state, country") */
|
|
75
|
+
city?: string;
|
|
76
|
+
/** Postal/ZIP code (alternative to city) */
|
|
77
|
+
postalCode?: string;
|
|
78
|
+
/** Latitude (if city not provided) */
|
|
79
|
+
lat?: string;
|
|
80
|
+
/** Longitude (if city not provided) */
|
|
81
|
+
lon?: string;
|
|
82
|
+
/** Units system: "imperial" or "metric" */
|
|
83
|
+
units?: 'imperial' | 'metric';
|
|
84
|
+
/** Language code for localized responses */
|
|
85
|
+
language?: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Parameters for daily forecast requests
|
|
89
|
+
*/
|
|
90
|
+
export type DailyForecastParams = WeatherRequestParams & {
|
|
91
|
+
/** Number of days to forecast */
|
|
92
|
+
days?: number;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Parameters for hourly forecast requests
|
|
96
|
+
*/
|
|
97
|
+
export type HourlyForecastParams = WeatherRequestParams & {
|
|
98
|
+
/** Number of hours to forecast */
|
|
99
|
+
hours?: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Weather API for retrieving weather data from various providers
|
|
103
|
+
*
|
|
104
|
+
* Provides access to current conditions and forecasts from WeatherBit
|
|
105
|
+
* and AccuWeather through the General Integrations Service.
|
|
106
|
+
*/
|
|
107
|
+
export declare class Weather {
|
|
108
|
+
_client: Client;
|
|
109
|
+
constructor(client: Client);
|
|
110
|
+
/**
|
|
111
|
+
* Retrieves current weather conditions for a specified location using WeatherBit.
|
|
112
|
+
*
|
|
113
|
+
* @param params - Weather request parameters including location and units
|
|
114
|
+
* @returns A promise that resolves to the current weather conditions
|
|
115
|
+
* @throws {Error} If the request fails or location is invalid
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* // Get weather by city
|
|
120
|
+
* const weather = await weather.getConditions({ city: 'New York', units: 'imperial' })
|
|
121
|
+
*
|
|
122
|
+
* // Get weather by postal code
|
|
123
|
+
* const weather = await weather.getConditions({ postalCode: '10001', units: 'metric' })
|
|
124
|
+
*
|
|
125
|
+
* // Get weather by coordinates
|
|
126
|
+
* const weather = await weather.getConditions({ lat: '40.7128', lon: '-74.0060' })
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
getConditions(params: WeatherRequestParams): Promise<WeatherConditions>;
|
|
130
|
+
/**
|
|
131
|
+
* Retrieves daily weather forecast for a specified location using WeatherBit.
|
|
132
|
+
*
|
|
133
|
+
* @param params - Forecast request parameters including location, units, and number of days
|
|
134
|
+
* @returns A promise that resolves to an array of daily forecast data
|
|
135
|
+
* @throws {Error} If the request fails or location is invalid
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* // Get 5-day forecast
|
|
140
|
+
* const forecast = await weather.getDailyForecast({
|
|
141
|
+
* city: 'London',
|
|
142
|
+
* units: 'metric',
|
|
143
|
+
* days: 5
|
|
144
|
+
* })
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
getDailyForecast(params: DailyForecastParams): Promise<WeatherForecast[]>;
|
|
148
|
+
/**
|
|
149
|
+
* Retrieves hourly weather forecast for a specified location using WeatherBit.
|
|
150
|
+
*
|
|
151
|
+
* @param params - Forecast request parameters including location, units, and number of hours
|
|
152
|
+
* @returns A promise that resolves to an array of hourly forecast data
|
|
153
|
+
* @throws {Error} If the request fails or location is invalid
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* // Get 24-hour forecast
|
|
158
|
+
* const forecast = await weather.getHourlyForecast({
|
|
159
|
+
* city: 'Tokyo',
|
|
160
|
+
* units: 'metric',
|
|
161
|
+
* hours: 24
|
|
162
|
+
* })
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
getHourlyForecast(params: HourlyForecastParams): Promise<WeatherForecast[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Retrieves current weather conditions using AccuWeather.
|
|
168
|
+
*
|
|
169
|
+
* @param params - Weather request parameters including location and units
|
|
170
|
+
* @returns A promise that resolves to the AccuWeather conditions data
|
|
171
|
+
* @throws {Error} If the request fails or location is invalid
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* const weather = await weather.getAccuWeatherConditions({
|
|
176
|
+
* city: 'Paris',
|
|
177
|
+
* units: 'metric'
|
|
178
|
+
* })
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
getAccuWeatherConditions(params: WeatherRequestParams): Promise<Record<string, any>>;
|
|
182
|
+
/**
|
|
183
|
+
* Retrieves daily forecast using AccuWeather.
|
|
184
|
+
*
|
|
185
|
+
* @param params - Forecast request parameters including location and units
|
|
186
|
+
* @returns A promise that resolves to the AccuWeather daily forecast data
|
|
187
|
+
* @throws {Error} If the request fails or location is invalid
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* const forecast = await weather.getAccuWeatherDailyForecast({
|
|
192
|
+
* city: 'Sydney',
|
|
193
|
+
* units: 'metric'
|
|
194
|
+
* })
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
getAccuWeatherDailyForecast(params: WeatherRequestParams): Promise<Record<string, any>>;
|
|
198
|
+
/**
|
|
199
|
+
* Retrieves hourly forecast using AccuWeather.
|
|
200
|
+
*
|
|
201
|
+
* @param params - Forecast request parameters including location and units
|
|
202
|
+
* @returns A promise that resolves to the AccuWeather hourly forecast data
|
|
203
|
+
* @throws {Error} If the request fails or location is invalid
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```typescript
|
|
207
|
+
* const forecast = await weather.getAccuWeatherHourlyForecast({
|
|
208
|
+
* city: 'Berlin',
|
|
209
|
+
* units: 'metric'
|
|
210
|
+
* })
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
getAccuWeatherHourlyForecast(params: WeatherRequestParams): Promise<Record<string, any>>;
|
|
214
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telemetryos/root-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "The official TelemetryOS root application sdk package. Provides types and apis for building root TelemetryOS applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|