This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
DeleteSessionCommand, | |
DeleteSessionCommandInput, | |
LexRuntimeV2Client, | |
PutSessionCommand, | |
PutSessionCommandInput, | |
RecognizeTextCommand, | |
RecognizeTextCommandInput | |
} from '@aws-sdk/client-lex-runtime-v2' | |
import AWS from 'aws-sdk' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Builds training dataset | |
* @param root | |
* @param nodeType | |
* @param propertiesAsPrompt | |
* @param propertyAsCompletion | |
* @return | |
*/ | |
private List<Example> buildTrainingData(Session session, String root, String nodeType, List<String> propertiesAsPrompt, String propertyAsCompletion) throws RepositoryException { | |
List<Example> examples = new ArrayList<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert') | |
const Web3 = require('web3') | |
const web3 = new Web3() | |
const { privateKey, address: publicKey } = web3.eth.accounts.create() | |
// 1. Sign arbitrary text | |
const { signature } = web3.eth.accounts.sign('Arbitrary and random text', privateKey) | |
// 2. Recover public key from the signature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphql from "../src/cli/graphql"; | |
function Tours({ tours }) { | |
return ( | |
<div> | |
{ | |
tours.map((tour)=> { | |
return ( | |
<div> | |
<h1>{tour.name}</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient } from 'apollo-client' | |
import { createHttpLink } from 'apollo-link-http' | |
import { InMemoryCache } from 'apollo-cache-inmemory' | |
import fetch from 'isomorphic-unfetch' | |
import gql from 'graphql-tag' | |
const buildClient = () => { | |
return new ApolloClient({ | |
ssrMode: true, | |
link: createHttpLink({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Query { | |
nodes(workspace: String!, path: String): [Node] | |
} | |
type Node { | |
name: String, | |
path: String, | |
nodeType: String, | |
properties: [Property] | |
children: [Node] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directive @definition(workspace : String!, rootPath : String, nodeTypes : [String]) on FIELD_DEFINITION | |
schema { | |
query: Query, | |
} | |
type Query { | |
pages_ql : [Page] @definition(workspace: "website", nodeTypes: ["mgnl:page"]) | |
} | |
type Page { | |
name(jcrName: String): String, | |
title: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Api(value = "/magnolia-rest-graphql") | |
@Path("/magnolia-rest-graphql") | |
@I18n | |
@Slf4j | |
public class GraphQLEndpoint<D extends EndpointDefinition> extends AbstractEndpoint<D> { | |
private static final String STATUS_MESSAGE_OK = "OK"; | |
private static final String STATUS_MESSAGE_METHOD_NOT_ALLOWED = "Method Not Allowed"; | |
private static final String STATUS_MESSAGE_NO_CONTENT = "No content and Not Found"; | |
private static final String STATUS_MESSAGE_NOT_FOUND = "Not Found"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Auction bidding | |
Buyers bid for items on sale | |
Scenario: Bids higher than reserve price are accepted | |
Given Auction with reserve price 200000 | |
When A buyer make a bid for 205000 | |
Then Bid for 205000 is accepted | |
Scenario: Bid lower than reserve price are rejected | |
Given Auction with reserve price 200000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Auction opening | |
The auctioneer opens the auction by announcing a reserve for the item on sale. | |
Scenario: Auctioned items must be shown and described in detail | |
When Open auction for "Porsche 550 RS Spyder 1954" | |
Then Smart contract for Auction of "Porsche 550 RS Spyder 1954" must be created | |
Scenario: Auction of items with not suitable description must be rejected | |
When Open auction for "Car" | |
Then Smart contract for Auction rejected due to "Poor description" |
NewerOlder