@vercel/functions 3.5.0 → 3.6.0
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.
- package/CHANGELOG.md +14 -0
- package/cache/in-memory-cache.d.ts +1 -0
- package/cache/index.js +4 -1
- package/cache/types.d.ts +1 -1
- package/docs/README.md +7 -5
- package/docs/index/README.md +37 -0
- package/docs/index/functions/addCacheTag.md +19 -0
- package/docs/index/functions/attachDatabasePool.md +45 -0
- package/docs/index/functions/dangerouslyDeleteBySrcImage.md +23 -0
- package/docs/index/functions/dangerouslyDeleteByTag.md +23 -0
- package/docs/index/functions/geolocation.md +49 -0
- package/docs/index/functions/getCache.md +36 -0
- package/docs/index/functions/getEnv.md +291 -0
- package/docs/index/functions/invalidateBySrcImage.md +19 -0
- package/docs/index/functions/invalidateByTag.md +19 -0
- package/docs/index/functions/ipAddress.md +36 -0
- package/docs/index/functions/next.md +47 -0
- package/docs/index/functions/rewrite.md +66 -0
- package/docs/index/functions/waitUntil.md +38 -0
- package/docs/index/interfaces/DangerouslyDeleteOptions.md +18 -0
- package/docs/index/interfaces/Geo.md +90 -0
- package/docs/index/interfaces/PurgeApi.md +123 -0
- package/docs/index/interfaces/Request.md +19 -0
- package/docs/index/interfaces/RuntimeCache.md +133 -0
- package/docs/index/type-aliases/AddCacheTagApi.md +26 -0
- package/docs/index/variables/experimental_attachDatabasePool.md +49 -0
- package/docs/oidc/README.md +15 -0
- package/docs/oidc/functions/awsCredentialsProvider.md +24 -0
- package/docs/oidc/functions/getVercelOidcToken.md +58 -0
- package/docs/oidc/functions/getVercelOidcTokenSync.md +36 -0
- package/docs/oidc/interfaces/AwsCredentialsProviderInit.md +195 -0
- package/package.json +5 -5
- package/docs/interfaces/index.DangerouslyDeleteOptions.md +0 -22
- package/docs/interfaces/index.Geo.md +0 -115
- package/docs/interfaces/index.PurgeApi.md +0 -134
- package/docs/interfaces/index.Request.md +0 -23
- package/docs/interfaces/index.RuntimeCache.md +0 -131
- package/docs/interfaces/oidc.AwsCredentialsProviderInit.md +0 -221
- package/docs/modules/index.md +0 -536
- package/docs/modules/oidc.md +0 -133
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# Interface: RuntimeCache
|
|
2
|
-
|
|
3
|
-
[index](../modules/index.md).RuntimeCache
|
|
4
|
-
|
|
5
|
-
Interface representing the runtime cache.
|
|
6
|
-
|
|
7
|
-
## Table of contents
|
|
8
|
-
|
|
9
|
-
### Properties
|
|
10
|
-
|
|
11
|
-
- [delete](index.RuntimeCache.md#delete)
|
|
12
|
-
- [expireTag](index.RuntimeCache.md#expiretag)
|
|
13
|
-
- [get](index.RuntimeCache.md#get)
|
|
14
|
-
- [set](index.RuntimeCache.md#set)
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
### delete
|
|
19
|
-
|
|
20
|
-
• **delete**: (`key`: `string`) => [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
21
|
-
|
|
22
|
-
#### Type declaration
|
|
23
|
-
|
|
24
|
-
▸ (`key`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
25
|
-
|
|
26
|
-
Deletes a value from the cache.
|
|
27
|
-
|
|
28
|
-
##### Parameters
|
|
29
|
-
|
|
30
|
-
| Name | Type | Description |
|
|
31
|
-
| :---- | :------- | :------------------------------ |
|
|
32
|
-
| `key` | `string` | The key of the value to delete. |
|
|
33
|
-
|
|
34
|
-
##### Returns
|
|
35
|
-
|
|
36
|
-
[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
37
|
-
|
|
38
|
-
A promise that resolves when the value is deleted.
|
|
39
|
-
|
|
40
|
-
#### Defined in
|
|
41
|
-
|
|
42
|
-
[packages/functions/src/cache/types.ts:11](https://github.com/vercel/vercel/blob/main/packages/functions/src/cache/types.ts#L11)
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
### expireTag
|
|
47
|
-
|
|
48
|
-
• **expireTag**: (`tag`: `string` \| `string`[]) => [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
49
|
-
|
|
50
|
-
#### Type declaration
|
|
51
|
-
|
|
52
|
-
▸ (`tag`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
53
|
-
|
|
54
|
-
Expires cache entries by tag.
|
|
55
|
-
|
|
56
|
-
##### Parameters
|
|
57
|
-
|
|
58
|
-
| Name | Type | Description |
|
|
59
|
-
| :---- | :--------------------- | :---------------------------------------------- |
|
|
60
|
-
| `tag` | `string` \| `string`[] | The tag or tags of the cache entries to expire. |
|
|
61
|
-
|
|
62
|
-
##### Returns
|
|
63
|
-
|
|
64
|
-
[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
65
|
-
|
|
66
|
-
A promise that resolves when the cache entries expiration request is received.
|
|
67
|
-
|
|
68
|
-
#### Defined in
|
|
69
|
-
|
|
70
|
-
[packages/functions/src/cache/types.ts:44](https://github.com/vercel/vercel/blob/main/packages/functions/src/cache/types.ts#L44)
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
### get
|
|
75
|
-
|
|
76
|
-
• **get**: (`key`: `string`) => [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`unknown`\>
|
|
77
|
-
|
|
78
|
-
#### Type declaration
|
|
79
|
-
|
|
80
|
-
▸ (`key`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`unknown`\>
|
|
81
|
-
|
|
82
|
-
Retrieves a value from the cache.
|
|
83
|
-
|
|
84
|
-
##### Parameters
|
|
85
|
-
|
|
86
|
-
| Name | Type | Description |
|
|
87
|
-
| :---- | :------- | :-------------------------------- |
|
|
88
|
-
| `key` | `string` | The key of the value to retrieve. |
|
|
89
|
-
|
|
90
|
-
##### Returns
|
|
91
|
-
|
|
92
|
-
[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`unknown`\>
|
|
93
|
-
|
|
94
|
-
A promise that resolves to the value, or null if not found.
|
|
95
|
-
|
|
96
|
-
#### Defined in
|
|
97
|
-
|
|
98
|
-
[packages/functions/src/cache/types.ts:19](https://github.com/vercel/vercel/blob/main/packages/functions/src/cache/types.ts#L19)
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
### set
|
|
103
|
-
|
|
104
|
-
• **set**: (`key`: `string`, `value`: `unknown`, `options?`: { `name?`: `string` ; `tags?`: `string`[] ; `ttl?`: `number` }) => [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
105
|
-
|
|
106
|
-
#### Type declaration
|
|
107
|
-
|
|
108
|
-
▸ (`key`, `value`, `options?`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
109
|
-
|
|
110
|
-
Sets a value in the cache.
|
|
111
|
-
|
|
112
|
-
##### Parameters
|
|
113
|
-
|
|
114
|
-
| Name | Type | Description |
|
|
115
|
-
| :-------------- | :--------- | :------------------------------------------------------------- |
|
|
116
|
-
| `key` | `string` | The key of the value to set. |
|
|
117
|
-
| `value` | `unknown` | The value to set. |
|
|
118
|
-
| `options?` | `Object` | Optional settings for the cache entry. |
|
|
119
|
-
| `options.name?` | `string` | Optional user-friendly name for the cache entry used for o11y. |
|
|
120
|
-
| `options.tags?` | `string`[] | Optional tags to associate with the cache entry. |
|
|
121
|
-
| `options.ttl?` | `number` | Optional time-to-live for the cache entry, in seconds. |
|
|
122
|
-
|
|
123
|
-
##### Returns
|
|
124
|
-
|
|
125
|
-
[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`\>
|
|
126
|
-
|
|
127
|
-
A promise that resolves when the value is set.
|
|
128
|
-
|
|
129
|
-
#### Defined in
|
|
130
|
-
|
|
131
|
-
[packages/functions/src/cache/types.ts:32](https://github.com/vercel/vercel/blob/main/packages/functions/src/cache/types.ts#L32)
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
# Interface: AwsCredentialsProviderInit
|
|
2
|
-
|
|
3
|
-
[oidc](../modules/oidc.md).AwsCredentialsProviderInit
|
|
4
|
-
|
|
5
|
-
The init object for the `awsCredentialsProvider` function.
|
|
6
|
-
|
|
7
|
-
## Hierarchy
|
|
8
|
-
|
|
9
|
-
- [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)<`FromWebTokenInit`, `"webIdentityToken"`\>
|
|
10
|
-
|
|
11
|
-
↳ **`AwsCredentialsProviderInit`**
|
|
12
|
-
|
|
13
|
-
## Table of contents
|
|
14
|
-
|
|
15
|
-
### Properties
|
|
16
|
-
|
|
17
|
-
- [clientConfig](oidc.AwsCredentialsProviderInit.md#clientconfig)
|
|
18
|
-
- [clientPlugins](oidc.AwsCredentialsProviderInit.md#clientplugins)
|
|
19
|
-
- [durationSeconds](oidc.AwsCredentialsProviderInit.md#durationseconds)
|
|
20
|
-
- [logger](oidc.AwsCredentialsProviderInit.md#logger)
|
|
21
|
-
- [parentClientConfig](oidc.AwsCredentialsProviderInit.md#parentclientconfig)
|
|
22
|
-
- [policy](oidc.AwsCredentialsProviderInit.md#policy)
|
|
23
|
-
- [policyArns](oidc.AwsCredentialsProviderInit.md#policyarns)
|
|
24
|
-
- [providerId](oidc.AwsCredentialsProviderInit.md#providerid)
|
|
25
|
-
- [roleArn](oidc.AwsCredentialsProviderInit.md#rolearn)
|
|
26
|
-
- [roleAssumerWithWebIdentity](oidc.AwsCredentialsProviderInit.md#roleassumerwithwebidentity)
|
|
27
|
-
- [roleSessionName](oidc.AwsCredentialsProviderInit.md#rolesessionname)
|
|
28
|
-
|
|
29
|
-
## Properties
|
|
30
|
-
|
|
31
|
-
### clientConfig
|
|
32
|
-
|
|
33
|
-
• `Optional` **clientConfig**: `any`
|
|
34
|
-
|
|
35
|
-
Custom STS client configurations overriding the default ones.
|
|
36
|
-
|
|
37
|
-
#### Inherited from
|
|
38
|
-
|
|
39
|
-
Omit.clientConfig
|
|
40
|
-
|
|
41
|
-
#### Defined in
|
|
42
|
-
|
|
43
|
-
node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.806.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:135
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
### clientPlugins
|
|
48
|
-
|
|
49
|
-
• `Optional` **clientPlugins**: `Pluggable`<`any`, `any`\>[]
|
|
50
|
-
|
|
51
|
-
Custom STS client middleware plugin to modify the client default behavior.
|
|
52
|
-
|
|
53
|
-
#### Inherited from
|
|
54
|
-
|
|
55
|
-
Omit.clientPlugins
|
|
56
|
-
|
|
57
|
-
#### Defined in
|
|
58
|
-
|
|
59
|
-
node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.806.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:139
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
### durationSeconds
|
|
64
|
-
|
|
65
|
-
• **durationSeconds**: `undefined` \| `number`
|
|
66
|
-
|
|
67
|
-
The duration, in seconds, of the role session. Defaults to 3600 seconds.
|
|
68
|
-
|
|
69
|
-
#### Inherited from
|
|
70
|
-
|
|
71
|
-
Omit.durationSeconds
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
### logger
|
|
76
|
-
|
|
77
|
-
• `Optional` **logger**: `Logger`
|
|
78
|
-
|
|
79
|
-
This logger is only used to provide information
|
|
80
|
-
on what credential providers were used during resolution.
|
|
81
|
-
|
|
82
|
-
It does not log credentials.
|
|
83
|
-
|
|
84
|
-
#### Inherited from
|
|
85
|
-
|
|
86
|
-
Omit.logger
|
|
87
|
-
|
|
88
|
-
#### Defined in
|
|
89
|
-
|
|
90
|
-
node_modules/.pnpm/@aws-sdk+types@3.609.0/node_modules/@aws-sdk/types/dist-types/credentials.d.ts:31
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
### parentClientConfig
|
|
95
|
-
|
|
96
|
-
• `Optional` **parentClientConfig**: `Object`
|
|
97
|
-
|
|
98
|
-
Present if the credential provider was created by calling
|
|
99
|
-
the defaultCredentialProvider in a client's middleware, having
|
|
100
|
-
access to the client's config.
|
|
101
|
-
|
|
102
|
-
The region of that parent or outer client is important because
|
|
103
|
-
an inner client used by the credential provider may need
|
|
104
|
-
to match its default partition or region with that of
|
|
105
|
-
the outer client.
|
|
106
|
-
|
|
107
|
-
**`Deprecated`**
|
|
108
|
-
|
|
109
|
-
- not truly deprecated, marked as a warning to not use this.
|
|
110
|
-
|
|
111
|
-
#### Index signature
|
|
112
|
-
|
|
113
|
-
▪ [key: `string`]: `unknown`
|
|
114
|
-
|
|
115
|
-
#### Type declaration
|
|
116
|
-
|
|
117
|
-
| Name | Type |
|
|
118
|
-
| :-------- | :-------------------------------- |
|
|
119
|
-
| `region?` | `string` \| `Provider`<`string`\> |
|
|
120
|
-
|
|
121
|
-
#### Inherited from
|
|
122
|
-
|
|
123
|
-
Omit.parentClientConfig
|
|
124
|
-
|
|
125
|
-
#### Defined in
|
|
126
|
-
|
|
127
|
-
node_modules/.pnpm/@aws-sdk+types@3.609.0/node_modules/@aws-sdk/types/dist-types/credentials.d.ts:45
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
### policy
|
|
132
|
-
|
|
133
|
-
• **policy**: `undefined` \| `string`
|
|
134
|
-
|
|
135
|
-
An IAM policy in JSON format that you want to use as an inline session policy.
|
|
136
|
-
|
|
137
|
-
#### Inherited from
|
|
138
|
-
|
|
139
|
-
Omit.policy
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
### policyArns
|
|
144
|
-
|
|
145
|
-
• **policyArns**: `undefined` \| { `arn?`: `string` }[]
|
|
146
|
-
|
|
147
|
-
ARNs of the IAM managed policies that you want to use as managed session policies.
|
|
148
|
-
|
|
149
|
-
#### Inherited from
|
|
150
|
-
|
|
151
|
-
Omit.policyArns
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
### providerId
|
|
156
|
-
|
|
157
|
-
• **providerId**: `undefined` \| `string`
|
|
158
|
-
|
|
159
|
-
The fully qualified host component of the domain name of the identity provider.
|
|
160
|
-
|
|
161
|
-
#### Inherited from
|
|
162
|
-
|
|
163
|
-
Omit.providerId
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
### roleArn
|
|
168
|
-
|
|
169
|
-
• **roleArn**: `string`
|
|
170
|
-
|
|
171
|
-
ARN of the role that the caller is assuming.
|
|
172
|
-
|
|
173
|
-
#### Inherited from
|
|
174
|
-
|
|
175
|
-
Omit.roleArn
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### roleAssumerWithWebIdentity
|
|
180
|
-
|
|
181
|
-
• `Optional` **roleAssumerWithWebIdentity**: (`params`: `AssumeRoleWithWebIdentityParams`) => [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`AwsCredentialIdentity`\>
|
|
182
|
-
|
|
183
|
-
#### Type declaration
|
|
184
|
-
|
|
185
|
-
▸ (`params`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`AwsCredentialIdentity`\>
|
|
186
|
-
|
|
187
|
-
A function that assumes a role with web identity and returns a promise fulfilled with credentials for the assumed role.
|
|
188
|
-
|
|
189
|
-
##### Parameters
|
|
190
|
-
|
|
191
|
-
| Name | Type |
|
|
192
|
-
| :------- | :-------------------------------- |
|
|
193
|
-
| `params` | `AssumeRoleWithWebIdentityParams` |
|
|
194
|
-
|
|
195
|
-
##### Returns
|
|
196
|
-
|
|
197
|
-
[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`AwsCredentialIdentity`\>
|
|
198
|
-
|
|
199
|
-
#### Inherited from
|
|
200
|
-
|
|
201
|
-
Omit.roleAssumerWithWebIdentity
|
|
202
|
-
|
|
203
|
-
#### Defined in
|
|
204
|
-
|
|
205
|
-
node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.806.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:130
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
### roleSessionName
|
|
210
|
-
|
|
211
|
-
• `Optional` **roleSessionName**: `string`
|
|
212
|
-
|
|
213
|
-
An identifier for the assumed role session.
|
|
214
|
-
|
|
215
|
-
#### Inherited from
|
|
216
|
-
|
|
217
|
-
Omit.roleSessionName
|
|
218
|
-
|
|
219
|
-
#### Defined in
|
|
220
|
-
|
|
221
|
-
node*modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.609.0*@aws-sdk+client-sts@3.806.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts:123
|