- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
81 lines
3.1 KiB
TypeScript
81 lines
3.1 KiB
TypeScript
import { Maybe } from '../jsutils/Maybe';
|
|
|
|
import { DocumentNode } from '../language/ast';
|
|
import { ExecutionResult } from '../execution/execute';
|
|
import { GraphQLSchema } from '../type/schema';
|
|
import { GraphQLFieldResolver } from '../type/definition';
|
|
|
|
export interface SubscriptionArgs {
|
|
schema: GraphQLSchema;
|
|
document: DocumentNode;
|
|
rootValue?: any;
|
|
contextValue?: any;
|
|
variableValues?: Maybe<Record<string, any>>;
|
|
operationName?: Maybe<string>;
|
|
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
|
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
|
}
|
|
|
|
/**
|
|
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
|
*
|
|
* Returns a Promise which resolves to either an AsyncIterator (if successful)
|
|
* or an ExecutionResult (client error). The promise will be rejected if a
|
|
* server error occurs.
|
|
*
|
|
* If the client-provided arguments to this function do not result in a
|
|
* compliant subscription, a GraphQL Response (ExecutionResult) with
|
|
* descriptive errors and no data will be returned.
|
|
*
|
|
* If the the source stream could not be created due to faulty subscription
|
|
* resolver logic or underlying systems, the promise will resolve to a single
|
|
* ExecutionResult containing `errors` and no `data`.
|
|
*
|
|
* If the operation succeeded, the promise resolves to an AsyncIterator, which
|
|
* yields a stream of ExecutionResults representing the response stream.
|
|
*
|
|
* Accepts either an object with named arguments, or individual arguments.
|
|
*/
|
|
export function subscribe(
|
|
args: SubscriptionArgs,
|
|
): Promise<AsyncIterableIterator<ExecutionResult> | ExecutionResult>;
|
|
|
|
export function subscribe(
|
|
schema: GraphQLSchema,
|
|
document: DocumentNode,
|
|
rootValue?: any,
|
|
contextValue?: any,
|
|
variableValues?: Maybe<{ [key: string]: any }>,
|
|
operationName?: Maybe<string>,
|
|
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>,
|
|
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>,
|
|
): Promise<AsyncIterableIterator<ExecutionResult> | ExecutionResult>;
|
|
|
|
/**
|
|
* Implements the "CreateSourceEventStream" algorithm described in the
|
|
* GraphQL specification, resolving the subscription source event stream.
|
|
*
|
|
* Returns a Promise<AsyncIterable>.
|
|
*
|
|
* If the client-provided invalid arguments, the source stream could not be
|
|
* created, or the resolver did not return an AsyncIterable, this function will
|
|
* will throw an error, which should be caught and handled by the caller.
|
|
*
|
|
* A Source Event Stream represents a sequence of events, each of which triggers
|
|
* a GraphQL execution for that event.
|
|
*
|
|
* This may be useful when hosting the stateful subscription service in a
|
|
* different process or machine than the stateless GraphQL execution engine,
|
|
* or otherwise separating these two steps. For more on this, see the
|
|
* "Supporting Subscriptions at Scale" information in the GraphQL specification.
|
|
*/
|
|
export function createSourceEventStream(
|
|
schema: GraphQLSchema,
|
|
document: DocumentNode,
|
|
rootValue?: any,
|
|
contextValue?: any,
|
|
variableValues?: { [key: string]: any },
|
|
operationName?: Maybe<string>,
|
|
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>,
|
|
): Promise<AsyncIterable<any> | ExecutionResult>;
|