-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathval-name.ts
124 lines (100 loc) · 2.39 KB
/
val-name.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../../resource';
import * as Core from '../../../core';
export class ValName extends APIResource {
/**
* Get a val
*/
retrieve(
username: string,
valName: string,
options?: Core.RequestOptions,
): Core.APIPromise<ValNameRetrieveResponse> {
return this._client.get(`/v1/alias/${username}/${valName}`, options);
}
}
/**
* A Val
*/
export interface ValNameRetrieveResponse {
/**
* This val’s id
*/
id: string;
/**
* The user who created this val
*/
author: ValNameRetrieveResponse.Author | null;
/**
* TypeScript code associated with this val
*/
code: string | null;
createdAt: string;
/**
* How many likes this val has received
*/
likeCount: number;
links: ValNameRetrieveResponse.Links;
/**
* The name of this val
*/
name: string;
/**
* This val’s privacy setting. Unlisted vals do not appear on profile pages or
* elsewhere, but you can link to them.
*/
privacy: 'public' | 'unlisted' | 'private';
/**
* Whether this val is available publicly on Val Town
*/
public: boolean;
/**
* This val’s readme, as Markdown
*/
readme: string | null;
referenceCount: number;
/**
* The type of a val. HTTP can receive web requests, Email can receive emails, Cron
* runs periodically, and Script can be used for libraries or one-off calculations
*/
type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext';
/**
* The URL of this val on the Val Town website
*/
url: string;
/**
* The version of this val, starting at zero
*/
version: number;
versionCreatedAt?: string;
}
export namespace ValNameRetrieveResponse {
/**
* The user who created this val
*/
export interface Author {
id: string;
username: string | null;
}
export interface Links {
/**
* The URL of this Val’s source code as a module
*/
module: string;
/**
* The URL of this val on this API
*/
self: string;
/**
* The endpoint to retrieve this val’s versions
*/
versions: string;
/**
* This val’s web endpoint, where it serves a website or API
*/
endpoint?: string;
}
}
export declare namespace ValName {
export { type ValNameRetrieveResponse as ValNameRetrieveResponse };
}