feat(medusa, medusa-js, medusa-react): PublishableApiKey "update" endpoint & add "title" property (#2609)

**What**
- update PK endpoint
  - medusa-js/react implementation
- add a title property to the entity
  - update the migration file
  - pass a title on create
  - list PKs by title
  - update the client libs with new param signatures
- change id prefix to: "pk_"
This commit is contained in:
Frane Polić
2022-11-16 04:35:22 +00:00
committed by GitHub
parent ccfc5f666d
commit 03fc9e18e9
17 changed files with 390 additions and 30 deletions
@@ -17,9 +17,12 @@ export class PublishableApiKey extends BaseEntity {
@Column({ type: resolveDbType("timestamptz"), nullable: true })
revoked_at?: Date
@Column()
title: string
@BeforeInsert()
private beforeInsert(): void {
this.id = generateEntityId(this.id, "pubkey")
this.id = generateEntityId(this.id, "pk")
}
}
@@ -32,7 +35,7 @@ export class PublishableApiKey extends BaseEntity {
* id:
* type: string
* description: The key's ID
* example: pak_01G1G5V27GYX4QXNARRQCW1N8T
* example: pk_01G1G5V27GYX4QXNARRQCW1N8T
* created_by:
* type: string
* description: "The unique identifier of the user that created the key."