@antasphere/slideless 0.13.8 → 0.13.9
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/bin.js +1001 -315
- package/package.json +4 -4
package/dist/bin.js
CHANGED
|
@@ -3547,7 +3547,7 @@ function migrateLegacyConfig(env, spec) {
|
|
|
3547
3547
|
return { migrated: true, from, to };
|
|
3548
3548
|
}
|
|
3549
3549
|
|
|
3550
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
3550
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/config.js
|
|
3551
3551
|
function createConfig(identity) {
|
|
3552
3552
|
const TOOL = identity.tool;
|
|
3553
3553
|
const LEGACY = { tool: TOOL, legacyDir: identity.legacyConfigDir };
|
|
@@ -3573,7 +3573,7 @@ function createConfig(identity) {
|
|
|
3573
3573
|
return { configPath: configPath3, loadConfig: loadConfig4, saveConfig: saveConfig4, clearConfig: clearConfig3, removeConnectKey: removeConnectKey3 };
|
|
3574
3574
|
}
|
|
3575
3575
|
|
|
3576
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-sdk@1.
|
|
3576
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-sdk@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-sdk/dist/index.js
|
|
3577
3577
|
var PlatformApiError = class extends Error {
|
|
3578
3578
|
status;
|
|
3579
3579
|
code;
|
|
@@ -3805,16 +3805,16 @@ var ChassisClient = class {
|
|
|
3805
3805
|
members(params = {}) {
|
|
3806
3806
|
return this.request("GET", this.pathWithQuery("/members", params));
|
|
3807
3807
|
}
|
|
3808
|
-
updateMember(
|
|
3809
|
-
return this.request("PATCH", `/members/${encodeURIComponent(
|
|
3808
|
+
updateMember(id2, patch) {
|
|
3809
|
+
return this.request("PATCH", `/members/${encodeURIComponent(id2)}`, patch);
|
|
3810
3810
|
}
|
|
3811
3811
|
/**
|
|
3812
3812
|
* Admin: delete a member's account (GDPR erasure). Sessions only — the
|
|
3813
3813
|
* endpoint is unlisted in the machine scope allowlist, so API keys 403.
|
|
3814
3814
|
* Files the member uploaded stay with the workspace.
|
|
3815
3815
|
*/
|
|
3816
|
-
deleteMember(
|
|
3817
|
-
return this.request("DELETE", `/members/${encodeURIComponent(
|
|
3816
|
+
deleteMember(id2) {
|
|
3817
|
+
return this.request("DELETE", `/members/${encodeURIComponent(id2)}`);
|
|
3818
3818
|
}
|
|
3819
3819
|
/**
|
|
3820
3820
|
* Remove a member from the workspace (admin+, sessions only): the
|
|
@@ -3822,16 +3822,16 @@ var ChassisClient = class {
|
|
|
3822
3822
|
* deleted; the account stays. Invited back, the person starts with none.
|
|
3823
3823
|
* Refused `hub_managed` on a hub-origin workspace (removal is the hub's).
|
|
3824
3824
|
*/
|
|
3825
|
-
removeMember(
|
|
3826
|
-
return this.request("POST", `/members/${encodeURIComponent(
|
|
3825
|
+
removeMember(id2) {
|
|
3826
|
+
return this.request("POST", `/members/${encodeURIComponent(id2)}/remove`);
|
|
3827
3827
|
}
|
|
3828
3828
|
/**
|
|
3829
3829
|
* Owner: mint a one-time password reset link for a member (SMTP-free
|
|
3830
3830
|
* recovery). Refused for a per-resource guest and for anyone who also belongs
|
|
3831
3831
|
* to another workspace — the minted credential is global (PRDCT-1354).
|
|
3832
3832
|
*/
|
|
3833
|
-
createMemberResetLink(
|
|
3834
|
-
return this.request("POST", `/members/${encodeURIComponent(
|
|
3833
|
+
createMemberResetLink(id2, opts = {}) {
|
|
3834
|
+
return this.request("POST", `/members/${encodeURIComponent(id2)}/reset-link`, void 0, idempotencyHeader(opts));
|
|
3835
3835
|
}
|
|
3836
3836
|
/**
|
|
3837
3837
|
* Owner: mint a one-time email change link for a member (SMTP-free email
|
|
@@ -3839,8 +3839,8 @@ var ChassisClient = class {
|
|
|
3839
3839
|
* it with the target member only. Same refusals as the reset link (guest
|
|
3840
3840
|
* targets, cross-workspace targets), plus the cloud edition closure.
|
|
3841
3841
|
*/
|
|
3842
|
-
createMemberChangeEmailLink(
|
|
3843
|
-
return this.request("POST", `/members/${encodeURIComponent(
|
|
3842
|
+
createMemberChangeEmailLink(id2, req, opts = {}) {
|
|
3843
|
+
return this.request("POST", `/members/${encodeURIComponent(id2)}/change-email-link`, req, idempotencyHeader(opts));
|
|
3844
3844
|
}
|
|
3845
3845
|
// ── Projects ──────────────────────────────────────────────────────────────
|
|
3846
3846
|
// A project is a subgroup of the workspace with its own members and three
|
|
@@ -3855,35 +3855,35 @@ var ChassisClient = class {
|
|
|
3855
3855
|
createProject(req, opts = {}) {
|
|
3856
3856
|
return this.request("POST", "/projects", req, idempotencyHeader(opts));
|
|
3857
3857
|
}
|
|
3858
|
-
project(
|
|
3859
|
-
return this.request("GET", `/projects/${encodeURIComponent(
|
|
3858
|
+
project(id2) {
|
|
3859
|
+
return this.request("GET", `/projects/${encodeURIComponent(id2)}`);
|
|
3860
3860
|
}
|
|
3861
|
-
updateProject(
|
|
3862
|
-
return this.request("PATCH", `/projects/${encodeURIComponent(
|
|
3861
|
+
updateProject(id2, patch) {
|
|
3862
|
+
return this.request("PATCH", `/projects/${encodeURIComponent(id2)}`, patch);
|
|
3863
3863
|
}
|
|
3864
|
-
archiveProject(
|
|
3865
|
-
return this.request("POST", `/projects/${encodeURIComponent(
|
|
3864
|
+
archiveProject(id2) {
|
|
3865
|
+
return this.request("POST", `/projects/${encodeURIComponent(id2)}/archive`);
|
|
3866
3866
|
}
|
|
3867
|
-
unarchiveProject(
|
|
3868
|
-
return this.request("POST", `/projects/${encodeURIComponent(
|
|
3867
|
+
unarchiveProject(id2) {
|
|
3868
|
+
return this.request("POST", `/projects/${encodeURIComponent(id2)}/unarchive`);
|
|
3869
3869
|
}
|
|
3870
|
-
projectMembers(
|
|
3871
|
-
return this.request("GET", this.pathWithQuery(`/projects/${encodeURIComponent(
|
|
3870
|
+
projectMembers(id2, params = {}) {
|
|
3871
|
+
return this.request("GET", this.pathWithQuery(`/projects/${encodeURIComponent(id2)}/members`, params));
|
|
3872
3872
|
}
|
|
3873
3873
|
/**
|
|
3874
3874
|
* Adds one of the workspace's own active members, by user id or by email,
|
|
3875
3875
|
* or one of its teams by `teamId`: exactly one of the three. A team entry
|
|
3876
3876
|
* gives every member of the team the role.
|
|
3877
3877
|
*/
|
|
3878
|
-
addProjectMember(
|
|
3879
|
-
return this.request("POST", `/projects/${encodeURIComponent(
|
|
3878
|
+
addProjectMember(id2, req, opts = {}) {
|
|
3879
|
+
return this.request("POST", `/projects/${encodeURIComponent(id2)}/members`, req, idempotencyHeader(opts));
|
|
3880
3880
|
}
|
|
3881
|
-
setProjectMemberRole(
|
|
3882
|
-
return this.request("PATCH", `/projects/${encodeURIComponent(
|
|
3881
|
+
setProjectMemberRole(id2, userId, role) {
|
|
3882
|
+
return this.request("PATCH", `/projects/${encodeURIComponent(id2)}/members/${encodeURIComponent(userId)}`, { role });
|
|
3883
3883
|
}
|
|
3884
3884
|
/** A manager removes anyone; any member removes themselves. */
|
|
3885
|
-
removeProjectMember(
|
|
3886
|
-
return this.request("DELETE", `/projects/${encodeURIComponent(
|
|
3885
|
+
removeProjectMember(id2, userId) {
|
|
3886
|
+
return this.request("DELETE", `/projects/${encodeURIComponent(id2)}/members/${encodeURIComponent(userId)}`);
|
|
3887
3887
|
}
|
|
3888
3888
|
/** Changes the role a team holds on a project (manager). */
|
|
3889
3889
|
setProjectTeamRole(projectId, teamId, role) {
|
|
@@ -3902,30 +3902,79 @@ var ChassisClient = class {
|
|
|
3902
3902
|
teams(params = {}) {
|
|
3903
3903
|
return this.request("GET", this.pathWithQuery("/teams", params));
|
|
3904
3904
|
}
|
|
3905
|
-
team(
|
|
3906
|
-
return this.request("GET", `/teams/${encodeURIComponent(
|
|
3905
|
+
team(id2) {
|
|
3906
|
+
return this.request("GET", `/teams/${encodeURIComponent(id2)}`);
|
|
3907
3907
|
}
|
|
3908
3908
|
/** Owner or admin. The slug is derived from the name when absent. */
|
|
3909
3909
|
createTeam(req, opts = {}) {
|
|
3910
3910
|
return this.request("POST", "/teams", req, idempotencyHeader(opts));
|
|
3911
3911
|
}
|
|
3912
|
-
updateTeam(
|
|
3913
|
-
return this.request("PATCH", `/teams/${encodeURIComponent(
|
|
3912
|
+
updateTeam(id2, patch) {
|
|
3913
|
+
return this.request("PATCH", `/teams/${encodeURIComponent(id2)}`, patch);
|
|
3914
3914
|
}
|
|
3915
3915
|
/** The memberships stay; answers the team's final snapshot. */
|
|
3916
|
-
deleteTeam(
|
|
3917
|
-
return this.request("DELETE", `/teams/${encodeURIComponent(
|
|
3916
|
+
deleteTeam(id2) {
|
|
3917
|
+
return this.request("DELETE", `/teams/${encodeURIComponent(id2)}`);
|
|
3918
3918
|
}
|
|
3919
|
-
teamMembers(
|
|
3920
|
-
return this.request("GET", this.pathWithQuery(`/teams/${encodeURIComponent(
|
|
3919
|
+
teamMembers(id2, params = {}) {
|
|
3920
|
+
return this.request("GET", this.pathWithQuery(`/teams/${encodeURIComponent(id2)}/members`, params));
|
|
3921
3921
|
}
|
|
3922
3922
|
/** Seats one of the workspace's own active members, by user id or by email. */
|
|
3923
|
-
addTeamMember(
|
|
3924
|
-
return this.request("POST", `/teams/${encodeURIComponent(
|
|
3923
|
+
addTeamMember(id2, req, opts = {}) {
|
|
3924
|
+
return this.request("POST", `/teams/${encodeURIComponent(id2)}/members`, req, idempotencyHeader(opts));
|
|
3925
3925
|
}
|
|
3926
3926
|
/** Unseats a member; the workspace membership stays. */
|
|
3927
|
-
removeTeamMember(
|
|
3928
|
-
return this.request("DELETE", `/teams/${encodeURIComponent(
|
|
3927
|
+
removeTeamMember(id2, userId) {
|
|
3928
|
+
return this.request("DELETE", `/teams/${encodeURIComponent(id2)}/members/${encodeURIComponent(userId)}`);
|
|
3929
|
+
}
|
|
3930
|
+
// ── Webhooks ──────────────────────────────────────────────────────────────
|
|
3931
|
+
// URLs the workspace registers to be told, by a signed POST, when one of the
|
|
3932
|
+
// tool's events happens. Owners and admins manage them (a guest gets 403
|
|
3933
|
+
// `guest_forbidden`, a member 403 `forbidden`); every non-guest member reads
|
|
3934
|
+
// the catalog. A machine credential needs the tool's webhooks scope (the
|
|
3935
|
+
// catalog: its read scope). The signing secret is in two answers only, the
|
|
3936
|
+
// create and the rotation, and never again.
|
|
3937
|
+
/** The workspace's endpoints, newest first. */
|
|
3938
|
+
webhooks(params = {}) {
|
|
3939
|
+
return this.request("GET", this.pathWithQuery("/webhooks", params));
|
|
3940
|
+
}
|
|
3941
|
+
/** The event catalog: every event type, its subjects and the JSON Schema of its data. */
|
|
3942
|
+
webhookEvents() {
|
|
3943
|
+
return this.request("GET", "/webhooks/events");
|
|
3944
|
+
}
|
|
3945
|
+
/** Owner or admin. The answer carries the signing secret (`whsec_…`), shown once. */
|
|
3946
|
+
createWebhook(req, opts = {}) {
|
|
3947
|
+
return this.request("POST", "/webhooks", req, idempotencyHeader(opts));
|
|
3948
|
+
}
|
|
3949
|
+
webhook(id2) {
|
|
3950
|
+
return this.request("GET", `/webhooks/${encodeURIComponent(id2)}`);
|
|
3951
|
+
}
|
|
3952
|
+
/** Only the fields named change; at least one is required. */
|
|
3953
|
+
updateWebhook(id2, req) {
|
|
3954
|
+
return this.request("PATCH", `/webhooks/${encodeURIComponent(id2)}`, req);
|
|
3955
|
+
}
|
|
3956
|
+
/** Deletes the endpoint and its delivery history; answers its final snapshot. */
|
|
3957
|
+
deleteWebhook(id2) {
|
|
3958
|
+
return this.request("DELETE", `/webhooks/${encodeURIComponent(id2)}`);
|
|
3959
|
+
}
|
|
3960
|
+
/** A new signing secret, shown once; the previous one signs until `previousSecretExpiresAt`. */
|
|
3961
|
+
rotateWebhookSecret(id2) {
|
|
3962
|
+
return this.request("POST", `/webhooks/${encodeURIComponent(id2)}/rotate-secret`);
|
|
3963
|
+
}
|
|
3964
|
+
/** Sends a signed `webhook.ping` now; the outcome is on the answered delivery. */
|
|
3965
|
+
testWebhook(id2) {
|
|
3966
|
+
return this.request("POST", `/webhooks/${encodeURIComponent(id2)}/test`);
|
|
3967
|
+
}
|
|
3968
|
+
/** An endpoint's deliveries, newest first, optionally by status. */
|
|
3969
|
+
webhookDeliveries(id2, params = {}) {
|
|
3970
|
+
return this.request("GET", this.pathWithQuery(`/webhooks/${encodeURIComponent(id2)}/deliveries`, params, { status: params.status }));
|
|
3971
|
+
}
|
|
3972
|
+
webhookDelivery(id2, deliveryId) {
|
|
3973
|
+
return this.request("GET", `/webhooks/${encodeURIComponent(id2)}/deliveries/${encodeURIComponent(deliveryId)}`);
|
|
3974
|
+
}
|
|
3975
|
+
/** Queues the same event again (same `eventId`, same payload) as a new delivery. */
|
|
3976
|
+
redeliverWebhook(id2, deliveryId) {
|
|
3977
|
+
return this.request("POST", `/webhooks/${encodeURIComponent(id2)}/deliveries/${encodeURIComponent(deliveryId)}/redeliver`);
|
|
3929
3978
|
}
|
|
3930
3979
|
// ── Demo passes ───────────────────────────────────────────────────────────
|
|
3931
3980
|
// A link that signs one member in without a password, for a demonstration.
|
|
@@ -3949,8 +3998,8 @@ var ChassisClient = class {
|
|
|
3949
3998
|
return this.request("POST", "/demo/passes", req);
|
|
3950
3999
|
}
|
|
3951
4000
|
/** Owner: revoke a pass; revoking a revoked pass answers it again. */
|
|
3952
|
-
revokeDemoPass(
|
|
3953
|
-
return this.request("DELETE", `/demo/passes/${encodeURIComponent(
|
|
4001
|
+
revokeDemoPass(id2) {
|
|
4002
|
+
return this.request("DELETE", `/demo/passes/${encodeURIComponent(id2)}`);
|
|
3954
4003
|
}
|
|
3955
4004
|
/**
|
|
3956
4005
|
* Anyone holding a pass's secret: sign in as its person. Served by the
|
|
@@ -3985,8 +4034,8 @@ var ChassisClient = class {
|
|
|
3985
4034
|
createApiKey(req, opts = {}) {
|
|
3986
4035
|
return this.request("POST", "/api-keys", req, idempotencyHeader(opts));
|
|
3987
4036
|
}
|
|
3988
|
-
revokeApiKey(
|
|
3989
|
-
return this.request("DELETE", `/api-keys/${encodeURIComponent(
|
|
4037
|
+
revokeApiKey(id2) {
|
|
4038
|
+
return this.request("DELETE", `/api-keys/${encodeURIComponent(id2)}`);
|
|
3990
4039
|
}
|
|
3991
4040
|
// ── Invitations ───────────────────────────────────────────────────────────
|
|
3992
4041
|
invitations(params = {}) {
|
|
@@ -3996,8 +4045,8 @@ var ChassisClient = class {
|
|
|
3996
4045
|
createInvitation(req, opts = {}) {
|
|
3997
4046
|
return this.request("POST", "/invitations", req, idempotencyHeader(opts));
|
|
3998
4047
|
}
|
|
3999
|
-
revokeInvitation(
|
|
4000
|
-
return this.request("DELETE", `/invitations/${encodeURIComponent(
|
|
4048
|
+
revokeInvitation(id2) {
|
|
4049
|
+
return this.request("DELETE", `/invitations/${encodeURIComponent(id2)}`);
|
|
4001
4050
|
}
|
|
4002
4051
|
/** Public: resolves an invitation token for the acceptance page. */
|
|
4003
4052
|
lookupInvitation(token) {
|
|
@@ -4050,15 +4099,15 @@ var ChassisClient = class {
|
|
|
4050
4099
|
});
|
|
4051
4100
|
return this.parse(res);
|
|
4052
4101
|
}
|
|
4053
|
-
deleteFile(
|
|
4054
|
-
return this.request("DELETE", `/files/${encodeURIComponent(
|
|
4102
|
+
deleteFile(id2) {
|
|
4103
|
+
return this.request("DELETE", `/files/${encodeURIComponent(id2)}`);
|
|
4055
4104
|
}
|
|
4056
|
-
file(
|
|
4057
|
-
return this.request("GET", `/files/${encodeURIComponent(
|
|
4105
|
+
file(id2) {
|
|
4106
|
+
return this.request("GET", `/files/${encodeURIComponent(id2)}`);
|
|
4058
4107
|
}
|
|
4059
4108
|
/** URL of the streamed (Range-capable) content endpoint for a file. */
|
|
4060
|
-
fileContentUrl(
|
|
4061
|
-
return `${this.baseUrl}/api/v1/files/${encodeURIComponent(
|
|
4109
|
+
fileContentUrl(id2) {
|
|
4110
|
+
return `${this.baseUrl}/api/v1/files/${encodeURIComponent(id2)}/content`;
|
|
4062
4111
|
}
|
|
4063
4112
|
/**
|
|
4064
4113
|
* Downloads a file's bytes with the client's own headers (credential and
|
|
@@ -4066,8 +4115,8 @@ var ChassisClient = class {
|
|
|
4066
4115
|
* answer throws PlatformApiError like every other method. A browser anchor
|
|
4067
4116
|
* on `fileContentUrl` cannot carry `X-Workspace-Id` (PRDCT-2426).
|
|
4068
4117
|
*/
|
|
4069
|
-
async downloadFileContent(
|
|
4070
|
-
return this.rawDownload(this.fileContentUrl(
|
|
4118
|
+
async downloadFileContent(id2) {
|
|
4119
|
+
return this.rawDownload(this.fileContentUrl(id2));
|
|
4071
4120
|
}
|
|
4072
4121
|
/** The shared body of the streamed-download methods (the asset download's shape). */
|
|
4073
4122
|
async rawDownload(url2) {
|
|
@@ -4112,7 +4161,7 @@ var ChassisClient = class {
|
|
|
4112
4161
|
}
|
|
4113
4162
|
};
|
|
4114
4163
|
|
|
4115
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4164
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/identity.js
|
|
4116
4165
|
var DEFAULT_HUB_URL = "https://account.antasphere.com";
|
|
4117
4166
|
function cliIdentity(identity) {
|
|
4118
4167
|
return {
|
|
@@ -4123,18 +4172,19 @@ function cliIdentity(identity) {
|
|
|
4123
4172
|
envPrefix: identity.cli.envPrefix,
|
|
4124
4173
|
keyPrefix: identity.apiKeyPrefix,
|
|
4125
4174
|
exportScope: identity.scopes.dataExport,
|
|
4175
|
+
webhooksScope: identity.scopes.webhooks,
|
|
4126
4176
|
cloudUrl: identity.cloud.url
|
|
4127
4177
|
};
|
|
4128
4178
|
}
|
|
4129
4179
|
|
|
4130
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4180
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/workspace.js
|
|
4131
4181
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4132
4182
|
function isWorkspaceId(value) {
|
|
4133
4183
|
return UUID_RE.test(value);
|
|
4134
4184
|
}
|
|
4135
4185
|
function orgIdOf(w) {
|
|
4136
|
-
const
|
|
4137
|
-
return typeof
|
|
4186
|
+
const id2 = w.centralAccountId;
|
|
4187
|
+
return typeof id2 === "string" && id2 ? id2 : null;
|
|
4138
4188
|
}
|
|
4139
4189
|
function workspaceLines(workspaces) {
|
|
4140
4190
|
if (workspaces.length === 0)
|
|
@@ -4234,7 +4284,7 @@ ${workspaceLines(me.workspaces)}`;
|
|
|
4234
4284
|
};
|
|
4235
4285
|
}
|
|
4236
4286
|
|
|
4237
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4287
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/context.js
|
|
4238
4288
|
var CliApiRefusal = class extends CliUsageError {
|
|
4239
4289
|
status;
|
|
4240
4290
|
constructor(message, status) {
|
|
@@ -4399,9 +4449,9 @@ function createContext(input) {
|
|
|
4399
4449
|
const selection = ctx.workspaceSelection;
|
|
4400
4450
|
if (!selection || ctx.workspaceId !== void 0)
|
|
4401
4451
|
return;
|
|
4402
|
-
const
|
|
4403
|
-
ctx.client.setWorkspace(
|
|
4404
|
-
ctx.workspaceId =
|
|
4452
|
+
const id2 = isWorkspaceId(selection.value) ? selection.value : matchWorkspace((await ctx.client.me()).workspaces, selection.value).id;
|
|
4453
|
+
ctx.client.setWorkspace(id2);
|
|
4454
|
+
ctx.workspaceId = id2;
|
|
4405
4455
|
appliedContexts.set(ctx.io, ctx);
|
|
4406
4456
|
}
|
|
4407
4457
|
function workspaceSource(ctx) {
|
|
@@ -4550,7 +4600,7 @@ var {
|
|
|
4550
4600
|
Help
|
|
4551
4601
|
} = import_index.default;
|
|
4552
4602
|
|
|
4553
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4603
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/stdin.js
|
|
4554
4604
|
var claims = /* @__PURE__ */ new WeakMap();
|
|
4555
4605
|
async function readAllStdin() {
|
|
4556
4606
|
const chunks = [];
|
|
@@ -4571,7 +4621,7 @@ async function readSecretFromStdin(io, claimant) {
|
|
|
4571
4621
|
return value;
|
|
4572
4622
|
}
|
|
4573
4623
|
|
|
4574
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4624
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/auth.js
|
|
4575
4625
|
var HUB_URL_ENV2 = "ANTASPHERE_URL";
|
|
4576
4626
|
function describeCredential(source, profileName) {
|
|
4577
4627
|
switch (source) {
|
|
@@ -5028,7 +5078,7 @@ ${organizationsLine(me)}`);
|
|
|
5028
5078
|
});
|
|
5029
5079
|
}
|
|
5030
5080
|
|
|
5031
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
5081
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/workspaces.js
|
|
5032
5082
|
function registerWorkspaceCommands(kit, program2, io) {
|
|
5033
5083
|
const { requireApiKey: requireApiKey2, resolveContext: resolveContext2, workspaceSource } = kit;
|
|
5034
5084
|
const { describeSelection } = kit.workspace;
|
|
@@ -5100,7 +5150,7 @@ function registerWorkspaceCommands(kit, program2, io) {
|
|
|
5100
5150
|
});
|
|
5101
5151
|
}
|
|
5102
5152
|
|
|
5103
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
5153
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/teams.js
|
|
5104
5154
|
function explainTeamRefusal(e, ctx) {
|
|
5105
5155
|
switch (e.code) {
|
|
5106
5156
|
case "forbidden":
|
|
@@ -5304,7 +5354,7 @@ ${teamLines(team)}`);
|
|
|
5304
5354
|
});
|
|
5305
5355
|
}
|
|
5306
5356
|
|
|
5307
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
5357
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/projects.js
|
|
5308
5358
|
var ROLES = ["viewer", "editor", "manager"];
|
|
5309
5359
|
function parseRole(value) {
|
|
5310
5360
|
if (ROLES.includes(value))
|
|
@@ -5427,10 +5477,10 @@ function registerProjectCommands(kit, program2, io) {
|
|
|
5427
5477
|
`);
|
|
5428
5478
|
}
|
|
5429
5479
|
});
|
|
5430
|
-
projects.command("get <id>").description("Show one project, with your own role on it").action(async (
|
|
5480
|
+
projects.command("get <id>").description("Show one project, with your own role on it").action(async (id2, _opts, cmd) => {
|
|
5431
5481
|
const ctx = resolveContext2(cmd, io);
|
|
5432
5482
|
await requireApiKey2(ctx);
|
|
5433
|
-
const project = await explained("project", () => ctx.client.project(
|
|
5483
|
+
const project = await explained("project", () => ctx.client.project(id2));
|
|
5434
5484
|
if (ctx.json)
|
|
5435
5485
|
return printJson2(io, project);
|
|
5436
5486
|
io.out.write(projectLines(project));
|
|
@@ -5449,7 +5499,7 @@ function registerProjectCommands(kit, program2, io) {
|
|
|
5449
5499
|
io.out.write(`Created project "${project.name}".
|
|
5450
5500
|
${projectLines(project)}`);
|
|
5451
5501
|
});
|
|
5452
|
-
projects.command("update <id>").description("Change a project's name, description or metadata (manager)").option("--name <name>", "rename the project").option("--description <text>", "replace the description").option("--clear-description", "remove the description", false).option("--metadata <json>", "replace the whole metadata object (a JSON object)").action(async (
|
|
5502
|
+
projects.command("update <id>").description("Change a project's name, description or metadata (manager)").option("--name <name>", "rename the project").option("--description <text>", "replace the description").option("--clear-description", "remove the description", false).option("--metadata <json>", "replace the whole metadata object (a JSON object)").action(async (id2, opts, cmd) => {
|
|
5453
5503
|
if (opts.description !== void 0 && opts.clearDescription) {
|
|
5454
5504
|
throw new CliUsageError("Pass either --description <text> or --clear-description, not both.");
|
|
5455
5505
|
}
|
|
@@ -5463,25 +5513,25 @@ ${projectLines(project)}`);
|
|
|
5463
5513
|
}
|
|
5464
5514
|
const ctx = resolveContext2(cmd, io);
|
|
5465
5515
|
await requireApiKey2(ctx);
|
|
5466
|
-
const project = await explained("project", () => ctx.client.updateProject(
|
|
5516
|
+
const project = await explained("project", () => ctx.client.updateProject(id2, patch));
|
|
5467
5517
|
if (ctx.json)
|
|
5468
5518
|
return printJson2(io, project);
|
|
5469
5519
|
io.out.write(`Updated project "${project.name}".
|
|
5470
5520
|
${projectLines(project)}`);
|
|
5471
5521
|
});
|
|
5472
|
-
projects.command("archive <id>").description("Archive a project: out of the default list and read-only (manager). Never deleted").action(async (
|
|
5522
|
+
projects.command("archive <id>").description("Archive a project: out of the default list and read-only (manager). Never deleted").action(async (id2, _opts, cmd) => {
|
|
5473
5523
|
const ctx = resolveContext2(cmd, io);
|
|
5474
5524
|
await requireApiKey2(ctx);
|
|
5475
|
-
const project = await explained("project", () => ctx.client.archiveProject(
|
|
5525
|
+
const project = await explained("project", () => ctx.client.archiveProject(id2));
|
|
5476
5526
|
if (ctx.json)
|
|
5477
5527
|
return printJson2(io, project);
|
|
5478
5528
|
io.out.write(`Archived "${project.name}". It is read-only and out of \`projects list\` until you unarchive it.
|
|
5479
5529
|
`);
|
|
5480
5530
|
});
|
|
5481
|
-
projects.command("unarchive <id>").description("Bring an archived project back (manager)").action(async (
|
|
5531
|
+
projects.command("unarchive <id>").description("Bring an archived project back (manager)").action(async (id2, _opts, cmd) => {
|
|
5482
5532
|
const ctx = resolveContext2(cmd, io);
|
|
5483
5533
|
await requireApiKey2(ctx);
|
|
5484
|
-
const project = await explained("project", () => ctx.client.unarchiveProject(
|
|
5534
|
+
const project = await explained("project", () => ctx.client.unarchiveProject(id2));
|
|
5485
5535
|
if (ctx.json)
|
|
5486
5536
|
return printJson2(io, project);
|
|
5487
5537
|
io.out.write(`Unarchived "${project.name}". It is writable again.
|
|
@@ -5579,6 +5629,308 @@ ${projectLines(project)}`);
|
|
|
5579
5629
|
});
|
|
5580
5630
|
}
|
|
5581
5631
|
|
|
5632
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/webhooks.js
|
|
5633
|
+
function explainWebhookRefusal(e, lookup, identity) {
|
|
5634
|
+
switch (e.code) {
|
|
5635
|
+
case "forbidden":
|
|
5636
|
+
return e.status === 403 ? "Only an owner or an admin manages webhooks." : null;
|
|
5637
|
+
case "guest_forbidden":
|
|
5638
|
+
return "You are a guest of this workspace, and guests do not manage its webhooks.";
|
|
5639
|
+
case "not_found":
|
|
5640
|
+
if (lookup === "catalog")
|
|
5641
|
+
return null;
|
|
5642
|
+
return lookup === "delivery" ? "No such delivery." : "No such webhook in this workspace.";
|
|
5643
|
+
case "url_refused":
|
|
5644
|
+
case "demo_session":
|
|
5645
|
+
return e.message;
|
|
5646
|
+
case "unknown_event":
|
|
5647
|
+
return `${e.message}. The exact types are in \`webhooks events\`; a family is its first word plus \`.*\`.`;
|
|
5648
|
+
case "unknown_subject":
|
|
5649
|
+
return `${e.message}. The subject keys are in \`webhooks events\`.`;
|
|
5650
|
+
case "plan_required": {
|
|
5651
|
+
const url2 = e.details?.upgradeUrl;
|
|
5652
|
+
return typeof url2 === "string" && url2 ? `${e.message} \u2014 upgrade the plan at ${url2}` : e.message;
|
|
5653
|
+
}
|
|
5654
|
+
case "insufficient_scope":
|
|
5655
|
+
case "endpoint_not_allowed":
|
|
5656
|
+
if (lookup === "catalog")
|
|
5657
|
+
return null;
|
|
5658
|
+
return identity.webhooksScope ? `This key cannot manage webhooks: create one with the ${identity.webhooksScope} scope on the API keys page.` : `${identity.displayName} opens webhooks to no API key: manage them signed in, in the dashboard.`;
|
|
5659
|
+
default:
|
|
5660
|
+
return null;
|
|
5661
|
+
}
|
|
5662
|
+
}
|
|
5663
|
+
async function explained2(identity, lookup, run2) {
|
|
5664
|
+
try {
|
|
5665
|
+
return await run2();
|
|
5666
|
+
} catch (e) {
|
|
5667
|
+
if (e instanceof PlatformApiError) {
|
|
5668
|
+
const line = explainWebhookRefusal(e, lookup, identity);
|
|
5669
|
+
if (line)
|
|
5670
|
+
throw new CliApiRefusal(line, e.status);
|
|
5671
|
+
}
|
|
5672
|
+
throw e;
|
|
5673
|
+
}
|
|
5674
|
+
}
|
|
5675
|
+
async function allWebhooks(client) {
|
|
5676
|
+
const first = await client.webhooks();
|
|
5677
|
+
return drainPages({ rows: first.webhooks, nextCursor: first.nextCursor }, async (cursor) => {
|
|
5678
|
+
const page = await client.webhooks({ cursor });
|
|
5679
|
+
return { rows: page.webhooks, nextCursor: page.nextCursor };
|
|
5680
|
+
});
|
|
5681
|
+
}
|
|
5682
|
+
var collect = (value, previous) => [...previous, value];
|
|
5683
|
+
function parseWebhookFilters(values) {
|
|
5684
|
+
const filters = {};
|
|
5685
|
+
for (const value of values) {
|
|
5686
|
+
const at = value.indexOf("=");
|
|
5687
|
+
const subject = at > 0 ? value.slice(0, at).trim() : "";
|
|
5688
|
+
const id2 = at > 0 ? value.slice(at + 1).trim() : "";
|
|
5689
|
+
if (!subject || !id2) {
|
|
5690
|
+
throw new CliUsageError(`--filter takes <subject>=<id> (e.g. thing=<id>), not "${value}".`);
|
|
5691
|
+
}
|
|
5692
|
+
const ids = filters[subject] ??= [];
|
|
5693
|
+
if (!ids.includes(id2))
|
|
5694
|
+
ids.push(id2);
|
|
5695
|
+
}
|
|
5696
|
+
return filters;
|
|
5697
|
+
}
|
|
5698
|
+
var DELIVERY_STATUSES = ["pending", "delivered", "failed", "held"];
|
|
5699
|
+
function parseLimit(value) {
|
|
5700
|
+
const n = Number(value);
|
|
5701
|
+
if (!Number.isInteger(n) || n < 1 || n > 100) {
|
|
5702
|
+
throw new CliUsageError(`--limit takes a whole number from 1 to 100, not "${value}".`);
|
|
5703
|
+
}
|
|
5704
|
+
return n;
|
|
5705
|
+
}
|
|
5706
|
+
function fmtWhen(iso) {
|
|
5707
|
+
return `${iso.slice(0, 10)} ${iso.slice(11, 16)}`;
|
|
5708
|
+
}
|
|
5709
|
+
function fmtFilters(filters) {
|
|
5710
|
+
const keys = Object.keys(filters);
|
|
5711
|
+
return keys.length === 0 ? "none" : keys.map((k) => `${k}=${(filters[k] ?? []).join("|")}`).join(" ");
|
|
5712
|
+
}
|
|
5713
|
+
function lastDelivery(w) {
|
|
5714
|
+
return w.lastDeliveryStatus && w.lastDeliveryAt ? `${w.lastDeliveryStatus} ${fmtWhen(w.lastDeliveryAt)}` : "-";
|
|
5715
|
+
}
|
|
5716
|
+
function endpointLines(w) {
|
|
5717
|
+
return `${w.url}
|
|
5718
|
+
id: ${w.id}
|
|
5719
|
+
` + (w.description ? ` description: ${w.description}
|
|
5720
|
+
` : "") + ` events: ${w.events.join(", ")}
|
|
5721
|
+
filters: ${fmtFilters(w.filters)}
|
|
5722
|
+
enabled: ${w.enabled ? "yes" : "no"}
|
|
5723
|
+
` + (w.disabledAt ? ` disabled: ${w.disabledAt}${w.disabledReason ? ` (${w.disabledReason})` : ""}
|
|
5724
|
+
` : "") + ` failures: ${w.consecutiveFailures} in a row
|
|
5725
|
+
last: ${lastDelivery(w)}
|
|
5726
|
+
` + (w.previousSecretExpiresAt ? ` old secret: signs until ${w.previousSecretExpiresAt}
|
|
5727
|
+
` : "") + ` created: ${w.createdAt}
|
|
5728
|
+
`;
|
|
5729
|
+
}
|
|
5730
|
+
function deliveryLines(d) {
|
|
5731
|
+
return `Delivery ${d.id}
|
|
5732
|
+
event: ${d.eventType} (${d.eventId})
|
|
5733
|
+
status: ${d.status}
|
|
5734
|
+
attempt: ${d.attempt}
|
|
5735
|
+
HTTP code: ${d.lastStatusCode ?? "-"}
|
|
5736
|
+
` + (d.lastError ? ` error: ${d.lastError}
|
|
5737
|
+
` : "") + (d.nextAttemptAt ? ` next try: ${d.nextAttemptAt}
|
|
5738
|
+
` : "") + (d.deliveredAt ? ` delivered: ${d.deliveredAt}
|
|
5739
|
+
` : "") + ` created: ${d.createdAt}
|
|
5740
|
+
`;
|
|
5741
|
+
}
|
|
5742
|
+
function catalogLines(catalog) {
|
|
5743
|
+
if (catalog.events.length === 0)
|
|
5744
|
+
return "No event types.\n";
|
|
5745
|
+
let out = table([
|
|
5746
|
+
["TYPE", "SUBJECTS", "DESCRIPTION"],
|
|
5747
|
+
...catalog.events.map((e) => [e.type, e.subjects.join(",") || "-", e.description])
|
|
5748
|
+
]);
|
|
5749
|
+
if (catalog.subjects.length > 0) {
|
|
5750
|
+
out += "\nSubjects (what --filter <subject>=<id> matches on):\n" + table(catalog.subjects.map((s) => [` ${s.key}`, `subjects.${s.field}`, s.description]));
|
|
5751
|
+
}
|
|
5752
|
+
return out;
|
|
5753
|
+
}
|
|
5754
|
+
function registerWebhookCommands(kit, program2, io) {
|
|
5755
|
+
const { requireApiKey: requireApiKey2, resolveContext: resolveContext2, identity } = kit;
|
|
5756
|
+
const scopeLine = identity.webhooksScope ? `A key needs the ${identity.webhooksScope} scope.` : `${identity.displayName} opens webhooks to no API key.`;
|
|
5757
|
+
const webhooks = program2.command("webhooks").description("The workspace's webhooks (signed POSTs to your URLs when an event happens)").addHelpText("after", `
|
|
5758
|
+
An owner or an admin manages the webhooks; every member reads the event catalog
|
|
5759
|
+
(\`webhooks events\`). ${scopeLine}
|
|
5760
|
+
The signing secret is printed once, at \`create\` and at \`rotate-secret\`: store it then.
|
|
5761
|
+
`);
|
|
5762
|
+
webhooks.command("list").description("List the workspace's webhook endpoints (every page)").action(async (_opts, cmd) => {
|
|
5763
|
+
const ctx = resolveContext2(cmd, io);
|
|
5764
|
+
await requireApiKey2(ctx);
|
|
5765
|
+
const rows = await explained2(identity, "webhook", () => allWebhooks(ctx.client));
|
|
5766
|
+
if (ctx.json)
|
|
5767
|
+
return printJson2(io, { webhooks: rows, nextCursor: null });
|
|
5768
|
+
if (rows.length === 0) {
|
|
5769
|
+
io.out.write("No webhooks.\n");
|
|
5770
|
+
return;
|
|
5771
|
+
}
|
|
5772
|
+
io.out.write(table([
|
|
5773
|
+
["ID", "URL", "EVENTS", "ENABLED", "LAST DELIVERY", "FAILURES"],
|
|
5774
|
+
...rows.map((w) => [
|
|
5775
|
+
w.id,
|
|
5776
|
+
w.url,
|
|
5777
|
+
w.events.join(","),
|
|
5778
|
+
w.enabled ? "yes" : "no",
|
|
5779
|
+
lastDelivery(w),
|
|
5780
|
+
String(w.consecutiveFailures)
|
|
5781
|
+
])
|
|
5782
|
+
]));
|
|
5783
|
+
});
|
|
5784
|
+
webhooks.command("events").description("The event catalog: every event type, the subjects it carries, what it means").action(async (_opts, cmd) => {
|
|
5785
|
+
const ctx = resolveContext2(cmd, io);
|
|
5786
|
+
await requireApiKey2(ctx);
|
|
5787
|
+
const catalog = await explained2(identity, "catalog", () => ctx.client.webhookEvents());
|
|
5788
|
+
if (ctx.json)
|
|
5789
|
+
return printJson2(io, catalog);
|
|
5790
|
+
io.out.write(catalogLines(catalog));
|
|
5791
|
+
});
|
|
5792
|
+
webhooks.command("create <url>").description("Register an endpoint (owner or admin); its signing secret is printed once").option("--event <type>", "an event type (thing.created), a family (thing.*) or everything (*); repeatable, at least one", collect, []).option("--description <text>", "what the endpoint is for").option("--filter <subject>=<id>", "only events about this subject id; repeatable (same subject: OR, different subjects: AND)", collect, []).option("--disabled", "register it switched off", false).action(async (url2, opts, cmd) => {
|
|
5793
|
+
if (opts.event.length === 0) {
|
|
5794
|
+
throw new CliUsageError("Name at least one event: --event <type> (e.g. --event thing.created), repeatable.");
|
|
5795
|
+
}
|
|
5796
|
+
const filters = parseWebhookFilters(opts.filter);
|
|
5797
|
+
const req = {
|
|
5798
|
+
url: url2,
|
|
5799
|
+
events: opts.event,
|
|
5800
|
+
...opts.description !== void 0 ? { description: opts.description } : {},
|
|
5801
|
+
...Object.keys(filters).length > 0 ? { filters } : {},
|
|
5802
|
+
...opts.disabled ? { enabled: false } : {}
|
|
5803
|
+
};
|
|
5804
|
+
const ctx = resolveContext2(cmd, io);
|
|
5805
|
+
await requireApiKey2(ctx);
|
|
5806
|
+
const created = await explained2(identity, "webhook", () => ctx.client.createWebhook(req));
|
|
5807
|
+
if (ctx.json)
|
|
5808
|
+
return printJson2(io, created);
|
|
5809
|
+
io.out.write(`Created webhook ${created.id}.
|
|
5810
|
+
Its signing secret is shown this once, never again: store it now.
|
|
5811
|
+
${created.secret}
|
|
5812
|
+
`);
|
|
5813
|
+
});
|
|
5814
|
+
webhooks.command("get <id>").description("Show one endpoint").action(async (id2, _opts, cmd) => {
|
|
5815
|
+
const ctx = resolveContext2(cmd, io);
|
|
5816
|
+
await requireApiKey2(ctx);
|
|
5817
|
+
const endpoint = await explained2(identity, "webhook", () => ctx.client.webhook(id2));
|
|
5818
|
+
if (ctx.json)
|
|
5819
|
+
return printJson2(io, endpoint);
|
|
5820
|
+
io.out.write(endpointLines(endpoint));
|
|
5821
|
+
});
|
|
5822
|
+
webhooks.command("update <id>").description("Change an endpoint (owner or admin); only what is passed changes").option("--endpoint-url <url>", "the new address the deliveries go to").option("--description <text>", "the new description").option("--event <type>", "replace the events with these; repeatable", collect, []).option("--filter <subject>=<id>", "replace the filters with these; repeatable", collect, []).option("--clear-filters", "remove every filter", false).option("--enable", "switch the endpoint on", false).option("--disable", "switch the endpoint off", false).action(async (id2, opts, cmd) => {
|
|
5823
|
+
if (opts.enable && opts.disable) {
|
|
5824
|
+
throw new CliUsageError("Pass --enable or --disable, not both.");
|
|
5825
|
+
}
|
|
5826
|
+
if (opts.clearFilters && opts.filter.length > 0) {
|
|
5827
|
+
throw new CliUsageError("Pass --filter or --clear-filters, not both.");
|
|
5828
|
+
}
|
|
5829
|
+
const req = {
|
|
5830
|
+
...opts.endpointUrl !== void 0 ? { url: opts.endpointUrl } : {},
|
|
5831
|
+
...opts.description !== void 0 ? { description: opts.description } : {},
|
|
5832
|
+
...opts.event.length > 0 ? { events: opts.event } : {},
|
|
5833
|
+
...opts.filter.length > 0 ? { filters: parseWebhookFilters(opts.filter) } : {},
|
|
5834
|
+
...opts.clearFilters ? { filters: {} } : {},
|
|
5835
|
+
...opts.enable ? { enabled: true } : {},
|
|
5836
|
+
...opts.disable ? { enabled: false } : {}
|
|
5837
|
+
};
|
|
5838
|
+
if (Object.keys(req).length === 0) {
|
|
5839
|
+
throw new CliUsageError("Nothing to change \u2014 pass --endpoint-url, --description, --event, --filter, --clear-filters, --enable or --disable.");
|
|
5840
|
+
}
|
|
5841
|
+
const ctx = resolveContext2(cmd, io);
|
|
5842
|
+
await requireApiKey2(ctx);
|
|
5843
|
+
const updated = await explained2(identity, "webhook", () => ctx.client.updateWebhook(id2, req));
|
|
5844
|
+
if (ctx.json)
|
|
5845
|
+
return printJson2(io, updated);
|
|
5846
|
+
io.out.write(`Updated webhook ${updated.id}.
|
|
5847
|
+
${endpointLines(updated)}`);
|
|
5848
|
+
});
|
|
5849
|
+
webhooks.command("delete <id>").description("Delete an endpoint and its delivery history (owner or admin)").action(async (id2, _opts, cmd) => {
|
|
5850
|
+
const ctx = resolveContext2(cmd, io);
|
|
5851
|
+
await requireApiKey2(ctx);
|
|
5852
|
+
const deleted = await explained2(identity, "webhook", () => ctx.client.deleteWebhook(id2));
|
|
5853
|
+
if (ctx.json)
|
|
5854
|
+
return printJson2(io, deleted);
|
|
5855
|
+
io.out.write(`Deleted webhook ${deleted.id} (${deleted.url}) and its delivery history.
|
|
5856
|
+
`);
|
|
5857
|
+
});
|
|
5858
|
+
webhooks.command("rotate-secret <id>").description("Replace an endpoint's signing secret (owner or admin); the new one is printed once").action(async (id2, _opts, cmd) => {
|
|
5859
|
+
const ctx = resolveContext2(cmd, io);
|
|
5860
|
+
await requireApiKey2(ctx);
|
|
5861
|
+
const rotated = await explained2(identity, "webhook", () => ctx.client.rotateWebhookSecret(id2));
|
|
5862
|
+
if (ctx.json)
|
|
5863
|
+
return printJson2(io, rotated);
|
|
5864
|
+
io.out.write(`New signing secret for webhook ${rotated.id}, shown this once, never again: store it now.
|
|
5865
|
+
${rotated.secret}
|
|
5866
|
+
The previous secret keeps signing until ${rotated.previousSecretExpiresAt}.
|
|
5867
|
+
`);
|
|
5868
|
+
});
|
|
5869
|
+
webhooks.command("test <id>").description("Send a signed webhook.ping now and print its outcome (exit 1 when not delivered)").action(async (id2, _opts, cmd) => {
|
|
5870
|
+
const ctx = resolveContext2(cmd, io);
|
|
5871
|
+
await requireApiKey2(ctx);
|
|
5872
|
+
const { delivery } = await explained2(identity, "webhook", () => ctx.client.testWebhook(id2));
|
|
5873
|
+
if (ctx.json)
|
|
5874
|
+
printJson2(io, { delivery });
|
|
5875
|
+
else
|
|
5876
|
+
io.out.write(`Ping ${delivery.status}` + (delivery.lastStatusCode !== null ? `, HTTP ${delivery.lastStatusCode}` : "") + (delivery.lastError ? `: ${delivery.lastError}` : "") + ` (delivery ${delivery.id}).
|
|
5877
|
+
`);
|
|
5878
|
+
if (delivery.status !== "delivered") {
|
|
5879
|
+
throw new CliUsageError(`The ping was not delivered (${delivery.status}).`);
|
|
5880
|
+
}
|
|
5881
|
+
});
|
|
5882
|
+
webhooks.command("deliveries <id>").description("List one page of an endpoint's deliveries, newest first").option("--status <status>", `only these: ${DELIVERY_STATUSES.join(", ")}`).option("--limit <n>", "page size, 1 to 100 (server default 50)").option("--cursor <cursor>", "the next page, as the previous one printed it").action(async (id2, opts, cmd) => {
|
|
5883
|
+
if (opts.status !== void 0 && !DELIVERY_STATUSES.includes(opts.status)) {
|
|
5884
|
+
throw new CliUsageError(`--status takes one of ${DELIVERY_STATUSES.join(", ")}, not "${opts.status}".`);
|
|
5885
|
+
}
|
|
5886
|
+
const params = {
|
|
5887
|
+
...opts.status !== void 0 ? { status: opts.status } : {},
|
|
5888
|
+
...opts.limit !== void 0 ? { limit: parseLimit(opts.limit) } : {},
|
|
5889
|
+
...opts.cursor !== void 0 ? { cursor: opts.cursor } : {}
|
|
5890
|
+
};
|
|
5891
|
+
const ctx = resolveContext2(cmd, io);
|
|
5892
|
+
await requireApiKey2(ctx);
|
|
5893
|
+
const page = await explained2(identity, "webhook", () => ctx.client.webhookDeliveries(id2, params));
|
|
5894
|
+
if (ctx.json)
|
|
5895
|
+
return printJson2(io, page);
|
|
5896
|
+
if (page.deliveries.length === 0) {
|
|
5897
|
+
io.out.write("No deliveries.\n");
|
|
5898
|
+
return;
|
|
5899
|
+
}
|
|
5900
|
+
io.out.write(table([
|
|
5901
|
+
["ID", "EVENT", "STATUS", "ATTEMPT", "CODE", "CREATED"],
|
|
5902
|
+
...page.deliveries.map((d) => [
|
|
5903
|
+
d.id,
|
|
5904
|
+
d.eventType,
|
|
5905
|
+
d.status,
|
|
5906
|
+
String(d.attempt),
|
|
5907
|
+
d.lastStatusCode !== null ? String(d.lastStatusCode) : "-",
|
|
5908
|
+
fmtWhen(d.createdAt)
|
|
5909
|
+
])
|
|
5910
|
+
]));
|
|
5911
|
+
if (page.nextCursor)
|
|
5912
|
+
io.out.write(`More: --cursor ${page.nextCursor}
|
|
5913
|
+
`);
|
|
5914
|
+
});
|
|
5915
|
+
webhooks.command("delivery <id> <deliveryId>").description("Show one delivery: its status, its latest attempt (--json: the payload as sent)").action(async (id2, deliveryId, _opts, cmd) => {
|
|
5916
|
+
const ctx = resolveContext2(cmd, io);
|
|
5917
|
+
await requireApiKey2(ctx);
|
|
5918
|
+
const delivery = await explained2(identity, "delivery", () => ctx.client.webhookDelivery(id2, deliveryId));
|
|
5919
|
+
if (ctx.json)
|
|
5920
|
+
return printJson2(io, delivery);
|
|
5921
|
+
io.out.write(deliveryLines(delivery));
|
|
5922
|
+
});
|
|
5923
|
+
webhooks.command("redeliver <id> <deliveryId>").description("Queue the same event again as a new delivery (same event id, same payload)").action(async (id2, deliveryId, _opts, cmd) => {
|
|
5924
|
+
const ctx = resolveContext2(cmd, io);
|
|
5925
|
+
await requireApiKey2(ctx);
|
|
5926
|
+
const delivery = await explained2(identity, "delivery", () => ctx.client.redeliverWebhook(id2, deliveryId));
|
|
5927
|
+
if (ctx.json)
|
|
5928
|
+
return printJson2(io, delivery);
|
|
5929
|
+
io.out.write(`Queued delivery ${delivery.id} of ${delivery.eventType} (event ${delivery.eventId}).
|
|
5930
|
+
`);
|
|
5931
|
+
});
|
|
5932
|
+
}
|
|
5933
|
+
|
|
5582
5934
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
5583
5935
|
var external_exports = {};
|
|
5584
5936
|
__export(external_exports, {
|
|
@@ -8671,42 +9023,42 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
8671
9023
|
}
|
|
8672
9024
|
doc.write(`const newResult = {};`);
|
|
8673
9025
|
for (const key of normalized.keys) {
|
|
8674
|
-
const
|
|
9026
|
+
const id2 = ids[key];
|
|
8675
9027
|
const k = esc(key);
|
|
8676
9028
|
const schema = shape[key];
|
|
8677
9029
|
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
8678
9030
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
8679
|
-
doc.write(`const ${
|
|
9031
|
+
doc.write(`const ${id2} = ${parseStr(key)};`);
|
|
8680
9032
|
if (isOptionalIn && isOptionalOut) {
|
|
8681
9033
|
doc.write(`
|
|
8682
|
-
if (${
|
|
9034
|
+
if (${id2}.issues.length) {
|
|
8683
9035
|
if (${k} in input) {
|
|
8684
|
-
payload.issues = payload.issues.concat(${
|
|
9036
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
8685
9037
|
...iss,
|
|
8686
9038
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
8687
9039
|
})));
|
|
8688
9040
|
}
|
|
8689
9041
|
}
|
|
8690
9042
|
|
|
8691
|
-
if (${
|
|
9043
|
+
if (${id2}.value === undefined) {
|
|
8692
9044
|
if (${k} in input) {
|
|
8693
9045
|
newResult[${k}] = undefined;
|
|
8694
9046
|
}
|
|
8695
9047
|
} else {
|
|
8696
|
-
newResult[${k}] = ${
|
|
9048
|
+
newResult[${k}] = ${id2}.value;
|
|
8697
9049
|
}
|
|
8698
9050
|
|
|
8699
9051
|
`);
|
|
8700
9052
|
} else if (!isOptionalIn) {
|
|
8701
9053
|
doc.write(`
|
|
8702
|
-
const ${
|
|
8703
|
-
if (${
|
|
8704
|
-
payload.issues = payload.issues.concat(${
|
|
9054
|
+
const ${id2}_present = ${k} in input;
|
|
9055
|
+
if (${id2}.issues.length) {
|
|
9056
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
8705
9057
|
...iss,
|
|
8706
9058
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
8707
9059
|
})));
|
|
8708
9060
|
}
|
|
8709
|
-
if (!${
|
|
9061
|
+
if (!${id2}_present && !${id2}.issues.length) {
|
|
8710
9062
|
payload.issues.push({
|
|
8711
9063
|
code: "invalid_type",
|
|
8712
9064
|
expected: "nonoptional",
|
|
@@ -8715,30 +9067,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
8715
9067
|
});
|
|
8716
9068
|
}
|
|
8717
9069
|
|
|
8718
|
-
if (${
|
|
8719
|
-
if (${
|
|
9070
|
+
if (${id2}_present) {
|
|
9071
|
+
if (${id2}.value === undefined) {
|
|
8720
9072
|
newResult[${k}] = undefined;
|
|
8721
9073
|
} else {
|
|
8722
|
-
newResult[${k}] = ${
|
|
9074
|
+
newResult[${k}] = ${id2}.value;
|
|
8723
9075
|
}
|
|
8724
9076
|
}
|
|
8725
9077
|
|
|
8726
9078
|
`);
|
|
8727
9079
|
} else {
|
|
8728
9080
|
doc.write(`
|
|
8729
|
-
if (${
|
|
8730
|
-
payload.issues = payload.issues.concat(${
|
|
9081
|
+
if (${id2}.issues.length) {
|
|
9082
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
8731
9083
|
...iss,
|
|
8732
9084
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
8733
9085
|
})));
|
|
8734
9086
|
}
|
|
8735
9087
|
|
|
8736
|
-
if (${
|
|
9088
|
+
if (${id2}.value === undefined) {
|
|
8737
9089
|
if (${k} in input) {
|
|
8738
9090
|
newResult[${k}] = undefined;
|
|
8739
9091
|
}
|
|
8740
9092
|
} else {
|
|
8741
|
-
newResult[${k}] = ${
|
|
9093
|
+
newResult[${k}] = ${id2}.value;
|
|
8742
9094
|
}
|
|
8743
9095
|
|
|
8744
9096
|
`);
|
|
@@ -17070,26 +17422,26 @@ function extractDefs(ctx, schema) {
|
|
|
17070
17422
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
17071
17423
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
17072
17424
|
for (const entry of ctx.seen.entries()) {
|
|
17073
|
-
const
|
|
17074
|
-
if (
|
|
17075
|
-
const existing = idToSchema.get(
|
|
17425
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
17426
|
+
if (id2) {
|
|
17427
|
+
const existing = idToSchema.get(id2);
|
|
17076
17428
|
if (existing && existing !== entry[0]) {
|
|
17077
|
-
throw new Error(`Duplicate schema id "${
|
|
17429
|
+
throw new Error(`Duplicate schema id "${id2}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
17078
17430
|
}
|
|
17079
|
-
idToSchema.set(
|
|
17431
|
+
idToSchema.set(id2, entry[0]);
|
|
17080
17432
|
}
|
|
17081
17433
|
}
|
|
17082
17434
|
const makeURI = (entry) => {
|
|
17083
17435
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
17084
17436
|
if (ctx.external) {
|
|
17085
17437
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
17086
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
17438
|
+
const uriGenerator = ctx.external.uri ?? ((id3) => id3);
|
|
17087
17439
|
if (externalId) {
|
|
17088
17440
|
return { ref: uriGenerator(externalId) };
|
|
17089
17441
|
}
|
|
17090
|
-
const
|
|
17091
|
-
entry[1].defId =
|
|
17092
|
-
return { defId:
|
|
17442
|
+
const id2 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
17443
|
+
entry[1].defId = id2;
|
|
17444
|
+
return { defId: id2, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id2}` };
|
|
17093
17445
|
}
|
|
17094
17446
|
if (entry[1] === root) {
|
|
17095
17447
|
return { ref: "#" };
|
|
@@ -17137,8 +17489,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17137
17489
|
continue;
|
|
17138
17490
|
}
|
|
17139
17491
|
}
|
|
17140
|
-
const
|
|
17141
|
-
if (
|
|
17492
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
17493
|
+
if (id2) {
|
|
17142
17494
|
extractToDef(entry);
|
|
17143
17495
|
continue;
|
|
17144
17496
|
}
|
|
@@ -17234,10 +17586,10 @@ function finalize(ctx, schema) {
|
|
|
17234
17586
|
} else {
|
|
17235
17587
|
}
|
|
17236
17588
|
if (ctx.external?.uri) {
|
|
17237
|
-
const
|
|
17238
|
-
if (!
|
|
17589
|
+
const id2 = ctx.external.registry.get(schema)?.id;
|
|
17590
|
+
if (!id2)
|
|
17239
17591
|
throw new Error("Schema is missing an `id` property");
|
|
17240
|
-
result.$id = ctx.external.uri(
|
|
17592
|
+
result.$id = ctx.external.uri(id2);
|
|
17241
17593
|
}
|
|
17242
17594
|
Object.assign(result, root.def ?? root.schema);
|
|
17243
17595
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -20093,7 +20445,7 @@ function date4(params) {
|
|
|
20093
20445
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
20094
20446
|
config(en_default());
|
|
20095
20447
|
|
|
20096
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
20448
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/common.js
|
|
20097
20449
|
var apiErrorSchema = external_exports.object({
|
|
20098
20450
|
error: external_exports.object({
|
|
20099
20451
|
code: external_exports.string(),
|
|
@@ -20198,12 +20550,12 @@ function isValidMediaType(value) {
|
|
|
20198
20550
|
return value.length >= 1 && value.length <= 255 && isLatin1(value) && MEDIA_TYPE_RE.test(value);
|
|
20199
20551
|
}
|
|
20200
20552
|
|
|
20201
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
20553
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/scope.js
|
|
20202
20554
|
function defineScopeSchema(scopes) {
|
|
20203
20555
|
return external_exports.enum(scopes);
|
|
20204
20556
|
}
|
|
20205
20557
|
|
|
20206
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
20558
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/seams.js
|
|
20207
20559
|
var KNOWN_AUTH_METHODS = [
|
|
20208
20560
|
"password",
|
|
20209
20561
|
"email-otp",
|
|
@@ -21787,7 +22139,7 @@ var HUB_TOOL_WIRE_INPUTS = {
|
|
|
21787
22139
|
}
|
|
21788
22140
|
};
|
|
21789
22141
|
|
|
21790
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22142
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/entitlements.js
|
|
21791
22143
|
var entitlementTierSchema = billingPlanSchema;
|
|
21792
22144
|
var entitlementActionSchema = external_exports.object({
|
|
21793
22145
|
key: external_exports.string().min(1),
|
|
@@ -21821,7 +22173,7 @@ var entitlementProfileSchema = external_exports.object({
|
|
|
21821
22173
|
upgradeUrl: external_exports.string()
|
|
21822
22174
|
});
|
|
21823
22175
|
|
|
21824
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22176
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/instance.js
|
|
21825
22177
|
var instanceInfoSchema2 = external_exports.object({
|
|
21826
22178
|
name: external_exports.string(),
|
|
21827
22179
|
instanceId: external_exports.string().nullable(),
|
|
@@ -21890,7 +22242,7 @@ var instanceInfoSchema2 = external_exports.object({
|
|
|
21890
22242
|
entitlements: toolEntitlementsSchema.optional()
|
|
21891
22243
|
});
|
|
21892
22244
|
|
|
21893
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22245
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/setup.js
|
|
21894
22246
|
var setupRequestSchema2 = external_exports.object({
|
|
21895
22247
|
instanceName: plainText(1, 120),
|
|
21896
22248
|
owner: external_exports.object({
|
|
@@ -21907,7 +22259,7 @@ var setupResponseSchema2 = external_exports.object({
|
|
|
21907
22259
|
ownerUserId: external_exports.string()
|
|
21908
22260
|
});
|
|
21909
22261
|
|
|
21910
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22262
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/workspaces.js
|
|
21911
22263
|
var lookKey2 = external_exports.string().regex(/^[a-z][a-z0-9-]{0,31}$/, "a short lowercase key").nullable();
|
|
21912
22264
|
var lookLevel2 = external_exports.number().min(0).max(1).nullable();
|
|
21913
22265
|
var workspaceLookSchema2 = external_exports.object({
|
|
@@ -21947,7 +22299,7 @@ var workspaceUpdatedSchema2 = external_exports.object({
|
|
|
21947
22299
|
})
|
|
21948
22300
|
});
|
|
21949
22301
|
|
|
21950
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22302
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/me.js
|
|
21951
22303
|
var onboardingDismissedSchema = external_exports.object({
|
|
21952
22304
|
dismissed: external_exports.literal(true)
|
|
21953
22305
|
});
|
|
@@ -22099,7 +22451,7 @@ function defineMeSchemas(scopeSchema3) {
|
|
|
22099
22451
|
return { meResponseSchema: meResponseSchema3 };
|
|
22100
22452
|
}
|
|
22101
22453
|
|
|
22102
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22454
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/members.js
|
|
22103
22455
|
var memberSchema2 = external_exports.object({
|
|
22104
22456
|
id: external_exports.string(),
|
|
22105
22457
|
userId: external_exports.string(),
|
|
@@ -22133,7 +22485,7 @@ var memberChangeEmailLinkSchema2 = external_exports.object({
|
|
|
22133
22485
|
expiresAt: external_exports.string()
|
|
22134
22486
|
});
|
|
22135
22487
|
|
|
22136
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22488
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/cli-auth.js
|
|
22137
22489
|
var cliAuthRequestSchema2 = external_exports.object({
|
|
22138
22490
|
email: external_exports.email()
|
|
22139
22491
|
});
|
|
@@ -22175,7 +22527,7 @@ function defineCliAuthSchemas(apiKeySchema3) {
|
|
|
22175
22527
|
return { cliAuthCompletedSchema: cliAuthCompletedSchema3 };
|
|
22176
22528
|
}
|
|
22177
22529
|
|
|
22178
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22530
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/sso-connect.js
|
|
22179
22531
|
var ssoCliConnectSchema = external_exports.object({
|
|
22180
22532
|
/** The hub-minted exchange JWT (compact JWS — three base64url segments). */
|
|
22181
22533
|
token: external_exports.string().min(20).max(4096),
|
|
@@ -22190,18 +22542,18 @@ var ssoCliConnectSchema = external_exports.object({
|
|
|
22190
22542
|
hubRefreshToken: external_exports.string().min(20).max(512).optional()
|
|
22191
22543
|
});
|
|
22192
22544
|
|
|
22193
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22545
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/cli-package.js
|
|
22194
22546
|
var cliPackageRequestSchema = external_exports.object({
|
|
22195
22547
|
/** The hub-minted exchange JWT (compact JWS — three base64url segments). */
|
|
22196
22548
|
token: external_exports.string().min(1)
|
|
22197
22549
|
});
|
|
22198
22550
|
|
|
22199
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22551
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/sso-logout.js
|
|
22200
22552
|
var ssoLogoutResponseSchema = external_exports.object({
|
|
22201
22553
|
url: external_exports.string().nullable()
|
|
22202
22554
|
});
|
|
22203
22555
|
|
|
22204
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22556
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/invitations.js
|
|
22205
22557
|
var invitationSchema2 = external_exports.object({
|
|
22206
22558
|
id: external_exports.string(),
|
|
22207
22559
|
email: external_exports.string(),
|
|
@@ -22243,7 +22595,7 @@ var invitationAcceptedSchema2 = external_exports.object({
|
|
|
22243
22595
|
role: workspaceRoleSchema
|
|
22244
22596
|
});
|
|
22245
22597
|
|
|
22246
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22598
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/audit.js
|
|
22247
22599
|
var auditEntrySchema2 = external_exports.object({
|
|
22248
22600
|
id: external_exports.number(),
|
|
22249
22601
|
actorUserId: external_exports.string().nullable(),
|
|
@@ -22288,7 +22640,7 @@ var auditListSchema2 = external_exports.object({
|
|
|
22288
22640
|
total: external_exports.number().int().nullable()
|
|
22289
22641
|
});
|
|
22290
22642
|
|
|
22291
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22643
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/break-glass.js
|
|
22292
22644
|
var breakGlassClaimOwnershipRequestSchema2 = external_exports.object({
|
|
22293
22645
|
userId: external_exports.string().min(1).optional(),
|
|
22294
22646
|
workspaceId: external_exports.uuid().optional()
|
|
@@ -22313,7 +22665,7 @@ var breakGlassResetTwoFactorSchema2 = external_exports.object({
|
|
|
22313
22665
|
hadTwoFactor: external_exports.boolean()
|
|
22314
22666
|
});
|
|
22315
22667
|
|
|
22316
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22668
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/files.js
|
|
22317
22669
|
var fileSchema2 = external_exports.object({
|
|
22318
22670
|
id: external_exports.string(),
|
|
22319
22671
|
sha256: external_exports.string(),
|
|
@@ -22338,7 +22690,7 @@ var fileUploadQuerySchema2 = external_exports.object({
|
|
|
22338
22690
|
name: plainText(1, 255)
|
|
22339
22691
|
});
|
|
22340
22692
|
|
|
22341
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22693
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/projects.js
|
|
22342
22694
|
var projectRoleSchema = external_exports.enum(["manager", "editor", "viewer"]);
|
|
22343
22695
|
var PROJECT_METADATA_MAX_LENGTH = 16 * 1024;
|
|
22344
22696
|
var projectMetadataSchema = opaqueJsonChecks(external_exports.record(external_exports.string(), external_exports.unknown())).refine((v) => JSON.stringify(v).length <= PROJECT_METADATA_MAX_LENGTH, `metadata must serialize to at most ${PROJECT_METADATA_MAX_LENGTH} characters`);
|
|
@@ -22426,7 +22778,7 @@ var projectMemberParamsSchema = external_exports.object({
|
|
|
22426
22778
|
});
|
|
22427
22779
|
var projectTeamParamsSchema = external_exports.object({ id: external_exports.uuid(), teamId: external_exports.uuid() });
|
|
22428
22780
|
|
|
22429
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22781
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/teams.js
|
|
22430
22782
|
var teamSlugSchema2 = external_exports.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "lowercase letters and digits, joined by single dashes").min(1).max(60);
|
|
22431
22783
|
var teamSchema2 = external_exports.object({
|
|
22432
22784
|
id: external_exports.string(),
|
|
@@ -22480,7 +22832,119 @@ var teamMemberParamsSchema = external_exports.object({
|
|
|
22480
22832
|
userId: noControlChars(external_exports.string().min(1).max(200))
|
|
22481
22833
|
});
|
|
22482
22834
|
|
|
22483
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22835
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/webhooks.js
|
|
22836
|
+
var webhookEventPatternSchema = external_exports.string().max(80).regex(/^(\*|[a-z][a-z0-9_]*\.(\*|[a-z][a-z0-9_]*))$/, "an event type (thing.created), a family (thing.*) or everything (*)");
|
|
22837
|
+
var webhookSubjectKeySchema = external_exports.string().max(40).regex(/^[a-z][a-z0-9_]*$/, "lowercase letters, digits and underscores, starting with a letter");
|
|
22838
|
+
var webhookFiltersSchema = external_exports.record(webhookSubjectKeySchema, external_exports.array(plainText(1, 200)).min(1).max(100)).refine((v) => Object.keys(v).length <= 10, { error: "at most 10 subject keys" }).describe("Subject key \u2192 ids; AND across keys, OR within a key; an event that does not carry a filtered subject does not match");
|
|
22839
|
+
var UrlParser = globalThis.URL;
|
|
22840
|
+
function isHttpUrlWithoutCredentials(value) {
|
|
22841
|
+
let parsed;
|
|
22842
|
+
try {
|
|
22843
|
+
parsed = new UrlParser(value);
|
|
22844
|
+
} catch {
|
|
22845
|
+
return false;
|
|
22846
|
+
}
|
|
22847
|
+
return (parsed.protocol === "http:" || parsed.protocol === "https:") && parsed.username === "" && parsed.password === "";
|
|
22848
|
+
}
|
|
22849
|
+
var webhookUrlSchema = external_exports.string().max(2048).refine((v) => !/\s/.test(v) && !hasControlChars(v), {
|
|
22850
|
+
error: "must not contain whitespace or control characters",
|
|
22851
|
+
abort: true
|
|
22852
|
+
}).refine(isHttpUrlWithoutCredentials, { error: "an http or https URL without credentials" });
|
|
22853
|
+
var webhookDeliveryStatusSchema = external_exports.enum(["pending", "delivered", "failed", "held"]);
|
|
22854
|
+
var webhookEndpointSchema = external_exports.object({
|
|
22855
|
+
id: external_exports.string(),
|
|
22856
|
+
url: external_exports.string(),
|
|
22857
|
+
description: external_exports.string(),
|
|
22858
|
+
events: external_exports.array(external_exports.string()),
|
|
22859
|
+
filters: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
22860
|
+
enabled: external_exports.boolean(),
|
|
22861
|
+
createdBy: external_exports.string().nullable(),
|
|
22862
|
+
createdAt: external_exports.string(),
|
|
22863
|
+
updatedAt: external_exports.string(),
|
|
22864
|
+
/** Set with `disabledReason` when the endpoint was switched off after failing too long. */
|
|
22865
|
+
disabledAt: external_exports.string().nullable(),
|
|
22866
|
+
disabledReason: external_exports.string().nullable(),
|
|
22867
|
+
consecutiveFailures: external_exports.number().int(),
|
|
22868
|
+
lastDeliveryAt: external_exports.string().nullable(),
|
|
22869
|
+
lastDeliveryStatus: external_exports.enum(["delivered", "failed"]).nullable(),
|
|
22870
|
+
/** During a rotation, the previous secret keeps signing until this date. */
|
|
22871
|
+
previousSecretExpiresAt: external_exports.string().nullable()
|
|
22872
|
+
});
|
|
22873
|
+
var webhookEndpointCreatedSchema = webhookEndpointSchema.extend({
|
|
22874
|
+
secret: external_exports.string()
|
|
22875
|
+
});
|
|
22876
|
+
var webhookSecretRotatedSchema = webhookEndpointSchema.extend({
|
|
22877
|
+
secret: external_exports.string(),
|
|
22878
|
+
previousSecretExpiresAt: external_exports.string()
|
|
22879
|
+
});
|
|
22880
|
+
var webhookDescriptionSchema = plainText(0, 200);
|
|
22881
|
+
var webhookEventsSchema = external_exports.array(webhookEventPatternSchema).min(1).max(50);
|
|
22882
|
+
var webhookEndpointCreateSchema = external_exports.object({
|
|
22883
|
+
url: webhookUrlSchema,
|
|
22884
|
+
description: webhookDescriptionSchema.default(""),
|
|
22885
|
+
events: webhookEventsSchema,
|
|
22886
|
+
filters: webhookFiltersSchema.default({}),
|
|
22887
|
+
enabled: external_exports.boolean().default(true)
|
|
22888
|
+
});
|
|
22889
|
+
var webhookEndpointUpdateSchema = external_exports.object({
|
|
22890
|
+
url: webhookUrlSchema.optional(),
|
|
22891
|
+
description: webhookDescriptionSchema.optional(),
|
|
22892
|
+
events: webhookEventsSchema.optional(),
|
|
22893
|
+
filters: webhookFiltersSchema.optional(),
|
|
22894
|
+
enabled: external_exports.boolean().optional()
|
|
22895
|
+
}).refine((b) => Object.values(b).some((v) => v !== void 0), { error: "nothing to change" });
|
|
22896
|
+
var webhooksListSchema = external_exports.object({
|
|
22897
|
+
webhooks: external_exports.array(webhookEndpointSchema),
|
|
22898
|
+
nextCursor: external_exports.string().nullable()
|
|
22899
|
+
});
|
|
22900
|
+
var webhookDeliverySchema = external_exports.object({
|
|
22901
|
+
id: external_exports.string(),
|
|
22902
|
+
endpointId: external_exports.string(),
|
|
22903
|
+
eventId: external_exports.string(),
|
|
22904
|
+
eventType: external_exports.string(),
|
|
22905
|
+
status: webhookDeliveryStatusSchema,
|
|
22906
|
+
attempt: external_exports.number().int(),
|
|
22907
|
+
lastStatusCode: external_exports.number().int().nullable(),
|
|
22908
|
+
lastError: external_exports.string().nullable(),
|
|
22909
|
+
nextAttemptAt: external_exports.string().nullable(),
|
|
22910
|
+
deliveredAt: external_exports.string().nullable(),
|
|
22911
|
+
createdAt: external_exports.string(),
|
|
22912
|
+
updatedAt: external_exports.string(),
|
|
22913
|
+
payload: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
22914
|
+
});
|
|
22915
|
+
var webhookDeliveriesListSchema = external_exports.object({
|
|
22916
|
+
deliveries: external_exports.array(webhookDeliverySchema),
|
|
22917
|
+
nextCursor: external_exports.string().nullable()
|
|
22918
|
+
});
|
|
22919
|
+
var webhookDeliveriesListQuerySchema = cursorPageQuerySchema.extend({
|
|
22920
|
+
status: webhookDeliveryStatusSchema.optional()
|
|
22921
|
+
});
|
|
22922
|
+
var webhookTestResultSchema = external_exports.object({
|
|
22923
|
+
delivery: webhookDeliverySchema
|
|
22924
|
+
});
|
|
22925
|
+
var webhookCatalogSubjectSchema = external_exports.object({
|
|
22926
|
+
key: external_exports.string(),
|
|
22927
|
+
field: external_exports.string(),
|
|
22928
|
+
description: external_exports.string(),
|
|
22929
|
+
/** The value under `field` is always a list of ids (`projectIds`); else always one id. */
|
|
22930
|
+
list: external_exports.boolean()
|
|
22931
|
+
});
|
|
22932
|
+
var webhookCatalogEventSchema = external_exports.object({
|
|
22933
|
+
type: external_exports.string(),
|
|
22934
|
+
description: external_exports.string(),
|
|
22935
|
+
/** The subject keys this event carries (what a filter can match it on). */
|
|
22936
|
+
subjects: external_exports.array(external_exports.string()),
|
|
22937
|
+
/** The JSON Schema of the event's `data`. */
|
|
22938
|
+
schema: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
22939
|
+
});
|
|
22940
|
+
var webhookCatalogSchema = external_exports.object({
|
|
22941
|
+
subjects: external_exports.array(webhookCatalogSubjectSchema),
|
|
22942
|
+
events: external_exports.array(webhookCatalogEventSchema)
|
|
22943
|
+
});
|
|
22944
|
+
var webhookParamsSchema = external_exports.object({ id: external_exports.uuid() });
|
|
22945
|
+
var webhookDeliveryParamsSchema = webhookParamsSchema.extend({ deliveryId: external_exports.uuid() });
|
|
22946
|
+
|
|
22947
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/demo-passes.js
|
|
22484
22948
|
var DEMO_PASS_MAX_MINUTES2 = 10080;
|
|
22485
22949
|
var demoPassSchema2 = external_exports.object({
|
|
22486
22950
|
id: external_exports.string(),
|
|
@@ -22521,7 +22985,7 @@ var demoPassRedeemedSchema2 = external_exports.object({
|
|
|
22521
22985
|
expiresAt: external_exports.string()
|
|
22522
22986
|
});
|
|
22523
22987
|
|
|
22524
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22988
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/api-keys.js
|
|
22525
22989
|
function defineApiKeySchemas(scopeSchema3) {
|
|
22526
22990
|
const apiKeySchema3 = external_exports.object({
|
|
22527
22991
|
id: external_exports.string(),
|
|
@@ -22566,7 +23030,7 @@ function defineApiKeySchemas(scopeSchema3) {
|
|
|
22566
23030
|
return { apiKeySchema: apiKeySchema3, apiKeysListSchema: apiKeysListSchema3, apiKeyCreateSchema: apiKeyCreateSchema3, apiKeyCreatedSchema: apiKeyCreatedSchema3 };
|
|
22567
23031
|
}
|
|
22568
23032
|
|
|
22569
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
23033
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/define.js
|
|
22570
23034
|
function defineChassisContract(tool) {
|
|
22571
23035
|
return buildChassisContract(defineScopeSchema(tool.scopes));
|
|
22572
23036
|
}
|
|
@@ -22580,7 +23044,7 @@ function buildChassisContract(scopeSchema3) {
|
|
|
22580
23044
|
};
|
|
22581
23045
|
}
|
|
22582
23046
|
|
|
22583
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23047
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/owner-session.js
|
|
22584
23048
|
var SIGN_IN_WAITS_MS = [4e3, 8e3, 12e3];
|
|
22585
23049
|
var SESSION_COOKIE = /session_token$/;
|
|
22586
23050
|
function sessionCookie(res) {
|
|
@@ -22661,7 +23125,7 @@ async function withOwnerSession(ctx, options, run2) {
|
|
|
22661
23125
|
}
|
|
22662
23126
|
}
|
|
22663
23127
|
|
|
22664
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23128
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/demo.js
|
|
22665
23129
|
var SWITCH_OFF = "Demo sign-in is off on this instance (DEMO_SIGN_IN), or this is the cloud edition, where demo links are minted at the Antasphere hub.";
|
|
22666
23130
|
var NOT_AN_OWNER = "Only an owner of this workspace manages demo links: the account that signed in is not one.";
|
|
22667
23131
|
var REFUSALS = /* @__PURE__ */ new Set([
|
|
@@ -22683,7 +23147,7 @@ var MemberRefusal = class extends CliApiRefusal {
|
|
|
22683
23147
|
this.code = code;
|
|
22684
23148
|
}
|
|
22685
23149
|
};
|
|
22686
|
-
async function
|
|
23150
|
+
async function explained3(run2) {
|
|
22687
23151
|
try {
|
|
22688
23152
|
return await run2();
|
|
22689
23153
|
} catch (e) {
|
|
@@ -22728,7 +23192,7 @@ function lifetimeMinutes(opts) {
|
|
|
22728
23192
|
function demoLink(baseUrl, secret, path) {
|
|
22729
23193
|
return `${baseUrl.replace(/\/+$/, "")}/demo#pass=${secret}&to=${encodeURIComponent(path)}`;
|
|
22730
23194
|
}
|
|
22731
|
-
var
|
|
23195
|
+
var collect2 = (value, previous) => [...previous, value];
|
|
22732
23196
|
function registerDemoCommands(kit, program2, io) {
|
|
22733
23197
|
const { identity, resolveContext: resolveContext2 } = kit;
|
|
22734
23198
|
const prefix = identity.envPrefix;
|
|
@@ -22739,7 +23203,7 @@ function registerDemoCommands(kit, program2, io) {
|
|
|
22739
23203
|
...opts.ownerEmail !== void 0 ? { ownerEmail: opts.ownerEmail } : {},
|
|
22740
23204
|
ownerPasswordStdin: opts.ownerPasswordStdin
|
|
22741
23205
|
});
|
|
22742
|
-
ownerFlags(demo.command("link").description("Mint one demo pass per member and print one link per page").requiredOption("--email <address>", "a member the links sign in (repeatable: one sign-in, one pass per member)",
|
|
23206
|
+
ownerFlags(demo.command("link").description("Mint one demo pass per member and print one link per page").requiredOption("--email <address>", "a member the links sign in (repeatable: one sign-in, one pass per member)", collect2, []).option("--path <p>", "a page the link lands on (repeatable; the first is the default, /)", collect2, []).option("--hours <n>", "how long the link lives, in hours (default: a day; at most a week)").option("--minutes <n>", "how long the link lives, in minutes (instead of --hours)")).action(async (opts, cmd) => {
|
|
22743
23207
|
const paths = opts.path.length > 0 ? opts.path : ["/"];
|
|
22744
23208
|
for (const path of paths) {
|
|
22745
23209
|
if (!isSafeDemoPath(path)) {
|
|
@@ -22753,7 +23217,7 @@ function registerDemoCommands(kit, program2, io) {
|
|
|
22753
23217
|
const refused2 = [];
|
|
22754
23218
|
for (const email3 of opts.email) {
|
|
22755
23219
|
try {
|
|
22756
|
-
const minted = await
|
|
23220
|
+
const minted = await explained3(() => client.mintDemoPass({
|
|
22757
23221
|
email: email3,
|
|
22758
23222
|
path: paths[0],
|
|
22759
23223
|
...expiresInMinutes !== void 0 ? { expiresInMinutes } : {}
|
|
@@ -22785,7 +23249,7 @@ function registerDemoCommands(kit, program2, io) {
|
|
|
22785
23249
|
});
|
|
22786
23250
|
ownerFlags(demo.command("list").description("List the demo passes of the workspace (newest first)")).action(async (opts, cmd) => {
|
|
22787
23251
|
const ctx = resolveContext2(cmd, io);
|
|
22788
|
-
const { passes } = await withOwnerSession(ctx, session(opts), (client) =>
|
|
23252
|
+
const { passes } = await withOwnerSession(ctx, session(opts), (client) => explained3(() => client.demoPasses()));
|
|
22789
23253
|
if (ctx.json)
|
|
22790
23254
|
return printJson2(io, { passes });
|
|
22791
23255
|
if (passes.length === 0) {
|
|
@@ -22805,9 +23269,9 @@ function registerDemoCommands(kit, program2, io) {
|
|
|
22805
23269
|
])
|
|
22806
23270
|
]));
|
|
22807
23271
|
});
|
|
22808
|
-
ownerFlags(demo.command("revoke <id>").description("Revoke a demo pass; the sessions it opened end with it")).action(async (
|
|
23272
|
+
ownerFlags(demo.command("revoke <id>").description("Revoke a demo pass; the sessions it opened end with it")).action(async (id2, opts, cmd) => {
|
|
22809
23273
|
const ctx = resolveContext2(cmd, io);
|
|
22810
|
-
const pass = await withOwnerSession(ctx, session(opts), (client) =>
|
|
23274
|
+
const pass = await withOwnerSession(ctx, session(opts), (client) => explained3(() => client.revokeDemoPass(id2)));
|
|
22811
23275
|
if (ctx.json)
|
|
22812
23276
|
return printJson2(io, pass);
|
|
22813
23277
|
io.out.write(`Revoked the demo pass ${pass.id} for ${pass.email}. The sessions it opened are signed out.
|
|
@@ -22815,14 +23279,14 @@ function registerDemoCommands(kit, program2, io) {
|
|
|
22815
23279
|
});
|
|
22816
23280
|
}
|
|
22817
23281
|
|
|
22818
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23282
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/files.js
|
|
22819
23283
|
import { createWriteStream } from "node:fs";
|
|
22820
23284
|
import { mkdir as mkdir2, readFile, writeFile } from "node:fs/promises";
|
|
22821
23285
|
import { basename, resolve as resolve2, win32 } from "node:path";
|
|
22822
23286
|
import { Readable } from "node:stream";
|
|
22823
23287
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
22824
23288
|
|
|
22825
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23289
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/safe-write.js
|
|
22826
23290
|
import { constants as FS } from "node:fs";
|
|
22827
23291
|
import { mkdir, open, realpath, unlink } from "node:fs/promises";
|
|
22828
23292
|
import { dirname as dirname2, isAbsolute, relative, resolve } from "node:path";
|
|
@@ -22903,7 +23367,7 @@ async function streamContained(root, relPath, source) {
|
|
|
22903
23367
|
}
|
|
22904
23368
|
}
|
|
22905
23369
|
|
|
22906
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23370
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/files.js
|
|
22907
23371
|
function safeDownloadName(originalName) {
|
|
22908
23372
|
const name = basename(win32.basename(originalName));
|
|
22909
23373
|
if (name === "" || name === "." || name === ".." || name.startsWith(".")) {
|
|
@@ -22984,15 +23448,15 @@ function registerFileCommands(kit, program2, io) {
|
|
|
22984
23448
|
id: ${result.file.id}
|
|
22985
23449
|
`);
|
|
22986
23450
|
});
|
|
22987
|
-
files.command("download <id>").description("Download a file by id").option("--out <path>", "write to this exact path (your path, used verbatim)").option("--dir <path>", "directory to write the stored name into (default: .)").action(async (
|
|
23451
|
+
files.command("download <id>").description("Download a file by id").option("--out <path>", "write to this exact path (your path, used verbatim)").option("--dir <path>", "directory to write the stored name into (default: .)").action(async (id2, opts, cmd) => {
|
|
22988
23452
|
const ctx = resolveContext2(cmd, io);
|
|
22989
23453
|
const apiKey = await requireApiKey2(ctx);
|
|
22990
23454
|
if (opts.out && opts.dir) {
|
|
22991
23455
|
throw new CliUsageError("Pass either --out <path> or --dir <path>, not both.");
|
|
22992
23456
|
}
|
|
22993
|
-
const meta3 = await ctx.client.file(
|
|
23457
|
+
const meta3 = await ctx.client.file(id2);
|
|
22994
23458
|
const fetchImpl = io.fetch ?? globalThis.fetch.bind(globalThis);
|
|
22995
|
-
const res = await fetchImpl(ctx.client.fileContentUrl(
|
|
23459
|
+
const res = await fetchImpl(ctx.client.fileContentUrl(id2), {
|
|
22996
23460
|
// This one bypasses the SDK, so it carries the SDK's headers itself:
|
|
22997
23461
|
// the key, and the selected workspace (a download follows it too).
|
|
22998
23462
|
headers: {
|
|
@@ -23019,18 +23483,18 @@ function registerFileCommands(kit, program2, io) {
|
|
|
23019
23483
|
io.out.write(`Downloaded ${meta3.originalName} \u2192 ${out} (${fmtBytes(buf.length)})
|
|
23020
23484
|
`);
|
|
23021
23485
|
});
|
|
23022
|
-
files.command("rm <id>").description("Delete a file by id").action(async (
|
|
23486
|
+
files.command("rm <id>").description("Delete a file by id").action(async (id2, _opts, cmd) => {
|
|
23023
23487
|
const ctx = resolveContext2(cmd, io);
|
|
23024
23488
|
await requireApiKey2(ctx);
|
|
23025
|
-
await ctx.client.deleteFile(
|
|
23489
|
+
await ctx.client.deleteFile(id2);
|
|
23026
23490
|
if (ctx.json)
|
|
23027
|
-
return printJson2(io, { deleted:
|
|
23028
|
-
io.out.write(`Deleted ${
|
|
23491
|
+
return printJson2(io, { deleted: id2 });
|
|
23492
|
+
io.out.write(`Deleted ${id2}
|
|
23029
23493
|
`);
|
|
23030
23494
|
});
|
|
23031
23495
|
}
|
|
23032
23496
|
|
|
23033
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23497
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/completion.js
|
|
23034
23498
|
function commandTree(program2) {
|
|
23035
23499
|
return program2.commands.filter((c) => !c.name().startsWith("help")).map((c) => ({
|
|
23036
23500
|
name: c.name(),
|
|
@@ -23105,7 +23569,7 @@ function registerCompletionCommand(identity, program2, io) {
|
|
|
23105
23569
|
});
|
|
23106
23570
|
}
|
|
23107
23571
|
|
|
23108
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23572
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/program.js
|
|
23109
23573
|
function creditFigures(credit) {
|
|
23110
23574
|
const parts = [
|
|
23111
23575
|
typeof credit?.credits === "number" ? `this needs ${credit.credits} credits` : null,
|
|
@@ -23123,6 +23587,7 @@ function createProgram(kit, definition) {
|
|
|
23123
23587
|
registerWorkspaceCommands(kit, program2, io);
|
|
23124
23588
|
registerProjectCommands(kit, program2, io);
|
|
23125
23589
|
registerTeamCommands(kit, program2, io);
|
|
23590
|
+
registerWebhookCommands(kit, program2, io);
|
|
23126
23591
|
registerDemoCommands(kit, program2, io);
|
|
23127
23592
|
registerTool2(program2, io);
|
|
23128
23593
|
registerFileCommands(kit, program2, io);
|
|
@@ -23159,9 +23624,9 @@ function createProgram(kit, definition) {
|
|
|
23159
23624
|
return e.exitCode;
|
|
23160
23625
|
}
|
|
23161
23626
|
if (e instanceof PlatformApiError || e instanceof CliAuthError) {
|
|
23162
|
-
const
|
|
23163
|
-
if (
|
|
23164
|
-
io.err.write(`Error: ${
|
|
23627
|
+
const explained4 = await explainWorkspaceRefusal(io, e);
|
|
23628
|
+
if (explained4) {
|
|
23629
|
+
io.err.write(`Error: ${explained4}
|
|
23165
23630
|
`);
|
|
23166
23631
|
return 1;
|
|
23167
23632
|
}
|
|
@@ -23187,7 +23652,7 @@ function createProgram(kit, definition) {
|
|
|
23187
23652
|
return { buildProgram, run: run2 };
|
|
23188
23653
|
}
|
|
23189
23654
|
|
|
23190
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23655
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/open.js
|
|
23191
23656
|
import { spawn } from "node:child_process";
|
|
23192
23657
|
function platformOpener(platform = process.platform) {
|
|
23193
23658
|
if (platform === "darwin")
|
|
@@ -23213,7 +23678,7 @@ function isInteractive(io) {
|
|
|
23213
23678
|
return io.out.isTTY === true;
|
|
23214
23679
|
}
|
|
23215
23680
|
|
|
23216
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23681
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.3.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/index.js
|
|
23217
23682
|
function defineCli(definition) {
|
|
23218
23683
|
const { identity, createClient } = definition;
|
|
23219
23684
|
const config2 = createConfig(identity);
|
|
@@ -23231,9 +23696,11 @@ var IDENTITY = {
|
|
|
23231
23696
|
scopes: {
|
|
23232
23697
|
read: "presentations:read",
|
|
23233
23698
|
write: "presentations:write",
|
|
23234
|
-
dataExport: "data:export"
|
|
23699
|
+
dataExport: "data:export",
|
|
23700
|
+
// Managing the workspace's webhook endpoints (PRDCT-3482): on the CLI key like read and write (Romain, 13 October 2026).
|
|
23701
|
+
webhooks: "webhooks:manage"
|
|
23235
23702
|
},
|
|
23236
|
-
cliKeyScopesLabel: "presentations:read+write",
|
|
23703
|
+
cliKeyScopesLabel: "presentations:read+write, webhooks:manage",
|
|
23237
23704
|
cloud: { url: "https://slideless.antasphere.com" },
|
|
23238
23705
|
cli: {
|
|
23239
23706
|
bin: "slideless",
|
|
@@ -23250,7 +23717,9 @@ var IDENTITY = {
|
|
|
23250
23717
|
|
|
23251
23718
|
// ../contract/dist/chassis.js
|
|
23252
23719
|
var { read, write, dataExport } = IDENTITY.scopes;
|
|
23253
|
-
var chassisContract = defineChassisContract({
|
|
23720
|
+
var chassisContract = defineChassisContract({
|
|
23721
|
+
scopes: [read, write, dataExport, IDENTITY.scopes.webhooks]
|
|
23722
|
+
});
|
|
23254
23723
|
var scopeSchema2 = chassisContract.scopeSchema;
|
|
23255
23724
|
var apiKeySchema2 = chassisContract.apiKeySchema;
|
|
23256
23725
|
var apiKeysListSchema2 = chassisContract.apiKeysListSchema;
|
|
@@ -23985,6 +24454,223 @@ var appsListSchema = external_exports.object({
|
|
|
23985
24454
|
source: external_exports.enum(APP_SOURCES)
|
|
23986
24455
|
});
|
|
23987
24456
|
|
|
24457
|
+
// ../contract/dist/schemas/webhooks.js
|
|
24458
|
+
var id = external_exports.string();
|
|
24459
|
+
var isoDate = external_exports.string();
|
|
24460
|
+
var shareLinkFacts = external_exports.object({
|
|
24461
|
+
deckId: id,
|
|
24462
|
+
linkId: id,
|
|
24463
|
+
name: external_exports.string(),
|
|
24464
|
+
purpose: external_exports.string(),
|
|
24465
|
+
pinnedVersion: external_exports.number().int().nullable(),
|
|
24466
|
+
expiresAt: isoDate.nullable(),
|
|
24467
|
+
hasPassword: external_exports.boolean()
|
|
24468
|
+
});
|
|
24469
|
+
var formResponseFacts = external_exports.object({
|
|
24470
|
+
deckId: id,
|
|
24471
|
+
formName: external_exports.string(),
|
|
24472
|
+
responseId: id,
|
|
24473
|
+
revision: external_exports.number().int(),
|
|
24474
|
+
linkId: id.nullable(),
|
|
24475
|
+
version: external_exports.number().int(),
|
|
24476
|
+
source: external_exports.string(),
|
|
24477
|
+
placement: external_exports.string().nullable(),
|
|
24478
|
+
/** The answers as submitted, by field name: a text, or a list for a multiple choice. */
|
|
24479
|
+
answers: external_exports.record(external_exports.string(), external_exports.union([external_exports.string(), external_exports.array(external_exports.string())])),
|
|
24480
|
+
files: external_exports.array(external_exports.object({ id, name: external_exports.string(), sizeBytes: external_exports.number().int() }))
|
|
24481
|
+
});
|
|
24482
|
+
var collaboratorFacts = external_exports.object({
|
|
24483
|
+
deckId: id,
|
|
24484
|
+
collaboratorId: id,
|
|
24485
|
+
email: external_exports.string(),
|
|
24486
|
+
userId: id.nullable()
|
|
24487
|
+
});
|
|
24488
|
+
var annotationFacts = external_exports.object({
|
|
24489
|
+
deckId: id,
|
|
24490
|
+
version: external_exports.number().int(),
|
|
24491
|
+
annotationId: id,
|
|
24492
|
+
linkId: id.nullable(),
|
|
24493
|
+
authorName: external_exports.string().nullable()
|
|
24494
|
+
});
|
|
24495
|
+
var thumbnailFacts = external_exports.object({ deckId: id, versionId: id, version: external_exports.number().int() });
|
|
24496
|
+
var DECK_WEBHOOK_EVENTS = [
|
|
24497
|
+
{
|
|
24498
|
+
type: "deck.created",
|
|
24499
|
+
description: "A deck was created: its first version was pushed, or a deck was duplicated.",
|
|
24500
|
+
subjects: ["deck", "project"],
|
|
24501
|
+
data: external_exports.object({
|
|
24502
|
+
deckId: id,
|
|
24503
|
+
title: external_exports.string(),
|
|
24504
|
+
version: external_exports.number().int(),
|
|
24505
|
+
projectIds: external_exports.array(id),
|
|
24506
|
+
ownerUserId: id,
|
|
24507
|
+
remixedFrom: id.nullable()
|
|
24508
|
+
})
|
|
24509
|
+
},
|
|
24510
|
+
{
|
|
24511
|
+
type: "deck.version_committed",
|
|
24512
|
+
description: "A new version of a deck was pushed.",
|
|
24513
|
+
subjects: ["deck", "project"],
|
|
24514
|
+
data: external_exports.object({
|
|
24515
|
+
deckId: id,
|
|
24516
|
+
version: external_exports.number().int(),
|
|
24517
|
+
title: external_exports.string(),
|
|
24518
|
+
authorUserId: id,
|
|
24519
|
+
authorRole: external_exports.string()
|
|
24520
|
+
})
|
|
24521
|
+
},
|
|
24522
|
+
{
|
|
24523
|
+
type: "deck.updated",
|
|
24524
|
+
description: "A deck\u2019s settings changed (its title, its description, its form notifications\u2026); `fields` names what.",
|
|
24525
|
+
subjects: ["deck", "project"],
|
|
24526
|
+
data: external_exports.object({ deckId: id, fields: external_exports.array(external_exports.string()) })
|
|
24527
|
+
},
|
|
24528
|
+
{
|
|
24529
|
+
type: "deck.deleted",
|
|
24530
|
+
description: "A deck was deleted.",
|
|
24531
|
+
subjects: ["deck", "project"],
|
|
24532
|
+
data: external_exports.object({ deckId: id, title: external_exports.string() })
|
|
24533
|
+
},
|
|
24534
|
+
{
|
|
24535
|
+
type: "deck.project_linked",
|
|
24536
|
+
description: "A deck was put in a project (at creation, or later).",
|
|
24537
|
+
subjects: ["deck", "project"],
|
|
24538
|
+
data: external_exports.object({ deckId: id, projectId: id })
|
|
24539
|
+
},
|
|
24540
|
+
{
|
|
24541
|
+
type: "deck.project_unlinked",
|
|
24542
|
+
description: "A deck was taken out of a project.",
|
|
24543
|
+
subjects: ["deck", "project"],
|
|
24544
|
+
data: external_exports.object({ deckId: id, projectId: id })
|
|
24545
|
+
},
|
|
24546
|
+
{
|
|
24547
|
+
type: "share_link.created",
|
|
24548
|
+
description: "A share link was made for a deck (preview links never emit).",
|
|
24549
|
+
subjects: ["deck", "project", "link"],
|
|
24550
|
+
data: shareLinkFacts
|
|
24551
|
+
},
|
|
24552
|
+
{
|
|
24553
|
+
type: "share_link.updated",
|
|
24554
|
+
description: "A share link changed; `changed` names the fields.",
|
|
24555
|
+
subjects: ["deck", "project", "link"],
|
|
24556
|
+
data: shareLinkFacts.extend({ changed: external_exports.array(external_exports.string()) })
|
|
24557
|
+
},
|
|
24558
|
+
{
|
|
24559
|
+
type: "share_link.revoked",
|
|
24560
|
+
description: "A share link was revoked.",
|
|
24561
|
+
subjects: ["deck", "project", "link"],
|
|
24562
|
+
data: shareLinkFacts
|
|
24563
|
+
},
|
|
24564
|
+
{
|
|
24565
|
+
type: "share_link.sent",
|
|
24566
|
+
description: "A share link was sent by mail from the dashboard.",
|
|
24567
|
+
subjects: ["deck", "project", "link"],
|
|
24568
|
+
data: shareLinkFacts.extend({ recipient: external_exports.string() })
|
|
24569
|
+
},
|
|
24570
|
+
{
|
|
24571
|
+
type: "share_link.viewed",
|
|
24572
|
+
description: "A share link was opened. Grouped per link: the first view is sent at once, then at most one event per link per five minutes carrying the count and the facts of the views since the last one. No address, no identity.",
|
|
24573
|
+
subjects: ["deck", "project", "link"],
|
|
24574
|
+
data: external_exports.object({
|
|
24575
|
+
deckId: id,
|
|
24576
|
+
linkId: id,
|
|
24577
|
+
version: external_exports.number().int().nullable(),
|
|
24578
|
+
views: external_exports.number().int(),
|
|
24579
|
+
firstViewAt: isoDate,
|
|
24580
|
+
lastViewAt: isoDate,
|
|
24581
|
+
referrerHosts: external_exports.array(external_exports.string()),
|
|
24582
|
+
placements: external_exports.array(external_exports.string()),
|
|
24583
|
+
browserFamilies: external_exports.array(external_exports.string())
|
|
24584
|
+
})
|
|
24585
|
+
},
|
|
24586
|
+
{
|
|
24587
|
+
type: "attachment.downloaded",
|
|
24588
|
+
description: "An attachment of a deck was downloaded through a share link (`name` null for the whole bundle).",
|
|
24589
|
+
subjects: ["deck", "project", "link"],
|
|
24590
|
+
data: external_exports.object({ deckId: id, linkId: id, version: external_exports.number().int(), name: external_exports.string().nullable() })
|
|
24591
|
+
},
|
|
24592
|
+
{
|
|
24593
|
+
type: "form.response_submitted",
|
|
24594
|
+
description: "A form inside a deck received a response; `answers` carries it.",
|
|
24595
|
+
subjects: ["deck", "project", "link"],
|
|
24596
|
+
data: formResponseFacts
|
|
24597
|
+
},
|
|
24598
|
+
{
|
|
24599
|
+
type: "form.response_edited",
|
|
24600
|
+
description: "A respondent edited their response through their edit link; `answers` is the new revision.",
|
|
24601
|
+
subjects: ["deck", "project", "link"],
|
|
24602
|
+
data: formResponseFacts
|
|
24603
|
+
},
|
|
24604
|
+
{
|
|
24605
|
+
type: "form.file_uploaded",
|
|
24606
|
+
description: "A respondent dropped a file into a form field (before the response is submitted).",
|
|
24607
|
+
subjects: ["deck", "project", "link"],
|
|
24608
|
+
data: external_exports.object({
|
|
24609
|
+
deckId: id,
|
|
24610
|
+
formName: external_exports.string(),
|
|
24611
|
+
linkId: id,
|
|
24612
|
+
uploadId: id,
|
|
24613
|
+
name: external_exports.string(),
|
|
24614
|
+
sizeBytes: external_exports.number().int()
|
|
24615
|
+
})
|
|
24616
|
+
},
|
|
24617
|
+
{
|
|
24618
|
+
type: "form.response_deleted",
|
|
24619
|
+
description: "A form response was deleted from the dashboard.",
|
|
24620
|
+
subjects: ["deck", "project"],
|
|
24621
|
+
data: external_exports.object({ deckId: id, responseId: id })
|
|
24622
|
+
},
|
|
24623
|
+
{
|
|
24624
|
+
type: "collaborator.invited",
|
|
24625
|
+
description: "Someone was invited to work on a deck.",
|
|
24626
|
+
subjects: ["deck", "project"],
|
|
24627
|
+
data: collaboratorFacts
|
|
24628
|
+
},
|
|
24629
|
+
{
|
|
24630
|
+
type: "collaborator.revoked",
|
|
24631
|
+
description: "A collaborator\u2019s grant on a deck was revoked (by hand, or with a member\u2019s removal).",
|
|
24632
|
+
subjects: ["deck", "project"],
|
|
24633
|
+
data: collaboratorFacts
|
|
24634
|
+
},
|
|
24635
|
+
{
|
|
24636
|
+
type: "collaborator.claimed",
|
|
24637
|
+
description: "An invited collaborator claimed their grant on a deck.",
|
|
24638
|
+
subjects: ["deck", "project"],
|
|
24639
|
+
data: collaboratorFacts
|
|
24640
|
+
},
|
|
24641
|
+
{
|
|
24642
|
+
type: "annotation.created",
|
|
24643
|
+
description: "An annotation was left on a deck version, by a viewer through a share link or by a member.",
|
|
24644
|
+
subjects: ["deck", "project", "link"],
|
|
24645
|
+
data: annotationFacts
|
|
24646
|
+
},
|
|
24647
|
+
{
|
|
24648
|
+
type: "annotation.resolved",
|
|
24649
|
+
description: "An annotation was marked resolved.",
|
|
24650
|
+
subjects: ["deck", "project"],
|
|
24651
|
+
data: annotationFacts
|
|
24652
|
+
},
|
|
24653
|
+
{
|
|
24654
|
+
type: "annotation.deleted",
|
|
24655
|
+
description: "An annotation was deleted.",
|
|
24656
|
+
subjects: ["deck", "project"],
|
|
24657
|
+
data: annotationFacts
|
|
24658
|
+
},
|
|
24659
|
+
{
|
|
24660
|
+
type: "thumbnail.rendered",
|
|
24661
|
+
description: "The still image of a deck version is ready.",
|
|
24662
|
+
subjects: ["deck", "project"],
|
|
24663
|
+
data: thumbnailFacts
|
|
24664
|
+
},
|
|
24665
|
+
{
|
|
24666
|
+
type: "thumbnail.failed",
|
|
24667
|
+
description: "The still image of a deck version could not be made.",
|
|
24668
|
+
subjects: ["deck", "project"],
|
|
24669
|
+
data: thumbnailFacts
|
|
24670
|
+
}
|
|
24671
|
+
];
|
|
24672
|
+
var DECK_WEBHOOK_EVENT_TYPES = DECK_WEBHOOK_EVENTS.map((e) => e.type);
|
|
24673
|
+
|
|
23988
24674
|
// ../contract/dist/embed.js
|
|
23989
24675
|
var EMBED_PLACEMENT_RE = /^[A-Za-z0-9._-]{1,64}$/;
|
|
23990
24676
|
function buildEmbedSnippets(opts) {
|
|
@@ -24050,8 +24736,8 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24050
24736
|
const { presentations } = await this.presentations({ type, default: true, limit: 1 });
|
|
24051
24737
|
return presentations[0] ?? null;
|
|
24052
24738
|
}
|
|
24053
|
-
presentation(
|
|
24054
|
-
return this.request("GET", `/presentations/${encodeURIComponent(
|
|
24739
|
+
presentation(id2) {
|
|
24740
|
+
return this.request("GET", `/presentations/${encodeURIComponent(id2)}`);
|
|
24055
24741
|
}
|
|
24056
24742
|
/**
|
|
24057
24743
|
* Update mutable deck properties. `metadata` replaces the stored object
|
|
@@ -24063,12 +24749,12 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24063
24749
|
* made private, 403 `forbidden` when the caller reads the deck but may not
|
|
24064
24750
|
* change that property.
|
|
24065
24751
|
*/
|
|
24066
|
-
updatePresentation(
|
|
24067
|
-
return this.request("PATCH", `/presentations/${encodeURIComponent(
|
|
24752
|
+
updatePresentation(id2, patch) {
|
|
24753
|
+
return this.request("PATCH", `/presentations/${encodeURIComponent(id2)}`, patch);
|
|
24068
24754
|
}
|
|
24069
24755
|
/** Soft delete: versions and share tokens stop resolving. */
|
|
24070
|
-
deletePresentation(
|
|
24071
|
-
return this.request("DELETE", `/presentations/${encodeURIComponent(
|
|
24756
|
+
deletePresentation(id2) {
|
|
24757
|
+
return this.request("DELETE", `/presentations/${encodeURIComponent(id2)}`);
|
|
24072
24758
|
}
|
|
24073
24759
|
/**
|
|
24074
24760
|
* Duplicate a deck (PRDCT-2279): a new deck in the same workspace whose
|
|
@@ -24076,8 +24762,8 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24076
24762
|
* re-uploaded. `version` picks the source version (current when omitted),
|
|
24077
24763
|
* `title` names the copy. Idempotency-Key aware like the other creates.
|
|
24078
24764
|
*/
|
|
24079
|
-
duplicatePresentation(
|
|
24080
|
-
return this.request("POST", `/presentations/${encodeURIComponent(
|
|
24765
|
+
duplicatePresentation(id2, req = {}, opts = {}) {
|
|
24766
|
+
return this.request("POST", `/presentations/${encodeURIComponent(id2)}/duplicate`, req, idempotencyHeader(opts));
|
|
24081
24767
|
}
|
|
24082
24768
|
// ── Projects (ADR 026) ────────────────────────────────────────────────────
|
|
24083
24769
|
// The chassis client carries the projects themselves (`projects()`,
|
|
@@ -24086,12 +24772,12 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24086
24772
|
* Link a deck to a project: the project's members read it from then on.
|
|
24087
24773
|
* The deck administrator's act, with editor or more on the project.
|
|
24088
24774
|
*/
|
|
24089
|
-
linkPresentationProject(
|
|
24090
|
-
return this.request("PUT", `/presentations/${encodeURIComponent(
|
|
24775
|
+
linkPresentationProject(id2, projectId) {
|
|
24776
|
+
return this.request("PUT", `/presentations/${encodeURIComponent(id2)}/projects/${encodeURIComponent(projectId)}`);
|
|
24091
24777
|
}
|
|
24092
24778
|
/** Take a deck out of a project (the deck administrator, or a project manager). */
|
|
24093
|
-
unlinkPresentationProject(
|
|
24094
|
-
return this.request("DELETE", `/presentations/${encodeURIComponent(
|
|
24779
|
+
unlinkPresentationProject(id2, projectId) {
|
|
24780
|
+
return this.request("DELETE", `/presentations/${encodeURIComponent(id2)}/projects/${encodeURIComponent(projectId)}`);
|
|
24095
24781
|
}
|
|
24096
24782
|
/** The project's brand: the brand reference its decks are authored with, or null. */
|
|
24097
24783
|
projectBrand(projectId) {
|
|
@@ -24139,28 +24825,28 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24139
24825
|
* Commit a new immutable version. `expectedBaseVersion` must equal the
|
|
24140
24826
|
* deck's currentVersion or the server answers 409 version_conflict.
|
|
24141
24827
|
*/
|
|
24142
|
-
commitVersion(
|
|
24143
|
-
return this.request("POST", `/presentations/${encodeURIComponent(
|
|
24828
|
+
commitVersion(id2, req) {
|
|
24829
|
+
return this.request("POST", `/presentations/${encodeURIComponent(id2)}/versions`, req);
|
|
24144
24830
|
}
|
|
24145
24831
|
// ── Pull ──────────────────────────────────────────────────────────────────
|
|
24146
|
-
presentationVersions(
|
|
24147
|
-
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(
|
|
24832
|
+
presentationVersions(id2, params = {}) {
|
|
24833
|
+
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(id2)}/versions`, params));
|
|
24148
24834
|
}
|
|
24149
24835
|
/** One version including its full manifest (path → sha256). */
|
|
24150
|
-
presentationVersion(
|
|
24151
|
-
return this.request("GET", `/presentations/${encodeURIComponent(
|
|
24836
|
+
presentationVersion(id2, version2) {
|
|
24837
|
+
return this.request("GET", `/presentations/${encodeURIComponent(id2)}/versions/${version2}`);
|
|
24152
24838
|
}
|
|
24153
24839
|
/** URL of the streamed asset download endpoint (content-addressed). */
|
|
24154
|
-
presentationAssetUrl(
|
|
24155
|
-
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
24840
|
+
presentationAssetUrl(id2, sha256) {
|
|
24841
|
+
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/assets/${encodeURIComponent(sha256)}`;
|
|
24156
24842
|
}
|
|
24157
24843
|
/**
|
|
24158
24844
|
* Downloads one deck blob. Returns the raw Response so callers can stream
|
|
24159
24845
|
* the bytes; a non-2xx answer throws PlatformApiError like every method.
|
|
24160
24846
|
*/
|
|
24161
|
-
async downloadPresentationAsset(
|
|
24847
|
+
async downloadPresentationAsset(id2, sha256) {
|
|
24162
24848
|
const headers = this.baseHeaders();
|
|
24163
|
-
const res = await this.fetchImpl(this.presentationAssetUrl(
|
|
24849
|
+
const res = await this.fetchImpl(this.presentationAssetUrl(id2, sha256), {
|
|
24164
24850
|
method: "GET",
|
|
24165
24851
|
headers,
|
|
24166
24852
|
credentials: "same-origin",
|
|
@@ -24174,8 +24860,8 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24174
24860
|
return res;
|
|
24175
24861
|
}
|
|
24176
24862
|
/** URL of the streamed attachments zip of one version (PRDCT-2278). */
|
|
24177
|
-
versionAttachmentsZipUrl(
|
|
24178
|
-
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
24863
|
+
versionAttachmentsZipUrl(id2, version2) {
|
|
24864
|
+
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/versions/${version2}/downloads.zip`;
|
|
24179
24865
|
}
|
|
24180
24866
|
/**
|
|
24181
24867
|
* Downloads one version's attachments (its `downloads/` folder) as a
|
|
@@ -24183,24 +24869,24 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24183
24869
|
* Content-Disposition carries it). Returns the raw Response so callers can
|
|
24184
24870
|
* stream the bytes; 404 no_attachments when the version carries none.
|
|
24185
24871
|
*/
|
|
24186
|
-
async downloadVersionAttachmentsZip(
|
|
24187
|
-
return this.rawDownload(this.versionAttachmentsZipUrl(
|
|
24872
|
+
async downloadVersionAttachmentsZip(id2, version2) {
|
|
24873
|
+
return this.rawDownload(this.versionAttachmentsZipUrl(id2, version2));
|
|
24188
24874
|
}
|
|
24189
24875
|
/**
|
|
24190
24876
|
* URL of one attachment of one version by its name (the path relative to
|
|
24191
24877
|
* `downloads/`). The name is ONE path segment on the wire: a nested name
|
|
24192
24878
|
* (`sub/file.csv`) is percent-encoded whole (`sub%2Ffile.csv`).
|
|
24193
24879
|
*/
|
|
24194
|
-
versionAttachmentUrl(
|
|
24195
|
-
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
24880
|
+
versionAttachmentUrl(id2, version2, name) {
|
|
24881
|
+
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/versions/${version2}/downloads/${encodeURIComponent(name)}`;
|
|
24196
24882
|
}
|
|
24197
24883
|
/** Downloads one attachment (attachment disposition, the manifest content type). Raw Response. */
|
|
24198
|
-
async downloadVersionAttachment(
|
|
24199
|
-
return this.rawDownload(this.versionAttachmentUrl(
|
|
24884
|
+
async downloadVersionAttachment(id2, version2, name) {
|
|
24885
|
+
return this.rawDownload(this.versionAttachmentUrl(id2, version2, name));
|
|
24200
24886
|
}
|
|
24201
24887
|
/** URL of a version's still image (WebP). */
|
|
24202
|
-
versionThumbnailUrl(
|
|
24203
|
-
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
24888
|
+
versionThumbnailUrl(id2, version2) {
|
|
24889
|
+
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/versions/${version2}/thumbnail`;
|
|
24204
24890
|
}
|
|
24205
24891
|
/**
|
|
24206
24892
|
* A version's still image. Raw Response; a non-2xx throws PlatformApiError
|
|
@@ -24209,8 +24895,8 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24209
24895
|
* `private, no-cache` with an ETag, so the browser keeps the bytes and revalidates
|
|
24210
24896
|
* on each ask (a 304), and a read right that was revoked is felt at once.
|
|
24211
24897
|
*/
|
|
24212
|
-
async versionThumbnail(
|
|
24213
|
-
const res = await this.fetchImpl(this.versionThumbnailUrl(
|
|
24898
|
+
async versionThumbnail(id2, version2) {
|
|
24899
|
+
const res = await this.fetchImpl(this.versionThumbnailUrl(id2, version2), {
|
|
24214
24900
|
method: "GET",
|
|
24215
24901
|
headers: this.baseHeaders(),
|
|
24216
24902
|
credentials: "same-origin",
|
|
@@ -24224,17 +24910,17 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24224
24910
|
return res;
|
|
24225
24911
|
}
|
|
24226
24912
|
/** URL of the streamed AGENT.md briefing endpoint. */
|
|
24227
|
-
agentDocUrl(
|
|
24228
|
-
const base = `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
24913
|
+
agentDocUrl(id2, version2) {
|
|
24914
|
+
const base = `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/agent-doc`;
|
|
24229
24915
|
return version2 !== void 0 ? `${base}?version=${version2}` : base;
|
|
24230
24916
|
}
|
|
24231
24917
|
/**
|
|
24232
24918
|
* The deck's AGENT.md briefing as markdown text (current version, or a
|
|
24233
24919
|
* pinned one). 404 agent_doc_not_found when that version ships none.
|
|
24234
24920
|
*/
|
|
24235
|
-
async agentDoc(
|
|
24921
|
+
async agentDoc(id2, version2) {
|
|
24236
24922
|
const headers = this.baseHeaders();
|
|
24237
|
-
const res = await this.fetchImpl(this.agentDocUrl(
|
|
24923
|
+
const res = await this.fetchImpl(this.agentDocUrl(id2, version2), {
|
|
24238
24924
|
method: "GET",
|
|
24239
24925
|
headers,
|
|
24240
24926
|
credentials: "same-origin",
|
|
@@ -24248,12 +24934,12 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24248
24934
|
return res.text();
|
|
24249
24935
|
}
|
|
24250
24936
|
// ── Sharing ───────────────────────────────────────────────────────────────
|
|
24251
|
-
shareTokens(
|
|
24252
|
-
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(
|
|
24937
|
+
shareTokens(id2, params = {}) {
|
|
24938
|
+
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(id2)}/tokens`, params));
|
|
24253
24939
|
}
|
|
24254
24940
|
/** The returned `secret`/`url` appear only here — never retrievable again. */
|
|
24255
|
-
createShareToken(
|
|
24256
|
-
return this.request("POST", `/presentations/${encodeURIComponent(
|
|
24941
|
+
createShareToken(id2, req, opts = {}) {
|
|
24942
|
+
return this.request("POST", `/presentations/${encodeURIComponent(id2)}/tokens`, req, idempotencyHeader(opts));
|
|
24257
24943
|
}
|
|
24258
24944
|
/**
|
|
24259
24945
|
* Mint the dashboard's transient preview token (deck owner / workspace
|
|
@@ -24261,8 +24947,8 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24261
24947
|
* 'preview', 1 h expiry, hidden from the sharing panel, excluded from view
|
|
24262
24948
|
* stats, immutable. `version` pins the preview; omitted = latest.
|
|
24263
24949
|
*/
|
|
24264
|
-
createPreviewToken(
|
|
24265
|
-
return this.request("POST", `/presentations/${encodeURIComponent(
|
|
24950
|
+
createPreviewToken(id2, req = {}) {
|
|
24951
|
+
return this.request("POST", `/presentations/${encodeURIComponent(id2)}/preview-token`, req);
|
|
24266
24952
|
}
|
|
24267
24953
|
/**
|
|
24268
24954
|
* Per-view events of one share token, newest first (cursor-paginated):
|
|
@@ -24270,31 +24956,31 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24270
24956
|
* placement label, and a coarse browser family. No IP, no geolocation,
|
|
24271
24957
|
* no full referrer URLs — the server never stores them.
|
|
24272
24958
|
*/
|
|
24273
|
-
shareTokenViews(
|
|
24274
|
-
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(
|
|
24959
|
+
shareTokenViews(id2, tokenId, params = {}) {
|
|
24960
|
+
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(id2)}/tokens/${encodeURIComponent(tokenId)}/views`, params));
|
|
24275
24961
|
}
|
|
24276
24962
|
/** Pin/unpin version, rename, the per-link switches (annotate, forms, downloads, bar, remembering, file uploads), expiry, password (null clears). */
|
|
24277
|
-
updateShareToken(
|
|
24278
|
-
return this.request("PATCH", `/presentations/${encodeURIComponent(
|
|
24963
|
+
updateShareToken(id2, tokenId, patch) {
|
|
24964
|
+
return this.request("PATCH", `/presentations/${encodeURIComponent(id2)}/tokens/${encodeURIComponent(tokenId)}`, patch);
|
|
24279
24965
|
}
|
|
24280
24966
|
/** Soft revoke — access stats survive. */
|
|
24281
|
-
revokeShareToken(
|
|
24282
|
-
return this.request("DELETE", `/presentations/${encodeURIComponent(
|
|
24967
|
+
revokeShareToken(id2, tokenId) {
|
|
24968
|
+
return this.request("DELETE", `/presentations/${encodeURIComponent(id2)}/tokens/${encodeURIComponent(tokenId)}`);
|
|
24283
24969
|
}
|
|
24284
24970
|
/** Email the viewer link to a recipient (best-effort on top of the copyable URL). */
|
|
24285
|
-
sendShareToken(
|
|
24286
|
-
return this.request("POST", `/presentations/${encodeURIComponent(
|
|
24971
|
+
sendShareToken(id2, tokenId, req) {
|
|
24972
|
+
return this.request("POST", `/presentations/${encodeURIComponent(id2)}/tokens/${encodeURIComponent(tokenId)}/send`, req);
|
|
24287
24973
|
}
|
|
24288
24974
|
// ── Collaborators ─────────────────────────────────────────────────────────
|
|
24289
|
-
collaborators(
|
|
24290
|
-
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(
|
|
24975
|
+
collaborators(id2, params = {}) {
|
|
24976
|
+
return this.request("GET", this.pathWithQuery(`/presentations/${encodeURIComponent(id2)}/collaborators`, params));
|
|
24291
24977
|
}
|
|
24292
24978
|
/** `claimUrl` is always returned — email delivery is best-effort on top. */
|
|
24293
|
-
inviteCollaborator(
|
|
24294
|
-
return this.request("POST", `/presentations/${encodeURIComponent(
|
|
24979
|
+
inviteCollaborator(id2, req, opts = {}) {
|
|
24980
|
+
return this.request("POST", `/presentations/${encodeURIComponent(id2)}/collaborators`, req, idempotencyHeader(opts));
|
|
24295
24981
|
}
|
|
24296
|
-
removeCollaborator(
|
|
24297
|
-
return this.request("DELETE", `/presentations/${encodeURIComponent(
|
|
24982
|
+
removeCollaborator(id2, collaboratorId) {
|
|
24983
|
+
return this.request("DELETE", `/presentations/${encodeURIComponent(id2)}/collaborators/${encodeURIComponent(collaboratorId)}`);
|
|
24298
24984
|
}
|
|
24299
24985
|
/** Public: resolves a collaborator claim token for the claim page. */
|
|
24300
24986
|
lookupCollaboratorInvite(token) {
|
|
@@ -24318,21 +25004,21 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24318
25004
|
const qs = query.toString();
|
|
24319
25005
|
return qs ? `${base}?${qs}` : base;
|
|
24320
25006
|
}
|
|
24321
|
-
annotations(
|
|
24322
|
-
return this.request("GET", this.pathWithAnnotationQuery(`/presentations/${encodeURIComponent(
|
|
25007
|
+
annotations(id2, params = {}) {
|
|
25008
|
+
return this.request("GET", this.pathWithAnnotationQuery(`/presentations/${encodeURIComponent(id2)}/annotations`, params));
|
|
24323
25009
|
}
|
|
24324
25010
|
/** Workspace-wide inbox: annotations across all decks, newest first. */
|
|
24325
25011
|
annotationInbox(params = {}) {
|
|
24326
25012
|
return this.request("GET", this.pathWithAnnotationQuery("/annotations", params));
|
|
24327
25013
|
}
|
|
24328
|
-
createAnnotation(
|
|
24329
|
-
return this.request("POST", `/presentations/${encodeURIComponent(
|
|
25014
|
+
createAnnotation(id2, req) {
|
|
25015
|
+
return this.request("POST", `/presentations/${encodeURIComponent(id2)}/annotations`, req);
|
|
24330
25016
|
}
|
|
24331
|
-
updateAnnotation(
|
|
24332
|
-
return this.request("PATCH", `/presentations/${encodeURIComponent(
|
|
25017
|
+
updateAnnotation(id2, annotationId, patch) {
|
|
25018
|
+
return this.request("PATCH", `/presentations/${encodeURIComponent(id2)}/annotations/${encodeURIComponent(annotationId)}`, patch);
|
|
24333
25019
|
}
|
|
24334
|
-
deleteAnnotation(
|
|
24335
|
-
return this.request("DELETE", `/presentations/${encodeURIComponent(
|
|
25020
|
+
deleteAnnotation(id2, annotationId) {
|
|
25021
|
+
return this.request("DELETE", `/presentations/${encodeURIComponent(id2)}/annotations/${encodeURIComponent(annotationId)}`);
|
|
24336
25022
|
}
|
|
24337
25023
|
// ── Form responses (ADR 022) ──────────────────────────────────────────────
|
|
24338
25024
|
pathWithFormResponseQuery(base, params) {
|
|
@@ -24359,8 +25045,8 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24359
25045
|
* form, share link, source (link/embed), placement label, and time.
|
|
24360
25046
|
* Payload values are the respondent's RAW input — escape before rendering.
|
|
24361
25047
|
*/
|
|
24362
|
-
formResponses(
|
|
24363
|
-
return this.request("GET", this.pathWithFormResponseQuery(`/presentations/${encodeURIComponent(
|
|
25048
|
+
formResponses(id2, params = {}) {
|
|
25049
|
+
return this.request("GET", this.pathWithFormResponseQuery(`/presentations/${encodeURIComponent(id2)}/responses`, params));
|
|
24364
25050
|
}
|
|
24365
25051
|
/**
|
|
24366
25052
|
* One response with its edit history (PRDCT-2329): the current row and
|
|
@@ -24368,8 +25054,8 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24368
25054
|
* written through. Payload values are RAW respondent input at every
|
|
24369
25055
|
* revision — escape before rendering.
|
|
24370
25056
|
*/
|
|
24371
|
-
formResponse(
|
|
24372
|
-
return this.request("GET", `/presentations/${encodeURIComponent(
|
|
25057
|
+
formResponse(id2, responseId) {
|
|
25058
|
+
return this.request("GET", `/presentations/${encodeURIComponent(id2)}/responses/${encodeURIComponent(responseId)}`);
|
|
24373
25059
|
}
|
|
24374
25060
|
// The files of form responses (PRDCT-2403): what respondents uploaded into
|
|
24375
25061
|
// a form's file fields. `FormResponse.files` lists them (RAW respondent
|
|
@@ -24377,30 +25063,30 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24377
25063
|
// path); these three calls fetch the bytes. Same return shape as every
|
|
24378
25064
|
// streamed download here: the raw Response, PlatformApiError on a non-2xx.
|
|
24379
25065
|
/** URL of one uploaded file of one response (attachment + nosniff, Range supported). */
|
|
24380
|
-
formResponseFileUrl(
|
|
24381
|
-
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
25066
|
+
formResponseFileUrl(id2, responseId, fileId) {
|
|
25067
|
+
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/responses/${encodeURIComponent(responseId)}/files/${encodeURIComponent(fileId)}`;
|
|
24382
25068
|
}
|
|
24383
25069
|
/**
|
|
24384
25070
|
* Downloads one file a respondent uploaded. Raw Response so callers can
|
|
24385
25071
|
* stream it; verify the bytes against the wire's `sizeBytes` and `sha256`
|
|
24386
25072
|
* before keeping them.
|
|
24387
25073
|
*/
|
|
24388
|
-
async downloadFormResponseFile(
|
|
24389
|
-
return this.rawDownload(this.formResponseFileUrl(
|
|
25074
|
+
async downloadFormResponseFile(id2, responseId, fileId) {
|
|
25075
|
+
return this.rawDownload(this.formResponseFileUrl(id2, responseId, fileId));
|
|
24390
25076
|
}
|
|
24391
25077
|
/** URL of one response's files as one zip (`<field>/<file>`). */
|
|
24392
|
-
formResponseFilesZipUrl(
|
|
24393
|
-
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
25078
|
+
formResponseFilesZipUrl(id2, responseId) {
|
|
25079
|
+
return `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/responses/${encodeURIComponent(responseId)}/files.zip`;
|
|
24394
25080
|
}
|
|
24395
25081
|
/**
|
|
24396
25082
|
* Downloads one response's uploaded files as a streamed store-only zip (the
|
|
24397
25083
|
* Content-Disposition carries its name). 404 no_files when it holds none.
|
|
24398
25084
|
*/
|
|
24399
|
-
async downloadFormResponseFilesZip(
|
|
24400
|
-
return this.rawDownload(this.formResponseFilesZipUrl(
|
|
25085
|
+
async downloadFormResponseFilesZip(id2, responseId) {
|
|
25086
|
+
return this.rawDownload(this.formResponseFilesZipUrl(id2, responseId));
|
|
24401
25087
|
}
|
|
24402
25088
|
/** URL of the whole deck's form-files zip, with its filters. */
|
|
24403
|
-
formResponsesFilesZipUrl(
|
|
25089
|
+
formResponsesFilesZipUrl(id2, params = {}) {
|
|
24404
25090
|
const query = new URLSearchParams();
|
|
24405
25091
|
if (params.form)
|
|
24406
25092
|
query.set("form", params.form);
|
|
@@ -24413,7 +25099,7 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24413
25099
|
if (params.since)
|
|
24414
25100
|
query.set("since", params.since);
|
|
24415
25101
|
const qs = query.toString();
|
|
24416
|
-
const base = `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(
|
|
25102
|
+
const base = `${this.baseUrl}/api/v1/presentations/${encodeURIComponent(id2)}/responses/files.zip`;
|
|
24417
25103
|
return qs ? `${base}?${qs}` : base;
|
|
24418
25104
|
}
|
|
24419
25105
|
/**
|
|
@@ -24422,16 +25108,16 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24422
25108
|
* listing (form, share link, source, placement, time). 404 no_files when
|
|
24423
25109
|
* nothing matches.
|
|
24424
25110
|
*/
|
|
24425
|
-
async downloadFormResponsesFilesZip(
|
|
24426
|
-
return this.rawDownload(this.formResponsesFilesZipUrl(
|
|
25111
|
+
async downloadFormResponsesFilesZip(id2, params = {}) {
|
|
25112
|
+
return this.rawDownload(this.formResponsesFilesZipUrl(id2, params));
|
|
24427
25113
|
}
|
|
24428
25114
|
/** Grouped counts per form × link × source × placement, plus the deck total. */
|
|
24429
|
-
formResponsesSummary(
|
|
24430
|
-
return this.request("GET", `/presentations/${encodeURIComponent(
|
|
25115
|
+
formResponsesSummary(id2) {
|
|
25116
|
+
return this.request("GET", `/presentations/${encodeURIComponent(id2)}/responses/summary`);
|
|
24431
25117
|
}
|
|
24432
25118
|
/** Owner moderation: delete one response (audited server-side). */
|
|
24433
|
-
deleteFormResponse(
|
|
24434
|
-
return this.request("DELETE", `/presentations/${encodeURIComponent(
|
|
25119
|
+
deleteFormResponse(id2, responseId) {
|
|
25120
|
+
return this.request("DELETE", `/presentations/${encodeURIComponent(id2)}/responses/${encodeURIComponent(responseId)}`);
|
|
24435
25121
|
}
|
|
24436
25122
|
// ── Apps ──────────────────────────────────────────────────────────────────
|
|
24437
25123
|
// The other tools of the organization: a browser session's alone (an API key
|
|
@@ -25615,10 +26301,10 @@ function registerContentCommands(program2, io) {
|
|
|
25615
26301
|
`);
|
|
25616
26302
|
openInBrowser(io, url2);
|
|
25617
26303
|
});
|
|
25618
|
-
program2.command("agent-doc [id]").description(`Print a deck's ${AGENT_DOC_PATH} briefing (id defaults to the ${LINK_FILENAME} link in .)`).option("--at <version>", "read this version instead of the latest", (v) => parseInt(v, 10)).option("--out <file>", "write to a file instead of stdout").action(async (
|
|
26304
|
+
program2.command("agent-doc [id]").description(`Print a deck's ${AGENT_DOC_PATH} briefing (id defaults to the ${LINK_FILENAME} link in .)`).option("--at <version>", "read this version instead of the latest", (v) => parseInt(v, 10)).option("--out <file>", "write to a file instead of stdout").action(async (id2, opts, cmd) => {
|
|
25619
26305
|
const ctx = resolveContext(cmd, io);
|
|
25620
26306
|
await requireApiKey(ctx);
|
|
25621
|
-
let deckId =
|
|
26307
|
+
let deckId = id2 ?? null;
|
|
25622
26308
|
if (!deckId) {
|
|
25623
26309
|
const link = await readLink(resolve6("."));
|
|
25624
26310
|
if (!link) {
|
|
@@ -25654,13 +26340,13 @@ function registerContentCommands(program2, io) {
|
|
|
25654
26340
|
});
|
|
25655
26341
|
program2.command("pull [id] [path]").description(
|
|
25656
26342
|
`Download a deck version to a folder (id defaults to the ${LINK_FILENAME} link in the target)`
|
|
25657
|
-
).option("--at <version>", "pull this version instead of the latest", (v) => parseInt(v, 10)).action(async (
|
|
26343
|
+
).option("--at <version>", "pull this version instead of the latest", (v) => parseInt(v, 10)).action(async (id2, path, opts, cmd) => {
|
|
25658
26344
|
const ctx = resolveContext(cmd, io);
|
|
25659
26345
|
await requireApiKey(ctx);
|
|
25660
26346
|
const linkMismatch = (linked) => new CliUsageError(
|
|
25661
26347
|
`${LINK_FILENAME} links this folder to ${linked}, but you are pulling from ${ctx.baseUrl}. Pull into a different folder, or delete ${LINK_FILENAME} first.`
|
|
25662
26348
|
);
|
|
25663
|
-
let deckId =
|
|
26349
|
+
let deckId = id2 ?? null;
|
|
25664
26350
|
let dest = path ?? null;
|
|
25665
26351
|
if (!deckId) {
|
|
25666
26352
|
const link = await readLink(resolve6(dest ?? "."));
|
|
@@ -25699,10 +26385,10 @@ function registerContentCommands(program2, io) {
|
|
|
25699
26385
|
);
|
|
25700
26386
|
});
|
|
25701
26387
|
program2.command("pull-annotations [id]").description(`List a deck's annotations (id defaults to the ${LINK_FILENAME} link in .)`).option("--version <n>", "only notes anchored to this version", (v) => parseInt(v, 10)).option("--status <status>", "open | resolved").option("--out <file>", "write the annotations as JSON to this file").action(
|
|
25702
|
-
async (
|
|
26388
|
+
async (id2, opts, cmd) => {
|
|
25703
26389
|
const ctx = resolveContext(cmd, io);
|
|
25704
26390
|
await requireApiKey(ctx);
|
|
25705
|
-
let deckId =
|
|
26391
|
+
let deckId = id2 ?? null;
|
|
25706
26392
|
if (!deckId) {
|
|
25707
26393
|
const link = await readLink(resolve6("."));
|
|
25708
26394
|
if (!link) {
|
|
@@ -25753,10 +26439,10 @@ function registerContentCommands(program2, io) {
|
|
|
25753
26439
|
);
|
|
25754
26440
|
const annotation = program2.command("annotation").description("Update deck annotations (pull-annotations lists them)");
|
|
25755
26441
|
annotation.command("resolve <id> <annotationId>").description("Mark an annotation resolved").action(
|
|
25756
|
-
(
|
|
26442
|
+
(id2, annotationId, _opts, cmd) => setAnnotationStatus(cmd, io, id2, annotationId, "resolved")
|
|
25757
26443
|
);
|
|
25758
26444
|
annotation.command("reopen <id> <annotationId>").description("Reopen a resolved annotation").action(
|
|
25759
|
-
(
|
|
26445
|
+
(id2, annotationId, _opts, cmd) => setAnnotationStatus(cmd, io, id2, annotationId, "open")
|
|
25760
26446
|
);
|
|
25761
26447
|
program2.command("dev [path]").description(
|
|
25762
26448
|
"Serve the deck folder locally with the exact viewer sandbox headers + live reload (no backend)"
|
|
@@ -26085,10 +26771,10 @@ function openAfterPush(ctx, url2, input) {
|
|
|
26085
26771
|
ctx.io.out.write(" opened in your browser (--no-open to skip)\n");
|
|
26086
26772
|
openInBrowser(ctx.io, url2);
|
|
26087
26773
|
}
|
|
26088
|
-
async function setAnnotationStatus(cmd, io,
|
|
26774
|
+
async function setAnnotationStatus(cmd, io, id2, annotationId, status) {
|
|
26089
26775
|
const ctx = resolveContext(cmd, io);
|
|
26090
26776
|
await requireApiKey(ctx);
|
|
26091
|
-
const updated = await ctx.client.updateAnnotation(
|
|
26777
|
+
const updated = await ctx.client.updateAnnotation(id2, annotationId, { status });
|
|
26092
26778
|
if (ctx.json) return printJson2(io, updated);
|
|
26093
26779
|
io.out.write(`Annotation ${updated.id} ${status === "resolved" ? "resolved" : "reopened"}.
|
|
26094
26780
|
`);
|
|
@@ -26118,7 +26804,7 @@ function parseSetPair(pair) {
|
|
|
26118
26804
|
return [key, raw];
|
|
26119
26805
|
}
|
|
26120
26806
|
}
|
|
26121
|
-
var
|
|
26807
|
+
var collect3 = (value, all) => [...all, value];
|
|
26122
26808
|
function registerDeckCommands(program2, io) {
|
|
26123
26809
|
program2.command("list").description("List presentations (newest first, cursor-paginated)").option("--cursor <cursor>", "resume from a previous nextCursor").option("--limit <n>", "page size (1-100)", (v) => parseInt(v, 10)).option("--all", "follow nextCursor until every page is fetched", false).option("--project <id>", "only the decks in this project").action(
|
|
26124
26810
|
async (opts, cmd) => {
|
|
@@ -26158,10 +26844,10 @@ function registerDeckCommands(program2, io) {
|
|
|
26158
26844
|
}
|
|
26159
26845
|
}
|
|
26160
26846
|
);
|
|
26161
|
-
program2.command("get <id>").description("Show one presentation (metadata + latest version)").action(async (
|
|
26847
|
+
program2.command("get <id>").description("Show one presentation (metadata + latest version)").action(async (id2, _opts, cmd) => {
|
|
26162
26848
|
const ctx = resolveContext(cmd, io);
|
|
26163
26849
|
await requireApiKey(ctx);
|
|
26164
|
-
const deck = await ctx.client.presentation(
|
|
26850
|
+
const deck = await ctx.client.presentation(id2);
|
|
26165
26851
|
if (ctx.json) return printJson2(io, deck);
|
|
26166
26852
|
const metaKeys = Object.keys(deck.metadata);
|
|
26167
26853
|
const references = provenanceOf(deck.metadata);
|
|
@@ -26186,9 +26872,9 @@ function registerDeckCommands(program2, io) {
|
|
|
26186
26872
|
program2.command("meta <id>").description("Show or edit a deck's metadata object (the seam for building your own dashboard)").option(
|
|
26187
26873
|
"--set <key=value>",
|
|
26188
26874
|
"set one key (repeatable; values parse as JSON when valid, else string)",
|
|
26189
|
-
|
|
26875
|
+
collect3,
|
|
26190
26876
|
[]
|
|
26191
|
-
).option("--unset <key>", "remove one key (repeatable)",
|
|
26877
|
+
).option("--unset <key>", "remove one key (repeatable)", collect3, []).option("--replace <object>", "replace the WHOLE metadata object with this JSON").action(async (id2, opts, cmd) => {
|
|
26192
26878
|
const ctx = resolveContext(cmd, io);
|
|
26193
26879
|
await requireApiKey(ctx);
|
|
26194
26880
|
const editing = opts.set.length > 0 || opts.unset.length > 0 || opts.replace !== void 0;
|
|
@@ -26196,7 +26882,7 @@ function registerDeckCommands(program2, io) {
|
|
|
26196
26882
|
throw new CliUsageError("--replace cannot be combined with --set/--unset");
|
|
26197
26883
|
}
|
|
26198
26884
|
if (!editing) {
|
|
26199
|
-
const deck = await ctx.client.presentation(
|
|
26885
|
+
const deck = await ctx.client.presentation(id2);
|
|
26200
26886
|
if (ctx.json) return printJson2(io, deck.metadata);
|
|
26201
26887
|
io.out.write(`${JSON.stringify(deck.metadata, null, 2)}
|
|
26202
26888
|
`);
|
|
@@ -26215,7 +26901,7 @@ function registerDeckCommands(program2, io) {
|
|
|
26215
26901
|
}
|
|
26216
26902
|
metadata = parsed;
|
|
26217
26903
|
} else {
|
|
26218
|
-
const deck = await ctx.client.presentation(
|
|
26904
|
+
const deck = await ctx.client.presentation(id2);
|
|
26219
26905
|
metadata = { ...deck.metadata };
|
|
26220
26906
|
for (const pair of opts.set) {
|
|
26221
26907
|
const [key, value] = parseSetPair(pair);
|
|
@@ -26223,7 +26909,7 @@ function registerDeckCommands(program2, io) {
|
|
|
26223
26909
|
}
|
|
26224
26910
|
for (const key of opts.unset) delete metadata[key];
|
|
26225
26911
|
}
|
|
26226
|
-
const updated = await ctx.client.updatePresentation(
|
|
26912
|
+
const updated = await ctx.client.updatePresentation(id2, { metadata });
|
|
26227
26913
|
if (ctx.json) return printJson2(io, updated.metadata);
|
|
26228
26914
|
io.out.write(
|
|
26229
26915
|
`Updated metadata of "${updated.title}" (${Object.keys(updated.metadata).length} key(s)):
|
|
@@ -26231,18 +26917,18 @@ ${JSON.stringify(updated.metadata, null, 2)}
|
|
|
26231
26917
|
`
|
|
26232
26918
|
);
|
|
26233
26919
|
});
|
|
26234
|
-
program2.command("versions <id>").description("List a deck's version history (newest first, cursor-paginated)").option("--cursor <cursor>", "resume from a previous nextCursor").option("--limit <n>", "page size (1-100)", (v) => parseInt(v, 10)).option("--all", "follow nextCursor until every page is fetched", false).action(async (
|
|
26920
|
+
program2.command("versions <id>").description("List a deck's version history (newest first, cursor-paginated)").option("--cursor <cursor>", "resume from a previous nextCursor").option("--limit <n>", "page size (1-100)", (v) => parseInt(v, 10)).option("--all", "follow nextCursor until every page is fetched", false).action(async (id2, opts, cmd) => {
|
|
26235
26921
|
const ctx = resolveContext(cmd, io);
|
|
26236
26922
|
await requireApiKey(ctx);
|
|
26237
26923
|
const params = {};
|
|
26238
26924
|
if (opts.cursor) params.cursor = opts.cursor;
|
|
26239
26925
|
if (opts.limit !== void 0) params.limit = opts.limit;
|
|
26240
|
-
const first = await ctx.client.presentationVersions(
|
|
26926
|
+
const first = await ctx.client.presentationVersions(id2, params);
|
|
26241
26927
|
const rows = [...first.versions];
|
|
26242
26928
|
if (opts.all) {
|
|
26243
26929
|
let cursor = first.nextCursor;
|
|
26244
26930
|
while (cursor) {
|
|
26245
|
-
const page = await ctx.client.presentationVersions(
|
|
26931
|
+
const page = await ctx.client.presentationVersions(id2, { ...params, cursor });
|
|
26246
26932
|
rows.push(...page.versions);
|
|
26247
26933
|
cursor = page.nextCursor;
|
|
26248
26934
|
}
|
|
@@ -26269,10 +26955,10 @@ ${JSON.stringify(updated.metadata, null, 2)}
|
|
|
26269
26955
|
`);
|
|
26270
26956
|
}
|
|
26271
26957
|
});
|
|
26272
|
-
program2.command("delete <id>").description("Delete a presentation (soft delete; versions and share links stop resolving)").action(async (
|
|
26958
|
+
program2.command("delete <id>").description("Delete a presentation (soft delete; versions and share links stop resolving)").action(async (id2, _opts, cmd) => {
|
|
26273
26959
|
const ctx = resolveContext(cmd, io);
|
|
26274
26960
|
await requireApiKey(ctx);
|
|
26275
|
-
const deck = await ctx.client.deletePresentation(
|
|
26961
|
+
const deck = await ctx.client.deletePresentation(id2);
|
|
26276
26962
|
if (ctx.json) return printJson2(io, deck);
|
|
26277
26963
|
io.out.write(`Deleted "${deck.title}" (${deck.id}).
|
|
26278
26964
|
`);
|
|
@@ -26770,7 +27456,7 @@ function registerSharingCommands(program2, io) {
|
|
|
26770
27456
|
"--placement <label>",
|
|
26771
27457
|
"placement label baked into the embed snippets (per-view analytics dimension; slug of [A-Za-z0-9._-], max 64)"
|
|
26772
27458
|
).action(
|
|
26773
|
-
async (
|
|
27459
|
+
async (id2, opts, cmd) => {
|
|
26774
27460
|
const ctx = resolveContext(cmd, io);
|
|
26775
27461
|
await requireApiKey(ctx);
|
|
26776
27462
|
if (opts.placement !== void 0 && !EMBED_PLACEMENT_RE.test(opts.placement)) {
|
|
@@ -26778,7 +27464,7 @@ function registerSharingCommands(program2, io) {
|
|
|
26778
27464
|
}
|
|
26779
27465
|
const password = await resolveSharePassword(io, opts);
|
|
26780
27466
|
const created = await ctx.client.createShareToken(
|
|
26781
|
-
|
|
27467
|
+
id2,
|
|
26782
27468
|
shareOptionsOf({ ...opts, ...password !== void 0 ? { password } : {} })
|
|
26783
27469
|
);
|
|
26784
27470
|
const embed = buildEmbedSnippets({
|
|
@@ -26808,11 +27494,11 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
26808
27494
|
}
|
|
26809
27495
|
}
|
|
26810
27496
|
);
|
|
26811
|
-
program2.command("unshare <id>").description("Revoke one share token (--token) or ALL active tokens of the deck").option("--token <tokenId>", "revoke only this token").action(async (
|
|
27497
|
+
program2.command("unshare <id>").description("Revoke one share token (--token) or ALL active tokens of the deck").option("--token <tokenId>", "revoke only this token").action(async (id2, opts, cmd) => {
|
|
26812
27498
|
const ctx = resolveContext(cmd, io);
|
|
26813
27499
|
await requireApiKey(ctx);
|
|
26814
27500
|
if (opts.token) {
|
|
26815
|
-
const revoked2 = await ctx.client.revokeShareToken(
|
|
27501
|
+
const revoked2 = await ctx.client.revokeShareToken(id2, opts.token);
|
|
26816
27502
|
if (ctx.json) return printJson2(io, revoked2);
|
|
26817
27503
|
io.out.write(`Revoked share token ${revoked2.id} ("${revoked2.name}").
|
|
26818
27504
|
`);
|
|
@@ -26821,10 +27507,10 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
26821
27507
|
const revoked = [];
|
|
26822
27508
|
let cursor = null;
|
|
26823
27509
|
do {
|
|
26824
|
-
const page = await ctx.client.shareTokens(
|
|
27510
|
+
const page = await ctx.client.shareTokens(id2, cursor ? { cursor } : {});
|
|
26825
27511
|
for (const token of page.shareTokens) {
|
|
26826
27512
|
if (!token.revokedAt) {
|
|
26827
|
-
await ctx.client.revokeShareToken(
|
|
27513
|
+
await ctx.client.revokeShareToken(id2, token.id);
|
|
26828
27514
|
revoked.push(token.id);
|
|
26829
27515
|
}
|
|
26830
27516
|
}
|
|
@@ -26844,17 +27530,17 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
26844
27530
|
`annotation badge slot (${BADGE_POSITIONS}); remembered as the deck default`,
|
|
26845
27531
|
parseBadgePosition
|
|
26846
27532
|
).option("--expires <datetime>", "ISO expiry").option("--password <password>", `viewer password (tell recipients separately; or ${SHARE_PASSWORD_ENV})`).option("--password-stdin", "read the viewer password from stdin (keeps it out of argv)", false).option("--message <text>", "personal note included in the email").action(
|
|
26847
|
-
async (
|
|
27533
|
+
async (id2, opts, cmd) => {
|
|
26848
27534
|
const ctx = resolveContext(cmd, io);
|
|
26849
27535
|
await requireApiKey(ctx);
|
|
26850
27536
|
const password = await resolveSharePassword(io, opts);
|
|
26851
27537
|
const results = [];
|
|
26852
27538
|
for (const email3 of opts.to) {
|
|
26853
27539
|
const created = await ctx.client.createShareToken(
|
|
26854
|
-
|
|
27540
|
+
id2,
|
|
26855
27541
|
shareOptionsOf({ ...opts, name: email3, ...password !== void 0 ? { password } : {} })
|
|
26856
27542
|
);
|
|
26857
|
-
const sent = await ctx.client.sendShareToken(
|
|
27543
|
+
const sent = await ctx.client.sendShareToken(id2, created.shareToken.id, {
|
|
26858
27544
|
email: email3,
|
|
26859
27545
|
...opts.message ? { message: opts.message } : {}
|
|
26860
27546
|
});
|
|
@@ -26867,14 +27553,14 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
26867
27553
|
}
|
|
26868
27554
|
);
|
|
26869
27555
|
program2.command("pin <id> <tokenId>").description("Pin a share token to a version, or set it back to following the latest").option("--to-version <n>", "freeze the recipient on this version", (v) => parseInt(v, 10)).option("--latest", "follow the latest version again", false).action(
|
|
26870
|
-
async (
|
|
27556
|
+
async (id2, tokenId, opts, cmd) => {
|
|
26871
27557
|
const ctx = resolveContext(cmd, io);
|
|
26872
27558
|
await requireApiKey(ctx);
|
|
26873
27559
|
if (opts.latest === (opts.toVersion !== void 0)) {
|
|
26874
27560
|
throw new CliUsageError("Pass exactly one of --to-version <n> or --latest.");
|
|
26875
27561
|
}
|
|
26876
27562
|
const patch = opts.toVersion !== void 0 ? { versionMode: "pinned", pinnedVersion: opts.toVersion } : { versionMode: "latest" };
|
|
26877
|
-
const updated = await ctx.client.updateShareToken(
|
|
27563
|
+
const updated = await ctx.client.updateShareToken(id2, tokenId, patch);
|
|
26878
27564
|
if (ctx.json) return printJson2(io, updated);
|
|
26879
27565
|
io.out.write(
|
|
26880
27566
|
updated.versionMode === "pinned" ? `Token ${updated.id} pinned to v${updated.pinnedVersion}.
|
|
@@ -26883,18 +27569,18 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
26883
27569
|
);
|
|
26884
27570
|
}
|
|
26885
27571
|
);
|
|
26886
|
-
program2.command("tokens <id>").description("List a deck's share tokens with access stats (newest first, cursor-paginated)").option("--cursor <cursor>", "resume from a previous nextCursor").option("--limit <n>", "page size (1-100)", (v) => parseInt(v, 10)).option("--all", "follow nextCursor until every page is fetched", false).action(async (
|
|
27572
|
+
program2.command("tokens <id>").description("List a deck's share tokens with access stats (newest first, cursor-paginated)").option("--cursor <cursor>", "resume from a previous nextCursor").option("--limit <n>", "page size (1-100)", (v) => parseInt(v, 10)).option("--all", "follow nextCursor until every page is fetched", false).action(async (id2, opts, cmd) => {
|
|
26887
27573
|
const ctx = resolveContext(cmd, io);
|
|
26888
27574
|
await requireApiKey(ctx);
|
|
26889
27575
|
const params = {};
|
|
26890
27576
|
if (opts.cursor) params.cursor = opts.cursor;
|
|
26891
27577
|
if (opts.limit !== void 0) params.limit = opts.limit;
|
|
26892
|
-
const first = await ctx.client.shareTokens(
|
|
27578
|
+
const first = await ctx.client.shareTokens(id2, params);
|
|
26893
27579
|
const rows = [...first.shareTokens];
|
|
26894
27580
|
if (opts.all) {
|
|
26895
27581
|
let cursor = first.nextCursor;
|
|
26896
27582
|
while (cursor) {
|
|
26897
|
-
const page = await ctx.client.shareTokens(
|
|
27583
|
+
const page = await ctx.client.shareTokens(id2, { ...params, cursor });
|
|
26898
27584
|
rows.push(...page.shareTokens);
|
|
26899
27585
|
cursor = page.nextCursor;
|
|
26900
27586
|
}
|
|
@@ -26944,14 +27630,14 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
26944
27630
|
program2.command("views <id> [tokenId]").description(
|
|
26945
27631
|
"Per-view stats of a share link: when it was opened, the referring site, the ?p= placement label, and the browser family (no IPs, no full URLs \u2014 never stored). Omit tokenId to see which links exist."
|
|
26946
27632
|
).option("--cursor <cursor>", "resume from a previous nextCursor").option("--limit <n>", "page size (1-100)", (v) => parseInt(v, 10)).option("--all", "follow nextCursor until every page is fetched", false).action(
|
|
26947
|
-
async (
|
|
27633
|
+
async (id2, tokenId, opts, cmd) => {
|
|
26948
27634
|
const ctx = resolveContext(cmd, io);
|
|
26949
27635
|
await requireApiKey(ctx);
|
|
26950
27636
|
if (!tokenId) {
|
|
26951
27637
|
const tokens = [];
|
|
26952
27638
|
let cursor = opts.cursor ?? null;
|
|
26953
27639
|
do {
|
|
26954
|
-
const page = await ctx.client.shareTokens(
|
|
27640
|
+
const page = await ctx.client.shareTokens(id2, cursor ? { cursor } : {});
|
|
26955
27641
|
tokens.push(...page.shareTokens);
|
|
26956
27642
|
cursor = page.nextCursor;
|
|
26957
27643
|
} while (cursor);
|
|
@@ -26970,19 +27656,19 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
26970
27656
|
])
|
|
26971
27657
|
)
|
|
26972
27658
|
);
|
|
26973
|
-
io.out.write(`Pick one: slideless views ${
|
|
27659
|
+
io.out.write(`Pick one: slideless views ${id2} <tokenId>
|
|
26974
27660
|
`);
|
|
26975
27661
|
return;
|
|
26976
27662
|
}
|
|
26977
27663
|
const params = {};
|
|
26978
27664
|
if (opts.cursor) params.cursor = opts.cursor;
|
|
26979
27665
|
if (opts.limit !== void 0) params.limit = opts.limit;
|
|
26980
|
-
const first = await ctx.client.shareTokenViews(
|
|
27666
|
+
const first = await ctx.client.shareTokenViews(id2, tokenId, params);
|
|
26981
27667
|
const rows = [...first.views];
|
|
26982
27668
|
if (opts.all) {
|
|
26983
27669
|
let cursor = first.nextCursor;
|
|
26984
27670
|
while (cursor) {
|
|
26985
|
-
const page = await ctx.client.shareTokenViews(
|
|
27671
|
+
const page = await ctx.client.shareTokenViews(id2, tokenId, { ...params, cursor });
|
|
26986
27672
|
rows.push(...page.views);
|
|
26987
27673
|
cursor = page.nextCursor;
|
|
26988
27674
|
}
|
|
@@ -27013,7 +27699,7 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
27013
27699
|
program2.command("responses <id>").description(
|
|
27014
27700
|
"A deck's embedded-form responses: what viewers submitted through share links and embeds, newest first. With no filters, prints the per-form summary (form, link, source, placement, count, last activity), then the most recent rows. Payload cells are the respondent's raw input."
|
|
27015
27701
|
).option("--form <name>", "only this form (the data-slideless-form name)").option("--link <tokenId>", "only responses that came through this share token").option("--source <source>", "only direct-link or embedded submissions (link | embed)").option("--placement <label>", "only responses whose serving document carried this ?p= label").option("--since <datetime>", "only responses created at or after this ISO instant").option("--csv", "output the listed rows as CSV (one column per payload field)", false).option("--cursor <cursor>", "resume from a previous nextCursor").option("--limit <n>", "page size (1-100)", (v) => parseInt(v, 10)).option("--all", "follow nextCursor until every page is fetched", false).action(
|
|
27016
|
-
async (
|
|
27702
|
+
async (id2, opts, cmd) => {
|
|
27017
27703
|
const ctx = resolveContext(cmd, io);
|
|
27018
27704
|
await requireApiKey(ctx);
|
|
27019
27705
|
if (ctx.json && opts.csv) {
|
|
@@ -27039,12 +27725,12 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
27039
27725
|
}
|
|
27040
27726
|
const filtered = Boolean(opts.form || opts.link || opts.source || opts.placement || opts.since);
|
|
27041
27727
|
const fetchRows = async () => {
|
|
27042
|
-
const first = await ctx.client.formResponses(
|
|
27728
|
+
const first = await ctx.client.formResponses(id2, params);
|
|
27043
27729
|
const rows2 = [...first.responses];
|
|
27044
27730
|
if (opts.all) {
|
|
27045
27731
|
let cursor = first.nextCursor;
|
|
27046
27732
|
while (cursor) {
|
|
27047
|
-
const page = await ctx.client.formResponses(
|
|
27733
|
+
const page = await ctx.client.formResponses(id2, { ...params, cursor });
|
|
27048
27734
|
rows2.push(...page.responses);
|
|
27049
27735
|
cursor = page.nextCursor;
|
|
27050
27736
|
}
|
|
@@ -27070,7 +27756,7 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
27070
27756
|
`);
|
|
27071
27757
|
return;
|
|
27072
27758
|
}
|
|
27073
|
-
const summary = await ctx.client.formResponsesSummary(
|
|
27759
|
+
const summary = await ctx.client.formResponsesSummary(id2);
|
|
27074
27760
|
if (summary.total === 0 && !ctx.json) {
|
|
27075
27761
|
io.out.write(
|
|
27076
27762
|
'No form responses yet. Forms are <form data-slideless-form="name"> elements in the deck HTML.\n'
|
|
@@ -27101,17 +27787,17 @@ Password-protected links do not render inside embeds; docs: sharing/embedding.
|
|
|
27101
27787
|
}
|
|
27102
27788
|
io.out.write(
|
|
27103
27789
|
`
|
|
27104
|
-
Slice: slideless responses ${
|
|
27790
|
+
Slice: slideless responses ${id2} --form <name> [--link <tokenId>] [--source link|embed] [--placement <label>] [--since <ISO>]; export with --csv
|
|
27105
27791
|
`
|
|
27106
27792
|
);
|
|
27107
27793
|
}
|
|
27108
27794
|
);
|
|
27109
27795
|
program2.command("response <id> <responseId>").description(
|
|
27110
27796
|
"One form response with its edit history (PRDCT-2329): the current answer, then every kept revision newest first, with the link and the moment each was written through."
|
|
27111
|
-
).action(async (
|
|
27797
|
+
).action(async (id2, responseId, _opts, cmd) => {
|
|
27112
27798
|
const ctx = resolveContext(cmd, io);
|
|
27113
27799
|
await requireApiKey(ctx);
|
|
27114
|
-
const detail = await ctx.client.formResponse(
|
|
27800
|
+
const detail = await ctx.client.formResponse(id2, responseId);
|
|
27115
27801
|
if (ctx.json) return printJson2(io, detail);
|
|
27116
27802
|
const r = detail.response;
|
|
27117
27803
|
io.out.write(
|
|
@@ -27126,7 +27812,7 @@ Slice: slideless responses ${id} --form <name> [--link <tokenId>] [--source link
|
|
|
27126
27812
|
Files (${files.length}):
|
|
27127
27813
|
`);
|
|
27128
27814
|
io.out.write(table(files.map((f) => [` ${f.field}`, f.name, fmtBytes(f.sizeBytes), f.id])));
|
|
27129
|
-
io.out.write(` Download them: slideless response-files ${
|
|
27815
|
+
io.out.write(` Download them: slideless response-files ${id2} ${r.id}
|
|
27130
27816
|
`);
|
|
27131
27817
|
}
|
|
27132
27818
|
io.out.write(
|
|
@@ -27152,17 +27838,17 @@ History (${detail.versions.length} revision${detail.versions.length === 1 ? "" :
|
|
|
27152
27838
|
});
|
|
27153
27839
|
program2.command("uploads <id> <tokenId>").description(
|
|
27154
27840
|
"Show or switch file uploads on one EXISTING share link (PRDCT-2403): whether its respondents may upload files into the deck's form file fields. A new link has them on; a link minted before file fields existed has them off until its owner turns them on here."
|
|
27155
|
-
).option("--on", "let respondents on this link upload files into form file fields", false).option("--off", "refuse file uploads through this link (the rest of the form still submits)", false).action(async (
|
|
27841
|
+
).option("--on", "let respondents on this link upload files into form file fields", false).option("--off", "refuse file uploads through this link (the rest of the form still submits)", false).action(async (id2, tokenId, opts, cmd) => {
|
|
27156
27842
|
const ctx = resolveContext(cmd, io);
|
|
27157
27843
|
await requireApiKey(ctx);
|
|
27158
27844
|
if (opts.on && opts.off) throw new CliUsageError("Pass either --on or --off, not both.");
|
|
27159
27845
|
let token;
|
|
27160
27846
|
if (opts.on || opts.off) {
|
|
27161
|
-
token = await ctx.client.updateShareToken(
|
|
27847
|
+
token = await ctx.client.updateShareToken(id2, tokenId, { canUploadFiles: opts.on });
|
|
27162
27848
|
} else {
|
|
27163
27849
|
let cursor = null;
|
|
27164
27850
|
do {
|
|
27165
|
-
const page = await ctx.client.shareTokens(
|
|
27851
|
+
const page = await ctx.client.shareTokens(id2, { limit: 100, ...cursor ? { cursor } : {} });
|
|
27166
27852
|
token = page.shareTokens.find((t) => t.id === tokenId);
|
|
27167
27853
|
cursor = token ? null : page.nextCursor;
|
|
27168
27854
|
} while (cursor);
|
|
@@ -27184,17 +27870,17 @@ History (${detail.versions.length} revision${detail.versions.length === 1 ? "" :
|
|
|
27184
27870
|
});
|
|
27185
27871
|
program2.command("pdf <id> <tokenId>").description(
|
|
27186
27872
|
"Show or switch the PDF export on one EXISTING share link: whether its recipient sees an Export PDF action in the viewer's bar, printed by their browser. A new link has it on; a link minted before the switch existed has it off until its owner turns it on here."
|
|
27187
|
-
).option("--on", "let the recipient export the deck to PDF from the viewer", false).option("--off", "remove the Export PDF action from this link", false).action(async (
|
|
27873
|
+
).option("--on", "let the recipient export the deck to PDF from the viewer", false).option("--off", "remove the Export PDF action from this link", false).action(async (id2, tokenId, opts, cmd) => {
|
|
27188
27874
|
const ctx = resolveContext(cmd, io);
|
|
27189
27875
|
await requireApiKey(ctx);
|
|
27190
27876
|
if (opts.on && opts.off) throw new CliUsageError("Pass either --on or --off, not both.");
|
|
27191
27877
|
let token;
|
|
27192
27878
|
if (opts.on || opts.off) {
|
|
27193
|
-
token = await ctx.client.updateShareToken(
|
|
27879
|
+
token = await ctx.client.updateShareToken(id2, tokenId, { canExportPdf: opts.on });
|
|
27194
27880
|
} else {
|
|
27195
27881
|
let cursor = null;
|
|
27196
27882
|
do {
|
|
27197
|
-
const page = await ctx.client.shareTokens(
|
|
27883
|
+
const page = await ctx.client.shareTokens(id2, { limit: 100, ...cursor ? { cursor } : {} });
|
|
27198
27884
|
token = page.shareTokens.find((t) => t.id === tokenId);
|
|
27199
27885
|
cursor = token ? null : page.nextCursor;
|
|
27200
27886
|
} while (cursor);
|
|
@@ -27211,11 +27897,11 @@ History (${detail.versions.length} revision${detail.versions.length === 1 ? "" :
|
|
|
27211
27897
|
});
|
|
27212
27898
|
program2.command("notify <id>").description(
|
|
27213
27899
|
"Show or switch the owner mails for form responses on one deck (PRDCT-2330): a mail when a response arrives, another when one is edited; on by default"
|
|
27214
|
-
).option("--on", "mail the deck owner on new and edited responses", false).option("--off", "stop mailing the deck owner about responses (forms stay on)", false).action(async (
|
|
27900
|
+
).option("--on", "mail the deck owner on new and edited responses", false).option("--off", "stop mailing the deck owner about responses (forms stay on)", false).action(async (id2, opts, cmd) => {
|
|
27215
27901
|
const ctx = resolveContext(cmd, io);
|
|
27216
27902
|
await requireApiKey(ctx);
|
|
27217
27903
|
if (opts.on && opts.off) throw new CliUsageError("Pass either --on or --off, not both.");
|
|
27218
|
-
const deck = opts.on || opts.off ? await ctx.client.updatePresentation(
|
|
27904
|
+
const deck = opts.on || opts.off ? await ctx.client.updatePresentation(id2, { notifyOnResponse: opts.on }) : await ctx.client.presentation(id2);
|
|
27219
27905
|
if (ctx.json) return printJson2(io, { notifyOnResponse: deck.notifyOnResponse });
|
|
27220
27906
|
io.out.write(
|
|
27221
27907
|
deck.notifyOnResponse ? `Response mails are ON for "${deck.title}": the owner is mailed on a new response and on an edit.
|
|
@@ -27223,10 +27909,10 @@ History (${detail.versions.length} revision${detail.versions.length === 1 ? "" :
|
|
|
27223
27909
|
`
|
|
27224
27910
|
);
|
|
27225
27911
|
});
|
|
27226
|
-
program2.command("invite <id>").description("Invite a dev collaborator to one deck (prints the claim link)").requiredOption("--email <email>", "invitee email").action(async (
|
|
27912
|
+
program2.command("invite <id>").description("Invite a dev collaborator to one deck (prints the claim link)").requiredOption("--email <email>", "invitee email").action(async (id2, opts, cmd) => {
|
|
27227
27913
|
const ctx = resolveContext(cmd, io);
|
|
27228
27914
|
await requireApiKey(ctx);
|
|
27229
|
-
const invited = await ctx.client.inviteCollaborator(
|
|
27915
|
+
const invited = await ctx.client.inviteCollaborator(id2, { email: opts.email });
|
|
27230
27916
|
if (ctx.json) return printJson2(io, invited);
|
|
27231
27917
|
io.out.write(
|
|
27232
27918
|
`Invited ${opts.email} as a dev collaborator (grant ${invited.collaborator.id}).
|
|
@@ -27235,10 +27921,10 @@ History (${detail.versions.length} revision${detail.versions.length === 1 ? "" :
|
|
|
27235
27921
|
`
|
|
27236
27922
|
);
|
|
27237
27923
|
});
|
|
27238
|
-
program2.command("uninvite <id> <collaboratorId>").description("Revoke a collaborator grant (pending or active)").action(async (
|
|
27924
|
+
program2.command("uninvite <id> <collaboratorId>").description("Revoke a collaborator grant (pending or active)").action(async (id2, collaboratorId, _opts, cmd) => {
|
|
27239
27925
|
const ctx = resolveContext(cmd, io);
|
|
27240
27926
|
await requireApiKey(ctx);
|
|
27241
|
-
const revoked = await ctx.client.removeCollaborator(
|
|
27927
|
+
const revoked = await ctx.client.removeCollaborator(id2, collaboratorId);
|
|
27242
27928
|
if (ctx.json) return printJson2(io, revoked);
|
|
27243
27929
|
io.out.write(`Revoked collaborator grant ${revoked.id} (${revoked.email}).
|
|
27244
27930
|
`);
|
|
@@ -27409,7 +28095,7 @@ function registerResponseFilesCommand(program2, io) {
|
|
|
27409
28095
|
"--zip [path]",
|
|
27410
28096
|
"stream the server's zip to disk instead (default: the server's file name, in the current directory)"
|
|
27411
28097
|
).action(
|
|
27412
|
-
async (
|
|
28098
|
+
async (id2, responseId, opts, cmd) => {
|
|
27413
28099
|
const ctx = resolveContext(cmd, io);
|
|
27414
28100
|
await requireApiKey(ctx);
|
|
27415
28101
|
if (opts.out !== void 0 && opts.zip !== void 0) {
|
|
@@ -27437,15 +28123,15 @@ function registerResponseFilesCommand(program2, io) {
|
|
|
27437
28123
|
filters.since = new Date(opts.since).toISOString();
|
|
27438
28124
|
}
|
|
27439
28125
|
if (opts.zip !== void 0) {
|
|
27440
|
-
return zipMode(ctx, io,
|
|
28126
|
+
return zipMode(ctx, io, id2, responseId, filters, opts.zip);
|
|
27441
28127
|
}
|
|
27442
28128
|
const responses = [];
|
|
27443
28129
|
if (responseId !== void 0) {
|
|
27444
|
-
responses.push((await ctx.client.formResponse(
|
|
28130
|
+
responses.push((await ctx.client.formResponse(id2, responseId)).response);
|
|
27445
28131
|
} else {
|
|
27446
28132
|
let cursor = null;
|
|
27447
28133
|
do {
|
|
27448
|
-
const page = await ctx.client.formResponses(
|
|
28134
|
+
const page = await ctx.client.formResponses(id2, {
|
|
27449
28135
|
...filters,
|
|
27450
28136
|
limit: 100,
|
|
27451
28137
|
...cursor ? { cursor } : {}
|
|
@@ -27456,7 +28142,7 @@ function registerResponseFilesCommand(program2, io) {
|
|
|
27456
28142
|
}
|
|
27457
28143
|
const planned = plan(responses, responseId !== void 0);
|
|
27458
28144
|
const root = resolve8(
|
|
27459
|
-
opts.out ?? (responseId !== void 0 ? `response-files-${safePathSegment(responseId.slice(0, 8))}` : `form-files-${safePathSegment(
|
|
28145
|
+
opts.out ?? (responseId !== void 0 ? `response-files-${safePathSegment(responseId.slice(0, 8))}` : `form-files-${safePathSegment(id2.slice(0, 8))}`)
|
|
27460
28146
|
);
|
|
27461
28147
|
if (planned.length === 0) {
|
|
27462
28148
|
if (ctx.json) return printJson2(io, { mode: "folder", path: null, files: [], totalBytes: 0 });
|
|
@@ -27467,7 +28153,7 @@ function registerResponseFilesCommand(program2, io) {
|
|
|
27467
28153
|
}
|
|
27468
28154
|
const written = [];
|
|
27469
28155
|
for (const p of planned) {
|
|
27470
|
-
const path = await downloadInto(ctx,
|
|
28156
|
+
const path = await downloadInto(ctx, id2, root, p);
|
|
27471
28157
|
written.push({
|
|
27472
28158
|
responseId: p.response.id,
|
|
27473
28159
|
formName: p.response.formName,
|
|
@@ -27499,10 +28185,10 @@ function registerResponseFilesCommand(program2, io) {
|
|
|
27499
28185
|
}
|
|
27500
28186
|
);
|
|
27501
28187
|
}
|
|
27502
|
-
async function zipMode(ctx, io,
|
|
28188
|
+
async function zipMode(ctx, io, id2, responseId, filters, zip) {
|
|
27503
28189
|
let res;
|
|
27504
28190
|
try {
|
|
27505
|
-
res = responseId !== void 0 ? await ctx.client.downloadFormResponseFilesZip(
|
|
28191
|
+
res = responseId !== void 0 ? await ctx.client.downloadFormResponseFilesZip(id2, responseId) : await ctx.client.downloadFormResponsesFilesZip(id2, filters);
|
|
27506
28192
|
} catch (e) {
|
|
27507
28193
|
if (e instanceof PlatformApiError && e.code === "no_files") {
|
|
27508
28194
|
if (ctx.json) return printJson2(io, { mode: "zip", path: null, sizeBytes: 0 });
|
|
@@ -27528,7 +28214,7 @@ async function zipMode(ctx, io, id, responseId, filters, zip) {
|
|
|
27528
28214
|
sizeBytes = (await stat6(path)).size;
|
|
27529
28215
|
} else {
|
|
27530
28216
|
const served = contentDispositionName(res.headers.get("content-disposition"));
|
|
27531
|
-
const fallback = `form-files-${safePathSegment((responseId ??
|
|
28217
|
+
const fallback = `form-files-${safePathSegment((responseId ?? id2).slice(0, 8))}.zip`;
|
|
27532
28218
|
let name = served ? safePathSegment(served) : fallback;
|
|
27533
28219
|
if (name === "_") name = fallback;
|
|
27534
28220
|
if (!/\.zip$/i.test(name)) name = `${name}.zip`;
|
|
@@ -27540,7 +28226,7 @@ async function zipMode(ctx, io, id, responseId, filters, zip) {
|
|
|
27540
28226
|
}
|
|
27541
28227
|
|
|
27542
28228
|
// src/index.ts
|
|
27543
|
-
var VERSION = "0.13.
|
|
28229
|
+
var VERSION = "0.13.9";
|
|
27544
28230
|
function registerTool(program2, io) {
|
|
27545
28231
|
registerDeckCommands(program2, io);
|
|
27546
28232
|
registerContentCommands(program2, io);
|