backend changes

This commit is contained in:
Aiden McClelland
2025-07-22 16:48:16 -06:00
parent 4d9709eb1c
commit d3e7e37f59
28 changed files with 211 additions and 162 deletions

View File

@@ -133,6 +133,7 @@ export class ActionInputModal {
readonly warning = this.context.data.actionInfo.metadata.warning
readonly pkgInfo = this.context.data.pkgInfo
readonly requestInfo = this.context.data.requestInfo
eventId: string | null = null
buttons: ActionButton<any>[] = [
{
@@ -151,6 +152,7 @@ export class ActionInputModal {
).pipe(
map(res => {
const originalValue = res.value || {}
this.eventId = res.eventId
return {
spec: res.spec,
@@ -174,7 +176,12 @@ export class ActionInputModal {
async execute(input: object) {
if (await this.checkConflicts(input)) {
await this.actionService.execute(this.pkgInfo.id, this.actionId, input)
await this.actionService.execute(
this.pkgInfo.id,
this.eventId,
this.actionId,
input,
)
this.context.$implicit.complete()
}
}

View File

@@ -67,9 +67,9 @@ export class ActionService {
},
})
.pipe(filter(Boolean))
.subscribe(() => this.execute(pkgInfo.id, actionInfo.id))
.subscribe(() => this.execute(pkgInfo.id, null, actionInfo.id))
} else {
this.execute(pkgInfo.id, actionInfo.id)
this.execute(pkgInfo.id, null, actionInfo.id)
}
}
} else {
@@ -96,14 +96,20 @@ export class ActionService {
}
}
async execute(packageId: string, actionId: string, input?: object) {
async execute(
packageId: string,
eventId: string | null,
actionId: string,
input?: object,
) {
const loader = this.loader.open('Loading').subscribe()
try {
const res = await this.api.runAction({
packageId,
eventId,
actionId,
input: input || null,
input: input ?? null,
})
if (!res) return

View File

@@ -347,12 +347,14 @@ export namespace RR {
export type GetActionInputReq = { packageId: string; actionId: string } // package.action.get-input
export type GetActionInputRes = {
eventId: string
spec: IST.InputSpec
value: object | null
}
export type ActionReq = {
packageId: string
eventId: string | null
actionId: string
input: object | null
} // package.action.run

View File

@@ -1108,6 +1108,7 @@ export class MockApiService extends ApiService {
): Promise<RR.GetActionInputRes> {
await pauseFor(2000)
return {
eventId: 'ANZXNWIFRTTBZ6T52KQPZILIQQODDHXQ',
value: Mock.MockConfig,
spec: await Mock.getActionInputSpec(),
}