@sellable/mcp 0.1.546 → 0.1.548
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/tools/sequencer.js
CHANGED
|
@@ -151,18 +151,7 @@ export async function attachSequence(input) {
|
|
|
151
151
|
// (`CampaignOffer.sequenceTemplate`). The workflow-tables endpoint
|
|
152
152
|
// writes to `WorkflowTable.config.sequenceTemplate`, which the UI
|
|
153
153
|
// doesn't read — hitting it on a campaign table is silently wrong.
|
|
154
|
-
|
|
155
|
-
try {
|
|
156
|
-
const tableMeta = await api.get(`/api/v3/workflow-tables/${input.tableId}?mode=meta`);
|
|
157
|
-
const rawCampaignId = tableMeta?.table?.config?.campaignOfferId;
|
|
158
|
-
if (typeof rawCampaignId === "string" && rawCampaignId.length > 0) {
|
|
159
|
-
campaignOfferId = rawCampaignId;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch {
|
|
163
|
-
// Fall back to workflow-tables path on meta-fetch failure —
|
|
164
|
-
// non-campaign tables won't have the field set anyway.
|
|
165
|
-
}
|
|
154
|
+
const campaignOfferId = await resolveCampaignOfferIdForTable(api, input.tableId);
|
|
166
155
|
const endpoint = campaignOfferId
|
|
167
156
|
? `/api/v3/campaigns/${campaignOfferId}/sequence`
|
|
168
157
|
: `/api/v3/workflow-tables/${input.tableId}/sequence`;
|
|
@@ -191,6 +180,32 @@ export async function attachSequence(input) {
|
|
|
191
180
|
throw error;
|
|
192
181
|
}
|
|
193
182
|
}
|
|
183
|
+
async function resolveCampaignOfferIdForTable(api, tableId) {
|
|
184
|
+
try {
|
|
185
|
+
const tableMeta = await api.get(`/api/v3/workflow-tables/${tableId}?mode=meta`);
|
|
186
|
+
const rawCampaignId = tableMeta?.table?.config?.campaignOfferId;
|
|
187
|
+
if (typeof rawCampaignId === "string" && rawCampaignId.length > 0) {
|
|
188
|
+
return rawCampaignId;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
// Continue to the inventory fallback below.
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
const tableInventory = await api.get("/api/v3/mcp/tables?limit=500");
|
|
196
|
+
const matchingTable = tableInventory?.tables?.find((table) => {
|
|
197
|
+
return table?.id === tableId;
|
|
198
|
+
});
|
|
199
|
+
const rawCampaignId = matchingTable?.campaignOfferId;
|
|
200
|
+
if (typeof rawCampaignId === "string" && rawCampaignId.length > 0) {
|
|
201
|
+
return rawCampaignId;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// Fall back to workflow-tables path on inventory failure.
|
|
206
|
+
}
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
194
209
|
export async function attachRecommendedSequence(input) {
|
|
195
210
|
const api = getApi();
|
|
196
211
|
try {
|
package/package.json
CHANGED
|
@@ -854,11 +854,11 @@ not a parent-thread summary. The receipt must include:
|
|
|
854
854
|
endpoint/tool to put the unlaunched campaign into `PAUSED` review state, then
|
|
855
855
|
reread the campaign/table. Do not raw-write `campaignStatus`, do not start or
|
|
856
856
|
launch, and do not schedule/send. Completion requires reread proof of
|
|
857
|
-
`currentStep:"send"` and `campaignStatus:"PAUSED"` for standard
|
|
858
|
-
customer-visible lanes.
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
857
|
+
`currentStep:"send"` and `campaignStatus:"PAUSED"` for standard and
|
|
858
|
+
connection-only customer-visible lanes. `send` is the product's paused
|
|
859
|
+
review step; do not use unsupported aliases such as `review` as final proof.
|
|
860
|
+
If the raw output nests this in `finalCampaignRead` or `finalTableRead`, copy
|
|
861
|
+
it to canonical
|
|
862
862
|
`finalPausedSendProof.currentStep` and
|
|
863
863
|
`finalPausedSendProof.campaignStatus`.
|
|
864
864
|
- `verifyCall`: the exact `setup_evergreen_campaigns({ mode:"verify",
|