@myapihq/sdk 1.0.3 → 1.0.4

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 CHANGED
@@ -26,15 +26,7 @@ export interface Org {
26
26
  updated_at: string;
27
27
  }
28
28
  export type OrgPayload = Omit<Org, 'id' | 'created_at' | 'updated_at'>;
29
- export declare function createAgentAccount(): Promise<{
30
- account_id: string;
31
- pin: string;
32
- token: string;
33
- }>;
34
- export declare function recoverAgentToken(pin: string): Promise<{
35
- token: string;
36
- }>;
37
- export declare function createApiKey(jwtToken: string, name: string): Promise<{
29
+ export declare function createApiKey(apiKey: string, name: string): Promise<{
38
30
  api_key: string;
39
31
  id: string;
40
32
  prefix: string;
@@ -46,11 +38,6 @@ export declare function listApiKeys(apiKey: string): Promise<{
46
38
  created_at: string;
47
39
  }[]>;
48
40
  export declare function revokeApiKey(apiKey: string, keyId: string): Promise<void>;
49
- export declare function linkAgent(apiKey: string, pin: string): Promise<void>;
50
- export declare function listLinkedAgents(apiKey: string): Promise<{
51
- account_id: string;
52
- created_at: string;
53
- }[]>;
54
41
  export declare function createOrg(apiKey: string, payload: OrgPayload): Promise<Org>;
55
42
  export declare function importOrg(apiKey: string, domain: string, autoAccept?: boolean): Promise<{
56
43
  job_id: string;
@@ -68,6 +55,8 @@ export declare function deleteOrg(apiKey: string, orgId: string): Promise<void>;
68
55
  export declare function getBalance(apiKey: string): Promise<{
69
56
  balance_cents: number;
70
57
  balance_display: string;
58
+ credits_cents: number;
59
+ credits_display: string;
71
60
  has_payment_method: boolean;
72
61
  }>;
73
62
  export declare function getBillingHistory(apiKey: string): Promise<{
package/dist/hq.js CHANGED
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAgentAccount = createAgentAccount;
4
- exports.recoverAgentToken = recoverAgentToken;
5
3
  exports.createApiKey = createApiKey;
6
4
  exports.listApiKeys = listApiKeys;
7
5
  exports.revokeApiKey = revokeApiKey;
8
- exports.linkAgent = linkAgent;
9
- exports.listLinkedAgents = listLinkedAgents;
10
6
  exports.createOrg = createOrg;
11
7
  exports.importOrg = importOrg;
12
8
  exports.getOrgImportStatus = getOrgImportStatus;
@@ -21,14 +17,8 @@ exports.setupPayment = setupPayment;
21
17
  exports.topUp = topUp;
22
18
  const client_1 = require("./client");
23
19
  const BASE_URL = 'https://api.myapihq.com';
24
- async function createAgentAccount() {
25
- return (0, client_1.request)('POST', `${BASE_URL}/hq/account/agent/create`);
26
- }
27
- async function recoverAgentToken(pin) {
28
- return (0, client_1.request)('POST', `${BASE_URL}/hq/account/agent/token`, undefined, { pin });
29
- }
30
- async function createApiKey(jwtToken, name) {
31
- return (0, client_1.request)('POST', `${BASE_URL}/hq/account/create/key`, jwtToken, { name });
20
+ async function createApiKey(apiKey, name) {
21
+ return (0, client_1.request)('POST', `${BASE_URL}/hq/account/create/key`, apiKey, { name });
32
22
  }
33
23
  async function listApiKeys(apiKey) {
34
24
  return (0, client_1.request)('GET', `${BASE_URL}/hq/account/keys`, apiKey);
@@ -36,12 +26,6 @@ async function listApiKeys(apiKey) {
36
26
  async function revokeApiKey(apiKey, keyId) {
37
27
  return (0, client_1.request)('DELETE', `${BASE_URL}/hq/account/delete/key/${encodeURIComponent(keyId)}`, apiKey);
38
28
  }
39
- async function linkAgent(apiKey, pin) {
40
- return (0, client_1.request)('POST', `${BASE_URL}/hq/account/link-agent`, apiKey, { pin });
41
- }
42
- async function listLinkedAgents(apiKey) {
43
- return (0, client_1.request)('GET', `${BASE_URL}/hq/account/agents`, apiKey);
44
- }
45
29
  async function createOrg(apiKey, payload) {
46
30
  return (0, client_1.request)('POST', `${BASE_URL}/hq/orgs`, apiKey, payload);
47
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myapihq/sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "TypeScript SDK for the MyAPI ecosystem",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/hq.ts CHANGED
@@ -32,16 +32,8 @@ export interface Org {
32
32
 
33
33
  export type OrgPayload = Omit<Org, 'id' | 'created_at' | 'updated_at'>;
34
34
 
35
- export async function createAgentAccount(): Promise<{ account_id: string; pin: string; token: string }> {
36
- return request('POST', `${BASE_URL}/hq/account/agent/create`);
37
- }
38
-
39
- export async function recoverAgentToken(pin: string): Promise<{ token: string }> {
40
- return request('POST', `${BASE_URL}/hq/account/agent/token`, undefined, { pin });
41
- }
42
-
43
- export async function createApiKey(jwtToken: string, name: string): Promise<{ api_key: string; id: string; prefix: string }> {
44
- return request('POST', `${BASE_URL}/hq/account/create/key`, jwtToken, { name });
35
+ export async function createApiKey(apiKey: string, name: string): Promise<{ api_key: string; id: string; prefix: string }> {
36
+ return request('POST', `${BASE_URL}/hq/account/create/key`, apiKey, { name });
45
37
  }
46
38
 
47
39
  export async function listApiKeys(apiKey: string): Promise<{ id: string; name: string; prefix: string; created_at: string }[]> {
@@ -52,14 +44,6 @@ export async function revokeApiKey(apiKey: string, keyId: string): Promise<void>
52
44
  return request('DELETE', `${BASE_URL}/hq/account/delete/key/${encodeURIComponent(keyId)}`, apiKey);
53
45
  }
54
46
 
55
- export async function linkAgent(apiKey: string, pin: string): Promise<void> {
56
- return request('POST', `${BASE_URL}/hq/account/link-agent`, apiKey, { pin });
57
- }
58
-
59
- export async function listLinkedAgents(apiKey: string): Promise<{ account_id: string; created_at: string }[]> {
60
- return request('GET', `${BASE_URL}/hq/account/agents`, apiKey);
61
- }
62
-
63
47
  export async function createOrg(apiKey: string, payload: OrgPayload): Promise<Org> {
64
48
  return request('POST', `${BASE_URL}/hq/orgs`, apiKey, payload);
65
49
  }
@@ -92,7 +76,7 @@ export async function deleteOrg(apiKey: string, orgId: string): Promise<void> {
92
76
  return request('DELETE', `${BASE_URL}/hq/orgs/${encodeURIComponent(orgId)}`, apiKey);
93
77
  }
94
78
 
95
- export async function getBalance(apiKey: string): Promise<{ balance_cents: number; balance_display: string; has_payment_method: boolean }> {
79
+ export async function getBalance(apiKey: string): Promise<{ balance_cents: number; balance_display: string; credits_cents: number; credits_display: string; has_payment_method: boolean }> {
96
80
  return request('GET', `${BASE_URL}/hq/billing/balance`, apiKey);
97
81
  }
98
82