@motiadev/plugin-states 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 CHANGED
@@ -72,7 +72,7 @@ function plugin(motia) {
72
72
  api(motia);
73
73
  return { workbench: [{
74
74
  packageName: "@motiadev/plugin-states",
75
- cssImports: ["@motiadev/plugin-states/dist/index.css"],
75
+ cssImports: ["@motiadev/plugin-states/dist/styles.css"],
76
76
  label: "States",
77
77
  position: "bottom",
78
78
  componentName: "StatesPage",
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","names":["ApiRequest","ApiResponse","FlowContext","MotiaPluginContext","api","motia","registerApi","method","path","req","Promise","groupId","queryParams","filter","JSON","parse","undefined","items","state","status","body","Record","error","Error","message","ctx","key","value","set","id","ids","keyParts","split","join","delete","MotiaPlugin","MotiaPluginContext","api","plugin","motia","workbench","packageName","cssImports","label","position","componentName","labelIcon"],"sources":["../src/api.ts","../src/plugin.ts"],"sourcesContent":["import type { ApiRequest, ApiResponse, FlowContext, MotiaPluginContext } from '@motiadev/core'\n\nexport const api = (motia: MotiaPluginContext): void => {\n motia.registerApi(\n {\n method: 'GET',\n path: '/__motia/state',\n },\n async (req: ApiRequest): Promise<ApiResponse> => {\n try {\n const groupId = req.queryParams.groupId as string | undefined\n const filter = req.queryParams.filter ? JSON.parse(req.queryParams.filter as string) : undefined\n const items = await motia.state.items({ groupId, filter })\n\n return {\n status: 200,\n body: items as unknown as Record<string, unknown>,\n }\n } catch (error: unknown) {\n return {\n status: 500,\n body: { error: error instanceof Error ? error.message : 'Unknown error' },\n }\n }\n },\n )\n\n motia.registerApi(\n {\n method: 'POST',\n path: '/__motia/state',\n },\n async (req: ApiRequest, ctx: FlowContext): Promise<ApiResponse> => {\n try {\n const { key, groupId, value } = req.body as { key: string; groupId: string; value: any }\n await ctx.state.set(groupId, key, value)\n return {\n status: 200,\n body: { key, groupId, value },\n }\n } catch (error: unknown) {\n return {\n status: 500,\n body: { error: error instanceof Error ? error.message : 'Unknown error' },\n }\n }\n },\n )\n\n motia.registerApi(\n {\n method: 'POST',\n path: '/__motia/state/delete',\n },\n async (req: ApiRequest, ctx: FlowContext): Promise<ApiResponse> => {\n try {\n for (const id of (req.body as { ids: string[] }).ids) {\n const [groupId, ...keyParts] = id.split(':')\n const key = keyParts.join(':')\n await ctx.state.delete(groupId, key)\n }\n\n return {\n status: 204,\n body: '',\n }\n } catch (error: unknown) {\n return {\n status: 500,\n body: { error: error instanceof Error ? error.message : 'Unknown error' },\n }\n }\n },\n )\n}\n","import type { MotiaPlugin, MotiaPluginContext } from '@motiadev/core'\nimport { api } from './api'\n\nexport default function plugin(motia: MotiaPluginContext): MotiaPlugin {\n api(motia)\n\n return {\n workbench: [\n {\n packageName: '@motiadev/plugin-states',\n cssImports: ['@motiadev/plugin-states/dist/index.css'],\n label: 'States',\n position: 'bottom',\n componentName: 'StatesPage',\n labelIcon: 'file',\n },\n ],\n }\n}\n"],"mappings":";AAEA,MAAaI,OAAOC,UAAoC;AACtDA,OAAMC,YACJ;EACEC,QAAQ;EACRC,MAAM;EACP,EACD,OAAOC,QAA0C;AAC/C,MAAI;GACF,MAAME,UAAUF,IAAIG,YAAYD;GAChC,MAAME,SAASJ,IAAIG,YAAYC,SAASC,KAAKC,MAAMN,IAAIG,YAAYC,OAAiB,GAAGG;AAGvF,UAAO;IACLG,QAAQ;IACRC,MAJY,MAAMf,MAAMa,MAAMD,MAAM;KAAEN;KAASE;KAAQ,CAAC;IAKzD;WACMS,OAAgB;AACvB,UAAO;IACLH,QAAQ;IACRC,MAAM,EAAEE,OAAOA,iBAAiBC,QAAQD,MAAME,UAAU,iBAAgB;IACzE;;GAGN;AAEDnB,OAAMC,YACJ;EACEC,QAAQ;EACRC,MAAM;EACP,EACD,OAAOC,KAAiBgB,QAA2C;AACjE,MAAI;GACF,MAAM,EAAEC,KAAKf,SAASgB,UAAUlB,IAAIW;AACpC,SAAMK,IAAIP,MAAMU,IAAIjB,SAASe,KAAKC,MAAM;AACxC,UAAO;IACLR,QAAQ;IACRC,MAAM;KAAEM;KAAKf;KAASgB;KAAM;IAC7B;WACML,OAAgB;AACvB,UAAO;IACLH,QAAQ;IACRC,MAAM,EAAEE,OAAOA,iBAAiBC,QAAQD,MAAME,UAAU,iBAAgB;IACzE;;GAGN;AAEDnB,OAAMC,YACJ;EACEC,QAAQ;EACRC,MAAM;EACP,EACD,OAAOC,KAAiBgB,QAA2C;AACjE,MAAI;AACF,QAAK,MAAMI,MAAOpB,IAAIW,KAA2BU,KAAK;IACpD,MAAM,CAACnB,SAAS,GAAGoB,YAAYF,GAAGG,MAAM,IAAI;IAC5C,MAAMN,MAAMK,SAASE,KAAK,IAAI;AAC9B,UAAMR,IAAIP,MAAMgB,OAAOvB,SAASe,IAAI;;AAGtC,UAAO;IACLP,QAAQ;IACRC,MAAM;IACP;WACME,OAAgB;AACvB,UAAO;IACLH,QAAQ;IACRC,MAAM,EAAEE,OAAOA,iBAAiBC,QAAQD,MAAME,UAAU,iBAAgB;IACzE;;GAGN;;;;;ACtEH,SAAwBc,OAAOC,OAAwC;AACrEF,KAAIE,MAAM;AAEV,QAAO,EACLC,WAAW,CACT;EACEC,aAAa;EACbC,YAAY,CAAC,yCAAyC;EACtDC,OAAO;EACPC,UAAU;EACVC,eAAe;EACfC,WAAW;EACZ,CAAA,EAEJ"}
1
+ {"version":3,"file":"plugin.js","names":["ApiRequest","ApiResponse","FlowContext","MotiaPluginContext","api","motia","registerApi","method","path","req","Promise","groupId","queryParams","filter","JSON","parse","undefined","items","state","status","body","Record","error","Error","message","ctx","key","value","set","id","ids","keyParts","split","join","delete","MotiaPlugin","MotiaPluginContext","api","plugin","motia","workbench","packageName","cssImports","label","position","componentName","labelIcon"],"sources":["../src/api.ts","../src/plugin.ts"],"sourcesContent":["import type { ApiRequest, ApiResponse, FlowContext, MotiaPluginContext } from '@motiadev/core'\n\nexport const api = (motia: MotiaPluginContext): void => {\n motia.registerApi(\n {\n method: 'GET',\n path: '/__motia/state',\n },\n async (req: ApiRequest): Promise<ApiResponse> => {\n try {\n const groupId = req.queryParams.groupId as string | undefined\n const filter = req.queryParams.filter ? JSON.parse(req.queryParams.filter as string) : undefined\n const items = await motia.state.items({ groupId, filter })\n\n return {\n status: 200,\n body: items as unknown as Record<string, unknown>,\n }\n } catch (error: unknown) {\n return {\n status: 500,\n body: { error: error instanceof Error ? error.message : 'Unknown error' },\n }\n }\n },\n )\n\n motia.registerApi(\n {\n method: 'POST',\n path: '/__motia/state',\n },\n async (req: ApiRequest, ctx: FlowContext): Promise<ApiResponse> => {\n try {\n const { key, groupId, value } = req.body as { key: string; groupId: string; value: any }\n await ctx.state.set(groupId, key, value)\n return {\n status: 200,\n body: { key, groupId, value },\n }\n } catch (error: unknown) {\n return {\n status: 500,\n body: { error: error instanceof Error ? error.message : 'Unknown error' },\n }\n }\n },\n )\n\n motia.registerApi(\n {\n method: 'POST',\n path: '/__motia/state/delete',\n },\n async (req: ApiRequest, ctx: FlowContext): Promise<ApiResponse> => {\n try {\n for (const id of (req.body as { ids: string[] }).ids) {\n const [groupId, ...keyParts] = id.split(':')\n const key = keyParts.join(':')\n await ctx.state.delete(groupId, key)\n }\n\n return {\n status: 204,\n body: '',\n }\n } catch (error: unknown) {\n return {\n status: 500,\n body: { error: error instanceof Error ? error.message : 'Unknown error' },\n }\n }\n },\n )\n}\n","import type { MotiaPlugin, MotiaPluginContext } from '@motiadev/core'\nimport { api } from './api'\n\nexport default function plugin(motia: MotiaPluginContext): MotiaPlugin {\n api(motia)\n\n return {\n workbench: [\n {\n packageName: '@motiadev/plugin-states',\n cssImports: ['@motiadev/plugin-states/dist/styles.css'],\n label: 'States',\n position: 'bottom',\n componentName: 'StatesPage',\n labelIcon: 'file',\n },\n ],\n }\n}\n"],"mappings":";AAEA,MAAaI,OAAOC,UAAoC;AACtDA,OAAMC,YACJ;EACEC,QAAQ;EACRC,MAAM;EACP,EACD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F,KAAIE,MAAM;AAEV,QAAO,EACLC,WAAW,CACT;EACEC,aAAa;EACbC,YAAY,CAAC,0CAA0C;EACvDC,OAAO;EACPC,UAAU;EACVC,eAAe;EACfC,WAAW;EACZ,CAAA,EAEJ"}
@@ -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-states",
3
- "version": "0.14.0-beta.165-634707",
3
+ "version": "0.14.0-beta.165-198270",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "zustand": "^5.0.8"
21
21
  },
22
22
  "peerDependencies": {
23
- "@motiadev/core": "0.14.0-beta.165-634707",
24
- "@motiadev/ui": "0.14.0-beta.165-634707"
23
+ "@motiadev/core": "0.14.0-beta.165-198270",
24
+ "@motiadev/ui": "0.14.0-beta.165-198270"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@bosh-code/tsdown-plugin-inject-css": "^2.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.css","names":[],"sources":["../src/styles.css"],"sourcesContent":["export default undefined;"],"mappings":"AAAA"}
File without changes