@files-stack/graphql-schema
Advanced tools
Comparing version 0.0.26 to 0.0.27-0
@@ -92,3 +92,3 @@ module.exports = | ||
}); | ||
const graphqlFiles = __webpack_require__(7); | ||
const graphqlFiles = __webpack_require__(8); | ||
const graphqls = graphqlFiles.keys().map((graphqlName) => { | ||
@@ -146,6 +146,22 @@ return graphqlFiles(graphqlName); | ||
const core_1 = __webpack_require__(6); | ||
const uri_1 = __webpack_require__(7); | ||
exports.resolver = (pubsub, logger) => ({ | ||
IFileStat: { | ||
resource(root, args, ctx) { | ||
return uri_1.default.from(root.resource).toString(); | ||
}, | ||
}, | ||
IContent: { | ||
resource(root, args, ctx) { | ||
return uri_1.default.from(root.resource).toString(); | ||
}, | ||
}, | ||
IStreamContent: { | ||
resource(root, args, ctx) { | ||
return uri_1.default.from(root.resource).toString(); | ||
}, | ||
}, | ||
Query: { | ||
resolveFile(root, args, ctx) { | ||
logger && logger.info('resolveFile (%s)', decodeURIComponent(args.resource)); | ||
logger && logger.debug('resolveFile (%s)', decodeURIComponent(args.resource)); | ||
ctx.fileService.watchFileChanges(decodeURIComponent(args.resource)); | ||
@@ -169,3 +185,3 @@ return ctx.fileService.resolveFile(decodeURIComponent(args.resource), args.options); | ||
loadFile(root, args, ctx) { | ||
logger && logger.info('loadFile (%s)', decodeURIComponent(args.resource)); | ||
logger && logger.debug('loadFile (%s)', decodeURIComponent(args.resource)); | ||
ctx.fileService.watchFileChanges(decodeURIComponent(args.resource)); | ||
@@ -175,11 +191,11 @@ return ctx.fileService.resolveFile(decodeURIComponent(args.resource), args.options); | ||
importFile(root, args, ctx) { | ||
logger && logger.info('importFile (%j)', decodeURIComponent(args.source)); | ||
logger && logger.debug('importFile (%j)', decodeURIComponent(args.source)); | ||
return ctx.fileService.importFile(decodeURIComponent(args.source), args.targetFolder); | ||
}, | ||
updateContent(root, args, ctx) { | ||
logger && logger.info('updateContent (%s)', decodeURIComponent(args.resource)); | ||
logger && logger.debug('updateContent (%s)', decodeURIComponent(args.resource)); | ||
return ctx.fileService.updateContent(decodeURIComponent(args.resource), args.value, args.options); | ||
}, | ||
moveFile(root, args, ctx) { | ||
logger && logger.info('move file (%s)', decodeURIComponent(args.source), decodeURIComponent(args.target)); | ||
logger && logger.debug('move file (%s)', decodeURIComponent(args.source), decodeURIComponent(args.target)); | ||
ctx.fileService.unwatchFileChanges(decodeURIComponent(args.source)); | ||
@@ -189,15 +205,15 @@ return ctx.fileService.moveFile(decodeURIComponent(args.source), decodeURIComponent(args.target), args.overwrite); | ||
copyFile(root, args, ctx) { | ||
logger && logger.info('copy file (%s)', decodeURIComponent(args.source), decodeURIComponent(args.target)); | ||
logger && logger.debug('copy file (%s)', decodeURIComponent(args.source), decodeURIComponent(args.target)); | ||
return ctx.fileService.copyFile(decodeURIComponent(args.source), decodeURIComponent(args.target), args.overwrite); | ||
}, | ||
createFile(root, args, ctx) { | ||
logger && logger.info('create file (%s)', decodeURIComponent(args.resource)); | ||
logger && logger.debug('create file (%s)', decodeURIComponent(args.resource)); | ||
return ctx.fileService.createFile(decodeURIComponent(args.resource), args.content); | ||
}, | ||
createFolder(root, args, ctx) { | ||
logger && logger.info('create folder (%s)', decodeURIComponent(args.resource)); | ||
logger && logger.debug('create folder (%s)', decodeURIComponent(args.resource)); | ||
return ctx.fileService.createFolder(decodeURIComponent(args.resource)); | ||
}, | ||
rename(root, args, ctx) { | ||
logger && logger.info('rename (%s, %s)', decodeURIComponent(args.resource), args.newName); | ||
logger && logger.debug('rename (%s, %s)', decodeURIComponent(args.resource), args.newName); | ||
return ctx.fileService.rename(decodeURIComponent(args.resource), args.newName); | ||
@@ -209,3 +225,3 @@ }, | ||
del(root, args, ctx) { | ||
logger && logger.info('delete (%j)', decodeURIComponent(args.resource)); | ||
logger && logger.debug('delete (%j)', decodeURIComponent(args.resource)); | ||
ctx.fileService.del(decodeURIComponent(args.resource), args.useTrash); | ||
@@ -227,6 +243,12 @@ ctx.fileService.unwatchFileChanges(decodeURIComponent(args.resource)); | ||
subscribe: graphql_subscriptions_1.withFilter(() => pubsub.asyncIterator(core_1.PubsubIdentifier.FILE_UPDATED), (payload, variables) => { | ||
logger.debug('subscribe fileData: (%j), variables: (%j)', payload.fileData, variables); | ||
return (variables.resource === payload.fileData.resource); | ||
logger.debug('subscribe fileData: (%j), variables: (%j)', payload, variables); | ||
return true; | ||
}), | ||
}, | ||
fileStreamContent: { | ||
subscribe: graphql_subscriptions_1.withFilter(() => pubsub.asyncIterator(core_1.PubsubIdentifier.FILE_CONTENT_STREAM), (payload, variables) => { | ||
logger.debug('subscribe fileStreamContent: (%j), variables: (%j)', payload, variables); | ||
return true; | ||
}), | ||
}, | ||
fileOperation: { | ||
@@ -271,6 +293,12 @@ subscribe: graphql_subscriptions_1.withFilter(() => pubsub.asyncIterator(core_1.PubsubIdentifier.FILE_OPERATION), (payload, variables) => { | ||
/* 7 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("@vscode/base-node/vs/base/common/uri"); | ||
/***/ }), | ||
/* 8 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var map = { | ||
"./schema.graphqls": 8 | ||
"./schema.graphqls": 9 | ||
}; | ||
@@ -291,9 +319,9 @@ function webpackContext(req) { | ||
module.exports = webpackContext; | ||
webpackContext.id = 7; | ||
webpackContext.id = 8; | ||
/***/ }), | ||
/* 8 */ | ||
/* 9 */ | ||
/***/ (function(module, exports) { | ||
module.exports = "interface IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n}\n\ntype IFileStat implements IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n isDirectory: Boolean!\n hasChildren: Boolean!\n children: [IFileStat]\n size: Int\n}\n\n\ntype IContent implements IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n value: String!\n encoding: String!\n}\n\ntype IStreamContent implements IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n # to replace string with IStringStream\n value: String!\n encoding: String!\n}\n\nenum FileOperation {\n CREATE\n DELETE\n MOVE\n COPY\n IMPORT\n}\n\nenum FileChangeType {\n UPDATED\n ADDED\n DELETED\n}\n\ntype IFileChange {\n type: Int\n resource: String\n}\n\ntype IFileOperation {\n resource: String\n target: IFileStat\n operation: Int\n}\n\ninput IUpdateContentOptions {\n encoding: String\n overwriteEncoding: Boolean\n overwriteReadonly: Boolean\n mtime: String\n etag: String\n}\n\ninput IResolveContentOptions {\n acceptTextOnly: Boolean\n etag: String\n encoding: String\n autoGuessEncoding: Boolean\n}\n\ninput IResolveFileOptions {\n resolveTo: [String]\n resolveSingleChildDescendants: Boolean\n}\n\ntype IImportResult {\n stat: IFileStat\n isNew: Boolean\n}\n\n\n# Mutations\nextend type Mutation {\n loadFile(resource: String!, options: IResolveFileOptions): IFileStat\n importFile(source: String!, targetFolder: String!): IImportResult\n updateContent(resource: String!, value: String!, options: IUpdateContentOptions!): IFileStat\n moveFile(source: String!, target: String!, overwrite: Boolean): IFileStat\n copyFile(source: String!, target: String!, overwrite: Boolean): IFileStat\n createFile(resource: String!, content: String): IFileStat\n createFolder(resource: String!): IFileStat\n rename(resource: String!, newName: String!): IFileStat\n touchFile(resource: String!): IFileStat\n del(resource: String!, useTrash: Boolean): Boolean\n watchFileChanges(resource: String!): Boolean\n unwatchFileChanges(resource: String!): Boolean\n unwatchFileChangesFsPath(fsPath: String!): Boolean\n # updateOptions(options: any): Boolean\n}\n\n# Root Query\nextend type Query {\n resolveFile(resource: String!, options: IResolveFileOptions): IFileStat\n existsFile(resource: String!): Boolean\n resolveContent(resource: String!, options: IResolveContentOptions): IContent\n resolveStreamContent(resouce: String!, options: IResolveContentOptions): IStreamContent\n resolveContents(resources: [String!]!): [IContent]\n getEncoding(resource: String!): String\n\n}\n\n# Subscriptions\nextend type Subscription {\n fileData(resource: String!): IFileChange\n fileOperation(resource: String!): IFileOperation\n}" | ||
module.exports = "interface IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n}\n\ntype IFileStat implements IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n isDirectory: Boolean!\n hasChildren: Boolean!\n children: [IFileStat]\n size: Int\n}\n\n\ntype IContent implements IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n value: String!\n encoding: String!\n}\n\ntype IStreamContent implements IBaseStat {\n resource: String!\n name: String!\n mtime: String!\n etag: String!\n value: String!\n encoding: String!\n status: String!\n}\n\nenum FileOperation {\n CREATE\n DELETE\n MOVE\n COPY\n IMPORT\n}\n\nenum FileChangeType {\n UPDATED\n ADDED\n DELETED\n}\n\ntype IFileChange {\n type: Int!\n resource: String\n name: String\n mtime: String\n etag: String\n isDirectory: Boolean\n hasChildren: Boolean\n children: [IFileStat]\n size: Int\n}\n\ntype IFileOperation {\n resource: String\n target: IFileStat\n operation: Int\n}\n\ninput IUpdateContentOptions {\n encoding: String\n overwriteEncoding: Boolean\n overwriteReadonly: Boolean\n mtime: String\n etag: String\n}\n\ninput IResolveContentOptions {\n acceptTextOnly: Boolean\n etag: String\n encoding: String\n autoGuessEncoding: Boolean\n}\n\ninput IResolveFileOptions {\n resolveTo: [String]\n resolveSingleChildDescendants: Boolean\n}\n\ntype IImportResult {\n stat: IFileStat\n isNew: Boolean\n}\n\n\n# Mutations\nextend type Mutation {\n loadFile(resource: String!, options: IResolveFileOptions): IFileStat\n importFile(source: String!, targetFolder: String!): IImportResult\n updateContent(resource: String!, value: String!, options: IUpdateContentOptions!): IFileStat\n moveFile(source: String!, target: String!, overwrite: Boolean): IFileStat\n copyFile(source: String!, target: String!, overwrite: Boolean): IFileStat\n createFile(resource: String!, content: String): IFileStat\n createFolder(resource: String!): IFileStat\n rename(resource: String!, newName: String!): IFileStat\n touchFile(resource: String!): IFileStat\n del(resource: String!, useTrash: Boolean): Boolean\n watchFileChanges(resource: String!): Boolean\n unwatchFileChanges(resource: String!): Boolean\n unwatchFileChangesFsPath(fsPath: String!): Boolean\n # updateOptions(options: any): Boolean\n}\n\n# Root Query\nextend type Query {\n resolveFile(resource: String!, options: IResolveFileOptions): IFileStat\n existsFile(resource: String!): Boolean\n resolveContent(resource: String!, options: IResolveContentOptions): IContent\n resolveStreamContent(resource: String!, options: IResolveContentOptions): IStreamContent\n resolveContents(resources: [String!]!): [IContent]\n getEncoding(resource: String!): String\n\n}\n\n# Subscriptions\nextend type Subscription {\n fileData(resource: String!): [IFileChange]\n fileOperation(resource: String!): IFileOperation\n fileStreamContent(resource: String!): IStreamContent\n}" | ||
@@ -300,0 +328,0 @@ /***/ }) |
{ | ||
"name": "@files-stack/graphql-schema", | ||
"version": "0.0.26", | ||
"version": "0.0.27-0", | ||
"description": "Sample Schema Module", | ||
@@ -48,7 +48,7 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@files-stack/core": "^0.0.26", | ||
"@files-stack/server-core": "^0.0.26" | ||
"@files-stack/core": "^0.0.27-0", | ||
"@files-stack/server-core": "^0.0.27-0" | ||
}, | ||
"devDependencies": { | ||
"@files-stack/utils": "^0.0.26", | ||
"@files-stack/utils": "^0.0.27-0", | ||
"cross-env": "^5.1.3", | ||
@@ -62,3 +62,3 @@ "jest": "^22.1.0", | ||
"@vscode/base-parts-ipc": "^0.0.6", | ||
"@vscode/platform-node": "^0.0.10", | ||
"@vscode/platform-node": "^0.1.15", | ||
"@workbench-stack/extensions": "*", | ||
@@ -65,0 +65,0 @@ "graphql": "^0.10.0 || ^0.11.0", |
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
44312
310
+ Added@files-stack/core@0.0.27-16(transitive)
+ Added@files-stack/server-core@0.0.27-16(transitive)
- Removed@files-stack/core@0.0.26(transitive)
- Removed@files-stack/server-core@0.0.26(transitive)
Updated@files-stack/core@^0.0.27-0