UNPKG

3 kBTypeScriptView Raw
1import { IngesterOptions, SubscriptionOptions } from "../internal/graph/graphQL";
2export declare class ParameterEnum {
3 value: string | string[];
4 constructor(value: string | string[]);
5}
6export declare function enumValue(value: string | string[]): ParameterEnum;
7/**
8 * Prepare a GraphQL subscription string for the use with Apollo or EventHandlers.
9 *
10 * Subscription can be provided by the following options:
11 *
12 * * subscription: string containing the subscription GraphQL, or
13 * * path: absolute or relative path to a .graphql file to load; if provided a relative
14 * path this will resolve the relative path to an absolute given the location of
15 * the calling script.
16 * * name: name GraphQL subscription operation to load; this will walk up the directory
17 * structure starting at the location of the calling script and look for a folder
18 * called 'graphql'. Once that folder is found, the subscription named 'name' is
19 * being looked for.
20 * * fragmentsDir: location of fragment .graphql files
21 * * inline: remove any unneeded whitespace and line breaks from returned GraphQL string
22 * * variables: the variables to bind into the subscription
23 * * operationName: name of the subscription to use in the generated GraphQL string
24 *
25 * @param {{subscription?: string; path?: string; name?: string; fragmentDir?: string; inline?: boolean;
26 * variables?: {[p: string]: string | boolean | number | ParameterEnum}}} options
27 * @returns {string}
28 */
29export declare function subscription(optionsOrName: SubscriptionOptions | string): string;
30/**
31 * Read a subscription from a file relative to the provided directory (or the module root by default)
32 * Note: Use __dirname to get the current directory of the calling script.
33 * @param {string} path
34 * @param {string} current
35 * @param {{[p: string]: string | boolean | number}} parameters
36 * @returns {string}
37 *
38 * DEPRECATED: use subscription() instead
39 */
40export declare function subscriptionFromFile(path: string, current?: string, parameters?: {
41 [name: string]: string | boolean | number | ParameterEnum;
42}): string;
43/**
44 * Prepare a GraphQL ingester SDL string for the register with the automation client.
45 *
46 * Ingester can be provided by the following options:
47 *
48 * * path: absolute or relative path to a .graphql file to load; if provided a relative
49 * path this will resolve the relative path to an absolute given the location of
50 * the calling script.
51 * * name: name of the .graphql file to load; this will walk up the directory structure
52 * starting a t the location of the calling script and look for a folder called
53 * 'graphql'. Once that folder is found, by convention name is being looked for
54 * in the 'ingester' sub directory.
55 *
56 * @param {IngesterOptions | string} optionsOrName
57 * @returns {string}
58 */
59export declare function ingester(optionsOrName: IngesterOptions | string): string;
60//# sourceMappingURL=graphQL.d.ts.map
\No newline at end of file