@superfaceai/ast
Advanced tools
Comparing version 0.0.33 to 0.0.34
@@ -10,2 +10,10 @@ # Changelog | ||
## [0.0.34] - 2021-10-14 | ||
### Added | ||
- Added `UseCaseExampleNode` | ||
- Added Comlink example nodes `ComlinkPrimitiveLiteralNode`, `ComlinkObjectLiteralNode`, `ComlinkListLiteralNode`, `ComlinkAssignmentNode` | ||
### Changed | ||
- **BREAKING CHANGE**: `UseCaseSlotDefinitionNode` property `type` renamed to `value` and made required | ||
## [0.0.33] - 2021-10-14 | ||
@@ -139,3 +147,4 @@ | ||
[Unreleased]: https://github.com/superfaceai/ast-js/compare/v0.0.33...HEAD | ||
[Unreleased]: https://github.com/superfaceai/ast-js/compare/v0.0.34...HEAD | ||
[0.0.34]: https://github.com/superfaceai/ast-js/compare/v0.0.33...v0.0.34 | ||
[0.0.33]: https://github.com/superfaceai/ast-js/compare/v0.0.32...v0.0.33 | ||
@@ -142,0 +151,0 @@ [0.0.32]: https://github.com/superfaceai/ast-js/compare/v0.0.32-beta.0...v0.0.32 |
import { DocumentedNode, Location, Span } from './source'; | ||
export declare type ProfileNodeKind = 'PrimitiveTypeName' | 'ModelTypeName' | 'EnumDefinition' | 'ObjectDefinition' | 'ListDefinition' | 'NonNullDefinition' | 'UnionDefinition' | 'EnumValue' | 'FieldDefinition' | 'NamedFieldDefinition' | 'NamedModelDefinition' | 'UseCaseSlotDefinition' | 'UseCaseDefinition' | 'ProfileHeader' | 'ProfileDocument'; | ||
export declare type ProfileNodeKind = 'PrimitiveTypeName' | 'ModelTypeName' | 'EnumDefinition' | 'ObjectDefinition' | 'ListDefinition' | 'NonNullDefinition' | 'UnionDefinition' | 'EnumValue' | 'FieldDefinition' | 'NamedFieldDefinition' | 'NamedModelDefinition' | 'UseCaseSlotDefinition' | 'UseCaseDefinition' | 'ProfileHeader' | 'ProfileDocument' | 'UseCaseExample' | 'ComlinkPrimitiveLiteral' | 'ComlinkObjectLiteral' | 'ComlinkAssignment' | 'ComlinkListLiteral'; | ||
export interface ProfileASTNodeBase { | ||
@@ -55,3 +55,3 @@ kind: ProfileNodeKind; | ||
} | ||
export declare type TypeDefinition = ObjectDefinitionNode | EnumDefinitionNode | UnionDefinitionNode | ListDefinitionNode | NonNullDefinitionNode; | ||
export declare type TypeDefinition = ObjectDefinitionNode | EnumDefinitionNode | UnionDefinitionNode | ListDefinitionNode | NonNullDefinitionNode | UseCaseExampleNode | ComlinkLiteralNode; | ||
export declare type Type = TypeName | TypeDefinition; | ||
@@ -109,9 +109,9 @@ /** | ||
/** | ||
* Named slot definition for usecases. | ||
* Named slot definition for usecases and usecase examples. | ||
* | ||
* The point of this node is so that the usecase slots (`input`, `result`, `async result` and `error`) can have proper spans and documentation. | ||
*/ | ||
export interface UseCaseSlotDefinitionNode<T extends Type = Type> extends ProfileASTNodeBase, DocumentedNode { | ||
export interface UseCaseSlotDefinitionNode<T extends ProfileASTNode> extends ProfileASTNodeBase, DocumentedNode { | ||
kind: 'UseCaseSlotDefinition'; | ||
type?: T | undefined; | ||
value: T; | ||
} | ||
@@ -140,5 +140,6 @@ /** | ||
input?: UseCaseSlotDefinitionNode<ObjectDefinitionNode> | undefined; | ||
result?: UseCaseSlotDefinitionNode | undefined; | ||
asyncResult?: UseCaseSlotDefinitionNode | undefined; | ||
error?: UseCaseSlotDefinitionNode | undefined; | ||
result?: UseCaseSlotDefinitionNode<Type> | undefined; | ||
asyncResult?: UseCaseSlotDefinitionNode<Type> | undefined; | ||
error?: UseCaseSlotDefinitionNode<Type> | undefined; | ||
examples?: UseCaseSlotDefinitionNode<UseCaseExampleNode>[] | undefined; | ||
} | ||
@@ -187,2 +188,40 @@ /** | ||
export declare type DocumentDefinition = UseCaseDefinitionNode | NamedFieldDefinitionNode | NamedModelDefinitionNode; | ||
export declare type ProfileASTNode = EnumDefinitionNode | EnumValueNode | FieldDefinitionNode | ListDefinitionNode | ModelTypeNameNode | NamedFieldDefinitionNode | NamedModelDefinitionNode | NonNullDefinitionNode | ObjectDefinitionNode | PrimitiveTypeNameNode | ProfileDocumentNode | ProfileHeaderNode | UnionDefinitionNode | UseCaseDefinitionNode | UseCaseSlotDefinitionNode; | ||
export declare type ProfileASTNode = EnumDefinitionNode | EnumValueNode | FieldDefinitionNode | ListDefinitionNode | ModelTypeNameNode | NamedFieldDefinitionNode | NamedModelDefinitionNode | NonNullDefinitionNode | ObjectDefinitionNode | PrimitiveTypeNameNode | ProfileDocumentNode | ProfileHeaderNode | UnionDefinitionNode | UseCaseDefinitionNode | UseCaseSlotDefinitionNode<Type> | UseCaseSlotDefinitionNode<ComlinkLiteralNode> | UseCaseExampleNode | ComlinkPrimitiveLiteralNode | ComlinkObjectLiteralNode | ComlinkListLiteralNode; | ||
export interface UseCaseExampleNode extends ProfileASTNodeBase { | ||
kind: 'UseCaseExample'; | ||
exampleName?: string; | ||
input?: UseCaseSlotDefinitionNode<ComlinkLiteralNode> | undefined; | ||
result?: UseCaseSlotDefinitionNode<ComlinkLiteralNode> | undefined; | ||
asyncResult?: UseCaseSlotDefinitionNode<ComlinkLiteralNode> | undefined; | ||
error?: UseCaseSlotDefinitionNode<ComlinkLiteralNode> | undefined; | ||
} | ||
/** | ||
* Comlink primitive literal for boolean, string and number values. | ||
*/ | ||
export interface ComlinkPrimitiveLiteralNode extends ProfileASTNodeBase { | ||
kind: 'ComlinkPrimitiveLiteral'; | ||
value: number | string | boolean; | ||
} | ||
/** | ||
* Comlink object literal node: `{ <...assignments> }` | ||
*/ | ||
export interface ComlinkObjectLiteralNode extends ProfileASTNodeBase { | ||
kind: 'ComlinkObjectLiteral'; | ||
fields: ComlinkAssignmentNode[]; | ||
} | ||
/** | ||
* Comlink list literal node: `[ <...literals> ]` | ||
*/ | ||
export interface ComlinkListLiteralNode extends ProfileASTNodeBase { | ||
kind: 'ComlinkListLiteral'; | ||
items: ComlinkLiteralNode[]; | ||
} | ||
/** | ||
* Comlink assignment node: `key."b.az".bar = <value>` | ||
*/ | ||
export interface ComlinkAssignmentNode extends ProfileASTNodeBase, DocumentedNode { | ||
kind: 'ComlinkAssignment'; | ||
key: string[]; | ||
value: ComlinkLiteralNode; | ||
} | ||
export declare type ComlinkLiteralNode = ComlinkPrimitiveLiteralNode | ComlinkObjectLiteralNode | ComlinkListLiteralNode; |
@@ -22,3 +22,3 @@ import { DocumentDefinition, EnumDefinitionNode, EnumValueNode, FieldDefinitionNode, ListDefinitionNode, ModelTypeNameNode, NamedFieldDefinitionNode, NamedModelDefinitionNode, NonNullDefinitionNode, ObjectDefinitionNode, PrimitiveTypeNameNode, ProfileASTNode, ProfileDocumentNode, ProfileHeaderNode, Type, TypeDefinition, TypeName, UnionDefinitionNode, UseCaseDefinitionNode, UseCaseSlotDefinitionNode } from './profile-ast'; | ||
export declare const isUseCaseDefinitionNode: Guard<UseCaseDefinitionNode>; | ||
export declare const isUseCaseSlotDefinitionNode: Guard<UseCaseSlotDefinitionNode>; | ||
export declare const isUseCaseSlotDefinitionNode: Guard<UseCaseSlotDefinitionNode<ProfileASTNode>>; | ||
export declare const assertProfileDocumentNode: (node: unknown) => ProfileDocumentNode; | ||
@@ -25,0 +25,0 @@ export interface ProfileAstVisitor<R = unknown> { |
import { Guard } from '../ast'; | ||
import { SecurityValues } from '../superjson'; | ||
import { IntegrationParameter } from '.'; | ||
import { ApiKeySecurityScheme, BasicAuthSecurityScheme, BearerTokenSecurityScheme, DigestSecurityScheme, ProviderJson, SecurityScheme } from './providerjson'; | ||
@@ -12,1 +13,4 @@ export declare function isValidProviderName(name: string): boolean; | ||
export declare function prepareSecurityValues(providerName: string, schemes: SecurityScheme[]): SecurityValues[]; | ||
export declare function prepareProviderParameters(parameters: IntegrationParameter[]): { | ||
[key: string]: string; | ||
}; |
{ | ||
"name": "@superfaceai/ast", | ||
"version": "0.0.33", | ||
"version": "0.0.34", | ||
"description": "Superface profile and map language ASTs, https://superface.ai", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
2233810
52146
229