@myapihq/sdk 1.0.11 → 1.0.12
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/funnel.d.ts +14 -6
- package/dist/funnel.js +26 -14
- package/package.json +1 -1
- package/src/funnel.ts +21 -11
package/dist/funnel.d.ts
CHANGED
|
@@ -18,14 +18,22 @@ export interface VerifyTest {
|
|
|
18
18
|
details: string;
|
|
19
19
|
}
|
|
20
20
|
export declare function createFunnel(apiKey: string, orgId: string, domain: string): Promise<Funnel>;
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function getFunnel(apiKey: string, orgId: string, funnelId: string): Promise<Funnel>;
|
|
22
|
+
export declare function listFunnels(apiKey: string, orgId: string): Promise<Funnel[]>;
|
|
23
|
+
export declare function deleteFunnel(apiKey: string, orgId: string, funnelId: string): Promise<void>;
|
|
24
|
+
export declare function previewFunnel(apiKey: string, orgId: string, funnelId: string): Promise<{
|
|
25
|
+
preview_url: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function publishFunnel(apiKey: string, orgId: string, funnelId: string): Promise<{
|
|
28
|
+
status: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function getPublishStatus(apiKey: string, orgId: string, funnelId: string): Promise<{
|
|
31
|
+
status: string;
|
|
32
|
+
}>;
|
|
33
|
+
export declare function pushPage(apiKey: string, orgId: string, funnelId: string, slug: string, html: string): Promise<{
|
|
22
34
|
status: string;
|
|
23
|
-
key: string;
|
|
24
35
|
}>;
|
|
25
|
-
export declare function verifyFunnel(apiKey: string, funnelId: string, opts?: {
|
|
36
|
+
export declare function verifyFunnel(apiKey: string, orgId: string, funnelId: string, opts?: {
|
|
26
37
|
html?: string;
|
|
27
38
|
slug?: string;
|
|
28
39
|
}): Promise<VerifyResult>;
|
|
29
|
-
export declare function listFunnels(apiKey: string): Promise<Funnel[]>;
|
|
30
|
-
export declare function getFunnel(apiKey: string, funnelId: string): Promise<Funnel>;
|
|
31
|
-
export declare function deleteFunnel(apiKey: string, funnelId: string): Promise<void>;
|
package/dist/funnel.js
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFunnel = createFunnel;
|
|
4
|
-
exports.pushPage = pushPage;
|
|
5
|
-
exports.verifyFunnel = verifyFunnel;
|
|
6
|
-
exports.listFunnels = listFunnels;
|
|
7
4
|
exports.getFunnel = getFunnel;
|
|
5
|
+
exports.listFunnels = listFunnels;
|
|
8
6
|
exports.deleteFunnel = deleteFunnel;
|
|
7
|
+
exports.previewFunnel = previewFunnel;
|
|
8
|
+
exports.publishFunnel = publishFunnel;
|
|
9
|
+
exports.getPublishStatus = getPublishStatus;
|
|
10
|
+
exports.pushPage = pushPage;
|
|
11
|
+
exports.verifyFunnel = verifyFunnel;
|
|
9
12
|
const client_1 = require("./client");
|
|
10
13
|
const BASE_URL = 'https://api.myfunnelapi.com';
|
|
11
14
|
async function createFunnel(apiKey, orgId, domain) {
|
|
12
|
-
return (0, client_1.request)('POST', `${BASE_URL}/funnel/funnels/create-raw`, apiKey, {
|
|
15
|
+
return (0, client_1.request)('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/create-raw`, apiKey, { domain });
|
|
16
|
+
}
|
|
17
|
+
async function getFunnel(apiKey, orgId, funnelId) {
|
|
18
|
+
return (0, client_1.request)('GET', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}`, apiKey);
|
|
19
|
+
}
|
|
20
|
+
async function listFunnels(apiKey, orgId) {
|
|
21
|
+
return (0, client_1.request)('GET', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels`, apiKey);
|
|
22
|
+
}
|
|
23
|
+
async function deleteFunnel(apiKey, orgId, funnelId) {
|
|
24
|
+
return (0, client_1.request)('DELETE', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}`, apiKey);
|
|
13
25
|
}
|
|
14
|
-
async function
|
|
15
|
-
return (0, client_1.request)('POST', `${BASE_URL}/funnel/funnels/${encodeURIComponent(funnelId)}/
|
|
26
|
+
async function previewFunnel(apiKey, orgId, funnelId) {
|
|
27
|
+
return (0, client_1.request)('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/preview`, apiKey);
|
|
16
28
|
}
|
|
17
|
-
async function
|
|
18
|
-
return (0, client_1.request)('POST', `${BASE_URL}/funnel/funnels/${encodeURIComponent(funnelId)}/
|
|
29
|
+
async function publishFunnel(apiKey, orgId, funnelId) {
|
|
30
|
+
return (0, client_1.request)('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/publish`, apiKey);
|
|
19
31
|
}
|
|
20
|
-
async function
|
|
21
|
-
return (0, client_1.request)('GET', `${BASE_URL}/funnel/funnels`, apiKey);
|
|
32
|
+
async function getPublishStatus(apiKey, orgId, funnelId) {
|
|
33
|
+
return (0, client_1.request)('GET', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/publish/status`, apiKey);
|
|
22
34
|
}
|
|
23
|
-
async function
|
|
24
|
-
return (0, client_1.request)('
|
|
35
|
+
async function pushPage(apiKey, orgId, funnelId, slug, html) {
|
|
36
|
+
return (0, client_1.request)('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/push-page`, apiKey, { slug, html });
|
|
25
37
|
}
|
|
26
|
-
async function
|
|
27
|
-
return (0, client_1.request)('
|
|
38
|
+
async function verifyFunnel(apiKey, orgId, funnelId, opts) {
|
|
39
|
+
return (0, client_1.request)('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/verify`, apiKey, opts || {});
|
|
28
40
|
}
|
package/package.json
CHANGED
package/src/funnel.ts
CHANGED
|
@@ -10,20 +10,30 @@ export interface VerifyResult {
|
|
|
10
10
|
export interface VerifyTest { type: 'link' | 'webhook'; url: string; passed: boolean; details: string }
|
|
11
11
|
|
|
12
12
|
export async function createFunnel(apiKey: string, orgId: string, domain: string): Promise<Funnel> {
|
|
13
|
-
return request('POST', `${BASE_URL}/funnel/funnels/create-raw`, apiKey, {
|
|
13
|
+
return request('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/create-raw`, apiKey, { domain });
|
|
14
14
|
}
|
|
15
|
-
export async function
|
|
16
|
-
return request('
|
|
15
|
+
export async function getFunnel(apiKey: string, orgId: string, funnelId: string): Promise<Funnel> {
|
|
16
|
+
return request('GET', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}`, apiKey);
|
|
17
17
|
}
|
|
18
|
-
export async function
|
|
19
|
-
return request('
|
|
18
|
+
export async function listFunnels(apiKey: string, orgId: string): Promise<Funnel[]> {
|
|
19
|
+
return request('GET', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels`, apiKey);
|
|
20
20
|
}
|
|
21
|
-
export async function
|
|
22
|
-
return request('
|
|
21
|
+
export async function deleteFunnel(apiKey: string, orgId: string, funnelId: string): Promise<void> {
|
|
22
|
+
return request('DELETE', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}`, apiKey);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
|
|
25
|
+
export async function previewFunnel(apiKey: string, orgId: string, funnelId: string): Promise<{ preview_url: string }> {
|
|
26
|
+
return request('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/preview`, apiKey);
|
|
27
|
+
}
|
|
28
|
+
export async function publishFunnel(apiKey: string, orgId: string, funnelId: string): Promise<{ status: string }> {
|
|
29
|
+
return request('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/publish`, apiKey);
|
|
30
|
+
}
|
|
31
|
+
export async function getPublishStatus(apiKey: string, orgId: string, funnelId: string): Promise<{ status: string }> {
|
|
32
|
+
return request('GET', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/publish/status`, apiKey);
|
|
33
|
+
}
|
|
34
|
+
export async function pushPage(apiKey: string, orgId: string, funnelId: string, slug: string, html: string): Promise<{ status: string }> {
|
|
35
|
+
return request('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/push-page`, apiKey, { slug, html });
|
|
26
36
|
}
|
|
27
|
-
export async function
|
|
28
|
-
return request('
|
|
37
|
+
export async function verifyFunnel(apiKey: string, orgId: string, funnelId: string, opts?: { html?: string; slug?: string }): Promise<VerifyResult> {
|
|
38
|
+
return request('POST', `${BASE_URL}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/verify`, apiKey, opts || {});
|
|
29
39
|
}
|