diff --git a/.github/workflows/registry-publish.yml b/.github/workflows/registry-publish.yml new file mode 100644 index 0000000..3e4abe2 --- /dev/null +++ b/.github/workflows/registry-publish.yml @@ -0,0 +1,36 @@ +name: publish package to serverless-hub + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + pip install requests + - name: NPM install + run: | + npm install --production + - name: Add publish file + run: | + wget https://serverless-registry.oss-cn-hangzhou.aliyuncs.com/publish-file/python3/hub-publish.py + ls + - name: Publish package + env: + publish_token: ${{ secrets.alibaba_registry_publish_token }} + run: | + ls + python hub-publish.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6155cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +.s +.DS_Store \ No newline at end of file diff --git a/hook/index.js b/hook/index.js new file mode 100644 index 0000000..099f7a5 --- /dev/null +++ b/hook/index.js @@ -0,0 +1,12 @@ +async function preInit(inputObj) { + +} + +async function postInit(inputObj) { + +} + +module.exports = { + postInit, + preInit +} diff --git a/publish.yaml b/publish.yaml new file mode 100644 index 0000000..2e65af1 --- /dev/null +++ b/publish.yaml @@ -0,0 +1,27 @@ + +Type: Application +Name: fc-stable-diffusion +Provider: + - 阿里云 +Version: 0.0.1 +Description: 简短的描述/介绍 +HomePage: 项目首页地址 +Tags: #标签详情 + - 部署函数 +Category: Web框架 +Service: # 使用的服务 + 函数计算: # + # Runtime: Python 3.6 如果服务是函数,还需要增加Runtime + Authorities: #权限描述 + - 创建函数 # 所需要的权限 +Parameters: + type: object + additionalProperties: false # 不允许增加其他属性 + required: # 必填项 + - region + properties: + access: + title: 访问秘钥 + type: string + default: default + description: \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/readme_en.md b/readme_en.md new file mode 100644 index 0000000..e69de29 diff --git a/src/code/.env b/src/code/.env new file mode 100644 index 0000000..553a5b2 --- /dev/null +++ b/src/code/.env @@ -0,0 +1 @@ +proxyUrl= \ No newline at end of file diff --git a/src/code/LICENSE b/src/code/LICENSE new file mode 100644 index 0000000..b96dcb0 --- /dev/null +++ b/src/code/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/code/README.md b/src/code/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/code/bootstrap b/src/code/bootstrap new file mode 100644 index 0000000..37401a8 --- /dev/null +++ b/src/code/bootstrap @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export PORT=4000 +npm run serverprod \ No newline at end of file diff --git a/src/code/build/index.html b/src/code/build/index.html new file mode 100644 index 0000000..adab201 --- /dev/null +++ b/src/code/build/index.html @@ -0,0 +1,39 @@ +
\ No newline at end of file diff --git a/src/code/build/main.js b/src/code/build/main.js new file mode 100644 index 0000000..bedd6a8 --- /dev/null +++ b/src/code/build/main.js @@ -0,0 +1,3 @@ +/*! For license information please see main.js.LICENSE.txt */ +(()=>{var e={117:(e,t,n)=>{"use strict";function r(e,t,n,r,a,l,o){try{var u=e[l](o),i=u.value}catch(e){return void n(e)}u.done?t(i):Promise.resolve(i).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,l){var o=e.apply(t,n);function u(e){r(o,a,l,u,i,"next",e)}function i(e){r(o,a,l,u,i,"throw",e)}u(void 0)}))}}n.r(t),n.d(t,{useRefresh:()=>f,useServerResponse:()=>d});var l=n(294),o=n(904);function u(){u=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",i=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,a){var l=t&&t.prototype instanceof p?t:p,o=Object.create(l.prototype),u=new C(a||[]);return r(o,"_invoke",{value:S(e,n,u)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d={};function p(){}function h(){}function m(){}var v={};s(v,l,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(P([])));y&&y!==t&&n.call(y,l)&&(v=y);var b=m.prototype=p.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function a(r,l,o,u){var i=f(e[r],e,l);if("throw"!==i.type){var s=i.arg,c=s.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){a("next",e,o,u)}),(function(e){a("throw",e,o,u)})):t.resolve(c).then((function(e){s.value=e,o(s)}),(function(e){return a("throw",e,o,u)}))}u(i.arg)}var l;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return l=l?l.then(r,r):r()}})}function S(e,t,n){var r="suspendedStart";return function(a,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw l;return{value:void 0,done:!0}}for(n.method=a,n.arg=l;;){var o=n.delegate;if(o){var u=x(o,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var i=f(e,t,n);if("normal"===i.type){if(r=n.done?"completed":"suspendedYield",i.arg===d)continue;return{value:i.arg,done:n.done}}"throw"===i.type&&(r="completed",n.method="throw",n.arg=i.arg)}}}function x(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var l=a.arg;return l?l.done?(t[e.resultName]=l.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function P(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r=0;--a){var l=this.tryEntries[a],o=l.completion;if("root"===l.tryLoc)return r("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),i=n.call(l,"finallyLoc");if(u&&i){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;E(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function i(){return new Map}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text/javascript",n=arguments.length>2?arguments[2]:void 0,r=document.createElement("script");r.type=t,r.src=e,r.crossOrigin="anonymous",n&&(r.onload=n),document.body.appendChild(r)}var c=["/javascript/aspectRatioOverlay.js","/javascript/contextMenus.js","/javascript/dragdrop.js","/javascript/edit-attention.js","/javascript/extensions.js","/javascript/extraNetworks.js","/javascript/generationParams.js","/javascript/hints.js","/javascript/hires_fix.js","/javascript/imageMaskFix.js","/javascript/imageParams.js","/javascript/imageviewer.js","/javascript/localization.js","/javascript/notification.js","/javascript/progressbar.js","/javascript/textualInversion.js","/javascript/ui.js","/extensions/deforum/javascript/deforum-hints.js","/extensions/deforum/javascript/deforum.js","/extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js"];function f(){var e=(0,l.unstable_useCacheRefresh)();return function(t,n){e(i,new Map([[t,n]]))}}function d(e){var t=JSON.stringify(e),n=(0,l.unstable_getCacheForType)(i),r=n.get(t);return r||(r=(0,o.createFromFetch)(fetch("/react?location="+encodeURIComponent(t))),n.set(t,r),setTimeout(a(u().mark((function e(){var t,n,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/proxyUrl");case 2:return t=e.sent,e.next=5,t.json();case 5:n=e.sent,r=n.proxyUrl,s("".concat(r,"/assets/index.4395ab38.js"),"module"),c.forEach((function(e){s(e)}));case 9:case"end":return e.stop()}}),e)}))),1e3),r)}},543:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LocationContext:()=>a,useLocation:()=>l});var r=n(294),a=(0,r.createContext)();function l(){return(0,r.useContext)(a)}},391:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nc});var a=n(294),l=n(800),o=n(117),u=n(543),i=n(893);function s(){return(0,i.jsxs)("div",{className:"loading",children:[(0,i.jsx)("h1",{children:"ServerlessDevs欢迎你"}),(0,i.jsx)("div",{className:"image-placeholder"}),(0,i.jsx)("p",{className:"loading-text",children:"程序正在加载中,请稍后"})]})}function c(e){return e.initialCache,(0,i.jsx)(a.Suspense,{fallback:null,children:(0,i.jsx)(l.ErrorBoundary,{FallbackComponent:p,children:(0,i.jsx)(f,{})})})}function f(){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)(s,{}),children:(0,i.jsx)(d,{})})}function d(){var e,t,n=(e=(0,a.useState)({selectedId:null,isEditing:!1,searchText:""}),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,l=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw l}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=n[0],s=n[1],c=(0,o.useServerResponse)(l);return(0,i.jsx)(u.LocationContext.Provider,{value:[l,s],children:c.readRoot()})}function p(e){var t=e.error;return(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{children:"Application Error"}),(0,i.jsx)("pre",{style:{whiteSpace:"pre-wrap"},children:t.stack})]})}},87:(e,t,n)=>{"use strict";n.r(t);var r=n(935),a=n(391),l=n(893),o=new Map;(0,r.createRoot)(document.getElementById("client")).render((0,l.jsx)(a.default,{initialCache:o}))},418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var l,o,u=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i{"use strict";var r=n(418),a=n(294),l=n(840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n