amplience-graphql-codegen-common
Advanced tools
Comparing version 0.1.8 to 0.2.0
import * as graphql from 'graphql'; | ||
import { FieldDefinitionNode, TypeDefinitionNode, DirectiveNode, ValueNode, ObjectValueNode, DefinitionNode, ObjectTypeDefinitionNode, TypeNode } from 'graphql'; | ||
import { FieldDefinitionNode, TypeDefinitionNode, ValueNode, DirectiveNode, ObjectValueNode, DefinitionNode, ObjectTypeDefinitionNode, TypeNode } from 'graphql'; | ||
declare const hasDirective: (symbol: FieldDefinitionNode | TypeDefinitionNode, name: string) => boolean | undefined; | ||
declare const maybeDirective: (symbol: FieldDefinitionNode | TypeDefinitionNode, name: string) => DirectiveNode | undefined; | ||
declare const maybeDirective: (symbol: FieldDefinitionNode | TypeDefinitionNode, name: string) => graphql.ConstDirectiveNode | undefined; | ||
declare const maybeDirectiveValue: <T extends ValueNode>(directive: DirectiveNode, argument: string) => T | undefined; | ||
@@ -10,3 +10,3 @@ declare const maybeFieldValue: <T extends ValueNode>(node: ObjectValueNode, field: string) => T | undefined; | ||
declare const typeName: (type: TypeNode) => string; | ||
declare const switchArray: <T>(type: TypeNode, { ifArray, other }: { | ||
declare const switchArray: <T>(type: TypeNode, { ifArray, other, }: { | ||
ifArray: (subType: TypeNode) => T; | ||
@@ -20,2 +20,4 @@ other: (type: TypeNode) => T; | ||
declare const combinations: (array: string[]) => string[][]; | ||
declare type Ensure<T extends {}, K extends keyof T> = T & Record<K, NonNullable<T[K]>>; | ||
declare const hasProperty: <T extends {}, K extends keyof T>(prop: K) => (obj: T) => obj is Ensure<T, K>; | ||
@@ -25,2 +27,2 @@ declare const schemaPrepend: graphql.DocumentNode; | ||
export { combinations, hasDirective, ifNotEmpty, ifValue, isObjectTypeDefinitionNode, isValue, maybeDirective, maybeDirectiveValue, maybeFieldValue, schemaPrepend, switchArray, typeName, typeUri }; | ||
export { Ensure, combinations, hasDirective, hasProperty, ifNotEmpty, ifValue, isObjectTypeDefinitionNode, isValue, maybeDirective, maybeDirectiveValue, maybeFieldValue, schemaPrepend, switchArray, typeName, typeUri }; |
@@ -25,2 +25,3 @@ "use strict"; | ||
hasDirective: () => hasDirective, | ||
hasProperty: () => hasProperty, | ||
ifNotEmpty: () => ifNotEmpty, | ||
@@ -68,2 +69,4 @@ ifValue: () => ifValue, | ||
return typeName(type.type); | ||
default: | ||
throw new Error(type.kind); | ||
} | ||
@@ -90,2 +93,3 @@ }; | ||
}; | ||
var hasProperty = (prop) => (obj) => Boolean(obj[prop]); | ||
@@ -113,3 +117,2 @@ // src/index.ts | ||
enum ValidationLevel { | ||
SLOT | ||
CONTENT_TYPE | ||
@@ -131,2 +134,4 @@ HIERARCHY | ||
) on OBJECT | ||
directive @icon(url: String!) on OBJECT | ||
`; | ||
@@ -138,2 +143,3 @@ var typeUri = (type, schemaHost) => `${schemaHost}/${(0, import_change_case.paramCase)(type.name.value)}`; | ||
hasDirective, | ||
hasProperty, | ||
ifNotEmpty, | ||
@@ -140,0 +146,0 @@ ifValue, |
{ | ||
"name": "amplience-graphql-codegen-common", | ||
"author": "Lab Digital", | ||
"version": "0.1.6", | ||
"version": "0.1.8", | ||
"private": false, | ||
@@ -13,5 +13,2 @@ "license": "MIT", | ||
], | ||
"publishConfig": { | ||
"directory": "dist" | ||
}, | ||
"engines": { | ||
@@ -28,3 +25,3 @@ "node": ">=16" | ||
"change-case": "^4.1.2", | ||
"graphql": "^15.6.0", | ||
"graphql": "^16.5.0", | ||
"graphql-tag": "^2.12.6" | ||
@@ -31,0 +28,0 @@ }, |
{ | ||
"name": "amplience-graphql-codegen-common", | ||
"author": "Lab Digital", | ||
"version": "0.1.8", | ||
"version": "0.2.0", | ||
"private": false, | ||
@@ -24,6 +24,6 @@ "license": "MIT", | ||
"change-case": "^4.1.2", | ||
"graphql": "^15.6.0", | ||
"graphql": "^16.5.0", | ||
"graphql-tag": "^2.12.6" | ||
}, | ||
"gitHead": "4e2063ba1f4317c8f5895a07cfeac747abfa7e4a" | ||
"gitHead": "b074ad9bbd2473ec1943b12ee46d8b7ce2e62928" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
300136
2973
+ Addedgraphql@16.10.0(transitive)
- Removedgraphql@15.10.1(transitive)
Updatedgraphql@^16.5.0