@stacksjs/actions 0.61.24 → 0.62.0

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/upgrade.js CHANGED
@@ -7,7 +7,7 @@ import {log} from "@stacksjs/logging";
7
7
  import {projectPath} from "@stacksjs/path";
8
8
  import * as storage from "@stacksjs/storage";
9
9
  // package.json
10
- var version = "0.61.24";
10
+ var version = "0.62.0";
11
11
 
12
12
  // src/upgrade.ts
13
13
  function checkForUncommittedChanges(options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.61.24",
4
+ "version": "0.62.0",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -68,7 +68,7 @@
68
68
  "@stacksjs/utils": "latest",
69
69
  "@stacksjs/validation": "latest",
70
70
  "markdown-it": "^14.1.0",
71
- "vue-component-meta": "^2.0.19"
71
+ "vue-component-meta": "^2.0.26"
72
72
  },
73
73
  "dependencies": {
74
74
  "@stacksjs/cli": "latest",
@@ -86,7 +86,7 @@
86
86
  "@stacksjs/utils": "latest",
87
87
  "@stacksjs/validation": "latest",
88
88
  "markdown-it": "^14.1.0",
89
- "vue-component-meta": "^2.0.19"
89
+ "vue-component-meta": "^2.0.26"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@stacksjs/development": "latest"
package/src/action.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { JobOptions, Nullable } from '@stacksjs/types'
2
2
  import type { ValidationBoolean, ValidationNumber, ValidationString } from '@stacksjs/validation'
3
+ import type { ModelRequest } from '../../../types/requests'
3
4
 
4
5
  type ValidationKey = string
5
6
  interface ValidationValue {
@@ -7,12 +8,6 @@ interface ValidationValue {
7
8
  message: string
8
9
  }
9
10
 
10
- // TODO: this is temporary and will get auto generated based on ./app/Actions/*
11
- interface Request {
12
- message: string
13
- level: 'info' | 'warn' | 'error'
14
- }
15
-
16
11
  interface ActionOptions {
17
12
  name?: string
18
13
  description?: string
@@ -24,7 +19,7 @@ interface ActionOptions {
24
19
  tries?: JobOptions['tries']
25
20
  backoff?: JobOptions['backoff']
26
21
  enabled?: JobOptions['enabled']
27
- handle: (request?: Request) => Promise<any> | object | string
22
+ handle: (request: ModelRequest) => Promise<any> | object | string
28
23
  }
29
24
 
30
25
  export class Action {
@@ -37,7 +32,7 @@ export class Action {
37
32
  path?: ActionOptions['path']
38
33
  method?: ActionOptions['method']
39
34
  validations?: Record<ValidationKey, ValidationValue>
40
- handle: (request?: Request) => Promise<any> | object | string
35
+ handle: (request: ModelRequest) => Promise<any> | object | string
41
36
 
42
37
  constructor({ name, description, validations, handle, rate, tries, backoff, enabled, path, method }: ActionOptions) {
43
38
  // log.debug(`Action ${name} created`) // TODO: this does not yet work because the cloud does not yet have proper file system (efs) access
@@ -27,10 +27,10 @@ export async function runAction(action: Action, options?: ActionOptions) {
27
27
  for await (const file of glob.scan(scanOptions)) {
28
28
  log.debug('file', file)
29
29
  if (file === `${action}.ts` || file.endsWith(`${action}.ts`))
30
- return ((await import(p.userActionsPath(file))).default as ActionType).handle()
30
+ return ((await import(/* @vite-ignore */ p.userActionsPath(file))).default as ActionType).handle()
31
31
 
32
32
  // if a custom model name is used, we need to check for it
33
- const a = await import(p.userActionsPath(file))
33
+ const a = await import(/* @vite-ignore */ p.userActionsPath(file))
34
34
  if (a.name === action) return await a.handle()
35
35
  }
36
36