@stacksjs/actions 0.70.44 → 0.70.53

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.
Files changed (127) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/action.d.ts +104 -17
  3. package/dist/blog.d.ts +12 -0
  4. package/dist/build/frontend-static.d.ts +16 -0
  5. package/dist/chunk-00qp27jy.js +93 -0
  6. package/dist/{chunk-jd1yzkq5.js → chunk-23thftnv.js} +1 -1
  7. package/dist/chunk-4qzb8g3z.js +3 -0
  8. package/dist/chunk-5dfz9en9.js +920 -0
  9. package/dist/{chunk-3beht8ja.js → chunk-5hwp0frq.js} +1 -1
  10. package/dist/{chunk-aw6d8zr3.js → chunk-5pwpk005.js} +2 -2
  11. package/dist/chunk-604jy79b.js +5 -0
  12. package/dist/{chunk-wnrgcx3d.js → chunk-63swek9d.js} +2 -2
  13. package/dist/chunk-67am4dae.js +688 -0
  14. package/dist/{chunk-gt77jmb5.js → chunk-8gbewxns.js} +1 -1
  15. package/dist/chunk-8r76qydb.js +240 -0
  16. package/dist/{chunk-schcaf73.js → chunk-9x17v4x2.js} +2 -2
  17. package/dist/chunk-aazd6qpv.js +3 -0
  18. package/dist/{chunk-n2fd1d0m.js → chunk-ag4fy7cx.js} +1 -1
  19. package/dist/{chunk-2qchdrf9.js → chunk-badehrwa.js} +1 -1
  20. package/dist/chunk-dbz9dp2h.js +3 -0
  21. package/dist/{chunk-v0wnrnaa.js → chunk-e8505qz8.js} +2 -2
  22. package/dist/chunk-jv7ry09n.js +3 -0
  23. package/dist/{chunk-w418anbq.js → chunk-jve1p4dz.js} +2 -2
  24. package/dist/chunk-mcwfmqzb.js +283 -0
  25. package/dist/chunk-n24m8prb.js +3 -0
  26. package/dist/{chunk-h93n2j40.js → chunk-nm9h5rye.js} +2 -2
  27. package/dist/{chunk-60qjz7zb.js → chunk-ny1racy0.js} +2 -2
  28. package/dist/{chunk-2gh7kgpc.js → chunk-p601xr03.js} +1 -1
  29. package/dist/{chunk-x471rxrn.js → chunk-pqnzp7x8.js} +2 -2
  30. package/dist/chunk-rj1cbghx.js +17 -0
  31. package/dist/chunk-rzhs51h1.js +3 -0
  32. package/dist/{chunk-7bpdkc40.js → chunk-sp5cjdhd.js} +213 -76
  33. package/dist/chunk-tqax3gbq.js +16 -0
  34. package/dist/{chunk-c8qt2xst.js → chunk-vsj8ns4p.js} +1 -1
  35. package/dist/{chunk-rdajkt2s.js → chunk-x8nrbsk1.js} +2 -2
  36. package/dist/dev/dashboard-utils.d.ts +19 -1
  37. package/dist/dev/migrate-watcher.d.ts +1 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/make.d.ts +19 -0
  40. package/dist/queue/dlq-purge.d.ts +1 -0
  41. package/dist/queue/dlq-retry.d.ts +1 -0
  42. package/dist/queue/dlq.d.ts +1 -0
  43. package/dist/queue/list.d.ts +1 -0
  44. package/dist/queue/pause.d.ts +1 -0
  45. package/dist/queue/quarantine.d.ts +1 -0
  46. package/dist/queue/resume.d.ts +1 -0
  47. package/dist/queue/unquarantine.d.ts +1 -0
  48. package/dist/src/action.js +1 -1
  49. package/dist/src/actions.js +1 -1
  50. package/dist/src/add.js +1 -1
  51. package/dist/src/ai/request-model-access.js +1 -1
  52. package/dist/src/auth/setup.js +82 -24
  53. package/dist/src/blog.js +102 -0
  54. package/dist/src/build/core.js +1 -1
  55. package/dist/src/build/frontend-static.js +9 -0
  56. package/dist/src/build/views.js +1 -1
  57. package/dist/src/build.js +1 -1
  58. package/dist/src/commit.js +1 -1
  59. package/dist/src/database/seed.js +1 -1
  60. package/dist/src/deploy/index.js +38 -45
  61. package/dist/src/dev/api.js +4 -4
  62. package/dist/src/dev/dashboard-globals.js +1 -1
  63. package/dist/src/dev/dashboard-utils.js +1 -1
  64. package/dist/src/dev/dashboard.js +6 -6
  65. package/dist/src/dev/docs.js +1 -1
  66. package/dist/src/dev/index.js +1 -1
  67. package/dist/src/dev/migrate-watcher.js +2 -0
  68. package/dist/src/dev/views.js +1 -1
  69. package/dist/src/discover-packages.js +1 -1
  70. package/dist/src/examples.js +1 -1
  71. package/dist/src/generate/component-meta.js +1 -1
  72. package/dist/src/generate/env-files.js +1 -1
  73. package/dist/src/generate/ide-helpers.js +1 -1
  74. package/dist/src/generate/index.js +1 -1
  75. package/dist/src/generate/lib-entries.js +1 -1
  76. package/dist/src/generate/vscode-custom-data.js +1 -1
  77. package/dist/src/helpers/component-meta.js +1 -1
  78. package/dist/src/helpers/index.js +1 -1
  79. package/dist/src/helpers/lib-entries.js +1 -1
  80. package/dist/src/helpers/package-json.js +1 -1
  81. package/dist/src/helpers/utils.js +1 -1
  82. package/dist/src/helpers/vscode-custom-data.js +1 -1
  83. package/dist/src/index.js +1 -1
  84. package/dist/src/key-generate.js +1 -1
  85. package/dist/src/make-command.js +1 -1
  86. package/dist/src/make-job.js +1 -1
  87. package/dist/src/make-policy.js +1 -1
  88. package/dist/src/make-resource.js +1 -1
  89. package/dist/src/make.js +1 -1
  90. package/dist/src/migrate/fresh.js +1 -1
  91. package/dist/src/orm/base.js +1 -1
  92. package/dist/src/queue/dlq-purge.js +2 -0
  93. package/dist/src/queue/dlq-retry.js +2 -0
  94. package/dist/src/queue/dlq.js +5 -0
  95. package/dist/src/queue/failed.js +4 -4
  96. package/dist/src/queue/list.js +5 -0
  97. package/dist/src/queue/pause.js +2 -0
  98. package/dist/src/queue/quarantine.js +3 -0
  99. package/dist/src/queue/resume.js +2 -0
  100. package/dist/src/queue/unquarantine.js +2 -0
  101. package/dist/src/release.js +1 -1
  102. package/dist/src/run-action.js +1 -1
  103. package/dist/src/scaffold-crud.js +1 -1
  104. package/dist/src/serve/api.js +1 -1
  105. package/dist/src/setup/index.js +1 -1
  106. package/dist/src/setup/ssl.js +1 -1
  107. package/dist/src/stacks.js +1 -1
  108. package/dist/src/templates.js +1 -1
  109. package/dist/src/types.js +1 -1
  110. package/dist/src/upgrade/dependencies.js +1 -1
  111. package/dist/src/upgrade/framework-utils.js +1 -1
  112. package/dist/src/upgrade/framework.js +5 -5
  113. package/dist/src/upgrade/index.js +1 -1
  114. package/dist/src/upgrade.js +1 -1
  115. package/dist/upgrade/framework-utils.d.ts +48 -0
  116. package/package.json +18 -18
  117. package/dist/chunk-2kaj93p5.js +0 -3
  118. package/dist/chunk-3086k7zk.js +0 -184
  119. package/dist/chunk-67y94dzt.js +0 -658
  120. package/dist/chunk-6x1m5rkr.js +0 -17
  121. package/dist/chunk-96b7fcmd.js +0 -3
  122. package/dist/chunk-d4srk6ma.js +0 -3
  123. package/dist/chunk-kzhgexj4.js +0 -3
  124. package/dist/chunk-n1y0gpv6.js +0 -3
  125. package/dist/chunk-n2x7v39b.js +0 -5
  126. package/dist/chunk-tc935b45.js +0 -93
  127. package/dist/chunk-wv5yb5wb.js +0 -101
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.70.44",
4
+ "version": "0.70.53",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -54,27 +54,27 @@
54
54
  "prepublishOnly": "bun run build"
55
55
  },
56
56
  "dependencies": {
57
- "@stacksjs/bunpress": "^0.1.5",
58
- "@stacksjs/ts-cloud": "^0.2.15",
57
+ "@stacksjs/bunpress": "^0.1.11",
58
+ "@stacksjs/ts-cloud": "^0.7.12",
59
59
  "@stacksjs/ts-md": "^0.1.1"
60
60
  },
61
61
  "devDependencies": {
62
- "@stacksjs/api": "^0.70.44",
63
- "@stacksjs/cli": "^0.70.44",
64
- "@stacksjs/config": "^0.70.44",
65
- "@stacksjs/database": "^0.70.44",
62
+ "@stacksjs/api": "0.70.53",
63
+ "@stacksjs/cli": "0.70.53",
64
+ "@stacksjs/config": "0.70.53",
65
+ "@stacksjs/database": "0.70.53",
66
66
  "@stacksjs/tlsx": "^0.13.2",
67
67
  "better-dx": "^0.2.12",
68
- "@stacksjs/dns": "^0.70.44",
69
- "@stacksjs/enums": "^0.70.44",
70
- "@stacksjs/env": "^0.70.44",
71
- "@stacksjs/error-handling": "^0.70.44",
72
- "@stacksjs/logging": "^0.70.44",
73
- "@stacksjs/path": "^0.70.44",
74
- "@stacksjs/security": "^0.70.44",
75
- "@stacksjs/storage": "^0.70.44",
76
- "@stacksjs/strings": "^0.70.44",
77
- "@stacksjs/utils": "^0.70.44",
78
- "@stacksjs/validation": "^0.70.44"
68
+ "@stacksjs/dns": "0.70.53",
69
+ "@stacksjs/enums": "0.70.53",
70
+ "@stacksjs/env": "0.70.53",
71
+ "@stacksjs/error-handling": "0.70.53",
72
+ "@stacksjs/logging": "0.70.53",
73
+ "@stacksjs/path": "0.70.53",
74
+ "@stacksjs/security": "0.70.53",
75
+ "@stacksjs/storage": "0.70.53",
76
+ "@stacksjs/strings": "0.70.53",
77
+ "@stacksjs/utils": "0.70.53",
78
+ "@stacksjs/validation": "0.70.53"
79
79
  }
80
80
  }
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{existsSync as T,readdirSync as $,readFileSync as X,statSync as z,writeFileSync as J}from"fs";import{homedir as Q}from"os";import{join as Y,resolve as I}from"path";import A from"process";function m(q,B){let D=q.version;if(D)return{channel:"stable",ref:D.startsWith("v")?D:`v${D}`,targetVersion:D};if(q.canary)return{channel:"canary",ref:"canary"};if(q.stable)return{channel:"stable",ref:"main"};if(B==="canary")return{channel:"canary",ref:"canary"};return{channel:"stable",ref:"main"}}function F(q,B="storage/framework/core"){return`github:stacksjs/stacks#${q}/${B}`}function S(q){try{if(T(q))return JSON.parse(X(q,"utf-8")).version||null}catch{}return null}function v(q){try{if(T(q)){if(X(q,"utf-8").trim()==="canary")return"canary"}}catch{}return"stable"}function P(q,B){try{J(q,B,"utf-8")}catch{}}function g(q,B,D){if(q.targetVersion)return`Installing Stacks v${q.targetVersion.replace(/^v/,"")}...`;if(q.channel==="canary")return"Upgrading to the latest canary build...";if(D&&B==="canary")return"Switching back to the latest stable release...";return"Upgrading to the latest version..."}function w(q,B,D,G,H){if(q.targetVersion){let E=q.targetVersion.replace(/^v/,"");if(B===E&&!H)return`Stacks is already at v${E}`;if(B)return`Installed Stacks v${E} (was v${B})`;return`Installed Stacks v${E}`}if(B&&D&&B===D&&!H){if(q.channel==="canary")return`Stacks is already up to date (canary ${B})`;return`Stacks is already up to date (v${B})`}if(B&&D){let E=G==="canary"?`canary ${B}`:`v${B}`,K=q.channel==="canary"?`canary ${D}`:`v${D}`;return`Upgraded Stacks from ${E} to ${K}`}if(D)return`Upgraded Stacks to ${q.channel==="canary"?`canary ${D}`:`v${D}`}`;return`Upgraded Stacks to ${q.ref} (latest)`}var b=[{localPath:"storage/framework/core",subPath:"storage/framework/core",label:"core",skip:["node_modules","dist","bun.lock",".DS_Store"]},{localPath:"storage/framework/defaults",subPath:"storage/framework/defaults",label:"defaults",skip:["node_modules","dist",".DS_Store",".discovered-models.json"]},{localPath:"buddy",subPath:"buddy",label:"buddy",isFile:!0},{localPath:"bootstrap",subPath:"bootstrap",label:"bootstrap",isFile:!0}];function x(q){let B=[A.env.STACKS_LOCAL_PATH,I(q,"..","stacks"),I(q,"..","..","stacks"),I(Q(),"Code","stacks"),I(Q(),"code","stacks"),I(Q(),"projects","stacks"),I(Q(),"src","stacks")];for(let D of B){if(!D)continue;let G=Y(D,"storage","framework","core","buddy","package.json");try{if(T(G)&&I(D)!==I(q))return I(D)}catch{}}return null}async function f(q,B=[]){let D=new Map;if(!T(q))return D;let G=new Set(B),H=[{abs:q,rel:""}],E=[];while(H.length>0){let{abs:K,rel:M}=H.pop(),L;try{L=$(K)}catch{continue}for(let N of L){if(G.has(N))continue;let U=Y(K,N),W=M?`${M}/${N}`:N,O;try{O=z(U)}catch{continue}if(O.isDirectory())H.push({abs:U,rel:W});else if(O.isFile()){let Z=O.size;E.push((async()=>{let _=await C(U);D.set(W,{size:Z,hash:_})})())}}}return await Promise.all(E),D}function p(q,B){let D=0,G=0,H=0;for(let[K,M]of B){let L=q.get(K);if(!L)D++;else if(L.size!==M.size||L.hash!==M.hash)G++;else H++}let E=0;for(let K of q.keys())if(!B.has(K))E++;return{added:D,changed:G,removed:E,unchanged:H}}async function C(q){try{let B=await Bun.file(q).arrayBuffer();return Bun.hash(B)}catch{return 0n}}
3
- export{m as a,F as b,S as c,v as d,P as e,g as f,w as g,b as h,x as i,f as j,p as k};
@@ -1,184 +0,0 @@
1
- // @bun
2
- var b={action:`import { Action } from '@stacksjs/actions'
3
-
4
- export default new Action({
5
- name: '{0}',
6
- description: '{0} action',
7
-
8
- handle() {
9
- return 'Hello World action'
10
- },
11
- })`,actionWithValidation:`import { Action } from '@stacksjs/actions'
12
- import { schema, validate } from '@stacksjs/validation'
13
-
14
- export default new Action({
15
- name: '{0}',
16
- description: '{0} action',
17
-
18
- async handle(request) {
19
- // Replace these rules with whatever this action expects. The
20
- // returned object is typed to the rule shape; type-narrow further
21
- // by passing a generic to validate<Payload>().
22
- const data = await validate(request, {
23
- // example: title: schema.string().required().min(1),
24
- })
25
-
26
- return { ok: true, data }
27
- },
28
- })`,actionWithAuth:`import { Action } from '@stacksjs/actions'
29
-
30
- export default new Action({
31
- name: '{0}',
32
- description: '{0} action (authenticated)',
33
-
34
- async handle(request) {
35
- const user = await request.user()
36
- if (!user) {
37
- return new Response('Unauthorized', { status: 401 })
38
- }
39
-
40
- return { ok: true, userId: user.id }
41
- },
42
- })`,actionWithBoth:`import { Action } from '@stacksjs/actions'
43
- import { schema, validate } from '@stacksjs/validation'
44
-
45
- export default new Action({
46
- name: '{0}',
47
- description: '{0} action (authenticated + validated)',
48
-
49
- async handle(request) {
50
- const user = await request.user()
51
- if (!user) {
52
- return new Response('Unauthorized', { status: 401 })
53
- }
54
-
55
- const data = await validate(request, {
56
- // example: title: schema.string().required().min(1),
57
- })
58
-
59
- return { ok: true, userId: user.id, data }
60
- },
61
- })`,component:`<script setup lang="ts">
62
- console.log('Hello World component created')
63
- </script>
64
-
65
- <template>
66
- <div>
67
- Some HTML block
68
- </div>
69
- </template>`,page:`<script setup lang="ts">
70
- console.log('Hello World page created')
71
- </script>
72
-
73
- <template>
74
- <div>
75
- Visit http://127.0.0.1/{0}
76
- </div>
77
- </template>`,function:`// reactive state
78
- const {0} = ref(0)
79
-
80
- // functions that mutate state and trigger updates
81
- function increment() {
82
- {0}.value++
83
- }
84
-
85
- export {
86
- {0},
87
- increment,
88
- }`,language:`button:
89
- text: Copy`,notification:`import type { {0} } from '@stacksjs/types'
90
-
91
- function content(): string {
92
- return 'example'
93
- }
94
-
95
- function send(): {0} {
96
- return {
97
- content: content(),
98
- }
99
- }`,middleware:`import type { Request } from '@stacksjs/router'
100
- import { Middleware } from '@stacksjs/router'
101
-
102
- export default new Middleware({
103
- name: '{0}',
104
- priority: 1,
105
- async handle(request: Request) {
106
- // Your middleware logic here
107
- },
108
- })`,model:`import { defineModel } from '@stacksjs/orm'
109
- import { schema } from '@stacksjs/validation'
110
-
111
- export default defineModel({
112
- name: '{0}',
113
- table: '{1}',
114
- primaryKey: 'id',
115
- autoIncrement: true,
116
-
117
- traits: {
118
- useTimestamps: true,
119
-
120
- useSeeder: {
121
- count: 10,
122
- },
123
- },
124
-
125
- attributes: {
126
- // your attributes here
127
- },
128
- } as const)`,migration:`import type { Database } from '@stacksjs/database'
129
-
130
- export async function up(db: Database): Promise<void> {
131
- await db.schema
132
- .createTable('{0}')
133
- .addColumn('id', 'integer', col => col.autoIncrement().primaryKey())
134
- .execute()
135
- }`,stackPackageJson:`{
136
- "name": "{0}",
137
- "version": "0.0.1",
138
- "type": "module",
139
- "stacks": {
140
- "name": "{1}",
141
- "description": "A Stacks extension"
142
- }
143
- }`,job:`import { Job } from '@stacksjs/jobs'
144
-
145
- export default new Job({
146
- name: '{0}',
147
- description: '{0} job',
148
-
149
- async handle() {
150
- // Your job logic here
151
- console.log('Job executed')
152
- },
153
- })`,event:`import { Event } from '@stacksjs/events'
154
-
155
- export default new Event({
156
- name: '{0}',
157
- description: '{0} event',
158
-
159
- async handle(data: any) {
160
- // Your event handler logic here
161
- console.log('Event handled:', data)
162
- },
163
- })`,listener:`import { Listener } from '@stacksjs/events'
164
-
165
- export default new Listener({
166
- name: '{0}',
167
- description: '{0} listener',
168
-
169
- async handle(data: any) {
170
- // Your listener logic here
171
- console.log('Listener triggered:', data)
172
- },
173
- })`,command:`import { Command } from '@stacksjs/cli'
174
-
175
- export default new Command({
176
- name: '{0}',
177
- description: '{0} command',
178
-
179
- async handle() {
180
- // Your command logic here
181
- console.log('Command executed')
182
- },
183
- })`};
184
- export{b as aa};