@myapihq/sdk 1.0.7 → 1.0.9
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/domain.d.ts +2 -2
- package/dist/domain.js +13 -13
- package/package.json +1 -1
- package/src/domain.ts +13 -13
package/dist/domain.d.ts
CHANGED
|
@@ -21,10 +21,10 @@ export declare function importDomain(apiKey: string, orgId: string, payload: {
|
|
|
21
21
|
namecheap_api_user?: string;
|
|
22
22
|
namecheap_api_key?: string;
|
|
23
23
|
}): Promise<DomainRecord>;
|
|
24
|
-
export declare function listDomains(apiKey: string, orgId: string, filter?:
|
|
24
|
+
export declare function listDomains(apiKey: string, orgId: string, filter?: string): Promise<DomainRecord[]>;
|
|
25
25
|
export declare function getDomainStatus(apiKey: string, orgId: string, domain: string): Promise<DomainRecord>;
|
|
26
|
-
export declare function renewDomain(apiKey: string, orgId: string, domain: string, years?: number): Promise<DomainRecord>;
|
|
27
26
|
export declare function assignDomain(apiKey: string, orgId: string, domain: string, targetOrgId: string): Promise<DomainRecord>;
|
|
27
|
+
export declare function unassignDomain(apiKey: string, orgId: string, domain: string): Promise<DomainRecord>;
|
|
28
28
|
export declare function getDomainSettings(apiKey: string, orgId: string, domain: string): Promise<DomainSettings>;
|
|
29
29
|
export declare function updateDomainSettings(apiKey: string, orgId: string, domain: string, payload: {
|
|
30
30
|
security_level?: 'essentially_off' | 'medium' | 'high' | 'under_attack';
|
package/dist/domain.js
CHANGED
|
@@ -5,37 +5,37 @@ exports.registerDomain = registerDomain;
|
|
|
5
5
|
exports.importDomain = importDomain;
|
|
6
6
|
exports.listDomains = listDomains;
|
|
7
7
|
exports.getDomainStatus = getDomainStatus;
|
|
8
|
-
exports.renewDomain = renewDomain;
|
|
9
8
|
exports.assignDomain = assignDomain;
|
|
9
|
+
exports.unassignDomain = unassignDomain;
|
|
10
10
|
exports.getDomainSettings = getDomainSettings;
|
|
11
11
|
exports.updateDomainSettings = updateDomainSettings;
|
|
12
12
|
const client_1 = require("./client");
|
|
13
13
|
const BASE_URL = 'https://api.mydomainapi.com';
|
|
14
14
|
async function checkDomain(apiKey, orgId, domain) {
|
|
15
|
-
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${orgId}/check/available/${encodeURIComponent(domain)}`, apiKey);
|
|
15
|
+
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/check/available/${encodeURIComponent(domain)}`, apiKey);
|
|
16
16
|
}
|
|
17
17
|
async function registerDomain(apiKey, orgId, domain, years) {
|
|
18
|
-
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${orgId}/register`, apiKey, { domain, years });
|
|
18
|
+
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/register`, apiKey, { domain, years });
|
|
19
19
|
}
|
|
20
20
|
async function importDomain(apiKey, orgId, payload) {
|
|
21
|
-
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${orgId}/import`, apiKey, payload);
|
|
21
|
+
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/import`, apiKey, payload);
|
|
22
22
|
}
|
|
23
23
|
async function listDomains(apiKey, orgId, filter) {
|
|
24
|
-
const query = filter ? `?filter=${filter}` : '';
|
|
25
|
-
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${orgId}/list${query}`, apiKey);
|
|
24
|
+
const query = filter ? `?filter=${encodeURIComponent(filter)}` : '';
|
|
25
|
+
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/list${query}`, apiKey);
|
|
26
26
|
}
|
|
27
27
|
async function getDomainStatus(apiKey, orgId, domain) {
|
|
28
|
-
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/status`, apiKey);
|
|
29
|
-
}
|
|
30
|
-
async function renewDomain(apiKey, orgId, domain, years) {
|
|
31
|
-
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/renew`, apiKey, { years });
|
|
28
|
+
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/status`, apiKey);
|
|
32
29
|
}
|
|
33
30
|
async function assignDomain(apiKey, orgId, domain, targetOrgId) {
|
|
34
|
-
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: targetOrgId });
|
|
31
|
+
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: targetOrgId });
|
|
32
|
+
}
|
|
33
|
+
async function unassignDomain(apiKey, orgId, domain) {
|
|
34
|
+
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: null });
|
|
35
35
|
}
|
|
36
36
|
async function getDomainSettings(apiKey, orgId, domain) {
|
|
37
|
-
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/settings`, apiKey);
|
|
37
|
+
return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/settings`, apiKey);
|
|
38
38
|
}
|
|
39
39
|
async function updateDomainSettings(apiKey, orgId, domain, payload) {
|
|
40
|
-
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/settings`, apiKey, payload);
|
|
40
|
+
return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/settings`, apiKey, payload);
|
|
41
41
|
}
|
package/package.json
CHANGED
package/src/domain.ts
CHANGED
|
@@ -18,36 +18,36 @@ export interface DomainSettings {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export async function checkDomain(apiKey: string, orgId: string, domain: string): Promise<{ available: boolean; price_cents: number }> {
|
|
21
|
-
return request('GET', `${BASE_URL}/domain/orgs/${orgId}/check/available/${encodeURIComponent(domain)}`, apiKey);
|
|
21
|
+
return request('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/check/available/${encodeURIComponent(domain)}`, apiKey);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export async function registerDomain(apiKey: string, orgId: string, domain: string, years?: number): Promise<DomainRecord> {
|
|
25
|
-
return request('POST', `${BASE_URL}/domain/orgs/${orgId}/register`, apiKey, { domain, years });
|
|
25
|
+
return request('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/register`, apiKey, { domain, years });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export async function importDomain(apiKey: string, orgId: string, payload: { domain: string; namecheap_api_user?: string; namecheap_api_key?: string; }): Promise<DomainRecord> {
|
|
29
|
-
return request('POST', `${BASE_URL}/domain/orgs/${orgId}/import`, apiKey, payload);
|
|
29
|
+
return request('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/import`, apiKey, payload);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export async function listDomains(apiKey: string, orgId: string, filter?:
|
|
33
|
-
const query = filter ? `?filter=${filter}` : '';
|
|
34
|
-
return request('GET', `${BASE_URL}/domain/orgs/${orgId}/list${query}`, apiKey);
|
|
32
|
+
export async function listDomains(apiKey: string, orgId: string, filter?: string): Promise<DomainRecord[]> {
|
|
33
|
+
const query = filter ? `?filter=${encodeURIComponent(filter)}` : '';
|
|
34
|
+
return request('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/list${query}`, apiKey);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export async function getDomainStatus(apiKey: string, orgId: string, domain: string): Promise<DomainRecord> {
|
|
38
|
-
return request('GET', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/status`, apiKey);
|
|
38
|
+
return request('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/status`, apiKey);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export async function
|
|
42
|
-
return request('POST', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/
|
|
41
|
+
export async function assignDomain(apiKey: string, orgId: string, domain: string, targetOrgId: string): Promise<DomainRecord> {
|
|
42
|
+
return request('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: targetOrgId });
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export async function
|
|
46
|
-
return request('POST', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id:
|
|
45
|
+
export async function unassignDomain(apiKey: string, orgId: string, domain: string): Promise<DomainRecord> {
|
|
46
|
+
return request('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: null });
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export async function getDomainSettings(apiKey: string, orgId: string, domain: string): Promise<DomainSettings> {
|
|
50
|
-
return request('GET', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/settings`, apiKey);
|
|
50
|
+
return request('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/settings`, apiKey);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export async function updateDomainSettings(apiKey: string, orgId: string, domain: string, payload: {
|
|
@@ -55,5 +55,5 @@ export async function updateDomainSettings(apiKey: string, orgId: string, domain
|
|
|
55
55
|
browser_check?: 'on' | 'off';
|
|
56
56
|
purge_cache?: boolean;
|
|
57
57
|
}): Promise<DomainSettings> {
|
|
58
|
-
return request('POST', `${BASE_URL}/domain/orgs/${orgId}/${encodeURIComponent(domain)}/settings`, apiKey, payload);
|
|
58
|
+
return request('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/settings`, apiKey, payload);
|
|
59
59
|
}
|