Skip to content

Commit 3c61c86

Browse files
authored
Prepare for release (#230)
* Add dotenv * Update Transloadit.ts * w
1 parent 41b3916 commit 3c61c86

6 files changed

Lines changed: 23 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ env.sh
1818
!.yarn/versions
1919
.aider*
2020
.DS_Store
21+
.env

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@typescript-eslint/parser": "^8.29.1",
4040
"@vitest/coverage-v8": "^3.1.3",
4141
"badge-maker": "^4.1.0",
42+
"dotenv": "^16.5.0",
4243
"eslint": "8",
4344
"eslint-config-prettier": "^8.10.0",
4445
"eslint-config-transloadit": "^2.0.0",

src/Transloadit.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ export class Transloadit {
403403
)
404404
// eslint-disable-next-line no-console
405405
console.error(
406-
`---\nPlease report this error to Transloadit (support@transloadit.com). We are working on better schemas for our API and this looks like something we do not cover yet: \n\n${err}\nThank you in advance!---\n`
406+
`---\nPlease report this error to Transloadit (support@transloadit.com). We are working on better schemas for our API and this looks like something we do not cover yet: \n\n${err}\nThank you in advance!\n---\n`
407407
)
408408
// @TODO, once our schemas have matured, we should throw the error here.
409409
// But as it stands, schemas are new, and we can't easily update all customer's node-sdks,
@@ -490,7 +490,7 @@ export class Transloadit {
490490
)
491491
// eslint-disable-next-line no-console
492492
console.error(
493-
`---\nPlease report this error to Transloadit (support@transloadit.com). We are working on better schemas for our API and this looks like something we do not cover yet: \n\n${err}\nThank you in advance!---\n`
493+
`---\nPlease report this error to Transloadit (support@transloadit.com). We are working on better schemas for our API and this looks like something we do not cover yet: \n\n${err}\nThank you in advance!\n---\n`
494494
)
495495
return {
496496
// @TODO, once our schemas have matured, we should throw the error here.
@@ -530,7 +530,7 @@ export class Transloadit {
530530
)
531531
// eslint-disable-next-line no-console
532532
console.error(
533-
`---\nPlease report this error to Transloadit (support@transloadit.com). We are working on better schemas for our API and this looks like something we do not cover yet: \n\n${err}\nThank you in advance!---\n`
533+
`---\nPlease report this error to Transloadit (support@transloadit.com). We are working on better schemas for our API and this looks like something we do not cover yet: \n\n${err}\nThank you in advance!\n---\n`
534534
)
535535
// @TODO, once our schemas have matured, we should throw the error here.
536536
// But as it stands, schemas are new, and we can't easily update all customer's node-sdks,

src/alphalib/types/assemblyStatus.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,18 @@ export const assemblyIndexItemSchema = z
595595
instance: assemblyStatusBaseSchema.shape.instance.unwrap().optional(), // from base
596596
notify_url: assemblyStatusBaseSchema.shape.notify_url.optional(), // from base
597597
redirect_url: z.string().nullable().optional(), // Specific to list item, was in old ListedAssembly
598-
files: z.string(), // JSON stringified, specific to list item
598+
files: z.string().nullable(), // JSON stringified, specific to list item, CAN BE NULL
599599
warning_count: z.number().optional(), // Specific to list item
600600
execution_duration: assemblyStatusBaseSchema.shape.execution_duration.optional(), // from base
601601
execution_start: assemblyStatusBaseSchema.shape.execution_start.optional(), // from base
602+
region: assemblyStatusBaseSchema.shape.region.optional(), // from base
603+
num_input_files: assemblyStatusBaseSchema.shape.num_input_files.optional(), // from base
604+
bytes_usage: assemblyStatusBaseSchema.shape.bytes_usage.optional(), // from base
602605
ok: assemblyStatusOkCodeSchema.nullable().optional(), // Use exported enum
603606
error: assemblyStatusErrCodeSchema.nullable().optional(), // Use exported enum
604607
created: z.string(), // Specific to list item, mandatory based on old interface
608+
created_ts: z.number().optional(), // Add new field
609+
template_name: z.string().nullable().optional(), // Add new field
605610
})
606611
.strict()
607612

test/integration/live-api.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { setTimeout } from 'timers/promises'
99
import got, { RetryOptions } from 'got'
1010
import intoStream from 'into-stream'
1111
import debug from 'debug'
12+
import { config } from 'dotenv'
1213

1314
import {
1415
CreateAssemblyOptions,
@@ -21,6 +22,9 @@ import { createProxy } from '../util.js'
2122
import { RobotImageResizeInstructionsInput } from '../../src/alphalib/types/robots/image-resize.js'
2223
import { RobotFileFilterInstructionsInput } from '../../src/alphalib/types/robots/file-filter.js'
2324

25+
// Load environment variables from .env file
26+
config()
27+
2428
const log = debug('transloadit:live-api')
2529

2630
async function downloadTmpFile(url: string) {

yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,6 +3191,13 @@ __metadata:
31913191
languageName: node
31923192
linkType: hard
31933193

3194+
"dotenv@npm:^16.5.0":
3195+
version: 16.5.0
3196+
resolution: "dotenv@npm:16.5.0"
3197+
checksum: 10c0/5bc94c919fbd955bf0ba44d33922a1e93d1078e64a1db5c30faeded1d996e7a83c55332cb8ea4fae5a9ca4d0be44cbceb95c5811e70f9f095298df09d1997dd9
3198+
languageName: node
3199+
linkType: hard
3200+
31943201
"dunder-proto@npm:^1.0.0, dunder-proto@npm:^1.0.1":
31953202
version: 1.0.1
31963203
resolution: "dunder-proto@npm:1.0.1"
@@ -6919,6 +6926,7 @@ __metadata:
69196926
"@vitest/coverage-v8": "npm:^3.1.3"
69206927
badge-maker: "npm:^4.1.0"
69216928
debug: "npm:^4.4.0"
6929+
dotenv: "npm:^16.5.0"
69226930
eslint: "npm:8"
69236931
eslint-config-prettier: "npm:^8.10.0"
69246932
eslint-config-transloadit: "npm:^2.0.0"

0 commit comments

Comments
 (0)