@graphql-mesh/soap 1.0.0-alpha-3fc47d119.0 → 1.0.0-alpha-20230420181317-a95037648
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/cjs/index.js +56 -0
- package/cjs/package.json +1 -0
- package/esm/index.js +53 -0
- package/package.json +26 -21
- package/typings/index.d.cts +10 -0
- package/typings/index.d.ts +10 -0
- package/index.d.ts +0 -13
- package/index.js +0 -1063
- package/index.mjs +0 -1059
- package/soap-graphql/index.d.ts +0 -4
- package/soap-graphql/node-soap/index.d.ts +0 -3
- package/soap-graphql/node-soap/node-soap-caller.d.ts +0 -18
- package/soap-graphql/node-soap/node-soap-endpoint.d.ts +0 -58
- package/soap-graphql/node-soap/node-soap-resolver.d.ts +0 -26
- package/soap-graphql/node-soap/node-soap.d.ts +0 -21
- package/soap-graphql/soap-graphql.d.ts +0 -62
- package/soap-graphql/soap2graphql/custom-type-resolver.d.ts +0 -64
- package/soap-graphql/soap2graphql/index.d.ts +0 -6
- package/soap-graphql/soap2graphql/name-resolver.d.ts +0 -5
- package/soap-graphql/soap2graphql/schema-resolver.d.ts +0 -30
- package/soap-graphql/soap2graphql/soap-caller.d.ts +0 -17
- package/soap-graphql/soap2graphql/soap-endpoint.d.ts +0 -66
- package/soap-graphql/soap2graphql/soap2graphql.d.ts +0 -83
package/soap-graphql/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SoapOperation } from '../soap2graphql/soap-endpoint';
|
|
2
|
-
import { SoapCaller, SoapCallInput } from '../soap2graphql/soap-caller';
|
|
3
|
-
import { NodeSoapClient } from './node-soap';
|
|
4
|
-
import { LazyLoggerMessage, Logger } from '@graphql-mesh/types';
|
|
5
|
-
/**
|
|
6
|
-
* Default implementation of SoapCaller for node-soap.
|
|
7
|
-
*/
|
|
8
|
-
export declare class NodeSoapCaller implements SoapCaller {
|
|
9
|
-
protected soapClient: NodeSoapClient;
|
|
10
|
-
protected logger: Logger;
|
|
11
|
-
constructor(soapClient: NodeSoapClient, logger: Logger);
|
|
12
|
-
call(input: SoapCallInput): Promise<any>;
|
|
13
|
-
protected requestFunctionForOperation(operation: SoapOperation): (requestMessage: any, callback: (err: any, res: any) => void) => void;
|
|
14
|
-
protected createSoapRequestMessage(input: SoapCallInput): Promise<any>;
|
|
15
|
-
protected deepCopy(obj: any): any;
|
|
16
|
-
protected createGraphqlResult(input: SoapCallInput, result: any): Promise<any>;
|
|
17
|
-
protected debug(message: LazyLoggerMessage): void;
|
|
18
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@graphql-mesh/types';
|
|
2
|
-
import { SoapEndpoint, SoapType, SoapField, SoapService, SoapPort, SoapOperation } from '../soap2graphql/soap-endpoint';
|
|
3
|
-
import { NodeSoapClient } from './node-soap';
|
|
4
|
-
import { NodeSoapWsdlResolver } from './node-soap-resolver';
|
|
5
|
-
export declare function createSoapEndpoint(soapClient: NodeSoapClient, logger: Logger): SoapEndpoint;
|
|
6
|
-
export declare class NodeSoapEndpoint implements SoapEndpoint {
|
|
7
|
-
private soapClient;
|
|
8
|
-
private _resolver;
|
|
9
|
-
constructor(soapClient: NodeSoapClient, logger: Logger);
|
|
10
|
-
description(): string;
|
|
11
|
-
services(): NodeSoapService[];
|
|
12
|
-
resolver(): NodeSoapWsdlResolver;
|
|
13
|
-
private _describe;
|
|
14
|
-
protected describe(): any;
|
|
15
|
-
}
|
|
16
|
-
export declare class NodeSoapService implements SoapService {
|
|
17
|
-
private _wsdl;
|
|
18
|
-
private _name;
|
|
19
|
-
private _content;
|
|
20
|
-
constructor(_wsdl: NodeSoapEndpoint, _name: string, _content: any);
|
|
21
|
-
endpoint(): NodeSoapEndpoint;
|
|
22
|
-
name(): string;
|
|
23
|
-
private _ports;
|
|
24
|
-
ports(): NodeSoapPort[];
|
|
25
|
-
private createPorts;
|
|
26
|
-
}
|
|
27
|
-
export declare class NodeSoapPort implements SoapPort {
|
|
28
|
-
private _service;
|
|
29
|
-
private _name;
|
|
30
|
-
private _content;
|
|
31
|
-
constructor(_service: NodeSoapService, _name: string, _content: any);
|
|
32
|
-
endpoint(): NodeSoapEndpoint;
|
|
33
|
-
service(): NodeSoapService;
|
|
34
|
-
name(): string;
|
|
35
|
-
private _operations;
|
|
36
|
-
operations(): NodeSoapOperation[];
|
|
37
|
-
private createOperations;
|
|
38
|
-
}
|
|
39
|
-
export declare class NodeSoapOperation implements SoapOperation {
|
|
40
|
-
private _port;
|
|
41
|
-
private _name;
|
|
42
|
-
private _content;
|
|
43
|
-
constructor(_port: NodeSoapPort, _name: string, _content: any);
|
|
44
|
-
endpoint(): NodeSoapEndpoint;
|
|
45
|
-
service(): NodeSoapService;
|
|
46
|
-
port(): NodeSoapPort;
|
|
47
|
-
name(): string;
|
|
48
|
-
content(): any;
|
|
49
|
-
private _inputs;
|
|
50
|
-
args(): SoapField[];
|
|
51
|
-
private _output;
|
|
52
|
-
output(): {
|
|
53
|
-
type: SoapType;
|
|
54
|
-
isList: boolean;
|
|
55
|
-
};
|
|
56
|
-
resultField(): string;
|
|
57
|
-
private createOutput;
|
|
58
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SoapType, SoapOperationArg } from '../soap2graphql/soap-endpoint';
|
|
2
|
-
import { NodeSoapOperation } from './node-soap-endpoint';
|
|
3
|
-
import { NodeSoapWsdl } from './node-soap';
|
|
4
|
-
import { Logger } from '@graphql-mesh/types';
|
|
5
|
-
export declare class NodeSoapWsdlResolver {
|
|
6
|
-
private wsdl;
|
|
7
|
-
private logger;
|
|
8
|
-
private alreadyResolved;
|
|
9
|
-
constructor(wsdl: NodeSoapWsdl, logger: Logger);
|
|
10
|
-
warn(...args: any[]): void;
|
|
11
|
-
debug(...args: any[]): void;
|
|
12
|
-
createOperationArgs(operation: NodeSoapOperation): SoapOperationArg[];
|
|
13
|
-
private createOperationArg;
|
|
14
|
-
createOperationOutput(operation: NodeSoapOperation): {
|
|
15
|
-
type: {
|
|
16
|
-
type: SoapType;
|
|
17
|
-
isList: boolean;
|
|
18
|
-
};
|
|
19
|
-
resultField: string;
|
|
20
|
-
};
|
|
21
|
-
private resolveContentToSoapType;
|
|
22
|
-
private findTypeName;
|
|
23
|
-
resolveWsdlNameToSoapType(namespace: string, wsdlTypeName: string, ownerStringForLog: string): SoapType;
|
|
24
|
-
private findXsdTypeDefinition;
|
|
25
|
-
private resolveTypeBody;
|
|
26
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import soap from 'soap';
|
|
2
|
-
/**
|
|
3
|
-
* Type for the soap-client from node-soap.
|
|
4
|
-
*/
|
|
5
|
-
export declare type NodeSoapClient = any | soap.Client;
|
|
6
|
-
export declare type NodeSoapWsdl = any | soap.WSDL;
|
|
7
|
-
/**
|
|
8
|
-
* Creation options for a node-soap client.
|
|
9
|
-
*/
|
|
10
|
-
export declare type NodeSoapOptions = {
|
|
11
|
-
options?: soap.IOptions;
|
|
12
|
-
/**
|
|
13
|
-
* For convenience:
|
|
14
|
-
* If set, the security of the created node-soap client will be set to basic-auth with the given options.
|
|
15
|
-
*/
|
|
16
|
-
basicAuth?: {
|
|
17
|
-
username: string;
|
|
18
|
-
password: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare function createSoapClient(url: string, options?: NodeSoapOptions): Promise<NodeSoapClient>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { NodeSoapClient, NodeSoapOptions } from './node-soap/node-soap';
|
|
2
|
-
import { SchemaOptions } from './soap2graphql/soap2graphql';
|
|
3
|
-
import { SoapCaller } from './soap2graphql/soap-caller';
|
|
4
|
-
import { Logger } from '@graphql-mesh/types';
|
|
5
|
-
import { GraphQLSchema, GraphQLSchemaConfig } from 'graphql';
|
|
6
|
-
export declare type SoapGraphqlOptions = {
|
|
7
|
-
/**
|
|
8
|
-
* node-soap client to use.
|
|
9
|
-
* Either this field or 'createClient' must be filled.
|
|
10
|
-
*/
|
|
11
|
-
soapClient?: NodeSoapClient;
|
|
12
|
-
/**
|
|
13
|
-
* Creation parameters for a node-soap client.
|
|
14
|
-
* Will only be used if 'soapClient' is empty.
|
|
15
|
-
* Either this field or 'soapClient' must be filled.
|
|
16
|
-
*/
|
|
17
|
-
createClient?: {
|
|
18
|
-
url: string;
|
|
19
|
-
options?: NodeSoapOptions;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Options for the GraphQL schema.
|
|
23
|
-
*/
|
|
24
|
-
schemaOptions?: SchemaOptions;
|
|
25
|
-
/**
|
|
26
|
-
* Handler for executing a soap call based on input from GraphQL.
|
|
27
|
-
* Use this, if request do need pre-processing (resp.: responses need post-processing) before execution.
|
|
28
|
-
*
|
|
29
|
-
* default: NodeSoapCaller
|
|
30
|
-
*/
|
|
31
|
-
soapCaller?: SoapCaller;
|
|
32
|
-
/**
|
|
33
|
-
* If set to true, (a lot of) debug-information will be dumped to console.log
|
|
34
|
-
* Do not use this in production!
|
|
35
|
-
*
|
|
36
|
-
* default: false
|
|
37
|
-
*/
|
|
38
|
-
debug?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* If set to true, warnings will be printed to console.log
|
|
41
|
-
* A warning means: The GraphQL schema can be generated, but it might not work as intended.
|
|
42
|
-
*
|
|
43
|
-
* default: false
|
|
44
|
-
*/
|
|
45
|
-
warnings?: boolean;
|
|
46
|
-
logger: Logger;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Creates a GraphQL schema for the WSDL defined by the given parameters.
|
|
50
|
-
*
|
|
51
|
-
* The created GraphQL schema will include:
|
|
52
|
-
* - A Mutation-field for every operation in the WSDL.
|
|
53
|
-
* If the field is queried via GraphQL, the SOAP endpoint declared in the WSDL will be called and the result of the call will be returned via GraphQL.
|
|
54
|
-
* - A GraphQL output type for every WSDL type that is: a) used as a result of an operation and b) declared in the schema section of the WSDL.
|
|
55
|
-
* - A GraphQL interface type for every WSDL type that is: a) used as a base type of another type and b) declared in the schema section of the WSDL.
|
|
56
|
-
* - A GraphQL input type for every WSDL type that is: a) used as a input type of an operation and b) declared in the schema section of the WSDL.
|
|
57
|
-
* - A Query-field that returns the content of the WSDL (this is necessary, since a GraphQL schema must include at least one Query-field)
|
|
58
|
-
*
|
|
59
|
-
* @param options either an instance of SoapGraphQLOptions or the URL (http/https or path to a file) to a WSDL.
|
|
60
|
-
*/
|
|
61
|
-
export declare function soapGraphqlSchema(options: SoapGraphqlOptions): Promise<GraphQLSchema>;
|
|
62
|
-
export declare function soapGraphqlSchemaConfig(options: SoapGraphqlOptions): Promise<GraphQLSchemaConfig>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { GraphQLScalarType, GraphQLOutputType, GraphQLInputType, GraphQLList } from 'graphql';
|
|
2
|
-
/**
|
|
3
|
-
* Resolver that converts WSDL types, that are not fully defined in the WSDL itself, to GraphQL types.
|
|
4
|
-
* This is especially necessary for all primitive WSDL types (resp. scalar GraphQL types) like 'string', 'datetime', etc.
|
|
5
|
-
*
|
|
6
|
-
* You can provide your own resolver to handle custom types of your WSDL.
|
|
7
|
-
* But you must still provide resolvment for primitive types like 'string', e.g by re-using DefaultTypeResolver.
|
|
8
|
-
*/
|
|
9
|
-
export interface CustomTypeResolver {
|
|
10
|
-
outputType(typeName: string): GraphQLOutputType;
|
|
11
|
-
inputType(typeName: string): GraphQLInputType;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Default implementation of CustomTypeResolver.
|
|
15
|
-
* Based on https://www.w3.org/TR/xmlschema-2/#built-in-datatypes
|
|
16
|
-
*/
|
|
17
|
-
export declare class DefaultTypeResolver implements CustomTypeResolver {
|
|
18
|
-
string: GraphQLScalarType<string, string>;
|
|
19
|
-
base64Binary: GraphQLScalarType<unknown, unknown>;
|
|
20
|
-
hexBinary: GraphQLScalarType<unknown, unknown>;
|
|
21
|
-
duration: GraphQLScalarType<unknown, unknown>;
|
|
22
|
-
gYearMonth: GraphQLScalarType<string, string>;
|
|
23
|
-
gYear: GraphQLScalarType<string, string>;
|
|
24
|
-
gMonthDay: GraphQLScalarType<string, string>;
|
|
25
|
-
gDay: GraphQLScalarType<string, string>;
|
|
26
|
-
gMonth: GraphQLScalarType<string, string>;
|
|
27
|
-
anyURI: GraphQLScalarType<unknown, unknown>;
|
|
28
|
-
QName: GraphQLScalarType<string, string>;
|
|
29
|
-
normalizedString: GraphQLScalarType<string, string>;
|
|
30
|
-
token: GraphQLScalarType<string, string>;
|
|
31
|
-
NMTOKEN: GraphQLScalarType<string, string>;
|
|
32
|
-
NMTOKENS: GraphQLScalarType<string, string>;
|
|
33
|
-
language: GraphQLScalarType<string, string>;
|
|
34
|
-
Name: GraphQLScalarType<string, string>;
|
|
35
|
-
NCName: GraphQLScalarType<string, string>;
|
|
36
|
-
IDREF: GraphQLScalarType<string, string>;
|
|
37
|
-
IDREFS: GraphQLList<GraphQLScalarType<string, string>>;
|
|
38
|
-
ENTITY: GraphQLScalarType<string, string>;
|
|
39
|
-
ENTITIES: GraphQLList<GraphQLScalarType<string, string>>;
|
|
40
|
-
ID: GraphQLScalarType<string, string>;
|
|
41
|
-
boolean: GraphQLScalarType<boolean, boolean>;
|
|
42
|
-
byte: GraphQLScalarType<unknown, unknown>;
|
|
43
|
-
unsignedByte: GraphQLScalarType<unknown, unknown>;
|
|
44
|
-
short: GraphQLScalarType<number, number>;
|
|
45
|
-
unsignedShort: GraphQLScalarType<unknown, unknown>;
|
|
46
|
-
int: GraphQLScalarType<number, number>;
|
|
47
|
-
unsignedInt: GraphQLScalarType<unknown, unknown>;
|
|
48
|
-
integer: GraphQLScalarType<number, number>;
|
|
49
|
-
positiveInteger: GraphQLScalarType<unknown, unknown>;
|
|
50
|
-
nonPositiveInteger: GraphQLScalarType<unknown, unknown>;
|
|
51
|
-
negativeInteger: GraphQLScalarType<unknown, unknown>;
|
|
52
|
-
nonNegativeInteger: GraphQLScalarType<unknown, unknown>;
|
|
53
|
-
long: GraphQLScalarType<unknown, unknown>;
|
|
54
|
-
unsignedLong: GraphQLScalarType<unknown, unknown>;
|
|
55
|
-
decimal: GraphQLScalarType<number, number>;
|
|
56
|
-
float: GraphQLScalarType<number, number>;
|
|
57
|
-
double: GraphQLScalarType<number, number>;
|
|
58
|
-
dateTime: GraphQLScalarType<unknown, unknown>;
|
|
59
|
-
date: GraphQLScalarType<unknown, unknown>;
|
|
60
|
-
time: GraphQLScalarType<unknown, unknown>;
|
|
61
|
-
resolve(typeName: string): GraphQLScalarType;
|
|
62
|
-
outputType(typeName: string): GraphQLOutputType;
|
|
63
|
-
inputType(typeName: string): GraphQLInputType;
|
|
64
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SoapCaller, SoapCallInput } from './soap-caller';
|
|
2
|
-
import { NameResolver } from './name-resolver';
|
|
3
|
-
import { CustomTypeResolver, DefaultTypeResolver } from './custom-type-resolver';
|
|
4
|
-
import { SchemaOptions } from './soap2graphql';
|
|
5
|
-
export { SchemaOptions, CustomTypeResolver, DefaultTypeResolver, NameResolver, SoapCaller, SoapCallInput };
|
|
6
|
-
export * from './soap-endpoint';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { SoapObjectType } from './soap-endpoint';
|
|
2
|
-
export declare type NameResolver = (soapType: SoapObjectType) => string;
|
|
3
|
-
export declare const defaultOutputNameResolver: NameResolver;
|
|
4
|
-
export declare const defaultInputNameResolver: NameResolver;
|
|
5
|
-
export declare const defaultInterfaceNameResolver: NameResolver;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SchemaOptions } from './soap2graphql';
|
|
2
|
-
import { SoapEndpoint, SoapService, SoapPort, SoapOperation } from './soap-endpoint';
|
|
3
|
-
import { SoapCaller } from './soap-caller';
|
|
4
|
-
import { GraphQLObjectType, GraphQLFieldConfigMap, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLOutputType, GraphQLFieldResolver, GraphQLSchemaConfig } from 'graphql';
|
|
5
|
-
import { Logger } from '@graphql-mesh/types';
|
|
6
|
-
declare type RootType = 'query' | 'mutation';
|
|
7
|
-
export declare class SchemaResolver {
|
|
8
|
-
private soapEndpoint;
|
|
9
|
-
private soapCaller;
|
|
10
|
-
private logger;
|
|
11
|
-
private readonly options;
|
|
12
|
-
private outputResolver;
|
|
13
|
-
private inputResolver;
|
|
14
|
-
constructor(soapEndpoint: SoapEndpoint, soapCaller: SoapCaller, options: SchemaOptions, logger: Logger);
|
|
15
|
-
defaultOptions(options: SchemaOptions): SchemaOptions;
|
|
16
|
-
resolve(): GraphQLSchemaConfig;
|
|
17
|
-
getFields(rootType: RootType): GraphQLFieldConfigMap<any, any>;
|
|
18
|
-
createQueryObject(): GraphQLObjectType;
|
|
19
|
-
createMutationObject(): GraphQLObjectType;
|
|
20
|
-
createSoapServiceField(service: SoapService, rootType: RootType): GraphQLFieldConfig<any, any>;
|
|
21
|
-
createSoapPortField(service: SoapService, port: SoapPort, rootType: RootType): GraphQLFieldConfig<any, any>;
|
|
22
|
-
getFieldConfig(operation: SoapOperation): GraphQLFieldConfig<any, any>;
|
|
23
|
-
createSoapOperationField(operation: SoapOperation, rootType: RootType): GraphQLFieldConfig<any, any>;
|
|
24
|
-
createSoapOperationFieldArgs(operation: SoapOperation): GraphQLFieldConfigArgumentMap;
|
|
25
|
-
resolveSoapOperationReturnType(operation: SoapOperation): GraphQLOutputType;
|
|
26
|
-
createSoapOperationFieldResolver<TSource, TContext>(operation: SoapOperation): GraphQLFieldResolver<TSource, {
|
|
27
|
-
[argName: string]: any;
|
|
28
|
-
}, TContext>;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SoapOperation } from './soap-endpoint';
|
|
2
|
-
import { GraphQLResolveInfo } from 'graphql';
|
|
3
|
-
export declare type SoapCallInput = {
|
|
4
|
-
operation: SoapOperation;
|
|
5
|
-
graphqlSource: any;
|
|
6
|
-
graphqlArgs: {
|
|
7
|
-
[argName: string]: any;
|
|
8
|
-
};
|
|
9
|
-
graphqlContext: any;
|
|
10
|
-
graphqlInfo: GraphQLResolveInfo;
|
|
11
|
-
};
|
|
12
|
-
export interface SoapCaller {
|
|
13
|
-
/**
|
|
14
|
-
* Executes a SOAP call.
|
|
15
|
-
*/
|
|
16
|
-
call(input: SoapCallInput): Promise<any>;
|
|
17
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SOAP endpoint defined by a WSDL.
|
|
3
|
-
*/
|
|
4
|
-
export interface SoapEndpoint {
|
|
5
|
-
services(): SoapService[];
|
|
6
|
-
/**
|
|
7
|
-
* Returns a textual, human readable description of the soap endpoint.
|
|
8
|
-
* Note: ATM this is only used to have at least one query field in the GraphQLSchema.
|
|
9
|
-
*/
|
|
10
|
-
description(): string;
|
|
11
|
-
}
|
|
12
|
-
export interface SoapService {
|
|
13
|
-
endpoint(): SoapEndpoint;
|
|
14
|
-
name(): string;
|
|
15
|
-
ports(): SoapPort[];
|
|
16
|
-
}
|
|
17
|
-
export interface SoapPort {
|
|
18
|
-
endpoint(): SoapEndpoint;
|
|
19
|
-
service(): SoapService;
|
|
20
|
-
name(): string;
|
|
21
|
-
operations(): SoapOperation[];
|
|
22
|
-
}
|
|
23
|
-
export interface SoapOperation {
|
|
24
|
-
endpoint(): SoapEndpoint;
|
|
25
|
-
service(): SoapService;
|
|
26
|
-
port(): SoapPort;
|
|
27
|
-
name(): string;
|
|
28
|
-
/**
|
|
29
|
-
* Arguments that this operation accepts.
|
|
30
|
-
*/
|
|
31
|
-
args(): SoapOperationArg[];
|
|
32
|
-
/**
|
|
33
|
-
* Output that this operation provides if called.
|
|
34
|
-
*/
|
|
35
|
-
output(): {
|
|
36
|
-
type: SoapType;
|
|
37
|
-
isList: boolean;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* The field in the SOAP output message that contains the actual output.
|
|
41
|
-
*/
|
|
42
|
-
resultField(): string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A type declared in the WSDL.
|
|
46
|
-
*/
|
|
47
|
-
export declare type SoapType = SoapObjectType | SoapPrimitiveType;
|
|
48
|
-
/**
|
|
49
|
-
* A primitive type in the WSDL - only defined by its name.
|
|
50
|
-
*/
|
|
51
|
-
export declare type SoapPrimitiveType = string;
|
|
52
|
-
/**
|
|
53
|
-
* An object type in the WSDL.
|
|
54
|
-
* Defined by its name, fields and maybe a base type.
|
|
55
|
-
*/
|
|
56
|
-
export interface SoapObjectType {
|
|
57
|
-
name: string;
|
|
58
|
-
base: SoapObjectType;
|
|
59
|
-
fields: SoapField[];
|
|
60
|
-
}
|
|
61
|
-
export interface SoapField {
|
|
62
|
-
name: string;
|
|
63
|
-
type: SoapType;
|
|
64
|
-
isList: boolean;
|
|
65
|
-
}
|
|
66
|
-
export declare type SoapOperationArg = SoapField;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { CustomTypeResolver } from './custom-type-resolver';
|
|
2
|
-
import { NameResolver } from './name-resolver';
|
|
3
|
-
import { SoapEndpoint } from './soap-endpoint';
|
|
4
|
-
import { SoapCaller } from './soap-caller';
|
|
5
|
-
import { Logger } from '@graphql-mesh/types';
|
|
6
|
-
import { GraphQLSchemaConfig } from 'graphql';
|
|
7
|
-
/**
|
|
8
|
-
* Options for the GraphQL schema.
|
|
9
|
-
*/
|
|
10
|
-
export declare type SchemaOptions = {
|
|
11
|
-
/**
|
|
12
|
-
* If true, the services defined in the WSDL will be represented as GraphQL-Type objects in the schema.
|
|
13
|
-
* The fields of the object will be the ports of the service (or the operation, dependent on 'includePorts').
|
|
14
|
-
*
|
|
15
|
-
* Most soap-endpoints only define one service; so including it in the schema will just be inconvenient.
|
|
16
|
-
* But if there are multiple services with operations of the same name, you should set this option to true.
|
|
17
|
-
* Otherwise only one of the identical-named operations will be callable.
|
|
18
|
-
*
|
|
19
|
-
* default: false
|
|
20
|
-
*/
|
|
21
|
-
includeServices?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* If true, the ports defined in the WSDL will be represented as GraphQL-Type objects in the schema.
|
|
24
|
-
* The fields of the object will be the operations of the port.
|
|
25
|
-
*
|
|
26
|
-
* Most soap-endpoints only define one port; so including it in the schema will just be inconvenient.
|
|
27
|
-
* But if there are multiple ports with operations of the same name, you should set this option to true.
|
|
28
|
-
* Otherwise only one of the identical-named operations will be callable.
|
|
29
|
-
*
|
|
30
|
-
* default: false
|
|
31
|
-
*/
|
|
32
|
-
includePorts?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Resolver that will be used to convert WSDL types, that are not fully defined in the WSDL itself, to GraphQL types.
|
|
35
|
-
* This is especially necessary for all primitive WSDL types (resp. scalar GraphQL types) like 'string', 'datetime', etc.
|
|
36
|
-
*
|
|
37
|
-
* You can provide your own resolver to handle custom types of your WSDL.
|
|
38
|
-
* But you must still provide resolvment for primitive types like 'string', e.g by re-using DefaultTypeResolver.
|
|
39
|
-
*
|
|
40
|
-
* default: DefaultTypeResolver
|
|
41
|
-
*/
|
|
42
|
-
customResolver?: CustomTypeResolver;
|
|
43
|
-
/**
|
|
44
|
-
* Function that proivides the name of a GraphQLOutputType.
|
|
45
|
-
* The created name must be unique in the GraphQL schema!
|
|
46
|
-
* (This is especially important, since SOAP allows to use the same type for input and output, but GraphQL does not)
|
|
47
|
-
*
|
|
48
|
-
* default: use the name of the WSDL type.
|
|
49
|
-
*/
|
|
50
|
-
outputNameResolver?: NameResolver;
|
|
51
|
-
/**
|
|
52
|
-
* Function that proivides the name of a GraphQLInterfaceType.
|
|
53
|
-
* The created name must be unique in the GraphQL schema!
|
|
54
|
-
* (This is especially important, since SOAP allows to use the same type for input and output, but GraphQL does not)
|
|
55
|
-
*
|
|
56
|
-
* default: 'i' + WSDL type name.
|
|
57
|
-
*/
|
|
58
|
-
interfaceNameResolver?: NameResolver;
|
|
59
|
-
/**
|
|
60
|
-
* Function that proivides the name of a GraphQLInputType.
|
|
61
|
-
* The created name must be unique in the GraphQL schema!
|
|
62
|
-
* (This is especially important, since SOAP allows to use the same type for input and output, but GraphQL does not)
|
|
63
|
-
*
|
|
64
|
-
* default: WSDL type name + 'Input'.
|
|
65
|
-
*/
|
|
66
|
-
inputNameResolver?: NameResolver;
|
|
67
|
-
/**
|
|
68
|
-
* Automatically put operations starts with `query` or `get` into the Query type
|
|
69
|
-
* default: false
|
|
70
|
-
*/
|
|
71
|
-
selectQueryOperationsAuto?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Allows to explicitly override the default operation(Query or Mutation) for any SOAP operation
|
|
74
|
-
*/
|
|
75
|
-
selectQueryOrMutationField?: SoapSelectQueryOrMutationFieldConfig[];
|
|
76
|
-
};
|
|
77
|
-
export interface SoapSelectQueryOrMutationFieldConfig {
|
|
78
|
-
service: string;
|
|
79
|
-
port: string;
|
|
80
|
-
operation: string;
|
|
81
|
-
type: 'query' | 'mutation';
|
|
82
|
-
}
|
|
83
|
-
export declare function createSchemaConfig(endpoint: SoapEndpoint, soapCaller: SoapCaller, options: SchemaOptions, logger: Logger): GraphQLSchemaConfig;
|