stacks 0.58.58 → 0.58.60

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 (197) hide show
  1. package/core/actions/dist/src/build.js +18 -26
  2. package/core/actions/dist/src/bump.js +9 -3
  3. package/core/actions/dist/src/changelog.js +11 -3
  4. package/core/actions/dist/src/clean.js +2 -2
  5. package/core/actions/dist/src/dev/index.js +18 -26
  6. package/core/actions/dist/src/generate/index.js +18 -26
  7. package/core/actions/dist/src/helpers/index.js +18 -26
  8. package/core/actions/dist/src/helpers/utils.js +18 -26
  9. package/core/actions/dist/src/index.js +26 -34
  10. package/core/actions/dist/src/lint/fix.js +6 -2
  11. package/core/actions/dist/src/release.js +30 -35
  12. package/core/actions/dist/src/upgrade/index.js +18 -26
  13. package/core/actions/dist/src/upgrade.js +10 -7
  14. package/core/actions/package.json +1 -1
  15. package/core/actions/src/action.ts +18 -8
  16. package/core/actions/src/bump.ts +13 -6
  17. package/core/actions/src/changelog.ts +14 -4
  18. package/core/actions/src/clean.ts +2 -2
  19. package/core/actions/src/dev/api.ts +1 -2
  20. package/core/actions/src/domains/add.ts +12 -27
  21. package/core/actions/src/helpers/utils.ts +24 -36
  22. package/core/actions/src/lint/fix.ts +8 -2
  23. package/core/actions/src/migrate/dns.ts +1 -1
  24. package/core/actions/src/release.ts +4 -1
  25. package/core/actions/src/upgrade.ts +5 -2
  26. package/core/ai/dist/index.js +31 -29
  27. package/core/ai/package.json +3 -3
  28. package/core/alias/package.json +1 -1
  29. package/core/analytics/package.json +1 -1
  30. package/core/api/dist/index.js +6 -3
  31. package/core/api/package.json +1 -1
  32. package/core/arrays/package.json +1 -1
  33. package/core/auth/package.json +1 -1
  34. package/core/buddy/dist/chunk-59a9de11428ba763.js +993 -0
  35. package/core/buddy/dist/{chunk-e9c0ec1a3b7be088.js → chunk-6658b07ce4c24cac.js} +604 -512
  36. package/core/buddy/dist/cli.js +3916 -19
  37. package/core/buddy/dist/index.js +2 -5
  38. package/core/buddy/package.json +1 -1
  39. package/core/buddy/src/cli.ts +91 -17
  40. package/core/buddy/src/commands/add.ts +3 -0
  41. package/core/buddy/src/commands/build.ts +18 -3
  42. package/core/buddy/src/commands/changelog.ts +13 -6
  43. package/core/buddy/src/commands/clean.ts +3 -1
  44. package/core/buddy/src/commands/cloud.ts +14 -2
  45. package/core/buddy/src/commands/commit.ts +2 -0
  46. package/core/buddy/src/commands/configure.ts +6 -3
  47. package/core/buddy/src/commands/create.ts +3 -1
  48. package/core/buddy/src/commands/deploy.ts +4 -2
  49. package/core/buddy/src/commands/dev.ts +17 -4
  50. package/core/buddy/src/commands/dns.ts +7 -1
  51. package/core/buddy/src/commands/domains.ts +7 -1
  52. package/core/buddy/src/commands/fresh.ts +4 -2
  53. package/core/buddy/src/commands/generate.ts +36 -26
  54. package/core/buddy/src/commands/http.ts +6 -4
  55. package/core/buddy/src/commands/index.ts +0 -2
  56. package/core/buddy/src/commands/install.ts +3 -1
  57. package/core/buddy/src/commands/key.ts +2 -0
  58. package/core/buddy/src/commands/lint.ts +4 -0
  59. package/core/buddy/src/commands/list.ts +6 -2
  60. package/core/buddy/src/commands/make.ts +52 -30
  61. package/core/buddy/src/commands/migrate.ts +6 -2
  62. package/core/buddy/src/commands/prepublish.ts +3 -0
  63. package/core/buddy/src/commands/release.ts +12 -2
  64. package/core/buddy/src/commands/seed.ts +3 -1
  65. package/core/buddy/src/commands/setup.ts +16 -8
  66. package/core/buddy/src/commands/tinker.ts +3 -1
  67. package/core/buddy/src/commands/types.ts +4 -2
  68. package/core/buddy/src/commands/upgrade.ts +14 -3
  69. package/core/buddy/src/commands/version.ts +7 -0
  70. package/core/build/package.json +1 -1
  71. package/core/bun-create/bud/package.json +1 -1
  72. package/core/bun-create/buddy/package.json +1 -1
  73. package/core/bun-create/stack/package.json +1 -1
  74. package/core/bun-create/stacks/package.json +1 -1
  75. package/core/bun-create/stx/package.json +1 -1
  76. package/core/bun-plugin-yaml/package.json +1 -1
  77. package/core/cache/package.json +2 -2
  78. package/core/chat/package.json +1 -1
  79. package/core/cli/dist/index.js +463 -81
  80. package/core/cli/package.json +1 -1
  81. package/core/cli/src/cli.ts +9 -31
  82. package/core/cli/src/console.ts +19 -19
  83. package/core/cli/src/exec.ts +25 -8
  84. package/core/cli/src/helpers.ts +3 -3
  85. package/core/cli/src/index.ts +1 -1
  86. package/core/cli/src/parse.ts +95 -17
  87. package/core/cli/src/run.ts +7 -7
  88. package/core/cli/src/utils.ts +62 -0
  89. package/core/cloud/dist/index.js +29 -30
  90. package/core/cloud/package.json +32 -32
  91. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
  92. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  93. package/core/cloud/src/cloud/dashboard.ts +86 -85
  94. package/core/cloud/src/cloud/docs.ts +1 -1
  95. package/core/cloud/src/cloud/queue.ts +35 -34
  96. package/core/cloud/src/cloud/router-layer/nodejs/package.json +2 -2
  97. package/core/collections/package.json +1 -1
  98. package/core/config/dist/index.js +52 -30
  99. package/core/config/package.json +1 -1
  100. package/core/config/src/config.ts +1 -1
  101. package/core/config/src/defaults.ts +32 -16
  102. package/core/config/src/overrides.ts +2 -0
  103. package/core/database/package.json +1 -1
  104. package/core/database/src/kysely-bun-worker/worker.ts +0 -1
  105. package/core/datetime/package.json +1 -1
  106. package/core/desktop/package.json +3 -3
  107. package/core/development/package.json +1 -1
  108. package/core/dns/package.json +7 -7
  109. package/core/docs/package.json +1 -1
  110. package/core/email/package.json +4 -3
  111. package/core/email/src/server/converter.ts +19 -19
  112. package/core/email/src/server/inbound.ts +24 -8
  113. package/core/email/src/server/outbound.ts +17 -17
  114. package/core/enums/dist/index.js +2 -2
  115. package/core/enums/package.json +1 -1
  116. package/core/enums/src/index.ts +2 -2
  117. package/core/env/dist/index.js +1 -1
  118. package/core/env/package.json +3 -2
  119. package/core/env/src/utils.ts +1 -0
  120. package/core/error-handling/package.json +1 -1
  121. package/core/eslint-config/build.ts +1 -1
  122. package/core/eslint-config/package.json +12 -10
  123. package/core/eslint-config/test/cli.spec.ts +2 -1
  124. package/core/eslint-config/tsconfig.json +2 -2
  125. package/core/events/package.json +1 -1
  126. package/core/faker/package.json +2 -2
  127. package/core/git/package.json +1 -1
  128. package/core/health/package.json +1 -1
  129. package/core/http/package.json +1 -1
  130. package/core/lint/package.json +1 -1
  131. package/core/logging/build.ts +1 -1
  132. package/core/logging/dist/index.js +44 -1915
  133. package/core/logging/package.json +1 -1
  134. package/core/logging/src/index.ts +79 -13
  135. package/core/notifications/package.json +2 -2
  136. package/core/objects/package.json +1 -1
  137. package/core/orm/package.json +1 -1
  138. package/core/path/dist/index.js +10 -0
  139. package/core/path/package.json +1 -1
  140. package/core/path/src/index.ts +10 -0
  141. package/core/payments/dist/index.js +34 -10
  142. package/core/payments/package.json +2 -2
  143. package/core/push/package.json +1 -1
  144. package/core/query-builder/package.json +1 -1
  145. package/core/queue/package.json +1 -1
  146. package/core/raycast/package.json +1 -1
  147. package/core/realtime/package.json +1 -1
  148. package/core/repl/package.json +1 -1
  149. package/core/router/dist/index.js +517 -14
  150. package/core/router/package.json +1 -1
  151. package/core/router/src/router.ts +10 -3
  152. package/core/scheduler/package.json +2 -1
  153. package/core/scheduler/tests/cron.test.ts +11 -9
  154. package/core/search-engine/package.json +1 -1
  155. package/core/security/package.json +1 -1
  156. package/core/server/package.json +2 -2
  157. package/core/signals/package.json +1 -1
  158. package/core/slug/package.json +1 -1
  159. package/core/sms/package.json +1 -1
  160. package/core/storage/package.json +1 -1
  161. package/core/strings/package.json +1 -1
  162. package/core/tables/package.json +2 -2
  163. package/core/testing/package.json +5 -3
  164. package/core/tinker/package.json +1 -1
  165. package/core/tunnel/package.json +1 -1
  166. package/core/types/dist/index.js +1787 -6
  167. package/core/types/package.json +6 -6
  168. package/core/types/src/ai.ts +1 -0
  169. package/core/types/src/app.ts +1 -1
  170. package/core/types/src/binary.ts +1 -0
  171. package/core/types/src/cli.ts +13 -3
  172. package/core/types/src/docs.ts +6 -2
  173. package/core/types/src/index.ts +1 -0
  174. package/core/types/src/logger.ts +54 -0
  175. package/core/types/src/router.ts +2 -1
  176. package/core/types/src/stacks.ts +10 -0
  177. package/core/ui/package.json +4 -4
  178. package/core/utils/dist/index.js +13 -5
  179. package/core/utils/package.json +2 -2
  180. package/core/utils/src/hash.ts +10 -1
  181. package/core/validation/package.json +1 -1
  182. package/core/vite/dist/index.js +1 -1
  183. package/core/vite/package.json +4 -4
  184. package/core/vite/src/example-wc.ts +1 -4
  185. package/core/vite/src/plugin/auto-imports.ts +1 -2
  186. package/core/vite/src/plugin/components.ts +1 -2
  187. package/core/vite/src/plugin/docs.ts +1 -1
  188. package/core/whois/package.json +3 -3
  189. package/core/x-ray/package.json +1 -1
  190. package/core/zsh-buddy/buddy.plugin.zsh +4 -0
  191. package/core/zsh-buddy/package.json +3 -3
  192. package/ide/dictionary.txt +1 -0
  193. package/ide/vscode/package.json +3 -4
  194. package/package.json +1 -1
  195. package/core/buddy/src/commands/example.ts +0 -66
  196. package/core/buddy/src/commands/inspire.ts +0 -24
  197. package/core/cli/src/utilities.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cloud",
3
3
  "type": "module",
4
- "version": "0.58.58",
4
+ "version": "0.58.60",
5
5
  "description": "The Stacks cloud/serverless integration & implementation.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -55,19 +55,19 @@
55
55
  "prepublishOnly": "bun run build"
56
56
  },
57
57
  "peerDependencies": {
58
- "@aws-sdk/client-bedrock": "^3.509.0",
59
- "@aws-sdk/client-cloudformation": "^3.509.0",
60
- "@aws-sdk/client-cloudfront": "^3.509.0",
61
- "@aws-sdk/client-cloudwatch-logs": "^3.509.0",
62
- "@aws-sdk/client-ec2": "^3.509.0",
63
- "@aws-sdk/client-efs": "^3.509.0",
64
- "@aws-sdk/client-iam": "^3.509.0",
65
- "@aws-sdk/client-lambda": "^3.509.0",
66
- "@aws-sdk/client-route-53-domains": "^3.509.0",
67
- "@aws-sdk/client-s3": "^3.509.0",
68
- "@aws-sdk/client-ses": "^3.509.0",
69
- "@aws-sdk/client-sesv2": "^3.509.0",
70
- "@aws-sdk/client-ssm": "^3.509.0",
58
+ "@aws-sdk/client-bedrock": "^3.511.0",
59
+ "@aws-sdk/client-cloudformation": "^3.511.0",
60
+ "@aws-sdk/client-cloudfront": "^3.511.0",
61
+ "@aws-sdk/client-cloudwatch-logs": "^3.511.0",
62
+ "@aws-sdk/client-ec2": "^3.511.0",
63
+ "@aws-sdk/client-efs": "^3.511.0",
64
+ "@aws-sdk/client-iam": "^3.511.0",
65
+ "@aws-sdk/client-lambda": "^3.511.0",
66
+ "@aws-sdk/client-route-53-domains": "^3.511.0",
67
+ "@aws-sdk/client-s3": "^3.511.0",
68
+ "@aws-sdk/client-ses": "^3.511.0",
69
+ "@aws-sdk/client-sesv2": "^3.511.0",
70
+ "@aws-sdk/client-ssm": "^3.511.0",
71
71
  "@stacksjs/config": "workspace:*",
72
72
  "@stacksjs/env": "workspace:*",
73
73
  "@stacksjs/logging": "workspace:*",
@@ -79,20 +79,20 @@
79
79
  "@stacksjs/validation": "workspace:*"
80
80
  },
81
81
  "dependencies": {
82
- "@aws-sdk/client-bedrock": "^3.509.0",
83
- "@aws-sdk/client-cloudformation": "^3.509.0",
84
- "@aws-sdk/client-cloudfront": "^3.509.0",
85
- "@aws-sdk/client-cloudwatch-logs": "^3.509.0",
86
- "@aws-sdk/client-dynamodb": "3.509.0",
87
- "@aws-sdk/client-ec2": "^3.509.0",
88
- "@aws-sdk/client-efs": "^3.509.0",
89
- "@aws-sdk/client-iam": "^3.509.0",
90
- "@aws-sdk/client-lambda": "^3.509.0",
91
- "@aws-sdk/client-route-53-domains": "^3.509.0",
92
- "@aws-sdk/client-s3": "^3.509.0",
93
- "@aws-sdk/client-ses": "^3.509.0",
94
- "@aws-sdk/client-sesv2": "^3.509.0",
95
- "@aws-sdk/client-ssm": "^3.509.0",
82
+ "@aws-sdk/client-bedrock": "^3.511.0",
83
+ "@aws-sdk/client-cloudformation": "^3.511.0",
84
+ "@aws-sdk/client-cloudfront": "^3.511.0",
85
+ "@aws-sdk/client-cloudwatch-logs": "^3.511.0",
86
+ "@aws-sdk/client-dynamodb": "3.511.0",
87
+ "@aws-sdk/client-ec2": "^3.511.0",
88
+ "@aws-sdk/client-efs": "^3.511.0",
89
+ "@aws-sdk/client-iam": "^3.511.0",
90
+ "@aws-sdk/client-lambda": "^3.511.0",
91
+ "@aws-sdk/client-route-53-domains": "^3.511.0",
92
+ "@aws-sdk/client-s3": "^3.511.0",
93
+ "@aws-sdk/client-ses": "^3.511.0",
94
+ "@aws-sdk/client-sesv2": "^3.511.0",
95
+ "@aws-sdk/client-ssm": "^3.511.0",
96
96
  "@stacksjs/config": "workspace:*",
97
97
  "@stacksjs/dns": "workspace:*",
98
98
  "@stacksjs/env": "workspace:*",
@@ -102,18 +102,18 @@
102
102
  "@stacksjs/storage": "workspace:*",
103
103
  "@stacksjs/utils": "workspace:*",
104
104
  "@stacksjs/validation": "workspace:*",
105
- "aws-cdk": "^2.126.0",
106
- "aws-cdk-lib": "^2.126.0",
105
+ "aws-cdk": "^2.127.0",
106
+ "aws-cdk-lib": "^2.127.0",
107
107
  "aws4fetch": "^1.0.17",
108
108
  "constructs": "^10.3.0"
109
109
  },
110
110
  "devDependencies": {
111
- "@oclif/plugin-plugins": "^4.2.1",
111
+ "@oclif/plugin-plugins": "^4.2.2",
112
112
  "@stacksjs/cli": "workspace:*",
113
113
  "@stacksjs/development": "workspace:*",
114
114
  "@stacksjs/env": "workspace:*",
115
115
  "jszip": "^3.10.1",
116
- "oclif": "^4.4.7",
116
+ "oclif": "^4.4.11",
117
117
  "source-map-support": "^0.5.21"
118
118
  }
119
119
  }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "aws-sdk-layer",
3
- "version": "0.58.57",
3
+ "version": "0.58.58",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aws-sdk-layer",
9
- "version": "0.58.57",
9
+ "version": "0.58.58",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "aws-sdk": "^2.1553.0"
12
+ "aws-sdk": "^2.1555.0"
13
13
  }
14
14
  },
15
15
  "node_modules/available-typed-arrays": {
@@ -24,9 +24,9 @@
24
24
  }
25
25
  },
26
26
  "node_modules/aws-sdk": {
27
- "version": "2.1553.0",
28
- "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1553.0.tgz",
29
- "integrity": "sha512-CfZaw8dR9e642aBOeFhkFL7KoQApeLR15uH2IQqfL/12snWYayAAesYh0tEaU+XbhrH0CUsf2Zro5IraEXEZMg==",
27
+ "version": "2.1555.0",
28
+ "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1555.0.tgz",
29
+ "integrity": "sha512-hjYs1MQkJxdHnoZm8hypqGy4PQKWVUs19McdXRXWNXr97V0il4xcUpIfvjHQ9x9EjP0p/jyIx9/BtyrR68jnUQ==",
30
30
  "dependencies": {
31
31
  "buffer": "4.9.2",
32
32
  "events": "1.1.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-sdk-layer",
3
- "version": "0.58.58",
3
+ "version": "0.58.60",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -10,6 +10,6 @@
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
11
11
  },
12
12
  "dependencies": {
13
- "aws-sdk": "^2.1553.0"
13
+ "aws-sdk": "^2.1555.0"
14
14
  }
15
15
  }
@@ -1,85 +1,86 @@
1
- /* eslint-disable no-new */
2
- // TODO: finish this cloudwatch dashboard
3
- // import type { aws_lambda as lambda } from 'aws-cdk-lib'
4
- import { Aws, CfnOutput as Output, aws_cloudwatch as cloudwatch } from 'aws-cdk-lib'
5
- import type { Construct } from 'constructs'
6
- import type { NestedCloudProps } from '../types'
7
-
8
- export interface DashboardStackProps extends NestedCloudProps {
9
- dashboardName?: string
10
- }
11
-
12
- export class DashboardStack {
13
- // lambdaFunction: lambda.Function
14
- dashboard: cloudwatch.Dashboard
15
-
16
- constructor(scope: Construct, props: DashboardStackProps) {
17
- const dashboardName = props.dashboardName || 'StacksDashboard'
18
-
19
- // Create Sample Lambda Function which will create metrics
20
- // this.lambdaFunction = new Function(this, 'SampleLambda', {
21
- // handler: 'lambda-handler.handler',
22
- // runtime: Runtime.PYTHON_3_7,
23
- // code: new AssetCode(`./lambda`),
24
- // memorySize: 512,
25
- // timeout: Duration.seconds(10),
26
- // })
27
-
28
- // Create CloudWatch Dashboard
29
- this.dashboard = new cloudwatch.Dashboard(scope, 'SampleLambdaDashboard', {
30
- dashboardName,
31
- })
32
-
33
- // Create Title for Dashboard
34
- this.dashboard.addWidgets(new cloudwatch.TextWidget({
35
- markdown: `# Dashboard: ${this.lambdaFunction.functionName}`,
36
- height: 1,
37
- width: 24,
38
- }))
39
-
40
- // Create CloudWatch Dashboard Widgets: Errors, Invocations, Duration, Throttles
41
- this.dashboard.addWidgets(new cloudwatch.GraphWidget({
42
- title: 'Invocations',
43
- left: [this.lambdaFunction.metricInvocations()],
44
- width: 24,
45
- }))
46
-
47
- this.dashboard.addWidgets(new cloudwatch.GraphWidget({
48
- title: 'Errors',
49
- left: [this.lambdaFunction.metricErrors()],
50
- width: 24,
51
- }))
52
-
53
- this.dashboard.addWidgets(new cloudwatch.GraphWidget({
54
- title: 'Duration',
55
- left: [this.lambdaFunction.metricDuration()],
56
- width: 24,
57
- }))
58
-
59
- this.dashboard.addWidgets(new cloudwatch.GraphWidget({
60
- title: 'Throttles',
61
- left: [this.lambdaFunction.metricThrottles()],
62
- width: 24,
63
- }))
64
-
65
- // Create Widget to show last 20 Log Entries
66
- this.dashboard.addWidgets(new cloudwatch.LogQueryWidget({
67
- logGroupNames: [this.lambdaFunction.logGroup.logGroupName],
68
- queryLines: [
69
- 'fields @timestamp, @message',
70
- 'sort @timestamp desc',
71
- 'limit 20',
72
- ],
73
- width: 24,
74
- }))
75
-
76
- // Generate Output
77
- const cloudwatchDashboardURL = `https://${Aws.REGION}.console.aws.amazon.com/cloudwatch/home?region=${Aws.REGION}#dashboards:name=${dashboardName}`
78
-
79
- new Output(scope, 'DashboardOutput', {
80
- value: cloudwatchDashboardURL,
81
- description: 'The CloudWatch Dashboard URL',
82
- exportName: 'StacksDashboardURL',
83
- })
84
- }
85
- }
1
+ // /* eslint-disable no-new */
2
+ // // TODO: finish this cloudwatch dashboard
3
+ // // import type { aws_lambda as lambda } from 'aws-cdk-lib'
4
+ // import { Aws, CfnOutput as Output, aws_cloudwatch as cloudwatch } from 'aws-cdk-lib'
5
+ // import type { Construct } from 'constructs'
6
+ // import type { NestedCloudProps } from '../types'
7
+ //
8
+ // export interface DashboardStackProps extends NestedCloudProps {
9
+ // dashboardName?: string
10
+ // }
11
+ //
12
+ // export class DashboardStack {
13
+ // // lambdaFunction: lambda.Function
14
+ // dashboard: cloudwatch.Dashboard
15
+ //
16
+ // constructor(scope: Construct, props: DashboardStackProps) {
17
+ // const dashboardName = props.dashboardName || 'StacksDashboard'
18
+ //
19
+ // // Create Sample Lambda Function which will create metrics
20
+ // // this.lambdaFunction = new Function(this, 'SampleLambda', {
21
+ // // handler: 'lambda-handler.handler',
22
+ // // runtime: Runtime.PYTHON_3_7,
23
+ // // code: new AssetCode(`./lambda`),
24
+ // // memorySize: 512,
25
+ // // timeout: Duration.seconds(10),
26
+ // // })
27
+ //
28
+ // // Create CloudWatch Dashboard
29
+ // this.dashboard = new cloudwatch.Dashboard(scope, 'SampleLambdaDashboard', {
30
+ // dashboardName,
31
+ // })
32
+ //
33
+ // // Create Title for Dashboard
34
+ // this.dashboard.addWidgets(new cloudwatch.TextWidget({
35
+ // markdown: `# Dashboard: `,
36
+ // // markdown: `# Dashboard: ${this.lambdaFunction.functionName}`,
37
+ // height: 1,
38
+ // width: 24,
39
+ // }))
40
+ //
41
+ // // Create CloudWatch Dashboard Widgets: Errors, Invocations, Duration, Throttles
42
+ // this.dashboard.addWidgets(new cloudwatch.GraphWidget({
43
+ // title: 'Invocations',
44
+ // left: [this.lambdaFunction.metricInvocations()],
45
+ // width: 24,
46
+ // }))
47
+ //
48
+ // this.dashboard.addWidgets(new cloudwatch.GraphWidget({
49
+ // title: 'Errors',
50
+ // left: [this.lambdaFunction.metricErrors()],
51
+ // width: 24,
52
+ // }))
53
+ //
54
+ // this.dashboard.addWidgets(new cloudwatch.GraphWidget({
55
+ // title: 'Duration',
56
+ // left: [this.lambdaFunction.metricDuration()],
57
+ // width: 24,
58
+ // }))
59
+ //
60
+ // this.dashboard.addWidgets(new cloudwatch.GraphWidget({
61
+ // title: 'Throttles',
62
+ // left: [this.lambdaFunction.metricThrottles()],
63
+ // width: 24,
64
+ // }))
65
+ //
66
+ // // Create Widget to show last 20 Log Entries
67
+ // this.dashboard.addWidgets(new cloudwatch.LogQueryWidget({
68
+ // logGroupNames: [this.lambdaFunction.logGroup.logGroupName],
69
+ // queryLines: [
70
+ // 'fields @timestamp, @message',
71
+ // 'sort @timestamp desc',
72
+ // 'limit 20',
73
+ // ],
74
+ // width: 24,
75
+ // }))
76
+ //
77
+ // // Generate Output
78
+ // const cloudwatchDashboardURL = `https://${Aws.REGION}.console.aws.amazon.com/cloudwatch/home?region=${Aws.REGION}#dashboards:name=${dashboardName}`
79
+ //
80
+ // new Output(scope, 'DashboardOutput', {
81
+ // value: cloudwatchDashboardURL,
82
+ // description: 'The CloudWatch Dashboard URL',
83
+ // exportName: 'StacksDashboardURL',
84
+ // })
85
+ // }
86
+ // }
@@ -29,7 +29,7 @@ export class DocsStack {
29
29
  runtime: lambda.Runtime.NODEJS_18_X,
30
30
  handler: 'dist/origin-request.handler',
31
31
  code: lambda.Code.fromAsset(p.corePath('cloud/dist.zip'), {
32
- assetHash: originRequestFunctionHash,
32
+ assetHash: originRequestFunctionHash(),
33
33
  assetHashType: AssetHashType.CUSTOM,
34
34
  }),
35
35
  })
@@ -24,39 +24,39 @@ export class QueueStack {
24
24
 
25
25
  async init() {
26
26
  const jobsDir = path.jobsPath()
27
+ const actionsDir = path.appPath('Actions')
27
28
 
28
- try {
29
- const jobFiles = await fs.readdir(jobsDir)
30
- const actionFiles = await fs.readdir(actionsDir)
31
- const jobs = []
29
+ const jobFiles = await fs.readdir(jobsDir)
30
+ const actionFiles = await fs.readdir(actionsDir)
31
+ const jobs = []
32
32
 
33
- // then, need to loop through all app/Jobs/*.ts and create a rule for each, potentially overwriting the Schedule.ts jobs
34
- for (const file of jobFiles) {
35
- if (!file.endsWith('.ts'))
36
- continue
33
+ // then, need to loop through all app/Jobs/*.ts and create a rule for each, potentially overwriting the Schedule.ts jobs
34
+ for (const file of jobFiles) {
35
+ if (!file.endsWith('.ts'))
36
+ continue
37
37
 
38
- const filePath = path.jobsPath(file)
38
+ const jobPath = path.jobsPath(file)
39
39
 
40
- // Await the loading of the job module
41
- jobs.push(await this.loadModule(filePath))
42
- }
43
-
44
- for (const file of actionFiles) {
45
- if (!file.endsWith('.ts'))
46
- continue
40
+ // Await the loading of the job module
41
+ const job = await this.loadModule(jobPath)
42
+ this.createQueueRule(job, file)
43
+ jobs.push(job)
44
+ }
47
45
 
48
- const filePath = path.actionsPath(file)
46
+ for (const file of actionFiles) {
47
+ if (!file.endsWith('.ts'))
48
+ continue
49
49
 
50
- // Await the loading of the job module
51
- jobs.push(await this.loadModule(filePath))
52
- }
50
+ const actionPath = path.appPath(`Actions/${file}`)
53
51
 
54
- for (const job of jobs)
55
- await this.createQueueRule(job)
56
- }
57
- catch (err) {
58
- console.error('Error reading the jobs directory:', err)
52
+ // Await the loading of the job module
53
+ const action = await this.loadModule(actionPath)
54
+ this.createQueueRule(action, file)
55
+ jobs.push(action)
59
56
  }
57
+
58
+ // for (const job of jobs)
59
+ // await this.createQueueRule(job, file)
60
60
  }
61
61
 
62
62
  // Helper function to convert a rate string to a cron object for AWS Schedule
@@ -78,12 +78,13 @@ export class QueueStack {
78
78
  return jobModule
79
79
  }
80
80
 
81
- createQueueRule(job: any) {
82
- // Now you can safely access job.default.rate
83
- const rate = job.default?.rate
81
+ // TODO: narrow any type -> jobs & actions are allowed
82
+ createQueueRule(module: { default: any }, file: string) {
83
+ // Now you can safely access module.default.rate
84
+ const rate = module.default?.rate
84
85
 
85
86
  // if no rate or job is disabled, no need to schedule, skip
86
- if (!rate || job.default?.enabled === false)
87
+ if (!rate || module.default?.enabled === false)
87
88
  return
88
89
 
89
90
  // Convert the rate to a Schedule object
@@ -115,26 +116,26 @@ export class QueueStack {
115
116
  },
116
117
  {
117
118
  name: 'JOB_BACKOFF_FACTOR',
118
- value: jobModule.default?.backoffFactor,
119
+ value: module.default?.backoffFactor,
119
120
  },
120
121
  {
121
122
  name: 'JOB_RETRIES',
122
- value: jobModule.default?.tries,
123
+ value: module.default?.tries,
123
124
  },
124
125
  {
125
126
  name: 'JOB_INITIAL_DELAY',
126
- value: jobModule.default?.initialDelay,
127
+ value: module.default?.initialDelay,
127
128
  },
128
129
  {
129
130
  name: 'JOB_JITTER',
130
- value: jobModule.default?.jitter,
131
+ value: module.default?.jitter,
131
132
  },
132
133
  ],
133
134
  },
134
135
  ],
135
136
 
136
137
  retryAttempts: 1, // we utilize a custom retry mechanism in the job itself
137
- // retryAttempts: jobModule.default.tries || 3,
138
+ // retryAttempts: module.default.tries || 3,
138
139
 
139
140
  subnetSelection: {
140
141
  subnetType: ec2.SubnetType.PUBLIC, // SubnetType.PRIVATE_WITH_EGRESS
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stacks-router-layer",
3
- "version": "0.58.58",
3
+ "version": "0.58.60",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -10,6 +10,6 @@
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
11
11
  },
12
12
  "dependencies": {
13
- "@stacksjs/router": "^0.58.57"
13
+ "@stacksjs/router": "^0.58.59"
14
14
  }
15
15
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/collections",
3
3
  "type": "module",
4
- "version": "0.58.58",
4
+ "version": "0.58.60",
5
5
  "description": "The Stacks collections.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",