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.
Files changed (222) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +201 -0
  3. package/README.md +241 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +90 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +230 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +848 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +818 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +53 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +143 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +127 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +118 -0
  87. package/index.d.ts +118 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +109 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +81 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +100 -7
  94. package/resource.d.ts +6 -0
  95. package/resource.d.ts.map +1 -0
  96. package/resource.js +11 -0
  97. package/resource.js.map +1 -0
  98. package/resource.mjs +7 -0
  99. package/resource.mjs.map +1 -0
  100. package/resources/index.d.ts +4 -0
  101. package/resources/index.d.ts.map +1 -0
  102. package/resources/index.js +24 -0
  103. package/resources/index.js.map +1 -0
  104. package/resources/index.mjs +5 -0
  105. package/resources/index.mjs.map +1 -0
  106. package/resources/links/bulk.d.ts +101 -0
  107. package/resources/links/bulk.d.ts.map +1 -0
  108. package/resources/links/bulk.js +18 -0
  109. package/resources/links/bulk.js.map +1 -0
  110. package/resources/links/bulk.mjs +14 -0
  111. package/resources/links/bulk.mjs.map +1 -0
  112. package/resources/links/index.d.ts +4 -0
  113. package/resources/links/index.d.ts.map +1 -0
  114. package/resources/links/index.js +11 -0
  115. package/resources/links/index.js.map +1 -0
  116. package/resources/links/index.mjs +5 -0
  117. package/resources/links/index.mjs.map +1 -0
  118. package/resources/links/info.d.ts +30 -0
  119. package/resources/links/info.d.ts.map +1 -0
  120. package/resources/links/info.js +17 -0
  121. package/resources/links/info.js.map +1 -0
  122. package/resources/links/info.mjs +13 -0
  123. package/resources/links/info.mjs.map +1 -0
  124. package/resources/links/links.d.ts +253 -0
  125. package/resources/links/links.d.ts.map +1 -0
  126. package/resources/links/links.js +71 -0
  127. package/resources/links/links.js.map +1 -0
  128. package/resources/links/links.mjs +44 -0
  129. package/resources/links/links.mjs.map +1 -0
  130. package/resources/projects/index.d.ts +3 -0
  131. package/resources/projects/index.d.ts.map +1 -0
  132. package/resources/projects/index.js +9 -0
  133. package/resources/projects/index.js.map +1 -0
  134. package/resources/projects/index.mjs +4 -0
  135. package/resources/projects/index.mjs.map +1 -0
  136. package/resources/projects/projects.d.ts +98 -0
  137. package/resources/projects/projects.d.ts.map +1 -0
  138. package/resources/projects/projects.js +52 -0
  139. package/resources/projects/projects.js.map +1 -0
  140. package/resources/projects/projects.mjs +25 -0
  141. package/resources/projects/projects.mjs.map +1 -0
  142. package/resources/projects/tags.d.ts +40 -0
  143. package/resources/projects/tags.d.ts.map +1 -0
  144. package/resources/projects/tags.js +23 -0
  145. package/resources/projects/tags.js.map +1 -0
  146. package/resources/projects/tags.mjs +19 -0
  147. package/resources/projects/tags.mjs.map +1 -0
  148. package/resources/shared.d.ts +125 -0
  149. package/resources/shared.d.ts.map +1 -0
  150. package/resources/shared.js +4 -0
  151. package/resources/shared.js.map +1 -0
  152. package/resources/shared.mjs +3 -0
  153. package/resources/shared.mjs.map +1 -0
  154. package/shims/node.d.ts +29 -0
  155. package/shims/node.d.ts.map +1 -0
  156. package/shims/node.js +31 -0
  157. package/shims/node.js.map +1 -0
  158. package/shims/node.mjs +5 -0
  159. package/shims/node.mjs.map +1 -0
  160. package/shims/web.d.ts +26 -0
  161. package/shims/web.d.ts.map +1 -0
  162. package/shims/web.js +31 -0
  163. package/shims/web.js.map +1 -0
  164. package/shims/web.mjs +5 -0
  165. package/shims/web.mjs.map +1 -0
  166. package/src/_shims/MultipartBody.ts +9 -0
  167. package/src/_shims/README.md +46 -0
  168. package/src/_shims/auto/runtime-bun.ts +4 -0
  169. package/src/_shims/auto/runtime-node.ts +4 -0
  170. package/src/_shims/auto/runtime.ts +4 -0
  171. package/src/_shims/auto/types-node.ts +4 -0
  172. package/src/_shims/auto/types.d.ts +101 -0
  173. package/src/_shims/auto/types.js +3 -0
  174. package/src/_shims/auto/types.mjs +3 -0
  175. package/src/_shims/bun-runtime.ts +14 -0
  176. package/src/_shims/index.d.ts +81 -0
  177. package/src/_shims/index.js +13 -0
  178. package/src/_shims/index.mjs +7 -0
  179. package/src/_shims/manual-types.d.ts +12 -0
  180. package/src/_shims/manual-types.js +3 -0
  181. package/src/_shims/manual-types.mjs +3 -0
  182. package/src/_shims/node-runtime.ts +83 -0
  183. package/src/_shims/node-types.d.ts +42 -0
  184. package/src/_shims/node-types.js +3 -0
  185. package/src/_shims/node-types.mjs +3 -0
  186. package/src/_shims/registry.ts +63 -0
  187. package/src/_shims/web-runtime.ts +103 -0
  188. package/src/_shims/web-types.d.ts +83 -0
  189. package/src/_shims/web-types.js +3 -0
  190. package/src/_shims/web-types.mjs +3 -0
  191. package/src/core.ts +1122 -0
  192. package/src/error.ts +146 -0
  193. package/src/index.ts +195 -0
  194. package/src/lib/.keep +4 -0
  195. package/src/resource.ts +11 -0
  196. package/src/resources/index.ts +12 -0
  197. package/src/resources/links/bulk.ts +126 -0
  198. package/src/resources/links/index.ts +12 -0
  199. package/src/resources/links/info.ts +38 -0
  200. package/src/resources/links/links.ts +325 -0
  201. package/src/resources/projects/index.ts +4 -0
  202. package/src/resources/projects/projects.ts +122 -0
  203. package/src/resources/projects/tags.ts +53 -0
  204. package/src/resources/shared.ts +154 -0
  205. package/src/shims/node.ts +50 -0
  206. package/src/shims/web.ts +50 -0
  207. package/src/tsconfig.json +11 -0
  208. package/src/uploads.ts +245 -0
  209. package/src/version.ts +1 -0
  210. package/uploads.d.ts +75 -0
  211. package/uploads.d.ts.map +1 -0
  212. package/uploads.js +163 -0
  213. package/uploads.js.map +1 -0
  214. package/uploads.mjs +150 -0
  215. package/uploads.mjs.map +1 -0
  216. package/version.d.ts +2 -0
  217. package/version.d.ts.map +1 -0
  218. package/version.js +5 -0
  219. package/version.js.map +1 -0
  220. package/version.mjs +2 -0
  221. package/version.mjs.map +1 -0
  222. 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,4 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ export { Project, ProjectDetails, ProjectListResponse, Projects } from './projects';
4
+ export { Tag, TagListResponse, TagCreateParams, Tags } from './tags';
@@ -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
+ }