Skip to content

Commit 44a1a6b

Browse files
committed
Promote input.file out of experimental namespace
Close T-403
1 parent 3c848b6 commit 44a1a6b

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
@@ -244,7 +244,7 @@ const interval = new Interval({
244244
}),
245245
io.input.date('Date input', { disabled: true }),
246246
io.input.time('Time input', { disabled: true }),
247-
io.experimental.input.file('File input', { disabled: true }),
247+
io.input.file('File input', { disabled: true }),
248248
])
249249

250250
return 'Done!'
@@ -971,23 +971,20 @@ const interval = new Interval({
971971
return { message: 'OK, notified!' }
972972
},
973973
upload: async (io, ctx) => {
974-
const customDestinationFile = await io.experimental.input.file(
975-
'Upload an image!',
976-
{
977-
helpText: 'Will be uploaded to the custom destination.',
978-
allowedExtensions: ['.gif', '.jpg', '.jpeg', '.png'],
979-
generatePresignedUrls: async ({ name }) => {
980-
const urlSafeName = name.replace(/ /g, '-')
981-
const path = `custom-endpoint/${new Date().getTime()}-${urlSafeName}`
974+
const customDestinationFile = await io.input.file('Upload an image!', {
975+
helpText: 'Will be uploaded to the custom destination.',
976+
allowedExtensions: ['.gif', '.jpg', '.jpeg', '.png'],
977+
generatePresignedUrls: async ({ name }) => {
978+
const urlSafeName = name.replace(/ /g, '-')
979+
const path = `custom-endpoint/${new Date().getTime()}-${urlSafeName}`
982980

983-
return generateS3Urls(path)
984-
},
985-
}
986-
)
981+
return generateS3Urls(path)
982+
},
983+
})
987984

988985
console.log(await customDestinationFile.url())
989986

990-
const file = await io.experimental.input.file('Upload an image!', {
987+
const file = await io.input.file('Upload an image!', {
991988
helpText:
992989
'Will be uploaded to Interval and expire after the action finishes running.',
993990
allowedExtensions: ['.gif', '.jpg', '.jpeg', '.png'],

0 commit comments

Comments
 (0)