Skip to content

Commit

Permalink
Try again.
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarhane committed Oct 18, 2018
1 parent 079242a commit 6807025
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 4 deletions.
5 changes: 1 addition & 4 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"include": [
"src/**/*"
],
"include": ["src/**/*"],
"compilerOptions": {
"target": "ES6",
"allowSyntheticDefaultImports": true,
"baseUrl": "src/",
"checkJs": false,
"paths": {
"src-root/*": ["*"],
"services/*": ["shared/services/*"],
"browser-services/*": ["browser/services/*"],
"shared/*": ["shared/*"],
Expand Down
54 changes: 54 additions & 0 deletions src/shared/services/bolt/txMetadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2002-2018 "Neo4j, Inc"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { version } from 'project-root/package.json'

let counter = 0

// Application info
const NEO4J_BROWSER_BACKGROUND_QUERY = `NEO4J_BROWSER_BACKGROUND_QUERY`
const NEO4J_BROWSER_USER_QUERY = `NEO4J_BROWSER_USER_QUERY`
const NEO4J_BROWSER_APP_ID = `NEO4J_BROWSER_V${version}`

export const getBackgroundTxMetadata = ({ hasServerSupport = false }) => {
if (!hasServerSupport) {
return {}
}
return {
txMetadata: {
type: NEO4J_BROWSER_BACKGROUND_QUERY,
application: NEO4J_BROWSER_APP_ID,
query_number: ++counter
}
}
}

export const getUserTxMetadata = ({ hasServerSupport = false }) => {
if (!hasServerSupport) {
return {}
}
return {
txMetadata: {
type: NEO4J_BROWSER_USER_QUERY,
application: NEO4J_BROWSER_APP_ID,
query_number: ++counter
}
}
}

0 comments on commit 6807025

Please sign in to comment.