@short.io/client-node 1.1.0 → 2.0.1

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.
@@ -1,11 +0,0 @@
1
- export interface SuccessResBody {
2
- success: boolean;
3
- }
4
-
5
- export interface ErrorResBody {
6
- error: string;
7
- }
8
-
9
- export interface StatusResBody {
10
- status: string;
11
- }
@@ -1,44 +0,0 @@
1
- type LinkType = "increment" | "random" | "secure" | "four-char" | "eight-char" | "ten-char";
2
- type DomainState = "extra_records" | "not_registered" | "configured" | "not_configured" | "registration_pending";
3
- type SetupType = "dns" | "js";
4
- type HttpLevel = "none" | "redirect" | "hsts";
5
- type RobotPermission = "allow" | "disallow" | "noindex";
6
-
7
- export interface Domain {
8
- id: number;
9
- hostname: string;
10
- title: string | null;
11
- unicodeHostname: string;
12
- isFavorite: boolean;
13
- faviconURL: string | null;
14
- segmentKey: string | null;
15
- hasFavicon: boolean;
16
- linkType: LinkType;
17
- state: DomainState;
18
- redirect404: string;
19
- hideReferer: boolean;
20
- hideVisitorIp: boolean;
21
- caseSensitive: boolean;
22
- exportEnabled: boolean;
23
- cloaking: boolean;
24
- incrementCounter: string;
25
- setupType: SetupType;
26
- httpsLinks: boolean;
27
- integrationGA: string | null;
28
- integrationFB: string | null;
29
- integrationAdroll: string | null;
30
- integrationGTM: string | null;
31
- webhookURL: string | null;
32
- httpsLevel: HttpLevel;
33
- robots: RobotPermission;
34
- provider: string | null;
35
- purgeExpiredLinks: boolean;
36
- lastPurgeDate: string | null;
37
- createdAt: string;
38
- updatedAt: string;
39
- clientStorage?: string;
40
- TeamId?: number;
41
- }
42
-
43
- export interface DomainCreateOptions
44
- extends Partial<Pick<Domain, "caseSensitive" | "hideReferer" | "httpsLinks" | "linkType" | "redirect404">> {}
@@ -1,4 +0,0 @@
1
- export * from "./common";
2
- export * from "./domain";
3
- export * from "./link";
4
- export * from "./statistics";
package/src/types/link.ts DELETED
@@ -1,159 +0,0 @@
1
- import { ErrorResBody, SuccessResBody } from "./common.js";
2
- import { Domain } from "./domain.js";
3
-
4
- export interface Link {
5
- idString: string;
6
- path: string;
7
- DomainId: number;
8
- createdAt: string;
9
- updatedAt: string | null;
10
- expiresAt: string | null;
11
- shortURL: string;
12
- cloaking: boolean;
13
- OwnerId: number;
14
- originalURL: string;
15
- secureShortURL: string;
16
- title?: string;
17
- expiredURL?: string;
18
- ttl?: string;
19
- source?: string;
20
- duplicate?: boolean;
21
- archived?: boolean;
22
- redirectType?: string;
23
- clicksLimit?: number;
24
- passwordContact?: boolean;
25
- hasPassword?: true;
26
- password?: string;
27
- tags?: string[];
28
- androidURL?: string;
29
- iphoneURL?: string;
30
- utmSource?: string | null;
31
- utmMedium?: string | null;
32
- utmCampaign?: string | null;
33
- utmTerm?: string | null;
34
- utmContent?: string | null;
35
- }
36
-
37
- export interface LinkCountry {
38
- id: string;
39
- LinkIdString: Link["idString"];
40
- country: string;
41
- originalURL: string;
42
- createdAt: Date;
43
- }
44
-
45
- export interface LinkRegion {
46
- id: string;
47
- LinkIdString: Link["idString"];
48
- country: string;
49
- region: string;
50
- originalURL: string;
51
- name: string;
52
- createdAt: Date;
53
- }
54
-
55
- export interface LinkCreateOptions
56
- extends Pick<
57
- Partial<Link>,
58
- | "source"
59
- | "cloaking"
60
- | "password"
61
- | "redirectType"
62
- | "expiredURL"
63
- | "title"
64
- | "path"
65
- | "androidURL"
66
- | "iphoneURL"
67
- | "clicksLimit"
68
- > {
69
- tags?: string[];
70
- allowDuplicates?: boolean;
71
- folderId?: LinkFolder["id"];
72
- expiresAt?: number;
73
- ttl?: string;
74
- createdAt?: number;
75
- }
76
-
77
- export interface LinkUpdateOptions extends LinkCreateOptions {
78
- originalURL?: Link["originalURL"];
79
- archived?: Link["archived"];
80
- icon?: string;
81
- splitURL?: string;
82
- splitPercent?: number;
83
- passwordContact?: boolean;
84
- utmSource?: string | null;
85
- utmMedium?: string | null;
86
- utmCampaign?: string | null;
87
- utmTerm?: string | null;
88
- utmContent?: string | null;
89
- }
90
-
91
- export interface LinkBulkCreateOptions extends LinkCreateOptions, Pick<Link, "originalURL"> {}
92
-
93
- export interface LinkWithUser extends Link, User {}
94
-
95
- export interface LinksAndCount {
96
- links: LinkWithUser[];
97
- count: number;
98
- nextPageToken: string | null;
99
- hasMore?: boolean;
100
- }
101
-
102
- export interface LinkListOptions {
103
- domain_id: string;
104
- beforeDate?: string;
105
- afterDate?: string;
106
- dateSortOrder?: SortingOrder;
107
- createdAt?: string;
108
- idString?: string;
109
- pageToken?: string;
110
- folderId?: LinkFolder["id"];
111
- limit?: number;
112
- offset?: number;
113
- }
114
-
115
- export interface UpdateLinkErrorRes extends ErrorResBody {
116
- field: string;
117
- }
118
-
119
- export interface DeleteLinkRes extends SuccessResBody, Pick<Link, "idString"> {}
120
-
121
- export interface GetLinkQRCodeOptions {
122
- type?: string;
123
- size?: number;
124
- color?: string;
125
- backgroundColor?: string;
126
- }
127
-
128
- export type LinkOpenGraphData = [string, string][];
129
-
130
- export interface LinkCountryCreateOptions {
131
- country: string;
132
- originalURL: string;
133
- }
134
-
135
- export interface LinkRegionCreateOptions {
136
- country: string;
137
- region: string;
138
- originalURL: string;
139
- }
140
-
141
- export interface LinkRegionDeleteOptions {
142
- country: string;
143
- region: string;
144
- }
145
-
146
- type SortingOrder = "asc" | "desc";
147
-
148
- interface User {
149
- email: string;
150
- id: number;
151
- name: string;
152
- photoURL: string;
153
- }
154
-
155
- interface LinkFolder {
156
- id: string;
157
- name: string;
158
- DomainId: Domain["id"];
159
- }
@@ -1,242 +0,0 @@
1
- import { Link } from "./link";
2
-
3
- export interface GetStatisticsOptions extends StartEndDate {
4
- period?: Period;
5
- tzOffset?: number;
6
- clicksChartInterval?: Interval;
7
- }
8
-
9
- export interface TopByColumnOptions extends StartEndDate, Pick<LimitOffset, "limit">, IncludeExcludeOptions {
10
- period?: Period;
11
- tzOffset?: number;
12
- prefix?: string;
13
- }
14
-
15
- export interface TopByIntervalOptions extends StartEndDate, Pick<LimitOffset, "limit">, IncludeExcludeOptions {
16
- interval?: Interval;
17
- period?: Period;
18
- tzOffset?: number;
19
- }
20
-
21
- export interface TopByIntervalRes {
22
- date: string;
23
- statistics: {
24
- column: string;
25
- score: string;
26
- }[];
27
- }
28
-
29
- export interface TopByColumnRes {
30
- name: string;
31
- }
32
-
33
- export interface GetLastClicksOptions
34
- extends StartEndDate,
35
- Pick<LimitOffset, "limit">,
36
- IncludeExcludeOptions,
37
- BeforeAfterDate {
38
- tzOffset?: number;
39
- period?: Period;
40
- }
41
-
42
- export interface LastClicksRes {
43
- host: string;
44
- path: string;
45
- lcpath: string;
46
- dt: string;
47
- method: string;
48
- url: string;
49
- st: number;
50
- ip: string;
51
- proto: string;
52
- ref: string;
53
- ua: string;
54
- human: boolean;
55
- browser: string;
56
- browser_version: string;
57
- country: string;
58
- city: string;
59
- social: string;
60
- refhost: string;
61
- os: string;
62
- utm_source: string;
63
- utm_medium: string;
64
- utm_campaign: string;
65
- goal_completed: boolean | null;
66
- ab_path: string | null;
67
- }
68
-
69
- export interface FilterOptions {
70
- paths?: Set<string>;
71
- countries?: Set<string>;
72
- dt?: [Date, Date];
73
- browsers?: string[];
74
- human?: boolean;
75
- socials?: string[];
76
- browserVersions?: string[];
77
- statuses?: number[];
78
- methods?: string[];
79
- protos?: ("http" | "https")[];
80
- refhosts?: string[];
81
- utmSources?: string[];
82
- utmMediums?: string[];
83
- utmCampaigns?: string[];
84
- }
85
-
86
- export interface IncludeExcludeOptions {
87
- include?: FilterOptions;
88
- exclude?: FilterOptions;
89
- }
90
-
91
- export interface LinkIds {
92
- ids: string;
93
- }
94
-
95
- export interface PathDate extends Pick<Link, "path" | "createdAt"> {}
96
-
97
- export interface PathClicks {
98
- [path: Link["path"]]: number;
99
- }
100
-
101
- export interface LinkStatistics {
102
- totalClicks: number;
103
- humanClicks: number;
104
- humanClicksChange: string;
105
- totalClicksChange: string;
106
- clickStatistics: {
107
- datasets: [
108
- {
109
- data: DatePoint[];
110
- },
111
- ];
112
- };
113
- interval: IntervalResponse;
114
- referer: Referer[];
115
- social: Social[];
116
- browser: Browser[];
117
- os: OS[];
118
- city: City[];
119
- country: Country[];
120
- }
121
-
122
- export interface DomainStatistics {
123
- country: Country[];
124
- city: City[];
125
- clicks: number;
126
- humanClicks: number;
127
- links: number;
128
- linksChange: string;
129
- linksChangePositive: boolean;
130
- clicksPerLink: string;
131
- clicksPerLinkChange: string;
132
- humanClicksPerLink: string;
133
- prevClicksChange: string;
134
- humanClicksChange: string;
135
- humanClicksChangePositive: boolean;
136
- interval: IntervalResponse;
137
- clickStatistics: {
138
- datasets: [
139
- {
140
- data: DatePoint[];
141
- },
142
- ];
143
- };
144
- referer: Referer[];
145
- social: Social[];
146
- browser: Browser[];
147
- os: OS[];
148
- utm_medium: ({ utm_medium: string } & ClicksScore)[];
149
- utm_source: ({ utm_source: string } & ClicksScore)[];
150
- utm_campaign: ({ utm_campaign: string } & ClicksScore)[];
151
- }
152
-
153
- interface IntervalResponse {
154
- startDate: Date | null;
155
- endDate: Date | null;
156
- prevStartDate: Date | null;
157
- prevEndDate: Date | null;
158
- }
159
-
160
- interface DatePoint {
161
- x: Date;
162
- y: number;
163
- }
164
-
165
- interface City extends ClicksScore {
166
- city: number;
167
- name: string;
168
- }
169
-
170
- interface OS extends ClicksScore {
171
- os: string;
172
- }
173
-
174
- interface Social extends ClicksScore {
175
- social: string;
176
- socialName?: string;
177
- }
178
-
179
- interface Browser extends ClicksScore {
180
- browser: string;
181
- browserName?: string;
182
- }
183
-
184
- interface Referer extends ClicksScore {
185
- referer: string;
186
- }
187
-
188
- interface Country extends ClicksScore {
189
- country: string;
190
- countryName: string;
191
- }
192
-
193
- interface ClicksScore {
194
- score: number;
195
- }
196
-
197
- type Period = "custom" | "today" | "yesterday" | "total" | "week" | "month" | "lastmonth" | "last7" | "last30";
198
- type Interval = "hour" | "day" | "week" | "month";
199
-
200
- export interface StartEndDate {
201
- startDate?: string;
202
- endDate?: string;
203
- }
204
-
205
- export interface BeforeAfterDate {
206
- afterDate?: string;
207
- beforeDate?: string;
208
- }
209
-
210
- export interface LinkClicks {
211
- [key: Link["idString"]]: number;
212
- }
213
-
214
- export interface LimitOffset {
215
- limit?: number;
216
- offset?: number;
217
- }
218
-
219
- export type Column =
220
- | "path"
221
- | "method"
222
- | "st"
223
- | "proto"
224
- | "human"
225
- | "browser"
226
- | "browser_version"
227
- | "country"
228
- | "city"
229
- | "social"
230
- | "refhost"
231
- | "os"
232
- | "utm_source"
233
- | "utm_medium"
234
- | "utm_campaign"
235
- | "goal_completed"
236
- | "ab_path";
237
-
238
- export interface TopColumnRes {
239
- score: number;
240
- column: string;
241
- displayName: string;
242
- }
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "./src",
4
- "outDir": "./dist",
5
- "module": "ESNext",
6
- "target": "ESNext",
7
- "moduleResolution": "node",
8
- "experimentalDecorators": true,
9
- "allowSyntheticDefaultImports": true,
10
- "incremental": true,
11
- "noImplicitAny": true,
12
- "removeComments": true,
13
- "preserveConstEnums": true,
14
- "noUnusedLocals": true,
15
- "sourceMap": true,
16
- "inlineSources": true,
17
- "strictNullChecks": true,
18
- "declaration": true
19
- }
20
- }