dub 0.0.0 → 0.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 +9 -0
- package/LICENSE +201 -0
- package/README.md +241 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +90 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +230 -0
- package/core.d.ts.map +1 -0
- package/core.js +848 -0
- package/core.js.map +1 -0
- package/core.mjs +818 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +118 -0
- package/index.d.ts +118 -0
- package/index.d.ts.map +1 -0
- package/index.js +109 -0
- package/index.js.map +1 -0
- package/index.mjs +81 -0
- package/index.mjs.map +1 -0
- package/package.json +100 -7
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/index.d.ts +4 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +24 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +5 -0
- package/resources/index.mjs.map +1 -0
- package/resources/links/bulk.d.ts +101 -0
- package/resources/links/bulk.d.ts.map +1 -0
- package/resources/links/bulk.js +18 -0
- package/resources/links/bulk.js.map +1 -0
- package/resources/links/bulk.mjs +14 -0
- package/resources/links/bulk.mjs.map +1 -0
- package/resources/links/index.d.ts +4 -0
- package/resources/links/index.d.ts.map +1 -0
- package/resources/links/index.js +11 -0
- package/resources/links/index.js.map +1 -0
- package/resources/links/index.mjs +5 -0
- package/resources/links/index.mjs.map +1 -0
- package/resources/links/info.d.ts +30 -0
- package/resources/links/info.d.ts.map +1 -0
- package/resources/links/info.js +17 -0
- package/resources/links/info.js.map +1 -0
- package/resources/links/info.mjs +13 -0
- package/resources/links/info.mjs.map +1 -0
- package/resources/links/links.d.ts +253 -0
- package/resources/links/links.d.ts.map +1 -0
- package/resources/links/links.js +71 -0
- package/resources/links/links.js.map +1 -0
- package/resources/links/links.mjs +44 -0
- package/resources/links/links.mjs.map +1 -0
- package/resources/projects/index.d.ts +3 -0
- package/resources/projects/index.d.ts.map +1 -0
- package/resources/projects/index.js +9 -0
- package/resources/projects/index.js.map +1 -0
- package/resources/projects/index.mjs +4 -0
- package/resources/projects/index.mjs.map +1 -0
- package/resources/projects/projects.d.ts +98 -0
- package/resources/projects/projects.d.ts.map +1 -0
- package/resources/projects/projects.js +52 -0
- package/resources/projects/projects.js.map +1 -0
- package/resources/projects/projects.mjs +25 -0
- package/resources/projects/projects.mjs.map +1 -0
- package/resources/projects/tags.d.ts +40 -0
- package/resources/projects/tags.d.ts.map +1 -0
- package/resources/projects/tags.js +23 -0
- package/resources/projects/tags.js.map +1 -0
- package/resources/projects/tags.mjs +19 -0
- package/resources/projects/tags.mjs.map +1 -0
- package/resources/shared.d.ts +125 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +83 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +63 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1122 -0
- package/src/error.ts +146 -0
- package/src/index.ts +195 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/index.ts +12 -0
- package/src/resources/links/bulk.ts +126 -0
- package/src/resources/links/index.ts +12 -0
- package/src/resources/links/info.ts +38 -0
- package/src/resources/links/links.ts +325 -0
- package/src/resources/projects/index.ts +4 -0
- package/src/resources/projects/projects.ts +122 -0
- package/src/resources/projects/tags.ts +53 -0
- package/src/resources/shared.ts +154 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +245 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +163 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +150 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/main.js +0 -8
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import * as Core from "../../core";
|
|
4
|
+
import { APIResource } from "../../resource";
|
|
5
|
+
import * as LinksAPI from "./links";
|
|
6
|
+
import * as Shared from "../shared";
|
|
7
|
+
import * as BulkAPI from "./bulk";
|
|
8
|
+
import * as InfoAPI from "./info";
|
|
9
|
+
|
|
10
|
+
export class Links extends APIResource {
|
|
11
|
+
info: InfoAPI.Info = new InfoAPI.Info(this._client);
|
|
12
|
+
bulk: BulkAPI.Bulk = new BulkAPI.Bulk(this._client);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create a new link for the authenticated project.
|
|
16
|
+
*/
|
|
17
|
+
create(params: LinkCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Link> {
|
|
18
|
+
const { projectSlug, ...body } = params;
|
|
19
|
+
return this._client.post('/links', { query: { projectSlug }, body, ...options });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Edit a link for the authenticated project.
|
|
24
|
+
*/
|
|
25
|
+
update(
|
|
26
|
+
linkId: string,
|
|
27
|
+
params: LinkUpdateParams,
|
|
28
|
+
options?: Core.RequestOptions,
|
|
29
|
+
): Core.APIPromise<Shared.Link> {
|
|
30
|
+
const { projectSlug, ...body } = params;
|
|
31
|
+
return this._client.put(`/links/${linkId}`, { query: { projectSlug }, body, ...options });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve a list of links for the authenticated project. The list will be
|
|
36
|
+
* paginated and the provided query parameters allow filtering the returned links.
|
|
37
|
+
*/
|
|
38
|
+
list(query: LinkListParams, options?: Core.RequestOptions): Core.APIPromise<LinkListResponse> {
|
|
39
|
+
return this._client.get('/links', { query, ...options });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Delete a link for the authenticated project.
|
|
44
|
+
*/
|
|
45
|
+
delete(
|
|
46
|
+
linkId: string,
|
|
47
|
+
params: LinkDeleteParams,
|
|
48
|
+
options?: Core.RequestOptions,
|
|
49
|
+
): Core.APIPromise<Shared.Link> {
|
|
50
|
+
const { projectSlug } = params;
|
|
51
|
+
return this._client.delete(`/links/${linkId}`, { query: { projectSlug }, ...options });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type LinkListResponse = Array<Shared.Link>;
|
|
56
|
+
|
|
57
|
+
export interface LinkCreateParams {
|
|
58
|
+
/**
|
|
59
|
+
* Query param: The slug for the project to create links for. E.g. for
|
|
60
|
+
* app.dub.co/acme, the projectSlug is 'acme'.
|
|
61
|
+
*/
|
|
62
|
+
projectSlug: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Body param: The domain of the short link.
|
|
66
|
+
*/
|
|
67
|
+
domain: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Body param: The destination URL of the short link.
|
|
71
|
+
*/
|
|
72
|
+
url: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Body param: The Android destination URL for the short link for Android device
|
|
76
|
+
* targeting.
|
|
77
|
+
*/
|
|
78
|
+
android?: string | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Body param: Whether the short link is archived.
|
|
82
|
+
*/
|
|
83
|
+
archived?: boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Body param: The comments for the short link.
|
|
87
|
+
*/
|
|
88
|
+
comments?: string | null;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Body param: The description of the short link generated via api.dub.co/metatags.
|
|
92
|
+
* Will be used for Custom Social Media Cards if `proxy` is true.
|
|
93
|
+
*/
|
|
94
|
+
description?: string | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Body param: The date and time when the short link will expire in ISO-8601
|
|
98
|
+
* format. Must be in the future.
|
|
99
|
+
*/
|
|
100
|
+
expiresAt?: string | null;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Body param: Geo targeting information for the short link in JSON format
|
|
104
|
+
* {[COUNTRY]: "https://example.com" }. Learn more: https://dub.sh/geo
|
|
105
|
+
*/
|
|
106
|
+
geo?: Record<string, string> | null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Body param: The image of the short link generated via api.dub.co/metatags. Will
|
|
110
|
+
* be used for Custom Social Media Cards if `proxy` is true.
|
|
111
|
+
*/
|
|
112
|
+
image?: string | null;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Body param: The iOS destination URL for the short link for iOS device targeting.
|
|
116
|
+
*/
|
|
117
|
+
ios?: string | null;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Body param: The short link slug. If not provided, a random 7-character slug will
|
|
121
|
+
* be generated.
|
|
122
|
+
*/
|
|
123
|
+
key?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Body param: The password required to access the destination URL of the short
|
|
127
|
+
* link.
|
|
128
|
+
*/
|
|
129
|
+
password?: string | null;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Body param: Whether the short link uses Custom Social Media Cards feature.
|
|
133
|
+
*/
|
|
134
|
+
proxy?: boolean;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Body param: Whether the short link's stats are publicly accessible.
|
|
138
|
+
*/
|
|
139
|
+
publicStats?: boolean;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Body param: Whether the short link uses link cloaking.
|
|
143
|
+
*/
|
|
144
|
+
rewrite?: boolean;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Body param: The unique id of the tag assigned to the short link.
|
|
148
|
+
*/
|
|
149
|
+
tagId?: string | null;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Body param: The title of the short link generated via api.dub.co/metatags. Will
|
|
153
|
+
* be used for Custom Social Media Cards if `proxy` is true.
|
|
154
|
+
*/
|
|
155
|
+
title?: string | null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface LinkUpdateParams {
|
|
159
|
+
/**
|
|
160
|
+
* Query param: The slug for the project that the link belongs to. E.g. for
|
|
161
|
+
* app.dub.co/acme, the projectSlug is 'acme'.
|
|
162
|
+
*/
|
|
163
|
+
projectSlug: string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Body param: The Android destination URL for the short link for Android device
|
|
167
|
+
* targeting.
|
|
168
|
+
*/
|
|
169
|
+
android?: string | null;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Body param: Whether the short link is archived.
|
|
173
|
+
*/
|
|
174
|
+
archived?: boolean;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Body param: The comments for the short link.
|
|
178
|
+
*/
|
|
179
|
+
comments?: string | null;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Body param: The description of the short link generated via api.dub.co/metatags.
|
|
183
|
+
* Will be used for Custom Social Media Cards if `proxy` is true.
|
|
184
|
+
*/
|
|
185
|
+
description?: string | null;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Body param: The domain of the short link.
|
|
189
|
+
*/
|
|
190
|
+
domain?: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Body param: The date and time when the short link will expire in ISO-8601
|
|
194
|
+
* format. Must be in the future.
|
|
195
|
+
*/
|
|
196
|
+
expiresAt?: string | null;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Body param: Geo targeting information for the short link in JSON format
|
|
200
|
+
* {[COUNTRY]: "https://example.com" }. Learn more: https://dub.sh/geo
|
|
201
|
+
*/
|
|
202
|
+
geo?: Record<string, string> | null;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Body param: The image of the short link generated via api.dub.co/metatags. Will
|
|
206
|
+
* be used for Custom Social Media Cards if `proxy` is true.
|
|
207
|
+
*/
|
|
208
|
+
image?: string | null;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Body param: The iOS destination URL for the short link for iOS device targeting.
|
|
212
|
+
*/
|
|
213
|
+
ios?: string | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Body param: The short link slug. If not provided, a random 7-character slug will
|
|
217
|
+
* be generated.
|
|
218
|
+
*/
|
|
219
|
+
key?: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Body param: The password required to access the destination URL of the short
|
|
223
|
+
* link.
|
|
224
|
+
*/
|
|
225
|
+
password?: string | null;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Body param: Whether the short link uses Custom Social Media Cards feature.
|
|
229
|
+
*/
|
|
230
|
+
proxy?: boolean;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Body param: Whether the short link's stats are publicly accessible.
|
|
234
|
+
*/
|
|
235
|
+
publicStats?: boolean;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Body param: Whether the short link uses link cloaking.
|
|
239
|
+
*/
|
|
240
|
+
rewrite?: boolean;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Body param: The unique id of the tag assigned to the short link.
|
|
244
|
+
*/
|
|
245
|
+
tagId?: string | null;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Body param: The title of the short link generated via api.dub.co/metatags. Will
|
|
249
|
+
* be used for Custom Social Media Cards if `proxy` is true.
|
|
250
|
+
*/
|
|
251
|
+
title?: string | null;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Body param: The destination URL of the short link.
|
|
255
|
+
*/
|
|
256
|
+
url?: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface LinkListParams {
|
|
260
|
+
/**
|
|
261
|
+
* The slug for the project to retrieve links for. E.g. for app.dub.co/acme, the
|
|
262
|
+
* projectSlug is 'acme'.
|
|
263
|
+
*/
|
|
264
|
+
projectSlug: string;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The domain to filter the links by. E.g. 'ac.me'. If not provided, all links for
|
|
268
|
+
* the project will be returned.
|
|
269
|
+
*/
|
|
270
|
+
domain?: string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* The page number for pagination (each page contains 100 links).
|
|
274
|
+
*/
|
|
275
|
+
page?: number;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* The search term to filter the links by. The search term will be matched against
|
|
279
|
+
* the short link slug and the destination url.
|
|
280
|
+
*/
|
|
281
|
+
search?: string;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Whether to include archived links in the response. Defaults to false if not
|
|
285
|
+
* provided.
|
|
286
|
+
*/
|
|
287
|
+
showArchived?: true | false;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The field to sort the links by. The default is 'createdAt', and sort order is
|
|
291
|
+
* always descending.
|
|
292
|
+
*/
|
|
293
|
+
sort?: 'createdAt' | 'clicks' | 'lastClicked';
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* The tag ID to filter the links by.
|
|
297
|
+
*/
|
|
298
|
+
tagId?: string;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* The user ID to filter the links by.
|
|
302
|
+
*/
|
|
303
|
+
userId?: string;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface LinkDeleteParams {
|
|
307
|
+
/**
|
|
308
|
+
* The slug for the project that the link belongs to. E.g. for app.dub.co/acme, the
|
|
309
|
+
* projectSlug is 'acme'.
|
|
310
|
+
*/
|
|
311
|
+
projectSlug: string;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export namespace Links {
|
|
315
|
+
export import LinkListResponse = LinksAPI.LinkListResponse;
|
|
316
|
+
export import LinkCreateParams = LinksAPI.LinkCreateParams;
|
|
317
|
+
export import LinkUpdateParams = LinksAPI.LinkUpdateParams;
|
|
318
|
+
export import LinkListParams = LinksAPI.LinkListParams;
|
|
319
|
+
export import LinkDeleteParams = LinksAPI.LinkDeleteParams;
|
|
320
|
+
export import Info = InfoAPI.Info;
|
|
321
|
+
export import InfoRetrieveParams = InfoAPI.InfoRetrieveParams;
|
|
322
|
+
export import Bulk = BulkAPI.Bulk;
|
|
323
|
+
export import BulkCreateResponse = BulkAPI.BulkCreateResponse;
|
|
324
|
+
export import BulkCreateParams = BulkAPI.BulkCreateParams;
|
|
325
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import * as Core from "../../core";
|
|
4
|
+
import { APIResource } from "../../resource";
|
|
5
|
+
import * as ProjectsAPI from "./projects";
|
|
6
|
+
import * as TagsAPI from "./tags";
|
|
7
|
+
|
|
8
|
+
export class Projects extends APIResource {
|
|
9
|
+
tags: TagsAPI.Tags = new TagsAPI.Tags(this._client);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Retrieve a project for the authenticated user.
|
|
13
|
+
*/
|
|
14
|
+
retrieve(projectSlug: string, options?: Core.RequestOptions): Core.APIPromise<ProjectDetails> {
|
|
15
|
+
return this._client.get(`/projects/${projectSlug}`, options);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve a list of projects for the authenticated user.
|
|
20
|
+
*/
|
|
21
|
+
list(options?: Core.RequestOptions): Core.APIPromise<ProjectListResponse> {
|
|
22
|
+
return this._client.get('/projects', options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Project {
|
|
27
|
+
/**
|
|
28
|
+
* The unique ID of the project.
|
|
29
|
+
*/
|
|
30
|
+
id?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The date and time when the billing cycle starts for the project.
|
|
34
|
+
*/
|
|
35
|
+
billingCycleStart?: number | null;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The date and time when the project was created.
|
|
39
|
+
*/
|
|
40
|
+
createdAt?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The logo of the project.
|
|
44
|
+
*/
|
|
45
|
+
logo?: string | null;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The name of the project.
|
|
49
|
+
*/
|
|
50
|
+
name?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The plan of the project.
|
|
54
|
+
*/
|
|
55
|
+
plan?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The slug of the project.
|
|
59
|
+
*/
|
|
60
|
+
slug?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The Stripe ID of the project.
|
|
64
|
+
*/
|
|
65
|
+
stripeId?: string | null;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The usage of the project.
|
|
69
|
+
*/
|
|
70
|
+
usage?: number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The usage limit of the project.
|
|
74
|
+
*/
|
|
75
|
+
usageLimit?: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ProjectDetails extends Project {
|
|
79
|
+
/**
|
|
80
|
+
* The domains of the project.
|
|
81
|
+
*/
|
|
82
|
+
domains?: Array<ProjectDetails.Domain>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The role of the authenticated user in the project.
|
|
86
|
+
*/
|
|
87
|
+
users?: Array<ProjectDetails.User>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export namespace ProjectDetails {
|
|
91
|
+
/**
|
|
92
|
+
* The domains of the project.
|
|
93
|
+
*/
|
|
94
|
+
export interface Domain {
|
|
95
|
+
/**
|
|
96
|
+
* The domain of the project.
|
|
97
|
+
*/
|
|
98
|
+
slug?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The role of the authenticated user in the project.
|
|
103
|
+
*/
|
|
104
|
+
export interface User {
|
|
105
|
+
/**
|
|
106
|
+
* The role of the authenticated user in the project.
|
|
107
|
+
*/
|
|
108
|
+
role?: string;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type ProjectListResponse = Array<Project>;
|
|
113
|
+
|
|
114
|
+
export namespace Projects {
|
|
115
|
+
export import Project = ProjectsAPI.Project;
|
|
116
|
+
export import ProjectDetails = ProjectsAPI.ProjectDetails;
|
|
117
|
+
export import ProjectListResponse = ProjectsAPI.ProjectListResponse;
|
|
118
|
+
export import Tags = TagsAPI.Tags;
|
|
119
|
+
export import Tag = TagsAPI.Tag;
|
|
120
|
+
export import TagListResponse = TagsAPI.TagListResponse;
|
|
121
|
+
export import TagCreateParams = TagsAPI.TagCreateParams;
|
|
122
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import * as Core from "../../core";
|
|
4
|
+
import { APIResource } from "../../resource";
|
|
5
|
+
import * as TagsAPI from "./tags";
|
|
6
|
+
|
|
7
|
+
export class Tags extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new tag for the authenticated project.
|
|
10
|
+
*/
|
|
11
|
+
create(projectSlug: string, body: TagCreateParams, options?: Core.RequestOptions): Core.APIPromise<Tag> {
|
|
12
|
+
return this._client.post(`/projects/${projectSlug}/tags`, { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve a list of tags for the authenticated project.
|
|
17
|
+
*/
|
|
18
|
+
list(projectSlug: string, options?: Core.RequestOptions): Core.APIPromise<TagListResponse> {
|
|
19
|
+
return this._client.get(`/projects/${projectSlug}/tags`, options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Tag {
|
|
24
|
+
/**
|
|
25
|
+
* The unique ID of the tag.
|
|
26
|
+
*/
|
|
27
|
+
id?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The color of the tag.
|
|
31
|
+
*/
|
|
32
|
+
color?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The name of the tag.
|
|
36
|
+
*/
|
|
37
|
+
name?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type TagListResponse = Array<Tag>;
|
|
41
|
+
|
|
42
|
+
export interface TagCreateParams {
|
|
43
|
+
/**
|
|
44
|
+
* The name of the tag to create.
|
|
45
|
+
*/
|
|
46
|
+
tag?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export namespace Tags {
|
|
50
|
+
export import Tag = TagsAPI.Tag;
|
|
51
|
+
export import TagListResponse = TagsAPI.TagListResponse;
|
|
52
|
+
export import TagCreateParams = TagsAPI.TagCreateParams;
|
|
53
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
export interface Link {
|
|
4
|
+
/**
|
|
5
|
+
* The unique ID of the short link.
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The Android destination URL for the short link for Android device targeting.
|
|
11
|
+
*/
|
|
12
|
+
android?: string | null;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Whether the short link is archived.
|
|
16
|
+
*/
|
|
17
|
+
archived?: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The number of clicks on the short link.
|
|
21
|
+
*/
|
|
22
|
+
clicks?: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The comments for the short link.
|
|
26
|
+
*/
|
|
27
|
+
comments?: string | null;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The date and time when the short link was created.
|
|
31
|
+
*/
|
|
32
|
+
createdAt?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The description of the short link generated via api.dub.co/metatags. Will be
|
|
36
|
+
* used for Custom Social Media Cards if `proxy` is true.
|
|
37
|
+
*/
|
|
38
|
+
description?: string | null;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The domain of the short link.
|
|
42
|
+
*/
|
|
43
|
+
domain?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The date and time when the short link will expire in ISO-8601 format. Must be in
|
|
47
|
+
* the future.
|
|
48
|
+
*/
|
|
49
|
+
expiresAt?: string | null;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Geo targeting information for the short link in JSON format {[COUNTRY]:
|
|
53
|
+
* "https://example.com" }. Learn more: https://dub.sh/geo
|
|
54
|
+
*/
|
|
55
|
+
geo?: Record<string, string> | null;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The image of the short link generated via api.dub.co/metatags. Will be used for
|
|
59
|
+
* Custom Social Media Cards if `proxy` is true.
|
|
60
|
+
*/
|
|
61
|
+
image?: string | null;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The iOS destination URL for the short link for iOS device targeting.
|
|
65
|
+
*/
|
|
66
|
+
ios?: string | null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The short link slug. If not provided, a random 7-character slug will be
|
|
70
|
+
* generated.
|
|
71
|
+
*/
|
|
72
|
+
key?: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The date and time when the short link was last clicked.
|
|
76
|
+
*/
|
|
77
|
+
lastClicked?: string | null;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The password required to access the destination URL of the short link.
|
|
81
|
+
*/
|
|
82
|
+
password?: string | null;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The project ID of the short link.
|
|
86
|
+
*/
|
|
87
|
+
projectId?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Whether the short link uses Custom Social Media Cards feature.
|
|
91
|
+
*/
|
|
92
|
+
proxy?: boolean;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Whether the short link's stats are publicly accessible.
|
|
96
|
+
*/
|
|
97
|
+
publicStats?: boolean;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Whether the short link uses link cloaking.
|
|
101
|
+
*/
|
|
102
|
+
rewrite?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The unique id of the tag assigned to the short link.
|
|
106
|
+
*/
|
|
107
|
+
tagId?: string | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The title of the short link generated via api.dub.co/metatags. Will be used for
|
|
111
|
+
* Custom Social Media Cards if `proxy` is true.
|
|
112
|
+
*/
|
|
113
|
+
title?: string | null;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The date and time when the short link was last updated.
|
|
117
|
+
*/
|
|
118
|
+
updatedAt?: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The destination URL of the short link.
|
|
122
|
+
*/
|
|
123
|
+
url?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The user ID of the creator of the short link.
|
|
127
|
+
*/
|
|
128
|
+
userId?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The UTM campaign of the short link.
|
|
132
|
+
*/
|
|
133
|
+
utm_campaign?: string | null;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The UTM content of the short link.
|
|
137
|
+
*/
|
|
138
|
+
utm_content?: string | null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The UTM medium of the short link.
|
|
142
|
+
*/
|
|
143
|
+
utm_medium?: string | null;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The UTM source of the short link.
|
|
147
|
+
*/
|
|
148
|
+
utm_source?: string | null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The UTM term of the short link.
|
|
152
|
+
*/
|
|
153
|
+
utm_term?: string | null;
|
|
154
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as types from '../_shims/node-types';
|
|
3
|
+
import { setShims } from '../_shims/registry';
|
|
4
|
+
import { getRuntime } from '../_shims/node-runtime';
|
|
5
|
+
setShims(getRuntime());
|
|
6
|
+
|
|
7
|
+
declare module '../_shims/manual-types' {
|
|
8
|
+
export namespace manual {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export type Agent = types.Agent;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export import fetch = types.fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
export type Request = types.Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export type RequestInfo = types.RequestInfo;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export type RequestInit = types.RequestInit;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
export type Response = types.Response;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export type ResponseInit = types.ResponseInit;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export type ResponseType = types.ResponseType;
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
export type BodyInit = types.BodyInit;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
export type Headers = types.Headers;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
export type HeadersInit = types.HeadersInit;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
export type BlobPropertyBag = types.BlobPropertyBag;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
export type FilePropertyBag = types.FilePropertyBag;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
export type FileFromPathOptions = types.FileFromPathOptions;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
export import FormData = types.FormData;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
export import File = types.File;
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
export import Blob = types.Blob;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
export type Readable = types.Readable;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
export type FsReadStream = types.FsReadStream;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
export import ReadableStream = types.ReadableStream;
|
|
49
|
+
}
|
|
50
|
+
}
|