@myapihq/sdk 2.26.1 → 2.27.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.
- package/dist/funnel.d.ts +13 -1
- package/dist/funnel.js +16 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/funnel.d.ts
CHANGED
|
@@ -64,11 +64,23 @@ export declare function pushFunnelPage(apiKey: string, orgId: string, funnelId:
|
|
|
64
64
|
export interface FunnelPage {
|
|
65
65
|
slug: string;
|
|
66
66
|
url?: string;
|
|
67
|
+
/** Raw published content. Present only when listed with includeContent. */
|
|
68
|
+
content?: string;
|
|
67
69
|
published_at?: string;
|
|
68
70
|
updated_at?: string;
|
|
69
71
|
[key: string]: unknown;
|
|
70
72
|
}
|
|
71
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Lists a funnel's pages.
|
|
75
|
+
*
|
|
76
|
+
* `includeContent` fetches each page's published content from KV. Without it a
|
|
77
|
+
* caller learns which paths exist and nothing about what is on them — so an
|
|
78
|
+
* agent asked to change one page had to regenerate the whole site or scrape the
|
|
79
|
+
* live URL, and `funnel push` overwrites. Editing was a blind write.
|
|
80
|
+
*/
|
|
81
|
+
export declare function listFunnelPages(apiKey: string, orgId: string, funnelId: string, opts?: {
|
|
82
|
+
includeContent?: boolean;
|
|
83
|
+
}): Promise<FunnelPage[]>;
|
|
72
84
|
export declare function verifyFunnel(apiKey: string, orgId: string, funnelId: string, opts?: {
|
|
73
85
|
html?: string;
|
|
74
86
|
slug?: string;
|
package/dist/funnel.js
CHANGED
|
@@ -54,11 +54,25 @@ async function deleteFunnel(apiKey, orgId, funnelId) {
|
|
|
54
54
|
async function pushFunnelPage(apiKey, orgId, funnelId, payload) {
|
|
55
55
|
return (0, client_1.request)('POST', `${config_1.FUNNEL_BASE}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/push-page`, apiKey, payload);
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Lists a funnel's pages.
|
|
59
|
+
*
|
|
60
|
+
* `includeContent` fetches each page's published content from KV. Without it a
|
|
61
|
+
* caller learns which paths exist and nothing about what is on them — so an
|
|
62
|
+
* agent asked to change one page had to regenerate the whole site or scrape the
|
|
63
|
+
* live URL, and `funnel push` overwrites. Editing was a blind write.
|
|
64
|
+
*/
|
|
65
|
+
async function listFunnelPages(apiKey, orgId, funnelId, opts) {
|
|
58
66
|
// Backend returns `{ pages: [...] }` for this endpoint (every other list
|
|
59
67
|
// endpoint returns a flat array). Unwrap so the SDK's contract matches the
|
|
60
68
|
// rest — callers expect an array.
|
|
61
|
-
|
|
69
|
+
// Two whole template literals rather than a concatenation: the coverage
|
|
70
|
+
// linter resolves the URL statically, and a built-up string reads to it as an
|
|
71
|
+
// uncalled route.
|
|
72
|
+
const url = opts?.includeContent
|
|
73
|
+
? `${config_1.FUNNEL_BASE}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/pages?include_content=true`
|
|
74
|
+
: `${config_1.FUNNEL_BASE}/funnel/orgs/${encodeURIComponent(orgId)}/funnels/${encodeURIComponent(funnelId)}/pages`;
|
|
75
|
+
const res = await (0, client_1.request)('GET', url, apiKey);
|
|
62
76
|
if (Array.isArray(res))
|
|
63
77
|
return res;
|
|
64
78
|
return res?.pages ?? [];
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.
|
|
1
|
+
export declare const SDK_VERSION = "2.27.1";
|
package/dist/version.js
CHANGED
|
@@ -8,4 +8,4 @@ exports.SDK_VERSION = void 0;
|
|
|
8
8
|
// Why a constant and not a package.json read: the SDK runs inside edge
|
|
9
9
|
// functions (Cloudflare Workers), so it must not import node:fs. A literal
|
|
10
10
|
// is the only version source that works in every runtime we ship to.
|
|
11
|
-
exports.SDK_VERSION = '2.
|
|
11
|
+
exports.SDK_VERSION = '2.27.1';
|