@xyo-network/api-graphql-plugin 2.99.5 → 3.0.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.
Files changed (68) hide show
  1. package/dist/browser/index.d.ts +81 -3
  2. package/dist/browser/index.mjs +23 -38
  3. package/dist/browser/index.mjs.map +1 -1
  4. package/dist/neutral/index.d.ts +81 -3
  5. package/dist/neutral/index.mjs +23 -38
  6. package/dist/neutral/index.mjs.map +1 -1
  7. package/dist/node/index.d.ts +81 -3
  8. package/dist/node/index.mjs +26 -45
  9. package/dist/node/index.mjs.map +1 -1
  10. package/package.json +16 -35
  11. package/src/index.ts +1 -1
  12. package/dist/browser/Plugin.d.cts +0 -24
  13. package/dist/browser/Plugin.d.cts.map +0 -1
  14. package/dist/browser/Plugin.d.mts +0 -24
  15. package/dist/browser/Plugin.d.mts.map +0 -1
  16. package/dist/browser/Plugin.d.ts +0 -24
  17. package/dist/browser/Plugin.d.ts.map +0 -1
  18. package/dist/browser/Witness.d.cts +0 -51
  19. package/dist/browser/Witness.d.cts.map +0 -1
  20. package/dist/browser/Witness.d.mts +0 -51
  21. package/dist/browser/Witness.d.mts.map +0 -1
  22. package/dist/browser/Witness.d.ts +0 -51
  23. package/dist/browser/Witness.d.ts.map +0 -1
  24. package/dist/browser/index.cjs +0 -101
  25. package/dist/browser/index.cjs.map +0 -1
  26. package/dist/browser/index.d.cts +0 -3
  27. package/dist/browser/index.d.cts.map +0 -1
  28. package/dist/browser/index.d.mts +0 -3
  29. package/dist/browser/index.d.mts.map +0 -1
  30. package/dist/browser/index.d.ts.map +0 -1
  31. package/dist/neutral/Plugin.d.cts +0 -24
  32. package/dist/neutral/Plugin.d.cts.map +0 -1
  33. package/dist/neutral/Plugin.d.mts +0 -24
  34. package/dist/neutral/Plugin.d.mts.map +0 -1
  35. package/dist/neutral/Plugin.d.ts +0 -24
  36. package/dist/neutral/Plugin.d.ts.map +0 -1
  37. package/dist/neutral/Witness.d.cts +0 -51
  38. package/dist/neutral/Witness.d.cts.map +0 -1
  39. package/dist/neutral/Witness.d.mts +0 -51
  40. package/dist/neutral/Witness.d.mts.map +0 -1
  41. package/dist/neutral/Witness.d.ts +0 -51
  42. package/dist/neutral/Witness.d.ts.map +0 -1
  43. package/dist/neutral/index.cjs +0 -101
  44. package/dist/neutral/index.cjs.map +0 -1
  45. package/dist/neutral/index.d.cts +0 -3
  46. package/dist/neutral/index.d.cts.map +0 -1
  47. package/dist/neutral/index.d.mts +0 -3
  48. package/dist/neutral/index.d.mts.map +0 -1
  49. package/dist/neutral/index.d.ts.map +0 -1
  50. package/dist/node/Plugin.d.cts +0 -24
  51. package/dist/node/Plugin.d.cts.map +0 -1
  52. package/dist/node/Plugin.d.mts +0 -24
  53. package/dist/node/Plugin.d.mts.map +0 -1
  54. package/dist/node/Plugin.d.ts +0 -24
  55. package/dist/node/Plugin.d.ts.map +0 -1
  56. package/dist/node/Witness.d.cts +0 -51
  57. package/dist/node/Witness.d.cts.map +0 -1
  58. package/dist/node/Witness.d.mts +0 -51
  59. package/dist/node/Witness.d.mts.map +0 -1
  60. package/dist/node/Witness.d.ts +0 -51
  61. package/dist/node/Witness.d.ts.map +0 -1
  62. package/dist/node/index.cjs +0 -114
  63. package/dist/node/index.cjs.map +0 -1
  64. package/dist/node/index.d.cts +0 -3
  65. package/dist/node/index.d.cts.map +0 -1
  66. package/dist/node/index.d.mts +0 -3
  67. package/dist/node/index.d.mts.map +0 -1
  68. package/dist/node/index.d.ts.map +0 -1
@@ -1,3 +1,81 @@
1
- export { ApiGraphqlWitnessPlugin, ApiGraphqlWitnessPlugin as default } from './Plugin.ts';
2
- export * from './Witness.ts';
3
- //# sourceMappingURL=index.d.ts.map
1
+ import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
2
+ import * as _xyo_network_payload_model from '@xyo-network/payload-model';
3
+ import { Payload, Schema } from '@xyo-network/payload-model';
4
+ import { AbstractWitness } from '@xyo-network/abstract-witness';
5
+ import * as _xyo_network_module_model from '@xyo-network/module-model';
6
+ import { AnyConfigSchema } from '@xyo-network/module-model';
7
+ import { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
8
+ import { ExecutionResult } from 'graphql';
9
+ import * as _store__xyo_network_account_model_virtual_3afa553815_package from '.store/@xyo-network-account-model-virtual-3afa553815/package';
10
+ import * as _store__xylabs_object_npm_4_0_0_ffd6151301_package from '.store/@xylabs-object-npm-4.0.0-ffd6151301/package';
11
+
12
+ declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
13
+ type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
14
+ type ApiGraphqlWitnessConfig = WitnessConfig<{
15
+ endpoint?: string;
16
+ schema: ApiGraphqlWitnessConfigSchema;
17
+ timeout?: number;
18
+ }>;
19
+ type HttpHeaderValue = string | string[] | number | boolean | null;
20
+ interface HttpHeaders {
21
+ [key: string]: HttpHeaderValue;
22
+ }
23
+ type ApiGraphqlWitnessParams = WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>, {
24
+ endpoint?: string;
25
+ headers?: HttpHeaders;
26
+ }>;
27
+ declare const GraphqlQuerySchema = "network.xyo.graphql.query";
28
+ type GraphqlQuerySchema = typeof GraphqlQuerySchema;
29
+ type GraphqlQuery = Payload<{
30
+ query: string;
31
+ variables: Record<string, unknown>;
32
+ }, GraphqlQuerySchema>;
33
+ declare const GraphqlResultSchema = "network.xyo.graphql.result";
34
+ type GraphqlResultSchema = typeof GraphqlResultSchema;
35
+ type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
36
+ http?: {
37
+ code?: string;
38
+ ipAddress?: string;
39
+ status?: number;
40
+ };
41
+ result?: ExecutionResult<TData, TExtensions>;
42
+ }, GraphqlResultSchema>;
43
+ declare const isGraphqlQuery: (x?: unknown | null) => x is _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
44
+ query: string;
45
+ variables: Record<string, unknown>;
46
+ } & {
47
+ schema: "network.xyo.graphql.query";
48
+ };
49
+ declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
50
+ static readonly configSchemas: Schema[];
51
+ static readonly defaultConfigSchema: Schema;
52
+ get endpoint(): string;
53
+ get headers(): HttpHeaders | undefined;
54
+ get timeout(): number | undefined;
55
+ protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
56
+ }
57
+
58
+ declare const ApiGraphqlWitnessPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<ApiGraphqlWitness<_store__xylabs_object_npm_4_0_0_ffd6151301_package.BaseParamsFields & {
59
+ account?: _store__xyo_network_account_model_virtual_3afa553815_package.AccountInstance | "random";
60
+ addToResolvers?: boolean;
61
+ additionalSigners?: _store__xyo_network_account_model_virtual_3afa553815_package.AccountInstance[];
62
+ allowNameResolution?: boolean;
63
+ config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & {
64
+ schema: "network.xyo.api.witness.config";
65
+ } & {
66
+ endpoint?: string;
67
+ schema: ApiGraphqlWitnessConfigSchema;
68
+ timeout?: number;
69
+ }, "schema"> & {
70
+ schema: "network.xyo.api.witness.config";
71
+ }, "schema"> & {
72
+ schema: string;
73
+ };
74
+ ephemeralQueryAccountEnabled?: boolean;
75
+ moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
76
+ } & {
77
+ endpoint?: string;
78
+ headers?: HttpHeaders;
79
+ }>>;
80
+
81
+ export { ApiGraphqlWitness, type ApiGraphqlWitnessConfig, ApiGraphqlWitnessConfigSchema, type ApiGraphqlWitnessParams, ApiGraphqlWitnessPlugin, type GraphqlQuery, GraphqlQuerySchema, type GraphqlResult, GraphqlResultSchema, type HttpHeaderValue, type HttpHeaders, ApiGraphqlWitnessPlugin as default, isGraphqlQuery };
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/Plugin.ts
5
2
  import { PayloadSetSchema } from "@xyo-network/payload-model";
6
3
  import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
@@ -15,13 +12,7 @@ var GraphqlQuerySchema = "network.xyo.graphql.query";
15
12
  var GraphqlResultSchema = "network.xyo.graphql.result";
16
13
  var isGraphqlQuery = isPayloadOfSchemaType(GraphqlQuerySchema);
17
14
  var ApiGraphqlWitness = class extends AbstractWitness {
18
- static {
19
- __name(this, "ApiGraphqlWitness");
20
- }
21
- static configSchemas = [
22
- ...super.configSchemas,
23
- ApiGraphqlWitnessConfigSchema
24
- ];
15
+ static configSchemas = [...super.configSchemas, ApiGraphqlWitnessConfigSchema];
25
16
  static defaultConfigSchema = ApiGraphqlWitnessConfigSchema;
26
17
  get endpoint() {
27
18
  return assertEx(this.config.endpoint ?? this.params.endpoint, () => "No endpoint specified");
@@ -35,39 +26,33 @@ var ApiGraphqlWitness = class extends AbstractWitness {
35
26
  async observeHandler(payloads) {
36
27
  await this.started("throw");
37
28
  const queries = payloads?.filter(isGraphqlQuery) ?? [];
38
- const axios = new AxiosJson({
39
- headers: this.headers,
40
- timeout: this.timeout
41
- });
42
- const observations = await Promise.all(queries.map(async ({ query, variables }) => {
43
- const httpResult = await axios.post(this.endpoint, {
44
- query,
45
- variables
46
- });
47
- const result = {
48
- http: {
49
- status: httpResult.status
50
- },
51
- result: httpResult.data,
52
- schema: GraphqlResultSchema
53
- };
54
- return result;
55
- }));
29
+ const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout });
30
+ const observations = await Promise.all(
31
+ queries.map(async ({ query, variables }) => {
32
+ const httpResult = await axios.post(this.endpoint, { query, variables });
33
+ const result = {
34
+ http: {
35
+ status: httpResult.status
36
+ },
37
+ result: httpResult.data,
38
+ schema: GraphqlResultSchema
39
+ };
40
+ return result;
41
+ })
42
+ );
56
43
  return observations.flat();
57
44
  }
58
45
  };
59
46
 
60
47
  // src/Plugin.ts
61
- var ApiGraphqlWitnessPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
62
- required: {
63
- [GraphqlQuerySchema]: 1
64
- },
65
- schema: PayloadSetSchema
66
- }, {
67
- witness: /* @__PURE__ */ __name(async (params) => {
68
- return await ApiGraphqlWitness.create(params);
69
- }, "witness")
70
- }), "ApiGraphqlWitnessPlugin");
48
+ var ApiGraphqlWitnessPlugin = () => createPayloadSetWitnessPlugin(
49
+ { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },
50
+ {
51
+ witness: async (params) => {
52
+ return await ApiGraphqlWitness.create(params);
53
+ }
54
+ }
55
+ );
71
56
  export {
72
57
  ApiGraphqlWitness,
73
58
  ApiGraphqlWitnessConfigSchema,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { ApiGraphqlWitness, GraphqlQuerySchema } from './Witness.ts'\n\nexport const ApiGraphqlWitnessPlugin = () =>\n createPayloadSetWitnessPlugin<ApiGraphqlWitness>(\n { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await ApiGraphqlWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport type { ExecutionResult } from 'graphql'\n\nexport const ApiGraphqlWitnessConfigSchema = 'network.xyo.api.witness.config'\nexport type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema\n\nexport type ApiGraphqlWitnessConfig = WitnessConfig<{\n endpoint?: string\n schema: ApiGraphqlWitnessConfigSchema\n timeout?: number\n}>\n\nexport type HttpHeaderValue = string | string[] | number | boolean | null\n\nexport interface HttpHeaders {\n [key: string]: HttpHeaderValue\n}\n\nexport type ApiGraphqlWitnessParams = WitnessParams<\n AnyConfigSchema<ApiGraphqlWitnessConfig>,\n {\n endpoint?: string\n headers?: HttpHeaders\n }\n>\n\nexport const GraphqlQuerySchema = 'network.xyo.graphql.query'\nexport type GraphqlQuerySchema = typeof GraphqlQuerySchema\n\nexport type GraphqlQuery = Payload<\n {\n query: string\n variables: Record<string, unknown>\n },\n GraphqlQuerySchema\n>\n\nexport const GraphqlResultSchema = 'network.xyo.graphql.result'\nexport type GraphqlResultSchema = typeof GraphqlResultSchema\n\nexport type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<\n {\n http?: {\n code?: string\n ipAddress?: string\n status?: number\n }\n result?: ExecutionResult<TData, TExtensions>\n },\n GraphqlResultSchema\n>\n\nexport const isGraphqlQuery = isPayloadOfSchemaType<GraphqlQuery>(GraphqlQuerySchema)\n\nexport class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<\n TParams,\n GraphqlQuery,\n GraphqlResult\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiGraphqlWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiGraphqlWitnessConfigSchema\n\n get endpoint() {\n return assertEx(this.config.endpoint ?? this.params.endpoint, () => 'No endpoint specified')\n }\n\n get headers() {\n return this.params.headers\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n protected override async observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]> {\n await this.started('throw')\n const queries = payloads?.filter(isGraphqlQuery) ?? []\n const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout })\n const observations = await Promise.all(\n queries.map(async ({ query, variables }) => {\n const httpResult = await axios.post(this.endpoint, { query, variables })\n const result: GraphqlResult = {\n http: {\n status: httpResult.status,\n },\n result: httpResult.data,\n schema: GraphqlResultSchema,\n }\n return result\n }),\n )\n return observations.flat()\n }\n}\n"],"mappings":";;;;AAAA,SAASA,wBAAwB;AACjC,SAASC,qCAAqC;;;ACD9C,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAEhC,SAASC,6BAA8C;AAIhD,IAAMC,gCAAgC;AAuBtC,IAAMC,qBAAqB;AAW3B,IAAMC,sBAAsB;AAe5B,IAAMC,iBAAiBC,sBAAoCH,kBAAAA;AAE3D,IAAMI,oBAAN,cAAmGC,gBAAAA;EA3D1G,OA2D0GA;;;EAKxG,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeP;;EAC5E,OAAyBQ,sBAA8BR;EAEvD,IAAIS,WAAW;AACb,WAAOC,SAAS,KAAKC,OAAOF,YAAY,KAAKG,OAAOH,UAAU,MAAM,uBAAA;EACtE;EAEA,IAAII,UAAU;AACZ,WAAO,KAAKD,OAAOC;EACrB;EAEA,IAAIC,UAAU;AACZ,WAAO,KAAKH,OAAOG;EACrB;EAEA,MAAyBC,eAAeC,UAAqD;AAC3F,UAAM,KAAKC,QAAQ,OAAA;AACnB,UAAMC,UAAUF,UAAUG,OAAOhB,cAAAA,KAAmB,CAAA;AACpD,UAAMiB,QAAQ,IAAIC,UAAU;MAAER,SAAS,KAAKA;MAASC,SAAS,KAAKA;IAAQ,CAAA;AAC3E,UAAMQ,eAAe,MAAMC,QAAQC,IACjCN,QAAQO,IAAI,OAAO,EAAEC,OAAOC,UAAS,MAAE;AACrC,YAAMC,aAAa,MAAMR,MAAMS,KAAK,KAAKpB,UAAU;QAAEiB;QAAOC;MAAU,CAAA;AACtE,YAAMG,SAAwB;QAC5BC,MAAM;UACJC,QAAQJ,WAAWI;QACrB;QACAF,QAAQF,WAAWK;QACnBC,QAAQhC;MACV;AACA,aAAO4B;IACT,CAAA,CAAA;AAEF,WAAOR,aAAaa,KAAI;EAC1B;AACF;;;AD7FO,IAAMC,0BAA0B,6BACrCC,8BACE;EAAEC,UAAU;IAAE,CAACC,kBAAAA,GAAqB;EAAE;EAAGC,QAAQC;AAAiB,GAClE;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAO,MAAMC,kBAAkBC,OAAOF,MAAAA;EACxC,GAFS;AAGX,CAAA,GAPmC;","names":["PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AxiosJson","AbstractWitness","isPayloadOfSchemaType","ApiGraphqlWitnessConfigSchema","GraphqlQuerySchema","GraphqlResultSchema","isGraphqlQuery","isPayloadOfSchemaType","ApiGraphqlWitness","AbstractWitness","configSchemas","defaultConfigSchema","endpoint","assertEx","config","params","headers","timeout","observeHandler","payloads","started","queries","filter","axios","AxiosJson","observations","Promise","all","map","query","variables","httpResult","post","result","http","status","data","schema","flat","ApiGraphqlWitnessPlugin","createPayloadSetWitnessPlugin","required","GraphqlQuerySchema","schema","PayloadSetSchema","witness","params","ApiGraphqlWitness","create"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { ApiGraphqlWitness, GraphqlQuerySchema } from './Witness.ts'\n\nexport const ApiGraphqlWitnessPlugin = () =>\n createPayloadSetWitnessPlugin<ApiGraphqlWitness>(\n { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await ApiGraphqlWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport type { ExecutionResult } from 'graphql'\n\nexport const ApiGraphqlWitnessConfigSchema = 'network.xyo.api.witness.config'\nexport type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema\n\nexport type ApiGraphqlWitnessConfig = WitnessConfig<{\n endpoint?: string\n schema: ApiGraphqlWitnessConfigSchema\n timeout?: number\n}>\n\nexport type HttpHeaderValue = string | string[] | number | boolean | null\n\nexport interface HttpHeaders {\n [key: string]: HttpHeaderValue\n}\n\nexport type ApiGraphqlWitnessParams = WitnessParams<\n AnyConfigSchema<ApiGraphqlWitnessConfig>,\n {\n endpoint?: string\n headers?: HttpHeaders\n }\n>\n\nexport const GraphqlQuerySchema = 'network.xyo.graphql.query'\nexport type GraphqlQuerySchema = typeof GraphqlQuerySchema\n\nexport type GraphqlQuery = Payload<\n {\n query: string\n variables: Record<string, unknown>\n },\n GraphqlQuerySchema\n>\n\nexport const GraphqlResultSchema = 'network.xyo.graphql.result'\nexport type GraphqlResultSchema = typeof GraphqlResultSchema\n\nexport type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<\n {\n http?: {\n code?: string\n ipAddress?: string\n status?: number\n }\n result?: ExecutionResult<TData, TExtensions>\n },\n GraphqlResultSchema\n>\n\nexport const isGraphqlQuery = isPayloadOfSchemaType<GraphqlQuery>(GraphqlQuerySchema)\n\nexport class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<\n TParams,\n GraphqlQuery,\n GraphqlResult\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiGraphqlWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiGraphqlWitnessConfigSchema\n\n get endpoint() {\n return assertEx(this.config.endpoint ?? this.params.endpoint, () => 'No endpoint specified')\n }\n\n get headers() {\n return this.params.headers\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n protected override async observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]> {\n await this.started('throw')\n const queries = payloads?.filter(isGraphqlQuery) ?? []\n const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout })\n const observations = await Promise.all(\n queries.map(async ({ query, variables }) => {\n const httpResult = await axios.post(this.endpoint, { query, variables })\n const result: GraphqlResult = {\n http: {\n status: httpResult.status,\n },\n result: httpResult.data,\n schema: GraphqlResultSchema,\n }\n return result\n }),\n )\n return observations.flat()\n }\n}\n"],"mappings":";AAAA,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACD9C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEhC,SAAS,6BAA8C;AAIhD,IAAM,gCAAgC;AAuBtC,IAAM,qBAAqB;AAW3B,IAAM,sBAAsB;AAe5B,IAAM,iBAAiB,sBAAoC,kBAAkB;AAE7E,IAAM,oBAAN,cAAmG,gBAIxG;AAAA,EACA,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,6BAA6B;AAAA,EACzG,OAAyB,sBAA8B;AAAA,EAEvD,IAAI,WAAW;AACb,WAAO,SAAS,KAAK,OAAO,YAAY,KAAK,OAAO,UAAU,MAAM,uBAAuB;AAAA,EAC7F;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,MAAyB,eAAe,UAAqD;AAC3F,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,UAAU,UAAU,OAAO,cAAc,KAAK,CAAC;AACrD,UAAM,QAAQ,IAAI,UAAU,EAAE,SAAS,KAAK,SAAS,SAAS,KAAK,QAAQ,CAAC;AAC5E,UAAM,eAAe,MAAM,QAAQ;AAAA,MACjC,QAAQ,IAAI,OAAO,EAAE,OAAO,UAAU,MAAM;AAC1C,cAAM,aAAa,MAAM,MAAM,KAAK,KAAK,UAAU,EAAE,OAAO,UAAU,CAAC;AACvE,cAAM,SAAwB;AAAA,UAC5B,MAAM;AAAA,YACJ,QAAQ,WAAW;AAAA,UACrB;AAAA,UACA,QAAQ,WAAW;AAAA,UACnB,QAAQ;AAAA,QACV;AACA,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AACA,WAAO,aAAa,KAAK;AAAA,EAC3B;AACF;;;AD7FO,IAAM,0BAA0B,MACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,kBAAkB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAClE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,kBAAkB,OAAO,MAAM;AAAA,IAC9C;AAAA,EACF;AACF;","names":[]}
@@ -1,3 +1,81 @@
1
- export { ApiGraphqlWitnessPlugin, ApiGraphqlWitnessPlugin as default } from './Plugin.ts';
2
- export * from './Witness.ts';
3
- //# sourceMappingURL=index.d.ts.map
1
+ import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
2
+ import * as _xyo_network_payload_model from '@xyo-network/payload-model';
3
+ import { Payload, Schema } from '@xyo-network/payload-model';
4
+ import { AbstractWitness } from '@xyo-network/abstract-witness';
5
+ import * as _xyo_network_module_model from '@xyo-network/module-model';
6
+ import { AnyConfigSchema } from '@xyo-network/module-model';
7
+ import { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
8
+ import { ExecutionResult } from 'graphql';
9
+ import * as _store__xyo_network_account_model_virtual_3afa553815_package from '.store/@xyo-network-account-model-virtual-3afa553815/package';
10
+ import * as _store__xylabs_object_npm_4_0_0_ffd6151301_package from '.store/@xylabs-object-npm-4.0.0-ffd6151301/package';
11
+
12
+ declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
13
+ type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
14
+ type ApiGraphqlWitnessConfig = WitnessConfig<{
15
+ endpoint?: string;
16
+ schema: ApiGraphqlWitnessConfigSchema;
17
+ timeout?: number;
18
+ }>;
19
+ type HttpHeaderValue = string | string[] | number | boolean | null;
20
+ interface HttpHeaders {
21
+ [key: string]: HttpHeaderValue;
22
+ }
23
+ type ApiGraphqlWitnessParams = WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>, {
24
+ endpoint?: string;
25
+ headers?: HttpHeaders;
26
+ }>;
27
+ declare const GraphqlQuerySchema = "network.xyo.graphql.query";
28
+ type GraphqlQuerySchema = typeof GraphqlQuerySchema;
29
+ type GraphqlQuery = Payload<{
30
+ query: string;
31
+ variables: Record<string, unknown>;
32
+ }, GraphqlQuerySchema>;
33
+ declare const GraphqlResultSchema = "network.xyo.graphql.result";
34
+ type GraphqlResultSchema = typeof GraphqlResultSchema;
35
+ type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
36
+ http?: {
37
+ code?: string;
38
+ ipAddress?: string;
39
+ status?: number;
40
+ };
41
+ result?: ExecutionResult<TData, TExtensions>;
42
+ }, GraphqlResultSchema>;
43
+ declare const isGraphqlQuery: (x?: unknown | null) => x is _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
44
+ query: string;
45
+ variables: Record<string, unknown>;
46
+ } & {
47
+ schema: "network.xyo.graphql.query";
48
+ };
49
+ declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
50
+ static readonly configSchemas: Schema[];
51
+ static readonly defaultConfigSchema: Schema;
52
+ get endpoint(): string;
53
+ get headers(): HttpHeaders | undefined;
54
+ get timeout(): number | undefined;
55
+ protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
56
+ }
57
+
58
+ declare const ApiGraphqlWitnessPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<ApiGraphqlWitness<_store__xylabs_object_npm_4_0_0_ffd6151301_package.BaseParamsFields & {
59
+ account?: _store__xyo_network_account_model_virtual_3afa553815_package.AccountInstance | "random";
60
+ addToResolvers?: boolean;
61
+ additionalSigners?: _store__xyo_network_account_model_virtual_3afa553815_package.AccountInstance[];
62
+ allowNameResolution?: boolean;
63
+ config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & {
64
+ schema: "network.xyo.api.witness.config";
65
+ } & {
66
+ endpoint?: string;
67
+ schema: ApiGraphqlWitnessConfigSchema;
68
+ timeout?: number;
69
+ }, "schema"> & {
70
+ schema: "network.xyo.api.witness.config";
71
+ }, "schema"> & {
72
+ schema: string;
73
+ };
74
+ ephemeralQueryAccountEnabled?: boolean;
75
+ moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
76
+ } & {
77
+ endpoint?: string;
78
+ headers?: HttpHeaders;
79
+ }>>;
80
+
81
+ export { ApiGraphqlWitness, type ApiGraphqlWitnessConfig, ApiGraphqlWitnessConfigSchema, type ApiGraphqlWitnessParams, ApiGraphqlWitnessPlugin, type GraphqlQuery, GraphqlQuerySchema, type GraphqlResult, GraphqlResultSchema, type HttpHeaderValue, type HttpHeaders, ApiGraphqlWitnessPlugin as default, isGraphqlQuery };
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/Plugin.ts
5
2
  import { PayloadSetSchema } from "@xyo-network/payload-model";
6
3
  import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
@@ -15,13 +12,7 @@ var GraphqlQuerySchema = "network.xyo.graphql.query";
15
12
  var GraphqlResultSchema = "network.xyo.graphql.result";
16
13
  var isGraphqlQuery = isPayloadOfSchemaType(GraphqlQuerySchema);
17
14
  var ApiGraphqlWitness = class extends AbstractWitness {
18
- static {
19
- __name(this, "ApiGraphqlWitness");
20
- }
21
- static configSchemas = [
22
- ...super.configSchemas,
23
- ApiGraphqlWitnessConfigSchema
24
- ];
15
+ static configSchemas = [...super.configSchemas, ApiGraphqlWitnessConfigSchema];
25
16
  static defaultConfigSchema = ApiGraphqlWitnessConfigSchema;
26
17
  get endpoint() {
27
18
  return assertEx(this.config.endpoint ?? this.params.endpoint, () => "No endpoint specified");
@@ -35,39 +26,33 @@ var ApiGraphqlWitness = class extends AbstractWitness {
35
26
  async observeHandler(payloads) {
36
27
  await this.started("throw");
37
28
  const queries = payloads?.filter(isGraphqlQuery) ?? [];
38
- const axios = new AxiosJson({
39
- headers: this.headers,
40
- timeout: this.timeout
41
- });
42
- const observations = await Promise.all(queries.map(async ({ query, variables }) => {
43
- const httpResult = await axios.post(this.endpoint, {
44
- query,
45
- variables
46
- });
47
- const result = {
48
- http: {
49
- status: httpResult.status
50
- },
51
- result: httpResult.data,
52
- schema: GraphqlResultSchema
53
- };
54
- return result;
55
- }));
29
+ const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout });
30
+ const observations = await Promise.all(
31
+ queries.map(async ({ query, variables }) => {
32
+ const httpResult = await axios.post(this.endpoint, { query, variables });
33
+ const result = {
34
+ http: {
35
+ status: httpResult.status
36
+ },
37
+ result: httpResult.data,
38
+ schema: GraphqlResultSchema
39
+ };
40
+ return result;
41
+ })
42
+ );
56
43
  return observations.flat();
57
44
  }
58
45
  };
59
46
 
60
47
  // src/Plugin.ts
61
- var ApiGraphqlWitnessPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
62
- required: {
63
- [GraphqlQuerySchema]: 1
64
- },
65
- schema: PayloadSetSchema
66
- }, {
67
- witness: /* @__PURE__ */ __name(async (params) => {
68
- return await ApiGraphqlWitness.create(params);
69
- }, "witness")
70
- }), "ApiGraphqlWitnessPlugin");
48
+ var ApiGraphqlWitnessPlugin = () => createPayloadSetWitnessPlugin(
49
+ { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },
50
+ {
51
+ witness: async (params) => {
52
+ return await ApiGraphqlWitness.create(params);
53
+ }
54
+ }
55
+ );
71
56
  export {
72
57
  ApiGraphqlWitness,
73
58
  ApiGraphqlWitnessConfigSchema,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { ApiGraphqlWitness, GraphqlQuerySchema } from './Witness.ts'\n\nexport const ApiGraphqlWitnessPlugin = () =>\n createPayloadSetWitnessPlugin<ApiGraphqlWitness>(\n { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await ApiGraphqlWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport type { ExecutionResult } from 'graphql'\n\nexport const ApiGraphqlWitnessConfigSchema = 'network.xyo.api.witness.config'\nexport type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema\n\nexport type ApiGraphqlWitnessConfig = WitnessConfig<{\n endpoint?: string\n schema: ApiGraphqlWitnessConfigSchema\n timeout?: number\n}>\n\nexport type HttpHeaderValue = string | string[] | number | boolean | null\n\nexport interface HttpHeaders {\n [key: string]: HttpHeaderValue\n}\n\nexport type ApiGraphqlWitnessParams = WitnessParams<\n AnyConfigSchema<ApiGraphqlWitnessConfig>,\n {\n endpoint?: string\n headers?: HttpHeaders\n }\n>\n\nexport const GraphqlQuerySchema = 'network.xyo.graphql.query'\nexport type GraphqlQuerySchema = typeof GraphqlQuerySchema\n\nexport type GraphqlQuery = Payload<\n {\n query: string\n variables: Record<string, unknown>\n },\n GraphqlQuerySchema\n>\n\nexport const GraphqlResultSchema = 'network.xyo.graphql.result'\nexport type GraphqlResultSchema = typeof GraphqlResultSchema\n\nexport type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<\n {\n http?: {\n code?: string\n ipAddress?: string\n status?: number\n }\n result?: ExecutionResult<TData, TExtensions>\n },\n GraphqlResultSchema\n>\n\nexport const isGraphqlQuery = isPayloadOfSchemaType<GraphqlQuery>(GraphqlQuerySchema)\n\nexport class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<\n TParams,\n GraphqlQuery,\n GraphqlResult\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiGraphqlWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiGraphqlWitnessConfigSchema\n\n get endpoint() {\n return assertEx(this.config.endpoint ?? this.params.endpoint, () => 'No endpoint specified')\n }\n\n get headers() {\n return this.params.headers\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n protected override async observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]> {\n await this.started('throw')\n const queries = payloads?.filter(isGraphqlQuery) ?? []\n const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout })\n const observations = await Promise.all(\n queries.map(async ({ query, variables }) => {\n const httpResult = await axios.post(this.endpoint, { query, variables })\n const result: GraphqlResult = {\n http: {\n status: httpResult.status,\n },\n result: httpResult.data,\n schema: GraphqlResultSchema,\n }\n return result\n }),\n )\n return observations.flat()\n }\n}\n"],"mappings":";;;;AAAA,SAASA,wBAAwB;AACjC,SAASC,qCAAqC;;;ACD9C,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAEhC,SAAS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chema","createPayloadSetWitnessPlugin","assertEx","AxiosJson","AbstractWitness","isPayloadOfSchemaType","ApiGraphqlWitnessConfigSchema","GraphqlQuerySchema","GraphqlResultSchema","isGraphqlQuery","isPayloadOfSchemaType","ApiGraphqlWitness","AbstractWitness","configSchemas","defaultConfigSchema","endpoint","assertEx","config","params","headers","timeout","observeHandler","payloads","started","queries","filter","axios","AxiosJson","observations","Promise","all","map","query","variables","httpResult","post","result","http","status","data","schema","flat","ApiGraphqlWitnessPlugin","createPayloadSetWitnessPlugin","required","GraphqlQuerySchema","schema","PayloadSetSchema","witness","params","ApiGraphqlWitness","create"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { ApiGraphqlWitness, GraphqlQuerySchema } from './Witness.ts'\n\nexport const ApiGraphqlWitnessPlugin = () =>\n createPayloadSetWitnessPlugin<ApiGraphqlWitness>(\n { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await ApiGraphqlWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport type { ExecutionResult } from 'graphql'\n\nexport const ApiGraphqlWitnessConfigSchema = 'network.xyo.api.witness.config'\nexport type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema\n\nexport type ApiGraphqlWitnessConfig = WitnessConfig<{\n endpoint?: string\n schema: ApiGraphqlWitnessConfigSchema\n timeout?: number\n}>\n\nexport type HttpHeaderValue = string | string[] | number | boolean | null\n\nexport interface HttpHeaders {\n [key: string]: HttpHeaderValue\n}\n\nexport type ApiGraphqlWitnessParams = WitnessParams<\n AnyConfigSchema<ApiGraphqlWitnessConfig>,\n {\n endpoint?: string\n headers?: HttpHeaders\n }\n>\n\nexport const GraphqlQuerySchema = 'network.xyo.graphql.query'\nexport type GraphqlQuerySchema = typeof GraphqlQuerySchema\n\nexport type GraphqlQuery = Payload<\n {\n query: string\n variables: Record<string, unknown>\n },\n GraphqlQuerySchema\n>\n\nexport const GraphqlResultSchema = 'network.xyo.graphql.result'\nexport type GraphqlResultSchema = typeof GraphqlResultSchema\n\nexport type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<\n {\n http?: {\n code?: string\n ipAddress?: string\n status?: number\n }\n result?: ExecutionResult<TData, TExtensions>\n },\n GraphqlResultSchema\n>\n\nexport const isGraphqlQuery = isPayloadOfSchemaType<GraphqlQuery>(GraphqlQuerySchema)\n\nexport class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<\n TParams,\n GraphqlQuery,\n GraphqlResult\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiGraphqlWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiGraphqlWitnessConfigSchema\n\n get endpoint() {\n return assertEx(this.config.endpoint ?? this.params.endpoint, () => 'No endpoint specified')\n }\n\n get headers() {\n return this.params.headers\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n protected override async observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]> {\n await this.started('throw')\n const queries = payloads?.filter(isGraphqlQuery) ?? []\n const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout })\n const observations = await Promise.all(\n queries.map(async ({ query, variables }) => {\n const httpResult = await axios.post(this.endpoint, { query, variables })\n const result: GraphqlResult = {\n http: {\n status: httpResult.status,\n },\n result: httpResult.data,\n schema: GraphqlResultSchema,\n }\n return result\n }),\n )\n return observations.flat()\n }\n}\n"],"mappings":";AAAA,SAA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AQ,iBAAiB;AAAA,EAClE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,kBAAkB,OAAO,MAAM;AAAA,IAC9C;AAAA,EACF;AACF;","names":[]}
@@ -1,3 +1,81 @@
1
- export { ApiGraphqlWitnessPlugin, ApiGraphqlWitnessPlugin as default } from './Plugin.ts';
2
- export * from './Witness.ts';
3
- //# sourceMappingURL=index.d.ts.map
1
+ import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
2
+ import * as _xyo_network_payload_model from '@xyo-network/payload-model';
3
+ import { Payload, Schema } from '@xyo-network/payload-model';
4
+ import { AbstractWitness } from '@xyo-network/abstract-witness';
5
+ import * as _xyo_network_module_model from '@xyo-network/module-model';
6
+ import { AnyConfigSchema } from '@xyo-network/module-model';
7
+ import { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
8
+ import { ExecutionResult } from 'graphql';
9
+ import * as _store__xyo_network_account_model_virtual_3afa553815_package from '.store/@xyo-network-account-model-virtual-3afa553815/package';
10
+ import * as _store__xylabs_object_npm_4_0_0_ffd6151301_package from '.store/@xylabs-object-npm-4.0.0-ffd6151301/package';
11
+
12
+ declare const ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
13
+ type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema;
14
+ type ApiGraphqlWitnessConfig = WitnessConfig<{
15
+ endpoint?: string;
16
+ schema: ApiGraphqlWitnessConfigSchema;
17
+ timeout?: number;
18
+ }>;
19
+ type HttpHeaderValue = string | string[] | number | boolean | null;
20
+ interface HttpHeaders {
21
+ [key: string]: HttpHeaderValue;
22
+ }
23
+ type ApiGraphqlWitnessParams = WitnessParams<AnyConfigSchema<ApiGraphqlWitnessConfig>, {
24
+ endpoint?: string;
25
+ headers?: HttpHeaders;
26
+ }>;
27
+ declare const GraphqlQuerySchema = "network.xyo.graphql.query";
28
+ type GraphqlQuerySchema = typeof GraphqlQuerySchema;
29
+ type GraphqlQuery = Payload<{
30
+ query: string;
31
+ variables: Record<string, unknown>;
32
+ }, GraphqlQuerySchema>;
33
+ declare const GraphqlResultSchema = "network.xyo.graphql.result";
34
+ type GraphqlResultSchema = typeof GraphqlResultSchema;
35
+ type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<{
36
+ http?: {
37
+ code?: string;
38
+ ipAddress?: string;
39
+ status?: number;
40
+ };
41
+ result?: ExecutionResult<TData, TExtensions>;
42
+ }, GraphqlResultSchema>;
43
+ declare const isGraphqlQuery: (x?: unknown | null) => x is _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & {
44
+ query: string;
45
+ variables: Record<string, unknown>;
46
+ } & {
47
+ schema: "network.xyo.graphql.query";
48
+ };
49
+ declare class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<TParams, GraphqlQuery, GraphqlResult> {
50
+ static readonly configSchemas: Schema[];
51
+ static readonly defaultConfigSchema: Schema;
52
+ get endpoint(): string;
53
+ get headers(): HttpHeaders | undefined;
54
+ get timeout(): number | undefined;
55
+ protected observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]>;
56
+ }
57
+
58
+ declare const ApiGraphqlWitnessPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<ApiGraphqlWitness<_store__xylabs_object_npm_4_0_0_ffd6151301_package.BaseParamsFields & {
59
+ account?: _store__xyo_network_account_model_virtual_3afa553815_package.AccountInstance | "random";
60
+ addToResolvers?: boolean;
61
+ additionalSigners?: _store__xyo_network_account_model_virtual_3afa553815_package.AccountInstance[];
62
+ allowNameResolution?: boolean;
63
+ config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & {
64
+ schema: "network.xyo.api.witness.config";
65
+ } & {
66
+ endpoint?: string;
67
+ schema: ApiGraphqlWitnessConfigSchema;
68
+ timeout?: number;
69
+ }, "schema"> & {
70
+ schema: "network.xyo.api.witness.config";
71
+ }, "schema"> & {
72
+ schema: string;
73
+ };
74
+ ephemeralQueryAccountEnabled?: boolean;
75
+ moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
76
+ } & {
77
+ endpoint?: string;
78
+ headers?: HttpHeaders;
79
+ }>>;
80
+
81
+ export { ApiGraphqlWitness, type ApiGraphqlWitnessConfig, ApiGraphqlWitnessConfigSchema, type ApiGraphqlWitnessParams, ApiGraphqlWitnessPlugin, type GraphqlQuery, GraphqlQuerySchema, type GraphqlResult, GraphqlResultSchema, type HttpHeaderValue, type HttpHeaders, ApiGraphqlWitnessPlugin as default, isGraphqlQuery };
@@ -1,11 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __reflectGet = Reflect.get;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
8
-
9
1
  // src/Plugin.ts
10
2
  import { PayloadSetSchema } from "@xyo-network/payload-model";
11
3
  import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
@@ -19,7 +11,9 @@ var ApiGraphqlWitnessConfigSchema = "network.xyo.api.witness.config";
19
11
  var GraphqlQuerySchema = "network.xyo.graphql.query";
20
12
  var GraphqlResultSchema = "network.xyo.graphql.result";
21
13
  var isGraphqlQuery = isPayloadOfSchemaType(GraphqlQuerySchema);
22
- var _ApiGraphqlWitness = class _ApiGraphqlWitness extends AbstractWitness {
14
+ var ApiGraphqlWitness = class extends AbstractWitness {
15
+ static configSchemas = [...super.configSchemas, ApiGraphqlWitnessConfigSchema];
16
+ static defaultConfigSchema = ApiGraphqlWitnessConfigSchema;
23
17
  get endpoint() {
24
18
  return assertEx(this.config.endpoint ?? this.params.endpoint, () => "No endpoint specified");
25
19
  }
@@ -31,47 +25,34 @@ var _ApiGraphqlWitness = class _ApiGraphqlWitness extends AbstractWitness {
31
25
  }
32
26
  async observeHandler(payloads) {
33
27
  await this.started("throw");
34
- const queries = (payloads == null ? void 0 : payloads.filter(isGraphqlQuery)) ?? [];
35
- const axios = new AxiosJson({
36
- headers: this.headers,
37
- timeout: this.timeout
38
- });
39
- const observations = await Promise.all(queries.map(async ({ query, variables }) => {
40
- const httpResult = await axios.post(this.endpoint, {
41
- query,
42
- variables
43
- });
44
- const result = {
45
- http: {
46
- status: httpResult.status
47
- },
48
- result: httpResult.data,
49
- schema: GraphqlResultSchema
50
- };
51
- return result;
52
- }));
28
+ const queries = payloads?.filter(isGraphqlQuery) ?? [];
29
+ const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout });
30
+ const observations = await Promise.all(
31
+ queries.map(async ({ query, variables }) => {
32
+ const httpResult = await axios.post(this.endpoint, { query, variables });
33
+ const result = {
34
+ http: {
35
+ status: httpResult.status
36
+ },
37
+ result: httpResult.data,
38
+ schema: GraphqlResultSchema
39
+ };
40
+ return result;
41
+ })
42
+ );
53
43
  return observations.flat();
54
44
  }
55
45
  };
56
- __name(_ApiGraphqlWitness, "ApiGraphqlWitness");
57
- __publicField(_ApiGraphqlWitness, "configSchemas", [
58
- ...__superGet(_ApiGraphqlWitness, _ApiGraphqlWitness, "configSchemas"),
59
- ApiGraphqlWitnessConfigSchema
60
- ]);
61
- __publicField(_ApiGraphqlWitness, "defaultConfigSchema", ApiGraphqlWitnessConfigSchema);
62
- var ApiGraphqlWitness = _ApiGraphqlWitness;
63
46
 
64
47
  // src/Plugin.ts
65
- var ApiGraphqlWitnessPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
66
- required: {
67
- [GraphqlQuerySchema]: 1
68
- },
69
- schema: PayloadSetSchema
70
- }, {
71
- witness: /* @__PURE__ */ __name(async (params) => {
72
- return await ApiGraphqlWitness.create(params);
73
- }, "witness")
74
- }), "ApiGraphqlWitnessPlugin");
48
+ var ApiGraphqlWitnessPlugin = () => createPayloadSetWitnessPlugin(
49
+ { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },
50
+ {
51
+ witness: async (params) => {
52
+ return await ApiGraphqlWitness.create(params);
53
+ }
54
+ }
55
+ );
75
56
  export {
76
57
  ApiGraphqlWitness,
77
58
  ApiGraphqlWitnessConfigSchema,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { ApiGraphqlWitness, GraphqlQuerySchema } from './Witness.ts'\n\nexport const ApiGraphqlWitnessPlugin = () =>\n createPayloadSetWitnessPlugin<ApiGraphqlWitness>(\n { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await ApiGraphqlWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport type { ExecutionResult } from 'graphql'\n\nexport const ApiGraphqlWitnessConfigSchema = 'network.xyo.api.witness.config'\nexport type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema\n\nexport type ApiGraphqlWitnessConfig = WitnessConfig<{\n endpoint?: string\n schema: ApiGraphqlWitnessConfigSchema\n timeout?: number\n}>\n\nexport type HttpHeaderValue = string | string[] | number | boolean | null\n\nexport interface HttpHeaders {\n [key: string]: HttpHeaderValue\n}\n\nexport type ApiGraphqlWitnessParams = WitnessParams<\n AnyConfigSchema<ApiGraphqlWitnessConfig>,\n {\n endpoint?: string\n headers?: HttpHeaders\n }\n>\n\nexport const GraphqlQuerySchema = 'network.xyo.graphql.query'\nexport type GraphqlQuerySchema = typeof GraphqlQuerySchema\n\nexport type GraphqlQuery = Payload<\n {\n query: string\n variables: Record<string, unknown>\n },\n GraphqlQuerySchema\n>\n\nexport const GraphqlResultSchema = 'network.xyo.graphql.result'\nexport type GraphqlResultSchema = typeof GraphqlResultSchema\n\nexport type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<\n {\n http?: {\n code?: string\n ipAddress?: string\n status?: number\n }\n result?: ExecutionResult<TData, TExtensions>\n },\n GraphqlResultSchema\n>\n\nexport const isGraphqlQuery = isPayloadOfSchemaType<GraphqlQuery>(GraphqlQuerySchema)\n\nexport class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<\n TParams,\n GraphqlQuery,\n GraphqlResult\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiGraphqlWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiGraphqlWitnessConfigSchema\n\n get endpoint() {\n return assertEx(this.config.endpoint ?? this.params.endpoint, () => 'No endpoint specified')\n }\n\n get headers() {\n return this.params.headers\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n protected override async observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]> {\n await this.started('throw')\n const queries = payloads?.filter(isGraphqlQuery) ?? []\n const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout })\n const observations = await Promise.all(\n queries.map(async ({ query, variables }) => {\n const httpResult = await axios.post(this.endpoint, { query, variables })\n const result: GraphqlResult = {\n http: {\n status: httpResult.status,\n },\n result: httpResult.data,\n sch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IAAM+B,0BAA0B,6BACrCC,8BACE;EAAEC,UAAU;IAAE,CAACC,kBAAAA,GAAqB;EAAE;EAAGC,QAAQC;AAAiB,GAClE;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAO,MAAMC,kBAAkBC,OAAOF,MAAAA;EACxC,GAFS;AAGX,CAAA,GAPmC;","names":["PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AxiosJson","AbstractWitness","isPayloadOfSchemaType","ApiGraphqlWitnessConfigSchema","GraphqlQuerySchema","GraphqlResultSchema","isGraphqlQuery","isPayloadOfSchemaType","ApiGraphqlWitness","AbstractWitness","endpoint","assertEx","config","params","headers","timeout","observeHandler","payloads","started","queries","filter","axios","AxiosJson","observations","Promise","all","map","query","variables","httpResult","post","result","http","status","data","schema","flat","configSchemas","defaultConfigSchema","ApiGraphqlWitnessPlugin","createPayloadSetWitnessPlugin","required","GraphqlQuerySchema","schema","PayloadSetSchema","witness","params","ApiGraphqlWitness","create"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { ApiGraphqlWitness, GraphqlQuerySchema } from './Witness.ts'\n\nexport const ApiGraphqlWitnessPlugin = () =>\n createPayloadSetWitnessPlugin<ApiGraphqlWitness>(\n { required: { [GraphqlQuerySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await ApiGraphqlWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport type { ExecutionResult } from 'graphql'\n\nexport const ApiGraphqlWitnessConfigSchema = 'network.xyo.api.witness.config'\nexport type ApiGraphqlWitnessConfigSchema = typeof ApiGraphqlWitnessConfigSchema\n\nexport type ApiGraphqlWitnessConfig = WitnessConfig<{\n endpoint?: string\n schema: ApiGraphqlWitnessConfigSchema\n timeout?: number\n}>\n\nexport type HttpHeaderValue = string | string[] | number | boolean | null\n\nexport interface HttpHeaders {\n [key: string]: HttpHeaderValue\n}\n\nexport type ApiGraphqlWitnessParams = WitnessParams<\n AnyConfigSchema<ApiGraphqlWitnessConfig>,\n {\n endpoint?: string\n headers?: HttpHeaders\n }\n>\n\nexport const GraphqlQuerySchema = 'network.xyo.graphql.query'\nexport type GraphqlQuerySchema = typeof GraphqlQuerySchema\n\nexport type GraphqlQuery = Payload<\n {\n query: string\n variables: Record<string, unknown>\n },\n GraphqlQuerySchema\n>\n\nexport const GraphqlResultSchema = 'network.xyo.graphql.result'\nexport type GraphqlResultSchema = typeof GraphqlResultSchema\n\nexport type GraphqlResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> = Payload<\n {\n http?: {\n code?: string\n ipAddress?: string\n status?: number\n }\n result?: ExecutionResult<TData, TExtensions>\n },\n GraphqlResultSchema\n>\n\nexport const isGraphqlQuery = isPayloadOfSchemaType<GraphqlQuery>(GraphqlQuerySchema)\n\nexport class ApiGraphqlWitness<TParams extends ApiGraphqlWitnessParams = ApiGraphqlWitnessParams> extends AbstractWitness<\n TParams,\n GraphqlQuery,\n GraphqlResult\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiGraphqlWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiGraphqlWitnessConfigSchema\n\n get endpoint() {\n return assertEx(this.config.endpoint ?? this.params.endpoint, () => 'No endpoint specified')\n }\n\n get headers() {\n return this.params.headers\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n protected override async observeHandler(payloads?: GraphqlQuery[]): Promise<GraphqlResult[]> {\n await this.started('throw')\n const queries = payloads?.filter(isGraphqlQuery) ?? []\n const axios = new AxiosJson({ headers: this.headers, timeout: this.timeout })\n const observations = await Promise.all(\n queries.map(async ({ query, variables }) => {\n const httpResult = await axios.post(this.endpoint, { query, variables })\n const result: GraphqlResult = {\n http: {\n status: httpResult.status,\n },\n result: httpResult.data,\n schema: GraphqlResultSchema,\n }\n return result\n }),\n )\n return observations.flat()\n }\n}\n"],"mappings":";AAAA,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACD9C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAEhC,SAAS,6BAA8C;AAIhD,IAAM,gCAAgC;AAuBtC,IAAM,qBAAqB;AAW3B,IAAM,sBAAsB;AAe5B,IAAM,iBAAiB,sBAAoC,kBAAkB;AAE7E,IAAM,oBAAN,cAAmG,gBAIxG;AAAA,EACA,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,6BAA6B;AAAA,EACzG,OAAyB,sBAA8B;AAAA,EAEvD,IAAI,WAAW;AACb,WAAO,SAAS,KAAK,OAAO,YAAY,KAAK,OAAO,UAAU,MAAM,uBAAuB;AAAA,EAC7F;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,MAAyB,eAAe,UAAqD;AAC3F,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,UAAU,UAAU,OAAO,cAAc,KAAK,CAAC;AACrD,UAAM,QAAQ,IAAI,UAAU,EAAE,SAAS,KAAK,SAAS,SAAS,KAAK,QAAQ,CAAC;AAC5E,UAAM,eAAe,MAAM,QAAQ;AAAA,MACjC,QAAQ,IAAI,OAAO,EAAE,OAAO,UAAU,MAAM;AAC1C,cAAM,aAAa,MAAM,MAAM,KAAK,KAAK,UAAU,EAAE,OAAO,UAAU,CAAC;AACvE,cAAM,SAAwB;AAAA,UAC5B,MAAM;AAAA,YACJ,QAAQ,WAAW;AAAA,UACrB;AAAA,U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