From 2a3eec35a1f0f5f5f74d2ad684d211fb9be6305b Mon Sep 17 00:00:00 2001 From: Anders Jurisoo Date: Sat, 14 Dec 2019 13:47:27 +0100 Subject: [PATCH] Fix API bug --- src/public/js/app.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/public/js/app.js b/src/public/js/app.js index 07e80cc..2f5ab4e 100644 --- a/src/public/js/app.js +++ b/src/public/js/app.js @@ -790,7 +790,7 @@ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="s !*** (webpack)/buildin/module.js ***! \***********************************/ /*! no static exports found */ /***/function node_modulesWebpackBuildinModuleJs(module,exports){eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack://PipeDream/(webpack)/buildin/module.js?");/***/},/***/"./package.json":/*!**********************!*\ !*** ./package.json ***! - \**********************/ /*! exports provided: name, version, description, main, repository, author, license, private, devDependencies, scripts, jest, dependencies, default */ /***/function packageJson(module){eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"@pipe-dream/core\\\",\\\"version\\\":\\\"1.0.12\\\",\\\"description\\\":\\\"Pipe Dream core functionality used by other repos\\\",\\\"main\\\":\\\"dist/pipe-dream.js\\\",\\\"repository\\\":\\\"github.com:pipe-dream/core\\\",\\\"author\\\":\\\"Anders Jurisoo \\\",\\\"license\\\":\\\"MIT\\\",\\\"private\\\":false,\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"7.5.5\\\",\\\"@types/jest\\\":\\\"^24.0.18\\\",\\\"babel-loader\\\":\\\"^8.0.6\\\",\\\"copy-webpack-plugin\\\":\\\"^5.0.4\\\",\\\"css-loader\\\":\\\"^3.1.0\\\",\\\"cssnano\\\":\\\"^4.1.10\\\",\\\"jest-transform-stub\\\":\\\"^2.0.0\\\",\\\"lodash\\\":\\\"^4.17.15\\\",\\\"mini-css-extract-plugin\\\":\\\"^0.8.0\\\",\\\"ts-jest\\\":\\\"^24.0.2\\\",\\\"typescript\\\":\\\"^3.5.3\\\",\\\"vue-loader\\\":\\\"^15.7.1\\\",\\\"vue-template-compiler\\\":\\\"^2.6.10\\\",\\\"webpack-cli\\\":\\\"^3.3.6\\\"},\\\"scripts\\\":{\\\"build\\\":\\\"webpack --mode development\\\",\\\"test\\\":\\\"cross-env NODE_ENV=test jest\\\",\\\"coverage\\\":\\\"jest --collectCoverage=true --coverageReporters=text-lcov | ./node_modules/coveralls/bin/coveralls.js\\\"},\\\"jest\\\":{\\\"moduleFileExtensions\\\":[\\\"js\\\",\\\"json\\\",\\\"vue\\\",\\\"ts\\\"],\\\"transform\\\":{\\\".*\\\\\\\\.(js)$\\\":\\\"babel-jest\\\",\\\".*\\\\\\\\.(vue)$\\\":\\\"vue-jest\\\",\\\".*\\\\\\\\.(string)$\\\":\\\"jest-raw-loader\\\",\\\".*\\\\\\\\.(tsx?)$\\\":\\\"ts-jest\\\"}},\\\"dependencies\\\":{\\\"@vue/test-utils\\\":\\\"^1.0.0-beta.29\\\",\\\"babel-core\\\":\\\"^7.0.0-bridge.0\\\",\\\"babel-jest\\\":\\\"^24.8.0\\\",\\\"babel-plugin-module-resolver\\\":\\\"^3.2.0\\\",\\\"babel-plugin-transform-es2015-modules-commonjs\\\":\\\"^6.26.2\\\",\\\"brace\\\":\\\"^0.11.0\\\",\\\"change-case\\\":\\\"^3.1.0\\\",\\\"collect.js\\\":\\\"^4.6.5\\\",\\\"coveralls\\\":\\\"^3.0.5\\\",\\\"cross-env\\\":\\\"^5.1\\\",\\\"cycle\\\":\\\"^1.0.3\\\",\\\"deepmerge\\\":\\\"^3.2.0\\\",\\\"jest\\\":\\\"^24.8.0\\\",\\\"jest-raw-loader\\\":\\\"^1.0.1\\\",\\\"laravel-mix\\\":\\\"^4.0.14\\\",\\\"laravel-mix-purgecss\\\":\\\"^4.1\\\",\\\"laravel-mix-tailwind\\\":\\\"^0.1.0\\\",\\\"object-hash\\\":\\\"^1.3.1\\\",\\\"pluralize\\\":\\\"^7.0.0\\\",\\\"resolve-url-loader\\\":\\\"^2.3.1\\\",\\\"sass\\\":\\\"^1.15.2\\\",\\\"sass-loader\\\":\\\"^7.1.0\\\",\\\"tailwindcss\\\":\\\"^1.0\\\",\\\"ts-loader\\\":\\\"^6.0.4\\\",\\\"vue\\\":\\\"^2.5.17\\\",\\\"vue-highlightjs\\\":\\\"^1.3.3\\\",\\\"vue-jest\\\":\\\"^3.0.4\\\",\\\"vue-textarea-autosize\\\":\\\"^1.0.4\\\",\\\"vuex\\\":\\\"^3.1.0\\\",\\\"webpack\\\":\\\"^4.37.0\\\"}}\");\n\n//# sourceURL=webpack://PipeDream/./package.json?");/***/},/***/"./src sync recursive \\.vue$/":/*!**************************!*\ + \**********************/ /*! exports provided: name, version, description, main, repository, author, license, private, devDependencies, scripts, jest, dependencies, default */ /***/function packageJson(module){eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"@pipe-dream/core\\\",\\\"version\\\":\\\"1.0.13\\\",\\\"description\\\":\\\"Pipe Dream core functionality used by other repos\\\",\\\"main\\\":\\\"dist/pipe-dream.js\\\",\\\"repository\\\":\\\"github.com:pipe-dream/core\\\",\\\"author\\\":\\\"Anders Jurisoo \\\",\\\"license\\\":\\\"MIT\\\",\\\"private\\\":false,\\\"devDependencies\\\":{\\\"@babel/core\\\":\\\"7.5.5\\\",\\\"@types/jest\\\":\\\"^24.0.18\\\",\\\"babel-loader\\\":\\\"^8.0.6\\\",\\\"copy-webpack-plugin\\\":\\\"^5.0.4\\\",\\\"css-loader\\\":\\\"^3.1.0\\\",\\\"cssnano\\\":\\\"^4.1.10\\\",\\\"jest-transform-stub\\\":\\\"^2.0.0\\\",\\\"lodash\\\":\\\"^4.17.15\\\",\\\"mini-css-extract-plugin\\\":\\\"^0.8.0\\\",\\\"ts-jest\\\":\\\"^24.0.2\\\",\\\"typescript\\\":\\\"^3.5.3\\\",\\\"vue-loader\\\":\\\"^15.7.1\\\",\\\"vue-template-compiler\\\":\\\"^2.6.10\\\",\\\"webpack-cli\\\":\\\"^3.3.6\\\"},\\\"scripts\\\":{\\\"build\\\":\\\"webpack --mode development\\\",\\\"test\\\":\\\"cross-env NODE_ENV=test jest\\\",\\\"coverage\\\":\\\"jest --collectCoverage=true --coverageReporters=text-lcov | ./node_modules/coveralls/bin/coveralls.js\\\"},\\\"jest\\\":{\\\"moduleFileExtensions\\\":[\\\"js\\\",\\\"json\\\",\\\"vue\\\",\\\"ts\\\"],\\\"transform\\\":{\\\".*\\\\\\\\.(js)$\\\":\\\"babel-jest\\\",\\\".*\\\\\\\\.(vue)$\\\":\\\"vue-jest\\\",\\\".*\\\\\\\\.(string)$\\\":\\\"jest-raw-loader\\\",\\\".*\\\\\\\\.(tsx?)$\\\":\\\"ts-jest\\\"}},\\\"dependencies\\\":{\\\"@vue/test-utils\\\":\\\"^1.0.0-beta.29\\\",\\\"babel-core\\\":\\\"^7.0.0-bridge.0\\\",\\\"babel-jest\\\":\\\"^24.8.0\\\",\\\"babel-plugin-module-resolver\\\":\\\"^3.2.0\\\",\\\"babel-plugin-transform-es2015-modules-commonjs\\\":\\\"^6.26.2\\\",\\\"brace\\\":\\\"^0.11.0\\\",\\\"change-case\\\":\\\"^3.1.0\\\",\\\"collect.js\\\":\\\"^4.6.5\\\",\\\"coveralls\\\":\\\"^3.0.5\\\",\\\"cross-env\\\":\\\"^5.1\\\",\\\"cycle\\\":\\\"^1.0.3\\\",\\\"deepmerge\\\":\\\"^3.2.0\\\",\\\"jest\\\":\\\"^24.8.0\\\",\\\"jest-raw-loader\\\":\\\"^1.0.1\\\",\\\"laravel-mix\\\":\\\"^4.0.14\\\",\\\"laravel-mix-purgecss\\\":\\\"^4.1\\\",\\\"laravel-mix-tailwind\\\":\\\"^0.1.0\\\",\\\"object-hash\\\":\\\"^1.3.1\\\",\\\"pluralize\\\":\\\"^7.0.0\\\",\\\"resolve-url-loader\\\":\\\"^2.3.1\\\",\\\"sass\\\":\\\"^1.15.2\\\",\\\"sass-loader\\\":\\\"^7.1.0\\\",\\\"tailwindcss\\\":\\\"^1.0\\\",\\\"ts-loader\\\":\\\"^6.0.4\\\",\\\"vue\\\":\\\"^2.5.17\\\",\\\"vue-highlightjs\\\":\\\"^1.3.3\\\",\\\"vue-jest\\\":\\\"^3.0.4\\\",\\\"vue-textarea-autosize\\\":\\\"^1.0.4\\\",\\\"vuex\\\":\\\"^3.1.0\\\",\\\"webpack\\\":\\\"^4.37.0\\\"}}\");\n\n//# sourceURL=webpack://PipeDream/./package.json?");/***/},/***/"./src sync recursive \\.vue$/":/*!**************************!*\ !*** ./src sync \.vue$/ ***! \**************************/ /*! no static exports found */ /***/function srcSyncRecursiveVue$(module,exports,__webpack_require__){eval("var map = {\n\t\"./components/AppHeader.vue\": \"./src/components/AppHeader.vue\",\n\t\"./components/AppWorkspace.vue\": \"./src/components/AppWorkspace.vue\",\n\t\"./components/NotificationCard.vue\": \"./src/components/NotificationCard.vue\",\n\t\"./components/WorkspaceNavigation.vue\": \"./src/components/WorkspaceNavigation.vue\",\n\t\"./components/WorkspaceTabs/Build/BuildTab.vue\": \"./src/components/WorkspaceTabs/Build/BuildTab.vue\",\n\t\"./components/WorkspaceTabs/Design/DesignTab.vue\": \"./src/components/WorkspaceTabs/Design/DesignTab.vue\",\n\t\"./components/WorkspaceTabs/Design/ObjectModelTab.vue\": \"./src/components/WorkspaceTabs/Design/ObjectModelTab.vue\",\n\t\"./components/WorkspaceTabs/Design/SettingsTab.vue\": \"./src/components/WorkspaceTabs/Design/SettingsTab.vue\",\n\t\"./components/WorkspaceTabs/Design/StackTab.vue\": \"./src/components/WorkspaceTabs/Design/StackTab.vue\",\n\t\"./components/WorkspaceTabs/Design/TemplatesTab.vue\": \"./src/components/WorkspaceTabs/Design/TemplatesTab.vue\",\n\t\"./components/WorkspaceTabs/Review/ReviewTab.vue\": \"./src/components/WorkspaceTabs/Review/ReviewTab.vue\",\n\t\"./components/WorkspaceTabs/WorkspaceTabNavigation.vue\": \"./src/components/WorkspaceTabs/WorkspaceTabNavigation.vue\",\n\t\"./utilities/CodeEditor.vue\": \"./src/utilities/CodeEditor.vue\",\n\t\"./utilities/HintBox.vue\": \"./src/utilities/HintBox.vue\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./src sync recursive \\\\.vue$/\";\n\n//# sourceURL=webpack://PipeDream/./src_sync_\\.vue$/?");/***/},/***/"./src/PipeDream.ts":/*!**************************!*\ !*** ./src/PipeDream.ts ***! @@ -5666,7 +5666,7 @@ module.exports = function (str, locale) { /*! exports provided: name, version, description, main, repository, author, license, private, scripts, devDependencies, jest, dependencies, default */ /***/ (function(module) { -module.exports = JSON.parse("{\"name\":\"@pipe-dream/laravel-file-factory\",\"version\":\"1.0.13\",\"description\":\"Laravel FileFactory implementation for Pipe Dream. This repo is not stand alone, it must be used together with a composer package or similar.\",\"main\":\"src/index.js\",\"repository\":\"github.com:pipe-dream/laravel-file-factory\",\"author\":\"Anders Jurisoo \",\"license\":\"MIT\",\"private\":false,\"scripts\":{\"dev\":\"npm run development\",\"development\":\"cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js\",\"watch\":\"npm run development -- --watch\",\"watch-poll\":\"npm run watch -- --watch-poll\",\"hot\":\"cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js\",\"prod\":\"npm run production\",\"production\":\"cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js\",\"test\":\"cross-env NODE_ENV=test jest\"},\"devDependencies\":{},\"jest\":{\"moduleNameMapper\":{\"^@pipe-dream/(.*)$\":\"/node_modules/@pipe-dream/$1\"},\"moduleFileExtensions\":[\"js\",\"json\",\"vue\"],\"transform\":{\".*\\\\.(js)$\":\"babel-jest\",\".*\\\\.(vue)$\":\"vue-jest\"},\"testMatch\":[\"/(test/**/*.js)\"],\"transformIgnorePatterns\":[\"/node_modules/(?!@pipe-dream/core).+\\\\.js$\"]},\"dependencies\":{\"@pipe-dream/core\":\"^1.0.4\",\"@vue/test-utils\":\"^1.0.0-beta.29\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-jest\":\"^23.6.0\",\"babel-plugin-module-resolver\":\"^3.2.0\",\"babel-plugin-transform-es2015-modules-commonjs\":\"^6.26.2\",\"change-case\":\"^3.1.0\",\"collect.js\":\"^4.6.5\",\"cross-env\":\"^5.1\",\"deepmerge\":\"^3.2.0\",\"expose-loader\":\"^0.7.5\",\"jest\":\"^24.8.0\",\"laravel-mix\":\"^4.0.14\",\"laravel-mix-purgecss\":\"^4.1\",\"laravel-mix-tailwind\":\"^0.1.0\",\"pluralize\":\"^7.0.0\",\"raw-loader\":\"^3.0.0\",\"resolve-url-loader\":\"^2.3.1\",\"sass\":\"^1.15.2\",\"sass-loader\":\"^7.1.0\",\"tailwindcss\":\"^0.7.4\",\"vue\":\"^2.5.17\",\"vue-highlightjs\":\"^1.3.3\",\"vue-jest\":\"^3.0.4\",\"vue-template-compiler\":\"^2.6.10\",\"vue-textarea-autosize\":\"^1.0.4\",\"vuex\":\"^3.1.0\"}}"); +module.exports = JSON.parse("{\"name\":\"@pipe-dream/laravel-file-factory\",\"version\":\"1.0.15\",\"description\":\"Laravel FileFactory implementation for Pipe Dream. This repo is not stand alone, it must be used together with a composer package or similar.\",\"main\":\"src/index.js\",\"repository\":\"github.com:pipe-dream/laravel-file-factory\",\"author\":\"Anders Jurisoo \",\"license\":\"MIT\",\"private\":false,\"scripts\":{\"dev\":\"npm run development\",\"development\":\"cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js\",\"watch\":\"npm run development -- --watch\",\"watch-poll\":\"npm run watch -- --watch-poll\",\"hot\":\"cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js\",\"prod\":\"npm run production\",\"production\":\"cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js\",\"test\":\"cross-env NODE_ENV=test jest\"},\"devDependencies\":{},\"jest\":{\"moduleNameMapper\":{\"^@pipe-dream/(.*)$\":\"/node_modules/@pipe-dream/$1\"},\"moduleFileExtensions\":[\"js\",\"json\",\"vue\"],\"transform\":{\".*\\\\.(js)$\":\"babel-jest\",\".*\\\\.(vue)$\":\"vue-jest\"},\"testMatch\":[\"/(test/**/*.js)\"],\"transformIgnorePatterns\":[\"/node_modules/(?!@pipe-dream/core).+\\\\.js$\"]},\"dependencies\":{\"@pipe-dream/core\":\"^1.0.4\",\"@vue/test-utils\":\"^1.0.0-beta.29\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-jest\":\"^23.6.0\",\"babel-plugin-module-resolver\":\"^3.2.0\",\"babel-plugin-transform-es2015-modules-commonjs\":\"^6.26.2\",\"change-case\":\"^3.1.0\",\"collect.js\":\"^4.6.5\",\"cross-env\":\"^5.1\",\"deepmerge\":\"^3.2.0\",\"expose-loader\":\"^0.7.5\",\"jest\":\"^24.8.0\",\"laravel-mix\":\"^4.0.14\",\"laravel-mix-purgecss\":\"^4.1\",\"laravel-mix-tailwind\":\"^0.1.0\",\"pluralize\":\"^7.0.0\",\"raw-loader\":\"^3.0.0\",\"resolve-url-loader\":\"^2.3.1\",\"sass\":\"^1.15.2\",\"sass-loader\":\"^7.1.0\",\"tailwindcss\":\"^0.7.4\",\"vue\":\"^2.5.17\",\"vue-highlightjs\":\"^1.3.3\",\"vue-jest\":\"^3.0.4\",\"vue-template-compiler\":\"^2.6.10\",\"vue-textarea-autosize\":\"^1.0.4\",\"vuex\":\"^3.1.0\"}}"); /***/ }), @@ -5988,12 +5988,14 @@ function (_ModelPipe) { return omc.modelsIncludingUser().map(function (model) { return { - path: "app/Http/Controllers/" + model.className() + "APIController.php", + path: _this.apiControllerPath() + "/" + model.className() + "APIController.php", content: _pipe_dream_core_dist_pipe_dream_js__WEBPACK_IMPORTED_MODULE_0__["Template"]["for"]('APIController.php').replace({ ___MODEL___: model.className(), ___MODEL_INSTANCE___: _utilities_Formatter__WEBPACK_IMPORTED_MODULE_2__["default"].camelCase(model.className()), ___LOAD_RELATIONSHIPS___: _this.loadRelationships(model), - ___MODEL_NAMESPACE___: _this.modelNamespace() + ___MODEL_NAMESPACE___: _this.modelNamespace(), + ___API_CONTROLLER_PATH___: _this.apiControllerPath(), + ___API_CONTROLLER_NAMESPACE___: _this.apiControllerNamespace() }) }; }); @@ -6342,6 +6344,16 @@ function () { value: function modelNamespace() { return window.store.getters.settings['LaravelFileFactory']['Model namespace']['value']; } + }, { + key: "apiControllerPath", + value: function apiControllerPath() { + return window.store.getters.settings['LaravelFileFactory']['API path']['value']; + } + }, { + key: "apiControllerNamespace", + value: function apiControllerNamespace() { + return window.store.getters.settings['LaravelFileFactory']['API namespace']['value']; + } }], [{ key: "with", value: function _with(omc) { @@ -7814,7 +7826,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony default export */ - __webpack_exports__["default"] = "___LOAD_RELATIONSHIPS___);\n }\n\n public function store(Request $request)\n {\n return new ___MODEL___Resource(___MODEL___::create($request->all()));\n }\n\n public function update(Request $request, ___MODEL___ $___MODEL_INSTANCE___)\n {\n $___MODEL_INSTANCE___->update($request->all());\n\n return new ___MODEL___Resource($___MODEL_INSTANCE___);\n }\n\n public function destroy(Request $request, ___MODEL___ $___MODEL_INSTANCE___)\n {\n $___MODEL_INSTANCE___->delete();\n\n return response()->json([], \\Illuminate\\Http\\Response::HTTP_NO_CONTENT);\n }\n}\n"; + __webpack_exports__["default"] = "___LOAD_RELATIONSHIPS___);\n }\n\n public function store(Request $request)\n {\n return new ___MODEL___Resource(___MODEL___::create($request->all()));\n }\n\n public function update(Request $request, ___MODEL___ $___MODEL_INSTANCE___)\n {\n $___MODEL_INSTANCE___->update($request->all());\n\n return new ___MODEL___Resource($___MODEL_INSTANCE___);\n }\n\n public function destroy(Request $request, ___MODEL___ $___MODEL_INSTANCE___)\n {\n $___MODEL_INSTANCE___->delete();\n\n return response()->noContent();\n }\n}\n"; /***/ },