@ascendkit/cli 0.2.6 → 0.3.1

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.
@@ -9,10 +9,10 @@ export async function listTemplates(client, params) {
9
9
  searchParams.set("isSystem", String(params.isSystem));
10
10
  const qs = searchParams.toString();
11
11
  const path = qs ? `/api/content/templates?${qs}` : "/api/content/templates";
12
- return client.get(path);
12
+ return client.managedGet(path);
13
13
  }
14
14
  export async function getTemplate(client, templateId) {
15
- return client.get(`/api/content/templates/${templateId}`);
15
+ return client.managedGet(`/api/content/templates/${templateId}`);
16
16
  }
17
17
  export async function updateTemplate(client, templateId, params) {
18
18
  return client.managedPut(`/api/content/templates/${templateId}`, params);
@@ -21,8 +21,8 @@ export async function deleteTemplate(client, templateId) {
21
21
  return client.managedDelete(`/api/content/templates/${templateId}`);
22
22
  }
23
23
  export async function listVersions(client, templateId) {
24
- return client.get(`/api/content/templates/${templateId}/versions`);
24
+ return client.managedGet(`/api/content/templates/${templateId}/versions`);
25
25
  }
26
26
  export async function getVersion(client, templateId, versionNumber) {
27
- return client.get(`/api/content/templates/${templateId}/versions/${versionNumber}`);
27
+ return client.managedGet(`/api/content/templates/${templateId}/versions/${versionNumber}`);
28
28
  }
@@ -23,15 +23,71 @@ export interface EmailSettings {
23
23
  value: string;
24
24
  }>;
25
25
  dnsProvider?: DnsProviderInfo;
26
+ identities?: EmailIdentity[];
27
+ }
28
+ export interface EmailIdentity {
29
+ email: string;
30
+ displayName: string;
31
+ verificationStatus: string;
32
+ isDefault: boolean;
33
+ }
34
+ export interface EmailIdentitiesResponse {
35
+ identities: EmailIdentity[];
36
+ active?: {
37
+ fromEmail?: string;
38
+ fromName?: string;
39
+ };
40
+ }
41
+ export interface DnsCheckRecord {
42
+ name: string;
43
+ type: string;
44
+ expectedValue: string;
45
+ found: boolean;
46
+ observedValue: string | null;
47
+ mismatch: boolean;
48
+ error: string | null;
49
+ checkedAt: string;
50
+ }
51
+ export interface DnsCheckResponse {
52
+ summary: {
53
+ total: number;
54
+ found: number;
55
+ notFound: number;
56
+ mismatch: number;
57
+ errored: number;
58
+ };
59
+ records: DnsCheckRecord[];
26
60
  }
27
61
  export declare function getSettings(client: AscendKitClient): Promise<EmailSettings>;
28
62
  export declare function updateSettings(client: AscendKitClient, params: UpdateEmailSettingsParams): Promise<EmailSettings>;
29
63
  export declare function setupDomain(client: AscendKitClient, domain: string): Promise<EmailSettings>;
30
- export declare function checkDomainStatus(client: AscendKitClient): Promise<unknown>;
64
+ export declare function checkDomainStatus(client: AscendKitClient): Promise<{
65
+ domain?: string;
66
+ status?: string;
67
+ dnsRecords?: Array<{
68
+ type: string;
69
+ name: string;
70
+ value: string;
71
+ }>;
72
+ dnsProvider?: DnsProviderInfo;
73
+ }>;
74
+ export declare function checkDnsRecords(client: AscendKitClient): Promise<DnsCheckResponse>;
31
75
  export declare function getDnsProvider(client: AscendKitClient, domain?: string): Promise<DnsProviderInfo>;
32
76
  export declare function removeDomain(client: AscendKitClient): Promise<EmailSettings>;
33
- export declare function useDefaultIdentity(client: AscendKitClient): Promise<EmailSettings>;
34
- export declare function useCustomIdentity(client: AscendKitClient, domain: string, options?: {
35
- fromEmail?: string;
36
- fromName?: string;
37
- }): Promise<EmailSettings>;
77
+ export declare function listIdentities(client: AscendKitClient): Promise<EmailIdentitiesResponse>;
78
+ export declare function createIdentity(client: AscendKitClient, identity: {
79
+ email: string;
80
+ displayName?: string;
81
+ }): Promise<EmailIdentitiesResponse>;
82
+ export declare function resendIdentityVerification(client: AscendKitClient, email: string): Promise<EmailIdentitiesResponse>;
83
+ export declare function setDefaultIdentity(client: AscendKitClient, identity: {
84
+ email: string;
85
+ displayName?: string;
86
+ }): Promise<EmailIdentitiesResponse>;
87
+ export declare function removeIdentity(client: AscendKitClient, email: string): Promise<EmailIdentitiesResponse>;
88
+ export declare function sendTestEmail(client: AscendKitClient, request: {
89
+ to: string;
90
+ fromIdentityEmail?: string;
91
+ }): Promise<{
92
+ message: string;
93
+ }>;
@@ -1,5 +1,5 @@
1
1
  export async function getSettings(client) {
2
- return client.get("/api/email/settings");
2
+ return client.managedGet("/api/email/settings");
3
3
  }
4
4
  export async function updateSettings(client, params) {
5
5
  const body = {};
@@ -13,27 +13,36 @@ export async function setupDomain(client, domain) {
13
13
  return client.managedPost("/api/email/settings/setup-domain", { domain });
14
14
  }
15
15
  export async function checkDomainStatus(client) {
16
- return client.get("/api/email/settings/domain-status");
16
+ return client.managedGet("/api/email/settings/domain-status");
17
+ }
18
+ export async function checkDnsRecords(client) {
19
+ return client.managedGet("/api/email/settings/check-dns-records");
17
20
  }
18
21
  export async function getDnsProvider(client, domain) {
19
22
  const suffix = domain ? `?domain=${encodeURIComponent(domain)}` : "";
20
- return client.get(`/api/email/settings/dns-provider${suffix}`);
23
+ return client.managedGet(`/api/email/settings/dns-provider${suffix}`);
21
24
  }
22
25
  export async function removeDomain(client) {
23
26
  return client.managedDelete("/api/email/settings/domain");
24
27
  }
25
- export async function useDefaultIdentity(client) {
26
- await removeDomain(client);
27
- return updateSettings(client, { fromEmail: "", fromName: "" });
28
- }
29
- export async function useCustomIdentity(client, domain, options) {
30
- const configured = await setupDomain(client, domain);
31
- if (options?.fromEmail !== undefined || options?.fromName !== undefined) {
32
- await updateSettings(client, {
33
- fromEmail: options.fromEmail,
34
- fromName: options.fromName,
35
- });
36
- return getSettings(client);
37
- }
38
- return configured;
28
+ export async function listIdentities(client) {
29
+ return client.managedGet("/api/email/settings/identities");
30
+ }
31
+ export async function createIdentity(client, identity) {
32
+ return client.managedPost("/api/email/settings/identities", {
33
+ email: identity.email,
34
+ displayName: identity.displayName ?? "",
35
+ });
36
+ }
37
+ export async function resendIdentityVerification(client, email) {
38
+ return client.managedPost(`/api/email/settings/identities/${encodeURIComponent(email)}/resend`, {});
39
+ }
40
+ export async function setDefaultIdentity(client, identity) {
41
+ return client.managedPost(`/api/email/settings/identities/${encodeURIComponent(identity.email)}/default`, { displayName: identity.displayName ?? "" });
42
+ }
43
+ export async function removeIdentity(client, email) {
44
+ return client.managedDelete(`/api/email/settings/identities/${encodeURIComponent(email)}`);
45
+ }
46
+ export async function sendTestEmail(client, request) {
47
+ return client.managedPost("/api/email/settings/send-test", request);
39
48
  }
@@ -30,6 +30,7 @@ export declare function updateJourney(client: AscendKitClient, journeyId: string
30
30
  export declare function deleteJourney(client: AscendKitClient, journeyId: string): Promise<unknown>;
31
31
  export declare function activateJourney(client: AscendKitClient, journeyId: string): Promise<unknown>;
32
32
  export declare function pauseJourney(client: AscendKitClient, journeyId: string): Promise<unknown>;
33
+ export declare function resumeJourney(client: AscendKitClient, journeyId: string): Promise<unknown>;
33
34
  export declare function archiveJourney(client: AscendKitClient, journeyId: string): Promise<unknown>;
34
35
  export declare function getJourneyAnalytics(client: AscendKitClient, journeyId: string): Promise<unknown>;
35
36
  export declare function getJourneyVisualization(client: AscendKitClient, journeyId: string): Promise<unknown>;
@@ -11,10 +11,10 @@ export async function listJourneys(client, opts) {
11
11
  if (opts?.offset != null)
12
12
  qs.set("offset", String(opts.offset));
13
13
  const query = qs.toString();
14
- return client.get(`${BASE}${query ? `?${query}` : ""}`);
14
+ return client.managedGet(`${BASE}${query ? `?${query}` : ""}`);
15
15
  }
16
16
  export async function getJourney(client, journeyId) {
17
- return client.get(`${BASE}/${journeyId}`);
17
+ return client.managedGet(`${BASE}/${journeyId}`);
18
18
  }
19
19
  export async function updateJourney(client, journeyId, params) {
20
20
  return client.managedRequest("PATCH", `${BASE}/${journeyId}`, params);
@@ -28,17 +28,20 @@ export async function activateJourney(client, journeyId) {
28
28
  export async function pauseJourney(client, journeyId) {
29
29
  return client.managedPost(`${BASE}/${journeyId}/pause`);
30
30
  }
31
+ export async function resumeJourney(client, journeyId) {
32
+ return client.managedPost(`${BASE}/${journeyId}/resume`);
33
+ }
31
34
  export async function archiveJourney(client, journeyId) {
32
35
  return client.managedPost(`${BASE}/${journeyId}/archive`);
33
36
  }
34
37
  export async function getJourneyAnalytics(client, journeyId) {
35
- return client.get(`${BASE}/${journeyId}/analytics`);
38
+ return client.managedGet(`${BASE}/${journeyId}/analytics`);
36
39
  }
37
40
  export async function getJourneyVisualization(client, journeyId) {
38
- return client.get(`${BASE}/${journeyId}/visualization`);
41
+ return client.managedGet(`${BASE}/${journeyId}/visualization`);
39
42
  }
40
43
  export async function listNodes(client, journeyId) {
41
- return client.get(`${BASE}/${journeyId}/nodes`);
44
+ return client.managedGet(`${BASE}/${journeyId}/nodes`);
42
45
  }
43
46
  export async function addNode(client, journeyId, params) {
44
47
  return client.managedPost(`${BASE}/${journeyId}/nodes`, params);
@@ -56,7 +59,7 @@ export async function listTransitions(client, journeyId, opts) {
56
59
  if (opts?.to_node)
57
60
  qs.set("to_node", opts.to_node);
58
61
  const query = qs.toString();
59
- return client.get(`${BASE}/${journeyId}/transitions${query ? `?${query}` : ""}`);
62
+ return client.managedGet(`${BASE}/${journeyId}/transitions${query ? `?${query}` : ""}`);
60
63
  }
61
64
  export async function addTransition(client, journeyId, params) {
62
65
  return client.managedPost(`${BASE}/${journeyId}/transitions`, params);
@@ -1,6 +1,7 @@
1
1
  export declare function init(apiUrl?: string, portalUrl?: string): Promise<void>;
2
2
  export declare function logout(): void;
3
3
  export declare function listProjects(): Promise<unknown>;
4
+ export declare function showProject(projectId: string): Promise<Record<string, unknown>>;
4
5
  export declare function createProject(name: string, description?: string, enabledServices?: string[]): Promise<unknown>;
5
6
  export declare function listEnvironments(projectId: string): Promise<unknown>;
6
7
  export declare function useEnvironment(tier: string, projectId: string): Promise<void>;
@@ -30,6 +31,21 @@ export declare function mcpLogin(client: AscendKitClient, params: McpLoginParams
30
31
  };
31
32
  accountId: string;
32
33
  }>;
34
+ export declare function mcpSetEnvironmentByPublicKey(client: AscendKitClient, publicKey: string): Promise<{
35
+ updatedFiles: string[];
36
+ environment: {
37
+ id: string;
38
+ name: string;
39
+ tier: string;
40
+ publicKey: string;
41
+ secretKey?: string | null;
42
+ };
43
+ project: {
44
+ id: string;
45
+ name: string;
46
+ };
47
+ role: string;
48
+ }>;
33
49
  export declare function mcpListProjects(client: AscendKitClient): Promise<unknown>;
34
50
  export declare function mcpCreateProject(client: AscendKitClient, params: McpCreateProjectParams): Promise<unknown>;
35
51
  export declare function mcpListEnvironments(client: AscendKitClient, projectId: string): Promise<unknown>;
@@ -48,10 +64,14 @@ export declare function mcpPromoteEnvironment(client: AscendKitClient, params: {
48
64
  targetTier: string;
49
65
  }): Promise<unknown>;
50
66
  export interface McpUpdateEnvironmentVariablesParams {
51
- projectId: string;
52
- envId: string;
67
+ projectId?: string;
68
+ envId?: string;
53
69
  variables: Record<string, string>;
54
70
  }
71
+ export declare function mcpGetEnvironment(client: AscendKitClient, params: {
72
+ projectId?: string;
73
+ envId?: string;
74
+ }): Promise<Record<string, unknown>>;
55
75
  export declare function mcpUpdateEnvironmentVariables(client: AscendKitClient, params: McpUpdateEnvironmentVariablesParams): Promise<unknown>;
56
76
  export declare function getEnvironment(projectId: string, envId: string): Promise<Record<string, unknown>>;
57
77
  export declare function updateEnvironmentVariables(projectId: string, envId: string, variables: Record<string, string>): Promise<unknown>;