@stacksjs/actions 0.74.48 → 0.74.50

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 (2) hide show
  1. package/dist/auth/prune.js +1 -1
  2. package/package.json +38 -38
@@ -1 +1 @@
1
- import process from"node:process";import{db,sql}from"@stacksjs/database";import{log}from"@stacksjs/logging";const args=process.argv.slice(2),hasFlag=(name)=>{return args.includes(`--${name}`)},getArg=(name)=>{const idx=args.findIndex((a)=>a.startsWith(`--${name}=`)||a.startsWith(`-${name.charAt(0)}=`));if(idx!==-1){const arg=args[idx];if(!arg)return;const eqIdx=arg.indexOf("=");return eqIdx>=0?arg.slice(eqIdx+1):void 0}const flagIdx=args.findIndex((a)=>a===`--${name}`||a===`-${name.charAt(0)}`),value=flagIdx!==-1?args[flagIdx+1]:void 0;if(value&&!value.startsWith("-"))return value;return},pruneExpired=!hasFlag("no-expired"),pruneRevoked=!hasFlag("no-revoked"),daysOld=Number(getArg("days"))||7;log.info("Pruning authentication tokens...");let expiredCount=0,revokedCount=0;if(pruneExpired){log.info("Removing expired tokens...");expiredCount=await db.deleteFrom("personal_access_tokens").where("expires_at","<",sql.raw("NOW()")).execute();log.success(`Removed ${expiredCount} expired token(s)`)}if(pruneRevoked){log.info(`Removing tokens revoked more than ${daysOld} day(s) ago...`);const cutoffDate=new Date;cutoffDate.setDate(cutoffDate.getDate()-daysOld);revokedCount=await db.deleteFrom("personal_access_tokens").whereNotNull("revoked_at").where("revoked_at","<",cutoffDate.toISOString()).execute();log.success(`Removed ${revokedCount} revoked token(s)`)}log.success(`Token pruning complete. Total removed: ${expiredCount+revokedCount}`);await log.flush();process.exit(0);
1
+ import process from"node:process";import{db,sql}from"@stacksjs/database/runtime";import{log}from"@stacksjs/logging";const args=process.argv.slice(2),hasFlag=(name)=>{return args.includes(`--${name}`)},getArg=(name)=>{const idx=args.findIndex((a)=>a.startsWith(`--${name}=`)||a.startsWith(`-${name.charAt(0)}=`));if(idx!==-1){const arg=args[idx];if(!arg)return;const eqIdx=arg.indexOf("=");return eqIdx>=0?arg.slice(eqIdx+1):void 0}const flagIdx=args.findIndex((a)=>a===`--${name}`||a===`-${name.charAt(0)}`),value=flagIdx!==-1?args[flagIdx+1]:void 0;if(value&&!value.startsWith("-"))return value;return},pruneExpired=!hasFlag("no-expired"),pruneRevoked=!hasFlag("no-revoked"),daysOld=Number(getArg("days"))||7;log.info("Pruning authentication tokens...");let expiredCount=0,revokedCount=0;if(pruneExpired){log.info("Removing expired tokens...");expiredCount=await db.deleteFrom("personal_access_tokens").where("expires_at","<",sql.raw("NOW()")).execute();log.success(`Removed ${expiredCount} expired token(s)`)}if(pruneRevoked){log.info(`Removing tokens revoked more than ${daysOld} day(s) ago...`);const cutoffDate=new Date;cutoffDate.setDate(cutoffDate.getDate()-daysOld);revokedCount=await db.deleteFrom("personal_access_tokens").whereNotNull("revoked_at").where("revoked_at","<",cutoffDate.toISOString()).execute();log.success(`Removed ${revokedCount} revoked token(s)`)}log.success(`Token pruning complete. Total removed: ${expiredCount+revokedCount}`);await log.flush();process.exit(0);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.74.48",
5
+ "version": "0.74.50",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -60,52 +60,52 @@
60
60
  "prepublishOnly": "bun run build"
61
61
  },
62
62
  "dependencies": {
63
- "@stacksjs/action-runner": "0.74.48",
64
- "@stacksjs/ai": "0.74.48",
65
- "@stacksjs/analytics": "0.74.48",
66
- "@stacksjs/api": "0.74.48",
67
- "@stacksjs/auth": "0.74.48",
68
- "@stacksjs/build": "0.74.48",
63
+ "@stacksjs/action-runner": "0.74.50",
64
+ "@stacksjs/ai": "0.74.50",
65
+ "@stacksjs/analytics": "0.74.50",
66
+ "@stacksjs/api": "0.74.50",
67
+ "@stacksjs/auth": "0.74.50",
68
+ "@stacksjs/build": "0.74.50",
69
69
  "@stacksjs/bumpx": "^0.2.6",
70
70
  "@stacksjs/bunpress": "^0.2.8",
71
- "@stacksjs/cli": "0.74.48",
72
- "@stacksjs/cloud": "0.74.48",
73
- "@stacksjs/cms": "0.74.48",
71
+ "@stacksjs/cli": "0.74.50",
72
+ "@stacksjs/cloud": "0.74.50",
73
+ "@stacksjs/cms": "0.74.50",
74
74
  "@stacksjs/components": "^0.2.246",
75
- "@stacksjs/config": "0.74.48",
76
- "@stacksjs/database": "0.74.48",
77
- "@stacksjs/desktop-build": "0.74.48",
78
- "@stacksjs/dns": "0.74.48",
79
- "@stacksjs/enums": "0.74.48",
80
- "@stacksjs/env": "0.74.48",
81
- "@stacksjs/error-handling": "0.74.48",
75
+ "@stacksjs/config": "0.74.50",
76
+ "@stacksjs/database": "0.74.50",
77
+ "@stacksjs/desktop-build": "0.74.50",
78
+ "@stacksjs/dns": "0.74.50",
79
+ "@stacksjs/enums": "0.74.50",
80
+ "@stacksjs/env": "0.74.50",
81
+ "@stacksjs/error-handling": "0.74.50",
82
82
  "@stacksjs/gitit": "^0.2.5",
83
- "@stacksjs/i18n": "0.74.48",
84
- "@stacksjs/image": "0.74.48",
85
- "@stacksjs/logging": "0.74.48",
83
+ "@stacksjs/i18n": "0.74.50",
84
+ "@stacksjs/image": "0.74.50",
85
+ "@stacksjs/logging": "0.74.50",
86
86
  "@stacksjs/logsmith": "^0.2.3",
87
- "@stacksjs/orm": "0.74.48",
88
- "@stacksjs/path": "0.74.48",
89
- "@stacksjs/payments": "0.74.48",
90
- "@stacksjs/queue": "0.74.48",
91
- "@stacksjs/registry": "0.74.48",
92
- "@stacksjs/router": "0.74.48",
87
+ "@stacksjs/orm": "0.74.50",
88
+ "@stacksjs/path": "0.74.50",
89
+ "@stacksjs/payments": "0.74.50",
90
+ "@stacksjs/queue": "0.74.50",
91
+ "@stacksjs/registry": "0.74.50",
92
+ "@stacksjs/router": "0.74.50",
93
93
  "@stacksjs/rpx": "^0.11.54",
94
- "@stacksjs/scheduler": "0.74.48",
95
- "@stacksjs/search-engine": "0.74.48",
96
- "@stacksjs/security": "0.74.48",
97
- "@stacksjs/server": "0.74.48",
98
- "@stacksjs/sites": "0.74.48",
99
- "@stacksjs/storage": "0.74.48",
100
- "@stacksjs/strings": "0.74.48",
94
+ "@stacksjs/scheduler": "0.74.50",
95
+ "@stacksjs/search-engine": "0.74.50",
96
+ "@stacksjs/security": "0.74.50",
97
+ "@stacksjs/server": "0.74.50",
98
+ "@stacksjs/sites": "0.74.50",
99
+ "@stacksjs/storage": "0.74.50",
100
+ "@stacksjs/strings": "0.74.50",
101
101
  "@stacksjs/stx": "^0.2.286",
102
102
  "@stacksjs/tlsx": "^0.13.19",
103
103
  "@stacksjs/ts-cloud": "^0.16.0",
104
104
  "@stacksjs/ts-md": "^0.1.1",
105
- "@stacksjs/tunnel": "0.74.48",
106
- "@stacksjs/types": "0.74.48",
107
- "@stacksjs/utils": "0.74.48",
108
- "@stacksjs/whois": "0.74.48",
105
+ "@stacksjs/tunnel": "0.74.50",
106
+ "@stacksjs/types": "0.74.50",
107
+ "@stacksjs/utils": "0.74.50",
108
+ "@stacksjs/whois": "0.74.50",
109
109
  "bun-plugin-stx": "^0.2.286"
110
110
  },
111
111
  "peerDependencies": {
@@ -121,7 +121,7 @@
121
121
  }
122
122
  },
123
123
  "devDependencies": {
124
- "@stacksjs/validation": "0.74.48",
124
+ "@stacksjs/validation": "0.74.50",
125
125
  "better-dx": "^0.2.24"
126
126
  }
127
127
  }