@motiadev/plugin-endpoint 0.14.0-beta.165-634707 → 0.14.0-beta.165-198270
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.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/styles.css.map +1 -0
- package/dist/styles.js +0 -0
- package/package.json +4 -4
- package/dist/index.css.map +0 -1
- /package/dist/{index.css → styles.css} +0 -0
package/dist/plugin.js
CHANGED
|
@@ -68,7 +68,7 @@ function plugin({ lockedData }) {
|
|
|
68
68
|
lockedData.onStep("step-removed", apiStepRemoved);
|
|
69
69
|
return { workbench: [{
|
|
70
70
|
packageName: "@motiadev/plugin-endpoint",
|
|
71
|
-
cssImports: ["@motiadev/plugin-endpoint/dist/
|
|
71
|
+
cssImports: ["@motiadev/plugin-endpoint/dist/styles.css"],
|
|
72
72
|
label: "Endpoints",
|
|
73
73
|
position: "top",
|
|
74
74
|
componentName: "EndpointsPage",
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","names":["ApiRouteConfig","ApiRouteMethod","JsonSchema","LockedData","QueryParam","Step","StreamAdapter","ApiEndpoint","id","method","path","description","queryParams","responseSchema","bodySchema","flows","mapEndpoint","step","filePath","config","EndpointsStream","constructor","lockedData","get","_groupId","Promise","endpoint","apiSteps","find","delete","set","_","__","data","getGroup","map","isApiStep","MotiaPlugin","MotiaPluginContext","Step","EndpointsStream","mapEndpoint","plugin","lockedData","stream","createStream","filePath","hidden","config","name","baseConfig","storageType","factory","schema","apiStepCreated","step","set","id","method","path","description","queryParams","apiStepUpdated","apiStepRemoved","delete","onStep","workbench","packageName","cssImports","label","position","componentName","labelIcon","plugin"],"sources":["../src/api/endpoints-stream.ts","../src/api/index.ts","../src/plugin.ts"],"sourcesContent":["import {\n type ApiRouteConfig,\n type ApiRouteMethod,\n type JsonSchema,\n type LockedData,\n type QueryParam,\n type Step,\n StreamAdapter,\n} from '@motiadev/core'\n\ntype ApiEndpoint = {\n id: string\n method: ApiRouteMethod\n path: string\n description?: string\n queryParams?: QueryParam[]\n responseSchema?: JsonSchema\n bodySchema?: JsonSchema\n flows?: string[]\n}\n\nexport const mapEndpoint = (step: Step<ApiRouteConfig>): ApiEndpoint => {\n return {\n id: step.filePath,\n method: step.config.method,\n path: step.config.path,\n description: step.config.description,\n queryParams: step.config.queryParams,\n responseSchema: step.config.responseSchema as never as JsonSchema,\n bodySchema: step.config.bodySchema as never as JsonSchema,\n flows: step.config.flows,\n }\n}\n\nexport class EndpointsStream extends StreamAdapter<ApiEndpoint> {\n constructor(private readonly lockedData: LockedData) {\n super('__motia.api-endpoints')\n }\n\n async get(_groupId: string, id: string): Promise<ApiEndpoint | null> {\n const endpoint = this.lockedData.apiSteps().find((step) => step.filePath === id)\n return endpoint ? mapEndpoint(endpoint) : null\n }\n\n async delete(id: string): Promise<ApiEndpoint> {\n return { id } as never\n }\n\n async set(_: string, __: string, data: ApiEndpoint): Promise<ApiEndpoint> {\n return data\n }\n\n async getGroup(): Promise<ApiEndpoint[]> {\n return this.lockedData.apiSteps().map(mapEndpoint)\n }\n}\n","import { isApiStep, type MotiaPlugin, type MotiaPluginContext, type Step } from '@motiadev/core'\nimport { EndpointsStream, mapEndpoint } from './endpoints-stream'\n\nexport function plugin({ lockedData }: MotiaPluginContext): MotiaPlugin {\n const stream = lockedData.createStream({\n filePath: '__motia.api-endpoints.ts',\n hidden: true,\n config: {\n name: '__motia.api-endpoints',\n baseConfig: { storageType: 'custom', factory: () => new EndpointsStream(lockedData) },\n schema: null as never,\n },\n })()\n\n const apiStepCreated = (step: Step) => {\n if (isApiStep(step)) {\n stream.set('default', step.filePath, {\n id: step.filePath,\n method: step.config.method,\n path: step.config.path,\n description: step.config.description,\n queryParams: step.config.queryParams,\n })\n }\n }\n\n const apiStepUpdated = (step: Step) => {\n if (isApiStep(step)) {\n stream.set('default', step.filePath, mapEndpoint(step))\n }\n }\n\n const apiStepRemoved = (step: Step) => {\n if (isApiStep(step)) {\n stream.delete('default', step.filePath)\n }\n }\n\n lockedData.onStep('step-created', apiStepCreated)\n lockedData.onStep('step-updated', apiStepUpdated)\n lockedData.onStep('step-removed', apiStepRemoved)\n\n return {\n workbench: [\n {\n packageName: '@motiadev/plugin-endpoint',\n cssImports: ['@motiadev/plugin-endpoint/dist/
|
|
1
|
+
{"version":3,"file":"plugin.js","names":["ApiRouteConfig","ApiRouteMethod","JsonSchema","LockedData","QueryParam","Step","StreamAdapter","ApiEndpoint","id","method","path","description","queryParams","responseSchema","bodySchema","flows","mapEndpoint","step","filePath","config","EndpointsStream","constructor","lockedData","get","_groupId","Promise","endpoint","apiSteps","find","delete","set","_","__","data","getGroup","map","isApiStep","MotiaPlugin","MotiaPluginContext","Step","EndpointsStream","mapEndpoint","plugin","lockedData","stream","createStream","filePath","hidden","config","name","baseConfig","storageType","factory","schema","apiStepCreated","step","set","id","method","path","description","queryParams","apiStepUpdated","apiStepRemoved","delete","onStep","workbench","packageName","cssImports","label","position","componentName","labelIcon","plugin"],"sources":["../src/api/endpoints-stream.ts","../src/api/index.ts","../src/plugin.ts"],"sourcesContent":["import {\n type ApiRouteConfig,\n type ApiRouteMethod,\n type JsonSchema,\n type LockedData,\n type QueryParam,\n type Step,\n StreamAdapter,\n} from '@motiadev/core'\n\ntype ApiEndpoint = {\n id: string\n method: ApiRouteMethod\n path: string\n description?: string\n queryParams?: QueryParam[]\n responseSchema?: JsonSchema\n bodySchema?: JsonSchema\n flows?: string[]\n}\n\nexport const mapEndpoint = (step: Step<ApiRouteConfig>): ApiEndpoint => {\n return {\n id: step.filePath,\n method: step.config.method,\n path: step.config.path,\n description: step.config.description,\n queryParams: step.config.queryParams,\n responseSchema: step.config.responseSchema as never as JsonSchema,\n bodySchema: step.config.bodySchema as never as JsonSchema,\n flows: step.config.flows,\n }\n}\n\nexport class EndpointsStream extends StreamAdapter<ApiEndpoint> {\n constructor(private readonly lockedData: LockedData) {\n super('__motia.api-endpoints')\n }\n\n async get(_groupId: string, id: string): Promise<ApiEndpoint | null> {\n const endpoint = this.lockedData.apiSteps().find((step) => step.filePath === id)\n return endpoint ? mapEndpoint(endpoint) : null\n }\n\n async delete(id: string): Promise<ApiEndpoint> {\n return { id } as never\n }\n\n async set(_: string, __: string, data: ApiEndpoint): Promise<ApiEndpoint> {\n return data\n }\n\n async getGroup(): Promise<ApiEndpoint[]> {\n return this.lockedData.apiSteps().map(mapEndpoint)\n }\n}\n","import { isApiStep, type MotiaPlugin, type MotiaPluginContext, type Step } from '@motiadev/core'\nimport { EndpointsStream, mapEndpoint } from './endpoints-stream'\n\nexport function plugin({ lockedData }: MotiaPluginContext): MotiaPlugin {\n const stream = lockedData.createStream({\n filePath: '__motia.api-endpoints.ts',\n hidden: true,\n config: {\n name: '__motia.api-endpoints',\n baseConfig: { storageType: 'custom', factory: () => new EndpointsStream(lockedData) },\n schema: null as never,\n },\n })()\n\n const apiStepCreated = (step: Step) => {\n if (isApiStep(step)) {\n stream.set('default', step.filePath, {\n id: step.filePath,\n method: step.config.method,\n path: step.config.path,\n description: step.config.description,\n queryParams: step.config.queryParams,\n })\n }\n }\n\n const apiStepUpdated = (step: Step) => {\n if (isApiStep(step)) {\n stream.set('default', step.filePath, mapEndpoint(step))\n }\n }\n\n const apiStepRemoved = (step: Step) => {\n if (isApiStep(step)) {\n stream.delete('default', step.filePath)\n }\n }\n\n lockedData.onStep('step-created', apiStepCreated)\n lockedData.onStep('step-updated', apiStepUpdated)\n lockedData.onStep('step-removed', apiStepRemoved)\n\n return {\n workbench: [\n {\n packageName: '@motiadev/plugin-endpoint',\n cssImports: ['@motiadev/plugin-endpoint/dist/styles.css'],\n label: 'Endpoints',\n position: 'top',\n componentName: 'EndpointsPage',\n labelIcon: 'link-2',\n },\n ],\n }\n}\n","import { plugin } from './api'\n\nexport default plugin\n"],"mappings":";;;AAqBA,MAAagB,eAAeC,SAA4C;AACtE,QAAO;EACLT,IAAIS,KAAKC;EAC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AUL,YAAYc,KAAK,CAAC;;CAI3D,MAAMQ,kBAAkBR,SAAe;AACrC,MAAInB,UAAUmB,KAAK,CACjBX,QAAOoB,OAAO,WAAWT,KAAKT,SAAS;;AAI3CH,YAAWsB,OAAO,gBAAgBX,eAAe;AACjDX,YAAWsB,OAAO,gBAAgBH,eAAe;AACjDnB,YAAWsB,OAAO,gBAAgBF,eAAe;AAEjD,QAAO,EACLG,WAAW,CACT;EACEC,aAAa;EACbC,YAAY,CAAC,4CAA4C;EACzDC,OAAO;EACPC,UAAU;EACVC,eAAe;EACfC,WAAW;EACZ,CAAA,EAEJ;;;;;ACnDH,qBAAeC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.css","names":[],"sources":["../src/styles.css"],"sourcesContent":["export default undefined;"],"mappings":"AAAA"}
|
package/dist/styles.js
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motiadev/plugin-endpoint",
|
|
3
|
-
"version": "0.14.0-beta.165-
|
|
3
|
+
"version": "0.14.0-beta.165-198270",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"zustand": "^5.0.8"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@motiadev/core": "0.14.0-beta.165-
|
|
28
|
-
"@motiadev/
|
|
29
|
-
"@motiadev/
|
|
27
|
+
"@motiadev/core": "0.14.0-beta.165-198270",
|
|
28
|
+
"@motiadev/ui": "0.14.0-beta.165-198270",
|
|
29
|
+
"@motiadev/stream-client-react": "0.14.0-beta.165-198270"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@rollup/plugin-babel": "^6.1.0",
|
package/dist/index.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.css","names":[],"sources":["../src/styles.css"],"sourcesContent":["export default undefined;"],"mappings":"AAAA"}
|
|
File without changes
|