@unsent/sdk 0.25.2 → 0.25.3
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/dist/index.d.mts +128 -1
- package/dist/index.d.ts +128 -1
- package/dist/index.js +39 -0
- package/dist/index.mjs +39 -0
- package/package.json +2 -3
- package/.eslintrc.cjs +0 -10
package/dist/index.d.mts
CHANGED
|
@@ -371,7 +371,97 @@ interface paths {
|
|
|
371
371
|
};
|
|
372
372
|
put?: never;
|
|
373
373
|
post?: never;
|
|
374
|
-
delete
|
|
374
|
+
delete: {
|
|
375
|
+
parameters: {
|
|
376
|
+
query?: never;
|
|
377
|
+
header?: never;
|
|
378
|
+
path: {
|
|
379
|
+
id: number;
|
|
380
|
+
};
|
|
381
|
+
cookie?: never;
|
|
382
|
+
};
|
|
383
|
+
requestBody?: never;
|
|
384
|
+
responses: {
|
|
385
|
+
/** @description Domain deleted successfully */
|
|
386
|
+
200: {
|
|
387
|
+
headers: {
|
|
388
|
+
[name: string]: unknown;
|
|
389
|
+
};
|
|
390
|
+
content: {
|
|
391
|
+
"application/json": {
|
|
392
|
+
/**
|
|
393
|
+
* @description The ID of the domain
|
|
394
|
+
* @example 1
|
|
395
|
+
*/
|
|
396
|
+
id: number;
|
|
397
|
+
/**
|
|
398
|
+
* @description The name of the domain
|
|
399
|
+
* @example example.com
|
|
400
|
+
*/
|
|
401
|
+
name: string;
|
|
402
|
+
/**
|
|
403
|
+
* @description The ID of the team
|
|
404
|
+
* @example 1
|
|
405
|
+
*/
|
|
406
|
+
teamId: number;
|
|
407
|
+
/** @enum {string} */
|
|
408
|
+
status: "NOT_STARTED" | "PENDING" | "SUCCESS" | "FAILED" | "TEMPORARY_FAILURE";
|
|
409
|
+
/** @default us-east-1 */
|
|
410
|
+
region: string;
|
|
411
|
+
/** @default false */
|
|
412
|
+
clickTracking: boolean;
|
|
413
|
+
/** @default false */
|
|
414
|
+
openTracking: boolean;
|
|
415
|
+
publicKey: string;
|
|
416
|
+
dkimStatus?: string | null;
|
|
417
|
+
spfDetails?: string | null;
|
|
418
|
+
createdAt: string;
|
|
419
|
+
updatedAt: string;
|
|
420
|
+
/** @default false */
|
|
421
|
+
dmarcAdded: boolean;
|
|
422
|
+
/** @default false */
|
|
423
|
+
isVerifying: boolean;
|
|
424
|
+
errorMessage?: string | null;
|
|
425
|
+
subdomain?: string | null;
|
|
426
|
+
verificationError?: string | null;
|
|
427
|
+
lastCheckedTime?: string | null;
|
|
428
|
+
dnsRecords: {
|
|
429
|
+
/**
|
|
430
|
+
* @description DNS record type
|
|
431
|
+
* @example TXT
|
|
432
|
+
* @enum {string}
|
|
433
|
+
*/
|
|
434
|
+
type: "MX" | "TXT";
|
|
435
|
+
/**
|
|
436
|
+
* @description DNS record name
|
|
437
|
+
* @example mail
|
|
438
|
+
*/
|
|
439
|
+
name: string;
|
|
440
|
+
/**
|
|
441
|
+
* @description DNS record value
|
|
442
|
+
* @example v=spf1 include:amazonses.com ~all
|
|
443
|
+
*/
|
|
444
|
+
value: string;
|
|
445
|
+
/**
|
|
446
|
+
* @description DNS record TTL
|
|
447
|
+
* @example Auto
|
|
448
|
+
*/
|
|
449
|
+
ttl: string;
|
|
450
|
+
/**
|
|
451
|
+
* @description DNS record priority
|
|
452
|
+
* @example 10
|
|
453
|
+
*/
|
|
454
|
+
priority?: string | null;
|
|
455
|
+
/** @enum {string} */
|
|
456
|
+
status: "NOT_STARTED" | "PENDING" | "SUCCESS" | "FAILED" | "TEMPORARY_FAILURE";
|
|
457
|
+
/** @description Whether the record is recommended */
|
|
458
|
+
recommended?: boolean;
|
|
459
|
+
}[];
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
};
|
|
375
465
|
options?: never;
|
|
376
466
|
head?: never;
|
|
377
467
|
patch?: never;
|
|
@@ -1018,10 +1108,47 @@ declare class Emails {
|
|
|
1018
1108
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1019
1109
|
}
|
|
1020
1110
|
|
|
1111
|
+
type CreateDomainPayload = paths["/v1/domains"]["post"]["requestBody"]["content"]["application/json"];
|
|
1112
|
+
type CreateDomainResponse = {
|
|
1113
|
+
data: CreateDomainResponseSuccess | null;
|
|
1114
|
+
error: ErrorResponse | null;
|
|
1115
|
+
};
|
|
1116
|
+
type CreateDomainResponseSuccess = paths["/v1/domains"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
1117
|
+
type GetDomainsResponse = {
|
|
1118
|
+
data: GetDomainsResponseSuccess | null;
|
|
1119
|
+
error: ErrorResponse | null;
|
|
1120
|
+
};
|
|
1121
|
+
type GetDomainsResponseSuccess = paths["/v1/domains"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1122
|
+
type VerifyDomainResponse = {
|
|
1123
|
+
data: VerifyDomainResponseSuccess | null;
|
|
1124
|
+
error: ErrorResponse | null;
|
|
1125
|
+
};
|
|
1126
|
+
type VerifyDomainResponseSuccess = paths["/v1/domains/{id}/verify"]["put"]["responses"]["200"]["content"]["application/json"];
|
|
1127
|
+
type GetDomainResponse = {
|
|
1128
|
+
data: GetDomainResponseSuccess | null;
|
|
1129
|
+
error: ErrorResponse | null;
|
|
1130
|
+
};
|
|
1131
|
+
type GetDomainResponseSuccess = paths["/v1/domains/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1132
|
+
type DeleteDomainResponse = {
|
|
1133
|
+
data: DeleteDomainResponseSuccess | null;
|
|
1134
|
+
error: ErrorResponse | null;
|
|
1135
|
+
};
|
|
1136
|
+
type DeleteDomainResponseSuccess = paths["/v1/domains/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
1137
|
+
declare class Domains {
|
|
1138
|
+
private readonly unsent;
|
|
1139
|
+
constructor(unsent: unsent);
|
|
1140
|
+
list(): Promise<GetDomainsResponse>;
|
|
1141
|
+
create(payload: CreateDomainPayload): Promise<CreateDomainResponse>;
|
|
1142
|
+
verify(id: number): Promise<VerifyDomainResponse>;
|
|
1143
|
+
get(id: number): Promise<GetDomainResponse>;
|
|
1144
|
+
delete(id: number): Promise<DeleteDomainResponse>;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1021
1147
|
declare class unsent {
|
|
1022
1148
|
readonly key?: string | undefined;
|
|
1023
1149
|
private readonly headers;
|
|
1024
1150
|
readonly emails: Emails;
|
|
1151
|
+
readonly domains: Domains;
|
|
1025
1152
|
readonly contacts: Contacts;
|
|
1026
1153
|
url: string;
|
|
1027
1154
|
constructor(key?: string | undefined, url?: string);
|
package/dist/index.d.ts
CHANGED
|
@@ -371,7 +371,97 @@ interface paths {
|
|
|
371
371
|
};
|
|
372
372
|
put?: never;
|
|
373
373
|
post?: never;
|
|
374
|
-
delete
|
|
374
|
+
delete: {
|
|
375
|
+
parameters: {
|
|
376
|
+
query?: never;
|
|
377
|
+
header?: never;
|
|
378
|
+
path: {
|
|
379
|
+
id: number;
|
|
380
|
+
};
|
|
381
|
+
cookie?: never;
|
|
382
|
+
};
|
|
383
|
+
requestBody?: never;
|
|
384
|
+
responses: {
|
|
385
|
+
/** @description Domain deleted successfully */
|
|
386
|
+
200: {
|
|
387
|
+
headers: {
|
|
388
|
+
[name: string]: unknown;
|
|
389
|
+
};
|
|
390
|
+
content: {
|
|
391
|
+
"application/json": {
|
|
392
|
+
/**
|
|
393
|
+
* @description The ID of the domain
|
|
394
|
+
* @example 1
|
|
395
|
+
*/
|
|
396
|
+
id: number;
|
|
397
|
+
/**
|
|
398
|
+
* @description The name of the domain
|
|
399
|
+
* @example example.com
|
|
400
|
+
*/
|
|
401
|
+
name: string;
|
|
402
|
+
/**
|
|
403
|
+
* @description The ID of the team
|
|
404
|
+
* @example 1
|
|
405
|
+
*/
|
|
406
|
+
teamId: number;
|
|
407
|
+
/** @enum {string} */
|
|
408
|
+
status: "NOT_STARTED" | "PENDING" | "SUCCESS" | "FAILED" | "TEMPORARY_FAILURE";
|
|
409
|
+
/** @default us-east-1 */
|
|
410
|
+
region: string;
|
|
411
|
+
/** @default false */
|
|
412
|
+
clickTracking: boolean;
|
|
413
|
+
/** @default false */
|
|
414
|
+
openTracking: boolean;
|
|
415
|
+
publicKey: string;
|
|
416
|
+
dkimStatus?: string | null;
|
|
417
|
+
spfDetails?: string | null;
|
|
418
|
+
createdAt: string;
|
|
419
|
+
updatedAt: string;
|
|
420
|
+
/** @default false */
|
|
421
|
+
dmarcAdded: boolean;
|
|
422
|
+
/** @default false */
|
|
423
|
+
isVerifying: boolean;
|
|
424
|
+
errorMessage?: string | null;
|
|
425
|
+
subdomain?: string | null;
|
|
426
|
+
verificationError?: string | null;
|
|
427
|
+
lastCheckedTime?: string | null;
|
|
428
|
+
dnsRecords: {
|
|
429
|
+
/**
|
|
430
|
+
* @description DNS record type
|
|
431
|
+
* @example TXT
|
|
432
|
+
* @enum {string}
|
|
433
|
+
*/
|
|
434
|
+
type: "MX" | "TXT";
|
|
435
|
+
/**
|
|
436
|
+
* @description DNS record name
|
|
437
|
+
* @example mail
|
|
438
|
+
*/
|
|
439
|
+
name: string;
|
|
440
|
+
/**
|
|
441
|
+
* @description DNS record value
|
|
442
|
+
* @example v=spf1 include:amazonses.com ~all
|
|
443
|
+
*/
|
|
444
|
+
value: string;
|
|
445
|
+
/**
|
|
446
|
+
* @description DNS record TTL
|
|
447
|
+
* @example Auto
|
|
448
|
+
*/
|
|
449
|
+
ttl: string;
|
|
450
|
+
/**
|
|
451
|
+
* @description DNS record priority
|
|
452
|
+
* @example 10
|
|
453
|
+
*/
|
|
454
|
+
priority?: string | null;
|
|
455
|
+
/** @enum {string} */
|
|
456
|
+
status: "NOT_STARTED" | "PENDING" | "SUCCESS" | "FAILED" | "TEMPORARY_FAILURE";
|
|
457
|
+
/** @description Whether the record is recommended */
|
|
458
|
+
recommended?: boolean;
|
|
459
|
+
}[];
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
};
|
|
375
465
|
options?: never;
|
|
376
466
|
head?: never;
|
|
377
467
|
patch?: never;
|
|
@@ -1018,10 +1108,47 @@ declare class Emails {
|
|
|
1018
1108
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1019
1109
|
}
|
|
1020
1110
|
|
|
1111
|
+
type CreateDomainPayload = paths["/v1/domains"]["post"]["requestBody"]["content"]["application/json"];
|
|
1112
|
+
type CreateDomainResponse = {
|
|
1113
|
+
data: CreateDomainResponseSuccess | null;
|
|
1114
|
+
error: ErrorResponse | null;
|
|
1115
|
+
};
|
|
1116
|
+
type CreateDomainResponseSuccess = paths["/v1/domains"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
1117
|
+
type GetDomainsResponse = {
|
|
1118
|
+
data: GetDomainsResponseSuccess | null;
|
|
1119
|
+
error: ErrorResponse | null;
|
|
1120
|
+
};
|
|
1121
|
+
type GetDomainsResponseSuccess = paths["/v1/domains"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1122
|
+
type VerifyDomainResponse = {
|
|
1123
|
+
data: VerifyDomainResponseSuccess | null;
|
|
1124
|
+
error: ErrorResponse | null;
|
|
1125
|
+
};
|
|
1126
|
+
type VerifyDomainResponseSuccess = paths["/v1/domains/{id}/verify"]["put"]["responses"]["200"]["content"]["application/json"];
|
|
1127
|
+
type GetDomainResponse = {
|
|
1128
|
+
data: GetDomainResponseSuccess | null;
|
|
1129
|
+
error: ErrorResponse | null;
|
|
1130
|
+
};
|
|
1131
|
+
type GetDomainResponseSuccess = paths["/v1/domains/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
1132
|
+
type DeleteDomainResponse = {
|
|
1133
|
+
data: DeleteDomainResponseSuccess | null;
|
|
1134
|
+
error: ErrorResponse | null;
|
|
1135
|
+
};
|
|
1136
|
+
type DeleteDomainResponseSuccess = paths["/v1/domains/{id}"]["delete"]["responses"]["200"]["content"]["application/json"];
|
|
1137
|
+
declare class Domains {
|
|
1138
|
+
private readonly unsent;
|
|
1139
|
+
constructor(unsent: unsent);
|
|
1140
|
+
list(): Promise<GetDomainsResponse>;
|
|
1141
|
+
create(payload: CreateDomainPayload): Promise<CreateDomainResponse>;
|
|
1142
|
+
verify(id: number): Promise<VerifyDomainResponse>;
|
|
1143
|
+
get(id: number): Promise<GetDomainResponse>;
|
|
1144
|
+
delete(id: number): Promise<DeleteDomainResponse>;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1021
1147
|
declare class unsent {
|
|
1022
1148
|
readonly key?: string | undefined;
|
|
1023
1149
|
private readonly headers;
|
|
1024
1150
|
readonly emails: Emails;
|
|
1151
|
+
readonly domains: Domains;
|
|
1025
1152
|
readonly contacts: Contacts;
|
|
1026
1153
|
url: string;
|
|
1027
1154
|
constructor(key?: string | undefined, url?: string);
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,44 @@ var Emails = class {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
+
// src/domain.ts
|
|
128
|
+
var Domains = class {
|
|
129
|
+
constructor(unsent2) {
|
|
130
|
+
this.unsent = unsent2;
|
|
131
|
+
this.unsent = unsent2;
|
|
132
|
+
}
|
|
133
|
+
async list() {
|
|
134
|
+
const data = await this.unsent.get("/domains");
|
|
135
|
+
return data;
|
|
136
|
+
}
|
|
137
|
+
async create(payload) {
|
|
138
|
+
const data = await this.unsent.post(
|
|
139
|
+
"/domains",
|
|
140
|
+
payload
|
|
141
|
+
);
|
|
142
|
+
return data;
|
|
143
|
+
}
|
|
144
|
+
async verify(id) {
|
|
145
|
+
const data = await this.unsent.put(
|
|
146
|
+
`/domains/${id}/verify`,
|
|
147
|
+
{}
|
|
148
|
+
);
|
|
149
|
+
return data;
|
|
150
|
+
}
|
|
151
|
+
async get(id) {
|
|
152
|
+
const data = await this.unsent.get(
|
|
153
|
+
`/domains/${id}`
|
|
154
|
+
);
|
|
155
|
+
return data;
|
|
156
|
+
}
|
|
157
|
+
async delete(id) {
|
|
158
|
+
const data = await this.unsent.delete(
|
|
159
|
+
`/domains/${id}`
|
|
160
|
+
);
|
|
161
|
+
return data;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
127
165
|
// src/unsent.ts
|
|
128
166
|
var defaultBaseUrl = "https://app.unsent.dev";
|
|
129
167
|
var baseUrl = `${process?.env?.UNSENT_BASE_URL ?? process?.env?.UNSENT_BASE_URL ?? defaultBaseUrl}/api/v1`;
|
|
@@ -154,6 +192,7 @@ var unsent = class {
|
|
|
154
192
|
headers;
|
|
155
193
|
// readonly domains = new Domains(this);
|
|
156
194
|
emails = new Emails(this);
|
|
195
|
+
domains = new Domains(this);
|
|
157
196
|
contacts = new Contacts(this);
|
|
158
197
|
url = baseUrl;
|
|
159
198
|
async fetchRequest(path, options = {}) {
|
package/dist/index.mjs
CHANGED
|
@@ -98,6 +98,44 @@ var Emails = class {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
// src/domain.ts
|
|
102
|
+
var Domains = class {
|
|
103
|
+
constructor(unsent2) {
|
|
104
|
+
this.unsent = unsent2;
|
|
105
|
+
this.unsent = unsent2;
|
|
106
|
+
}
|
|
107
|
+
async list() {
|
|
108
|
+
const data = await this.unsent.get("/domains");
|
|
109
|
+
return data;
|
|
110
|
+
}
|
|
111
|
+
async create(payload) {
|
|
112
|
+
const data = await this.unsent.post(
|
|
113
|
+
"/domains",
|
|
114
|
+
payload
|
|
115
|
+
);
|
|
116
|
+
return data;
|
|
117
|
+
}
|
|
118
|
+
async verify(id) {
|
|
119
|
+
const data = await this.unsent.put(
|
|
120
|
+
`/domains/${id}/verify`,
|
|
121
|
+
{}
|
|
122
|
+
);
|
|
123
|
+
return data;
|
|
124
|
+
}
|
|
125
|
+
async get(id) {
|
|
126
|
+
const data = await this.unsent.get(
|
|
127
|
+
`/domains/${id}`
|
|
128
|
+
);
|
|
129
|
+
return data;
|
|
130
|
+
}
|
|
131
|
+
async delete(id) {
|
|
132
|
+
const data = await this.unsent.delete(
|
|
133
|
+
`/domains/${id}`
|
|
134
|
+
);
|
|
135
|
+
return data;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
101
139
|
// src/unsent.ts
|
|
102
140
|
var defaultBaseUrl = "https://app.unsent.dev";
|
|
103
141
|
var baseUrl = `${process?.env?.UNSENT_BASE_URL ?? process?.env?.UNSENT_BASE_URL ?? defaultBaseUrl}/api/v1`;
|
|
@@ -128,6 +166,7 @@ var unsent = class {
|
|
|
128
166
|
headers;
|
|
129
167
|
// readonly domains = new Domains(this);
|
|
130
168
|
emails = new Emails(this);
|
|
169
|
+
domains = new Domains(this);
|
|
131
170
|
contacts = new Contacts(this);
|
|
132
171
|
url = baseUrl;
|
|
133
172
|
async fetchRequest(path, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsent/sdk",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"openapi-typescript": "^7.6.1",
|
|
15
15
|
"tsup": "^8.4.0",
|
|
16
16
|
"typescript": "^5.8.3",
|
|
17
|
-
"@workspace/typescript-config": "0.0.0"
|
|
18
|
-
"@workspace/eslint-config": "0.0.0"
|
|
17
|
+
"@workspace/typescript-config": "0.0.0"
|
|
19
18
|
},
|
|
20
19
|
"dependencies": {
|
|
21
20
|
"@react-email/render": "^1.0.6",
|
package/.eslintrc.cjs
DELETED