@omnigraph/grpc 0.0.1-alpha-20241030140429-9c1473cb596c3f20d6df4a3685ffdaf944f0a091 → 0.1.0-alpha-20241031133458-8ac8d61249cbd2b40359c5069d08bdddd3ad21ab

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/directives.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transportDirective = exports.TransportOptions = exports.GrpcCredentialsSsl = exports.grpcRootJsonDirective = exports.EnumDirective = exports.grpcConnectivityStateDirective = exports.grpcMethodDirective = void 0;
3
+ exports.transportDirective = exports.grpcRootJsonDirective = exports.EnumDirective = exports.grpcConnectivityStateDirective = exports.grpcMethodDirective = void 0;
4
4
  const graphql_1 = require("graphql");
5
5
  const transport_common_1 = require("@graphql-mesh/transport-common");
6
6
  exports.grpcMethodDirective = new graphql_1.GraphQLDirective({
@@ -70,37 +70,6 @@ exports.grpcRootJsonDirective = new graphql_1.GraphQLDirective({
70
70
  },
71
71
  isRepeatable: true,
72
72
  });
73
- exports.GrpcCredentialsSsl = new graphql_1.GraphQLInputObjectType({
74
- name: 'GrpcCredentialsSsl',
75
- fields: {
76
- rootCA: {
77
- type: graphql_1.GraphQLString,
78
- },
79
- certChain: {
80
- type: graphql_1.GraphQLString,
81
- },
82
- privateKey: {
83
- type: graphql_1.GraphQLString,
84
- },
85
- }
86
- });
87
- exports.TransportOptions = new graphql_1.GraphQLInputObjectType({
88
- name: 'TransportOptions',
89
- fields: {
90
- requestTimeout: {
91
- type: graphql_1.GraphQLInt,
92
- },
93
- credentialsSsl: {
94
- type: exports.GrpcCredentialsSsl,
95
- },
96
- useHTTPS: {
97
- type: graphql_1.GraphQLBoolean,
98
- },
99
- metaData: {
100
- type: transport_common_1.ObjMapScalar,
101
- }
102
- }
103
- });
104
73
  exports.transportDirective = new graphql_1.GraphQLDirective({
105
74
  name: 'transport',
106
75
  args: {
@@ -114,8 +83,8 @@ exports.transportDirective = new graphql_1.GraphQLDirective({
114
83
  type: graphql_1.GraphQLString,
115
84
  },
116
85
  options: {
117
- type: exports.TransportOptions,
118
- }
86
+ type: new graphql_1.GraphQLScalarType({ name: 'TransportOptions' }),
87
+ },
119
88
  },
120
89
  isRepeatable: true,
121
90
  locations: [graphql_1.DirectiveLocation.SCHEMA],
package/cjs/utils.js CHANGED
@@ -4,19 +4,18 @@ exports.addIncludePathResolver = addIncludePathResolver;
4
4
  exports.getTypeName = getTypeName;
5
5
  exports.walkToFindTypePath = walkToFindTypePath;
6
6
  const tslib_1 = require("tslib");
7
- const fs_1 = require("fs");
8
- const path_1 = require("path");
9
- const scalars_js_1 = require("./scalars.js");
10
7
  const lodash_has_1 = tslib_1.__importDefault(require("lodash.has"));
8
+ const cross_helpers_1 = require("@graphql-mesh/cross-helpers");
9
+ const scalars_js_1 = require("./scalars.js");
11
10
  function addIncludePathResolver(root, includePaths) {
12
11
  const originalResolvePath = root.resolvePath;
13
12
  root.resolvePath = (origin, target) => {
14
- if ((0, path_1.isAbsolute)(target)) {
13
+ if (cross_helpers_1.path.isAbsolute(target)) {
15
14
  return target;
16
15
  }
17
16
  for (const directory of includePaths) {
18
- const fullPath = (0, path_1.join)(directory, target);
19
- if ((0, fs_1.existsSync)(fullPath)) {
17
+ const fullPath = cross_helpers_1.path.join(directory, target);
18
+ if (cross_helpers_1.fs.existsSync(fullPath)) {
20
19
  return fullPath;
21
20
  }
22
21
  }
package/esm/directives.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DirectiveLocation, GraphQLBoolean, GraphQLDirective, GraphQLInputObjectType, GraphQLInt, GraphQLString, } from 'graphql';
1
+ import { DirectiveLocation, GraphQLBoolean, GraphQLDirective, GraphQLScalarType, GraphQLString, } from 'graphql';
2
2
  import { ObjMapScalar } from '@graphql-mesh/transport-common';
3
3
  export const grpcMethodDirective = new GraphQLDirective({
4
4
  name: 'grpcMethod',
@@ -67,37 +67,6 @@ export const grpcRootJsonDirective = new GraphQLDirective({
67
67
  },
68
68
  isRepeatable: true,
69
69
  });
70
- export const GrpcCredentialsSsl = new GraphQLInputObjectType({
71
- name: 'GrpcCredentialsSsl',
72
- fields: {
73
- rootCA: {
74
- type: GraphQLString,
75
- },
76
- certChain: {
77
- type: GraphQLString,
78
- },
79
- privateKey: {
80
- type: GraphQLString,
81
- },
82
- }
83
- });
84
- export const TransportOptions = new GraphQLInputObjectType({
85
- name: 'TransportOptions',
86
- fields: {
87
- requestTimeout: {
88
- type: GraphQLInt,
89
- },
90
- credentialsSsl: {
91
- type: GrpcCredentialsSsl,
92
- },
93
- useHTTPS: {
94
- type: GraphQLBoolean,
95
- },
96
- metaData: {
97
- type: ObjMapScalar,
98
- }
99
- }
100
- });
101
70
  export const transportDirective = new GraphQLDirective({
102
71
  name: 'transport',
103
72
  args: {
@@ -111,8 +80,8 @@ export const transportDirective = new GraphQLDirective({
111
80
  type: GraphQLString,
112
81
  },
113
82
  options: {
114
- type: TransportOptions,
115
- }
83
+ type: new GraphQLScalarType({ name: 'TransportOptions' }),
84
+ },
116
85
  },
117
86
  isRepeatable: true,
118
87
  locations: [DirectiveLocation.SCHEMA],
package/esm/utils.js CHANGED
@@ -1,16 +1,15 @@
1
- import { existsSync } from "fs";
2
- import { isAbsolute, join } from "path";
3
- import { getGraphQLScalarForGrpc, isGrpcScalar } from "./scalars.js";
4
1
  import lodashHas from 'lodash.has';
2
+ import { fs, path as pathModule } from '@graphql-mesh/cross-helpers';
3
+ import { getGraphQLScalarForGrpc, isGrpcScalar } from './scalars.js';
5
4
  export function addIncludePathResolver(root, includePaths) {
6
5
  const originalResolvePath = root.resolvePath;
7
6
  root.resolvePath = (origin, target) => {
8
- if (isAbsolute(target)) {
7
+ if (pathModule.isAbsolute(target)) {
9
8
  return target;
10
9
  }
11
10
  for (const directory of includePaths) {
12
- const fullPath = join(directory, target);
13
- if (existsSync(fullPath)) {
11
+ const fullPath = pathModule.join(directory, target);
12
+ if (fs.existsSync(fullPath)) {
14
13
  return fullPath;
15
14
  }
16
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigraph/grpc",
3
- "version": "0.0.1-alpha-20241030140429-9c1473cb596c3f20d6df4a3685ffdaf944f0a091",
3
+ "version": "0.1.0-alpha-20241031133458-8ac8d61249cbd2b40359c5069d08bdddd3ad21ab",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"
@@ -9,7 +9,7 @@
9
9
  "@ardatan/grpc-reflection-js": "^0.0.2",
10
10
  "@graphql-mesh/cross-helpers": "^0.4.7",
11
11
  "@graphql-mesh/string-interpolation": "^0.5.6",
12
- "@graphql-mesh/transport-common": "0.7.12-alpha-20241030140429-9c1473cb596c3f20d6df4a3685ffdaf944f0a091",
12
+ "@graphql-mesh/transport-common": "^0.7.12",
13
13
  "@graphql-tools/utils": "^10.5.5",
14
14
  "@grpc/grpc-js": "^1.1.7",
15
15
  "@whatwg-node/disposablestack": "^0.0.5",
@@ -1,8 +1,6 @@
1
- import { GraphQLDirective, GraphQLInputObjectType } from 'graphql';
1
+ import { GraphQLDirective } from 'graphql';
2
2
  export declare const grpcMethodDirective: GraphQLDirective;
3
3
  export declare const grpcConnectivityStateDirective: GraphQLDirective;
4
4
  export declare const EnumDirective: GraphQLDirective;
5
5
  export declare const grpcRootJsonDirective: GraphQLDirective;
6
- export declare const GrpcCredentialsSsl: GraphQLInputObjectType;
7
- export declare const TransportOptions: GraphQLInputObjectType;
8
6
  export declare const transportDirective: GraphQLDirective;
@@ -1,8 +1,6 @@
1
- import { GraphQLDirective, GraphQLInputObjectType } from 'graphql';
1
+ import { GraphQLDirective } from 'graphql';
2
2
  export declare const grpcMethodDirective: GraphQLDirective;
3
3
  export declare const grpcConnectivityStateDirective: GraphQLDirective;
4
4
  export declare const EnumDirective: GraphQLDirective;
5
5
  export declare const grpcRootJsonDirective: GraphQLDirective;
6
- export declare const GrpcCredentialsSsl: GraphQLInputObjectType;
7
- export declare const TransportOptions: GraphQLInputObjectType;
8
6
  export declare const transportDirective: GraphQLDirective;
@@ -1,5 +1,5 @@
1
- import type { SchemaComposer } from "graphql-compose";
2
- import type { INamespace, Root } from "protobufjs";
1
+ import type { SchemaComposer } from 'graphql-compose';
2
+ import type { INamespace, Root } from 'protobufjs';
3
3
  export declare function addIncludePathResolver(root: Root, includePaths: string[]): void;
4
4
  export declare function getTypeName(schemaComposer: SchemaComposer, pathWithName: string[] | undefined, isInput: boolean): string;
5
5
  export declare function walkToFindTypePath(rootJson: INamespace, pathWithName: string[], baseTypePath: string[]): string[];
@@ -1,5 +1,5 @@
1
- import type { SchemaComposer } from "graphql-compose";
2
- import type { INamespace, Root } from "protobufjs";
1
+ import type { SchemaComposer } from 'graphql-compose';
2
+ import type { INamespace, Root } from 'protobufjs';
3
3
  export declare function addIncludePathResolver(root: Root, includePaths: string[]): void;
4
4
  export declare function getTypeName(schemaComposer: SchemaComposer, pathWithName: string[] | undefined, isInput: boolean): string;
5
5
  export declare function walkToFindTypePath(rootJson: INamespace, pathWithName: string[], baseTypePath: string[]): string[];