stacks 0.58.63 → 0.58.65

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 (137) hide show
  1. package/core/actions/dist/src/database/seed.js +0 -3
  2. package/core/actions/dist/src/deploy/index.js +1 -1
  3. package/core/actions/dist/src/upgrade.js +1 -1
  4. package/core/actions/package.json +1 -1
  5. package/core/actions/src/action.ts +3 -1
  6. package/core/actions/src/copy-types.ts +1 -1
  7. package/core/actions/src/database/seed.ts +3 -3
  8. package/core/actions/src/deploy/index.ts +1 -1
  9. package/core/actions/src/helpers/utils.ts +2 -2
  10. package/core/ai/package.json +1 -1
  11. package/core/alias/package.json +1 -1
  12. package/core/analytics/package.json +1 -1
  13. package/core/api/package.json +1 -1
  14. package/core/arrays/package.json +1 -1
  15. package/core/arrays/src/helpers.ts +3 -3
  16. package/core/auth/package.json +1 -1
  17. package/core/buddy/dist/cli.js +1 -1
  18. package/core/buddy/package.json +1 -1
  19. package/core/buddy/src/cli.ts +1 -1
  20. package/core/build/package.json +1 -1
  21. package/core/bun-create/bud/package.json +1 -1
  22. package/core/bun-create/buddy/package.json +1 -1
  23. package/core/bun-create/stack/package.json +1 -1
  24. package/core/bun-create/stacks/package.json +1 -1
  25. package/core/bun-create/stx/package.json +1 -1
  26. package/core/bun-plugin-yaml/package.json +1 -1
  27. package/core/cache/package.json +1 -1
  28. package/core/cache/tests/DynamoDB.test.ts +125 -125
  29. package/core/cache/tests/Memcached.test.ts +51 -51
  30. package/core/cache/tests/Redis.test.ts +84 -84
  31. package/core/chat/package.json +1 -1
  32. package/core/cli/dist/index.js +1 -1
  33. package/core/cli/package.json +1 -1
  34. package/core/cli/src/exec.ts +2 -2
  35. package/core/cloud/dist/index.js +8 -8
  36. package/core/cloud/package.json +1 -1
  37. package/core/cloud/src/cloud/ai.ts +3 -3
  38. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +1 -1
  39. package/core/cloud/src/cloud/cli.ts +1 -1
  40. package/core/cloud/src/cloud/compute.ts +1 -1
  41. package/core/cloud/src/cloud/deployment.ts +3 -3
  42. package/core/cloud/src/cloud/router-layer/nodejs/package.json +2 -2
  43. package/core/collections/package.json +1 -1
  44. package/core/config/dist/index.js +4 -0
  45. package/core/config/package.json +1 -1
  46. package/core/database/package.json +1 -1
  47. package/core/database/src/kysely-bun-worker/driver.ts +1 -1
  48. package/core/datetime/package.json +1 -1
  49. package/core/desktop/package.json +3 -3
  50. package/core/development/package.json +1 -1
  51. package/core/dns/package.json +1 -1
  52. package/core/docs/package.json +1 -1
  53. package/core/email/package.json +2 -2
  54. package/core/enums/package.json +1 -1
  55. package/core/env/package.json +1 -1
  56. package/core/error-handling/package.json +1 -1
  57. package/core/error-handling/src/handler.ts +1 -1
  58. package/core/eslint-config/package.json +2 -2
  59. package/core/events/package.json +1 -1
  60. package/core/faker/package.json +1 -1
  61. package/core/git/package.json +1 -1
  62. package/core/health/package.json +1 -1
  63. package/core/http/package.json +1 -1
  64. package/core/lint/package.json +1 -1
  65. package/core/logging/package.json +1 -1
  66. package/core/notifications/package.json +1 -1
  67. package/core/objects/package.json +1 -1
  68. package/core/orm/package.json +1 -1
  69. package/core/path/dist/index.js +30 -0
  70. package/core/path/package.json +1 -1
  71. package/core/path/src/index.ts +31 -0
  72. package/core/payments/package.json +1 -1
  73. package/core/push/package.json +1 -1
  74. package/core/query-builder/package.json +1 -1
  75. package/core/queue/package.json +1 -1
  76. package/core/raycast/package.json +1 -1
  77. package/core/realtime/package.json +1 -1
  78. package/core/repl/package.json +1 -1
  79. package/core/router/dist/index.js +40 -2
  80. package/core/router/package.json +1 -1
  81. package/core/router/src/router.ts +21 -1
  82. package/core/router/src/server.ts +0 -2
  83. package/core/scheduler/dist/index.js +1 -2
  84. package/core/scheduler/package.json +2 -1
  85. package/core/scheduler/src/index.ts +1 -1
  86. package/core/scheduler/src/job.ts +2 -2
  87. package/core/scheduler/src/schedule.ts +2 -2
  88. package/core/scheduler/tests/cron.test.ts +1243 -1243
  89. package/core/scheduler/tests/crontime.test.ts +780 -778
  90. package/core/search-engine/dist/index.js +1 -3
  91. package/core/search-engine/package.json +1 -1
  92. package/core/search-engine/src/index.ts +5 -5
  93. package/core/security/package.json +1 -1
  94. package/core/server/package.json +1 -1
  95. package/core/signals/package.json +1 -1
  96. package/core/slug/package.json +1 -1
  97. package/core/sms/package.json +1 -1
  98. package/core/storage/dist/index.js +0 -1
  99. package/core/storage/package.json +1 -1
  100. package/core/storage/src/files.ts +2 -5
  101. package/core/storage/src/hash.ts +0 -2
  102. package/core/strings/package.json +1 -1
  103. package/core/tables/package.json +1 -1
  104. package/core/testing/dist/index.js +14978 -1
  105. package/core/testing/package.json +1 -1
  106. package/core/testing/src/index.ts +12 -2
  107. package/core/tinker/package.json +1 -1
  108. package/core/tunnel/package.json +1 -1
  109. package/core/types/package.json +2 -2
  110. package/core/types/src/cli.ts +1 -1
  111. package/core/types/src/cron-jobs.ts +0 -5
  112. package/core/types/src/errors.ts +1 -1
  113. package/core/types/src/router.ts +7 -5
  114. package/core/ui/package.json +3 -3
  115. package/core/utils/dist/index.js +4 -8
  116. package/core/utils/package.json +1 -1
  117. package/core/utils/scripts/export-size.ts +3 -3
  118. package/core/utils/src/base.ts +4 -4
  119. package/core/utils/src/helpers.ts +3 -3
  120. package/core/utils/src/retry.ts +2 -2
  121. package/core/validation/package.json +1 -1
  122. package/core/vite/dist/index.js +1 -1
  123. package/core/vite/package.json +1 -1
  124. package/core/vite/src/functions.ts +0 -1
  125. package/core/vite/src/index.ts +1 -1
  126. package/core/vite/src/plugin/docs.ts +2 -0
  127. package/core/vite/src/plugin/stacks.ts +3 -2
  128. package/core/vite/src/web-components.ts +2 -2
  129. package/core/whois/package.json +1 -1
  130. package/core/whois/src/index.ts +2 -2
  131. package/core/x-ray/package.json +1 -1
  132. package/core/zsh-buddy/package.json +1 -1
  133. package/ide/vscode/package.json +1 -1
  134. package/package.json +1 -1
  135. package/core/actions/src/database/mydb.sqlite +0 -0
  136. package/core/actions/src/database/stacks.sqlite +0 -0
  137. package/core/server/src/api.ts +0 -5
@@ -1,4 +1 @@
1
1
  // @bun
2
- // src/database/seed.ts
3
- import {seed} from "@stacksjs/database";
4
- await seed();
@@ -27,5 +27,5 @@ await runCommand("bun zip.ts", {
27
27
  log.info("Preparing Deployment...");
28
28
  var profile = process.env.AWS_PROFILE || "stacks";
29
29
  await runCommand(`bunx cdk deploy --require-approval never --profile="${profile}"`, {
30
- cwd: p.cloudPath()
30
+ cwd: p.frameworkCloudPath()
31
31
  });
@@ -7,7 +7,7 @@ import {projectPath} from "@stacksjs/path";
7
7
  import * as storage from "@stacksjs/storage";
8
8
  import {NpmScript} from "@stacksjs/enums";
9
9
  // package.json
10
- var version = "0.58.63";
10
+ var version = "0.58.65";
11
11
 
12
12
  // src/upgrade.ts
13
13
  function checkForUncommittedChanges(options) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -16,10 +16,12 @@ export class Action {
16
16
  rate?: JobOptions['rate']
17
17
  tries?: JobOptions['tries']
18
18
  backoff?: JobOptions['backoff']
19
- enabled?: JobOptions['enabled']
19
+ enabled?: boolean
20
20
  handle: () => Promise<any>
21
21
 
22
22
  constructor({ name, description, handle, rate, tries, backoff, enabled }: ActionOptions) {
23
+ // log.debug(`Action ${name} created`) // TODO
24
+
23
25
  this.name = name
24
26
  this.description = description
25
27
  this.rate = rate
@@ -18,5 +18,5 @@ destinations.forEach(([src, dest]) => {
18
18
  // const srcPath = resolve(__filename, '..', src)
19
19
  // const destPath = resolve(__filename, '..', dest)
20
20
 
21
- copyFolder(src, dest)
21
+ copyFolder(src!, dest!)
22
22
  })
@@ -1,4 +1,4 @@
1
1
  // import { database } from '@stacksjs/config'
2
- import { seed } from '@stacksjs/database'
3
-
4
- await seed()
2
+ // import { seed } from '@stacksjs/database'
3
+ //
4
+ // await seed()
@@ -42,5 +42,5 @@ const profile = process.env.AWS_PROFILE || 'stacks'
42
42
 
43
43
  // TODO: ensure we check whether cdk bootstrap needs to be run
44
44
  await runCommand(`bunx cdk deploy --require-approval never --profile="${profile}"`, {
45
- cwd: p.cloudPath(),
45
+ cwd: p.frameworkCloudPath(),
46
46
  })
@@ -2,7 +2,7 @@ import * as storage from '@stacksjs/storage'
2
2
  import { buddyOptions, runCommand, runCommands } from '@stacksjs/cli'
3
3
  import { log } from '@stacksjs/logging'
4
4
  import * as p from '@stacksjs/path'
5
- import type { ActionOptions, StacksError, Subprocess } from '@stacksjs/types'
5
+ import type { ActionOptions, Subprocess } from '@stacksjs/types'
6
6
  import type { Result } from '@stacksjs/error-handling'
7
7
  import { err, handleError } from '@stacksjs/error-handling'
8
8
 
@@ -13,7 +13,7 @@ import { err, handleError } from '@stacksjs/error-handling'
13
13
  * @param options The options to pass to the command.
14
14
  * @returns The result of the command.
15
15
  */
16
- export async function runAction(action: string, options?: ActionOptions): Promise<Result<Subprocess, StacksError>> {
16
+ export async function runAction(action: string, options?: ActionOptions): Promise<Result<Subprocess, Error>> {
17
17
  const opts = buddyOptions()
18
18
  const path = p.relativeActionsPath(`${action}.ts`)
19
19
  const cmd = `bun --bun ${path} ${opts}`.trimEnd()
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ai",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Stacks Artificial Intelligence.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/alias",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "The Stacks aliases.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/analytics",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Stacks Analytics. Privacy-friendly.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/api",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "The Stacks array utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/arrays",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "The Stacks array utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -74,12 +74,12 @@ export function partition<T>(array: readonly T[], ...filters: PartitionFilter<T>
74
74
  let i = 0
75
75
  for (const filter of filters) {
76
76
  if (filter(e, idx, arr)) {
77
- result[i].push(e)
77
+ result[i]!.push(e)
78
78
  return
79
79
  }
80
80
  i += 1
81
81
  }
82
- result[i].push(e)
82
+ result[i]!.push(e)
83
83
  })
84
84
  return result
85
85
  }
@@ -266,7 +266,7 @@ export function sample<T>(arr: T[], count: number) {
266
266
  export function shuffle<T>(array: T[]): T[] {
267
267
  for (let i = array.length - 1; i > 0; i--) {
268
268
  const j = Math.floor(Math.random() * (i + 1));
269
- [array[i], array[j]] = [array[j], array[i]]
269
+ [array[i]!, array[j]!] = [array[j]!, array[i]!]
270
270
  }
271
271
  return array
272
272
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/auth",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "A more simplistic way to authenticate.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -3945,7 +3945,7 @@ async function main() {
3945
3945
  ]);
3946
3946
  buddy.command("inspire", "Inspire yourself with a random quote").alias("insp").action(() => {
3947
3947
  log.info(quotes.random());
3948
- log.success("Have a great dayss!");
3948
+ log.success("Have a great days!");
3949
3949
  });
3950
3950
  buddy.on("inspire:*", () => {
3951
3951
  console.log("Invalid command:", buddy.args.join(" "));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -88,7 +88,7 @@ async function main() {
88
88
  .alias('insp')
89
89
  .action(() => {
90
90
  log.info(quotes.random())
91
- log.success('Have a great dayss!')
91
+ log.success('Have a great days!')
92
92
  })
93
93
 
94
94
  buddy.on('inspire:*', () => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/build",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "The Stacks framework build tools and configurations.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/bud",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/buddy",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stack",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stacks",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stx",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-yaml",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "A Bun plugin to load yaml files",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cache",
3
3
  "type": "module",
4
- "version": "0.58.63",
4
+ "version": "0.58.65",
5
5
  "description": "Caching the Stacks way.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,127 +1,113 @@
1
- import { DynamoDB, ListTablesCommand } from '@aws-sdk/client-dynamodb'
2
- import { expect, it } from '@stacksjs/testing'
3
-
4
- const dynamodb = new DynamoDB({ region: 'us-east-1' })
5
-
6
- describe('dynamoDB test', () => {
7
- it('it should create a table for dynamodb cache', async () => {
8
- await createTable()
9
- })
10
-
11
- it('it should set dynamodb cache', async () => {
12
- await set('foo', 'bar')
13
- const value = await get('foo')
14
- expect(value).toBe('bar')
15
- })
16
-
17
- it('it should get dynamodb cache', async () => {
18
- await set('foo', 'bar')
19
- const value = await get('foo')
20
- expect(value).toBe('bar')
21
- })
22
-
23
- it('it should delete dynamodb cache', async () => {
24
- await set('foo', 'bar')
25
- await remove('foo')
26
- const value = await get('foo')
27
- expect(value).toBe(null)
28
- })
29
- })
30
-
31
- async function createTable() {
32
- const tables = await dynamodb.send(new ListTablesCommand({}))
33
-
34
- const tableExists = tables.TableNames?.includes('cache')
35
-
36
- if (tableExists)
37
- return
38
-
39
- const params = {
40
- AttributeDefinitions: [
41
- {
42
- AttributeName: 'key',
43
- AttributeType: 'S',
44
- },
45
- ],
46
- KeySchema: [
47
- {
48
- AttributeName: 'key',
49
- KeyType: 'HASH',
50
- },
51
- ],
52
- ProvisionedThroughput: {
53
- ReadCapacityUnits: 5,
54
- WriteCapacityUnits: 5,
55
- },
56
- TableName: 'cache',
57
- }
58
-
59
- await dynamodb.createTable(params)
60
- }
61
-
62
- // TODO: needs to be imported to cache package
63
- async function set(key: string, value: string | number): Promise<void> {
64
- // eslint-disable-next-line no-console
65
- console.log('set', key, value)
66
- return Promise.resolve()
67
- // const valueAttribute = 'value'
68
- // const keyAttribute = 'key'
69
- //
70
- // const params: PutItemCommandInput = {
71
- // TableName: 'cache',
72
- // Item: {
73
- // [keyAttribute]: {
74
- // S: key,
75
- // },
76
- // [valueAttribute]: {
77
- // [getValueType(value)]: serialize(value),
78
- // },
79
- // },
80
- // }
81
- //
82
- // await dynamodb.putItem(params)
83
- }
84
-
85
- // TODO: needs to be imported to cache package
86
- async function get(key: string): Promise<string | undefined | null> {
87
- const valueAttribute = 'value'
88
- const keyAttribute = 'key'
89
-
90
- const params = {
91
- TableName: 'cache',
92
- Key: {
93
- [keyAttribute]: {
94
- S: key,
95
- },
96
- },
97
- }
98
-
99
- const response = await dynamodb.getItem(params)
100
-
101
- if (!response.Item)
102
- return null
103
-
104
- return response.Item[valueAttribute].S ?? response.Item[valueAttribute].N
105
- }
106
-
107
- // TODO: needs to be imported to cache package
108
- async function remove(key: string): Promise<void> {
109
- const keyAttribute = 'key'
110
-
111
- const params = {
112
- TableName: 'cache',
113
- Key: {
114
- [keyAttribute]: {
115
- S: key,
116
- },
117
- },
118
- }
119
-
120
- await dynamodb.deleteItem(params)
121
- }
122
-
123
- // TODO: needs to be imported to cache package
124
- // async function del(key: string): Promise<void> {
1
+ // import { DynamoDB, ListTablesCommand } from '@aws-sdk/client-dynamodb'
2
+ // import { expect, it } from '@stacksjs/testing'
3
+ //
4
+ // const dynamodb = new DynamoDB({ region: 'us-east-1' })
5
+ //
6
+ // describe('dynamoDB test', () => {
7
+ // it('it should create a table for dynamodb cache', async () => {
8
+ // await createTable()
9
+ // })
10
+ //
11
+ // it('it should set dynamodb cache', async () => {
12
+ // await set('foo', 'bar')
13
+ // const value = await get('foo')
14
+ // expect(value).toBe('bar')
15
+ // })
16
+ //
17
+ // it('it should get dynamodb cache', async () => {
18
+ // await set('foo', 'bar')
19
+ // const value = await get('foo')
20
+ // expect(value).toBe('bar')
21
+ // })
22
+ //
23
+ // it('it should delete dynamodb cache', async () => {
24
+ // await set('foo', 'bar')
25
+ // await remove('foo')
26
+ // const value = await get('foo')
27
+ // expect(value).toBe(null)
28
+ // })
29
+ // })
30
+ //
31
+ // async function createTable() {
32
+ // const tables = await dynamodb.send(new ListTablesCommand({}))
33
+ //
34
+ // const tableExists = tables.TableNames?.includes('cache')
35
+ //
36
+ // if (tableExists)
37
+ // return
38
+ //
39
+ // const params = {
40
+ // AttributeDefinitions: [
41
+ // {
42
+ // AttributeName: 'key',
43
+ // AttributeType: 'S',
44
+ // },
45
+ // ],
46
+ // KeySchema: [
47
+ // {
48
+ // AttributeName: 'key',
49
+ // KeyType: 'HASH',
50
+ // },
51
+ // ],
52
+ // ProvisionedThroughput: {
53
+ // ReadCapacityUnits: 5,
54
+ // WriteCapacityUnits: 5,
55
+ // },
56
+ // TableName: 'cache',
57
+ // }
58
+ //
59
+ // await dynamodb.createTable(params)
60
+ // }
61
+ //
62
+ // // TODO: needs to be imported to cache package
63
+ // async function set(key: string, value: string | number): Promise<void> {
64
+ // // eslint-disable-next-line no-console
65
+ // console.log('set', key, value)
66
+ // return Promise.resolve()
67
+ // // const valueAttribute = 'value'
68
+ // // const keyAttribute = 'key'
69
+ // //
70
+ // // const params: PutItemCommandInput = {
71
+ // // TableName: 'cache',
72
+ // // Item: {
73
+ // // [keyAttribute]: {
74
+ // // S: key,
75
+ // // },
76
+ // // [valueAttribute]: {
77
+ // // [getValueType(value)]: serialize(value),
78
+ // // },
79
+ // // },
80
+ // // }
81
+ // //
82
+ // // await dynamodb.putItem(params)
83
+ // }
84
+ //
85
+ // // TODO: needs to be imported to cache package
86
+ // async function get(key: string): Promise<string | undefined | null> {
87
+ // const valueAttribute = 'value'
88
+ // const keyAttribute = 'key'
89
+ //
90
+ // const params = {
91
+ // TableName: 'cache',
92
+ // Key: {
93
+ // [keyAttribute]: {
94
+ // S: key,
95
+ // },
96
+ // },
97
+ // }
98
+ //
99
+ // const response = await dynamodb.getItem(params)
100
+ //
101
+ // if (!response.Item)
102
+ // return null
103
+ //
104
+ // return response.Item[valueAttribute].S ?? response.Item[valueAttribute].N
105
+ // }
106
+ //
107
+ // // TODO: needs to be imported to cache package
108
+ // async function remove(key: string): Promise<void> {
109
+ // const keyAttribute = 'key'
110
+ //
125
111
  // const params = {
126
112
  // TableName: 'cache',
127
113
  // Key: {
@@ -130,6 +116,20 @@ async function remove(key: string): Promise<void> {
130
116
  // },
131
117
  // },
132
118
  // }
133
-
119
+ //
134
120
  // await dynamodb.deleteItem(params)
135
121
  // }
122
+ //
123
+ // // TODO: needs to be imported to cache package
124
+ // // async function del(key: string): Promise<void> {
125
+ // // const params = {
126
+ // // TableName: 'cache',
127
+ // // Key: {
128
+ // // [keyAttribute]: {
129
+ // // S: key,
130
+ // // },
131
+ // // },
132
+ // // }
133
+ //
134
+ // // await dynamodb.deleteItem(params)
135
+ // // }