Skip to content

Commit 4fa7d60

Browse files
committed
chore: wip
1 parent 16b79bd commit 4fa7d60

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

storage/framework/core/actions/src/ai/request-model-access.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import process from 'node:process'
22
import * as AWS4 from 'aws4'
3-
43
import { log } from '@stacksjs/cli'
54
import { ai } from '@stacksjs/config'
65
import { config } from 'aws-sdk'
7-
// todo: Remove axios and use the AWS SDK instead if possible, but I couldn't get it to work. At least, move to our own fetch wrapper
8-
import axios from 'axios'
96

107
// Specify the AWS profile
118
// process.env.AWS_PROFILE = 'your-profile-name' -> no need to define this because of our .env file
@@ -53,24 +50,24 @@ config.getCredentials((err) => {
5350
})
5451

5552
// Convert headers to the correct type
56-
const axiosHeaders = Object.fromEntries(
53+
const headers = Object.fromEntries(
5754
Object.entries(signedRequest.headers || {}).map(([key, value]) => [key, String(value)]),
5855
)
5956

6057
const url = `https://${signedRequest.host}${signedRequest.path}`
6158

6259
// Send the request
63-
axios({
60+
fetch(url, {
6461
method: signedRequest.method,
65-
url,
66-
headers: axiosHeaders,
67-
data: signedRequest.body,
62+
headers,
63+
body: signedRequest.body,
6864
})
69-
.then((response) => {
70-
log.info(response.data)
65+
.then((response) => response.json())
66+
.then((data) => {
67+
log.info(data)
7168
})
7269
.catch((error) => {
73-
log.error(error.data)
70+
log.error('Error:', error)
7471
})
7572
}
7673
}

storage/framework/ide/dictionary.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,15 @@ nprogress
208208
nuxt
209209
oclif
210210
ofetch
211+
officedocument
211212
ohmyzsh
212213
openai
213214
openapi
214215
opensearch
215216
opensearchservice
216217
openweb
217218
openweblabs
219+
openxmlformats
218220
orta
219221
otplib
220222
outdir
@@ -283,6 +285,7 @@ sizecheck
283285
solana
284286
sonner
285287
Spatie
288+
spreadsheetml
286289
Squeezy
287290
stackblitz
288291
stacksjs

0 commit comments

Comments
 (0)