feat: sync implementation for the user entity (#16234)

* ci: print out typeorm generation changes

* feat: sync implementation for the user entity

wip

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
Zack Pollard 2025-02-21 04:37:57 +00:00 committed by GitHub
parent 02cd8da871
commit ac36effb45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 1774 additions and 10 deletions

View file

@ -5802,6 +5802,107 @@
]
}
},
"/sync/ack": {
"delete": {
"operationId": "deleteSyncAck",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SyncAckDeleteDto"
}
}
},
"required": true
},
"responses": {
"204": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Sync"
]
},
"get": {
"operationId": "getSyncAck",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/SyncAckDto"
},
"type": "array"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Sync"
]
},
"post": {
"operationId": "sendSyncAck",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SyncAckSetDto"
}
}
},
"required": true
},
"responses": {
"204": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Sync"
]
}
},
"/sync/delta-sync": {
"post": {
"operationId": "getDeltaSync",
@ -5889,6 +5990,41 @@
]
}
},
"/sync/stream": {
"post": {
"operationId": "getSyncStream",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SyncStreamDto"
}
}
},
"required": true
},
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Sync"
]
}
},
"/system-config": {
"get": {
"operationId": "getConfig",
@ -11696,6 +11832,113 @@
},
"type": "object"
},
"SyncAckDeleteDto": {
"properties": {
"types": {
"items": {
"$ref": "#/components/schemas/SyncEntityType"
},
"type": "array"
}
},
"type": "object"
},
"SyncAckDto": {
"properties": {
"ack": {
"type": "string"
},
"type": {
"allOf": [
{
"$ref": "#/components/schemas/SyncEntityType"
}
]
}
},
"required": [
"ack",
"type"
],
"type": "object"
},
"SyncAckSetDto": {
"properties": {
"acks": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"acks"
],
"type": "object"
},
"SyncEntityType": {
"enum": [
"UserV1",
"UserDeleteV1"
],
"type": "string"
},
"SyncRequestType": {
"enum": [
"UsersV1"
],
"type": "string"
},
"SyncStreamDto": {
"properties": {
"types": {
"items": {
"$ref": "#/components/schemas/SyncRequestType"
},
"type": "array"
}
},
"required": [
"types"
],
"type": "object"
},
"SyncUserDeleteV1": {
"properties": {
"userId": {
"type": "string"
}
},
"required": [
"userId"
],
"type": "object"
},
"SyncUserV1": {
"properties": {
"deletedAt": {
"format": "date-time",
"nullable": true,
"type": "string"
},
"email": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"deletedAt",
"email",
"id",
"name"
],
"type": "object"
},
"SystemConfigBackupsDto": {
"properties": {
"database": {

View file

@ -1104,6 +1104,16 @@ export type StackCreateDto = {
export type StackUpdateDto = {
primaryAssetId?: string;
};
export type SyncAckDeleteDto = {
types?: SyncEntityType[];
};
export type SyncAckDto = {
ack: string;
"type": SyncEntityType;
};
export type SyncAckSetDto = {
acks: string[];
};
export type AssetDeltaSyncDto = {
updatedAfter: string;
userIds: string[];
@ -1119,6 +1129,9 @@ export type AssetFullSyncDto = {
updatedUntil: string;
userId?: string;
};
export type SyncStreamDto = {
types: SyncRequestType[];
};
export type DatabaseBackupConfig = {
cronExpression: string;
enabled: boolean;
@ -2912,6 +2925,32 @@ export function updateStack({ id, stackUpdateDto }: {
body: stackUpdateDto
})));
}
export function deleteSyncAck({ syncAckDeleteDto }: {
syncAckDeleteDto: SyncAckDeleteDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/sync/ack", oazapfts.json({
...opts,
method: "DELETE",
body: syncAckDeleteDto
})));
}
export function getSyncAck(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: SyncAckDto[];
}>("/sync/ack", {
...opts
}));
}
export function sendSyncAck({ syncAckSetDto }: {
syncAckSetDto: SyncAckSetDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/sync/ack", oazapfts.json({
...opts,
method: "POST",
body: syncAckSetDto
})));
}
export function getDeltaSync({ assetDeltaSyncDto }: {
assetDeltaSyncDto: AssetDeltaSyncDto;
}, opts?: Oazapfts.RequestOpts) {
@ -2936,6 +2975,15 @@ export function getFullSyncForUser({ assetFullSyncDto }: {
body: assetFullSyncDto
})));
}
export function getSyncStream({ syncStreamDto }: {
syncStreamDto: SyncStreamDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/sync/stream", oazapfts.json({
...opts,
method: "POST",
body: syncStreamDto
})));
}
export function getConfig(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
@ -3548,6 +3596,13 @@ export enum Error2 {
NoPermission = "no_permission",
NotFound = "not_found"
}
export enum SyncEntityType {
UserV1 = "UserV1",
UserDeleteV1 = "UserDeleteV1"
}
export enum SyncRequestType {
UsersV1 = "UsersV1"
}
export enum TranscodeHWAccel {
Nvenc = "nvenc",
Qsv = "qsv",