@myapihq/sdk 1.0.4 → 1.0.5
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/hq.d.ts +3 -1
- package/dist/hq.js +2 -2
- package/package.json +1 -1
- package/src/hq.ts +4 -4
package/dist/hq.d.ts
CHANGED
|
@@ -36,10 +36,11 @@ export declare function listApiKeys(apiKey: string): Promise<{
|
|
|
36
36
|
name: string;
|
|
37
37
|
prefix: string;
|
|
38
38
|
created_at: string;
|
|
39
|
+
last_used_at?: string;
|
|
39
40
|
}[]>;
|
|
40
41
|
export declare function revokeApiKey(apiKey: string, keyId: string): Promise<void>;
|
|
41
42
|
export declare function createOrg(apiKey: string, payload: OrgPayload): Promise<Org>;
|
|
42
|
-
export declare function importOrg(apiKey: string, domain: string, autoAccept?: boolean): Promise<{
|
|
43
|
+
export declare function importOrg(apiKey: string, orgId: string, domain: string, autoAccept?: boolean): Promise<{
|
|
43
44
|
job_id: string;
|
|
44
45
|
status: string;
|
|
45
46
|
}>;
|
|
@@ -60,6 +61,7 @@ export declare function getBalance(apiKey: string): Promise<{
|
|
|
60
61
|
has_payment_method: boolean;
|
|
61
62
|
}>;
|
|
62
63
|
export declare function getBillingHistory(apiKey: string): Promise<{
|
|
64
|
+
type: string;
|
|
63
65
|
amount_cents: number;
|
|
64
66
|
status: string;
|
|
65
67
|
created_at: string;
|
package/dist/hq.js
CHANGED
|
@@ -29,8 +29,8 @@ async function revokeApiKey(apiKey, keyId) {
|
|
|
29
29
|
async function createOrg(apiKey, payload) {
|
|
30
30
|
return (0, client_1.request)('POST', `${BASE_URL}/hq/orgs`, apiKey, payload);
|
|
31
31
|
}
|
|
32
|
-
async function importOrg(apiKey, domain, autoAccept) {
|
|
33
|
-
return (0, client_1.request)('POST', `${BASE_URL}/hq/org-imports`, apiKey, { domain, auto_accept: autoAccept });
|
|
32
|
+
async function importOrg(apiKey, orgId, domain, autoAccept) {
|
|
33
|
+
return (0, client_1.request)('POST', `${BASE_URL}/hq/org-imports`, apiKey, { domain, org_id: orgId, auto_accept: autoAccept });
|
|
34
34
|
}
|
|
35
35
|
async function getOrgImportStatus(apiKey, jobId) {
|
|
36
36
|
return (0, client_1.request)('GET', `${BASE_URL}/hq/org-imports/${encodeURIComponent(jobId)}`, apiKey);
|
package/package.json
CHANGED
package/src/hq.ts
CHANGED
|
@@ -36,7 +36,7 @@ export async function createApiKey(apiKey: string, name: string): Promise<{ api_
|
|
|
36
36
|
return request('POST', `${BASE_URL}/hq/account/create/key`, apiKey, { name });
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export async function listApiKeys(apiKey: string): Promise<{ id: string; name: string; prefix: string; created_at: string }[]> {
|
|
39
|
+
export async function listApiKeys(apiKey: string): Promise<{ id: string; name: string; prefix: string; created_at: string; last_used_at?: string }[]> {
|
|
40
40
|
return request('GET', `${BASE_URL}/hq/account/keys`, apiKey);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -48,8 +48,8 @@ export async function createOrg(apiKey: string, payload: OrgPayload): Promise<Or
|
|
|
48
48
|
return request('POST', `${BASE_URL}/hq/orgs`, apiKey, payload);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export async function importOrg(apiKey: string, domain: string, autoAccept?: boolean): Promise<{ job_id: string; status: string }> {
|
|
52
|
-
return request('POST', `${BASE_URL}/hq/org-imports`, apiKey, { domain, auto_accept: autoAccept });
|
|
51
|
+
export async function importOrg(apiKey: string, orgId: string, domain: string, autoAccept?: boolean): Promise<{ job_id: string; status: string }> {
|
|
52
|
+
return request('POST', `${BASE_URL}/hq/org-imports`, apiKey, { domain, org_id: orgId, auto_accept: autoAccept });
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export async function getOrgImportStatus(apiKey: string, jobId: string): Promise<{ status: string; brand_preview: unknown }> {
|
|
@@ -80,7 +80,7 @@ export async function getBalance(apiKey: string): Promise<{ balance_cents: numbe
|
|
|
80
80
|
return request('GET', `${BASE_URL}/hq/billing/balance`, apiKey);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export async function getBillingHistory(apiKey: string): Promise<{ amount_cents: number; status: string; created_at: string }[]> {
|
|
83
|
+
export async function getBillingHistory(apiKey: string): Promise<{ type: string; amount_cents: number; status: string; created_at: string }[]> {
|
|
84
84
|
return request('GET', `${BASE_URL}/hq/billing/history`, apiKey);
|
|
85
85
|
}
|
|
86
86
|
|