@installagent/sdk 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/portal-admin.d.ts +24 -0
- package/dist/portal-admin.js +29 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { type NewClientOptions, type NewClientResult, newClient, SLUG_PATTERN, }
|
|
|
32
32
|
export { opInstallCommand, opInstallFix, opIntegrationFix } from "./op-cli.js";
|
|
33
33
|
export { type PingResult, ping } from "./ping.js";
|
|
34
34
|
export { detectPlatform, detectPlatformInfo, detectShell, opNeedsAnotherShell, type Platform, type PlatformInfo, type Shell, } from "./platform.js";
|
|
35
|
-
export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_URL_ENV, type PortalAddUserInput, type PortalAddUserResult, PortalAdminAuthError, type PortalAdminOptions, type PortalAgent, type PortalAgentSyncRow, type PortalBuild, type PortalBuildType, type PortalCreateAgentInput, type PortalCreateBuildInput, type PortalCreateOrgInput, type PortalCreateOrgResult, type PortalListAgentsResult, type PortalListBuildsResult, type PortalListOrgsResult, type PortalOrg, type PortalOrgUser, PortalRequestError, type PortalSetAgentNameInput, type PortalSetAgentNameResult, type PortalSetAgentStatusInput, type PortalSetAgentStatusResult, type PortalSetAgentTriageResult, type PortalSetAgentWorkflowInput, type PortalSetAgentWorkflowResult, type PortalSetBuildStatusInput, type PortalSetDriveFolderResult, type PortalSetPasswordResult, type PortalSyncRunsResult, type PortalTriageBackfillResult, type PortalTriageProvider, type PortalTriageRecordsPage, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
|
|
35
|
+
export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_URL_ENV, type PortalAddUserInput, type PortalAddUserResult, PortalAdminAuthError, type PortalAdminOptions, type PortalAgent, type PortalAgentSyncRow, type PortalBuild, type PortalBuildType, type PortalCreateAgentInput, type PortalCreateBuildInput, type PortalCreateOrgInput, type PortalCreateOrgResult, type PortalListAgentsResult, type PortalListBuildsResult, type PortalListOrgsResult, type PortalOrg, type PortalOrgUser, PortalRequestError, type PortalSetAgentNameInput, type PortalSetAgentNameResult, type PortalSetAgentStatusInput, type PortalSetAgentStatusResult, type PortalSetAgentTriageResult, type PortalSetAgentWorkflowInput, type PortalSetAgentWorkflowResult, type PortalSetBuildStatusInput, type PortalSetDriveFolderResult, type PortalSetPasswordResult, type PortalSetUserInput, type PortalSetUserResult, type PortalSyncRunsResult, type PortalTriageBackfillResult, type PortalTriageProvider, type PortalTriageRecordsPage, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSetUser, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
|
|
36
36
|
export { expectedGithubAccount, type PrOpenOptions, type PrOpenResult, parseGithubRemote, prOpen, } from "./pr-open.js";
|
|
37
37
|
export { type StandupCallPrep, type StandupCallPrepStatus, type StandupGitState, type StandupIssueRef, type StandupLinear, type StandupOptions, type StandupRepo, type StandupRepoLint, type StandupResult, type StandupStaleTodo, standup, } from "./standup.js";
|
|
38
38
|
export { type SyncRepoResult, type SyncRepoStatus, type SyncReposOptions, type SyncReposResult, syncRepos, workspaceRepoNames, } from "./sync-repos.js";
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ export { newClient, SLUG_PATTERN, } from "./new-client.js";
|
|
|
35
35
|
export { opInstallCommand, opInstallFix, opIntegrationFix } from "./op-cli.js";
|
|
36
36
|
export { ping } from "./ping.js";
|
|
37
37
|
export { detectPlatform, detectPlatformInfo, detectShell, opNeedsAnotherShell, } from "./platform.js";
|
|
38
|
-
export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_URL_ENV, PortalAdminAuthError, PortalRequestError, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
|
|
38
|
+
export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_URL_ENV, PortalAdminAuthError, PortalRequestError, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSetUser, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
|
|
39
39
|
export { expectedGithubAccount, parseGithubRemote, prOpen, } from "./pr-open.js";
|
|
40
40
|
export { standup, } from "./standup.js";
|
|
41
41
|
export { syncRepos, workspaceRepoNames, } from "./sync-repos.js";
|
package/dist/portal-admin.d.ts
CHANGED
|
@@ -108,6 +108,23 @@ export interface PortalAddUserResult {
|
|
|
108
108
|
slug: string;
|
|
109
109
|
user: PortalOrgUser;
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Change one contact. Name it by `email` (case-insensitive) OR by `name` (only
|
|
113
|
+
* a contact with no email) — exactly one. Change `role`, `status` or both.
|
|
114
|
+
*/
|
|
115
|
+
export interface PortalSetUserInput {
|
|
116
|
+
slug: string;
|
|
117
|
+
email?: string;
|
|
118
|
+
name?: string;
|
|
119
|
+
role?: "member" | "owner";
|
|
120
|
+
status?: "active" | "disabled";
|
|
121
|
+
}
|
|
122
|
+
export interface PortalSetUserResult {
|
|
123
|
+
slug: string;
|
|
124
|
+
user: PortalOrgUser;
|
|
125
|
+
/** False when the contact already had these values (nothing was written). */
|
|
126
|
+
changed: boolean;
|
|
127
|
+
}
|
|
111
128
|
export interface PortalListOrgsResult {
|
|
112
129
|
orgs: PortalOrg[];
|
|
113
130
|
}
|
|
@@ -204,6 +221,13 @@ export declare function portalSetDriveFolder(input: {
|
|
|
204
221
|
folderId: string;
|
|
205
222
|
}, options?: PortalAdminOptions): Promise<PortalSetDriveFolderResult>;
|
|
206
223
|
export declare function portalAddUser(input: PortalAddUserInput, options?: PortalAdminOptions): Promise<PortalAddUserResult>;
|
|
224
|
+
/**
|
|
225
|
+
* Change a contact's role and/or status (PATCH /api/admin/users). The portal
|
|
226
|
+
* never deletes a contact: `disabled` keeps the row (uploads, feedback and
|
|
227
|
+
* sign-in links point at it) and stops new magic-link sign-ins. Errors name
|
|
228
|
+
* the field, never the email or name.
|
|
229
|
+
*/
|
|
230
|
+
export declare function portalSetUser(input: PortalSetUserInput, options?: PortalAdminOptions): Promise<PortalSetUserResult>;
|
|
207
231
|
export declare function portalListOrgs(options?: PortalAdminOptions): Promise<PortalListOrgsResult>;
|
|
208
232
|
/**
|
|
209
233
|
* The client-side check of a create: an agent needs its n8n workflow id, an
|
package/dist/portal-admin.js
CHANGED
|
@@ -114,6 +114,35 @@ export async function portalAddUser(input, options = {}) {
|
|
|
114
114
|
...(input.role ? { role: input.role } : {}),
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Change a contact's role and/or status (PATCH /api/admin/users). The portal
|
|
119
|
+
* never deletes a contact: `disabled` keeps the row (uploads, feedback and
|
|
120
|
+
* sign-in links point at it) and stops new magic-link sign-ins. Errors name
|
|
121
|
+
* the field, never the email or name.
|
|
122
|
+
*/
|
|
123
|
+
export async function portalSetUser(input, options = {}) {
|
|
124
|
+
const slug = normalizeSlug(input.slug, "org");
|
|
125
|
+
const email = input.email?.trim();
|
|
126
|
+
const name = input.name?.trim();
|
|
127
|
+
if (Boolean(email) === Boolean(name)) {
|
|
128
|
+
throw new Error("give exactly one of --email or --name to find the contact");
|
|
129
|
+
}
|
|
130
|
+
if (input.role !== undefined && input.role !== "member" && input.role !== "owner") {
|
|
131
|
+
throw new Error("role must be member|owner");
|
|
132
|
+
}
|
|
133
|
+
if (input.status !== undefined && input.status !== "active" && input.status !== "disabled") {
|
|
134
|
+
throw new Error("status must be active|disabled");
|
|
135
|
+
}
|
|
136
|
+
if (input.role === undefined && input.status === undefined) {
|
|
137
|
+
throw new Error("give --role and/or --status to change");
|
|
138
|
+
}
|
|
139
|
+
return portalRequest("PATCH", "/api/admin/users", options, {
|
|
140
|
+
slug,
|
|
141
|
+
...(email ? { email } : { name }),
|
|
142
|
+
...(input.role ? { role: input.role } : {}),
|
|
143
|
+
...(input.status ? { status: input.status } : {}),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
117
146
|
export async function portalListOrgs(options = {}) {
|
|
118
147
|
return portalRequest("GET", "/api/admin/orgs", options);
|
|
119
148
|
}
|
package/package.json
CHANGED