@secondlayer/cli 10.3.0 → 10.3.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/README.md
CHANGED
|
@@ -81,7 +81,8 @@ Reads emit JSON to stdout (`--json` accepted across all read commands); `-o/--ou
|
|
|
81
81
|
|
|
82
82
|
| Command | What it does |
|
|
83
83
|
|---|---|
|
|
84
|
-
| `sl subscriptions create <name> --runtime <inngest\|trigger\|cloudflare\|node> [--
|
|
84
|
+
| `sl subscriptions create <name> --subgraph <name> --table <name> [--runtime <inngest\|trigger\|cloudflare\|node>] [--url <url>]` | Subgraph subscription (optional local receiver scaffold) |
|
|
85
|
+
| `sl subscriptions create <name> --url <url> --trigger '<json>'` | Chain subscription (repeat `--trigger` or pass `--triggers-file`) |
|
|
85
86
|
| `sl subscriptions list` / `get <id\|name>` | List or show config + delivery state |
|
|
86
87
|
| `sl subscriptions update <id\|name> --url <url> [--filter key.gte=value]` | Patch URL, filter, format, retry, etc. |
|
|
87
88
|
| `sl subscriptions pause/resume <id\|name>` | Stop or restart delivery |
|
|
@@ -95,13 +96,11 @@ Read/action commands support `--json`. Destructive commands prompt unless
|
|
|
95
96
|
`-y` / `--yes`. Filters are schema-aware: unknown tables/columns, bad operators,
|
|
96
97
|
and non-scalar columns are rejected before the API call.
|
|
97
98
|
|
|
98
|
-
Subscriptions are
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`sl subscriptions` command (list/get/update/pause/resume/delete/doctor/test/
|
|
104
|
-
deliveries/...) operates on both kinds.
|
|
99
|
+
Subscriptions are **subgraph** (a table's rows) or **chain** (raw events, no
|
|
100
|
+
subgraph). `sl subscriptions create` with `--subgraph`/`--table` makes the
|
|
101
|
+
first. Pass `--trigger` or `--triggers-file` for the second. SDK, REST, and
|
|
102
|
+
MCP take the same `triggers` array. Every other `sl subscriptions` command
|
|
103
|
+
operates on both kinds.
|
|
105
104
|
|
|
106
105
|
### Other
|
|
107
106
|
|
package/dist/cli.js
CHANGED
|
@@ -29334,21 +29334,6 @@ var init_subgraph = __esm(() => {
|
|
|
29334
29334
|
};
|
|
29335
29335
|
});
|
|
29336
29336
|
|
|
29337
|
-
// src/utils/urls.ts
|
|
29338
|
-
function deriveBaseUrl(apiUrl) {
|
|
29339
|
-
const override = process.env.SL_DASHBOARD_URL?.trim();
|
|
29340
|
-
if (override)
|
|
29341
|
-
return override.replace(/\/$/, "");
|
|
29342
|
-
try {
|
|
29343
|
-
const url = new URL(apiUrl);
|
|
29344
|
-
url.hostname = url.hostname.replace(/^api\./, "");
|
|
29345
|
-
url.pathname = "/";
|
|
29346
|
-
return url.toString().replace(/\/$/, "");
|
|
29347
|
-
} catch {
|
|
29348
|
-
return apiUrl.replace(/\/$/, "");
|
|
29349
|
-
}
|
|
29350
|
-
}
|
|
29351
|
-
|
|
29352
29337
|
// src/commands/subgraph-test.ts
|
|
29353
29338
|
var exports_subgraph_test = {};
|
|
29354
29339
|
__export(exports_subgraph_test, {
|
|
@@ -30284,10 +30269,8 @@ Stopped watching.`);
|
|
|
30284
30269
|
const printDeployFooter = async () => {
|
|
30285
30270
|
try {
|
|
30286
30271
|
const { apiUrl } = await resolveAuth();
|
|
30287
|
-
const baseUrl = deriveBaseUrl(apiUrl);
|
|
30288
30272
|
const firstTable = Object.keys(effectiveDef.schema ?? {})[0];
|
|
30289
30273
|
const isPublic = result.visibility === "public";
|
|
30290
|
-
info(` Dashboard: ${baseUrl}/platform/subgraphs/${effectiveDef.name}`);
|
|
30291
30274
|
if (isPublic && firstTable) {
|
|
30292
30275
|
info(` Read: ${apiUrl}/v1/subgraphs/${effectiveDef.name}/${firstTable}`);
|
|
30293
30276
|
info(` Share: ${apiUrl}/v1/subgraphs/${effectiveDef.name} (public — no key needed)`);
|
|
@@ -34806,7 +34789,7 @@ init_esm();
|
|
|
34806
34789
|
// package.json
|
|
34807
34790
|
var package_default = {
|
|
34808
34791
|
name: "@secondlayer/cli",
|
|
34809
|
-
version: "10.3.
|
|
34792
|
+
version: "10.3.1",
|
|
34810
34793
|
repository: {
|
|
34811
34794
|
type: "git",
|
|
34812
34795
|
url: "git+https://github.com/ryanwaits/secondlayer.git",
|
|
@@ -34849,7 +34832,7 @@ var package_default = {
|
|
|
34849
34832
|
"@inquirer/prompts": "^8.2.0",
|
|
34850
34833
|
"@secondlayer/bundler": "^0.5.0",
|
|
34851
34834
|
"@secondlayer/scaffold": "^1.5.1",
|
|
34852
|
-
"@secondlayer/sdk": "^6.54.
|
|
34835
|
+
"@secondlayer/sdk": "^6.54.1",
|
|
34853
34836
|
"@secondlayer/shared": "^7.11.1",
|
|
34854
34837
|
"@secondlayer/stacks": "^3.3.1",
|
|
34855
34838
|
"@secondlayer/subgraphs": "^3.26.4",
|
|
@@ -35802,17 +35785,15 @@ async function createSubscription(name, opts) {
|
|
|
35802
35785
|
} catch (err) {
|
|
35803
35786
|
provisioningFailed = true;
|
|
35804
35787
|
warn(`Subscription provisioning failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
35805
|
-
info("Template copied, but the subscription was not created.
|
|
35788
|
+
info("Template copied, but the subscription was not created. Fix the API error, remove the template directory, and rerun.");
|
|
35806
35789
|
}
|
|
35807
35790
|
}
|
|
35808
|
-
let subscriptionId;
|
|
35809
35791
|
let subscriptionStatus;
|
|
35810
35792
|
if (sl) {
|
|
35811
35793
|
try {
|
|
35812
35794
|
const list = await sl.subscriptions.list();
|
|
35813
35795
|
const rows = list.data ?? [];
|
|
35814
35796
|
const created = rows.find((s2) => s2.name === name);
|
|
35815
|
-
subscriptionId = created?.id;
|
|
35816
35797
|
subscriptionStatus = created?.status;
|
|
35817
35798
|
} catch {}
|
|
35818
35799
|
}
|
|
@@ -35840,14 +35821,6 @@ SIGNING_SECRET=${signingSecret}
|
|
|
35840
35821
|
error("Subscription was not created.");
|
|
35841
35822
|
process.exit(1);
|
|
35842
35823
|
}
|
|
35843
|
-
let dashboardLine = "";
|
|
35844
|
-
try {
|
|
35845
|
-
const { apiUrl } = await resolveAuth();
|
|
35846
|
-
const base2 = deriveBaseUrl(apiUrl);
|
|
35847
|
-
dashboardLine = subscriptionId ? `Dashboard: ${base2}/platform/subgraphs/${subgraph}/subscriptions/${subscriptionId}
|
|
35848
|
-
` : `Dashboard: ${base2}/platform/subgraphs/${subgraph}/subscriptions
|
|
35849
|
-
`;
|
|
35850
|
-
} catch {}
|
|
35851
35824
|
const pausedLine = subscriptionStatus === "paused" ? `Subscription is paused. Resume:
|
|
35852
35825
|
sl subscriptions resume ${name}
|
|
35853
35826
|
` : "";
|
|
@@ -35856,7 +35829,7 @@ SIGNING_SECRET=${signingSecret}
|
|
|
35856
35829
|
bun install
|
|
35857
35830
|
bun run dev`;
|
|
35858
35831
|
success(`Done. Next:
|
|
35859
|
-
${
|
|
35832
|
+
${pausedLine}${runHint}`);
|
|
35860
35833
|
}
|
|
35861
35834
|
async function createChainSubscription(name, opts) {
|
|
35862
35835
|
for (const [flag, value] of [
|
|
@@ -35901,16 +35874,9 @@ async function createChainSubscription(name, opts) {
|
|
|
35901
35874
|
process.exit(1);
|
|
35902
35875
|
}
|
|
35903
35876
|
info(`Signing secret (store securely): ${signingSecret}`);
|
|
35904
|
-
let dashboardLine = "";
|
|
35905
|
-
try {
|
|
35906
|
-
const { apiUrl } = await resolveAuth();
|
|
35907
|
-
const base2 = deriveBaseUrl(apiUrl);
|
|
35908
|
-
dashboardLine = `Dashboard: ${base2}/platform/subscriptions/${subscriptionId}
|
|
35909
|
-
`;
|
|
35910
|
-
} catch {}
|
|
35911
35877
|
console.log();
|
|
35912
35878
|
success(`Done. Next:
|
|
35913
|
-
|
|
35879
|
+
View deliveries:
|
|
35914
35880
|
sl subscriptions get ${name}`);
|
|
35915
35881
|
}
|
|
35916
35882
|
async function getSubscriptionClient() {
|
|
@@ -39964,5 +39930,5 @@ registerAccountCommand(program);
|
|
|
39964
39930
|
registerKeysCommand(program);
|
|
39965
39931
|
program.parse();
|
|
39966
39932
|
|
|
39967
|
-
//# debugId=
|
|
39933
|
+
//# debugId=71DA8EB190B9ACCF64756E2164756E21
|
|
39968
39934
|
//# sourceMappingURL=cli.js.map
|