@myapihq/cli 1.0.5 → 1.0.6
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/commands/account.js +5 -16
- package/dist/commands/setup.js +10 -99
- package/dist/index.js +21 -5
- package/package.json +1 -1
- package/src/commands/account.ts +6 -20
- package/src/commands/setup.ts +10 -109
- package/src/index.ts +21 -5
- package/tsconfig.json +3 -6
- package/dist/cli/src/commands/account.d.ts +0 -4
- package/dist/cli/src/commands/account.js +0 -91
- package/dist/cli/src/commands/billing.d.ts +0 -4
- package/dist/cli/src/commands/billing.js +0 -34
- package/dist/cli/src/commands/domain.d.ts +0 -5
- package/dist/cli/src/commands/domain.js +0 -56
- package/dist/cli/src/commands/email.d.ts +0 -8
- package/dist/cli/src/commands/email.js +0 -95
- package/dist/cli/src/commands/funnel.d.ts +0 -3
- package/dist/cli/src/commands/funnel.js +0 -37
- package/dist/cli/src/commands/image.d.ts +0 -2
- package/dist/cli/src/commands/image.js +0 -47
- package/dist/cli/src/commands/org.d.ts +0 -5
- package/dist/cli/src/commands/org.js +0 -67
- package/dist/cli/src/commands/setup.d.ts +0 -1
- package/dist/cli/src/commands/setup.js +0 -165
- package/dist/cli/src/commands/storage.d.ts +0 -3
- package/dist/cli/src/commands/storage.js +0 -36
- package/dist/cli/src/commands/webhook.d.ts +0 -3
- package/dist/cli/src/commands/webhook.js +0 -28
- package/dist/cli/src/commands/workflow.d.ts +0 -5
- package/dist/cli/src/commands/workflow.js +0 -57
- package/dist/cli/src/config.d.ts +0 -8
- package/dist/cli/src/config.js +0 -69
- package/dist/cli/src/index.d.ts +0 -2
- package/dist/cli/src/index.js +0 -117
- package/dist/cli/src/output.d.ts +0 -5
- package/dist/cli/src/output.js +0 -42
- package/dist/cli/src/utils.d.ts +0 -5
- package/dist/cli/src/utils.js +0 -34
- package/dist/sdk/src/client.d.ts +0 -6
- package/dist/sdk/src/client.js +0 -51
- package/dist/sdk/src/domain.d.ts +0 -32
- package/dist/sdk/src/domain.js +0 -36
- package/dist/sdk/src/email.d.ts +0 -144
- package/dist/sdk/src/email.js +0 -116
- package/dist/sdk/src/funnel.d.ts +0 -31
- package/dist/sdk/src/funnel.js +0 -28
- package/dist/sdk/src/hq.d.ts +0 -84
- package/dist/sdk/src/hq.js +0 -80
- package/dist/sdk/src/image.d.ts +0 -21
- package/dist/sdk/src/image.js +0 -16
- package/dist/sdk/src/index.d.ts +0 -11
- package/dist/sdk/src/index.js +0 -51
- package/dist/sdk/src/pixel.d.ts +0 -65
- package/dist/sdk/src/pixel.js +0 -44
- package/dist/sdk/src/storage.d.ts +0 -10
- package/dist/sdk/src/storage.js +0 -48
- package/dist/sdk/src/types.d.ts +0 -17
- package/dist/sdk/src/types.js +0 -2
- package/dist/sdk/src/webhook.d.ts +0 -20
- package/dist/sdk/src/webhook.js +0 -20
- package/dist/sdk/src/workflow.d.ts +0 -56
- package/dist/sdk/src/workflow.js +0 -40
package/dist/sdk/src/funnel.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface Funnel {
|
|
2
|
-
id: string;
|
|
3
|
-
org_id: string;
|
|
4
|
-
domain: string;
|
|
5
|
-
created_at: string;
|
|
6
|
-
}
|
|
7
|
-
export interface VerifyResult {
|
|
8
|
-
pages?: Array<{
|
|
9
|
-
slug: string;
|
|
10
|
-
tests: VerifyTest[];
|
|
11
|
-
}>;
|
|
12
|
-
tests?: VerifyTest[];
|
|
13
|
-
}
|
|
14
|
-
export interface VerifyTest {
|
|
15
|
-
type: 'link' | 'webhook';
|
|
16
|
-
url: string;
|
|
17
|
-
passed: boolean;
|
|
18
|
-
details: string;
|
|
19
|
-
}
|
|
20
|
-
export declare function createFunnel(apiKey: string, orgId: string, domain: string): Promise<Funnel>;
|
|
21
|
-
export declare function pushPage(apiKey: string, funnelId: string, slug: string, html: string): Promise<{
|
|
22
|
-
status: string;
|
|
23
|
-
key: string;
|
|
24
|
-
}>;
|
|
25
|
-
export declare function verifyFunnel(apiKey: string, funnelId: string, opts?: {
|
|
26
|
-
html?: string;
|
|
27
|
-
slug?: string;
|
|
28
|
-
}): 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/sdk/src/funnel.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFunnel = createFunnel;
|
|
4
|
-
exports.pushPage = pushPage;
|
|
5
|
-
exports.verifyFunnel = verifyFunnel;
|
|
6
|
-
exports.listFunnels = listFunnels;
|
|
7
|
-
exports.getFunnel = getFunnel;
|
|
8
|
-
exports.deleteFunnel = deleteFunnel;
|
|
9
|
-
const client_1 = require("./client");
|
|
10
|
-
const BASE_URL = 'https://api.myfunnelapi.com';
|
|
11
|
-
async function createFunnel(apiKey, orgId, domain) {
|
|
12
|
-
return (0, client_1.request)('POST', `${BASE_URL}/funnel/funnels/create-raw`, apiKey, { org_id: orgId, domain });
|
|
13
|
-
}
|
|
14
|
-
async function pushPage(apiKey, funnelId, slug, html) {
|
|
15
|
-
return (0, client_1.request)('POST', `${BASE_URL}/funnel/funnels/${encodeURIComponent(funnelId)}/push-page`, apiKey, { slug, html });
|
|
16
|
-
}
|
|
17
|
-
async function verifyFunnel(apiKey, funnelId, opts) {
|
|
18
|
-
return (0, client_1.request)('POST', `${BASE_URL}/funnel/funnels/${encodeURIComponent(funnelId)}/verify`, apiKey, opts || {});
|
|
19
|
-
}
|
|
20
|
-
async function listFunnels(apiKey) {
|
|
21
|
-
return (0, client_1.request)('GET', `${BASE_URL}/funnel/funnels`, apiKey);
|
|
22
|
-
}
|
|
23
|
-
async function getFunnel(apiKey, funnelId) {
|
|
24
|
-
return (0, client_1.request)('GET', `${BASE_URL}/funnel/funnels/${encodeURIComponent(funnelId)}`, apiKey);
|
|
25
|
-
}
|
|
26
|
-
async function deleteFunnel(apiKey, funnelId) {
|
|
27
|
-
return (0, client_1.request)('DELETE', `${BASE_URL}/funnel/funnels/${encodeURIComponent(funnelId)}`, apiKey);
|
|
28
|
-
}
|
package/dist/sdk/src/hq.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
export interface Org {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
tagline?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
business_sector?: string;
|
|
7
|
-
logo_url?: string;
|
|
8
|
-
favicon_url?: string;
|
|
9
|
-
og_image_url?: string;
|
|
10
|
-
color_palette?: Record<string, string>;
|
|
11
|
-
font_family?: string;
|
|
12
|
-
imagery_style?: string;
|
|
13
|
-
headline?: string;
|
|
14
|
-
subheadline?: string;
|
|
15
|
-
cta_text?: string;
|
|
16
|
-
value_propositions?: string[];
|
|
17
|
-
social_links?: Record<string, string>;
|
|
18
|
-
canonical_url?: string;
|
|
19
|
-
privacy_policy_url?: string;
|
|
20
|
-
cookie_policy_url?: string;
|
|
21
|
-
terms_url?: string;
|
|
22
|
-
gdpr_enabled?: boolean;
|
|
23
|
-
default_language?: string;
|
|
24
|
-
tracking?: Record<string, unknown>;
|
|
25
|
-
created_at: string;
|
|
26
|
-
updated_at: string;
|
|
27
|
-
}
|
|
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<{
|
|
38
|
-
api_key: string;
|
|
39
|
-
id: string;
|
|
40
|
-
prefix: string;
|
|
41
|
-
}>;
|
|
42
|
-
export declare function listApiKeys(apiKey: string): Promise<{
|
|
43
|
-
id: string;
|
|
44
|
-
name: string;
|
|
45
|
-
prefix: string;
|
|
46
|
-
created_at: string;
|
|
47
|
-
}[]>;
|
|
48
|
-
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
|
-
export declare function createOrg(apiKey: string, payload: OrgPayload): Promise<Org>;
|
|
55
|
-
export declare function importOrg(apiKey: string, domain: string, autoAccept?: boolean): Promise<{
|
|
56
|
-
job_id: string;
|
|
57
|
-
status: string;
|
|
58
|
-
}>;
|
|
59
|
-
export declare function getOrgImportStatus(apiKey: string, jobId: string): Promise<{
|
|
60
|
-
status: string;
|
|
61
|
-
brand_preview: unknown;
|
|
62
|
-
}>;
|
|
63
|
-
export declare function confirmOrgImport(apiKey: string, jobId: string, overrides?: Partial<OrgPayload>): Promise<Org>;
|
|
64
|
-
export declare function listOrgs(apiKey: string): Promise<Org[]>;
|
|
65
|
-
export declare function getOrg(apiKey: string, orgId: string): Promise<Org>;
|
|
66
|
-
export declare function updateOrg(apiKey: string, orgId: string, payload: Partial<OrgPayload>): Promise<Org>;
|
|
67
|
-
export declare function deleteOrg(apiKey: string, orgId: string): Promise<void>;
|
|
68
|
-
export declare function getBalance(apiKey: string): Promise<{
|
|
69
|
-
balance_cents: number;
|
|
70
|
-
balance_display: string;
|
|
71
|
-
has_payment_method: boolean;
|
|
72
|
-
}>;
|
|
73
|
-
export declare function getBillingHistory(apiKey: string): Promise<{
|
|
74
|
-
amount_cents: number;
|
|
75
|
-
status: string;
|
|
76
|
-
created_at: string;
|
|
77
|
-
}[]>;
|
|
78
|
-
export declare function setupPayment(apiKey: string): Promise<{
|
|
79
|
-
url: string;
|
|
80
|
-
}>;
|
|
81
|
-
export declare function topUp(apiKey: string, amountCents: number): Promise<{
|
|
82
|
-
new_balance_cents: number;
|
|
83
|
-
new_balance_display: string;
|
|
84
|
-
}>;
|
package/dist/sdk/src/hq.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAgentAccount = createAgentAccount;
|
|
4
|
-
exports.recoverAgentToken = recoverAgentToken;
|
|
5
|
-
exports.createApiKey = createApiKey;
|
|
6
|
-
exports.listApiKeys = listApiKeys;
|
|
7
|
-
exports.revokeApiKey = revokeApiKey;
|
|
8
|
-
exports.linkAgent = linkAgent;
|
|
9
|
-
exports.listLinkedAgents = listLinkedAgents;
|
|
10
|
-
exports.createOrg = createOrg;
|
|
11
|
-
exports.importOrg = importOrg;
|
|
12
|
-
exports.getOrgImportStatus = getOrgImportStatus;
|
|
13
|
-
exports.confirmOrgImport = confirmOrgImport;
|
|
14
|
-
exports.listOrgs = listOrgs;
|
|
15
|
-
exports.getOrg = getOrg;
|
|
16
|
-
exports.updateOrg = updateOrg;
|
|
17
|
-
exports.deleteOrg = deleteOrg;
|
|
18
|
-
exports.getBalance = getBalance;
|
|
19
|
-
exports.getBillingHistory = getBillingHistory;
|
|
20
|
-
exports.setupPayment = setupPayment;
|
|
21
|
-
exports.topUp = topUp;
|
|
22
|
-
const client_1 = require("./client");
|
|
23
|
-
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 });
|
|
32
|
-
}
|
|
33
|
-
async function listApiKeys(apiKey) {
|
|
34
|
-
return (0, client_1.request)('GET', `${BASE_URL}/hq/account/keys`, apiKey);
|
|
35
|
-
}
|
|
36
|
-
async function revokeApiKey(apiKey, keyId) {
|
|
37
|
-
return (0, client_1.request)('DELETE', `${BASE_URL}/hq/account/delete/key/${encodeURIComponent(keyId)}`, apiKey);
|
|
38
|
-
}
|
|
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
|
-
async function createOrg(apiKey, payload) {
|
|
46
|
-
return (0, client_1.request)('POST', `${BASE_URL}/hq/orgs`, apiKey, payload);
|
|
47
|
-
}
|
|
48
|
-
async function importOrg(apiKey, domain, autoAccept) {
|
|
49
|
-
return (0, client_1.request)('POST', `${BASE_URL}/hq/org-imports`, apiKey, { domain, auto_accept: autoAccept });
|
|
50
|
-
}
|
|
51
|
-
async function getOrgImportStatus(apiKey, jobId) {
|
|
52
|
-
return (0, client_1.request)('GET', `${BASE_URL}/hq/org-imports/${encodeURIComponent(jobId)}`, apiKey);
|
|
53
|
-
}
|
|
54
|
-
async function confirmOrgImport(apiKey, jobId, overrides) {
|
|
55
|
-
return (0, client_1.request)('POST', `${BASE_URL}/hq/org-imports/${encodeURIComponent(jobId)}/confirm`, apiKey, overrides);
|
|
56
|
-
}
|
|
57
|
-
async function listOrgs(apiKey) {
|
|
58
|
-
return (0, client_1.request)('GET', `${BASE_URL}/hq/orgs`, apiKey);
|
|
59
|
-
}
|
|
60
|
-
async function getOrg(apiKey, orgId) {
|
|
61
|
-
return (0, client_1.request)('GET', `${BASE_URL}/hq/orgs/${encodeURIComponent(orgId)}`, apiKey);
|
|
62
|
-
}
|
|
63
|
-
async function updateOrg(apiKey, orgId, payload) {
|
|
64
|
-
return (0, client_1.request)('PATCH', `${BASE_URL}/hq/orgs/${encodeURIComponent(orgId)}`, apiKey, payload);
|
|
65
|
-
}
|
|
66
|
-
async function deleteOrg(apiKey, orgId) {
|
|
67
|
-
return (0, client_1.request)('DELETE', `${BASE_URL}/hq/orgs/${encodeURIComponent(orgId)}`, apiKey);
|
|
68
|
-
}
|
|
69
|
-
async function getBalance(apiKey) {
|
|
70
|
-
return (0, client_1.request)('GET', `${BASE_URL}/hq/billing/balance`, apiKey);
|
|
71
|
-
}
|
|
72
|
-
async function getBillingHistory(apiKey) {
|
|
73
|
-
return (0, client_1.request)('GET', `${BASE_URL}/hq/billing/history`, apiKey);
|
|
74
|
-
}
|
|
75
|
-
async function setupPayment(apiKey) {
|
|
76
|
-
return (0, client_1.request)('POST', `${BASE_URL}/hq/billing/setup-payment`, apiKey);
|
|
77
|
-
}
|
|
78
|
-
async function topUp(apiKey, amountCents) {
|
|
79
|
-
return (0, client_1.request)('POST', `${BASE_URL}/hq/billing/topup`, apiKey, { amount_cents: amountCents });
|
|
80
|
-
}
|
package/dist/sdk/src/image.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface ImageJob {
|
|
2
|
-
job_id: string;
|
|
3
|
-
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
4
|
-
url?: string;
|
|
5
|
-
error?: string;
|
|
6
|
-
prompt: string;
|
|
7
|
-
aspect_ratio: string;
|
|
8
|
-
created_at: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function generateImage(apiKey: string, payload: {
|
|
11
|
-
prompt: string;
|
|
12
|
-
aspect_ratio?: '1:1' | '16:9' | '9:16' | '4:3' | '3:4';
|
|
13
|
-
style?: string;
|
|
14
|
-
colors?: string;
|
|
15
|
-
has_text?: boolean;
|
|
16
|
-
}): Promise<{
|
|
17
|
-
job_id: string;
|
|
18
|
-
status: string;
|
|
19
|
-
}>;
|
|
20
|
-
export declare function getImageJob(apiKey: string, jobId: string): Promise<ImageJob>;
|
|
21
|
-
export declare function listImages(apiKey: string): Promise<ImageJob[]>;
|
package/dist/sdk/src/image.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateImage = generateImage;
|
|
4
|
-
exports.getImageJob = getImageJob;
|
|
5
|
-
exports.listImages = listImages;
|
|
6
|
-
const client_1 = require("./client");
|
|
7
|
-
const BASE_URL = 'https://api.myimageapi.com';
|
|
8
|
-
async function generateImage(apiKey, payload) {
|
|
9
|
-
return (0, client_1.request)('POST', `${BASE_URL}/image/generate`, apiKey, payload);
|
|
10
|
-
}
|
|
11
|
-
async function getImageJob(apiKey, jobId) {
|
|
12
|
-
return (0, client_1.request)('GET', `${BASE_URL}/image/jobs/${encodeURIComponent(jobId)}`, apiKey);
|
|
13
|
-
}
|
|
14
|
-
async function listImages(apiKey) {
|
|
15
|
-
return (0, client_1.request)('GET', `${BASE_URL}/image/list`, apiKey);
|
|
16
|
-
}
|
package/dist/sdk/src/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './client';
|
|
3
|
-
export * as hq from './hq';
|
|
4
|
-
export * as domain from './domain';
|
|
5
|
-
export * as email from './email';
|
|
6
|
-
export * as funnel from './funnel';
|
|
7
|
-
export * as image from './image';
|
|
8
|
-
export * as pixel from './pixel';
|
|
9
|
-
export * as storage from './storage';
|
|
10
|
-
export * as webhook from './webhook';
|
|
11
|
-
export * as workflow from './workflow';
|
package/dist/sdk/src/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.workflow = exports.webhook = exports.storage = exports.pixel = exports.image = exports.funnel = exports.email = exports.domain = exports.hq = void 0;
|
|
40
|
-
// AUTO-GENERATED by scripts/generate-indexes.js — do not edit manually
|
|
41
|
-
__exportStar(require("./types"), exports);
|
|
42
|
-
__exportStar(require("./client"), exports);
|
|
43
|
-
exports.hq = __importStar(require("./hq"));
|
|
44
|
-
exports.domain = __importStar(require("./domain"));
|
|
45
|
-
exports.email = __importStar(require("./email"));
|
|
46
|
-
exports.funnel = __importStar(require("./funnel"));
|
|
47
|
-
exports.image = __importStar(require("./image"));
|
|
48
|
-
exports.pixel = __importStar(require("./pixel"));
|
|
49
|
-
exports.storage = __importStar(require("./storage"));
|
|
50
|
-
exports.webhook = __importStar(require("./webhook"));
|
|
51
|
-
exports.workflow = __importStar(require("./workflow"));
|
package/dist/sdk/src/pixel.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export interface InteractionsResponse {
|
|
2
|
-
interactions: (Visit | PixelEvent)[];
|
|
3
|
-
total_visits: number;
|
|
4
|
-
total_events: number;
|
|
5
|
-
limit: number;
|
|
6
|
-
offset: number;
|
|
7
|
-
}
|
|
8
|
-
export interface Visit {
|
|
9
|
-
type: 'visit';
|
|
10
|
-
pixel_id: string;
|
|
11
|
-
from_url: string;
|
|
12
|
-
to_url: string;
|
|
13
|
-
ts: string;
|
|
14
|
-
}
|
|
15
|
-
export interface PixelEvent {
|
|
16
|
-
type: 'event';
|
|
17
|
-
pixel_id: string;
|
|
18
|
-
event_type: 'sent' | 'open' | 'click' | 'page_visit';
|
|
19
|
-
url?: string;
|
|
20
|
-
campaign_id?: string;
|
|
21
|
-
ts: string;
|
|
22
|
-
}
|
|
23
|
-
export declare function getInteractions(apiKey: string, params: {
|
|
24
|
-
website?: string;
|
|
25
|
-
domain?: string;
|
|
26
|
-
campaign_id?: string;
|
|
27
|
-
from?: string;
|
|
28
|
-
to?: string;
|
|
29
|
-
limit?: number;
|
|
30
|
-
offset?: number;
|
|
31
|
-
}): Promise<InteractionsResponse>;
|
|
32
|
-
export declare function getVisits(apiKey: string, params: {
|
|
33
|
-
website: string;
|
|
34
|
-
from?: string;
|
|
35
|
-
to?: string;
|
|
36
|
-
limit?: number;
|
|
37
|
-
offset?: number;
|
|
38
|
-
}): Promise<{
|
|
39
|
-
visits: Visit[];
|
|
40
|
-
total: number;
|
|
41
|
-
limit: number;
|
|
42
|
-
offset: number;
|
|
43
|
-
}>;
|
|
44
|
-
export declare function getEvents(apiKey: string, params: {
|
|
45
|
-
campaign_id?: string;
|
|
46
|
-
domain?: string;
|
|
47
|
-
from?: string;
|
|
48
|
-
to?: string;
|
|
49
|
-
limit?: number;
|
|
50
|
-
offset?: number;
|
|
51
|
-
}): Promise<{
|
|
52
|
-
events: PixelEvent[];
|
|
53
|
-
total: number;
|
|
54
|
-
limit: number;
|
|
55
|
-
offset: number;
|
|
56
|
-
}>;
|
|
57
|
-
export declare function getIdentity(apiKey: string, pixelId: string): Promise<{
|
|
58
|
-
uuid: string;
|
|
59
|
-
is_resolved: boolean;
|
|
60
|
-
nodes: Record<string, {
|
|
61
|
-
type: string;
|
|
62
|
-
probability: number;
|
|
63
|
-
}>;
|
|
64
|
-
latency_ms: number;
|
|
65
|
-
}>;
|
package/dist/sdk/src/pixel.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInteractions = getInteractions;
|
|
4
|
-
exports.getVisits = getVisits;
|
|
5
|
-
exports.getEvents = getEvents;
|
|
6
|
-
exports.getIdentity = getIdentity;
|
|
7
|
-
const client_1 = require("./client");
|
|
8
|
-
const BASE_URL = 'https://api.mypixelapi.com';
|
|
9
|
-
async function getInteractions(apiKey, params) {
|
|
10
|
-
const qs = new URLSearchParams();
|
|
11
|
-
for (const [key, val] of Object.entries(params)) {
|
|
12
|
-
if (val !== undefined && val !== null) {
|
|
13
|
-
qs.set(key, String(val));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const queryString = qs.toString();
|
|
17
|
-
const url = `${BASE_URL}/pixel/interactions${queryString ? `?${queryString}` : ''}`;
|
|
18
|
-
return (0, client_1.request)('GET', url, apiKey);
|
|
19
|
-
}
|
|
20
|
-
async function getVisits(apiKey, params) {
|
|
21
|
-
const qs = new URLSearchParams();
|
|
22
|
-
for (const [key, val] of Object.entries(params)) {
|
|
23
|
-
if (val !== undefined && val !== null) {
|
|
24
|
-
qs.set(key, String(val));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const queryString = qs.toString();
|
|
28
|
-
const url = `${BASE_URL}/pixel/visits${queryString ? `?${queryString}` : ''}`;
|
|
29
|
-
return (0, client_1.request)('GET', url, apiKey);
|
|
30
|
-
}
|
|
31
|
-
async function getEvents(apiKey, params) {
|
|
32
|
-
const qs = new URLSearchParams();
|
|
33
|
-
for (const [key, val] of Object.entries(params)) {
|
|
34
|
-
if (val !== undefined && val !== null) {
|
|
35
|
-
qs.set(key, String(val));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const queryString = qs.toString();
|
|
39
|
-
const url = `${BASE_URL}/pixel/events${queryString ? `?${queryString}` : ''}`;
|
|
40
|
-
return (0, client_1.request)('GET', url, apiKey);
|
|
41
|
-
}
|
|
42
|
-
async function getIdentity(apiKey, pixelId) {
|
|
43
|
-
return (0, client_1.request)('GET', `${BASE_URL}/pixel/identity/${encodeURIComponent(pixelId)}`, apiKey);
|
|
44
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface Asset {
|
|
2
|
-
asset_id: string;
|
|
3
|
-
url: string;
|
|
4
|
-
name: string;
|
|
5
|
-
created_at: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function ingestAsset(apiKey: string, orgId: string, url: string, name?: string): Promise<Asset>;
|
|
8
|
-
export declare function uploadAsset(apiKey: string, orgId: string, file: Blob | Buffer, contentType: 'image/jpeg' | 'image/png', name?: string): Promise<Asset>;
|
|
9
|
-
export declare function listAssets(apiKey: string, orgId: string): Promise<Asset[]>;
|
|
10
|
-
export declare function deleteAsset(apiKey: string, orgId: string, assetId: string): Promise<void>;
|
package/dist/sdk/src/storage.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ingestAsset = ingestAsset;
|
|
4
|
-
exports.uploadAsset = uploadAsset;
|
|
5
|
-
exports.listAssets = listAssets;
|
|
6
|
-
exports.deleteAsset = deleteAsset;
|
|
7
|
-
const client_1 = require("./client");
|
|
8
|
-
const BASE_URL = 'https://api.mystorageapi.com';
|
|
9
|
-
async function ingestAsset(apiKey, orgId, url, name) {
|
|
10
|
-
return (0, client_1.request)('POST', `${BASE_URL}/storage/orgs/${encodeURIComponent(orgId)}/assets/ingest`, apiKey, { url, name });
|
|
11
|
-
}
|
|
12
|
-
async function uploadAsset(apiKey, orgId, file, contentType, name) {
|
|
13
|
-
const headers = {
|
|
14
|
-
'Authorization': `Bearer ${apiKey}`
|
|
15
|
-
};
|
|
16
|
-
const formData = new FormData();
|
|
17
|
-
formData.append('file', new Blob([file], { type: contentType }));
|
|
18
|
-
if (name) {
|
|
19
|
-
formData.append('name', name);
|
|
20
|
-
}
|
|
21
|
-
const response = await fetch(`${BASE_URL}/storage/orgs/${encodeURIComponent(orgId)}/assets/upload`, {
|
|
22
|
-
method: 'POST',
|
|
23
|
-
headers,
|
|
24
|
-
body: formData
|
|
25
|
-
});
|
|
26
|
-
let result;
|
|
27
|
-
try {
|
|
28
|
-
result = await response.json();
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
throw new client_1.MyApiError('invalid_json_response', response.status);
|
|
32
|
-
}
|
|
33
|
-
if (!response.ok) {
|
|
34
|
-
const code = result?.error || 'unknown_error';
|
|
35
|
-
throw new client_1.MyApiError(code, response.status);
|
|
36
|
-
}
|
|
37
|
-
const apiResponse = result;
|
|
38
|
-
if (!apiResponse.success) {
|
|
39
|
-
throw new client_1.MyApiError(apiResponse.error || 'unknown_error', response.status);
|
|
40
|
-
}
|
|
41
|
-
return apiResponse.data;
|
|
42
|
-
}
|
|
43
|
-
async function listAssets(apiKey, orgId) {
|
|
44
|
-
return (0, client_1.request)('GET', `${BASE_URL}/storage/orgs/${encodeURIComponent(orgId)}/assets`, apiKey);
|
|
45
|
-
}
|
|
46
|
-
async function deleteAsset(apiKey, orgId, assetId) {
|
|
47
|
-
return (0, client_1.request)('DELETE', `${BASE_URL}/storage/orgs/${encodeURIComponent(orgId)}/assets/${encodeURIComponent(assetId)}`, apiKey);
|
|
48
|
-
}
|
package/dist/sdk/src/types.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface ApiResponse<T> {
|
|
2
|
-
success: boolean;
|
|
3
|
-
data: T | null;
|
|
4
|
-
error: string | null;
|
|
5
|
-
meta: {
|
|
6
|
-
request_id: string;
|
|
7
|
-
latency_ms: number;
|
|
8
|
-
service: string;
|
|
9
|
-
version: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface PaginatedResponse<T> {
|
|
13
|
-
data: T[];
|
|
14
|
-
total: number;
|
|
15
|
-
limit: number;
|
|
16
|
-
offset: number;
|
|
17
|
-
}
|
package/dist/sdk/src/types.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface WebhookEndpoint {
|
|
2
|
-
id: string;
|
|
3
|
-
org_id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
slug: string;
|
|
6
|
-
inbound_url: string;
|
|
7
|
-
created_at: string;
|
|
8
|
-
}
|
|
9
|
-
export interface Delivery {
|
|
10
|
-
id: string;
|
|
11
|
-
endpoint_id: string;
|
|
12
|
-
payload: unknown;
|
|
13
|
-
headers: Record<string, string>;
|
|
14
|
-
status: string;
|
|
15
|
-
created_at: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function createEndpoint(apiKey: string, orgId: string, name: string, description?: string): Promise<WebhookEndpoint>;
|
|
18
|
-
export declare function listEndpoints(apiKey: string): Promise<WebhookEndpoint[]>;
|
|
19
|
-
export declare function deleteEndpoint(apiKey: string, endpointId: string): Promise<void>;
|
|
20
|
-
export declare function getDelivery(apiKey: string, deliveryId: string): Promise<Delivery>;
|
package/dist/sdk/src/webhook.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createEndpoint = createEndpoint;
|
|
4
|
-
exports.listEndpoints = listEndpoints;
|
|
5
|
-
exports.deleteEndpoint = deleteEndpoint;
|
|
6
|
-
exports.getDelivery = getDelivery;
|
|
7
|
-
const client_1 = require("./client");
|
|
8
|
-
const BASE_URL = 'https://api.mywebhookapi.com';
|
|
9
|
-
async function createEndpoint(apiKey, orgId, name, description) {
|
|
10
|
-
return (0, client_1.request)('POST', `${BASE_URL}/webhook/endpoints`, apiKey, { org_id: orgId, name, description });
|
|
11
|
-
}
|
|
12
|
-
async function listEndpoints(apiKey) {
|
|
13
|
-
return (0, client_1.request)('GET', `${BASE_URL}/webhook/endpoints`, apiKey);
|
|
14
|
-
}
|
|
15
|
-
async function deleteEndpoint(apiKey, endpointId) {
|
|
16
|
-
return (0, client_1.request)('DELETE', `${BASE_URL}/webhook/endpoints/${encodeURIComponent(endpointId)}`, apiKey);
|
|
17
|
-
}
|
|
18
|
-
async function getDelivery(apiKey, deliveryId) {
|
|
19
|
-
return (0, client_1.request)('GET', `${BASE_URL}/webhook/deliveries/${encodeURIComponent(deliveryId)}`, apiKey);
|
|
20
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export type WorkflowStep = {
|
|
2
|
-
type: 'send_email';
|
|
3
|
-
from: string;
|
|
4
|
-
to: string;
|
|
5
|
-
subject: string;
|
|
6
|
-
template_id?: string;
|
|
7
|
-
html?: string;
|
|
8
|
-
} | {
|
|
9
|
-
type: 'slack_message';
|
|
10
|
-
webhook_url: string;
|
|
11
|
-
text: string;
|
|
12
|
-
};
|
|
13
|
-
export interface Workflow {
|
|
14
|
-
id: string;
|
|
15
|
-
org_id: string;
|
|
16
|
-
name: string;
|
|
17
|
-
status: 'enabled' | 'disabled';
|
|
18
|
-
trigger_config: {
|
|
19
|
-
endpoint_id: string;
|
|
20
|
-
};
|
|
21
|
-
steps: WorkflowStep[];
|
|
22
|
-
created_at: string;
|
|
23
|
-
}
|
|
24
|
-
export interface WorkflowRun {
|
|
25
|
-
id: string;
|
|
26
|
-
workflow_id: string;
|
|
27
|
-
trigger_payload: unknown;
|
|
28
|
-
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
29
|
-
error?: string;
|
|
30
|
-
attempt: number;
|
|
31
|
-
started_at: string;
|
|
32
|
-
finished_at?: string;
|
|
33
|
-
created_at: string;
|
|
34
|
-
}
|
|
35
|
-
export declare function createWorkflow(apiKey: string, payload: {
|
|
36
|
-
org_id: string;
|
|
37
|
-
name: string;
|
|
38
|
-
trigger_config: {
|
|
39
|
-
endpoint_id: string;
|
|
40
|
-
};
|
|
41
|
-
steps: WorkflowStep[];
|
|
42
|
-
}): Promise<Workflow>;
|
|
43
|
-
export declare function listWorkflows(apiKey: string): Promise<Workflow[]>;
|
|
44
|
-
export declare function getWorkflow(apiKey: string, workflowId: string): Promise<Workflow>;
|
|
45
|
-
export declare function updateWorkflow(apiKey: string, workflowId: string, payload: {
|
|
46
|
-
name?: string;
|
|
47
|
-
trigger_config?: {
|
|
48
|
-
endpoint_id: string;
|
|
49
|
-
};
|
|
50
|
-
steps?: WorkflowStep[];
|
|
51
|
-
}): Promise<Workflow>;
|
|
52
|
-
export declare function enableWorkflow(apiKey: string, workflowId: string): Promise<void>;
|
|
53
|
-
export declare function disableWorkflow(apiKey: string, workflowId: string): Promise<void>;
|
|
54
|
-
export declare function deleteWorkflow(apiKey: string, workflowId: string): Promise<void>;
|
|
55
|
-
export declare function listWorkflowRuns(apiKey: string, workflowId: string): Promise<WorkflowRun[]>;
|
|
56
|
-
export declare function getWorkflowRun(apiKey: string, runId: string): Promise<WorkflowRun>;
|
package/dist/sdk/src/workflow.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createWorkflow = createWorkflow;
|
|
4
|
-
exports.listWorkflows = listWorkflows;
|
|
5
|
-
exports.getWorkflow = getWorkflow;
|
|
6
|
-
exports.updateWorkflow = updateWorkflow;
|
|
7
|
-
exports.enableWorkflow = enableWorkflow;
|
|
8
|
-
exports.disableWorkflow = disableWorkflow;
|
|
9
|
-
exports.deleteWorkflow = deleteWorkflow;
|
|
10
|
-
exports.listWorkflowRuns = listWorkflowRuns;
|
|
11
|
-
exports.getWorkflowRun = getWorkflowRun;
|
|
12
|
-
const client_1 = require("./client");
|
|
13
|
-
const BASE_URL = 'https://api.myworkflowapi.com';
|
|
14
|
-
async function createWorkflow(apiKey, payload) {
|
|
15
|
-
return (0, client_1.request)('POST', `${BASE_URL}/workflow/workflows`, apiKey, payload);
|
|
16
|
-
}
|
|
17
|
-
async function listWorkflows(apiKey) {
|
|
18
|
-
return (0, client_1.request)('GET', `${BASE_URL}/workflow/workflows`, apiKey);
|
|
19
|
-
}
|
|
20
|
-
async function getWorkflow(apiKey, workflowId) {
|
|
21
|
-
return (0, client_1.request)('GET', `${BASE_URL}/workflow/workflows/${encodeURIComponent(workflowId)}`, apiKey);
|
|
22
|
-
}
|
|
23
|
-
async function updateWorkflow(apiKey, workflowId, payload) {
|
|
24
|
-
return (0, client_1.request)('PATCH', `${BASE_URL}/workflow/workflows/${encodeURIComponent(workflowId)}`, apiKey, payload);
|
|
25
|
-
}
|
|
26
|
-
async function enableWorkflow(apiKey, workflowId) {
|
|
27
|
-
return (0, client_1.request)('POST', `${BASE_URL}/workflow/workflows/${encodeURIComponent(workflowId)}/enable`, apiKey);
|
|
28
|
-
}
|
|
29
|
-
async function disableWorkflow(apiKey, workflowId) {
|
|
30
|
-
return (0, client_1.request)('POST', `${BASE_URL}/workflow/workflows/${encodeURIComponent(workflowId)}/disable`, apiKey);
|
|
31
|
-
}
|
|
32
|
-
async function deleteWorkflow(apiKey, workflowId) {
|
|
33
|
-
return (0, client_1.request)('DELETE', `${BASE_URL}/workflow/workflows/${encodeURIComponent(workflowId)}`, apiKey);
|
|
34
|
-
}
|
|
35
|
-
async function listWorkflowRuns(apiKey, workflowId) {
|
|
36
|
-
return (0, client_1.request)('GET', `${BASE_URL}/workflow/workflows/${encodeURIComponent(workflowId)}/runs`, apiKey);
|
|
37
|
-
}
|
|
38
|
-
async function getWorkflowRun(apiKey, runId) {
|
|
39
|
-
return (0, client_1.request)('GET', `${BASE_URL}/workflow/runs/${encodeURIComponent(runId)}`, apiKey);
|
|
40
|
-
}
|