@clawscarf/cli 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/THIRD_PARTY_NOTICES.md +102 -0
  4. package/deploy/execution/browser/LICENSE.playwright +202 -0
  5. package/deploy/execution/browser/seccomp.json +640 -0
  6. package/deploy/execution/browser-node/configuration.js +85 -0
  7. package/deploy/execution/browser-node/operator.js +167 -0
  8. package/deploy/execution/network/node-ingress.cfg +35 -0
  9. package/deploy/models/catalog.json +275 -0
  10. package/deploy/openshell/policy.yaml +24 -0
  11. package/generated/http/LICENSE.md +21 -0
  12. package/generated/http/client/client.gen.d.ts +2 -0
  13. package/generated/http/client/client.gen.js +216 -0
  14. package/generated/http/client/index.d.ts +10 -0
  15. package/generated/http/client/index.js +6 -0
  16. package/generated/http/client/types.gen.d.ts +120 -0
  17. package/generated/http/client/types.gen.js +2 -0
  18. package/generated/http/client/utils.gen.d.ts +37 -0
  19. package/generated/http/client/utils.gen.js +228 -0
  20. package/generated/http/core/auth.gen.d.ts +25 -0
  21. package/generated/http/core/auth.gen.js +14 -0
  22. package/generated/http/core/bodySerializer.gen.d.ts +25 -0
  23. package/generated/http/core/bodySerializer.gen.js +57 -0
  24. package/generated/http/core/params.gen.d.ts +43 -0
  25. package/generated/http/core/params.gen.js +109 -0
  26. package/generated/http/core/pathSerializer.gen.d.ts +33 -0
  27. package/generated/http/core/pathSerializer.gen.js +106 -0
  28. package/generated/http/core/queryKeySerializer.gen.d.ts +18 -0
  29. package/generated/http/core/queryKeySerializer.gen.js +92 -0
  30. package/generated/http/core/serverSentEvents.gen.d.ts +71 -0
  31. package/generated/http/core/serverSentEvents.gen.js +132 -0
  32. package/generated/http/core/types.gen.d.ts +83 -0
  33. package/generated/http/core/types.gen.js +2 -0
  34. package/generated/http/core/utils.gen.d.ts +19 -0
  35. package/generated/http/core/utils.gen.js +87 -0
  36. package/package.json +37 -0
  37. package/packs/README.md +130 -0
  38. package/packs/research-team/pack.json +20 -0
  39. package/packs/research-team/researcher/CLAW.md +19 -0
  40. package/packs/research-team/researcher/package.json +8 -0
  41. package/packs/research-team/researcher/profiles/openclaw.yml +6 -0
  42. package/packs/research-team/reviewer/CLAW.md +19 -0
  43. package/packs/research-team/reviewer/package.json +8 -0
  44. package/packs/research-team/reviewer/profiles/openclaw.yml +6 -0
  45. package/pnpm-lock.yaml +7158 -0
  46. package/recipes/README.md +37 -0
  47. package/recipes/team-server/recipe.json +28 -0
  48. package/release/README.md +137 -0
  49. package/release/components.json +29 -0
  50. package/release/operator.md +63 -0
  51. package/runtime/configuration.js +135 -0
  52. package/runtime/connections-configuration.js +70 -0
  53. package/runtime/model-contract.js +92 -0
  54. package/runtime/releases/0.1.0-alpha.1.json +37 -0
  55. package/scripts/clawscarf.js +92 -0
  56. package/scripts/cloud/login.js +134 -0
  57. package/scripts/cloud/registration.js +232 -0
  58. package/scripts/cloud/url.js +9 -0
  59. package/scripts/connections.js +193 -0
  60. package/scripts/controller.js +143 -0
  61. package/scripts/deployment/browser-node-compose.js +81 -0
  62. package/scripts/deployment/browser-node-helper.js +9 -0
  63. package/scripts/deployment/browser-node-pairing.js +165 -0
  64. package/scripts/deployment/browser-node.js +154 -0
  65. package/scripts/deployment/browser.js +143 -0
  66. package/scripts/deployment/certificates.js +76 -0
  67. package/scripts/deployment/compose.js +191 -0
  68. package/scripts/deployment/configuration.js +275 -0
  69. package/scripts/deployment/connection-policy.js +80 -0
  70. package/scripts/deployment/connection-settings.js +60 -0
  71. package/scripts/deployment/connections-runtime.js +31 -0
  72. package/scripts/deployment/connections.js +213 -0
  73. package/scripts/deployment/controller-compose.js +59 -0
  74. package/scripts/deployment/database.js +199 -0
  75. package/scripts/deployment/entrypoint.js +7 -0
  76. package/scripts/deployment/images.js +17 -0
  77. package/scripts/deployment/initial-services.js +53 -0
  78. package/scripts/deployment/launch.js +177 -0
  79. package/scripts/deployment/logs.js +15 -0
  80. package/scripts/deployment/model-gateway-compose.js +74 -0
  81. package/scripts/deployment/model-gateway.js +125 -0
  82. package/scripts/deployment/models.js +82 -0
  83. package/scripts/deployment/networks.js +354 -0
  84. package/scripts/deployment/policy.js +56 -0
  85. package/scripts/deployment/preflight.js +124 -0
  86. package/scripts/deployment/prepare.js +205 -0
  87. package/scripts/deployment/process.js +70 -0
  88. package/scripts/deployment/relay.js +58 -0
  89. package/scripts/deployment/runtime-binding.js +100 -0
  90. package/scripts/deployment/runtime.js +232 -0
  91. package/scripts/deployment/state.js +154 -0
  92. package/scripts/deployment/team.js +76 -0
  93. package/scripts/deployment/upgrade-rpc.py +148 -0
  94. package/scripts/deployment/upgrade-state.js +47 -0
  95. package/scripts/deployment/upgrade.js +298 -0
  96. package/scripts/deployment/volumes.js +24 -0
  97. package/scripts/errors.js +9 -0
  98. package/scripts/installation/administrator.js +23 -0
  99. package/scripts/installation/command.js +176 -0
  100. package/scripts/installation/configuration.js +104 -0
  101. package/scripts/installation/configure.js +122 -0
  102. package/scripts/installation/delete.js +111 -0
  103. package/scripts/installation/doctor.js +8 -0
  104. package/scripts/installation/errors.js +8 -0
  105. package/scripts/installation/files.js +51 -0
  106. package/scripts/installation/installer/cloud.js +22 -0
  107. package/scripts/installation/installer/collect.js +245 -0
  108. package/scripts/installation/installer/inputs.js +59 -0
  109. package/scripts/installation/installer/menu.js +49 -0
  110. package/scripts/installation/installer/prompts.js +139 -0
  111. package/scripts/installation/installer/run.js +251 -0
  112. package/scripts/installation/installer/secrets.js +16 -0
  113. package/scripts/installation/installer/sections/access.js +69 -0
  114. package/scripts/installation/installer/sections/certificates.js +18 -0
  115. package/scripts/installation/installer/sections/connections.js +4 -0
  116. package/scripts/installation/installer/sections/external-models.js +35 -0
  117. package/scripts/installation/installer/sections/models.js +119 -0
  118. package/scripts/installation/installer/sections/packs.js +82 -0
  119. package/scripts/installation/installer/sections/resources.js +10 -0
  120. package/scripts/installation/installer/settings.js +192 -0
  121. package/scripts/installation/installer/summary.js +44 -0
  122. package/scripts/installation/lifecycle.js +127 -0
  123. package/scripts/installation/location.js +3 -0
  124. package/scripts/installation/models.js +42 -0
  125. package/scripts/installation/options.js +360 -0
  126. package/scripts/installation/packs.js +150 -0
  127. package/scripts/installation/plan.js +121 -0
  128. package/scripts/installation/prerequisites.js +170 -0
  129. package/scripts/installation/recipes/catalog.js +55 -0
  130. package/scripts/installation/recipes/definition.js +32 -0
  131. package/scripts/installation/reconfigure.js +255 -0
  132. package/scripts/installation/requirements.js +23 -0
  133. package/scripts/installation/resolve.js +217 -0
  134. package/scripts/installation/runtime.js +87 -0
  135. package/scripts/installation/save.js +95 -0
  136. package/scripts/installation/setup.js +91 -0
  137. package/scripts/models/catalog.js +9 -0
  138. package/scripts/models/configuration.js +184 -0
  139. package/scripts/models/credentials.js +132 -0
  140. package/scripts/models/runtime.js +87 -0
  141. package/scripts/output.js +34 -0
  142. package/scripts/packs/connections.js +95 -0
  143. package/scripts/packs/lifecycle.js +125 -0
  144. package/scripts/packs/model.js +66 -0
  145. package/scripts/packs/native.js +69 -0
  146. package/scripts/packs/openshell.js +148 -0
  147. package/scripts/packs/policy.js +189 -0
  148. package/scripts/packs/requirements.in +1 -0
  149. package/scripts/packs/requirements.js +11 -0
  150. package/scripts/packs/requirements.txt +116 -0
  151. package/scripts/packs/source.js +90 -0
  152. package/scripts/packs/transport.py +68 -0
  153. package/scripts/people.js +52 -0
  154. package/scripts/release/create.js +62 -0
  155. package/scripts/release/definition.js +51 -0
  156. package/scripts/session.js +27 -0
  157. package/services/access/generated/client.gen.d.ts +12 -0
  158. package/services/access/generated/client.gen.js +3 -0
  159. package/services/access/generated/fastify.gen.d.ts +49 -0
  160. package/services/access/generated/fastify.gen.js +2 -0
  161. package/services/access/generated/index.d.ts +2 -0
  162. package/services/access/generated/index.js +2 -0
  163. package/services/access/generated/sdk.gen.d.ts +28 -0
  164. package/services/access/generated/sdk.gen.js +107 -0
  165. package/services/access/generated/types.gen.d.ts +349 -0
  166. package/services/access/generated/types.gen.js +2 -0
  167. package/services/access/migrations/001_access.sql +39 -0
  168. package/services/access/migrations/002_administrator_setup.sql +16 -0
  169. package/services/access/migrations/003_local_login_completion.sql +5 -0
  170. package/services/access/migrations/004_invitations.sql +21 -0
  171. package/services/access/repo/postgres.js +341 -0
  172. package/services/access/repo/session-logout.js +28 -0
  173. package/services/access/types/credential.js +2 -0
  174. package/services/access/types/errors.js +7 -0
  175. package/services/access/types/ingress.js +1 -0
  176. package/services/access/types/model.js +1 -0
  177. package/services/access/types/native-errors.js +7 -0
  178. package/services/access/types/native.js +1 -0
  179. package/services/cloud/generated/client.gen.d.ts +12 -0
  180. package/services/cloud/generated/client.gen.js +3 -0
  181. package/services/cloud/generated/index.d.ts +2 -0
  182. package/services/cloud/generated/index.js +2 -0
  183. package/services/cloud/generated/sdk.gen.d.ts +145 -0
  184. package/services/cloud/generated/sdk.gen.js +488 -0
  185. package/services/cloud/generated/types.gen.d.ts +2034 -0
  186. package/services/cloud/generated/types.gen.js +2 -0
  187. package/services/connections/cloud/generated/client.gen.d.ts +12 -0
  188. package/services/connections/cloud/generated/client.gen.js +3 -0
  189. package/services/connections/cloud/generated/fastify.gen.d.ts +68 -0
  190. package/services/connections/cloud/generated/fastify.gen.js +2 -0
  191. package/services/connections/cloud/generated/index.d.ts +2 -0
  192. package/services/connections/cloud/generated/index.js +2 -0
  193. package/services/connections/cloud/generated/sdk.gen.d.ts +95 -0
  194. package/services/connections/cloud/generated/sdk.gen.js +210 -0
  195. package/services/connections/cloud/generated/types.gen.d.ts +1044 -0
  196. package/services/connections/cloud/generated/types.gen.js +2 -0
  197. package/services/connections/migrations/001_connections.sql +220 -0
@@ -0,0 +1,52 @@
1
+ import { Command } from "commander";
2
+ import { sessionRequest } from "./session.js";
3
+ import * as api from "../services/access/generated/sdk.gen.js";
4
+ import { writeResult } from "./output.js";
5
+ export function peopleCommand(program) {
6
+ const command = new Command("people")
7
+ .description("Manage people and invitations as a signed-in administrator")
8
+ .requiredOption("--origin <url>", "Server origin")
9
+ .requiredOption("--session-file <path>", "Private file containing your session credential");
10
+ const request = () => sessionRequest(command.opts());
11
+ command.command("list").action(async () => {
12
+ const result = (await api.listPeople(await request())).data;
13
+ writeResult(program, result, result.people
14
+ .map((person) => `${person.name} <${person.email}> · ${person.role ?? "Unavailable"} · ${person.id}`)
15
+ .join("\n"));
16
+ });
17
+ command.command("invite <email>").action(async (email) => {
18
+ const result = (await api.createInvitation({ ...(await request()), body: { email } })).data;
19
+ writeResult(program, result, `Invitation for ${email}\n${result.url}\nExpires ${result.invitation.expiresAt}`);
20
+ });
21
+ command.command("invitations").action(async () => {
22
+ const result = (await api.listInvitations(await request())).data;
23
+ writeResult(program, result, result.invitations
24
+ .map((item) => `${item.email} · ${item.status} · ${item.id}`)
25
+ .join("\n") || "No invitations.");
26
+ });
27
+ command
28
+ .command("revoke-invitation <id>")
29
+ .action(async (invitationId) => {
30
+ await api.revokeInvitation({
31
+ ...(await request()),
32
+ path: { invitationId },
33
+ });
34
+ writeResult(program, { revoked: true }, "Invitation revoked.");
35
+ });
36
+ command
37
+ .command("role <userId> <role>")
38
+ .requiredOption("--expected-role <role>", "Previously observed native role")
39
+ .action(async (userId, role, options) => {
40
+ await api.setPersonRole({
41
+ ...(await request()),
42
+ path: { userId },
43
+ body: { role, expectedRole: options.expectedRole },
44
+ });
45
+ writeResult(program, { updated: true }, "Role updated.");
46
+ });
47
+ command.command("remove <userId>").action(async (userId) => {
48
+ await api.removePerson({ ...(await request()), path: { userId } });
49
+ writeResult(program, { removed: true }, "Access removed. Team files remain.");
50
+ });
51
+ return command;
52
+ }
@@ -0,0 +1,62 @@
1
+ import { OperatorError } from "../errors.js";
2
+ import { createHash } from "node:crypto";
3
+ import { createReadStream } from "node:fs";
4
+ import { copyFile, lstat, mkdir, readFile, rm, writeFile, } from "node:fs/promises";
5
+ import { fileURLToPath } from "node:url";
6
+ import { dirname, join, resolve } from "node:path";
7
+ import { z } from "zod";
8
+ import { releaseSchema } from "./definition.js";
9
+ // Build inputs use the release contract, replacing tool digests with source paths.
10
+ const inputSchema = releaseSchema.extend({
11
+ tools: z.strictObject({
12
+ openshell: releaseSchema.shape.tools.shape.openshell.extend({
13
+ cli: z.string().min(1),
14
+ gateway: z.string().min(1),
15
+ }),
16
+ }),
17
+ });
18
+ async function tool(source, destination, file) {
19
+ const stat = await lstat(source);
20
+ if (!stat.isFile() || !(stat.mode & 0o111))
21
+ throw new OperatorError("Release tools must be regular executable files.");
22
+ await copyFile(source, destination);
23
+ const hash = createHash("sha256");
24
+ for await (const bytes of createReadStream(destination)) {
25
+ if (!Buffer.isBuffer(bytes))
26
+ throw new OperatorError("Invalid file stream");
27
+ hash.update(bytes);
28
+ }
29
+ return { file, sha256: hash.digest("hex") };
30
+ }
31
+ /** Assemble portable payloads from explicit, already-built inputs. Never mutate sources. */
32
+ export async function createDevelopmentRelease(options) {
33
+ const input = inputSchema.parse(JSON.parse(await readFile(options.inputFile, "utf8")));
34
+ const directory = dirname(resolve(options.inputFile));
35
+ const output = resolve(options.outputDirectory);
36
+ await mkdir(output); // Refuse to merge with an existing bundle.
37
+ try {
38
+ for (const name of ["LICENSE", "THIRD_PARTY_NOTICES.md"])
39
+ await copyFile(fileURLToPath(new URL(`../../${name}`, import.meta.url)), join(output, name));
40
+ await mkdir(join(output, "tools"));
41
+ const release = releaseSchema.parse({
42
+ ...input,
43
+ tools: {
44
+ openshell: {
45
+ ...input.tools.openshell,
46
+ cli: await tool(resolve(directory, input.tools.openshell.cli), join(output, "tools/openshell"), "tools/openshell"),
47
+ gateway: await tool(resolve(directory, input.tools.openshell.gateway), join(output, "tools/openshell-gateway"), "tools/openshell-gateway"),
48
+ },
49
+ },
50
+ });
51
+ const releaseFile = join(output, "clawscarf-release.json");
52
+ await writeFile(releaseFile, JSON.stringify(release, null, 2) + "\n", {
53
+ flag: "wx",
54
+ mode: 0o600,
55
+ });
56
+ return release;
57
+ }
58
+ catch (error) {
59
+ await rm(output, { recursive: true, force: true });
60
+ throw error;
61
+ }
62
+ }
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ import { liteLlmImage, postgresImage } from "../deployment/images.js";
3
+ export const digest = z.string().regex(/^[a-f0-9]{64}$/);
4
+ const image = z
5
+ .string()
6
+ .regex(/^(?:sha256:[a-f0-9]{64}|[a-zA-Z0-9][a-zA-Z0-9._:/-]*@sha256:[a-f0-9]{64})$/);
7
+ const file = z.strictObject({
8
+ file: z.string().min(1),
9
+ sha256: digest,
10
+ url: z
11
+ .url()
12
+ .refine((value) => {
13
+ const url = new URL(value);
14
+ return (url.protocol === "https:" && !url.username && !url.password && !url.hash);
15
+ }, "Tool downloads require HTTPS without credentials.")
16
+ .optional(),
17
+ });
18
+ /** Pinned runtime metadata, independent of recipe defaults and deployment state. */
19
+ export const releaseSchema = z.strictObject({
20
+ schemaVersion: z.literal(1),
21
+ version: z.string().regex(/^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/),
22
+ sourceRevision: z.string().regex(/^[a-f0-9]{40}$/),
23
+ platforms: z.array(z.literal("darwin-arm64")).min(1).max(1),
24
+ images: z
25
+ .strictObject({
26
+ postgres: z.literal(postgresImage),
27
+ gateway: image,
28
+ companion: image,
29
+ openshellClient: image,
30
+ relay: image.optional(),
31
+ models: z.literal(liteLlmImage).optional(),
32
+ browser: z
33
+ .strictObject({
34
+ chromium: image,
35
+ node: image,
36
+ dns: image,
37
+ egress: image,
38
+ })
39
+ .optional(),
40
+ })
41
+ .refine((images) => Boolean(images.browser) === Boolean(images.relay), {
42
+ message: "Browser and relay images must be supplied together.",
43
+ }),
44
+ tools: z.strictObject({
45
+ openshell: z.strictObject({
46
+ version: z.string().min(1),
47
+ cli: file,
48
+ gateway: file,
49
+ }),
50
+ }),
51
+ });
@@ -0,0 +1,27 @@
1
+ import { session } from "../services/access/generated/sdk.gen.js";
2
+ import { cloudUrlSchema } from "./cloud/url.js";
3
+ import { readInputFile } from "./installation/files.js";
4
+ import { InstallationError } from "./installation/errors.js";
5
+ /** One bounded, non-redirecting authenticated operation for both management clients. */
6
+ export async function sessionRequest(options) {
7
+ if (!options.origin || !options.sessionFile)
8
+ throw new InstallationError("invalid_configuration", "Use --origin and --session-file for application management.");
9
+ const origin = cloudUrlSchema.parse(options.origin);
10
+ const token = (await readInputFile(options.sessionFile, true))
11
+ .toString("utf8")
12
+ .trim();
13
+ if (!/^[A-Za-z0-9_-]{43,128}$/.test(token))
14
+ throw new InstallationError("invalid_configuration", "Invalid session credential.");
15
+ const base = {
16
+ baseUrl: origin,
17
+ redirect: "error",
18
+ signal: AbortSignal.timeout(90_000),
19
+ throwOnError: true,
20
+ headers: { cookie: `clawscarf_session=${token}`, origin },
21
+ };
22
+ const current = (await session(base)).data;
23
+ return {
24
+ ...base,
25
+ headers: { ...base.headers, "x-csrf-token": current.csrfToken },
26
+ };
27
+ }
@@ -0,0 +1,12 @@
1
+ import { type Client, type ClientOptions, type Config } from '../../../generated/http/client/index.js';
2
+ import type { ClientOptions as ClientOptions2 } from './types.gen.js';
3
+ /**
4
+ * The `createClientConfig()` function will be called on client initialization
5
+ * and the returned object will become the client's initial configuration.
6
+ *
7
+ * You may want to initialize your client this way instead of calling
8
+ * `setConfig()`. This is useful for example if you're using Next.js
9
+ * to ensure your client always has the correct values.
10
+ */
11
+ export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
12
+ export declare const client: Client;
@@ -0,0 +1,3 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { createClient, createConfig } from '../../../generated/http/client/index.js';
3
+ export const client = createClient(createConfig({ baseUrl: 'services' }));
@@ -0,0 +1,49 @@
1
+ import type { RouteHandler } from 'fastify';
2
+ import type { CompleteLoginData, CreateInvitationData, CreateInvitationResponses, EnrollPersonData, EnrollPersonResponses, HealthResponses, ListInvitationsResponses, ListPeopleResponses, LogoutResponses, PrepareTeamResponses, RemovePersonData, RemovePersonResponses, RevokeInvitationData, RevokeInvitationResponses, SessionResponses, SetPersonRoleData, SetPersonRoleResponses, StartLoginData } from './types.gen.js';
3
+ export type RouteHandlers = {
4
+ health: RouteHandler<{
5
+ Reply: HealthResponses;
6
+ }>;
7
+ startLogin: RouteHandler<{
8
+ Querystring?: StartLoginData['query'];
9
+ }>;
10
+ completeLogin: RouteHandler<{
11
+ Querystring: CompleteLoginData['query'];
12
+ }>;
13
+ session: RouteHandler<{
14
+ Reply: SessionResponses;
15
+ }>;
16
+ logout: RouteHandler<{
17
+ Reply: LogoutResponses;
18
+ }>;
19
+ listPeople: RouteHandler<{
20
+ Reply: ListPeopleResponses;
21
+ }>;
22
+ enrollPerson: RouteHandler<{
23
+ Body: EnrollPersonData['body'];
24
+ Reply: EnrollPersonResponses;
25
+ }>;
26
+ removePerson: RouteHandler<{
27
+ Params: RemovePersonData['path'];
28
+ Reply: RemovePersonResponses;
29
+ }>;
30
+ prepareTeam: RouteHandler<{
31
+ Reply: PrepareTeamResponses;
32
+ }>;
33
+ setPersonRole: RouteHandler<{
34
+ Body: SetPersonRoleData['body'];
35
+ Params: SetPersonRoleData['path'];
36
+ Reply: SetPersonRoleResponses;
37
+ }>;
38
+ listInvitations: RouteHandler<{
39
+ Reply: ListInvitationsResponses;
40
+ }>;
41
+ createInvitation: RouteHandler<{
42
+ Body: CreateInvitationData['body'];
43
+ Reply: CreateInvitationResponses;
44
+ }>;
45
+ revokeInvitation: RouteHandler<{
46
+ Params: RevokeInvitationData['path'];
47
+ Reply: RevokeInvitationResponses;
48
+ }>;
49
+ };
@@ -0,0 +1,2 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export { completeLogin, createInvitation, enrollPerson, health, listInvitations, listPeople, logout, type Options, prepareTeam, removePerson, revokeInvitation, session, setPersonRole, startLogin } from './sdk.gen.js';
2
+ export type { ClientOptions, CompleteLoginData, CompleteLoginError, CompleteLoginErrors, CompleteLoginResponse, CompleteLoginResponses, CreateInvitationData, CreateInvitationError, CreateInvitationErrors, CreateInvitationResponse, CreateInvitationResponses, EnrollPersonData, EnrollPersonError, EnrollPersonErrors, EnrollPersonResponse, EnrollPersonResponses, HealthData, HealthError, HealthErrors, HealthResponse, HealthResponses, Invitation, ListInvitationsData, ListInvitationsError, ListInvitationsErrors, ListInvitationsResponse, ListInvitationsResponses, ListPeopleData, ListPeopleError, ListPeopleErrors, ListPeopleResponse, ListPeopleResponses, LogoutData, LogoutError, LogoutErrors, LogoutResponse, LogoutResponses, NavigationLink, Person, PrepareTeamData, PrepareTeamError, PrepareTeamErrors, PrepareTeamResponses, Problem, RemovePersonData, RemovePersonError, RemovePersonErrors, RemovePersonResponses, RevokeInvitationData, RevokeInvitationError, RevokeInvitationErrors, RevokeInvitationResponses, Role, SessionData, SessionError, SessionErrors, SessionResponse, SessionResponses, SetPersonRoleData, SetPersonRoleError, SetPersonRoleErrors, SetPersonRoleResponses, StartLoginData, StartLoginError, StartLoginErrors, StartLoginResponse, StartLoginResponses, User } from './types.gen.js';
@@ -0,0 +1,2 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export { completeLogin, createInvitation, enrollPerson, health, listInvitations, listPeople, logout, prepareTeam, removePerson, revokeInvitation, session, setPersonRole, startLogin } from './sdk.gen.js';
@@ -0,0 +1,28 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from '../../../generated/http/client/index.js';
2
+ import type { CompleteLoginData, CompleteLoginErrors, CompleteLoginResponses, CreateInvitationData, CreateInvitationErrors, CreateInvitationResponses, EnrollPersonData, EnrollPersonErrors, EnrollPersonResponses, HealthData, HealthErrors, HealthResponses, ListInvitationsData, ListInvitationsErrors, ListInvitationsResponses, ListPeopleData, ListPeopleErrors, ListPeopleResponses, LogoutData, LogoutErrors, LogoutResponses, PrepareTeamData, PrepareTeamErrors, PrepareTeamResponses, RemovePersonData, RemovePersonErrors, RemovePersonResponses, RevokeInvitationData, RevokeInvitationErrors, RevokeInvitationResponses, SessionData, SessionErrors, SessionResponses, SetPersonRoleData, SetPersonRoleErrors, SetPersonRoleResponses, StartLoginData, StartLoginErrors, StartLoginResponses } from './types.gen.js';
3
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
+ /**
5
+ * You can provide a client instance returned by `createClient()` instead of
6
+ * individual options. This might be also useful if you want to implement a
7
+ * custom client.
8
+ */
9
+ client?: Client;
10
+ /**
11
+ * You can pass arbitrary values through the `meta` object. This can be
12
+ * used to access values that aren't defined as part of the SDK function.
13
+ */
14
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
15
+ };
16
+ export declare const health: <ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>) => RequestResult<HealthResponses, HealthErrors, ThrowOnError>;
17
+ export declare const startLogin: <ThrowOnError extends boolean = false>(options?: Options<StartLoginData, ThrowOnError>) => RequestResult<StartLoginResponses, StartLoginErrors, ThrowOnError>;
18
+ export declare const completeLogin: <ThrowOnError extends boolean = false>(options: Options<CompleteLoginData, ThrowOnError>) => RequestResult<CompleteLoginResponses, CompleteLoginErrors, ThrowOnError>;
19
+ export declare const session: <ThrowOnError extends boolean = false>(options?: Options<SessionData, ThrowOnError>) => RequestResult<SessionResponses, SessionErrors, ThrowOnError>;
20
+ export declare const logout: <ThrowOnError extends boolean = false>(options?: Options<LogoutData, ThrowOnError>) => RequestResult<LogoutResponses, LogoutErrors, ThrowOnError>;
21
+ export declare const listPeople: <ThrowOnError extends boolean = false>(options?: Options<ListPeopleData, ThrowOnError>) => RequestResult<ListPeopleResponses, ListPeopleErrors, ThrowOnError>;
22
+ export declare const enrollPerson: <ThrowOnError extends boolean = false>(options: Options<EnrollPersonData, ThrowOnError>) => RequestResult<EnrollPersonResponses, EnrollPersonErrors, ThrowOnError>;
23
+ export declare const removePerson: <ThrowOnError extends boolean = false>(options: Options<RemovePersonData, ThrowOnError>) => RequestResult<RemovePersonResponses, RemovePersonErrors, ThrowOnError>;
24
+ export declare const prepareTeam: <ThrowOnError extends boolean = false>(options?: Options<PrepareTeamData, ThrowOnError>) => RequestResult<PrepareTeamResponses, PrepareTeamErrors, ThrowOnError>;
25
+ export declare const setPersonRole: <ThrowOnError extends boolean = false>(options: Options<SetPersonRoleData, ThrowOnError>) => RequestResult<SetPersonRoleResponses, SetPersonRoleErrors, ThrowOnError>;
26
+ export declare const listInvitations: <ThrowOnError extends boolean = false>(options?: Options<ListInvitationsData, ThrowOnError>) => RequestResult<ListInvitationsResponses, ListInvitationsErrors, ThrowOnError>;
27
+ export declare const createInvitation: <ThrowOnError extends boolean = false>(options: Options<CreateInvitationData, ThrowOnError>) => RequestResult<CreateInvitationResponses, CreateInvitationErrors, ThrowOnError>;
28
+ export declare const revokeInvitation: <ThrowOnError extends boolean = false>(options: Options<RevokeInvitationData, ThrowOnError>) => RequestResult<RevokeInvitationResponses, RevokeInvitationErrors, ThrowOnError>;
@@ -0,0 +1,107 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from './client.gen.js';
3
+ export const health = (options) => (options?.client ?? client).get({ url: '/_clawscarf/health', ...options });
4
+ export const startLogin = (options) => (options?.client ?? client).get({ url: '/_clawscarf/login', ...options });
5
+ export const completeLogin = (options) => (options.client ?? client).get({ url: '/_clawscarf/callback', ...options });
6
+ export const session = (options) => (options?.client ?? client).get({
7
+ security: [{
8
+ in: 'cookie',
9
+ name: 'clawscarf_session',
10
+ type: 'apiKey'
11
+ }],
12
+ url: '/_clawscarf/session',
13
+ ...options
14
+ });
15
+ export const logout = (options) => (options?.client ?? client).post({
16
+ security: [{
17
+ in: 'cookie',
18
+ name: 'clawscarf_session',
19
+ type: 'apiKey'
20
+ }, { name: 'x-csrf-token', type: 'apiKey' }],
21
+ url: '/_clawscarf/logout',
22
+ ...options
23
+ });
24
+ export const listPeople = (options) => (options?.client ?? client).get({
25
+ security: [{
26
+ in: 'cookie',
27
+ name: 'clawscarf_session',
28
+ type: 'apiKey'
29
+ }],
30
+ url: '/_clawscarf/people',
31
+ ...options
32
+ });
33
+ export const enrollPerson = (options) => (options.client ?? client).post({
34
+ security: [{
35
+ in: 'cookie',
36
+ name: 'clawscarf_session',
37
+ type: 'apiKey'
38
+ }, { name: 'x-csrf-token', type: 'apiKey' }],
39
+ url: '/_clawscarf/people',
40
+ ...options,
41
+ headers: {
42
+ 'Content-Type': 'application/json',
43
+ ...options.headers
44
+ }
45
+ });
46
+ export const removePerson = (options) => (options.client ?? client).delete({
47
+ security: [{
48
+ in: 'cookie',
49
+ name: 'clawscarf_session',
50
+ type: 'apiKey'
51
+ }, { name: 'x-csrf-token', type: 'apiKey' }],
52
+ url: '/_clawscarf/people/{userId}',
53
+ ...options
54
+ });
55
+ export const prepareTeam = (options) => (options?.client ?? client).post({
56
+ security: [{
57
+ in: 'cookie',
58
+ name: 'clawscarf_session',
59
+ type: 'apiKey'
60
+ }, { name: 'x-csrf-token', type: 'apiKey' }],
61
+ url: '/_clawscarf/team',
62
+ ...options
63
+ });
64
+ export const setPersonRole = (options) => (options.client ?? client).put({
65
+ security: [{
66
+ in: 'cookie',
67
+ name: 'clawscarf_session',
68
+ type: 'apiKey'
69
+ }, { name: 'x-csrf-token', type: 'apiKey' }],
70
+ url: '/_clawscarf/people/{userId}/role',
71
+ ...options,
72
+ headers: {
73
+ 'Content-Type': 'application/json',
74
+ ...options.headers
75
+ }
76
+ });
77
+ export const listInvitations = (options) => (options?.client ?? client).get({
78
+ security: [{
79
+ in: 'cookie',
80
+ name: 'clawscarf_session',
81
+ type: 'apiKey'
82
+ }],
83
+ url: '/_clawscarf/invitations',
84
+ ...options
85
+ });
86
+ export const createInvitation = (options) => (options.client ?? client).post({
87
+ security: [{
88
+ in: 'cookie',
89
+ name: 'clawscarf_session',
90
+ type: 'apiKey'
91
+ }, { name: 'x-csrf-token', type: 'apiKey' }],
92
+ url: '/_clawscarf/invitations',
93
+ ...options,
94
+ headers: {
95
+ 'Content-Type': 'application/json',
96
+ ...options.headers
97
+ }
98
+ });
99
+ export const revokeInvitation = (options) => (options.client ?? client).delete({
100
+ security: [{
101
+ in: 'cookie',
102
+ name: 'clawscarf_session',
103
+ type: 'apiKey'
104
+ }, { name: 'x-csrf-token', type: 'apiKey' }],
105
+ url: '/_clawscarf/invitations/{invitationId}',
106
+ ...options
107
+ });