@reqquest/ui 1.0.0 → 1.1.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/README.md +8 -0
- package/dist/api.js +656 -111
- package/dist/components/AppRequestCard.svelte +172 -0
- package/dist/components/ApplicantProgramList.svelte +184 -0
- package/dist/components/ApplicantProgramListTooltip.svelte +22 -0
- package/dist/components/ApplicantPromptPage.svelte +88 -0
- package/dist/components/ApplicationDetailsView.svelte +307 -0
- package/dist/components/ButtonLoadingIcon.svelte +2 -1
- package/dist/components/FieldCardCheckbox.svelte +328 -0
- package/dist/components/FieldCardRadio.svelte +320 -0
- package/dist/components/IntroPanel.svelte +41 -0
- package/dist/components/PeriodPanel.svelte +100 -0
- package/dist/components/QuestionnairePrompt.svelte +36 -0
- package/dist/components/RenderDisplayComponent.svelte +38 -0
- package/dist/components/ReviewerList.svelte +93 -0
- package/dist/components/StatusMessageList.svelte +35 -0
- package/dist/components/WarningIconYellow.svelte +20 -0
- package/dist/components/index.js +11 -0
- package/dist/components/types.js +1 -0
- package/dist/csv.js +21 -0
- package/dist/index.js +2 -0
- package/dist/status-utils.js +343 -0
- package/dist/stores/IStateStore.js +0 -1
- package/dist/typed-client/schema.graphql +564 -124
- package/dist/typed-client/schema.js +87 -23
- package/dist/typed-client/types.js +919 -454
- package/dist/util.js +12 -1
- package/package.json +39 -40
- package/dist/api.d.ts +0 -595
- package/dist/components/ButtonLoadingIcon.svelte.d.ts +0 -18
- package/dist/components/index.d.ts +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/registry.d.ts +0 -138
- package/dist/stores/IStateStore.d.ts +0 -5
- package/dist/typed-client/index.d.ts +0 -25
- package/dist/typed-client/runtime/batcher.d.ts +0 -105
- package/dist/typed-client/runtime/createClient.d.ts +0 -17
- package/dist/typed-client/runtime/error.d.ts +0 -18
- package/dist/typed-client/runtime/fetcher.d.ts +0 -10
- package/dist/typed-client/runtime/generateGraphqlOperation.d.ts +0 -30
- package/dist/typed-client/runtime/index.d.ts +0 -11
- package/dist/typed-client/runtime/linkTypeMap.d.ts +0 -9
- package/dist/typed-client/runtime/typeSelection.d.ts +0 -28
- package/dist/typed-client/runtime/types.d.ts +0 -55
- package/dist/typed-client/schema.d.ts +0 -1483
- package/dist/typed-client/types.d.ts +0 -540
- package/dist/util.d.ts +0 -2
package/dist/index.d.ts
DELETED
package/dist/registry.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import type { LayoutStructureNode, LayoutStructureNodeRoot } from '@txstate-mws/carbon-svelte';
|
|
2
|
-
import type { SvelteComponent } from 'svelte';
|
|
3
|
-
export interface ProgramDefinition {
|
|
4
|
-
/**
|
|
5
|
-
* The key for the program. Allows us to match up API programs with
|
|
6
|
-
* the appropriate definition.
|
|
7
|
-
*/
|
|
8
|
-
key: string;
|
|
9
|
-
/**
|
|
10
|
-
* An icon to represent this program in the navigation.
|
|
11
|
-
*/
|
|
12
|
-
icon?: typeof SvelteComponent<any>;
|
|
13
|
-
}
|
|
14
|
-
export interface RequirementDefinition {
|
|
15
|
-
/**
|
|
16
|
-
* The key for the requirement. Allows us to match up API requirements with
|
|
17
|
-
* the appropriate definition.
|
|
18
|
-
*/
|
|
19
|
-
key: string;
|
|
20
|
-
/**
|
|
21
|
-
* An icon to represent this requirement in the navigation. Requirements do not appear
|
|
22
|
-
* in the navigation in the applicant's view.
|
|
23
|
-
*/
|
|
24
|
-
icon?: typeof SvelteComponent<any>;
|
|
25
|
-
/**
|
|
26
|
-
* A component that will be used to render the form for this prompt's configuration, if applicable.
|
|
27
|
-
*/
|
|
28
|
-
configureComponent?: typeof SvelteComponent<any>;
|
|
29
|
-
}
|
|
30
|
-
export interface PromptDefinition {
|
|
31
|
-
key: string;
|
|
32
|
-
/**
|
|
33
|
-
* The component that will be used to render the form for this prompt.
|
|
34
|
-
*/
|
|
35
|
-
formComponent: typeof SvelteComponent<any>;
|
|
36
|
-
/**
|
|
37
|
-
* A component that displays the data collected from this prompt instead of collecting
|
|
38
|
-
* it. Should be as compact as possible, as it will be displayed in a big list of prompts.
|
|
39
|
-
*/
|
|
40
|
-
displayComponent: typeof SvelteComponent<any>;
|
|
41
|
-
/**
|
|
42
|
-
* A component that will be used to render the form for this prompt's configuration, if applicable.
|
|
43
|
-
*/
|
|
44
|
-
configureComponent?: typeof SvelteComponent<any>;
|
|
45
|
-
/**
|
|
46
|
-
* An icon for the navigation.
|
|
47
|
-
*/
|
|
48
|
-
icon?: typeof SvelteComponent<any>;
|
|
49
|
-
}
|
|
50
|
-
export interface Terminologies {
|
|
51
|
-
/**
|
|
52
|
-
* The name of the container for all the applications/programes.
|
|
53
|
-
*
|
|
54
|
-
* Defaults to "App Request", but can be changed to something like "Request" or "Application".
|
|
55
|
-
* "Application" works well if the project only has one program.
|
|
56
|
-
*/
|
|
57
|
-
appRequest?: string;
|
|
58
|
-
/**
|
|
59
|
-
* What to call the login for each user.
|
|
60
|
-
*
|
|
61
|
-
* Defaults to "Login", but can be changed to something like "Username" or "Email" or something
|
|
62
|
-
* unique to the organization like "NetID".
|
|
63
|
-
*/
|
|
64
|
-
login?: string;
|
|
65
|
-
/**
|
|
66
|
-
* The name of the time periods that applications are placed inside.
|
|
67
|
-
*
|
|
68
|
-
* Defaults to "Period", but can be changed to something like "Year" or "Term" or "Application
|
|
69
|
-
* Window".
|
|
70
|
-
*/
|
|
71
|
-
period?: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A type for the config object that should be exported from a CMS instance's admin/local/index.js
|
|
75
|
-
* to configure how that instance should work.
|
|
76
|
-
*/
|
|
77
|
-
export interface UIConfig {
|
|
78
|
-
programs: ProgramDefinition[];
|
|
79
|
-
requirements: RequirementDefinition[];
|
|
80
|
-
prompts: PromptDefinition[];
|
|
81
|
-
appName: string;
|
|
82
|
-
applicantDashboardTitle?: string;
|
|
83
|
-
applicantDashboardNavTitle?: string;
|
|
84
|
-
extraNavItems?: LayoutStructureNodeRoot<LayoutStructureNode>[];
|
|
85
|
-
/**
|
|
86
|
-
* These options give you the ability to customize the terminology used in the UI.
|
|
87
|
-
*
|
|
88
|
-
* This is useful for changing the wording to better fit your project's
|
|
89
|
-
* context.
|
|
90
|
-
*/
|
|
91
|
-
terminology?: Terminologies & {
|
|
92
|
-
/**
|
|
93
|
-
* Optionally, provide plural forms for each of the above. By default we will use a pluralization
|
|
94
|
-
* library.
|
|
95
|
-
*/
|
|
96
|
-
plural?: Terminologies;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Several spots in the UI allow you to provide custom components to add extra data or functionality.
|
|
100
|
-
*
|
|
101
|
-
* Specify the components here.
|
|
102
|
-
*/
|
|
103
|
-
slots?: {
|
|
104
|
-
/**
|
|
105
|
-
* This will be placed inside the card on the reviewer sidebar.
|
|
106
|
-
*
|
|
107
|
-
* It will be given the `basicRequestData` prop, which contains the basic information about the
|
|
108
|
-
* request, such as the name of the applicant and the period. Any custom user information returned
|
|
109
|
-
* by the userLookup function you provide will also be included at `basicRequestData.applicant.otherInfo`.
|
|
110
|
-
*/
|
|
111
|
-
reviewerSidebarCard?: typeof SvelteComponent<any>;
|
|
112
|
-
/**
|
|
113
|
-
* This will be placed below the request details in the sidebar.
|
|
114
|
-
*
|
|
115
|
-
* It will only receive the `basicRequestData` prop, but you may use the `api` object from
|
|
116
|
-
* @reqquest/ui to fetch additional data.
|
|
117
|
-
*/
|
|
118
|
-
reviewerSidebar?: typeof SvelteComponent<any>;
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
export interface UIConfigWithDefaults extends UIConfig {
|
|
122
|
-
terminology: Required<Terminologies>;
|
|
123
|
-
plural: Required<Terminologies>;
|
|
124
|
-
}
|
|
125
|
-
export declare class UIRegistry {
|
|
126
|
-
config: UIConfig;
|
|
127
|
-
protected promptMap: Record<string, PromptDefinition>;
|
|
128
|
-
protected requirementMap: Record<string, RequirementDefinition>;
|
|
129
|
-
protected programMap: Record<string, ProgramDefinition>;
|
|
130
|
-
protected lang: Required<Terminologies>;
|
|
131
|
-
protected plural: Required<Terminologies>;
|
|
132
|
-
constructor(config: UIConfig);
|
|
133
|
-
getWord(key: keyof Terminologies, count?: number, inclusive?: boolean): string;
|
|
134
|
-
getPlural(key: keyof Terminologies): string;
|
|
135
|
-
getPrompt(key: string): PromptDefinition;
|
|
136
|
-
getRequirement(key: string): RequirementDefinition;
|
|
137
|
-
getProgram(key: string): ProgramDefinition;
|
|
138
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { QueryGenqlSelection, Query, MutationGenqlSelection, Mutation } from './schema';
|
|
2
|
-
import { type FieldsSelection, type GraphqlOperation, type ClientOptions, GenqlError } from './runtime';
|
|
3
|
-
export type { FieldsSelection } from './runtime';
|
|
4
|
-
export { GenqlError };
|
|
5
|
-
export * from './schema';
|
|
6
|
-
export interface Client {
|
|
7
|
-
query<R extends QueryGenqlSelection>(request: R & {
|
|
8
|
-
__name?: string;
|
|
9
|
-
}): Promise<FieldsSelection<Query, R>>;
|
|
10
|
-
mutation<R extends MutationGenqlSelection>(request: R & {
|
|
11
|
-
__name?: string;
|
|
12
|
-
}): Promise<FieldsSelection<Mutation, R>>;
|
|
13
|
-
}
|
|
14
|
-
export declare const createClient: (options?: ClientOptions) => Client;
|
|
15
|
-
export declare const everything: {
|
|
16
|
-
__scalar: boolean;
|
|
17
|
-
};
|
|
18
|
-
export type QueryResult<fields extends QueryGenqlSelection> = FieldsSelection<Query, fields>;
|
|
19
|
-
export declare const generateQueryOp: (fields: QueryGenqlSelection & {
|
|
20
|
-
__name?: string;
|
|
21
|
-
}) => GraphqlOperation;
|
|
22
|
-
export type MutationResult<fields extends MutationGenqlSelection> = FieldsSelection<Mutation, fields>;
|
|
23
|
-
export declare const generateMutationOp: (fields: MutationGenqlSelection & {
|
|
24
|
-
__name?: string;
|
|
25
|
-
}) => GraphqlOperation;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { GraphqlOperation } from './generateGraphqlOperation';
|
|
2
|
-
type Variables = Record<string, any>;
|
|
3
|
-
type QueryError = Error & {
|
|
4
|
-
message: string;
|
|
5
|
-
locations?: Array<{
|
|
6
|
-
line: number;
|
|
7
|
-
column: number;
|
|
8
|
-
}>;
|
|
9
|
-
path?: any;
|
|
10
|
-
rid: string;
|
|
11
|
-
details?: Record<string, any>;
|
|
12
|
-
};
|
|
13
|
-
type Result = {
|
|
14
|
-
data: Record<string, any>;
|
|
15
|
-
errors: Array<QueryError>;
|
|
16
|
-
};
|
|
17
|
-
type Fetcher = (batchedQuery: GraphqlOperation | Array<GraphqlOperation>) => Promise<Array<Result>>;
|
|
18
|
-
type Options = {
|
|
19
|
-
batchInterval?: number;
|
|
20
|
-
shouldBatch?: boolean;
|
|
21
|
-
maxBatchSize?: number;
|
|
22
|
-
};
|
|
23
|
-
type Queue = Array<{
|
|
24
|
-
request: GraphqlOperation;
|
|
25
|
-
resolve: (...args: Array<any>) => any;
|
|
26
|
-
reject: (...args: Array<any>) => any;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Create a batcher client.
|
|
30
|
-
* @param {Fetcher} fetcher - A function that can handle the network requests to graphql endpoint
|
|
31
|
-
* @param {Options} options - the options to be used by client
|
|
32
|
-
* @param {boolean} options.shouldBatch - should the client batch requests. (default true)
|
|
33
|
-
* @param {integer} options.batchInterval - duration (in MS) of each batch window. (default 6)
|
|
34
|
-
* @param {integer} options.maxBatchSize - max number of requests in a batch. (default 0)
|
|
35
|
-
* @param {boolean} options.defaultHeaders - default headers to include with every request
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* const fetcher = batchedQuery => fetch('path/to/graphql', {
|
|
39
|
-
* method: 'post',
|
|
40
|
-
* headers: {
|
|
41
|
-
* Accept: 'application/json',
|
|
42
|
-
* 'Content-Type': 'application/json',
|
|
43
|
-
* },
|
|
44
|
-
* body: JSON.stringify(batchedQuery),
|
|
45
|
-
* credentials: 'include',
|
|
46
|
-
* })
|
|
47
|
-
* .then(response => response.json())
|
|
48
|
-
*
|
|
49
|
-
* const client = new QueryBatcher(fetcher, { maxBatchSize: 10 })
|
|
50
|
-
*/
|
|
51
|
-
export declare class QueryBatcher {
|
|
52
|
-
fetcher: Fetcher;
|
|
53
|
-
_options: Options;
|
|
54
|
-
_queue: Queue;
|
|
55
|
-
constructor(fetcher: Fetcher, { batchInterval, shouldBatch, maxBatchSize, }?: Options);
|
|
56
|
-
/**
|
|
57
|
-
* Fetch will send a graphql request and return the parsed json.
|
|
58
|
-
* @param {string} query - the graphql query.
|
|
59
|
-
* @param {Variables} variables - any variables you wish to inject as key/value pairs.
|
|
60
|
-
* @param {[string]} operationName - the graphql operationName.
|
|
61
|
-
* @param {Options} overrides - the client options overrides.
|
|
62
|
-
*
|
|
63
|
-
* @return {promise} resolves to parsed json of server response
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* client.fetch(`
|
|
67
|
-
* query getHuman($id: ID!) {
|
|
68
|
-
* human(id: $id) {
|
|
69
|
-
* name
|
|
70
|
-
* height
|
|
71
|
-
* }
|
|
72
|
-
* }
|
|
73
|
-
* `, { id: "1001" }, 'getHuman')
|
|
74
|
-
* .then(human => {
|
|
75
|
-
* // do something with human
|
|
76
|
-
* console.log(human);
|
|
77
|
-
* });
|
|
78
|
-
*/
|
|
79
|
-
fetch(query: string, variables?: Variables, operationName?: string, overrides?: Options): Promise<Result>;
|
|
80
|
-
/**
|
|
81
|
-
* Fetch will send a graphql request and return the parsed json.
|
|
82
|
-
* @param {string} query - the graphql query.
|
|
83
|
-
* @param {Variables} variables - any variables you wish to inject as key/value pairs.
|
|
84
|
-
* @param {[string]} operationName - the graphql operationName.
|
|
85
|
-
* @param {Options} overrides - the client options overrides.
|
|
86
|
-
*
|
|
87
|
-
* @return {Promise<Array<Result>>} resolves to parsed json of server response
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* client.forceFetch(`
|
|
91
|
-
* query getHuman($id: ID!) {
|
|
92
|
-
* human(id: $id) {
|
|
93
|
-
* name
|
|
94
|
-
* height
|
|
95
|
-
* }
|
|
96
|
-
* }
|
|
97
|
-
* `, { id: "1001" }, 'getHuman')
|
|
98
|
-
* .then(human => {
|
|
99
|
-
* // do something with human
|
|
100
|
-
* console.log(human);
|
|
101
|
-
* });
|
|
102
|
-
*/
|
|
103
|
-
forceFetch(query: string, variables?: Variables, operationName?: string, overrides?: Options): Promise<Result>;
|
|
104
|
-
}
|
|
105
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type BatchOptions } from './fetcher';
|
|
2
|
-
import type { ExecutionResult, LinkedType } from './types';
|
|
3
|
-
import { type GraphqlOperation } from './generateGraphqlOperation';
|
|
4
|
-
export type Headers = HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);
|
|
5
|
-
export type BaseFetcher = (operation: GraphqlOperation | GraphqlOperation[]) => Promise<ExecutionResult | ExecutionResult[]>;
|
|
6
|
-
export type ClientOptions = Omit<RequestInit, 'body' | 'headers'> & {
|
|
7
|
-
url?: string;
|
|
8
|
-
batch?: BatchOptions | boolean;
|
|
9
|
-
fetcher?: BaseFetcher;
|
|
10
|
-
fetch?: Function;
|
|
11
|
-
headers?: Headers;
|
|
12
|
-
};
|
|
13
|
-
export declare const createClient: ({ queryRoot, mutationRoot, subscriptionRoot, ...options }: ClientOptions & {
|
|
14
|
-
queryRoot?: LinkedType;
|
|
15
|
-
mutationRoot?: LinkedType;
|
|
16
|
-
subscriptionRoot?: LinkedType;
|
|
17
|
-
}) => any;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare class GenqlError extends Error {
|
|
2
|
-
errors: Array<GraphqlError>;
|
|
3
|
-
/**
|
|
4
|
-
* Partial data returned by the server
|
|
5
|
-
*/
|
|
6
|
-
data?: any;
|
|
7
|
-
constructor(errors: any[], data: any);
|
|
8
|
-
}
|
|
9
|
-
interface GraphqlError {
|
|
10
|
-
message: string;
|
|
11
|
-
locations?: Array<{
|
|
12
|
-
line: number;
|
|
13
|
-
column: number;
|
|
14
|
-
}>;
|
|
15
|
-
path?: string[];
|
|
16
|
-
extensions?: Record<string, any>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ClientOptions } from './createClient';
|
|
2
|
-
import type { GraphqlOperation } from './generateGraphqlOperation';
|
|
3
|
-
export interface Fetcher {
|
|
4
|
-
(gql: GraphqlOperation): Promise<any>;
|
|
5
|
-
}
|
|
6
|
-
export type BatchOptions = {
|
|
7
|
-
batchInterval?: number;
|
|
8
|
-
maxBatchSize?: number;
|
|
9
|
-
};
|
|
10
|
-
export declare const createFetcher: ({ url, headers, fetcher, fetch: _fetch, batch, ...rest }: ClientOptions) => Fetcher;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { LinkedField, LinkedType } from './types';
|
|
2
|
-
export interface Args {
|
|
3
|
-
[arg: string]: any | undefined;
|
|
4
|
-
}
|
|
5
|
-
export interface Fields {
|
|
6
|
-
[field: string]: Request;
|
|
7
|
-
}
|
|
8
|
-
export type Request = boolean | number | Fields;
|
|
9
|
-
export interface Variables {
|
|
10
|
-
[name: string]: {
|
|
11
|
-
value: any;
|
|
12
|
-
typing: [LinkedType, string];
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface Context {
|
|
16
|
-
root: LinkedType;
|
|
17
|
-
varCounter: number;
|
|
18
|
-
variables: Variables;
|
|
19
|
-
fragmentCounter: number;
|
|
20
|
-
fragments: string[];
|
|
21
|
-
}
|
|
22
|
-
export interface GraphqlOperation {
|
|
23
|
-
query: string;
|
|
24
|
-
variables?: {
|
|
25
|
-
[name: string]: any;
|
|
26
|
-
};
|
|
27
|
-
operationName?: string;
|
|
28
|
-
}
|
|
29
|
-
export declare const generateGraphqlOperation: (operation: "query" | "mutation" | "subscription", root: LinkedType, fields?: Fields) => GraphqlOperation;
|
|
30
|
-
export declare const getFieldFromPath: (root: LinkedType | undefined, path: string[]) => LinkedField;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { createClient } from './createClient';
|
|
2
|
-
export type { ClientOptions } from './createClient';
|
|
3
|
-
export type { FieldsSelection } from './typeSelection';
|
|
4
|
-
export { generateGraphqlOperation } from './generateGraphqlOperation';
|
|
5
|
-
export type { GraphqlOperation } from './generateGraphqlOperation';
|
|
6
|
-
export { linkTypeMap } from './linkTypeMap';
|
|
7
|
-
export { createFetcher } from './fetcher';
|
|
8
|
-
export { GenqlError } from './error';
|
|
9
|
-
export declare const everything: {
|
|
10
|
-
__scalar: boolean;
|
|
11
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CompressedTypeMap, LinkedArgMap, LinkedTypeMap } from './types';
|
|
2
|
-
export interface PartialLinkedFieldMap {
|
|
3
|
-
[field: string]: {
|
|
4
|
-
type: string;
|
|
5
|
-
args?: LinkedArgMap;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export declare const linkTypeMap: (typeMap: CompressedTypeMap<number>) => LinkedTypeMap;
|
|
9
|
-
export declare const resolveConcreteTypes: (linkedTypeMap: LinkedTypeMap) => LinkedTypeMap;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type FieldsSelection<SRC extends Anify<DST> | undefined, DST> = {
|
|
2
|
-
scalar: SRC;
|
|
3
|
-
union: Handle__isUnion<SRC, DST>;
|
|
4
|
-
object: HandleObject<SRC, DST>;
|
|
5
|
-
array: SRC extends Nil ? never : SRC extends Array<infer T | null> ? Array<FieldsSelection<T, DST>> : never;
|
|
6
|
-
__scalar: Handle__scalar<SRC, DST>;
|
|
7
|
-
never: never;
|
|
8
|
-
}[DST extends Nil ? 'never' : DST extends false | 0 ? 'never' : SRC extends Scalar ? 'scalar' : SRC extends any[] ? 'array' : SRC extends {
|
|
9
|
-
__isUnion?: any;
|
|
10
|
-
} ? 'union' : DST extends {
|
|
11
|
-
__scalar?: any;
|
|
12
|
-
} ? '__scalar' : DST extends {} ? 'object' : 'never'];
|
|
13
|
-
type HandleObject<SRC extends Anify<DST>, DST> = DST extends boolean ? SRC : SRC extends Nil ? never : Pick<{
|
|
14
|
-
[Key in keyof SRC]: Key extends keyof DST ? FieldsSelection<SRC[Key], NonNullable<DST[Key]>> : SRC[Key];
|
|
15
|
-
}, Exclude<keyof DST, FieldsToRemove>>;
|
|
16
|
-
type Handle__scalar<SRC extends Anify<DST>, DST> = SRC extends Nil ? never : Pick<{
|
|
17
|
-
[Key in keyof SRC]: Key extends keyof DST ? FieldsSelection<SRC[Key], DST[Key]> : SRC[Key];
|
|
18
|
-
}, {
|
|
19
|
-
[Key in keyof SRC]: SRC[Key] extends Nil ? never : Key extends FieldsToRemove ? never : SRC[Key] extends Scalar ? Key : Key extends keyof DST ? Key : never;
|
|
20
|
-
}[keyof SRC]>;
|
|
21
|
-
type Handle__isUnion<SRC extends Anify<DST>, DST> = SRC extends Nil ? never : Omit<SRC, FieldsToRemove>;
|
|
22
|
-
type Scalar = string | number | Date | boolean | null | undefined;
|
|
23
|
-
type Anify<T> = {
|
|
24
|
-
[P in keyof T]?: any;
|
|
25
|
-
};
|
|
26
|
-
type FieldsToRemove = '__isUnion' | '__scalar' | '__name' | '__args';
|
|
27
|
-
type Nil = undefined | null;
|
|
28
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export interface ExecutionResult<TData = {
|
|
2
|
-
[key: string]: any;
|
|
3
|
-
}> {
|
|
4
|
-
errors?: Array<Error>;
|
|
5
|
-
data?: TData | null;
|
|
6
|
-
}
|
|
7
|
-
export interface ArgMap<keyType = number> {
|
|
8
|
-
[arg: string]: [keyType, string] | [keyType] | undefined;
|
|
9
|
-
}
|
|
10
|
-
export type CompressedField<keyType = number> = [
|
|
11
|
-
type: keyType,
|
|
12
|
-
args?: ArgMap<keyType>
|
|
13
|
-
];
|
|
14
|
-
export interface CompressedFieldMap<keyType = number> {
|
|
15
|
-
[field: string]: CompressedField<keyType> | undefined;
|
|
16
|
-
}
|
|
17
|
-
export type CompressedType<keyType = number> = CompressedFieldMap<keyType>;
|
|
18
|
-
export interface CompressedTypeMap<keyType = number> {
|
|
19
|
-
scalars: Array<keyType>;
|
|
20
|
-
types: {
|
|
21
|
-
[type: string]: CompressedType<keyType> | undefined;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export type Field<keyType = number> = {
|
|
25
|
-
type: keyType;
|
|
26
|
-
args?: ArgMap<keyType>;
|
|
27
|
-
};
|
|
28
|
-
export interface FieldMap<keyType = number> {
|
|
29
|
-
[field: string]: Field<keyType> | undefined;
|
|
30
|
-
}
|
|
31
|
-
export type Type<keyType = number> = FieldMap<keyType>;
|
|
32
|
-
export interface TypeMap<keyType = number> {
|
|
33
|
-
scalars: Array<keyType>;
|
|
34
|
-
types: {
|
|
35
|
-
[type: string]: Type<keyType> | undefined;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export interface LinkedArgMap {
|
|
39
|
-
[arg: string]: [LinkedType, string] | undefined;
|
|
40
|
-
}
|
|
41
|
-
export interface LinkedField {
|
|
42
|
-
type: LinkedType;
|
|
43
|
-
args?: LinkedArgMap;
|
|
44
|
-
}
|
|
45
|
-
export interface LinkedFieldMap {
|
|
46
|
-
[field: string]: LinkedField | undefined;
|
|
47
|
-
}
|
|
48
|
-
export interface LinkedType {
|
|
49
|
-
name: string;
|
|
50
|
-
fields?: LinkedFieldMap;
|
|
51
|
-
scalar?: string[];
|
|
52
|
-
}
|
|
53
|
-
export interface LinkedTypeMap {
|
|
54
|
-
[type: string]: LinkedType | undefined;
|
|
55
|
-
}
|