@git-stack/graphql-schema
Advanced tools
Comparing version 0.0.6-y.0 to 0.0.7-0
@@ -96,7 +96,7 @@ module.exports = | ||
}); | ||
const resolvers = (pubsub, logger) => resolverModules.reduce((state, m) => { | ||
const resolvers = (pubsub, options) => resolverModules.reduce((state, m) => { | ||
if (!m.resolver) { | ||
return state; | ||
} | ||
return lodash_1.merge(state, m.resolver(pubsub, logger)); | ||
return lodash_1.merge(state, m.resolver(pubsub, options)); | ||
}, {}); | ||
@@ -144,3 +144,3 @@ exports.resolvers = resolvers; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolver = (pubsub, logger) => ({ | ||
exports.resolver = (pubsub, options) => ({ | ||
Query: { | ||
@@ -174,14 +174,12 @@ getCommit(root, { ref }, ctx) { | ||
async open(root, args, ctx) { | ||
ctx.gitService.setRepoPath(args.path); | ||
logger && logger.debug('args.path: [%s]', args.path); | ||
const status = await ctx.gitService.status(); | ||
if (status.error) { | ||
return { setPath: { error: status.error } }; | ||
} | ||
return { setPath: { error: '' } }; | ||
const rootFiles = await ctx.fileService.resolveFile(decodeURIComponent(args.path), {}); | ||
return await ctx.gitService.openRepository([...rootFiles.children], args.path); | ||
}, | ||
async close(root, args, ctx) { | ||
ctx.gitService.setRepoPath(null); | ||
return { isClosed: true }; | ||
async changeRepo(root, args, ctx) { | ||
await ctx.gitService.setRepo(args.path); | ||
return ctx.gitService.status(); | ||
}, | ||
close(root, args, ctx) { | ||
return ctx.gitService.close(args.path); | ||
}, | ||
add(root, args, ctx) { | ||
@@ -230,3 +228,3 @@ return ctx.gitService.add(args.paths); | ||
checkout(root, args, ctx) { | ||
return ctx.gitService.checkout(args.name); | ||
return ctx.gitService.checkout(args.name, args.options); | ||
}, | ||
@@ -242,2 +240,5 @@ merge(root, args, ctx) { | ||
}, | ||
setGlobalData(root, args, ctx) { | ||
return ctx.gitService.setGlobalData(args.type, args.data); | ||
}, | ||
}, | ||
@@ -275,3 +276,3 @@ }); | ||
module.exports = "\n\n\n# Root Query\nextend type Query {\n getCommit(ref: String!): Commit\n status: IGitStatusResult\n refs: [Ref]\n init: IGitStatusResult\n fetch: IGitStatusResult\n statusChanges: [TreeGroup]\n stashes: [Stash]\n headContent(resource: String!): IGetHead\n auth(id: String!): UserAuth\n}\n\nextend type Mutation {\n add(paths: [String]): IGitStatusResult\n close: IClosed\n deleteBranch(name: String!): IGitResult\n clone(url: String!, path: String!, options: ICloneOptions!): IGitResult\n createBranch(name: String!, checkout: Boolean!): IGitResult\n commit(message: String!, opts: ICommitOptions): IGitStatusResult\n commitAll(message: String!, opts: ICommitOptions): IGitStatusResult\n clean(paths: [String]): IGitStatusResult\n pull(options: IPullOptions): IGitStatusResult\n push(remote: String, name: String, options: IPushOptions): IGitResult \n stash(message: String): IGitStatusResult\n tag(name: String!, message: String): IGitResult\n sync(options: ISyncOptions): IGitStatusResult\n open(path: String): IGitPathResult\n checkout(name: String): IGitStatusResult\n merge(branch: String!): IGitStatusResult\n saveUser(login: String!, endpoint: String): ISaveUser\n unstash(index: Int): IGitStatusResult\n undoAll: IGitStatusResult\n unstage(paths: [String]): IGitStatusResult\n undoLastCommit: IGitStatusResult\n}\n" | ||
module.exports = "\n\n\n# Root Query\nextend type Query {\n getCommit(ref: String!): Commit\n status: [IGitStatusResult]\n refs: [Ref]\n init: [IGitStatusResult]\n fetch: [IGitStatusResult]\n statusChanges: [TreeGroup]\n stashes: [Stash]\n headContent(resource: String!): IGetHead\n auth(id: String!): UserAuth\n}\n\nextend type Mutation {\n add(paths: [String]): [IGitStatusResult]\n close(path: String): IClosed\n deleteBranch(name: String!): IGitResult\n clone(url: String!, path: String!, options: ICloneOptions!): IGitResultWithStatus\n createBranch(name: String!, checkout: Boolean!): IGitResult\n commit(message: String!, opts: ICommitOptions): IGitResultWithStatus\n commitAll(message: String!, opts: ICommitOptions): IGitResultWithStatus\n clean(paths: [String]): [IGitStatusResult]\n pull(options: IPullOptions): IGitResultWithStatus\n push(remote: String, name: String, options: IPushOptions): IGitResult \n stash(message: String): [IGitStatusResult]\n tag(name: String!, message: String): IGitResult\n sync(options: ISyncOptions): IGitResultWithStatus\n open(path: String): IOpenRes\n changeRepo(path: String): [IGitStatusResult]\n checkout(name: String, options: ICheckoutOptions): IGitResultWithStatus\n merge(branch: String!): IGitResultWithStatus\n saveUser(login: String!, endpoint: String): ISaveUser\n unstash(index: Int): [IGitStatusResult]\n undoAll: [IGitStatusResult]\n unstage(paths: [String]): [IGitStatusResult]\n undoLastCommit: [IGitStatusResult]\n setGlobalData(type: String, data: String): IGlobalDataUpdateRes\n}\n" | ||
@@ -282,3 +283,3 @@ /***/ }), | ||
module.exports = "type Commit {\n hash: String!\n message: String!\n}\n\nenum RawServiceState {\n OK\n GitNotFound\n Disabled\n}\n\ntype IGitStatusResult {\n currentBranch: String,\n currentTip: String,\n currentUpstreamBranch: String,\n branchAheadBehind: IBranchAhead,\n status: [IWorkingDirectory],\n stdout: String,\n stderr: String,\n exitCode: Int,\n gitErrorDescription: String\n}\n\ntype IBranchAhead {\n ahead: Int,\n behind: Int\n}\n\ntype IWorkingDirectory {\n path: String,\n oldPath: String,\n x: String,\n y: String\n}\n\n\ntype IGitServiceError implements Error {\n stack: String\n gitErrorCode: String!\n}\n\ninterface Error {\n stack: String\n}\n\ntype GitConfiguration {\n\tenabled: Boolean\n\tpath: String\n\tautorefresh: Boolean\n\tautofetch: Boolean\n\tenableLongCommitWarning: Boolean\n\tallowLargeRepositories: Boolean\n\tconfirmSync: Boolean\n\tcountBadge: String\n\tcheckoutType: String\n}\n\ninput IPushOptions {\n tags: Boolean\n setUpstream: Boolean\n login: String\n password: String\n}\n\nenum Status {\n INDEX_MODIFIED,\n\tINDEX_ADDED,\n\tINDEX_DELETED,\n\tINDEX_RENAMED,\n\tINDEX_COPIED,\n\n\tMODIFIED,\n\tDELETED,\n\tUNTRACKED,\n\tIGNORED,\n\n\tADDED_BY_US,\n\tADDED_BY_THEM,\n\tDELETED_BY_US,\n\tDELETED_BY_THEM,\n\tBOTH_ADDED,\n\tBOTH_DELETED,\n\tBOTH_MODIFIED\n}\n\ntype TreeItem {\n status: String!\n name: String!\n originName: String\n path: String\n originPath: String\n}\n\ninput TreeItemInput {\n status: String!\n path: String!\n originPath: String\n}\n\ntype TreeGroup {\n group: String!\n items: [TreeItem]\n}\n\ninput IPullOptions {\n login: String\n password: String\n rebase: Boolean\n branch: String\n}\n\ninput ISyncOptions {\n login: String\n password: String\n}\n\ntype IGitResult {\n stdout: String\n stderr: String\n exitCode: Int\n gitErrorDescription: String\n}\n\ntype OpenError{\n error: String\n}\n\ntype IGitPathResult {\n setPath: OpenError\n}\n\n\ninput ICloneOptions {\n login: String\n password: String\n}\n\ninput ICommitOptions {\n amend: Boolean,\n signoff: Boolean\n}\n\ntype Ref {\n type: Int,\n name: String,\n commit: String,\n remote: String\n}\n\ntype Stash { \n index: Int,\n description: String\n}\n\ntype UserAuth {\n login: String,\n endpoint: String\n}\n\ntype ISaveUser {\n id: String\n}\n\ntype IClosed {\n isClosed: Boolean\n}\n\ntype IGetHead {\n path: String\n stdout: String\n}" | ||
module.exports = "type Commit {\n hash: String!\n message: String!\n}\n\nenum RawServiceState {\n OK\n GitNotFound\n Disabled\n}\n\ntype IGitStatusResult {\n currentBranch: String,\n currentTip: String,\n currentUpstreamBranch: String,\n branchAheadBehind: IBranchAhead,\n status: [IWorkingDirectory],\n path: String,\n\n stdout: String,\n stderr: String,\n exitCode: Int,\n gitErrorDescription: String,\n}\n\ntype IGitResultWithStatus {\n status: [IGitStatusResult],\n stdout: String,\n stderr: String,\n exitCode: Int,\n gitErrorDescription: String,\n}\n\ntype IDugiteRes {\n stdout: String,\n stderr: String,\n exitCode: Int,\n gitErrorDescription: String,\n}\n\ntype IBranchAhead {\n ahead: Int,\n behind: Int\n}\n\ntype IWorkingDirectory {\n path: String,\n oldPath: String,\n x: String,\n y: String\n}\n\n\ntype IGitServiceError implements Error {\n stack: String\n gitErrorCode: String!\n}\n\ninterface Error {\n stack: String\n}\n\ntype GitConfiguration {\n\tenabled: Boolean\n\tpath: String\n\tautorefresh: Boolean\n\tautofetch: Boolean\n\tenableLongCommitWarning: Boolean\n\tallowLargeRepositories: Boolean\n\tconfirmSync: Boolean\n\tcountBadge: String\n\tcheckoutType: String\n}\n\ninput IPushOptions {\n tags: Boolean\n setUpstream: Boolean\n login: String\n password: String\n}\n\nenum Status {\n INDEX_MODIFIED,\n\tINDEX_ADDED,\n\tINDEX_DELETED,\n\tINDEX_RENAMED,\n\tINDEX_COPIED,\n\n\tMODIFIED,\n\tDELETED,\n\tUNTRACKED,\n\tIGNORED,\n\n\tADDED_BY_US,\n\tADDED_BY_THEM,\n\tDELETED_BY_US,\n\tDELETED_BY_THEM,\n\tBOTH_ADDED,\n\tBOTH_DELETED,\n\tBOTH_MODIFIED\n}\n\ntype TreeItem {\n status: String!\n name: String!\n originName: String\n path: String\n originPath: String\n}\n\ninput TreeItemInput {\n status: String!\n path: String!\n originPath: String\n}\n\ntype TreeGroup {\n group: String!\n items: [TreeItem]\n}\n\ninput IPullOptions {\n login: String\n password: String\n rebase: Boolean\n branch: String\n}\n\ninput ISyncOptions {\n login: String\n password: String\n}\n\ntype IGitResult {\n stdout: String\n stderr: String\n exitCode: Int\n gitErrorDescription: String\n}\n\ninput ICloneOptions {\n login: String\n password: String\n}\n\ninput ICommitOptions {\n amend: Boolean,\n signoff: Boolean\n}\n\ntype Ref {\n path: String,\n refs: [IRepoRefs],\n}\n\ntype IRepoRefs {\n type: Int,\n name: String,\n commit: String,\n remote: String\n}\n\ntype Stash { \n index: Int,\n description: String\n}\n\ntype UserAuth {\n login: String,\n endpoint: String\n}\n\ntype ISaveUser {\n id: String\n}\n\ntype IClosed {\n newPath: String\n}\n\ntype IGetHead {\n path: String\n stdout: String\n}\n\ninput ICheckoutOptions {\n repoPath: String\n}\n\ntype IGlobalRes {\n name: IDugiteRes,\n email: IDugiteRes\n}\n\ntype IOpenRes {\n openStatus: [IGitStatusResult],\n}\n\ntype IGlobalDataUpdateRes {\n type: String,\n data: String\n}" | ||
@@ -285,0 +286,0 @@ /***/ }) |
/// <reference types="bunyan" /> | ||
import * as Logger from 'bunyan'; | ||
declare const resolvers: (pubsub: any, logger?: Logger) => any; | ||
declare const resolvers: (pubsub: any, options: { | ||
logger: Logger; | ||
subscriptionID: string; | ||
}) => any; | ||
declare const typeDefs: any; | ||
export { resolvers, typeDefs }; |
{ | ||
"name": "@git-stack/graphql-schema", | ||
"version": "0.0.6-y.0", | ||
"version": "0.0.7-0", | ||
"description": "Gitstack Schema Module", | ||
@@ -48,10 +48,10 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@git-stack/server-core": "^0.0.6-y.0" | ||
"@git-stack/server-core": "^0.0.7-0" | ||
}, | ||
"devDependencies": { | ||
"@git-stack/utils": "^0.0.6-y.0", | ||
"@git-stack/utils": "^0.0.7-0", | ||
"cross-env": "^5.1.3", | ||
"jest": "^22.1.0", | ||
"jest": "^22.4.2", | ||
"rimraf": "^2.6.1", | ||
"webpack": "^3.10.0" | ||
"webpack": "^3.11.0" | ||
}, | ||
@@ -58,0 +58,0 @@ "peerDependencies": { |
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
38638
286
+ Added@git-stack/core@0.0.7(transitive)
+ Added@git-stack/server-core@0.0.7(transitive)
- Removed@git-stack/core@0.0.6-y.0(transitive)
- Removed@git-stack/server-core@0.0.6-y.0(transitive)