@myapihq/sdk 1.0.10 → 1.0.11

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.js CHANGED
@@ -28,7 +28,8 @@ async function getDomainStatus(apiKey, orgId, domain) {
28
28
  return (0, client_1.request)('GET', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/status`, apiKey);
29
29
  }
30
30
  async function assignDomain(apiKey, orgId, domain, targetOrgId) {
31
- return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: targetOrgId });
31
+ const org_id_payload = targetOrgId === 'null' ? null : targetOrgId;
32
+ return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: org_id_payload });
32
33
  }
33
34
  async function unassignDomain(apiKey, orgId, domain) {
34
35
  return (0, client_1.request)('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: null });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myapihq/sdk",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "TypeScript SDK for the MyAPI ecosystem",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/domain.ts CHANGED
@@ -39,7 +39,8 @@ export async function getDomainStatus(apiKey: string, orgId: string, domain: str
39
39
  }
40
40
 
41
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 });
42
+ const org_id_payload = targetOrgId === 'null' ? null : targetOrgId;
43
+ return request('POST', `${BASE_URL}/domain/orgs/${encodeURIComponent(orgId)}/${encodeURIComponent(domain)}/assign`, apiKey, { org_id: org_id_payload });
43
44
  }
44
45
 
45
46
  export async function unassignDomain(apiKey: string, orgId: string, domain: string): Promise<DomainRecord> {