Skip to content

Commit 177e3b7

Browse files
committed
Remove file/Response envvars upload docs
1 parent 0dc137d commit 177e3b7

File tree

3 files changed

+3
-75
lines changed

3 files changed

+3
-75
lines changed

docs/v3-openapi.yaml

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -811,17 +811,7 @@ paths:
811811
description: Whether to override existing variables or not
812812
default: false
813813
required: ["variables"]
814-
multipart/form-data:
815-
schema:
816-
type: object
817-
properties:
818-
variables:
819-
type: string
820-
format: binary
821-
override:
822-
type: boolean
823-
required:
824-
- variables
814+
825815
responses:
826816
"200":
827817
description: Environment variables imported successfully
@@ -864,57 +854,11 @@ paths:
864854
source: |-
865855
import { envvars } from "@trigger.dev/sdk/v3";
866856
867-
// Import variables from an array
868-
await envvars.upload("proj_yubjwjsfkxnylobaqvqz", "dev", {
869-
variables: [
870-
{
871-
name: "SLACK_API_KEY",
872-
value: "slack_123456"
873-
}
874-
],
875-
override: false
876-
});
877-
- lang: typescript
878-
label: Import variables from a read stream
879-
source: |-
880-
import { envvars } from "@trigger.dev/sdk/v3";
881-
import { createReadStream } from "node:fs";
882-
883-
// Import variables in dotenv format from a file
884-
await envvars.upload("proj_yubjwjsfkxnylobaqvqz", "dev", {
885-
variables: createReadStream(".env"),
886-
override: false
887-
});
888-
- lang: typescript
889-
label: Import variables from a response
890-
source: |-
891-
import { envvars } from "@trigger.dev/sdk/v3";
892-
893-
// Import variables in dotenv format from a response
894857
await envvars.upload("proj_yubjwjsfkxnylobaqvqz", "dev", {
895-
variables: await fetch("https://example.com/.env"),
858+
variables: { SLACK_API_KEY: "slack_key_1234" },
896859
override: false
897860
});
898-
- lang: typescript
899-
label: Import variables from a Buffer
900-
source: |-
901-
import { envvars } from "@trigger.dev/sdk/v3";
902861
903-
// Import variables in dotenv format from a buffer
904-
await envvars.upload("proj_yubjwjsfkxnylobaqvqz", "dev", {
905-
variables: Buffer.from("SLACK_API_KEY=slack_1234"),
906-
override: false
907-
});
908-
- lang: typescript
909-
label: Import variables from a File
910-
source: |-
911-
import { envvars } from "@trigger.dev/sdk/v3";
912-
913-
// Import variables in dotenv format from a file
914-
await envvars.upload("proj_yubjwjsfkxnylobaqvqz", "dev", {
915-
variables: new File(["SLACK_API_KEY=slack_1234"], ".env"),
916-
override: false
917-
});
918862
919863
"/api/v1/projects/{projectRef}/envvars/{env}/{name}":
920864
parameters:

packages/core/src/v3/apiClient/types.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ export interface ImportEnvironmentVariablesParams {
55
/**
66
* The variables to be imported. If a variable with the same key already exists, it will be overwritten when `override` is `true`.
77
*
8-
* There are two ways to specify the variables:
9-
*
10-
* 1. As a record of key-value pairs. e.g. `{ "key1": "value1", "key2": "value2" }`
11-
* 2. As an "uploadable" object in dotenv format. An uploadable can be a Node readable stream, a string, or a Buffer. You can also pass the return value of a `fetch` call.
8+
* To specify the variables, you can pass them in as a record of key-value pairs. e.g. `{ "key1": "value1", "key2": "value2" }`
129
*/
1310
variables: Record<string, string>;
14-
1511
override?: boolean;
1612
}
1713

references/v3-catalog/src/trigger/simple.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ export const taskWithSpecialCharacters = task({
3131
},
3232
});
3333

34-
export const updateEnvVars = task({
35-
id: "update-env-vars",
36-
run: async () => {
37-
return await envvars.upload({
38-
variables: await fetch(
39-
"https://gist.githubusercontent.com/ericallam/7a1001c6b03986a74d0f8aad4fd890aa/raw/fe2bc4da82f3b17178d47f58ec1458af47af5035/.env"
40-
),
41-
override: true,
42-
});
43-
},
44-
});
45-
4634
export const createJsonHeroDoc = task({
4735
id: "create-jsonhero-doc",
4836
run: async (payload: { title: string; content: any }, { ctx }) => {

0 commit comments

Comments
 (0)