@ricsam/r5d-api 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,6 +42,8 @@ Trusted server-side callers that authenticate through custom headers, such as a
42
42
  - `auth.status()`
43
43
  - `auth.logout()`
44
44
  - `auth.apiKeys.create/list/revoke`
45
+ - `processes.list({ project?, branch?, session?, worker? })`
46
+ - `processes.stop(runId)`
45
47
  - `projects.list()`
46
48
  - `projects.create({ name?, orgId? })`
47
49
  - `projects.describe(projectRef)`
@@ -160,6 +160,18 @@ class R5dctlClient {
160
160
  })
161
161
  }
162
162
  };
163
+ processes = {
164
+ list: (input = {}) => this.request({
165
+ method: "GET",
166
+ path: "/api/r5dctl/processes",
167
+ query: input
168
+ }),
169
+ stop: (runId) => this.request({
170
+ method: "POST",
171
+ path: `/api/r5dctl/processes/${encodeURIComponent(runId)}/stop`,
172
+ body: {}
173
+ })
174
+ };
163
175
  projects = {
164
176
  list: () => this.request({
165
177
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "commonjs"
5
5
  }
@@ -136,6 +136,18 @@ class R5dctlClient {
136
136
  })
137
137
  }
138
138
  };
139
+ processes = {
140
+ list: (input = {}) => this.request({
141
+ method: "GET",
142
+ path: "/api/r5dctl/processes",
143
+ query: input
144
+ }),
145
+ stop: (runId) => this.request({
146
+ method: "POST",
147
+ path: `/api/r5dctl/processes/${encodeURIComponent(runId)}/stop`,
148
+ body: {}
149
+ })
150
+ };
139
151
  projects = {
140
152
  list: () => this.request({
141
153
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "module"
5
5
  }
@@ -49,7 +49,6 @@ export type R5dctlPendingQuestion = {
49
49
  options: R5dctlPendingQuestionOption[];
50
50
  };
51
51
  export type R5dctlRequiredEnv = {
52
- target: "backend" | "frontend";
53
52
  name: string;
54
53
  optional: boolean;
55
54
  description: string;
@@ -148,16 +147,41 @@ export type R5dctlApiKey = {
148
147
  createdAt: string;
149
148
  lastUsedAt: string | null;
150
149
  };
150
+ export type R5dctlProcessRunStatus = "starting" | "running" | "exited" | "cancelled" | "failed";
151
+ export type R5dctlProcessRun = {
152
+ runId: string;
153
+ projectId: string;
154
+ projectPath: string;
155
+ sessionId: string;
156
+ branchName: string;
157
+ workerLabel: string;
158
+ argv: string[];
159
+ command: string;
160
+ cwd?: string;
161
+ status: R5dctlProcessRunStatus;
162
+ startedAt: string;
163
+ updatedAt: string;
164
+ logPath: string;
165
+ stdoutBytes: number;
166
+ stderrBytes: number;
167
+ cancelRequested: boolean;
168
+ error?: string;
169
+ };
170
+ export type R5dctlProcessListInput = {
171
+ project?: string;
172
+ branch?: string;
173
+ session?: string;
174
+ worker?: string;
175
+ };
151
176
  export type R5dctlProjectUpdateInput = {
152
177
  mode?: "greenfield" | "prod";
153
178
  };
154
- export type R5dctlEnvTarget = "backend" | "frontend";
155
179
  export type R5dctlEnvValue = {
156
180
  optional?: boolean;
157
181
  description: string;
158
182
  value: string | null;
159
183
  };
160
- export type R5dctlEnvData = Partial<Record<R5dctlEnvTarget, Record<string, R5dctlEnvValue>>>;
184
+ export type R5dctlEnvData = Record<string, R5dctlEnvValue>;
161
185
  export type R5dctlSessionCreateInput = {
162
186
  name?: string;
163
187
  branchName: string;
@@ -223,6 +247,10 @@ export declare class R5dctlClient {
223
247
  }>;
224
248
  };
225
249
  };
250
+ readonly processes: {
251
+ list: (input?: R5dctlProcessListInput) => Promise<R5dctlProcessRun[]>;
252
+ stop: (runId: string) => Promise<R5dctlProcessRun>;
253
+ };
226
254
  readonly projects: {
227
255
  list: () => Promise<R5dctlProject[]>;
228
256
  describe: (projectRef: string) => Promise<R5dctlProjectDescription>;
@@ -239,7 +267,7 @@ export declare class R5dctlClient {
239
267
  }>;
240
268
  };
241
269
  env: {
242
- get: (projectId: string, branchName: string) => Promise<Partial<Record<R5dctlEnvTarget, Record<string, R5dctlEnvValue>>>>;
270
+ get: (projectId: string, branchName: string) => Promise<R5dctlEnvData>;
243
271
  update: (projectId: string, branchName: string, input: R5dctlEnvData) => Promise<{
244
272
  success: boolean;
245
273
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/index.cjs",
6
6
  "module": "./dist/mjs/index.mjs",