@stacksjs/buddy 0.75.28 → 0.75.30

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.
@@ -0,0 +1,6 @@
1
+ /** Preserve CAC's negated booleans when forwarding auth:prune to its action. */
2
+ export declare function authPruneActionOptions<T extends AuthPruneFlags>(options: T): T & Record<'no-expired' | 'no-revoked', boolean>;
3
+ export declare interface AuthPruneFlags {
4
+ expired?: boolean
5
+ revoked?: boolean
6
+ }
@@ -0,0 +1 @@
1
+ export function authPruneActionOptions(options){return{...options,"no-expired":options.expired===!1,"no-revoked":options.revoked===!1}}
@@ -1 +1 @@
1
- import process from"node:process";import{runAction}from"@stacksjs/actions";import{intro,log,onUnknownSubcommand,outro}from"@stacksjs/cli";import{Action}from"@stacksjs/enums";import{ExitCode}from"@stacksjs/types";import{resultFailed}from"../result";export function auth(buddy){const descriptions={setup:"Set up authentication (migrations + personal access client)",token:"Create a personal access client token",client:"Create a new OAuth client",prune:"Prune expired and revoked tokens",project:"Target a specific project",verbose:"Enable verbose output"};buddy.command("auth:setup",descriptions.setup).option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:setup` ...",options);const perf=await intro("buddy auth:setup"),result=await runAction(Action.AuthSetup,options);if(resultFailed(result)){await outro("While setting up authentication, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("Authentication setup completed successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});buddy.command("auth:token",descriptions.token).option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:token` ...",options);const perf=await intro("buddy auth:token"),result=await runAction(Action.CreatePersonalAccessClient,options);if(resultFailed(result)){await outro("While creating the personal access client token, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("Personal access client token created successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});buddy.command("auth:client",descriptions.client).option("-n, --name [name]","Client name",{default:"OAuth Client"}).option("-r, --redirect [redirect]","Redirect URI",{default:"http://localhost"}).option("--personal","Create a personal access client",{default:!1}).option("--password","Create a password grant client",{default:!1}).option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:client` ...",options);const perf=await intro("buddy auth:client"),result=await runAction(Action.AuthClient,options);if(resultFailed(result)){await outro("While creating the OAuth client, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("OAuth client created successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});buddy.command("auth:prune",descriptions.prune).option("--expired","Prune expired tokens (default: true)",{default:!0}).option("--revoked","Prune revoked tokens (default: true)",{default:!0}).option("-d, --days [days]","Prune revoked tokens older than N days",{default:7}).option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:prune` ...",options);const perf=await intro("buddy auth:prune"),result=await runAction(Action.AuthPrune,options);if(resultFailed(result)){await outro("While pruning tokens, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("Token pruning completed successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});onUnknownSubcommand(buddy,"auth")}
1
+ import process from"node:process";import{runAction}from"@stacksjs/actions";import{intro,log,onUnknownSubcommand,outro}from"@stacksjs/cli";import{Action}from"@stacksjs/enums";import{ExitCode}from"@stacksjs/types";import{resultFailed}from"../result";import{authPruneActionOptions}from"./auth-prune-options";export function auth(buddy){const descriptions={setup:"Set up authentication (migrations + personal access client)",token:"Create a personal access client token",client:"Create a new OAuth client",prune:"Prune expired and revoked tokens",project:"Target a specific project",verbose:"Enable verbose output"};buddy.command("auth:setup",descriptions.setup).option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:setup` ...",options);const perf=await intro("buddy auth:setup"),result=await runAction(Action.AuthSetup,options);if(resultFailed(result)){await outro("While setting up authentication, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("Authentication setup completed successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});buddy.command("auth:token",descriptions.token).option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:token` ...",options);const perf=await intro("buddy auth:token"),result=await runAction(Action.CreatePersonalAccessClient,options);if(resultFailed(result)){await outro("While creating the personal access client token, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("Personal access client token created successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});buddy.command("auth:client",descriptions.client).option("-n, --name [name]","Client name",{default:"OAuth Client"}).option("-r, --redirect [redirect]","Redirect URI, or comma-separated provider URIs",{default:"http://localhost"}).option("--personal","Create a personal access client",{default:!1}).option("--password","Create a password grant client",{default:!1}).option("--provider","Create an authorization-server client",{default:!1}).option("--owner [id]","Owner user id for a provider client").option("--public","Create a public PKCE client without a secret",{default:!1}).option("--scopes [scopes]","Comma-separated provider scopes").option("--resources [resources]","Comma-separated provider resources").option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:client` ...",options);const perf=await intro("buddy auth:client"),result=await runAction(Action.AuthClient,options);if(resultFailed(result)){await outro("While creating the OAuth client, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("OAuth client created successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});buddy.command("auth:prune",descriptions.prune).option("--no-expired","Skip pruning expired tokens").option("--no-revoked","Skip pruning revoked tokens").option("-d, --days [days]","Prune revoked tokens older than N days",{default:7}).option("-p, --project [project]",descriptions.project,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy auth:prune` ...",options);const perf=await intro("buddy auth:prune"),result=await runAction(Action.AuthPrune,authPruneActionOptions(options));if(resultFailed(result)){await outro("While pruning tokens, there was an issue",{startTime:perf,useSeconds:!0},result.error);process.exit(ExitCode.FatalError)}await outro("Token pruning completed successfully.",{startTime:perf,useSeconds:!0});process.exit(ExitCode.Success)});onUnknownSubcommand(buddy,"auth")}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.28",
5
+ "version": "0.75.30",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -95,69 +95,69 @@
95
95
  "prepublishOnly": "bun run build"
96
96
  },
97
97
  "dependencies": {
98
- "@stacksjs/actions": "^0.75.28",
99
- "@stacksjs/ai": "^0.75.28",
100
- "@stacksjs/alias": "^0.75.28",
101
- "@stacksjs/analytics": "^0.75.28",
102
- "@stacksjs/api": "^0.75.28",
103
- "@stacksjs/arrays": "^0.75.28",
104
- "@stacksjs/auth": "^0.75.28",
105
- "@stacksjs/browser-extension": "^0.75.28",
106
- "@stacksjs/build": "^0.75.28",
107
- "@stacksjs/cache": "^0.75.28",
108
- "@stacksjs/chat": "^0.75.28",
98
+ "@stacksjs/actions": "^0.75.30",
99
+ "@stacksjs/ai": "^0.75.30",
100
+ "@stacksjs/alias": "^0.75.30",
101
+ "@stacksjs/analytics": "^0.75.30",
102
+ "@stacksjs/api": "^0.75.30",
103
+ "@stacksjs/arrays": "^0.75.30",
104
+ "@stacksjs/auth": "^0.75.30",
105
+ "@stacksjs/browser-extension": "^0.75.30",
106
+ "@stacksjs/build": "^0.75.30",
107
+ "@stacksjs/cache": "^0.75.30",
108
+ "@stacksjs/chat": "^0.75.30",
109
109
  "@stacksjs/clapp": "^0.2.12",
110
- "@stacksjs/cli": "^0.75.28",
111
- "@stacksjs/cloud": "^0.75.28",
112
- "@stacksjs/cms": "^0.75.28",
113
- "@stacksjs/collections": "^0.75.28",
114
- "@stacksjs/config": "^0.75.28",
115
- "@stacksjs/database": "^0.75.28",
116
- "@stacksjs/desktop-build": "^0.75.28",
117
- "@stacksjs/dns": "^0.75.28",
110
+ "@stacksjs/cli": "^0.75.30",
111
+ "@stacksjs/cloud": "^0.75.30",
112
+ "@stacksjs/cms": "^0.75.30",
113
+ "@stacksjs/collections": "^0.75.30",
114
+ "@stacksjs/config": "^0.75.30",
115
+ "@stacksjs/database": "^0.75.30",
116
+ "@stacksjs/desktop-build": "^0.75.30",
117
+ "@stacksjs/dns": "^0.75.30",
118
118
  "@stacksjs/dnsx": "^0.2.3",
119
- "@stacksjs/email": "^0.75.28",
120
- "@stacksjs/enums": "^0.75.28",
121
- "@stacksjs/env": "^0.75.28",
122
- "@stacksjs/error-handling": "^0.75.28",
123
- "@stacksjs/events": "^0.75.28",
124
- "@stacksjs/features": "^0.75.28",
125
- "@stacksjs/git": "^0.75.28",
119
+ "@stacksjs/email": "^0.75.30",
120
+ "@stacksjs/enums": "^0.75.30",
121
+ "@stacksjs/env": "^0.75.30",
122
+ "@stacksjs/error-handling": "^0.75.30",
123
+ "@stacksjs/events": "^0.75.30",
124
+ "@stacksjs/features": "^0.75.30",
125
+ "@stacksjs/git": "^0.75.30",
126
126
  "@stacksjs/gitit": "^0.2.5",
127
- "@stacksjs/health": "^0.75.28",
127
+ "@stacksjs/health": "^0.75.30",
128
128
  "@stacksjs/httx": "^0.1.10",
129
- "@stacksjs/image": "^0.75.28",
130
- "@stacksjs/lint": "^0.75.28",
131
- "@stacksjs/logging": "^0.75.28",
132
- "@stacksjs/notifications": "^0.75.28",
133
- "@stacksjs/objects": "^0.75.28",
134
- "@stacksjs/orm": "^0.75.28",
135
- "@stacksjs/path": "^0.75.28",
136
- "@stacksjs/payments": "^0.75.28",
137
- "@stacksjs/realtime": "^0.75.28",
138
- "@stacksjs/router": "^0.75.28",
129
+ "@stacksjs/image": "^0.75.30",
130
+ "@stacksjs/lint": "^0.75.30",
131
+ "@stacksjs/logging": "^0.75.30",
132
+ "@stacksjs/notifications": "^0.75.30",
133
+ "@stacksjs/objects": "^0.75.30",
134
+ "@stacksjs/orm": "^0.75.30",
135
+ "@stacksjs/path": "^0.75.30",
136
+ "@stacksjs/payments": "^0.75.30",
137
+ "@stacksjs/realtime": "^0.75.30",
138
+ "@stacksjs/router": "^0.75.30",
139
139
  "@stacksjs/rpx": "^0.11.54",
140
- "@stacksjs/scheduler": "^0.75.28",
141
- "@stacksjs/search-engine": "^0.75.28",
142
- "@stacksjs/security": "^0.75.28",
143
- "@stacksjs/server": "^0.75.28",
144
- "@stacksjs/sites": "^0.75.28",
145
- "@stacksjs/skills": "^0.75.28",
146
- "@stacksjs/storage": "^0.75.28",
147
- "@stacksjs/strings": "^0.75.28",
148
- "@stacksjs/stx": "^0.2.336",
149
- "@stacksjs/testing": "^0.75.28",
150
- "@stacksjs/tinker": "^0.75.28",
140
+ "@stacksjs/scheduler": "^0.75.30",
141
+ "@stacksjs/search-engine": "^0.75.30",
142
+ "@stacksjs/security": "^0.75.30",
143
+ "@stacksjs/server": "^0.75.30",
144
+ "@stacksjs/sites": "^0.75.30",
145
+ "@stacksjs/skills": "^0.75.30",
146
+ "@stacksjs/storage": "^0.75.30",
147
+ "@stacksjs/strings": "^0.75.30",
148
+ "@stacksjs/stx": "^0.2.337",
149
+ "@stacksjs/testing": "^0.75.30",
150
+ "@stacksjs/tinker": "^0.75.30",
151
151
  "@stacksjs/tlsx": "^0.13.19",
152
152
  "@stacksjs/ts-cloud": "^0.16.15",
153
- "@stacksjs/tunnel": "^0.75.28",
154
- "@stacksjs/types": "^0.75.28",
155
- "@stacksjs/ui": "^0.75.28",
156
- "@stacksjs/utils": "^0.75.28",
157
- "@stacksjs/validation": "^0.75.28",
153
+ "@stacksjs/tunnel": "^0.75.30",
154
+ "@stacksjs/types": "^0.75.30",
155
+ "@stacksjs/ui": "^0.75.30",
156
+ "@stacksjs/utils": "^0.75.30",
157
+ "@stacksjs/validation": "^0.75.30",
158
158
  "ajv": "^8.20.0",
159
159
  "ajv-formats": "^3.0.1",
160
- "bun-plugin-stx": "^0.2.336",
160
+ "bun-plugin-stx": "^0.2.337",
161
161
  "ts-pantry": "^0.11.35"
162
162
  },
163
163
  "devDependencies": {