このコミットが含まれているのは:
@@ -73,8 +73,30 @@ export const validatePostImportSessionId = (value: unknown): string | null => {
|
||||
}
|
||||
|
||||
|
||||
export const generatePostImportSessionId = (): string =>
|
||||
crypto.randomUUID ()
|
||||
const generateUuidV4FromRandomValues = (): string => {
|
||||
const bytes = new Uint8Array (16)
|
||||
crypto.getRandomValues (bytes)
|
||||
bytes[6] = (bytes[6] & 0x0f) | 0x40
|
||||
bytes[8] = (bytes[8] & 0x3f) | 0x80
|
||||
|
||||
const hex = Array.from (
|
||||
bytes,
|
||||
byte => byte.toString (16).padStart (2, '0'))
|
||||
return [
|
||||
hex.slice (0, 4).join (''),
|
||||
hex.slice (4, 6).join (''),
|
||||
hex.slice (6, 8).join (''),
|
||||
hex.slice (8, 10).join (''),
|
||||
hex.slice (10, 16).join ('')].join ('-')
|
||||
}
|
||||
|
||||
|
||||
export const generatePostImportSessionId = (): string => {
|
||||
if (typeof crypto.randomUUID === 'function')
|
||||
return crypto.randomUUID ()
|
||||
|
||||
return generateUuidV4FromRandomValues ()
|
||||
}
|
||||
|
||||
|
||||
const sessionKey = (sessionId: string): string => `${ SESSION_PREFIX }${ sessionId }`
|
||||
@@ -156,7 +178,10 @@ const ensureStringListRecord = (value: unknown): Record<string, string[]> | null
|
||||
const isValidStatus = (
|
||||
value: unknown,
|
||||
): value is PostImportRow['status'] =>
|
||||
value === 'ready' || value === 'warning' || value === 'error'
|
||||
value === 'pending'
|
||||
|| value === 'ready'
|
||||
|| value === 'warning'
|
||||
|| value === 'error'
|
||||
|
||||
|
||||
const isValidImportStatus = (
|
||||
|
||||
@@ -34,7 +34,7 @@ export type PostImportRow = {
|
||||
importErrors?: Record<string, string[]>
|
||||
provenance: Record<string, PostImportOrigin>
|
||||
tagSources?: Record<PostImportOrigin, string>
|
||||
status: 'ready' | 'warning' | 'error'
|
||||
status: 'pending' | 'ready' | 'warning' | 'error'
|
||||
skipReason?: PostImportSkipReason
|
||||
existingPostId?: number
|
||||
existingPost?: PostImportExistingPost
|
||||
|
||||
@@ -344,7 +344,7 @@ const buildRow = (state: FullRowState): PostImportRow => {
|
||||
validationErrors: { },
|
||||
provenance,
|
||||
tagSources,
|
||||
status: 'ready',
|
||||
status: 'pending',
|
||||
skipReason: state.skip ?? undefined,
|
||||
existingPostId: state.existing_post_id ?? undefined,
|
||||
resetSnapshot: {
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする