@valtown/sdk 1.14.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/index.d.mts +9 -5
- package/index.d.ts +9 -5
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.mjs +2 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.ts +20 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +35 -1
- package/pagination.js.map +1 -1
- package/pagination.mjs +33 -0
- package/pagination.mjs.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/orgs.d.ts +11 -29
- package/resources/orgs.d.ts.map +1 -1
- package/resources/orgs.js +8 -3
- package/resources/orgs.js.map +1 -1
- package/resources/orgs.mjs +6 -2
- package/resources/orgs.mjs.map +1 -1
- package/resources/search/index.d.ts +1 -1
- package/resources/search/index.d.ts.map +1 -1
- package/resources/search/index.js +1 -2
- package/resources/search/index.js.map +1 -1
- package/resources/search/index.mjs +1 -1
- package/resources/search/index.mjs.map +1 -1
- package/resources/search/search.d.ts +2 -2
- package/resources/search/search.d.ts.map +1 -1
- package/resources/search/search.js +0 -1
- package/resources/search/search.js.map +1 -1
- package/resources/search/search.mjs +1 -2
- package/resources/search/search.mjs.map +1 -1
- package/resources/search/vals.d.ts +6 -78
- package/resources/search/vals.d.ts.map +1 -1
- package/resources/search/vals.js +4 -7
- package/resources/search/vals.js.map +1 -1
- package/resources/search/vals.mjs +3 -5
- package/resources/search/vals.mjs.map +1 -1
- package/resources/shared.d.ts +161 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js +7 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs +5 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/vals/environment-variables.d.ts +137 -0
- package/resources/vals/environment-variables.d.ts.map +1 -0
- package/resources/vals/environment-variables.js +81 -0
- package/resources/vals/environment-variables.js.map +1 -0
- package/resources/vals/environment-variables.mjs +76 -0
- package/resources/vals/environment-variables.mjs.map +1 -0
- package/resources/vals/index.d.ts +2 -1
- package/resources/vals/index.d.ts.map +1 -1
- package/resources/vals/index.js +4 -1
- package/resources/vals/index.js.map +1 -1
- package/resources/vals/index.mjs +1 -0
- package/resources/vals/index.mjs.map +1 -1
- package/resources/vals/vals.d.ts +14 -18
- package/resources/vals/vals.d.ts.map +1 -1
- package/resources/vals/vals.js +13 -3
- package/resources/vals/vals.js.map +1 -1
- package/resources/vals/vals.mjs +12 -2
- package/resources/vals/vals.mjs.map +1 -1
- package/src/index.ts +18 -11
- package/src/pagination.ts +61 -0
- package/src/resources/index.ts +2 -2
- package/src/resources/orgs.ts +20 -33
- package/src/resources/search/index.ts +1 -1
- package/src/resources/search/search.ts +2 -8
- package/src/resources/search/vals.ts +8 -103
- package/src/resources/shared.ts +201 -1
- package/src/resources/vals/environment-variables.ts +199 -0
- package/src/resources/vals/index.ts +11 -1
- package/src/resources/vals/vals.ts +38 -26
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/orgs.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import * as Core from '../core';
|
|
5
|
-
import
|
|
5
|
+
import { PageCursorURL, type PageCursorURLParams } from '../pagination';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Get information about organizations you belong to
|
|
@@ -11,49 +11,36 @@ export class Orgs extends APIResource {
|
|
|
11
11
|
/**
|
|
12
12
|
* Get all orgs you are a member of
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
list(
|
|
15
|
+
query: OrgListParams,
|
|
16
|
+
options?: Core.RequestOptions,
|
|
17
|
+
): Core.PagePromise<OrgListResponsesPageCursorURL, OrgListResponse> {
|
|
18
|
+
return this._client.getAPIList('/v2/orgs', OrgListResponsesPageCursorURL, { query, ...options });
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
|
|
22
|
+
export class OrgListResponsesPageCursorURL extends PageCursorURL<OrgListResponse> {}
|
|
23
|
+
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
25
|
+
* An Org
|
|
21
26
|
*/
|
|
22
|
-
export interface
|
|
23
|
-
data: Array<OrgRetrieveResponse.Data>;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Links to use for pagination
|
|
27
|
-
*/
|
|
28
|
-
links: Shared.PaginationLinks;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export namespace OrgRetrieveResponse {
|
|
27
|
+
export interface OrgListResponse {
|
|
32
28
|
/**
|
|
33
|
-
*
|
|
29
|
+
* The id of the org
|
|
34
30
|
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* The id of the org
|
|
38
|
-
*/
|
|
39
|
-
id: string;
|
|
31
|
+
id: string;
|
|
40
32
|
|
|
41
|
-
|
|
42
|
-
}
|
|
33
|
+
username: string;
|
|
43
34
|
}
|
|
44
35
|
|
|
45
|
-
export interface
|
|
46
|
-
/**
|
|
47
|
-
* Maximum items to return in each paginated response
|
|
48
|
-
*/
|
|
49
|
-
limit: number;
|
|
36
|
+
export interface OrgListParams extends PageCursorURLParams {}
|
|
50
37
|
|
|
51
|
-
|
|
52
|
-
* Number of items to skip in order to deliver paginated results
|
|
53
|
-
*/
|
|
54
|
-
offset: number;
|
|
55
|
-
}
|
|
38
|
+
Orgs.OrgListResponsesPageCursorURL = OrgListResponsesPageCursorURL;
|
|
56
39
|
|
|
57
40
|
export declare namespace Orgs {
|
|
58
|
-
export {
|
|
41
|
+
export {
|
|
42
|
+
type OrgListResponse as OrgListResponse,
|
|
43
|
+
OrgListResponsesPageCursorURL as OrgListResponsesPageCursorURL,
|
|
44
|
+
type OrgListParams as OrgListParams,
|
|
45
|
+
};
|
|
59
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export { Search } from './search';
|
|
4
|
-
export {
|
|
4
|
+
export { Vals, type ValListParams } from './vals';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
4
|
import * as ValsAPI from './vals';
|
|
5
|
-
import { ValListParams,
|
|
5
|
+
import { ValListParams, Vals } from './vals';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Search endpoint for vals
|
|
@@ -12,13 +12,7 @@ export class Search extends APIResource {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
Search.Vals = Vals;
|
|
15
|
-
Search.ValListResponsesPageCursorURL = ValListResponsesPageCursorURL;
|
|
16
15
|
|
|
17
16
|
export declare namespace Search {
|
|
18
|
-
export {
|
|
19
|
-
Vals as Vals,
|
|
20
|
-
type ValListResponse as ValListResponse,
|
|
21
|
-
ValListResponsesPageCursorURL as ValListResponsesPageCursorURL,
|
|
22
|
-
type ValListParams as ValListParams,
|
|
23
|
-
};
|
|
17
|
+
export { Vals as Vals, type ValListParams as ValListParams };
|
|
24
18
|
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
4
|
import * as Core from '../../core';
|
|
5
|
-
import
|
|
5
|
+
import * as Shared from '../shared';
|
|
6
|
+
import { BasicValsPageCursorURL } from '../shared';
|
|
7
|
+
import { type PageCursorURLParams } from '../../pagination';
|
|
6
8
|
|
|
7
9
|
export class Vals extends APIResource {
|
|
8
10
|
/**
|
|
@@ -11,101 +13,8 @@ export class Vals extends APIResource {
|
|
|
11
13
|
list(
|
|
12
14
|
query: ValListParams,
|
|
13
15
|
options?: Core.RequestOptions,
|
|
14
|
-
): Core.PagePromise<
|
|
15
|
-
return this._client.getAPIList('/v1/search/vals',
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class ValListResponsesPageCursorURL extends PageCursorURL<ValListResponse> {}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A Val
|
|
23
|
-
*/
|
|
24
|
-
export interface ValListResponse {
|
|
25
|
-
/**
|
|
26
|
-
* This val's id
|
|
27
|
-
*/
|
|
28
|
-
id: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The user who created this val
|
|
32
|
-
*/
|
|
33
|
-
author: ValListResponse.Author | null;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* TypeScript code associated with this val
|
|
37
|
-
*/
|
|
38
|
-
code: string | null;
|
|
39
|
-
|
|
40
|
-
createdAt: string;
|
|
41
|
-
|
|
42
|
-
links: ValListResponse.Links;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The name of this val
|
|
46
|
-
*/
|
|
47
|
-
name: string;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* This resource's privacy setting. Unlisted resources do not appear on profile
|
|
51
|
-
* pages or elsewhere, but you can link to them.
|
|
52
|
-
*/
|
|
53
|
-
privacy: 'public' | 'unlisted' | 'private';
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Whether this val is available publicly on Val Town
|
|
57
|
-
*/
|
|
58
|
-
public: boolean;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* The type of a val. HTTP can receive web requests, Email can receive emails, Cron
|
|
62
|
-
* runs periodically, and Script can be used for libraries or one-off calculations
|
|
63
|
-
*/
|
|
64
|
-
type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext';
|
|
65
|
-
|
|
66
|
-
updatedAt: string;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* The URL of this resource on the Val Town website
|
|
70
|
-
*/
|
|
71
|
-
url: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* The version of this val, starting at zero
|
|
75
|
-
*/
|
|
76
|
-
version: number;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export namespace ValListResponse {
|
|
80
|
-
/**
|
|
81
|
-
* The user who created this val
|
|
82
|
-
*/
|
|
83
|
-
export interface Author {
|
|
84
|
-
id: string;
|
|
85
|
-
|
|
86
|
-
username: string | null;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface Links {
|
|
90
|
-
/**
|
|
91
|
-
* The URL of this Val's source code as a module
|
|
92
|
-
*/
|
|
93
|
-
module: string;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* The URL of this val on this API
|
|
97
|
-
*/
|
|
98
|
-
self: string;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* The endpoint to retrieve this val's versions
|
|
102
|
-
*/
|
|
103
|
-
versions: string;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* This val's web endpoint, where it serves a website or API
|
|
107
|
-
*/
|
|
108
|
-
endpoint?: string;
|
|
16
|
+
): Core.PagePromise<BasicValsPageCursorURL, Shared.BasicVal> {
|
|
17
|
+
return this._client.getAPIList('/v1/search/vals', BasicValsPageCursorURL, { query, ...options });
|
|
109
18
|
}
|
|
110
19
|
}
|
|
111
20
|
|
|
@@ -116,12 +25,8 @@ export interface ValListParams extends PageCursorURLParams {
|
|
|
116
25
|
query: string;
|
|
117
26
|
}
|
|
118
27
|
|
|
119
|
-
Vals.ValListResponsesPageCursorURL = ValListResponsesPageCursorURL;
|
|
120
|
-
|
|
121
28
|
export declare namespace Vals {
|
|
122
|
-
export {
|
|
123
|
-
type ValListResponse as ValListResponse,
|
|
124
|
-
ValListResponsesPageCursorURL as ValListResponsesPageCursorURL,
|
|
125
|
-
type ValListParams as ValListParams,
|
|
126
|
-
};
|
|
29
|
+
export { type ValListParams as ValListParams };
|
|
127
30
|
}
|
|
31
|
+
|
|
32
|
+
export { BasicValsPageCursorURL };
|
package/src/resources/shared.ts
CHANGED
|
@@ -1,6 +1,202 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { PageCursorURL } from '../pagination';
|
|
3
|
+
import { Cursor, PageCursorURL } from '../pagination';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A Val
|
|
7
|
+
*/
|
|
8
|
+
export interface BasicVal {
|
|
9
|
+
/**
|
|
10
|
+
* This val's id
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The user who created this val
|
|
16
|
+
*/
|
|
17
|
+
author: BasicVal.Author | null;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* TypeScript code associated with this val
|
|
21
|
+
*/
|
|
22
|
+
code: string | null;
|
|
23
|
+
|
|
24
|
+
createdAt: string;
|
|
25
|
+
|
|
26
|
+
links: BasicVal.Links;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The name of this val
|
|
30
|
+
*/
|
|
31
|
+
name: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* This resource's privacy setting. Unlisted resources do not appear on profile
|
|
35
|
+
* pages or elsewhere, but you can link to them.
|
|
36
|
+
*/
|
|
37
|
+
privacy: 'public' | 'unlisted' | 'private';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Whether this val is available publicly on Val Town
|
|
41
|
+
*/
|
|
42
|
+
public: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The type of a val. HTTP can receive web requests, Email can receive emails, Cron
|
|
46
|
+
* runs periodically, and Script can be used for libraries or one-off calculations
|
|
47
|
+
*/
|
|
48
|
+
type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext';
|
|
49
|
+
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The URL of this resource on the Val Town website
|
|
54
|
+
*/
|
|
55
|
+
url: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The version of this val, starting at zero
|
|
59
|
+
*/
|
|
60
|
+
version: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export namespace BasicVal {
|
|
64
|
+
/**
|
|
65
|
+
* The user who created this val
|
|
66
|
+
*/
|
|
67
|
+
export interface Author {
|
|
68
|
+
id: string;
|
|
69
|
+
|
|
70
|
+
username: string | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface Links {
|
|
74
|
+
/**
|
|
75
|
+
* The URL of this Val's source code as a module
|
|
76
|
+
*/
|
|
77
|
+
module: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The URL of this val on this API
|
|
81
|
+
*/
|
|
82
|
+
self: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The endpoint to retrieve this val's versions
|
|
86
|
+
*/
|
|
87
|
+
versions: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* This val's web endpoint, where it serves a website or API
|
|
91
|
+
*/
|
|
92
|
+
endpoint?: string;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A Legacy Val
|
|
98
|
+
*/
|
|
99
|
+
export interface ExtendedVal {
|
|
100
|
+
/**
|
|
101
|
+
* This val's id
|
|
102
|
+
*/
|
|
103
|
+
id: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The user who created this val
|
|
107
|
+
*/
|
|
108
|
+
author: ExtendedVal.Author | null;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* TypeScript code associated with this val
|
|
112
|
+
*/
|
|
113
|
+
code: string | null;
|
|
114
|
+
|
|
115
|
+
createdAt: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* How many likes this val has received
|
|
119
|
+
*/
|
|
120
|
+
likeCount: number;
|
|
121
|
+
|
|
122
|
+
links: ExtendedVal.Links;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The name of this val
|
|
126
|
+
*/
|
|
127
|
+
name: string;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* This resource's privacy setting. Unlisted resources do not appear on profile
|
|
131
|
+
* pages or elsewhere, but you can link to them.
|
|
132
|
+
*/
|
|
133
|
+
privacy: 'public' | 'unlisted' | 'private';
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Whether this val is available publicly on Val Town
|
|
137
|
+
*/
|
|
138
|
+
public: boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* This val's readme, as Markdown
|
|
142
|
+
*/
|
|
143
|
+
readme: string | null;
|
|
144
|
+
|
|
145
|
+
referenceCount: number;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The type of a val. HTTP can receive web requests, Email can receive emails, Cron
|
|
149
|
+
* runs periodically, and Script can be used for libraries or one-off calculations
|
|
150
|
+
*/
|
|
151
|
+
type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext';
|
|
152
|
+
|
|
153
|
+
updatedAt: string;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The URL of this resource on the Val Town website
|
|
157
|
+
*/
|
|
158
|
+
url: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The version of this val, starting at zero
|
|
162
|
+
*/
|
|
163
|
+
version: number;
|
|
164
|
+
|
|
165
|
+
versionCreatedAt?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export namespace ExtendedVal {
|
|
169
|
+
/**
|
|
170
|
+
* The user who created this val
|
|
171
|
+
*/
|
|
172
|
+
export interface Author {
|
|
173
|
+
id: string;
|
|
174
|
+
|
|
175
|
+
username: string | null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface Links {
|
|
179
|
+
/**
|
|
180
|
+
* The URL of this Val's source code as a module
|
|
181
|
+
*/
|
|
182
|
+
module: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The URL of this val on this API
|
|
186
|
+
*/
|
|
187
|
+
self: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The endpoint to retrieve this val's versions
|
|
191
|
+
*/
|
|
192
|
+
versions: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* This val's web endpoint, where it serves a website or API
|
|
196
|
+
*/
|
|
197
|
+
endpoint?: string;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
4
200
|
|
|
5
201
|
/**
|
|
6
202
|
* Links to use for pagination
|
|
@@ -165,4 +361,8 @@ export namespace Val {
|
|
|
165
361
|
}
|
|
166
362
|
}
|
|
167
363
|
|
|
364
|
+
export class BasicValsPageCursorURL extends PageCursorURL<BasicVal> {}
|
|
365
|
+
|
|
168
366
|
export class ValsPageCursorURL extends PageCursorURL<Val> {}
|
|
367
|
+
|
|
368
|
+
export class ValsCursor extends Cursor<Val> {}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import * as Core from '../../core';
|
|
5
|
+
import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
|
|
6
|
+
|
|
7
|
+
export class EnvironmentVariables extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new environment variable scoped to this project.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const environmentVariable =
|
|
14
|
+
* await client.vals.environmentVariables.create(
|
|
15
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
16
|
+
* { key: 'key', value: 'value' },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(
|
|
21
|
+
valId: string,
|
|
22
|
+
body: EnvironmentVariableCreateParams,
|
|
23
|
+
options?: Core.RequestOptions,
|
|
24
|
+
): Core.APIPromise<EnvironmentVariableCreateResponse> {
|
|
25
|
+
return this._client.post(`/v2/vals/${valId}/environment_variables`, { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Update a environment variable scoped to this project.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const environmentVariable =
|
|
34
|
+
* await client.vals.environmentVariables.update(
|
|
35
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
36
|
+
* 'key',
|
|
37
|
+
* { value: 'value' },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
update(
|
|
42
|
+
valId: string,
|
|
43
|
+
key: string,
|
|
44
|
+
body: EnvironmentVariableUpdateParams,
|
|
45
|
+
options?: Core.RequestOptions,
|
|
46
|
+
): Core.APIPromise<EnvironmentVariableUpdateResponse> {
|
|
47
|
+
return this._client.put(`/v2/vals/${valId}/environment_variables/${key}`, { body, ...options });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* List environment variables defined in this project. This only includes names,
|
|
52
|
+
* not values.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* // Automatically fetches more pages as needed.
|
|
57
|
+
* for await (const environmentVariableListResponse of client.vals.environmentVariables.list(
|
|
58
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
59
|
+
* { limit: 1, offset: 0 },
|
|
60
|
+
* )) {
|
|
61
|
+
* // ...
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
list(
|
|
66
|
+
valId: string,
|
|
67
|
+
query: EnvironmentVariableListParams,
|
|
68
|
+
options?: Core.RequestOptions,
|
|
69
|
+
): Core.PagePromise<EnvironmentVariableListResponsesPageCursorURL, EnvironmentVariableListResponse> {
|
|
70
|
+
return this._client.getAPIList(
|
|
71
|
+
`/v2/vals/${valId}/environment_variables`,
|
|
72
|
+
EnvironmentVariableListResponsesPageCursorURL,
|
|
73
|
+
{ query, ...options },
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Delete a environment variable scoped to this project.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* await client.vals.environmentVariables.delete(
|
|
83
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
84
|
+
* 'key',
|
|
85
|
+
* );
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
delete(valId: string, key: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
89
|
+
return this._client.delete(`/v2/vals/${valId}/environment_variables/${key}`, {
|
|
90
|
+
...options,
|
|
91
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export class EnvironmentVariableListResponsesPageCursorURL extends PageCursorURL<EnvironmentVariableListResponse> {}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* An environment variable
|
|
100
|
+
*/
|
|
101
|
+
export interface EnvironmentVariableCreateResponse {
|
|
102
|
+
createdAt: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Optional description of the environment variable
|
|
106
|
+
*/
|
|
107
|
+
description: string | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Name or key of the environment variable, accessible via Deno.env or process.env
|
|
111
|
+
*/
|
|
112
|
+
key: string;
|
|
113
|
+
|
|
114
|
+
updatedAt: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* An environment variable
|
|
119
|
+
*/
|
|
120
|
+
export interface EnvironmentVariableUpdateResponse {
|
|
121
|
+
createdAt: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Optional description of the environment variable
|
|
125
|
+
*/
|
|
126
|
+
description: string | null;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Name or key of the environment variable, accessible via Deno.env or process.env
|
|
130
|
+
*/
|
|
131
|
+
key: string;
|
|
132
|
+
|
|
133
|
+
updatedAt: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* An environment variable
|
|
138
|
+
*/
|
|
139
|
+
export interface EnvironmentVariableListResponse {
|
|
140
|
+
createdAt: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Optional description of the environment variable
|
|
144
|
+
*/
|
|
145
|
+
description: string | null;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Name or key of the environment variable, accessible via Deno.env or process.env
|
|
149
|
+
*/
|
|
150
|
+
key: string;
|
|
151
|
+
|
|
152
|
+
updatedAt: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface EnvironmentVariableCreateParams {
|
|
156
|
+
/**
|
|
157
|
+
* Name or key of the environment variable, accessible via Deno.env or process.env
|
|
158
|
+
*/
|
|
159
|
+
key: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Value of the environment variable.
|
|
163
|
+
*/
|
|
164
|
+
value: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Optional description of the environment variable
|
|
168
|
+
*/
|
|
169
|
+
description?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface EnvironmentVariableUpdateParams {
|
|
173
|
+
/**
|
|
174
|
+
* Value of the environment variable.
|
|
175
|
+
*/
|
|
176
|
+
value: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Optional description of the environment variable
|
|
180
|
+
*/
|
|
181
|
+
description?: string;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface EnvironmentVariableListParams extends PageCursorURLParams {}
|
|
185
|
+
|
|
186
|
+
EnvironmentVariables.EnvironmentVariableListResponsesPageCursorURL =
|
|
187
|
+
EnvironmentVariableListResponsesPageCursorURL;
|
|
188
|
+
|
|
189
|
+
export declare namespace EnvironmentVariables {
|
|
190
|
+
export {
|
|
191
|
+
type EnvironmentVariableCreateResponse as EnvironmentVariableCreateResponse,
|
|
192
|
+
type EnvironmentVariableUpdateResponse as EnvironmentVariableUpdateResponse,
|
|
193
|
+
type EnvironmentVariableListResponse as EnvironmentVariableListResponse,
|
|
194
|
+
EnvironmentVariableListResponsesPageCursorURL as EnvironmentVariableListResponsesPageCursorURL,
|
|
195
|
+
type EnvironmentVariableCreateParams as EnvironmentVariableCreateParams,
|
|
196
|
+
type EnvironmentVariableUpdateParams as EnvironmentVariableUpdateParams,
|
|
197
|
+
type EnvironmentVariableListParams as EnvironmentVariableListParams,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
@@ -9,6 +9,16 @@ export {
|
|
|
9
9
|
type BranchCreateParams,
|
|
10
10
|
type BranchListParams,
|
|
11
11
|
} from './branches';
|
|
12
|
+
export {
|
|
13
|
+
EnvironmentVariableListResponsesPageCursorURL,
|
|
14
|
+
EnvironmentVariables,
|
|
15
|
+
type EnvironmentVariableCreateResponse,
|
|
16
|
+
type EnvironmentVariableUpdateResponse,
|
|
17
|
+
type EnvironmentVariableListResponse,
|
|
18
|
+
type EnvironmentVariableCreateParams,
|
|
19
|
+
type EnvironmentVariableUpdateParams,
|
|
20
|
+
type EnvironmentVariableListParams,
|
|
21
|
+
} from './environment-variables';
|
|
12
22
|
export {
|
|
13
23
|
FileRetrieveResponsesPageCursorURL,
|
|
14
24
|
Files,
|
|
@@ -21,4 +31,4 @@ export {
|
|
|
21
31
|
type FileDeleteParams,
|
|
22
32
|
type FileGetContentParams,
|
|
23
33
|
} from './files';
|
|
24
|
-
export { Vals, type
|
|
34
|
+
export { Vals, type ValCreateParams, type ValListParams } from './vals';
|