gtm-now 0.10.9 → 0.10.10
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/index.js +50 -340
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -205,8 +205,7 @@ var init_config = __esm({
|
|
|
205
205
|
GTM_SMARTLEAD_API_KEY: "smartlead",
|
|
206
206
|
GTM_HARVEST_API_KEY: "harvest",
|
|
207
207
|
GTM_STORELEADS_API_KEY: "storeleads",
|
|
208
|
-
GTM_EXA_API_KEY: "exa"
|
|
209
|
-
GTM_LEADMAGIC_API_KEY: "leadmagic"
|
|
208
|
+
GTM_EXA_API_KEY: "exa"
|
|
210
209
|
};
|
|
211
210
|
ENV_WORKSPACE_MAP = {
|
|
212
211
|
GTM_PLUSVIBE_WORKSPACE_ID: "plusvibe"
|
|
@@ -8739,107 +8738,10 @@ var init_client25 = __esm({
|
|
|
8739
8738
|
});
|
|
8740
8739
|
|
|
8741
8740
|
// ../integrations/dist/leadmagic.js
|
|
8742
|
-
var LeadMagicClient;
|
|
8743
8741
|
var init_leadmagic2 = __esm({
|
|
8744
8742
|
"../integrations/dist/leadmagic.js"() {
|
|
8745
8743
|
"use strict";
|
|
8746
8744
|
init_base_client();
|
|
8747
|
-
LeadMagicClient = class extends BaseApiClient {
|
|
8748
|
-
constructor(config) {
|
|
8749
|
-
super({
|
|
8750
|
-
name: "LeadMagic",
|
|
8751
|
-
baseUrl: config.baseUrl ?? "https://api.leadmagic.io",
|
|
8752
|
-
headers: { "X-API-Key": config.apiKey },
|
|
8753
|
-
timeoutMs: config.timeoutMs
|
|
8754
|
-
});
|
|
8755
|
-
}
|
|
8756
|
-
// ─── People ──────────────────────────────────────────────────────────────────
|
|
8757
|
-
async findEmail(params) {
|
|
8758
|
-
return this.request("/v1/people/email-finder", {
|
|
8759
|
-
method: "POST",
|
|
8760
|
-
body: JSON.stringify(params)
|
|
8761
|
-
});
|
|
8762
|
-
}
|
|
8763
|
-
async validateEmail(params) {
|
|
8764
|
-
return this.request("/v1/people/email-validation", {
|
|
8765
|
-
method: "POST",
|
|
8766
|
-
body: JSON.stringify(params)
|
|
8767
|
-
});
|
|
8768
|
-
}
|
|
8769
|
-
async findMobile(params) {
|
|
8770
|
-
return this.request("/v1/people/mobile-finder", {
|
|
8771
|
-
method: "POST",
|
|
8772
|
-
body: JSON.stringify(params)
|
|
8773
|
-
});
|
|
8774
|
-
}
|
|
8775
|
-
async searchProfile(params) {
|
|
8776
|
-
return this.request("/v1/people/profile-search", {
|
|
8777
|
-
method: "POST",
|
|
8778
|
-
body: JSON.stringify(params)
|
|
8779
|
-
});
|
|
8780
|
-
}
|
|
8781
|
-
async findEmployees(params) {
|
|
8782
|
-
return this.request("/v1/people/employee-finder", {
|
|
8783
|
-
method: "POST",
|
|
8784
|
-
body: JSON.stringify(params)
|
|
8785
|
-
});
|
|
8786
|
-
}
|
|
8787
|
-
async findRole(params) {
|
|
8788
|
-
return this.request("/v1/people/role-finder", {
|
|
8789
|
-
method: "POST",
|
|
8790
|
-
body: JSON.stringify(params)
|
|
8791
|
-
});
|
|
8792
|
-
}
|
|
8793
|
-
async emailToProfile(params) {
|
|
8794
|
-
return this.request("/v1/people/b2b-profile", {
|
|
8795
|
-
method: "POST",
|
|
8796
|
-
body: JSON.stringify(params)
|
|
8797
|
-
});
|
|
8798
|
-
}
|
|
8799
|
-
async profileToEmail(params) {
|
|
8800
|
-
return this.request("/v1/people/b2b-profile-email", {
|
|
8801
|
-
method: "POST",
|
|
8802
|
-
body: JSON.stringify(params)
|
|
8803
|
-
});
|
|
8804
|
-
}
|
|
8805
|
-
async findPersonalEmail(params) {
|
|
8806
|
-
return this.request("/v1/people/personal-email-finder", {
|
|
8807
|
-
method: "POST",
|
|
8808
|
-
body: JSON.stringify(params)
|
|
8809
|
-
});
|
|
8810
|
-
}
|
|
8811
|
-
async detectJobChange(params) {
|
|
8812
|
-
return this.request("/v1/people/job-change-detector", {
|
|
8813
|
-
method: "POST",
|
|
8814
|
-
body: JSON.stringify(params)
|
|
8815
|
-
});
|
|
8816
|
-
}
|
|
8817
|
-
// ─── Companies ───────────────────────────────────────────────────────────────
|
|
8818
|
-
async searchCompany(params) {
|
|
8819
|
-
return this.request("/v1/companies/company-search", {
|
|
8820
|
-
method: "POST",
|
|
8821
|
-
body: JSON.stringify(params)
|
|
8822
|
-
});
|
|
8823
|
-
}
|
|
8824
|
-
async searchCompetitors(params) {
|
|
8825
|
-
return this.request("/v1/companies/competitors-search", {
|
|
8826
|
-
method: "POST",
|
|
8827
|
-
body: JSON.stringify(params)
|
|
8828
|
-
});
|
|
8829
|
-
}
|
|
8830
|
-
async getCompanyFunding(params) {
|
|
8831
|
-
return this.request("/v1/companies/company-funding", {
|
|
8832
|
-
method: "POST",
|
|
8833
|
-
body: JSON.stringify(params)
|
|
8834
|
-
});
|
|
8835
|
-
}
|
|
8836
|
-
async getTechnographics(params) {
|
|
8837
|
-
return this.request("/v1/companies/technographics", {
|
|
8838
|
-
method: "POST",
|
|
8839
|
-
body: JSON.stringify(params)
|
|
8840
|
-
});
|
|
8841
|
-
}
|
|
8842
|
-
};
|
|
8843
8745
|
}
|
|
8844
8746
|
});
|
|
8845
8747
|
|
|
@@ -10657,195 +10559,6 @@ var init_exa = __esm({
|
|
|
10657
10559
|
}
|
|
10658
10560
|
});
|
|
10659
10561
|
|
|
10660
|
-
// src/providers/adapters/leadmagic.ts
|
|
10661
|
-
function mapEmailQuality(status) {
|
|
10662
|
-
switch (status) {
|
|
10663
|
-
case "valid":
|
|
10664
|
-
return "95%";
|
|
10665
|
-
case "valid_catch_all":
|
|
10666
|
-
return "80%";
|
|
10667
|
-
case "catch_all":
|
|
10668
|
-
return "60%";
|
|
10669
|
-
default:
|
|
10670
|
-
return "50%";
|
|
10671
|
-
}
|
|
10672
|
-
}
|
|
10673
|
-
function mapVerificationStatus(status) {
|
|
10674
|
-
switch (status) {
|
|
10675
|
-
case "valid":
|
|
10676
|
-
return "deliverable";
|
|
10677
|
-
case "valid_catch_all":
|
|
10678
|
-
return "catch_all_safe";
|
|
10679
|
-
case "catch_all":
|
|
10680
|
-
return "catch_all_not_safe";
|
|
10681
|
-
case "invalid":
|
|
10682
|
-
return "undeliverable";
|
|
10683
|
-
default:
|
|
10684
|
-
return "unknown";
|
|
10685
|
-
}
|
|
10686
|
-
}
|
|
10687
|
-
var LeadMagicAdapter2;
|
|
10688
|
-
var init_leadmagic3 = __esm({
|
|
10689
|
-
"src/providers/adapters/leadmagic.ts"() {
|
|
10690
|
-
"use strict";
|
|
10691
|
-
init_dist();
|
|
10692
|
-
init_dist2();
|
|
10693
|
-
LeadMagicAdapter2 = class {
|
|
10694
|
-
name = "leadmagic";
|
|
10695
|
-
capabilities = [
|
|
10696
|
-
"enrich_email",
|
|
10697
|
-
"enrich_phone",
|
|
10698
|
-
"verify_email",
|
|
10699
|
-
"find_people"
|
|
10700
|
-
];
|
|
10701
|
-
notes = "Best for: email enrichment (name+domain), email validation (0.05 credits), mobile finder (needs LinkedIn URL, 5 credits), employee lists (0.05/employee). Also supports: profile search, company search, technographics, funding, competitors, job change detection. Pay-on-find pricing \u2014 free when no result.";
|
|
10702
|
-
client;
|
|
10703
|
-
constructor(apiKey) {
|
|
10704
|
-
this.client = new LeadMagicClient({ apiKey });
|
|
10705
|
-
}
|
|
10706
|
-
async checkCredentials() {
|
|
10707
|
-
try {
|
|
10708
|
-
await this.client.validateEmail({ email: "test@example.com" });
|
|
10709
|
-
return true;
|
|
10710
|
-
} catch (error) {
|
|
10711
|
-
logError(
|
|
10712
|
-
"leadmagic:checkCredentials",
|
|
10713
|
-
error instanceof Error ? error : new Error(String(error))
|
|
10714
|
-
);
|
|
10715
|
-
return false;
|
|
10716
|
-
}
|
|
10717
|
-
}
|
|
10718
|
-
async checkCredits() {
|
|
10719
|
-
return null;
|
|
10720
|
-
}
|
|
10721
|
-
// ─── EmailEnricher ──────────────────────────────────────
|
|
10722
|
-
async enrichEmail(contact) {
|
|
10723
|
-
try {
|
|
10724
|
-
if (contact.first_name && contact.last_name && (contact.company_domain || contact.company)) {
|
|
10725
|
-
const response = await this.client.findEmail({
|
|
10726
|
-
first_name: contact.first_name,
|
|
10727
|
-
last_name: contact.last_name,
|
|
10728
|
-
domain: contact.company_domain,
|
|
10729
|
-
company_name: !contact.company_domain ? contact.company : void 0
|
|
10730
|
-
});
|
|
10731
|
-
if (response.email && response.status !== "not_found") {
|
|
10732
|
-
return {
|
|
10733
|
-
email: response.email,
|
|
10734
|
-
quality: mapEmailQuality(response.status),
|
|
10735
|
-
provider: this.name,
|
|
10736
|
-
credits_consumed: response.credits_consumed
|
|
10737
|
-
};
|
|
10738
|
-
}
|
|
10739
|
-
}
|
|
10740
|
-
if (contact.linkedin_url) {
|
|
10741
|
-
const response = await this.client.profileToEmail({
|
|
10742
|
-
profile_url: contact.linkedin_url
|
|
10743
|
-
});
|
|
10744
|
-
if (response.email) {
|
|
10745
|
-
return {
|
|
10746
|
-
email: response.email,
|
|
10747
|
-
quality: "80%",
|
|
10748
|
-
// Profile-to-email doesn't return validation status
|
|
10749
|
-
provider: this.name,
|
|
10750
|
-
credits_consumed: response.credits_consumed
|
|
10751
|
-
};
|
|
10752
|
-
}
|
|
10753
|
-
}
|
|
10754
|
-
return null;
|
|
10755
|
-
} catch (error) {
|
|
10756
|
-
logError("leadmagic:enrichEmail", error instanceof Error ? error : new Error(String(error)));
|
|
10757
|
-
return null;
|
|
10758
|
-
}
|
|
10759
|
-
}
|
|
10760
|
-
// ─── PhoneEnricher ──────────────────────────────────────
|
|
10761
|
-
async enrichPhone(contact) {
|
|
10762
|
-
try {
|
|
10763
|
-
const response = await this.client.findMobile({
|
|
10764
|
-
profile_url: contact.linkedin_url,
|
|
10765
|
-
work_email: void 0,
|
|
10766
|
-
// Could pass email if available
|
|
10767
|
-
personal_email: void 0
|
|
10768
|
-
});
|
|
10769
|
-
if (!response.mobile_number) return null;
|
|
10770
|
-
return {
|
|
10771
|
-
phone: response.mobile_number,
|
|
10772
|
-
provider: this.name
|
|
10773
|
-
};
|
|
10774
|
-
} catch (error) {
|
|
10775
|
-
logError("leadmagic:enrichPhone", error instanceof Error ? error : new Error(String(error)));
|
|
10776
|
-
return null;
|
|
10777
|
-
}
|
|
10778
|
-
}
|
|
10779
|
-
// ─── EmailVerifier ──────────────────────────────────────
|
|
10780
|
-
async verifyEmail(email) {
|
|
10781
|
-
try {
|
|
10782
|
-
const response = await this.client.validateEmail({ email });
|
|
10783
|
-
return {
|
|
10784
|
-
email: response.email ?? email,
|
|
10785
|
-
valid: response.email_status === "valid" || response.email_status === "valid_catch_all",
|
|
10786
|
-
status: mapVerificationStatus(response.email_status),
|
|
10787
|
-
provider: this.name
|
|
10788
|
-
};
|
|
10789
|
-
} catch (error) {
|
|
10790
|
-
logError("leadmagic:verifyEmail", error instanceof Error ? error : new Error(String(error)));
|
|
10791
|
-
return {
|
|
10792
|
-
email,
|
|
10793
|
-
valid: false,
|
|
10794
|
-
status: "unknown",
|
|
10795
|
-
provider: this.name
|
|
10796
|
-
};
|
|
10797
|
-
}
|
|
10798
|
-
}
|
|
10799
|
-
// ─── PeopleFinder ───────────────────────────────────────
|
|
10800
|
-
async findPeople(query) {
|
|
10801
|
-
try {
|
|
10802
|
-
if (query.job_title && (query.company_domain || query.company_name)) {
|
|
10803
|
-
const response = await this.client.findRole({
|
|
10804
|
-
job_title: query.job_title,
|
|
10805
|
-
company_domain: query.company_domain,
|
|
10806
|
-
company_name: !query.company_domain ? query.company_name : void 0
|
|
10807
|
-
});
|
|
10808
|
-
if (response.first_name && response.last_name) {
|
|
10809
|
-
return [
|
|
10810
|
-
{
|
|
10811
|
-
first_name: response.first_name,
|
|
10812
|
-
last_name: response.last_name,
|
|
10813
|
-
job_title: response.job_title ?? void 0,
|
|
10814
|
-
company: response.company_name ?? void 0,
|
|
10815
|
-
company_domain: response.company_website ?? query.company_domain ?? void 0,
|
|
10816
|
-
linkedin_url: response.profile_url ?? void 0,
|
|
10817
|
-
sources: [this.name]
|
|
10818
|
-
}
|
|
10819
|
-
];
|
|
10820
|
-
}
|
|
10821
|
-
return [];
|
|
10822
|
-
}
|
|
10823
|
-
if (query.company_domain || query.company_name) {
|
|
10824
|
-
const response = await this.client.findEmployees({
|
|
10825
|
-
company_domain: query.company_domain,
|
|
10826
|
-
company_name: !query.company_domain ? query.company_name : void 0,
|
|
10827
|
-
limit: query.limit ?? 20
|
|
10828
|
-
});
|
|
10829
|
-
if (!response.data?.length) return [];
|
|
10830
|
-
return response.data.map((emp) => ({
|
|
10831
|
-
first_name: emp.first_name ?? "",
|
|
10832
|
-
last_name: emp.last_name ?? "",
|
|
10833
|
-
job_title: emp.title ?? void 0,
|
|
10834
|
-
company: emp.company_name ?? void 0,
|
|
10835
|
-
company_domain: emp.website ?? query.company_domain ?? void 0,
|
|
10836
|
-
sources: [this.name]
|
|
10837
|
-
}));
|
|
10838
|
-
}
|
|
10839
|
-
return [];
|
|
10840
|
-
} catch (error) {
|
|
10841
|
-
logError("leadmagic:findPeople", error instanceof Error ? error : new Error(String(error)));
|
|
10842
|
-
return [];
|
|
10843
|
-
}
|
|
10844
|
-
}
|
|
10845
|
-
};
|
|
10846
|
-
}
|
|
10847
|
-
});
|
|
10848
|
-
|
|
10849
10562
|
// src/providers/adapters/index.ts
|
|
10850
10563
|
var init_adapters = __esm({
|
|
10851
10564
|
"src/providers/adapters/index.ts"() {
|
|
@@ -10863,7 +10576,6 @@ var init_adapters = __esm({
|
|
|
10863
10576
|
init_storeleads();
|
|
10864
10577
|
init_harvest();
|
|
10865
10578
|
init_exa();
|
|
10866
|
-
init_leadmagic3();
|
|
10867
10579
|
}
|
|
10868
10580
|
});
|
|
10869
10581
|
|
|
@@ -10896,8 +10608,6 @@ function createAdapter(name, config) {
|
|
|
10896
10608
|
return config.api_key ? new HarvestApiAdapter(config.api_key) : null;
|
|
10897
10609
|
case "exa":
|
|
10898
10610
|
return config.api_key ? new ExaAdapter(config.api_key) : null;
|
|
10899
|
-
case "leadmagic":
|
|
10900
|
-
return config.api_key ? new LeadMagicAdapter2(config.api_key) : null;
|
|
10901
10611
|
default:
|
|
10902
10612
|
return null;
|
|
10903
10613
|
}
|
|
@@ -11831,13 +11541,19 @@ var init_review = __esm({
|
|
|
11831
11541
|
items: { type: "object" },
|
|
11832
11542
|
description: "Array of row objects (for create)"
|
|
11833
11543
|
},
|
|
11834
|
-
table_id: {
|
|
11544
|
+
table_id: {
|
|
11545
|
+
type: "string",
|
|
11546
|
+
description: "Table ID (for update, get_selected, or optional client-provided ID on create)"
|
|
11547
|
+
},
|
|
11835
11548
|
rows: {
|
|
11836
11549
|
type: "array",
|
|
11837
11550
|
items: { type: "object" },
|
|
11838
11551
|
description: "Updated row objects with _row_id (for update)"
|
|
11839
11552
|
},
|
|
11840
|
-
ttl_seconds: {
|
|
11553
|
+
ttl_seconds: {
|
|
11554
|
+
type: "number",
|
|
11555
|
+
description: "Optional TTL override in seconds (default: 24h). For create only."
|
|
11556
|
+
}
|
|
11841
11557
|
},
|
|
11842
11558
|
required: ["action"]
|
|
11843
11559
|
}
|
|
@@ -13857,7 +13573,9 @@ async function handleCrm(args, ctx) {
|
|
|
13857
13573
|
if (rows.length === 0) {
|
|
13858
13574
|
return {
|
|
13859
13575
|
created: 0,
|
|
13860
|
-
hints: [
|
|
13576
|
+
hints: [
|
|
13577
|
+
"No selected rows found in the review table. Select rows in the viewer and retry."
|
|
13578
|
+
]
|
|
13861
13579
|
};
|
|
13862
13580
|
}
|
|
13863
13581
|
const contacts = mapRowsToContacts(rows);
|
|
@@ -13887,7 +13605,10 @@ async function handleCrm(args, ctx) {
|
|
|
13887
13605
|
case "find_company": {
|
|
13888
13606
|
const query = args.query;
|
|
13889
13607
|
const name = args.name ?? query?.name;
|
|
13890
|
-
if (!name)
|
|
13608
|
+
if (!name)
|
|
13609
|
+
throw new Error(
|
|
13610
|
+
'name is required for find_company action (pass as name="X" or query={"name":"X"})'
|
|
13611
|
+
);
|
|
13891
13612
|
if (!manager.findCompany) throw new Error("Provider does not support company lookup");
|
|
13892
13613
|
return manager.findCompany(name);
|
|
13893
13614
|
}
|
|
@@ -14089,53 +13810,42 @@ __export(feedback_exports, {
|
|
|
14089
13810
|
handleFeedback: () => handleFeedback
|
|
14090
13811
|
});
|
|
14091
13812
|
async function handleFeedback(args) {
|
|
14092
|
-
const
|
|
14093
|
-
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
|
|
14102
|
-
|
|
14103
|
-
|
|
14104
|
-
const response = await fetch(`${SUPABASE_URL}/rest/v1/gtm_feedback`, {
|
|
14105
|
-
method: "POST",
|
|
14106
|
-
headers: {
|
|
14107
|
-
"Content-Type": "application/json",
|
|
14108
|
-
apikey: SUPABASE_KEY,
|
|
14109
|
-
Authorization: `Bearer ${SUPABASE_KEY}`,
|
|
14110
|
-
Prefer: "return=representation"
|
|
14111
|
-
},
|
|
14112
|
-
body: JSON.stringify(row)
|
|
14113
|
-
});
|
|
14114
|
-
if (!response.ok) {
|
|
14115
|
-
const body = await response.text().catch(() => "unknown");
|
|
14116
|
-
throw createGtmError(
|
|
14117
|
-
"PROVIDER_REQUEST_FAILED",
|
|
14118
|
-
`Failed to submit feedback: ${response.status}`,
|
|
14119
|
-
{
|
|
13813
|
+
const type = args.type;
|
|
13814
|
+
const message = args.message.trim();
|
|
13815
|
+
const context = args.context ?? {};
|
|
13816
|
+
try {
|
|
13817
|
+
const response = await fetch(`${VIEWER_URL2}/api/feedback`, {
|
|
13818
|
+
method: "POST",
|
|
13819
|
+
headers: { "Content-Type": "application/json" },
|
|
13820
|
+
body: JSON.stringify({ type, message, context })
|
|
13821
|
+
});
|
|
13822
|
+
if (!response.ok) {
|
|
13823
|
+
const body = await response.text().catch(() => "unknown");
|
|
13824
|
+
throw createGtmError("PROVIDER_REQUEST_FAILED", `Failed to submit feedback: ${response.status}`, {
|
|
14120
13825
|
details: { status: response.status, body }
|
|
14121
|
-
}
|
|
14122
|
-
|
|
13826
|
+
});
|
|
13827
|
+
}
|
|
13828
|
+
const data = await response.json();
|
|
13829
|
+
const created = data[0];
|
|
13830
|
+
return {
|
|
13831
|
+
submitted: true,
|
|
13832
|
+
id: created?.id,
|
|
13833
|
+
type,
|
|
13834
|
+
message: `Feedback submitted. Thank you! (ID: ${created?.id ?? "unknown"})`
|
|
13835
|
+
};
|
|
13836
|
+
} catch (error) {
|
|
13837
|
+
if (error && typeof error === "object" && "error_code" in error) throw error;
|
|
13838
|
+
logError("feedback:submit", error instanceof Error ? error : new Error(String(error)));
|
|
13839
|
+
throw createGtmError("PROVIDER_REQUEST_FAILED", "Failed to submit feedback. Please try again later.");
|
|
14123
13840
|
}
|
|
14124
|
-
const [created] = await response.json();
|
|
14125
|
-
return {
|
|
14126
|
-
submitted: true,
|
|
14127
|
-
id: created?.id,
|
|
14128
|
-
type: input.type,
|
|
14129
|
-
message: `Feedback submitted. Thank you! (ID: ${created?.id ?? "unknown"})`
|
|
14130
|
-
};
|
|
14131
13841
|
}
|
|
14132
|
-
var
|
|
13842
|
+
var VIEWER_URL2;
|
|
14133
13843
|
var init_feedback2 = __esm({
|
|
14134
13844
|
"src/handlers/feedback.ts"() {
|
|
14135
13845
|
"use strict";
|
|
13846
|
+
init_dist();
|
|
14136
13847
|
init_errors();
|
|
14137
|
-
|
|
14138
|
-
SUPABASE_KEY = process.env.GTM_SUPABASE_KEY ?? process.env.SUPABASE_SERVICE_ROLE_KEY ?? "";
|
|
13848
|
+
VIEWER_URL2 = process.env.GTM_VIEWER_URL ?? "https://gtm-viewer-production.up.railway.app";
|
|
14139
13849
|
}
|
|
14140
13850
|
});
|
|
14141
13851
|
|
|
@@ -14166,7 +13876,7 @@ async function createTable(args) {
|
|
|
14166
13876
|
...row,
|
|
14167
13877
|
_row_id: row._row_id ?? `r${i + 1}`
|
|
14168
13878
|
}));
|
|
14169
|
-
const response = await fetch(`${
|
|
13879
|
+
const response = await fetch(`${VIEWER_URL3}/api/tables`, {
|
|
14170
13880
|
method: "POST",
|
|
14171
13881
|
headers: { "Content-Type": "application/json" },
|
|
14172
13882
|
body: JSON.stringify({
|
|
@@ -14186,7 +13896,7 @@ async function createTable(args) {
|
|
|
14186
13896
|
async function updateTable(args) {
|
|
14187
13897
|
const tableId = args.table_id;
|
|
14188
13898
|
const rows = args.rows;
|
|
14189
|
-
const response = await fetch(`${
|
|
13899
|
+
const response = await fetch(`${VIEWER_URL3}/api/tables/${tableId}`, {
|
|
14190
13900
|
method: "PATCH",
|
|
14191
13901
|
headers: { "Content-Type": "application/json" },
|
|
14192
13902
|
body: JSON.stringify({ rows })
|
|
@@ -14199,18 +13909,18 @@ async function updateTable(args) {
|
|
|
14199
13909
|
}
|
|
14200
13910
|
async function getSelected(args) {
|
|
14201
13911
|
const tableId = args.table_id;
|
|
14202
|
-
const response = await fetch(`${
|
|
13912
|
+
const response = await fetch(`${VIEWER_URL3}/api/tables/${tableId}/selected`);
|
|
14203
13913
|
if (!response.ok) {
|
|
14204
13914
|
const body = await response.json().catch(() => ({}));
|
|
14205
13915
|
throw new Error(`Viewer API error ${response.status}: ${JSON.stringify(body)}`);
|
|
14206
13916
|
}
|
|
14207
13917
|
return response.json();
|
|
14208
13918
|
}
|
|
14209
|
-
var
|
|
13919
|
+
var VIEWER_URL3;
|
|
14210
13920
|
var init_review2 = __esm({
|
|
14211
13921
|
"src/handlers/review.ts"() {
|
|
14212
13922
|
"use strict";
|
|
14213
|
-
|
|
13923
|
+
VIEWER_URL3 = process.env.GTM_VIEWER_URL ?? "https://gtm-viewer-production.up.railway.app";
|
|
14214
13924
|
}
|
|
14215
13925
|
});
|
|
14216
13926
|
|