@graphql-mesh/grpc 1.0.0-alpha-20220804093904-8e2e41f7f → 1.0.0-alpha-20230420220344-25b6b92bf

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/package.json CHANGED
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "name": "@graphql-mesh/grpc",
3
- "version": "1.0.0-alpha-20220804093904-8e2e41f7f",
3
+ "version": "1.0.0-alpha-20230420220344-25b6b92bf",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@graphql-mesh/types": "0.79.0-alpha-20220804093904-8e2e41f7f",
7
- "@graphql-mesh/utils": "1.0.0-alpha-20220804093904-8e2e41f7f",
8
- "graphql": "*"
6
+ "@graphql-mesh/cross-helpers": "^0.3.4",
7
+ "@graphql-mesh/store": "1.0.0-alpha-20230420220344-25b6b92bf",
8
+ "@graphql-mesh/types": "1.0.0-alpha-20230420220344-25b6b92bf",
9
+ "@graphql-mesh/utils": "1.0.0-alpha-20230420220344-25b6b92bf",
10
+ "graphql": "*",
11
+ "tslib": "^2.4.0"
9
12
  },
10
13
  "dependencies": {
11
14
  "@ardatan/grpc-reflection-js": "0.0.2",
12
- "@graphql-mesh/cross-helpers": "0.2.0",
13
- "@graphql-mesh/store": "1.0.0-alpha-20220804093904-8e2e41f7f",
14
- "@graphql-mesh/string-interpolation": "0.3.0",
15
+ "@graphql-mesh/string-interpolation": "0.4.4",
15
16
  "@grpc/grpc-js": "^1.1.7",
16
- "@grpc/proto-loader": "0.7.0",
17
+ "@grpc/proto-loader": "0.7.6",
17
18
  "globby": "11.1.0",
18
- "graphql-compose": "9.0.8",
19
- "graphql-scalars": "1.17.0",
19
+ "graphql-compose": "9.0.10",
20
+ "graphql-scalars": "^1.20.4",
20
21
  "lodash.get": "4.4.2",
21
22
  "lodash.has": "4.5.2",
22
23
  "long": "4.0.0",
23
- "protobufjs": "7.0.0",
24
- "tslib": "^2.4.0"
24
+ "protobufjs": "7.2.3"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
@@ -29,21 +29,28 @@
29
29
  "directory": "packages/handlers/grpc"
30
30
  },
31
31
  "license": "MIT",
32
- "main": "index.js",
33
- "module": "index.mjs",
34
- "typings": "index.d.ts",
32
+ "main": "cjs/index.js",
33
+ "module": "esm/index.js",
34
+ "typings": "typings/index.d.ts",
35
35
  "typescript": {
36
- "definition": "index.d.ts"
36
+ "definition": "typings/index.d.ts"
37
37
  },
38
+ "type": "module",
38
39
  "exports": {
39
40
  ".": {
40
- "require": "./index.js",
41
- "import": "./index.mjs"
42
- },
43
- "./*": {
44
- "require": "./*.js",
45
- "import": "./*.mjs"
41
+ "require": {
42
+ "types": "./typings/index.d.cts",
43
+ "default": "./cjs/index.js"
44
+ },
45
+ "import": {
46
+ "types": "./typings/index.d.ts",
47
+ "default": "./esm/index.js"
48
+ },
49
+ "default": {
50
+ "types": "./typings/index.d.ts",
51
+ "default": "./esm/index.js"
52
+ }
46
53
  },
47
54
  "./package.json": "./package.json"
48
55
  }
49
- }
56
+ }
@@ -0,0 +1,37 @@
1
+ import { AnyNestedObject } from 'protobufjs';
2
+ import protobufjs from 'protobufjs';
3
+ import { Logger, MeshHandler, MeshHandlerOptions, YamlConfig } from '@graphql-mesh/types';
4
+ import { ChannelCredentials, loadPackageDefinition } from '@grpc/grpc-js';
5
+ import './patchLongJs.cjs';
6
+ type RootJsonEntry = {
7
+ name: string;
8
+ rootJson: protobufjs.INamespace;
9
+ };
10
+ export default class GrpcHandler implements MeshHandler {
11
+ private config;
12
+ private baseDir;
13
+ private rootJsonEntries;
14
+ private logger;
15
+ private pubsub;
16
+ constructor({ config, baseDir, store, logger, pubsub, }: MeshHandlerOptions<YamlConfig.GrpcHandler>);
17
+ processReflection(creds: ChannelCredentials): Promise<Promise<protobufjs.Root>[]>;
18
+ processDescriptorFile(): Promise<protobufjs.Root>;
19
+ processProtoFile(): Promise<protobufjs.Root>;
20
+ getCachedDescriptorSets(creds: ChannelCredentials): Promise<RootJsonEntry[]>;
21
+ getCredentials(): Promise<ChannelCredentials>;
22
+ walkToFindTypePath(rootJson: protobufjs.INamespace, pathWithName: string[], baseTypePath: string[]): string[];
23
+ visit({ nested, name, currentPath, rootJson, creds, grpcObject, rootLogger: logger, }: {
24
+ nested: AnyNestedObject;
25
+ name: string;
26
+ currentPath: string[];
27
+ rootJson: protobufjs.INamespace;
28
+ creds: ChannelCredentials;
29
+ grpcObject: ReturnType<typeof loadPackageDefinition>;
30
+ rootLogger: Logger;
31
+ }): void;
32
+ private schemaComposer;
33
+ getMeshSource(): Promise<{
34
+ schema: import("graphql").GraphQLSchema;
35
+ }>;
36
+ }
37
+ export {};
@@ -1,25 +1,23 @@
1
- import './patchLongJs';
2
- import { GetMeshSourceOptions, Logger, MeshHandler, YamlConfig } from '@graphql-mesh/types';
3
- import { ChannelCredentials, loadPackageDefinition } from '@grpc/grpc-js';
4
- import { AnyNestedObject, Message } from 'protobufjs';
1
+ import { AnyNestedObject } from 'protobufjs';
5
2
  import protobufjs from 'protobufjs';
6
- import { IFileDescriptorSet } from 'protobufjs/ext/descriptor';
7
- declare type DecodedDescriptorSet = Message<IFileDescriptorSet> & IFileDescriptorSet;
8
- declare type RootJsonAndDecodedDescriptorSet = {
3
+ import { Logger, MeshHandler, MeshHandlerOptions, YamlConfig } from '@graphql-mesh/types';
4
+ import { ChannelCredentials, loadPackageDefinition } from '@grpc/grpc-js';
5
+ import './patchLongJs.js';
6
+ type RootJsonEntry = {
9
7
  name: string;
10
8
  rootJson: protobufjs.INamespace;
11
- decodedDescriptorSet: DecodedDescriptorSet;
12
9
  };
13
10
  export default class GrpcHandler implements MeshHandler {
14
11
  private config;
15
12
  private baseDir;
16
- private rootJsonAndDecodedDescriptorSets;
13
+ private rootJsonEntries;
17
14
  private logger;
18
- constructor({ config, baseDir, store, logger }: GetMeshSourceOptions<YamlConfig.GrpcHandler>);
19
- getRootPromisesFromReflection(creds: ChannelCredentials): Promise<Promise<protobufjs.Root>[]>;
20
- getRootPromiseFromDescriptorFilePath(): Promise<protobufjs.Root>;
21
- getRootPromiseFromProtoFilePath(): Promise<protobufjs.Root>;
22
- getCachedDescriptorSets(creds: ChannelCredentials): Promise<RootJsonAndDecodedDescriptorSet[]>;
15
+ private pubsub;
16
+ constructor({ config, baseDir, store, logger, pubsub, }: MeshHandlerOptions<YamlConfig.GrpcHandler>);
17
+ processReflection(creds: ChannelCredentials): Promise<Promise<protobufjs.Root>[]>;
18
+ processDescriptorFile(): Promise<protobufjs.Root>;
19
+ processProtoFile(): Promise<protobufjs.Root>;
20
+ getCachedDescriptorSets(creds: ChannelCredentials): Promise<RootJsonEntry[]>;
23
21
  getCredentials(): Promise<ChannelCredentials>;
24
22
  walkToFindTypePath(rootJson: protobufjs.INamespace, pathWithName: string[], baseTypePath: string[]): string[];
25
23
  visit({ nested, name, currentPath, rootJson, creds, grpcObject, rootLogger: logger, }: {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function isScalarType(type: string): boolean;
2
+ export declare function getGraphQLScalar(scalarType: string): string;
@@ -0,0 +1,7 @@
1
+ /// <reference types="node" />
2
+ import { SchemaComposer } from 'graphql-compose';
3
+ import { Root } from 'protobufjs';
4
+ import { ResolverData } from '@graphql-mesh/string-interpolation';
5
+ export declare function getTypeName(schemaComposer: SchemaComposer, pathWithName: string[] | undefined, isInput: boolean): string;
6
+ export declare function addIncludePathResolver(root: Root, includePaths: string[]): void;
7
+ export declare function addMetaDataToCall(callFn: any, input: any, resolverData: ResolverData, metaData: Record<string, string | string[] | Buffer>, isResponseStream?: boolean): Promise<unknown>;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { SchemaComposer } from 'graphql-compose';
3
3
  import { Root } from 'protobufjs';
4
+ import { ResolverData } from '@graphql-mesh/string-interpolation';
4
5
  export declare function getTypeName(schemaComposer: SchemaComposer, pathWithName: string[] | undefined, isInput: boolean): string;
5
6
  export declare function addIncludePathResolver(root: Root, includePaths: string[]): void;
6
- export declare function addMetaDataToCall(callFn: any, input: any, context: Record<string, unknown>, metaData: Record<string, string | string[] | Buffer>, isResponseStream?: boolean): Promise<unknown>;
7
+ export declare function addMetaDataToCall(callFn: any, input: any, resolverData: ResolverData, metaData: Record<string, string | string[] | Buffer>, isResponseStream?: boolean): Promise<unknown>;