Skip to content

Commit aa92422

Browse files
authored
Merge pull request #946 from interval/promote-file-input
Promote input.file out of experimental namespace
2 parents acdcce9 + 44a1a6b commit aa92422

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

src/classes/IOClient.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ export class IOClient {
459459
datetime: this.createIOMethod('INPUT_DATETIME', {
460460
componentDef: datetime,
461461
}),
462+
file: this.createIOMethod('UPLOAD_FILE', {
463+
componentDef: file(this.logger),
464+
}),
462465
},
463466
select: {
464467
single: this.createIOMethod('SELECT_SINGLE', {
@@ -508,11 +511,6 @@ export class IOClient {
508511
propsRequired: true,
509512
componentDef: spreadsheet,
510513
}),
511-
input: {
512-
file: this.createIOMethod('UPLOAD_FILE', {
513-
componentDef: file(this.logger),
514-
}),
515-
},
516514
},
517515
}
518516
}

src/examples/basic/index.ts

+11-14
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ const interval = new Interval({
326326
}),
327327
io.input.date('Date input', { disabled: true }),
328328
io.input.time('Time input', { disabled: true }),
329-
io.experimental.input.file('File input', { disabled: true }),
329+
io.input.file('File input', { disabled: true }),
330330
])
331331

332332
return 'Done!'
@@ -1052,23 +1052,20 @@ const interval = new Interval({
10521052
return { message: 'OK, notified!' }
10531053
},
10541054
upload: async (io, ctx) => {
1055-
const customDestinationFile = await io.experimental.input.file(
1056-
'Upload an image!',
1057-
{
1058-
helpText: 'Will be uploaded to the custom destination.',
1059-
allowedExtensions: ['.gif', '.jpg', '.jpeg', '.png'],
1060-
generatePresignedUrls: async ({ name }) => {
1061-
const urlSafeName = name.replace(/ /g, '-')
1062-
const path = `custom-endpoint/${new Date().getTime()}-${urlSafeName}`
1055+
const customDestinationFile = await io.input.file('Upload an image!', {
1056+
helpText: 'Will be uploaded to the custom destination.',
1057+
allowedExtensions: ['.gif', '.jpg', '.jpeg', '.png'],
1058+
generatePresignedUrls: async ({ name }) => {
1059+
const urlSafeName = name.replace(/ /g, '-')
1060+
const path = `custom-endpoint/${new Date().getTime()}-${urlSafeName}`
10631061

1064-
return generateS3Urls(path)
1065-
},
1066-
}
1067-
)
1062+
return generateS3Urls(path)
1063+
},
1064+
})
10681065

10691066
console.log(await customDestinationFile.url())
10701067

1071-
const file = await io.experimental.input.file('Upload an image!', {
1068+
const file = await io.input.file('Upload an image!', {
10721069
helpText:
10731070
'Will be uploaded to Interval and expire after the action finishes running.',
10741071
allowedExtensions: ['.gif', '.jpg', '.jpeg', '.png'],

0 commit comments

Comments
 (0)