FileUpload
Defined in: src/models/fileUpload.model.ts:9
FileUpload model class with helper methods.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FileUpload(
data):FileUpload
Defined in: src/models/fileUpload.model.ts:10
Parameters
Section titled “Parameters”complete_url
Section titled “complete_url”string = ...
content_length
Section titled “content_length”number | null = ...
content_type
Section titled “content_type”string | null = ...
created_time
Section titled “created_time”string = notionDateStringSchema
expiry_time
Section titled “expiry_time”string | null = ...
file_import_result
Section titled “file_import_result”string = ...
filename
Section titled “filename”string = ...
string = ...
object
Section titled “object”"file_upload" = ...
status
Section titled “status”"failed" | "pending" | "uploaded" | "expired" = ...
upload_url
Section titled “upload_url”string = ...
Returns
Section titled “Returns”FileUpload
Overrides
Section titled “Overrides”BaseModel<NotionFileUpload>.constructor
Accessors
Section titled “Accessors”completeUrl
Section titled “completeUrl”Get Signature
Section titled “Get Signature”get completeUrl():
string
Defined in: src/models/fileUpload.model.ts:80
Returns the URL to complete the upload.
Returns
Section titled “Returns”string
contentLength
Section titled “contentLength”Get Signature
Section titled “Get Signature”get contentLength():
number|null
Defined in: src/models/fileUpload.model.ts:66
Returns the content length in bytes.
Returns
Section titled “Returns”number | null
contentType
Section titled “contentType”Get Signature
Section titled “Get Signature”get contentType():
string|null
Defined in: src/models/fileUpload.model.ts:59
Returns the content type (MIME type).
Returns
Section titled “Returns”string | null
createdTime
Section titled “createdTime”Get Signature
Section titled “Get Signature”get createdTime():
Date
Defined in: src/models/fileUpload.model.ts:31
Returns the created time as a Date object.
Returns
Section titled “Returns”Date
expiryTime
Section titled “expiryTime”Get Signature
Section titled “Get Signature”get expiryTime():
Date|null
Defined in: src/models/fileUpload.model.ts:38
Returns the expiry time as a Date object (or null if not set).
Returns
Section titled “Returns”Date | null
fileImportResult
Section titled “fileImportResult”Get Signature
Section titled “Get Signature”get fileImportResult():
string
Defined in: src/models/fileUpload.model.ts:87
Returns the file import result.
Returns
Section titled “Returns”string
filename
Section titled “filename”Get Signature
Section titled “Get Signature”get filename():
string
Defined in: src/models/fileUpload.model.ts:52
Returns the filename.
Returns
Section titled “Returns”string
Get Signature
Section titled “Get Signature”get id():
string
Defined in: src/models/fileUpload.model.ts:24
Returns the file upload ID.
Returns
Section titled “Returns”string
Overrides
Section titled “Overrides”object
Section titled “object”Get Signature
Section titled “Get Signature”get object():
"file_upload"
Defined in: src/models/fileUpload.model.ts:17
Returns “file_upload” - the object type.
Returns
Section titled “Returns”"file_upload"
Overrides
Section titled “Overrides”status
Section titled “status”Get Signature
Section titled “Get Signature”get status():
"failed"|"pending"|"uploaded"|"expired"
Defined in: src/models/fileUpload.model.ts:45
Returns the upload status.
Returns
Section titled “Returns”"failed" | "pending" | "uploaded" | "expired"
uploadUrl
Section titled “uploadUrl”Get Signature
Section titled “Get Signature”get uploadUrl():
string
Defined in: src/models/fileUpload.model.ts:73
Returns the URL to upload the file.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”isExpired()
Section titled “isExpired()”isExpired():
boolean
Defined in: src/models/fileUpload.model.ts:108
Checks if the upload has expired.
Returns
Section titled “Returns”boolean
isFailed()
Section titled “isFailed()”isFailed():
boolean
Defined in: src/models/fileUpload.model.ts:115
Checks if the upload has failed.
Returns
Section titled “Returns”boolean
isPending()
Section titled “isPending()”isPending():
boolean
Defined in: src/models/fileUpload.model.ts:94
Checks if the upload is pending.
Returns
Section titled “Returns”boolean
isUploaded()
Section titled “isUploaded()”isUploaded():
boolean
Defined in: src/models/fileUpload.model.ts:101
Checks if the upload is complete.
Returns
Section titled “Returns”boolean
toJSON()
Section titled “toJSON()”toJSON():
object
Defined in: src/models/base.model.ts:20
Returns the raw validated data as a plain object.
Returns
Section titled “Returns”object
complete_url
Section titled “complete_url”complete_url:
string
content_length
Section titled “content_length”content_length:
number|null
content_type
Section titled “content_type”content_type:
string|null
created_time
Section titled “created_time”created_time:
string=notionDateStringSchema
expiry_time
Section titled “expiry_time”expiry_time:
string|null
file_import_result
Section titled “file_import_result”file_import_result:
string
filename
Section titled “filename”filename:
string
id:
string
object
Section titled “object”object:
"file_upload"
status
Section titled “status”status:
"failed"|"pending"|"uploaded"|"expired"
upload_url
Section titled “upload_url”upload_url:
string