Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Aug 10, 2024
1 parent 1966d05 commit cd5e3f5
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"scripts": {
"fresh:contexts": "node ./scripts/bundle-contexts.js",
"prebuild": "rm -rf dist",
"build": "ncc build -m src/run.ts",
"build": "ncc build -m src/action/run.ts",
"transmute": "node dist/index.js",
"lint": "eslint ./src --fix",
"test": "dotenv -e .env jest",
Expand Down Expand Up @@ -80,4 +80,4 @@
"ts-jest": "^29.0.3",
"typescript": "^4.9.4"
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/getOptions.ts → src/action/getOptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from '@actions/core';

import { ActionOptions } from './types'
import { ActionOptions } from './ActionOptions'

const getOptions = (): ActionOptions => {
return {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/operations/index.ts → src/action/operations/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import{ ActionOptions} from '../types'
import { ActionOptions } from '../ActionOptions'

import * as neo4j from './neo4j'

const operations = async (options: ActionOptions) => {
if (options.neo4jUri){
if (options.neo4jUri) {
return neo4j.run(options)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import neo4j from 'neo4j-driver'

import { ActionOptions } from '../../types'
import { ActionOptions } from '../../ActionOptions'

import jsongraph from '../../../api/rdf/jsongraph'
import cypher from '../../../api/cypher'

import jsongraph from '../../api/rdf/jsongraph'
import cypher from '../../api/cypher'
export const run = async (options: ActionOptions) => {
const driver = neo4j.driver(
options.neo4jUri,
Expand Down
2 changes: 1 addition & 1 deletion src/run.ts → src/action/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as core from '@actions/core'
import getOpts from './getOptions'
import operationSwitch from './operationSwitch'
import cli from './cli'
import cli from '../cli'

async function run() {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import operationSwitch from "../operationSwitch";
import operationSwitch from "../action/operationSwitch";

const api = { operationSwitch }

Expand Down
12 changes: 8 additions & 4 deletions src/cli/graph/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import jsongraph from '../../api/rdf/jsongraph'
import * as contants from '../../constants'
import cypher from '../../api/cypher'

import operationSwitch from '../../operationSwitch'
import operationSwitch from '../../action/operationSwitch'

const graphContentType = `application/vnd.transmute.graph+json`
const cypherContentType = `application/vnd.transmute.cypher+json`
const rawCypherContentType = `application/vnd.transmute.cypher`

const register = (yargs) => {
yargs.command(
Expand Down Expand Up @@ -40,7 +44,7 @@ const register = (yargs) => {
const result = await operationSwitch(options)
console.info(JSON.stringify(result, null, 2))
} else if (accept && input) {
if (accept === contants.graphContentType) {
if (accept === graphContentType) {
const document = JSON.parse(
fs
.readFileSync(path.resolve(process.cwd(), input as string))
Expand All @@ -49,7 +53,7 @@ const register = (yargs) => {
const graph = await jsongraph.fromDocument(document)
console.info(JSON.stringify({ graph }, null, 2))
}
if (accept === contants.cypherContentType) {
if (accept === cypherContentType) {
const document = JSON.parse(
fs
.readFileSync(path.resolve(process.cwd(), input as string))
Expand All @@ -59,7 +63,7 @@ const register = (yargs) => {
const { query, params } = await cypher.fromJsonGraph(graph)
console.info(JSON.stringify({ query, params }, null, 2))
}
if (accept === contants.rawCypherContentType) {
if (accept === rawCypherContentType) {
const document = JSON.parse(
fs
.readFileSync(path.resolve(process.cwd(), input as string))
Expand Down
2 changes: 1 addition & 1 deletion src/cli/platform/module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import VerifiableDataPlatform from '@transmute/sdk'
import operationSwitch from '../../operationSwitch'
import operationSwitch from '../../action/operationSwitch'

export const command = 'platform <resource> <action>'

Expand Down
3 changes: 0 additions & 3 deletions src/constants.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/types/index.ts

This file was deleted.

0 comments on commit cd5e3f5

Please sign in to comment.