diff --git a/generated/apis/DevicesApi.ts b/generated/apis/DevicesApi.ts new file mode 100644 index 0000000..fa370d6 --- /dev/null +++ b/generated/apis/DevicesApi.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * ActivitySmith API + * Send push notifications and Live Activities to your own devices via a single API key. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AccountDeviceListResponse, + ForbiddenError, + RateLimitError, +} from '../models/index'; + +export interface ListAccountDevicesRequest { + limit?: number; + offset?: number; + includeInactive?: boolean; +} + +/** + * + */ +export class DevicesApi extends runtime.BaseAPI { + + /** + * Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices. + * List paired devices + */ + async listAccountDevicesRaw(requestParameters: ListAccountDevicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['includeInactive'] != null) { + queryParameters['include_inactive'] = requestParameters['includeInactive']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("apiKeyAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/account/devices`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices. + * List paired devices + */ + async listAccountDevices(requestParameters: ListAccountDevicesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAccountDevicesRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/generated/apis/index.ts b/generated/apis/index.ts index ecb06b5..f5b8796 100644 --- a/generated/apis/index.ts +++ b/generated/apis/index.ts @@ -1,6 +1,7 @@ /* tslint:disable */ /* eslint-disable */ export * from './AppIconBadgesApi'; +export * from './DevicesApi'; export * from './LiveActivitiesApi'; export * from './MetricsApi'; export * from './PushNotificationsApi'; diff --git a/generated/models/index.ts b/generated/models/index.ts index 093a4ed..d5e0668 100644 --- a/generated/models/index.ts +++ b/generated/models/index.ts @@ -1,5 +1,140 @@ /* tslint:disable */ /* eslint-disable */ +/** + * An iPhone or iPad paired to the account, one entry per device and owner. + * @export + * @interface AccountDevice + */ +export interface AccountDevice { + /** + * Email of the account member who paired the device. + * @type {string} + * @memberof AccountDevice + */ + user_email: string; + /** + * Device ID. Use it to assign the device to Channels. + * @type {string} + * @memberof AccountDevice + */ + device_id: string; + /** + * Device platform, such as ios. iPhones and iPads both report ios; use system_name to tell them apart. + * @type {string} + * @memberof AccountDevice + */ + device_type: string | null; + /** + * True when the device can receive Push Notifications or Live Activities. + * @type {boolean} + * @memberof AccountDevice + */ + is_active: boolean; + /** + * Whether each delivery token is active, keyed by token type (push, start_live_activity). + * @type {{ [key: string]: boolean; }} + * @memberof AccountDevice + */ + token_status: { [key: string]: boolean; }; + /** + * ActivitySmith app version on the device. + * @type {string} + * @memberof AccountDevice + */ + app_version: string | null; + /** + * Device name set on the device. + * @type {string} + * @memberof AccountDevice + */ + device_name: string | null; + /** + * Operating system name, such as iOS or iPadOS. + * @type {string} + * @memberof AccountDevice + */ + system_name: string | null; + /** + * Operating system version. + * @type {string} + * @memberof AccountDevice + */ + system_version: string | null; + /** + * When the device was first paired. + * @type {string} + * @memberof AccountDevice + */ + created_at: string | null; + /** + * When the device last updated its pairing. + * @type {string} + * @memberof AccountDevice + */ + updated_at: string | null; +} +/** + * + * @export + * @interface AccountDeviceListResponse + */ +export interface AccountDeviceListResponse { + /** + * + * @type {Array} + * @memberof AccountDeviceListResponse + */ + devices: Array; + /** + * + * @type {AccountDeviceListResponseMeta} + * @memberof AccountDeviceListResponse + */ + meta: AccountDeviceListResponseMeta; +} +/** + * + * @export + * @interface AccountDeviceListResponseMeta + */ +export interface AccountDeviceListResponseMeta { + /** + * Devices matching the filter. + * @type {number} + * @memberof AccountDeviceListResponseMeta + */ + total: number; + /** + * + * @type {number} + * @memberof AccountDeviceListResponseMeta + */ + limit: number; + /** + * + * @type {number} + * @memberof AccountDeviceListResponseMeta + */ + offset: number; + /** + * + * @type {boolean} + * @memberof AccountDeviceListResponseMeta + */ + has_more: boolean; + /** + * Offset for the next page, or null on the last page. + * @type {number} + * @memberof AccountDeviceListResponseMeta + */ + next_offset: number | null; + /** + * + * @type {boolean} + * @memberof AccountDeviceListResponseMeta + */ + include_inactive: boolean; +} /** * * @export diff --git a/generated/openapi-source.json b/generated/openapi-source.json index 498433c..91a1086 100644 --- a/generated/openapi-source.json +++ b/generated/openapi-source.json @@ -1,6 +1,6 @@ { "repository": "ActivitySmithHQ/activitysmith-backend", - "commit": "7bf9c3d88459fe3f122810979a45da0a1e6fd2d6", + "commit": "a57348676e146f834fd0cad2b827dfd0b814a3f4", "path": "openapi.json", - "sha256": "6987f90b106e28a0ab8058f43309e7a9f045c7c54d27ce90bbdd5966c3f99f7a" + "sha256": "de1079e0910a89405be1eae4d6492ad35f8149b4dee92ea864bf84386bb1293a" }