dub 0.7.0 → 0.9.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 +17 -0
- package/README.md +27 -23
- package/index.d.mts +5 -3
- package/index.d.ts +5 -3
- package/index.d.ts.map +1 -1
- package/index.js +4 -0
- package/index.js.map +1 -1
- package/index.mjs +4 -0
- package/index.mjs.map +1 -1
- package/package.json +3 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/links/bulk.d.ts +176 -10
- package/resources/links/bulk.d.ts.map +1 -1
- package/resources/links/bulk.js +2 -2
- package/resources/links/bulk.js.map +1 -1
- package/resources/links/bulk.mjs +2 -2
- package/resources/links/bulk.mjs.map +1 -1
- package/resources/links/index.d.ts +2 -2
- package/resources/links/index.d.ts.map +1 -1
- package/resources/links/index.js.map +1 -1
- package/resources/links/index.mjs.map +1 -1
- package/resources/links/info.d.ts +156 -5
- package/resources/links/info.d.ts.map +1 -1
- package/resources/links/info.js.map +1 -1
- package/resources/links/info.mjs.map +1 -1
- package/resources/links/links.d.ts +554 -52
- package/resources/links/links.d.ts.map +1 -1
- package/resources/links/links.js.map +1 -1
- 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 +135 -34
- package/resources/projects/projects.d.ts.map +1 -1
- package/resources/projects/projects.js.map +1 -1
- package/resources/projects/projects.mjs.map +1 -1
- package/resources/projects/tags.d.ts +0 -49
- package/resources/projects/tags.d.ts.map +1 -1
- package/resources/projects/tags.js +0 -16
- package/resources/projects/tags.js.map +1 -1
- package/resources/projects/tags.mjs +0 -16
- package/resources/projects/tags.mjs.map +1 -1
- package/resources/qr.d.ts +7 -6
- package/resources/qr.d.ts.map +1 -1
- package/resources/qr.js +5 -4
- package/resources/qr.js.map +1 -1
- package/resources/qr.mjs +5 -4
- package/resources/qr.mjs.map +1 -1
- package/src/index.ts +9 -3
- package/src/resources/index.ts +4 -3
- package/src/resources/links/bulk.ts +216 -13
- package/src/resources/links/index.ts +4 -2
- package/src/resources/links/info.ts +190 -5
- package/src/resources/links/links.ts +670 -53
- package/src/resources/projects/index.ts +2 -2
- package/src/resources/projects/projects.ts +166 -34
- package/src/resources/projects/tags.ts +1 -66
- package/src/resources/qr.ts +16 -7
- package/src/uploads.ts +2 -3
- package/src/version.ts +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js +2 -1
- package/uploads.js.map +1 -1
- package/uploads.mjs +2 -1
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,21 +1,171 @@
|
|
|
1
1
|
import * as Core from 'dub/core';
|
|
2
2
|
import { APIResource } from 'dub/resource';
|
|
3
3
|
import * as InfoAPI from 'dub/resources/links/info';
|
|
4
|
-
import * as LinksAPI from 'dub/resources/links/links';
|
|
5
4
|
export declare class Info extends APIResource {
|
|
6
5
|
/**
|
|
7
6
|
* Retrieve the info for a link from their domain and key.
|
|
8
7
|
*/
|
|
9
|
-
retrieve(params: InfoRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<
|
|
8
|
+
retrieve(params: InfoRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<InfoRetrieveResponse>;
|
|
9
|
+
}
|
|
10
|
+
export interface InfoRetrieveResponse {
|
|
11
|
+
/**
|
|
12
|
+
* The unique ID of the short link.
|
|
13
|
+
*/
|
|
14
|
+
id: string;
|
|
15
|
+
/**
|
|
16
|
+
* The Android destination URL for the short link for Android device targeting.
|
|
17
|
+
*/
|
|
18
|
+
android: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the short link is archived.
|
|
21
|
+
*/
|
|
22
|
+
archived: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The number of clicks on the short link.
|
|
25
|
+
*/
|
|
26
|
+
clicks: number;
|
|
27
|
+
/**
|
|
28
|
+
* The comments for the short link.
|
|
29
|
+
*/
|
|
30
|
+
comments: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* The date and time when the short link was created.
|
|
33
|
+
*/
|
|
34
|
+
createdAt: string;
|
|
35
|
+
/**
|
|
36
|
+
* The description of the short link generated via `api.dub.co/metatags`. Will be
|
|
37
|
+
* used for Custom Social Media Cards if `proxy` is true.
|
|
38
|
+
*/
|
|
39
|
+
description: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* The domain of the short link. If not provided, the primary domain for the
|
|
42
|
+
* project will be used (or `dub.sh` if the project has no domains).
|
|
43
|
+
*/
|
|
44
|
+
domain: string;
|
|
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
|
+
* Geo targeting information for the short link in JSON format
|
|
52
|
+
* `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo
|
|
53
|
+
*/
|
|
54
|
+
geo: Record<string, string> | null;
|
|
55
|
+
/**
|
|
56
|
+
* The image of the short link generated via `api.dub.co/metatags`. Will be used
|
|
57
|
+
* for Custom Social Media Cards if `proxy` is true.
|
|
58
|
+
*/
|
|
59
|
+
image: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* The iOS destination URL for the short link for iOS device targeting.
|
|
62
|
+
*/
|
|
63
|
+
ios: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* The short link slug. If not provided, a random 7-character slug will be
|
|
66
|
+
* generated.
|
|
67
|
+
*/
|
|
68
|
+
key: string;
|
|
69
|
+
/**
|
|
70
|
+
* The date and time when the short link was last clicked.
|
|
71
|
+
*/
|
|
72
|
+
lastClicked: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* The password required to access the destination URL of the short link.
|
|
75
|
+
*/
|
|
76
|
+
password: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* The project ID of the short link.
|
|
79
|
+
*/
|
|
80
|
+
projectId: string;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the short link uses Custom Social Media Cards feature.
|
|
83
|
+
*/
|
|
84
|
+
proxy: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the short link's stats are publicly accessible.
|
|
87
|
+
*/
|
|
88
|
+
publicStats: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* The full URL of the QR code for the short link (e.g.
|
|
91
|
+
* `https://api.dub.co/qr?url=https://dub.sh/try`).
|
|
92
|
+
*/
|
|
93
|
+
qrCode: string;
|
|
94
|
+
/**
|
|
95
|
+
* Whether the short link uses link cloaking.
|
|
96
|
+
*/
|
|
97
|
+
rewrite: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* The full URL of the short link, including the https protocol (e.g.
|
|
100
|
+
* `https://dub.sh/try`).
|
|
101
|
+
*/
|
|
102
|
+
shortLink: string;
|
|
103
|
+
/**
|
|
104
|
+
* The tags assigned to the short link.
|
|
105
|
+
*/
|
|
106
|
+
tags: Array<InfoRetrieveResponse.Tag> | null;
|
|
107
|
+
/**
|
|
108
|
+
* The title of the short link generated via `api.dub.co/metatags`. Will be used
|
|
109
|
+
* for Custom Social Media Cards if `proxy` is true.
|
|
110
|
+
*/
|
|
111
|
+
title: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* The date and time when the short link was last updated.
|
|
114
|
+
*/
|
|
115
|
+
updatedAt: string;
|
|
116
|
+
/**
|
|
117
|
+
* The destination URL of the short link.
|
|
118
|
+
*/
|
|
119
|
+
url: string;
|
|
120
|
+
/**
|
|
121
|
+
* The user ID of the creator of the short link.
|
|
122
|
+
*/
|
|
123
|
+
userId: string;
|
|
124
|
+
/**
|
|
125
|
+
* The UTM campaign of the short link.
|
|
126
|
+
*/
|
|
127
|
+
utm_campaign: string | null;
|
|
128
|
+
/**
|
|
129
|
+
* The UTM content of the short link.
|
|
130
|
+
*/
|
|
131
|
+
utm_content: string | null;
|
|
132
|
+
/**
|
|
133
|
+
* The UTM medium of the short link.
|
|
134
|
+
*/
|
|
135
|
+
utm_medium: string | null;
|
|
136
|
+
/**
|
|
137
|
+
* The UTM source of the short link.
|
|
138
|
+
*/
|
|
139
|
+
utm_source: string | null;
|
|
140
|
+
/**
|
|
141
|
+
* The UTM term of the short link.
|
|
142
|
+
*/
|
|
143
|
+
utm_term: string | null;
|
|
144
|
+
}
|
|
145
|
+
export declare namespace InfoRetrieveResponse {
|
|
146
|
+
interface Tag {
|
|
147
|
+
/**
|
|
148
|
+
* The unique ID of the tag.
|
|
149
|
+
*/
|
|
150
|
+
id: string;
|
|
151
|
+
/**
|
|
152
|
+
* The color of the tag.
|
|
153
|
+
*/
|
|
154
|
+
color: 'red' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'brown';
|
|
155
|
+
/**
|
|
156
|
+
* The name of the tag.
|
|
157
|
+
*/
|
|
158
|
+
name: string;
|
|
159
|
+
}
|
|
10
160
|
}
|
|
11
161
|
export interface InfoRetrieveParams {
|
|
12
162
|
/**
|
|
13
|
-
* The domain of the link to retrieve. E.g. for `
|
|
14
|
-
* `
|
|
163
|
+
* The domain of the link to retrieve. E.g. for `d.to/github`, the domain is
|
|
164
|
+
* `d.to`.
|
|
15
165
|
*/
|
|
16
166
|
domain: string;
|
|
17
167
|
/**
|
|
18
|
-
* The key of the link to retrieve. E.g. for `
|
|
168
|
+
* The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`.
|
|
19
169
|
*/
|
|
20
170
|
key: string;
|
|
21
171
|
/**
|
|
@@ -25,6 +175,7 @@ export interface InfoRetrieveParams {
|
|
|
25
175
|
projectSlug?: string;
|
|
26
176
|
}
|
|
27
177
|
export declare namespace Info {
|
|
178
|
+
export import InfoRetrieveResponse = InfoAPI.InfoRetrieveResponse;
|
|
28
179
|
export import InfoRetrieveParams = InfoAPI.InfoRetrieveParams;
|
|
29
180
|
}
|
|
30
181
|
//# sourceMappingURL=info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/resources/links/info.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/resources/links/info.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AAEpD,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAI3G;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,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GAAG,MAAM,GAAG,OAAO,CAAC;QAEzE;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yBAAiB,IAAI,CAAC;IACpB,MAAM,QAAQ,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAClE,MAAM,QAAQ,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/resources/links/info.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,2CAA2C;
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/resources/links/info.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,2CAA2C;AAG3C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,MAA0B,EAAE,OAA6B;QAChE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AARD,oBAQC;AA8MD,WAAiB,IAAI;AAGrB,CAAC,EAHgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAGpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.mjs","sourceRoot":"","sources":["../../src/resources/links/info.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"info.mjs","sourceRoot":"","sources":["../../src/resources/links/info.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,cAAc;AAG1C,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,MAA0B,EAAE,OAA6B;QAChE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AA8MD,WAAiB,IAAI;AAGrB,CAAC,EAHgB,IAAI,KAAJ,IAAI,QAGpB"}
|