@xyo-network/api-graphql-plugin 4.0.0 → 4.1.1
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/dist/browser/index.d.ts +52 -0
- package/dist/browser/spec/Witness.spec.d.ts +2 -0
- package/dist/browser/spec/Witness.spec.d.ts.map +1 -0
- package/dist/neutral/Plugin.d.ts +3 -0
- package/dist/neutral/Plugin.d.ts.map +1 -0
- package/dist/neutral/Witness.d.ts +46 -0
- package/dist/neutral/Witness.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +52 -0
- package/dist/neutral/index.d.ts.map +1 -0
- package/dist/neutral/spec/Witness.spec.d.ts +2 -0
- package/dist/neutral/spec/Witness.spec.d.ts.map +1 -0
- package/dist/node/Plugin.d.ts +3 -0
- package/dist/node/Plugin.d.ts.map +1 -0
- package/dist/node/Witness.d.ts +46 -0
- package/dist/node/Witness.d.ts.map +1 -0
- package/dist/node/index.d.ts +52 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/spec/Witness.spec.d.ts +2 -0
- package/dist/node/spec/Witness.spec.d.ts.map +1 -0
- package/package.json +14 -14
- package/dist/types/index.d.ts +0 -3
- /package/dist/{types → browser}/Plugin.d.ts +0 -0
- /package/dist/{types → browser}/Plugin.d.ts.map +0 -0
- /package/dist/{types → browser}/Witness.d.ts +0 -0
- /package/dist/{types → browser}/Witness.d.ts.map +0 -0
- /package/dist/{types → browser}/index.d.ts.map +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
|
|
2
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
3
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
+
import { WitnessParams, WitnessConfig } from '@xyo-network/witness-model';
|
|
6
|
+
import { ExecutionResult } from 'graphql';
|
|
7
|
+
|
|
8
|
+
declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
|
|
9
|
+
type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
|
|
10
|
+
type ApiGraphqlWitnessConfig = WitnessConfig<{
|
|
11
|
+
endpoint?: string;
|
|
12
|
+
schema: ApiGraphqlWitnessConfigSchema;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}>;
|
|
15
|
+
type HttpHeaderValue = string | string[] | number | boolean | null;
|
|
16
|
+
interface HttpHeaders {
|
|
17
|
+
[key: string]: HttpHeaderValue;
|
|
18
|
+
}
|
|
19
|
+
interface ApiGraphqlWitnessParams extends WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>> {
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
headers?: HttpHeaders;
|
|
22
|
+
}
|
|
23
|
+
declare const GraphqlQuerySchema = "network.xyo.graphql.query";
|
|
24
|
+
type GraphqlQuerySchema = typeof GraphqlQuerySchema;
|
|
25
|
+
type GraphqlQuery = Payload<{
|
|
26
|
+
query: string;
|
|
27
|
+
variables: Record<string, unknown>;
|
|
28
|
+
}, GraphqlQuerySchema>;
|
|
29
|
+
declare const GraphqlResultSchema = "network.xyo.graphql.result";
|
|
30
|
+
type GraphqlResultSchema = typeof GraphqlResultSchema;
|
|
31
|
+
type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
|
|
32
|
+
http?: {
|
|
33
|
+
code?: string;
|
|
34
|
+
ipAddress?: string;
|
|
35
|
+
status?: number;
|
|
36
|
+
};
|
|
37
|
+
result?: ExecutionResult<TData, TExtensions>;
|
|
38
|
+
}, GraphqlResultSchema>;
|
|
39
|
+
declare const isGraphqlQuery: (x?: unknown | null) => x is GraphqlQuery;
|
|
40
|
+
declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
|
|
41
|
+
static readonly configSchemas: Schema[];
|
|
42
|
+
static readonly defaultConfigSchema: Schema;
|
|
43
|
+
get endpoint(): string;
|
|
44
|
+
get headers(): HttpHeaders | undefined;
|
|
45
|
+
get timeout(): number | undefined;
|
|
46
|
+
protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare const ApiGraphqlWitnessPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<ApiGraphqlWitness<ApiGraphqlWitnessParams>>;
|
|
50
|
+
|
|
51
|
+
export { ApiGraphqlWitness, ApiGraphqlWitnessConfigSchema, ApiGraphqlWitnessPlugin, GraphqlQuerySchema, GraphqlResultSchema, ApiGraphqlWitnessPlugin as default, isGraphqlQuery };
|
|
52
|
+
export type { ApiGraphqlWitnessConfig, ApiGraphqlWitnessParams, GraphqlQuery, GraphqlResult, HttpHeaderValue, HttpHeaders };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAsB,MAAM,cAAc,CAAA;AAEpE,eAAO,MAAM,uBAAuB,2IAQjC,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
+
import type { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
+
import type { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
+
import type { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
|
|
5
|
+
import type { ExecutionResult } from 'graphql';
|
|
6
|
+
export declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
|
|
7
|
+
export type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
|
|
8
|
+
export type ApiGraphqlWitnessConfig = WitnessConfig<{
|
|
9
|
+
endpoint?: string;
|
|
10
|
+
schema: ApiGraphqlWitnessConfigSchema;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}>;
|
|
13
|
+
export type HttpHeaderValue = string | string[] | number | boolean | null;
|
|
14
|
+
export interface HttpHeaders {
|
|
15
|
+
[key: string]: HttpHeaderValue;
|
|
16
|
+
}
|
|
17
|
+
export interface ApiGraphqlWitnessParams extends WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>> {
|
|
18
|
+
endpoint?: string;
|
|
19
|
+
headers?: HttpHeaders;
|
|
20
|
+
}
|
|
21
|
+
export declare const GraphqlQuerySchema = "network.xyo.graphql.query";
|
|
22
|
+
export type GraphqlQuerySchema = typeof GraphqlQuerySchema;
|
|
23
|
+
export type GraphqlQuery = Payload<{
|
|
24
|
+
query: string;
|
|
25
|
+
variables: Record<string, unknown>;
|
|
26
|
+
}, GraphqlQuerySchema>;
|
|
27
|
+
export declare const GraphqlResultSchema = "network.xyo.graphql.result";
|
|
28
|
+
export type GraphqlResultSchema = typeof GraphqlResultSchema;
|
|
29
|
+
export type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
|
|
30
|
+
http?: {
|
|
31
|
+
code?: string;
|
|
32
|
+
ipAddress?: string;
|
|
33
|
+
status?: number;
|
|
34
|
+
};
|
|
35
|
+
result?: ExecutionResult<TData, TExtensions>;
|
|
36
|
+
}, GraphqlResultSchema>;
|
|
37
|
+
export declare const isGraphqlQuery: (x?: unknown | null) => x is GraphqlQuery;
|
|
38
|
+
export declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
|
|
39
|
+
static readonly configSchemas: Schema[];
|
|
40
|
+
static readonly defaultConfigSchema: Schema;
|
|
41
|
+
get endpoint(): string;
|
|
42
|
+
get headers(): HttpHeaders | undefined;
|
|
43
|
+
get timeout(): number | undefined;
|
|
44
|
+
protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,6BAA6B,mCAAmC,CAAA;AAC7E,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,6BAA6B,CAAA;IACrC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAEzE,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAA;CAC/B;AAED,MAAM,WAAW,uBAAwB,SAAQ,aAAa,CAC5D,eAAe,CAAC,uBAAuB,CAAC,CAAC;IAEzC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AAED,eAAO,MAAM,kBAAkB,8BAA8B,C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'@xyo-network/abstract-witness';
|
|
3
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
+
import { WitnessParams, WitnessConfig } from '@xyo-network/witness-model';
|
|
6
|
+
import { ExecutionResult } from 'graphql';
|
|
7
|
+
|
|
8
|
+
declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
|
|
9
|
+
type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
|
|
10
|
+
type ApiGraphqlWitnessConfig = WitnessConfig<{
|
|
11
|
+
endpoint?: string;
|
|
12
|
+
schema: ApiGraphqlWitnessConfigSchema;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}>;
|
|
15
|
+
type HttpHeaderValue = string | string[] | number | boolean | null;
|
|
16
|
+
interface HttpHeaders {
|
|
17
|
+
[key: string]: HttpHeaderValue;
|
|
18
|
+
}
|
|
19
|
+
interface ApiGraphqlWitnessParams extends WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>> {
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
headers?: HttpHeaders;
|
|
22
|
+
}
|
|
23
|
+
declare const GraphqlQuerySchema = "network.xyo.graphql.query";
|
|
24
|
+
type GraphqlQuerySchema = typeof GraphqlQuerySchema;
|
|
25
|
+
type GraphqlQuery = Payload<{
|
|
26
|
+
query: string;
|
|
27
|
+
variables: Record<string, unknown>;
|
|
28
|
+
}, GraphqlQuerySchema>;
|
|
29
|
+
declare const GraphqlResultSchema = "network.xyo.graphql.result";
|
|
30
|
+
type GraphqlResultSchema = typeof GraphqlResultSchema;
|
|
31
|
+
type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
|
|
32
|
+
http?: {
|
|
33
|
+
code?: string;
|
|
34
|
+
ipAddress?: string;
|
|
35
|
+
status?: number;
|
|
36
|
+
};
|
|
37
|
+
result?: ExecutionResult<TData, TExtensions>;
|
|
38
|
+
}, GraphqlResultSchema>;
|
|
39
|
+
declare const isGraphqlQuery: (x?: unknown | null) => x is GraphqlQuery;
|
|
40
|
+
declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
|
|
41
|
+
static readonly configSchemas: Schema[];
|
|
42
|
+
static readonly defaultConfigSchema: Schema;
|
|
43
|
+
get endpoint(): string;
|
|
44
|
+
get headers(): HttpHeaders | undefined;
|
|
45
|
+
get timeout(): number | undefined;
|
|
46
|
+
protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare const ApiGraphqlWitnessPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<ApiGraphqlWitness<ApiGraphqlWitnessParams>>;
|
|
50
|
+
|
|
51
|
+
export { ApiGraphqlWitness, ApiGraphqlWitnessConfigSchema, ApiGraphqlWitnessPlugin, GraphqlQuerySchema, GraphqlResultSchema, ApiGraphqlWitnessPlugin as default, isGraphqlQuery };
|
|
52
|
+
export type { ApiGraphqlWitnessConfig, ApiGraphqlWitnessParams, GraphqlQuery, GraphqlResult, HttpHeaderValue, HttpHeaders };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AACzF,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAsB,MAAM,cAAc,CAAA;AAEpE,eAAO,MAAM,uBAAuB,2IAQjC,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
+
import type { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
+
import type { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
+
import type { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
|
|
5
|
+
import type { ExecutionResult } from 'graphql';
|
|
6
|
+
export declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
|
|
7
|
+
export type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
|
|
8
|
+
export type ApiGraphqlWitnessConfig = WitnessConfig<{
|
|
9
|
+
endpoint?: string;
|
|
10
|
+
schema: ApiGraphqlWitnessConfigSchema;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}>;
|
|
13
|
+
export type HttpHeaderValue = string | string[] | number | boolean | null;
|
|
14
|
+
export interface HttpHeaders {
|
|
15
|
+
[key: string]: HttpHeaderValue;
|
|
16
|
+
}
|
|
17
|
+
export interface ApiGraphqlWitnessParams extends WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>> {
|
|
18
|
+
endpoint?: string;
|
|
19
|
+
headers?: HttpHeaders;
|
|
20
|
+
}
|
|
21
|
+
export declare const GraphqlQuerySchema = "network.xyo.graphql.query";
|
|
22
|
+
export type GraphqlQuerySchema = typeof GraphqlQuerySchema;
|
|
23
|
+
export type GraphqlQuery = Payload<{
|
|
24
|
+
query: string;
|
|
25
|
+
variables: Record<string, unknown>;
|
|
26
|
+
}, GraphqlQuerySchema>;
|
|
27
|
+
export declare const GraphqlResultSchema = "network.xyo.graphql.result";
|
|
28
|
+
export type GraphqlResultSchema = typeof GraphqlResultSchema;
|
|
29
|
+
export type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
|
|
30
|
+
http?: {
|
|
31
|
+
code?: string;
|
|
32
|
+
ipAddress?: string;
|
|
33
|
+
status?: number;
|
|
34
|
+
};
|
|
35
|
+
result?: ExecutionResult<TData, TExtensions>;
|
|
36
|
+
}, GraphqlResultSchema>;
|
|
37
|
+
export declare const isGraphqlQuery: (x?: unknown | null) => x is GraphqlQuery;
|
|
38
|
+
export declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
|
|
39
|
+
static readonly configSchemas: Schema[];
|
|
40
|
+
static readonly defaultConfigSchema: Schema;
|
|
41
|
+
get endpoint(): string;
|
|
42
|
+
get headers(): HttpHeaders | undefined;
|
|
43
|
+
get timeout(): number | undefined;
|
|
44
|
+
protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,6BAA6B,mCAAmC,CAAA;AAC7E,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,6BAA6B,CAAA;IACrC,OAAO,CAAC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,CACvH,OAAO,EACP,YAAY,EACZ,aAAa,CACd;IACC,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA0D;IAC1G,gBAAyB,mBAAmB,EAAE,MAAM,CAAgC;IAEpF,IAAI,QAAQ,WAEX;IAED,IAAI,OAAO,4BAEV;IAED,IAAI,OAAO,uBAEV;cAEwB,cAAc,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAiB7F"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
|
|
2
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
3
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
+
import { WitnessParams, WitnessConfig } from '@xyo-network/witness-model';
|
|
6
|
+
import { ExecutionResult } from 'graphql';
|
|
7
|
+
|
|
8
|
+
declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
|
|
9
|
+
type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
|
|
10
|
+
type ApiGraphqlWitnessConfig = WitnessConfig<{
|
|
11
|
+
endpoint?: string;
|
|
12
|
+
schema: ApiGraphqlWitnessConfigSchema;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}>;
|
|
15
|
+
type HttpHeaderValue = string | string[] | number | boolean | null;
|
|
16
|
+
interface HttpHeaders {
|
|
17
|
+
[key: string]: HttpHeaderValue;
|
|
18
|
+
}
|
|
19
|
+
interface ApiGraphqlWitnessParams extends WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>> {
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
headers?: HttpHeaders;
|
|
22
|
+
}
|
|
23
|
+
declare const GraphqlQuerySchema = "network.xyo.graphql.query";
|
|
24
|
+
type GraphqlQuerySchema = typeof GraphqlQuerySchema;
|
|
25
|
+
type GraphqlQuery = Payload<{
|
|
26
|
+
query: string;
|
|
27
|
+
variables: Record<string, unknown>;
|
|
28
|
+
}, GraphqlQuerySchema>;
|
|
29
|
+
declare const GraphqlResultSchema = "network.xyo.graphql.result";
|
|
30
|
+
type GraphqlResultSchema = typeof GraphqlResultSchema;
|
|
31
|
+
type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
|
|
32
|
+
http?: {
|
|
33
|
+
code?: string;
|
|
34
|
+
ipAddress?: string;
|
|
35
|
+
status?: number;
|
|
36
|
+
};
|
|
37
|
+
result?: ExecutionResult<TData, TExtensions>;
|
|
38
|
+
}, GraphqlResultSchema>;
|
|
39
|
+
declare const isGraphqlQuery: (x?: unknown | null) => x is GraphqlQuery;
|
|
40
|
+
declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
|
|
41
|
+
static readonly configSchemas: Schema[];
|
|
42
|
+
static readonly defaultConfigSchema: Schema;
|
|
43
|
+
get endpoint(): string;
|
|
44
|
+
get headers(): HttpHeaders | undefined;
|
|
45
|
+
get timeout(): number | undefined;
|
|
46
|
+
protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare const ApiGraphqlWitnessPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<ApiGraphqlWitness<ApiGraphqlWitnessParams>>;
|
|
50
|
+
|
|
51
|
+
export { ApiGraphqlWitness, ApiGraphqlWitnessConfigSchema, ApiGraphqlWitnessPlugin, GraphqlQuerySchema, GraphqlResultSchema, ApiGraphqlWitnessPlugin as default, isGraphqlQuery };
|
|
52
|
+
export type { ApiGraphqlWitnessConfig, ApiGraphqlWitnessParams, GraphqlQuery, GraphqlResult, HttpHeaderValue, HttpHeaders };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AACzF,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/api-graphql-plugin",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -21,29 +21,29 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"types": "./dist/
|
|
24
|
+
"types": "./dist/neutral/index.d.ts",
|
|
25
25
|
"default": "./dist/neutral/index.mjs"
|
|
26
26
|
},
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
|
-
"types": "dist/
|
|
30
|
+
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/assert": "^4.
|
|
33
|
-
"@xylabs/axios": "^4.
|
|
34
|
-
"@xyo-network/abstract-witness": "^4.
|
|
35
|
-
"@xyo-network/module-model": "^4.
|
|
36
|
-
"@xyo-network/payload-model": "^4.
|
|
37
|
-
"@xyo-network/payloadset-plugin": "^4.
|
|
38
|
-
"@xyo-network/witness-model": "^4.
|
|
32
|
+
"@xylabs/assert": "^4.13.23",
|
|
33
|
+
"@xylabs/axios": "^4.13.23",
|
|
34
|
+
"@xyo-network/abstract-witness": "^4.1.7",
|
|
35
|
+
"@xyo-network/module-model": "^4.1.7",
|
|
36
|
+
"@xyo-network/payload-model": "^4.1.7",
|
|
37
|
+
"@xyo-network/payloadset-plugin": "^4.1.7",
|
|
38
|
+
"@xyo-network/witness-model": "^4.1.7",
|
|
39
39
|
"graphql": "^16.11.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
43
|
-
"@xylabs/tsconfig": "^
|
|
44
|
-
"@xylabs/vitest-extended": "^4.
|
|
42
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.24",
|
|
43
|
+
"@xylabs/tsconfig": "^7.0.0-rc.24",
|
|
44
|
+
"@xylabs/vitest-extended": "^4.13.23",
|
|
45
45
|
"ethers": "^6.15.0",
|
|
46
|
-
"knip": "^5.
|
|
46
|
+
"knip": "^5.62.0",
|
|
47
47
|
"typescript": "^5.8.3",
|
|
48
48
|
"vitest": "^3.2.4"
|
|
49
49
|
},
|
package/dist/types/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|