Skip to content

Commit e6d368d

Browse files
committed
Merge branch 'develop' into docs/newsletter-mailchimp-guide
2 parents 28b2377 + ffdec55 commit e6d368d

35 files changed

Lines changed: 1629 additions & 426 deletions

File tree

.changeset/sixty-years-invite.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@medusajs/workflow-engine-inmemory": patch
3+
"@medusajs/workflow-engine-redis": patch
4+
"@medusajs/orchestration": patch
5+
"@medusajs/utils": patch
6+
---
7+
8+
fix(workflow-engine-*): Cleanup expired executions

packages/core/core-flows/src/payment-collection/steps/create-payment-session.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export interface CreatePaymentSessionStepInput {
3838
* Learn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/payment/payment-session#data-property).
3939
*/
4040
data?: Record<string, unknown>
41+
42+
/**
43+
* Holds custom data in key-value pairs.
44+
*/
45+
metadata?: Record<string, unknown>
4146
}
4247

4348
export const createPaymentSessionStepId = "create-payment-session"
@@ -57,6 +62,7 @@ export const createPaymentSessionStep = createStep(
5762
amount: input.amount,
5863
data: input.data ?? {},
5964
context: input.context,
65+
metadata: input.metadata ?? {},
6066
}
6167
)
6268

packages/core/orchestration/src/transaction/datastore/abstract-storage.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export interface IDistributedTransactionStorage {
2121
key: string,
2222
options?: TransactionOptions & { isCancelling?: boolean }
2323
): Promise<TransactionCheckpoint | undefined>
24-
list(): Promise<TransactionCheckpoint[]>
2524
save(
2625
key: string,
2726
data: TransactionCheckpoint,
@@ -56,6 +55,7 @@ export interface IDistributedTransactionStorage {
5655
transaction: DistributedTransactionType,
5756
step: TransactionStep
5857
): Promise<void>
58+
clearExpiredExecutions(): Promise<void>
5959
}
6060

6161
export abstract class DistributedSchedulerStorage
@@ -92,10 +92,6 @@ export abstract class DistributedTransactionStorage
9292
throw new Error("Method 'get' not implemented.")
9393
}
9494

95-
async list(): Promise<TransactionCheckpoint[]> {
96-
throw new Error("Method 'list' not implemented.")
97-
}
98-
9995
async save(
10096
key: string,
10197
data: TransactionCheckpoint,
@@ -149,4 +145,8 @@ export abstract class DistributedTransactionStorage
149145
): Promise<void> {
150146
throw new Error("Method 'clearStepTimeout' not implemented.")
151147
}
148+
149+
async clearExpiredExecutions(): Promise<void> {
150+
throw new Error("Method 'clearExpiredExecutions' not implemented.")
151+
}
152152
}

packages/core/orchestration/src/transaction/datastore/base-in-memory-storage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ export class BaseInMemoryDistributedTransactionStorage extends DistributedTransa
4141
this.storage.set(key, data)
4242
}
4343
}
44+
45+
async clearExpiredExecutions(): Promise<void> {}
4446
}

packages/core/types/src/payment/common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,11 @@ export interface PaymentSessionDTO {
581581
* @expandable
582582
*/
583583
payment?: PaymentDTO
584+
585+
/**
586+
* Holds custom data in key-value pairs.
587+
*/
588+
metadata?: Record<string, unknown>
584589
}
585590

586591
/**

packages/core/types/src/payment/mutations.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BigNumberInput } from "../totals"
2-
import { PaymentCollectionStatus } from "./common"
2+
import { PaymentCollectionStatus, PaymentSessionStatus } from "./common"
33
import {
44
PaymentAccountHolderDTO,
55
PaymentCustomerDTO,
@@ -212,6 +212,11 @@ export interface CreatePaymentSessionDTO {
212212
* Necessary context data for the associated payment provider.
213213
*/
214214
context?: PaymentProviderContext
215+
216+
/**
217+
* Holds custom data in key-value pairs.
218+
*/
219+
metadata?: Record<string, unknown>
215220
}
216221

217222
/**
@@ -238,10 +243,20 @@ export interface UpdatePaymentSessionDTO {
238243
*/
239244
amount: BigNumberInput
240245

246+
/**
247+
* The status of the payment session.
248+
*/
249+
status?: PaymentSessionStatus
250+
241251
/**
242252
* Necessary context data for the associated payment provider.
243253
*/
244254
context?: PaymentProviderContext
255+
256+
/**
257+
* Holds custom data in key-value pairs.
258+
*/
259+
metadata?: Record<string, unknown>
245260
}
246261

247262
/**

packages/core/types/src/payment/provider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,12 @@ export interface AuthorizePaymentOutput extends PaymentProviderOutput {
257257
/**
258258
* The result of updating a payment.
259259
*/
260-
export interface UpdatePaymentOutput extends PaymentProviderOutput {}
260+
export interface UpdatePaymentOutput extends PaymentProviderOutput {
261+
/**
262+
* The status of the payment, which will be stored in the payment session's `status` field.
263+
*/
264+
status?: PaymentSessionStatus
265+
}
261266

262267
/**
263268
* The result of deleting a payment.

0 commit comments

Comments
 (0)