This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
generated from NuroDev/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathfile.types.ts
85 lines (80 loc) · 2.19 KB
/
file.types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import type {
BaseLemonsqueezyResponse,
LemonsqueezyDataType,
PaginatedBaseLemonsqueezyResponse,
SharedLemonsqueezyOptions,
} from "~/shared";
/**
* @docs https://docs.lemonsqueezy.com/api/files#the-file-object
*/
export interface LemonsqueezyFile {
attributes: {
/**
* An ISO-8601 formatted date-time string indicating when the object was created
*
* @see https://en.wikipedia.org/wiki/ISO_8601
*/
createdAt: Date;
/**
* The unique URL to download the file. Note: for security reasons, download URLs are signed, expire after 1 hour and are rate-limited to 10 downloads per day per IP address
*/
download_url: string;
/**
* The file extension of the file (e.g. `pdf`)
*/
extension: string;
/**
* The unique identifier (UUID) for this file
*/
identifier: string;
/**
* The name of the file (e.g. `example.pdf`)
*/
name: string;
/**
* The human-readable size of the file (e.g. `5.5 MB`)
*/
size_formatted: string;
/**
* A positive integer in bytes representing the size of the file
*/
size: number;
/**
* An integer representing the order of this file when displayed
*/
sort: number;
/**
* The status of the file. Either `draft` or `published`
*/
status: "draft" | "published";
/**
* An ISO-8601 formatted date-time string indicating when the object was last updated
*
* @see https://en.wikipedia.org/wiki/ISO_8601
*/
updatedAt: Date;
/**
* The ID of the variant this file belongs to
*/
variant_id: number;
/**
* The software version of this file (if one exists, e.g. `1.0.0`)
*/
version: string;
};
type: LemonsqueezyDataType.files;
id: string;
}
export interface ListAllFilesOptions extends SharedLemonsqueezyOptions {
/**
* Only return files belonging to the variant with this ID
*/
variantId?: string;
}
export type ListAllFilesResult = PaginatedBaseLemonsqueezyResponse<
Array<LemonsqueezyFile>
>;
export interface RetrieveFileOptions extends SharedLemonsqueezyOptions {
id: string;
}
export type RetrieveFileResult = BaseLemonsqueezyResponse<LemonsqueezyFile>;