Upgrade deps (#5850)

This commit is contained in:
Elias Nahum
2021-11-29 23:19:39 +02:00
committed by GitHub
parent 5419758a5f
commit 42f193c70c
42 changed files with 3117 additions and 4486 deletions

View File

@@ -43,7 +43,7 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
createOrUpdateRawValues: getUniqueRawsBy({raws: roles, key: 'id'}),
tableName: ROLE,
}) as Promise<RoleModel[]>;
}
};
handleCustomEmojis = ({emojis, prepareRecordsOnly = true}: HandleCustomEmojiArgs) => {
if (!emojis.length) {
@@ -60,7 +60,7 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
createOrUpdateRawValues: getUniqueRawsBy({raws: emojis, key: 'name'}),
tableName: CUSTOM_EMOJI,
}) as Promise<CustomEmojiModel[]>;
}
};
handleSystem = ({systems, prepareRecordsOnly = true}: HandleSystemArgs) => {
if (!systems.length) {
@@ -77,7 +77,7 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
createOrUpdateRawValues: getUniqueRawsBy({raws: systems, key: 'id'}),
tableName: SYSTEM,
}) as Promise<SystemModel[]>;
}
};
handleTermOfService = ({termOfService, prepareRecordsOnly = true}: HandleTOSArgs) => {
if (!termOfService.length) {
@@ -94,29 +94,29 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
createOrUpdateRawValues: getUniqueRawsBy({raws: termOfService, key: 'id'}),
tableName: TERMS_OF_SERVICE,
}) as Promise<TermsOfServiceModel[]>;
}
};
/**
* execute: Handles the Create/Update operations on an table.
* @param {OperationArgs} execute
* @param {string} execute.tableName
* @param {RecordValue[]} execute.createRaws
* @param {RecordValue[]} execute.updateRaws
* @param {(TransformerArgs) => Promise<Model>} execute.recordOperator
* @returns {Promise<void>}
*/
execute = async ({createRaws, transformer, tableName, updateRaws}: OperationArgs): Promise<Model[]> => {
const models = await this.prepareRecords({
tableName,
createRaws,
updateRaws,
transformer,
});
/**
* execute: Handles the Create/Update operations on an table.
* @param {OperationArgs} execute
* @param {string} execute.tableName
* @param {RecordValue[]} execute.createRaws
* @param {RecordValue[]} execute.updateRaws
* @param {(TransformerArgs) => Promise<Model>} execute.recordOperator
* @returns {Promise<void>}
*/
execute = async ({createRaws, transformer, tableName, updateRaws}: OperationArgs): Promise<Model[]> => {
const models = await this.prepareRecords({
tableName,
createRaws,
updateRaws,
transformer,
});
if (models?.length > 0) {
await this.batchRecords(models);
}
if (models?.length > 0) {
await this.batchRecords(models);
}
return models;
};
return models;
};
}

View File

@@ -200,7 +200,7 @@ const PostHandler = (superclass: any) => class extends superclass {
if (batch.length) {
await this.batchRecords(batch);
}
}
};
/**
* handleFiles: Handler responsible for the Create/Update operations occurring on the File table from the 'Server' schema

View File

@@ -54,7 +54,7 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
}
return result;
}
};
handleReceivedPostsInChannel = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
if (!posts.length) {
@@ -168,11 +168,11 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
handleReceivedPostsInChannelBefore = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
throw new Error(`handleReceivedPostsInChannelBefore Not implemented yet. posts count${posts.length} prepareRecordsOnly=${prepareRecordsOnly}`);
}
};
handleReceivedPostsInChannelAfter = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
throw new Error(`handleReceivedPostsInChannelAfter Not implemented yet. posts count${posts.length} prepareRecordsOnly=${prepareRecordsOnly}`);
}
};
handleReceivedPostForChannel = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
if (!posts.length) {
@@ -221,7 +221,7 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
}
return targetChunk;
}
};
};
export default PostsInChannelHandler;