import api from './api'; import authentication from './api/authentication'; import alarms from './api/alarms'; import applications from './api/applications'; import claims from './api/claims'; import data from './api/data'; import domains from './api/domains'; import drivers from './api/drivers'; import emailtemplates from './api/emailtemplates'; import filesprivate from './api/filesprivate'; import filespublic from './api/filespublic'; import folders from './api/folders'; import globalnodetypetemplates from './api/globalnodetypetemplates'; import icons from './api/icons'; import lambdas from './api/lambdas'; import login from './api/login'; import logout from './api/logout'; import nodes from './api/nodes'; import nodetypes from './api/nodetypes'; import nodetypetemplates from './api/nodetypetemplates'; import notificationschemas from './api/notificationschemas'; import passwords from './api/passwords'; import permissions from './api/permissions'; import publish from './api/publish'; import reactions from './api/reactions'; import refresh from './api/refresh'; import reporting from './api/reporting'; import roles from './api/roles'; import rules from './api/rules'; import sessions from './api/sessions'; import tenant from './api/tenant'; import users from './api/users'; import usersubscriptions from './api/usersubscriptions'; export { authentication, alarms, applications, claims, data, domains, drivers, emailtemplates, filesprivate, filespublic, folders, globalnodetypetemplates, icons, lambdas, login, logout, nodes, nodetypes, nodetypetemplates, notificationschemas, passwords, permissions, publish, reactions, refresh, reporting, roles, rules, sessions, tenant, users, usersubscriptions, }; export default api; export interface CarbonError { code: string; detail: string; id: string; meta: object; status: number; } export interface AllAPIResponses { error?: CarbonError | Error; response: Response | undefined; data?: T; } export interface AlarmEvent { UpdatedAt: string; event: boolean; traceId: string; } export type AlarmHistoryType = Array; export interface AlarmNoteType { note: string; ts: string; updatedAt: string; userId: number; } export interface AlarmNoteResponseType { event: AlarmEvent; notes: AlarmNoteType; } export type CarbonUserTokenType = { accessId: string; createdAt: string; id: number; name: string; updatedAt: string; }; export type CarbonAPIKeyType = { createdAt: string; id: number; name: string; referenceValue: string; updatedAt: string; }; export type ParserFunctionType = { name: string; version: string; }; export interface CoreType { createdAt: string; editable: boolean; id: number; name: string; public: boolean; updatedAt: string; } export interface DriverType { createdAt: string; id: number; name: string; updatedAt: string; } export type ValueType = { createdAt: string; timestamp: string; value: any; traceId: string; }; export interface CurrentValueType { [key: string]: { [key: string]: ValueType; }; } export interface RoleType { allowedRoles: number[]; createdAt: string; id: number; name: string; permissions: number[]; updatedAt: string; } export type FolderChildrenType = { children: number[]; }; export type FolderTreeItemType = { name: string; parentId?: number; children?: number[]; }; export type FolderTreeType = { roots: number[]; tree: { [key: number]: FolderTreeItemType; }; }; export interface FolderType { createdAt: string; id: number; information: { address: { address: string; code: string; country: string; locality: string; region: string; }; }; location: { lat: number | string; lng: number | string } | null; metadata: any; name: string; parentFolderId: number; type: 'Client Company' | 'Participant' | 'Program' | ''; root: boolean; tags: any[]; theme: { logoUrl: string; }; updatedAt: string; usercount: number; parentFolderName?: string; } export interface AliasChannelType { aliasChannelName: string; aliasNodeId: number; createdAt: string; endTime: string; id: number; sourceChannelName: string; sourceNodeId: number; startTime: string; updatedAt: string; } export interface NodeType { aliasNodeIds: number[]; archiveNumber: number; createdAt: string; folderId: string; folderName?: string; id: number; isActive: boolean; location: { lat: string; lng: string } | null; metadata: any; nodeTypeId: string; nodeTypeName?: string; parentNodeId: string; tags: any[]; uniqueId: string; updatedAt: string; vanity: string; area: string; building: string; floor: string; } export interface ChannelType { default: any; machineLearningConfig: string | null; type: string | null; vanityName: string | null; } export interface ApplicationType { basePath: string; coreId: number; createdAt: string; id: number; name: string; theme: { logoUrl: string; titleText: string; }; updatedAt: string; } export interface DomainType { apps: Array; createdAt: string; defaultApplication: number; forceHttps: boolean; fqdn: string; id: number; theme: { [key: string]: string }; updatedAt: string; } export interface IconType { createdAt: string; id: number; updatedAt: string; color: string; description: string; level: number; name: string; shape: string; } export interface UserType { createdAt: string; email: string; folders: number[]; foldersDetail?: { [key: number]: string }; id: number; information?: { address?: { address?: string; code?: string; country?: string; locality?: string; region: string; }; first?: string; last?: string; timezone?: string; }; isRoot: boolean; lastUsed?: string; metadata?: { [key: string]: any; }; preferences?: { [key: string]: any; }; phone?: string; roleId: number; roleName?: string; updatedAt: string; impersonatedBy?: { email: string; id: number; }; error?: any; } export interface NodeTypeTemplateType { allowedRoles: number[]; createdAt: string; id: number; name: string; nodeTypeId: number; position: number; updatedAt: string; usage: string; vanityName: string; } export interface NodeTypeType { activationConfig: { autoActivate: boolean; autoCreate: boolean; changeNodeType: boolean; changeParent: boolean; setParent: string; syncParentFolder: boolean; }; allowedRoles: number[]; channels: { [key: string]: ChannelType }; createdAt: string; driverId: number; id: number; name: string; updatedAt: string; vanityName: string; } export interface EmailTemplateType { createdAt: string; fromEmail: string; fromName: string; key: string; subjectTemplate: string; updatedAt: string; } export interface GlobalNodeTypeTemplateType { allowedRoles: number[]; createdAt: string; id: number; name: string; updatedAt: string; } export interface ReactionType { active: boolean; createdAt: string; eventType: string; fromEmail: string; fromName: string; headerTemplate: string; id: number; name: string; ruleId: number; subjectTemplate: string; type: string; updatedAt: string; urlTemplate: string; } export interface RuleType { active: boolean; description: string; alwaysReact: boolean; channelName: string; condition: string; createdAt: string; createdBy: number; cronTime: number; debounceTime: number; iconId: number; id: number; name: string; nodeTypeId: number; updatedAt: string; updatedBy: number; } export interface ReactionHistoryType { date: string; nodeId: number; reactionId: number; value: { NodeID: number; Processed: string; ReactionID: number; ReferenceID: string; ResponseCode: string; StatusMessage: string; TID: number; TimeStamps: number; }; } export interface NotificationSchemaType { createdAt: string; defaultSchedule: string; id: number; name: string; reactions: number[]; updatedAt: string; } export interface LambdaType { active: boolean; channelName: string; createdAt: string; id: number; name: string; nodeTypeId: number; updatedAt: string; } export interface TenantType { createdAt: string; enableReactions: boolean; id: number; name: string; reactionFromEmail: string; reactionFromName: string; updatedAt: string; } export interface PermissionType { id: number; name: string; } export interface ReactionType { active: boolean; createdAt: string; eventType: string; fromEmail: string; fromName: string; headerTemplate: string; id: number; name: string; ruleId: number; subjectTemplate: string; type: string; updatedAt: string; urlTemplate: string; } export interface UserSubscriptionType { createdAt?: string; notificationSchemaId: number; schedule: string; updatedAt?: string; userId: number; } export interface ClaimType { createdAt: string; updatedAt: string; functionName: string; functionVersion: string; id: number; networkType: 'lora-tracknet' | 'nbiot-sercomm' | 'lora-chirpstack'; uniqueId: string; } export type CarbonQueryResult = { endCursor: string; hasNextPage: boolean; results: T[]; totalCount: number; }; export type CarbonQueryBodyType< FilterType = Array<{ fieldName: string; operator: string; value: any }> > = { detail?: boolean; filters: FilterType; type?: 'or' | 'and'; // TODO this type does not exist on the backend numberOfResults?: number; first?: string | number; after?: string | number; orderDirection?: 'asc' | 'desc'; orderBy?: string; }; export type UserActivityType = { first_used: string; impersonated_by: number; key: string; last_used: string; location: string; method: string; }; export type ReportingCSVType = { link: string; modified: string; }; export type CarbonThemeType = { theme: object; }; export type NetworkType = 'lora-tracknet' | 'nbiot-sercomm' | 'lora-chirpstack'; export type ClaimsPostResponseType = { queueDepth: number; }; type FilterOperator = string; export type FilterType = { fieldName: string; operator: FilterOperator; value: any; }; export type PublishPayload = { channelName: string; nodeId: string; parentNodeId?: number; timestamp?: string; value: unknown; }; export type UndoAllAPIResponses< T extends AllAPIResponses > = T extends AllAPIResponses ? U : never;