dub 0.1.0 → 0.2.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 +15 -0
- package/README.md +26 -14
- package/core.d.ts +2 -0
- package/core.d.ts.map +1 -1
- package/core.js +5 -3
- package/core.js.map +1 -1
- package/core.mjs +5 -3
- package/core.mjs.map +1 -1
- package/index.d.mts +9 -5
- package/index.d.ts +9 -5
- package/index.d.ts.map +1 -1
- package/index.js +11 -8
- package/index.js.map +1 -1
- package/index.mjs +11 -8
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/links/bulk.d.ts +1 -1
- package/resources/links/bulk.d.ts.map +1 -1
- package/resources/links/bulk.js +1 -1
- package/resources/links/bulk.js.map +1 -1
- package/resources/links/bulk.mjs +1 -1
- package/resources/links/bulk.mjs.map +1 -1
- package/resources/links/info.d.ts +2 -2
- package/resources/links/info.d.ts.map +1 -1
- package/resources/links/info.js +3 -2
- package/resources/links/info.js.map +1 -1
- package/resources/links/info.mjs +3 -2
- package/resources/links/info.mjs.map +1 -1
- package/resources/links/links.d.ts +5 -5
- package/resources/links/links.d.ts.map +1 -1
- package/resources/links/links.js +6 -5
- package/resources/links/links.js.map +1 -1
- package/resources/links/links.mjs +6 -5
- package/resources/links/links.mjs.map +1 -1
- package/resources/projects/index.d.ts +2 -2
- package/resources/projects/index.d.ts.map +1 -1
- package/resources/projects/index.js.map +1 -1
- package/resources/projects/index.mjs.map +1 -1
- package/resources/projects/projects.d.ts +10 -1
- package/resources/projects/projects.d.ts.map +1 -1
- package/resources/projects/projects.js +2 -1
- package/resources/projects/projects.js.map +1 -1
- package/resources/projects/projects.mjs +2 -1
- package/resources/projects/projects.mjs.map +1 -1
- package/resources/projects/tags.d.ts +16 -3
- package/resources/projects/tags.d.ts.map +1 -1
- package/resources/projects/tags.js +4 -2
- package/resources/projects/tags.js.map +1 -1
- package/resources/projects/tags.mjs +4 -2
- package/resources/projects/tags.mjs.map +1 -1
- package/src/core.ts +6 -4
- package/src/index.ts +19 -11
- package/src/resources/index.ts +7 -1
- package/src/resources/links/bulk.ts +2 -2
- package/src/resources/links/info.ts +4 -3
- package/src/resources/links/links.ts +10 -9
- package/src/resources/projects/index.ts +2 -2
- package/src/resources/projects/projects.ts +12 -1
- package/src/resources/projects/tags.ts +20 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -7,13 +7,15 @@ class Tags extends resource_1.APIResource {
|
|
|
7
7
|
/**
|
|
8
8
|
* Create a new tag for the authenticated project.
|
|
9
9
|
*/
|
|
10
|
-
create(
|
|
10
|
+
create(params, options) {
|
|
11
|
+
const { projectSlug = this._client.projectSlug, ...body } = params;
|
|
11
12
|
return this._client.post(`/projects/${projectSlug}/tags`, { body, ...options });
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Retrieve a list of tags for the authenticated project.
|
|
15
16
|
*/
|
|
16
|
-
list(
|
|
17
|
+
list(params, options) {
|
|
18
|
+
const { projectSlug = this._client.projectSlug } = params;
|
|
17
19
|
return this._client.get(`/projects/${projectSlug}/tags`, options);
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/resources/projects/tags.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,2CAA2C;AAG3C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;OAEG;IACH,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/resources/projects/tags.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,2CAA2C;AAG3C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;OAEG;IACH,MAAM,CAAC,MAAuB,EAAE,OAA6B;QAC3D,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,WAAW,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAqB,EAAE,OAA6B;QACvD,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,WAAW,OAAO,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF;AAhBD,oBAgBC;AA0CD,WAAiB,IAAI;AAKrB,CAAC,EALgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAKpB"}
|
|
@@ -4,13 +4,15 @@ export class Tags extends APIResource {
|
|
|
4
4
|
/**
|
|
5
5
|
* Create a new tag for the authenticated project.
|
|
6
6
|
*/
|
|
7
|
-
create(
|
|
7
|
+
create(params, options) {
|
|
8
|
+
const { projectSlug = this._client.projectSlug, ...body } = params;
|
|
8
9
|
return this._client.post(`/projects/${projectSlug}/tags`, { body, ...options });
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Retrieve a list of tags for the authenticated project.
|
|
12
13
|
*/
|
|
13
|
-
list(
|
|
14
|
+
list(params, options) {
|
|
15
|
+
const { projectSlug = this._client.projectSlug } = params;
|
|
14
16
|
return this._client.get(`/projects/${projectSlug}/tags`, options);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.mjs","sourceRoot":"","sources":["../../src/resources/projects/tags.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,cAAc;AAG1C,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"tags.mjs","sourceRoot":"","sources":["../../src/resources/projects/tags.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,cAAc;AAG1C,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,MAAM,CAAC,MAAuB,EAAE,OAA6B;QAC3D,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,WAAW,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAqB,EAAE,OAA6B;QACvD,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,WAAW,OAAO,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF;AA0CD,WAAiB,IAAI;AAKrB,CAAC,EALgB,IAAI,KAAJ,IAAI,QAKpB"}
|
package/src/core.ts
CHANGED
|
@@ -443,8 +443,8 @@ export abstract class APIClient {
|
|
|
443
443
|
query = { ...defaultQuery, ...query } as Req;
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
if (query) {
|
|
447
|
-
url.search = this.stringifyQuery(query);
|
|
446
|
+
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
447
|
+
url.search = this.stringifyQuery(query as Record<string, unknown>);
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
return url.toString();
|
|
@@ -952,14 +952,16 @@ export const ensurePresent = <T>(value: T | null | undefined): T => {
|
|
|
952
952
|
/**
|
|
953
953
|
* Read an environment variable.
|
|
954
954
|
*
|
|
955
|
+
* Trims beginning and trailing whitespace.
|
|
956
|
+
*
|
|
955
957
|
* Will return undefined if the environment variable doesn't exist or cannot be accessed.
|
|
956
958
|
*/
|
|
957
959
|
export const readEnv = (env: string): string | undefined => {
|
|
958
960
|
if (typeof process !== 'undefined') {
|
|
959
|
-
return process.env?.[env] ?? undefined;
|
|
961
|
+
return process.env?.[env]?.trim() ?? undefined;
|
|
960
962
|
}
|
|
961
963
|
if (typeof Deno !== 'undefined') {
|
|
962
|
-
return Deno.env?.get?.(env);
|
|
964
|
+
return Deno.env?.get?.(env)?.trim();
|
|
963
965
|
}
|
|
964
966
|
return undefined;
|
|
965
967
|
};
|
package/src/index.ts
CHANGED
|
@@ -8,9 +8,11 @@ import * as API from "./resources/index";
|
|
|
8
8
|
|
|
9
9
|
export interface ClientOptions {
|
|
10
10
|
/**
|
|
11
|
-
* Defaults to process.env['
|
|
11
|
+
* Defaults to process.env['DUB_API_KEY'].
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
token?: string;
|
|
14
|
+
|
|
15
|
+
projectSlug?: string | null;
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
@@ -71,14 +73,16 @@ export interface ClientOptions {
|
|
|
71
73
|
|
|
72
74
|
/** API Client for interfacing with the Dub API. */
|
|
73
75
|
export class Dub extends Core.APIClient {
|
|
74
|
-
|
|
76
|
+
token: string;
|
|
77
|
+
projectSlug: string | null;
|
|
75
78
|
|
|
76
79
|
private _options: ClientOptions;
|
|
77
80
|
|
|
78
81
|
/**
|
|
79
82
|
* API Client for interfacing with the Dub API.
|
|
80
83
|
*
|
|
81
|
-
* @param {string} [opts.
|
|
84
|
+
* @param {string} [opts.token=process.env['DUB_API_KEY'] ?? undefined]
|
|
85
|
+
* @param {string | null} [opts.projectSlug]
|
|
82
86
|
* @param {string} [opts.baseURL=process.env['DUB_BASE_URL'] ?? https://api.dub.co] - Override the default base URL for the API.
|
|
83
87
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
84
88
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -89,19 +93,21 @@ export class Dub extends Core.APIClient {
|
|
|
89
93
|
*/
|
|
90
94
|
constructor({
|
|
91
95
|
baseURL = Core.readEnv('DUB_BASE_URL'),
|
|
92
|
-
|
|
96
|
+
token = Core.readEnv('DUB_API_KEY'),
|
|
97
|
+
projectSlug = null,
|
|
93
98
|
...opts
|
|
94
99
|
}: ClientOptions = {}) {
|
|
95
|
-
if (
|
|
100
|
+
if (token === undefined) {
|
|
96
101
|
throw new Errors.DubError(
|
|
97
|
-
"The
|
|
102
|
+
"The DUB_API_KEY environment variable is missing or empty; either provide it, or instantiate the Dub client with an token option, like new Dub({ token: 'My Token' }).",
|
|
98
103
|
);
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
const options: ClientOptions = {
|
|
102
|
-
|
|
107
|
+
token,
|
|
108
|
+
projectSlug,
|
|
103
109
|
...opts,
|
|
104
|
-
baseURL: baseURL
|
|
110
|
+
baseURL: baseURL || `https://api.dub.co`,
|
|
105
111
|
};
|
|
106
112
|
|
|
107
113
|
super({
|
|
@@ -113,7 +119,8 @@ export class Dub extends Core.APIClient {
|
|
|
113
119
|
});
|
|
114
120
|
this._options = options;
|
|
115
121
|
|
|
116
|
-
this.
|
|
122
|
+
this.token = token;
|
|
123
|
+
this.projectSlug = projectSlug;
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
links: API.Links = new API.Links(this);
|
|
@@ -131,7 +138,7 @@ export class Dub extends Core.APIClient {
|
|
|
131
138
|
}
|
|
132
139
|
|
|
133
140
|
protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
|
|
134
|
-
return { Authorization: `Bearer ${this.
|
|
141
|
+
return { Authorization: `Bearer ${this.token}` };
|
|
135
142
|
}
|
|
136
143
|
|
|
137
144
|
static Dub = this;
|
|
@@ -188,6 +195,7 @@ export namespace Dub {
|
|
|
188
195
|
export import Project = API.Project;
|
|
189
196
|
export import ProjectDetails = API.ProjectDetails;
|
|
190
197
|
export import ProjectListResponse = API.ProjectListResponse;
|
|
198
|
+
export import ProjectRetrieveParams = API.ProjectRetrieveParams;
|
|
191
199
|
|
|
192
200
|
export import Link = API.Link;
|
|
193
201
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -9,4 +9,10 @@ export {
|
|
|
9
9
|
LinkDeleteParams,
|
|
10
10
|
Links,
|
|
11
11
|
} from './links/links';
|
|
12
|
-
export {
|
|
12
|
+
export {
|
|
13
|
+
Project,
|
|
14
|
+
ProjectDetails,
|
|
15
|
+
ProjectListResponse,
|
|
16
|
+
ProjectRetrieveParams,
|
|
17
|
+
Projects,
|
|
18
|
+
} from './projects/projects';
|
|
@@ -10,7 +10,7 @@ export class Bulk extends APIResource {
|
|
|
10
10
|
* Bulk create up to 100 links for the authenticated project.
|
|
11
11
|
*/
|
|
12
12
|
create(params: BulkCreateParams, options?: Core.RequestOptions): Core.APIPromise<BulkCreateResponse> {
|
|
13
|
-
const { projectSlug, ...body } = params;
|
|
13
|
+
const { projectSlug = this._client.projectSlug, ...body } = params;
|
|
14
14
|
return this._client.post('/links/bulk', { query: { projectSlug }, body, ...options });
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -22,7 +22,7 @@ export interface BulkCreateParams {
|
|
|
22
22
|
* Query param: The slug for the project to create links for. E.g. for
|
|
23
23
|
* app.dub.co/acme, the projectSlug is 'acme'.
|
|
24
24
|
*/
|
|
25
|
-
projectSlug
|
|
25
|
+
projectSlug?: string;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export namespace BulkCreateParams {
|
|
@@ -9,8 +9,9 @@ export class Info extends APIResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* Retrieve the info for a link from their domain and key.
|
|
11
11
|
*/
|
|
12
|
-
retrieve(
|
|
13
|
-
|
|
12
|
+
retrieve(params: InfoRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Link> {
|
|
13
|
+
const { projectSlug = this._client.projectSlug, ...query } = params;
|
|
14
|
+
return this._client.get('/links/info', { query: { projectSlug, ...query }, ...options });
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -30,7 +31,7 @@ export interface InfoRetrieveParams {
|
|
|
30
31
|
* The slug for the project that the link belongs to. E.g. for app.dub.co/acme, the
|
|
31
32
|
* projectSlug is 'acme'.
|
|
32
33
|
*/
|
|
33
|
-
projectSlug
|
|
34
|
+
projectSlug?: string;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export namespace Info {
|
|
@@ -15,7 +15,7 @@ export class Links extends APIResource {
|
|
|
15
15
|
* Create a new link for the authenticated project.
|
|
16
16
|
*/
|
|
17
17
|
create(params: LinkCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Link> {
|
|
18
|
-
const { projectSlug, ...body } = params;
|
|
18
|
+
const { projectSlug = this._client.projectSlug, ...body } = params;
|
|
19
19
|
return this._client.post('/links', { query: { projectSlug }, body, ...options });
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -27,7 +27,7 @@ export class Links extends APIResource {
|
|
|
27
27
|
params: LinkUpdateParams,
|
|
28
28
|
options?: Core.RequestOptions,
|
|
29
29
|
): Core.APIPromise<Shared.Link> {
|
|
30
|
-
const { projectSlug, ...body } = params;
|
|
30
|
+
const { projectSlug = this._client.projectSlug, ...body } = params;
|
|
31
31
|
return this._client.put(`/links/${linkId}`, { query: { projectSlug }, body, ...options });
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -35,8 +35,9 @@ export class Links extends APIResource {
|
|
|
35
35
|
* Retrieve a list of links for the authenticated project. The list will be
|
|
36
36
|
* paginated and the provided query parameters allow filtering the returned links.
|
|
37
37
|
*/
|
|
38
|
-
list(
|
|
39
|
-
|
|
38
|
+
list(params: LinkListParams, options?: Core.RequestOptions): Core.APIPromise<LinkListResponse> {
|
|
39
|
+
const { projectSlug = this._client.projectSlug, ...query } = params;
|
|
40
|
+
return this._client.get('/links', { query: { projectSlug, ...query }, ...options });
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -47,7 +48,7 @@ export class Links extends APIResource {
|
|
|
47
48
|
params: LinkDeleteParams,
|
|
48
49
|
options?: Core.RequestOptions,
|
|
49
50
|
): Core.APIPromise<Shared.Link> {
|
|
50
|
-
const { projectSlug } = params;
|
|
51
|
+
const { projectSlug = this._client.projectSlug } = params;
|
|
51
52
|
return this._client.delete(`/links/${linkId}`, { query: { projectSlug }, ...options });
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -59,7 +60,7 @@ export interface LinkCreateParams {
|
|
|
59
60
|
* Query param: The slug for the project to create links for. E.g. for
|
|
60
61
|
* app.dub.co/acme, the projectSlug is 'acme'.
|
|
61
62
|
*/
|
|
62
|
-
projectSlug
|
|
63
|
+
projectSlug?: string;
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
* Body param: The domain of the short link.
|
|
@@ -160,7 +161,7 @@ export interface LinkUpdateParams {
|
|
|
160
161
|
* Query param: The slug for the project that the link belongs to. E.g. for
|
|
161
162
|
* app.dub.co/acme, the projectSlug is 'acme'.
|
|
162
163
|
*/
|
|
163
|
-
projectSlug
|
|
164
|
+
projectSlug?: string;
|
|
164
165
|
|
|
165
166
|
/**
|
|
166
167
|
* Body param: The Android destination URL for the short link for Android device
|
|
@@ -261,7 +262,7 @@ export interface LinkListParams {
|
|
|
261
262
|
* The slug for the project to retrieve links for. E.g. for app.dub.co/acme, the
|
|
262
263
|
* projectSlug is 'acme'.
|
|
263
264
|
*/
|
|
264
|
-
projectSlug
|
|
265
|
+
projectSlug?: string;
|
|
265
266
|
|
|
266
267
|
/**
|
|
267
268
|
* The domain to filter the links by. E.g. 'ac.me'. If not provided, all links for
|
|
@@ -308,7 +309,7 @@ export interface LinkDeleteParams {
|
|
|
308
309
|
* The slug for the project that the link belongs to. E.g. for app.dub.co/acme, the
|
|
309
310
|
* projectSlug is 'acme'.
|
|
310
311
|
*/
|
|
311
|
-
projectSlug
|
|
312
|
+
projectSlug?: string;
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
export namespace Links {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
export { Project, ProjectDetails, ProjectListResponse, Projects } from './projects';
|
|
4
|
-
export { Tag, TagListResponse, TagCreateParams, Tags } from './tags';
|
|
3
|
+
export { Project, ProjectDetails, ProjectListResponse, ProjectRetrieveParams, Projects } from './projects';
|
|
4
|
+
export { Tag, TagListResponse, TagCreateParams, TagListParams, Tags } from './tags';
|
|
@@ -11,7 +11,8 @@ export class Projects extends APIResource {
|
|
|
11
11
|
/**
|
|
12
12
|
* Retrieve a project for the authenticated user.
|
|
13
13
|
*/
|
|
14
|
-
retrieve(
|
|
14
|
+
retrieve(params: ProjectRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<ProjectDetails> {
|
|
15
|
+
const { projectSlug = this._client.projectSlug } = params;
|
|
15
16
|
return this._client.get(`/projects/${projectSlug}`, options);
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -111,12 +112,22 @@ export namespace ProjectDetails {
|
|
|
111
112
|
|
|
112
113
|
export type ProjectListResponse = Array<Project>;
|
|
113
114
|
|
|
115
|
+
export interface ProjectRetrieveParams {
|
|
116
|
+
/**
|
|
117
|
+
* The slug for the project to retrieve. E.g. for app.dub.co/acme, the projectSlug
|
|
118
|
+
* is 'acme'.
|
|
119
|
+
*/
|
|
120
|
+
projectSlug?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
114
123
|
export namespace Projects {
|
|
115
124
|
export import Project = ProjectsAPI.Project;
|
|
116
125
|
export import ProjectDetails = ProjectsAPI.ProjectDetails;
|
|
117
126
|
export import ProjectListResponse = ProjectsAPI.ProjectListResponse;
|
|
127
|
+
export import ProjectRetrieveParams = ProjectsAPI.ProjectRetrieveParams;
|
|
118
128
|
export import Tags = TagsAPI.Tags;
|
|
119
129
|
export import Tag = TagsAPI.Tag;
|
|
120
130
|
export import TagListResponse = TagsAPI.TagListResponse;
|
|
121
131
|
export import TagCreateParams = TagsAPI.TagCreateParams;
|
|
132
|
+
export import TagListParams = TagsAPI.TagListParams;
|
|
122
133
|
}
|
|
@@ -8,14 +8,16 @@ export class Tags extends APIResource {
|
|
|
8
8
|
/**
|
|
9
9
|
* Create a new tag for the authenticated project.
|
|
10
10
|
*/
|
|
11
|
-
create(
|
|
11
|
+
create(params: TagCreateParams, options?: Core.RequestOptions): Core.APIPromise<Tag> {
|
|
12
|
+
const { projectSlug = this._client.projectSlug, ...body } = params;
|
|
12
13
|
return this._client.post(`/projects/${projectSlug}/tags`, { body, ...options });
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Retrieve a list of tags for the authenticated project.
|
|
17
18
|
*/
|
|
18
|
-
list(
|
|
19
|
+
list(params: TagListParams, options?: Core.RequestOptions): Core.APIPromise<TagListResponse> {
|
|
20
|
+
const { projectSlug = this._client.projectSlug } = params;
|
|
19
21
|
return this._client.get(`/projects/${projectSlug}/tags`, options);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -41,13 +43,28 @@ export type TagListResponse = Array<Tag>;
|
|
|
41
43
|
|
|
42
44
|
export interface TagCreateParams {
|
|
43
45
|
/**
|
|
44
|
-
* The
|
|
46
|
+
* Path param: The slug for the project to create tags for. E.g. for
|
|
47
|
+
* app.dub.co/acme, the projectSlug is 'acme'.
|
|
48
|
+
*/
|
|
49
|
+
projectSlug?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Body param: The name of the tag to create.
|
|
45
53
|
*/
|
|
46
54
|
tag?: string;
|
|
47
55
|
}
|
|
48
56
|
|
|
57
|
+
export interface TagListParams {
|
|
58
|
+
/**
|
|
59
|
+
* The slug for the project to retrieve tags for. E.g. for app.dub.co/acme, the
|
|
60
|
+
* projectSlug is 'acme'.
|
|
61
|
+
*/
|
|
62
|
+
projectSlug?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
49
65
|
export namespace Tags {
|
|
50
66
|
export import Tag = TagsAPI.Tag;
|
|
51
67
|
export import TagListResponse = TagsAPI.TagListResponse;
|
|
52
68
|
export import TagCreateParams = TagsAPI.TagCreateParams;
|
|
69
|
+
export import TagListParams = TagsAPI.TagListParams;
|
|
53
70
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.2.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.2.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|