@motiadev/plugin-endpoint 0.8.6-beta.143 → 0.8.6-beta.144-481431
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.js +9 -9
- package/package.json +4 -4
package/dist/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("@motiadev/core"),s=e=>({id:e.filePath,method:e.config.method,path:e.config.path,description:e.config.description,queryParams:e.config.queryParams,responseSchema:e.config.responseSchema,bodySchema:e.config.bodySchema,flows:e.config.flows});class
|
|
1
|
+
"use strict";const a=require("@motiadev/core"),s=e=>({id:e.filePath,method:e.config.method,path:e.config.path,description:e.config.description,queryParams:e.config.queryParams,responseSchema:e.config.responseSchema,bodySchema:e.config.bodySchema,flows:e.config.flows});class p extends a.StreamAdapter{constructor(n){super("__motia.api-endpoints"),this.lockedData=n}async get(n,o){const i=this.lockedData.apiSteps().find(r=>r.filePath===o);return i?s(i):null}async delete(n){return{id:n}}async set(n,o,i){return i}async getGroup(){return this.lockedData.apiSteps().map(s)}}function c({lockedData:e}){const n=e.createStream({filePath:"__motia.api-endpoints.ts",hidden:!0,config:{name:"__motia.api-endpoints",baseConfig:{storageType:"custom",factory:()=>new p(e)},schema:null}})(),o=t=>{a.isApiStep(t)&&n.set("default",t.filePath,{id:t.filePath,method:t.config.method,path:t.config.path,description:t.config.description,queryParams:t.config.queryParams})},i=t=>{a.isApiStep(t)&&n.set("default",t.filePath,s(t))},r=t=>{a.isApiStep(t)&&n.delete("default",t.filePath)};return e.onStep("step-created",o),e.onStep("step-updated",i),e.onStep("step-removed",r),{workbench:[{packageName:"@motiadev/plugin-endpoint",cssImports:["@motiadev/plugin-endpoint/dist/plugin-endpoint.css"],label:"Endpoints",position:"top",componentName:"EndpointsPage",labelIcon:"link-2"}]}}module.exports=c;
|
package/dist/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StreamAdapter as d, isApiStep as r } from "@motiadev/core";
|
|
2
|
-
const
|
|
2
|
+
const p = (e) => ({
|
|
3
3
|
id: e.filePath,
|
|
4
4
|
method: e.config.method,
|
|
5
5
|
path: e.config.path,
|
|
@@ -9,13 +9,13 @@ const c = (e) => ({
|
|
|
9
9
|
bodySchema: e.config.bodySchema,
|
|
10
10
|
flows: e.config.flows
|
|
11
11
|
});
|
|
12
|
-
class
|
|
12
|
+
class s extends d {
|
|
13
13
|
constructor(n) {
|
|
14
|
-
super(), this.lockedData = n;
|
|
14
|
+
super("__motia.api-endpoints"), this.lockedData = n;
|
|
15
15
|
}
|
|
16
16
|
async get(n, o) {
|
|
17
17
|
const i = this.lockedData.apiSteps().find((a) => a.filePath === o);
|
|
18
|
-
return i ?
|
|
18
|
+
return i ? p(i) : null;
|
|
19
19
|
}
|
|
20
20
|
async delete(n) {
|
|
21
21
|
return { id: n };
|
|
@@ -24,16 +24,16 @@ class p extends d {
|
|
|
24
24
|
return i;
|
|
25
25
|
}
|
|
26
26
|
async getGroup() {
|
|
27
|
-
return this.lockedData.apiSteps().map(
|
|
27
|
+
return this.lockedData.apiSteps().map(p);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function m({ lockedData: e }) {
|
|
31
31
|
const n = e.createStream({
|
|
32
32
|
filePath: "__motia.api-endpoints.ts",
|
|
33
33
|
hidden: !0,
|
|
34
34
|
config: {
|
|
35
35
|
name: "__motia.api-endpoints",
|
|
36
|
-
baseConfig: { storageType: "custom", factory: () => new
|
|
36
|
+
baseConfig: { storageType: "custom", factory: () => new s(e) },
|
|
37
37
|
schema: null
|
|
38
38
|
}
|
|
39
39
|
})(), o = (t) => {
|
|
@@ -45,7 +45,7 @@ function f({ lockedData: e }) {
|
|
|
45
45
|
queryParams: t.config.queryParams
|
|
46
46
|
});
|
|
47
47
|
}, i = (t) => {
|
|
48
|
-
r(t) && n.set("default", t.filePath,
|
|
48
|
+
r(t) && n.set("default", t.filePath, p(t));
|
|
49
49
|
}, a = (t) => {
|
|
50
50
|
r(t) && n.delete("default", t.filePath);
|
|
51
51
|
};
|
|
@@ -63,5 +63,5 @@ function f({ lockedData: e }) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
m as default
|
|
67
67
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motiadev/plugin-endpoint",
|
|
3
|
-
"version": "0.8.6-beta.
|
|
3
|
+
"version": "0.8.6-beta.144-481431",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"zustand": "^5.0.8"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@motiadev/core": "0.8.6-beta.
|
|
35
|
-
"@motiadev/
|
|
36
|
-
"@motiadev/
|
|
34
|
+
"@motiadev/core": "0.8.6-beta.144-481431",
|
|
35
|
+
"@motiadev/stream-client-react": "0.8.6-beta.144-481431",
|
|
36
|
+
"@motiadev/ui": "0.8.6-beta.144-481431"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@tailwindcss/vite": "^4.1.14",
|