{"record":{"id":"f5274ba83eb5fba5","repo":"jackwener/OpenCLI","slug":"unknown-privacy-privacy-valid-privacy-joi-f5274b","errorCode":null,"errorMessage":"Unknown privacy \"${privacy}\". Valid: ${PRIVACY.join(', ')}","messagePattern":"Unknown privacy \"(.+?)\"\\. Valid: (.+?)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/board-update.js","lineNumber":29,"sourceCode":"  access: 'write',\n  description: 'Update the name, description, or privacy of your board',\n  domain: 'www.pinterest.com',\n  strategy: Strategy.COOKIE,\n  args: [\n    { name: 'board', type: 'string', positional: true, required: true, help: '<username>/<slug>, a board URL, or a numeric board id, e.g. janedoe/my-board' },\n    { name: 'name', type: 'string', default: '', help: 'New board name' },\n    { name: 'description', type: 'string', help: 'New board description (pass \"\" to clear)' },\n    { name: 'privacy', type: 'string', choices: PRIVACY, help: 'New privacy: public or secret' },\n  ],\n  columns: ['boardId', 'name', 'privacy', 'url'],\n  func: async (page, kwargs) => {\n    const { username, slug, path, board: preloadedBoard } = await resolveBoardTarget(page, kwargs.board);\n    const name = String(kwargs.name ?? '').trim();\n    const description = kwargs.description === undefined ? undefined : String(kwargs.description).trim();\n    const privacy = String(kwargs.privacy ?? '').trim();\n\n    if (privacy && !PRIVACY.includes(privacy)) {\n      throw new ArgumentError(`Unknown privacy \"${privacy}\". Valid: ${PRIVACY.join(', ')}`);\n    }\n    if (!name && description === undefined && !privacy) {\n      throw new ArgumentError(\n        'nothing to update',\n        'Pass at least one of --name, --description, or --privacy',\n      );\n    }\n\n    await page.goto(`${PINTEREST_BASE}${path}`);\n    const { boardId } = await resolveBoardId(page, username, slug, path, preloadedBoard);\n\n    const options = { board_id: boardId };\n    if (name) options.name = name;\n    if (description !== undefined) options.description = description;\n    if (privacy) options.privacy = privacy;\n\n    const updated = await pinterestResourceUpdate(page, 'BoardResource', options, path);\n","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/board-update.js#L11-L47","documentation":"The board-update command validates the --privacy argument against the PRIVACY whitelist (e.g. public/secret). Passing any other string raises ArgumentError before any request is made, so no board state is changed.","triggerScenarios":"Running `pinterest board-update <board> --privacy <value>` where value is not exactly one of the PRIVACY entries — e.g. 'private' instead of 'secret', 'Public' with wrong casing, or a truncated value.","commonSituations":"Confusing Pinterest's 'secret' terminology with 'private'; case-sensitivity mistakes in scripts; older scripts using vocabulary from another API.","solutions":["Use one of the valid values listed in the error message exactly (check casing).","Replace 'private' with 'secret' (Pinterest's term for hidden boards).","Omit --privacy entirely if you only want to update name or description.","Validate the value against PRIVACY in your script before invoking the command."],"exampleFix":"// before\nawait cli.boardUpdate('user/board', { privacy: 'private' });\n// after\nawait cli.boardUpdate('user/board', { privacy: 'secret' });","handlingStrategy":"validation","validationCode":"const PRIVACY = ['public', 'secret'];\nif (privacy !== undefined && !PRIVACY.includes(privacy)) {\n  throw new Error(`privacy must be one of ${PRIVACY.join(', ')}, got ${privacy}`);\n}","typeGuard":"function isValidPrivacy(v) {\n  return typeof v === 'string' && ['public', 'secret'].includes(v);\n}","tryCatchPattern":"try {\n  await cli.boardUpdate(board, { privacy });\n} catch (e) {\n  if (/Unknown privacy/.test(e.message)) {\n    console.error('Use exactly:', e.message.split('Valid:')[1].trim());\n  } else throw e;\n}","preventionTips":["Use Pinterest's term 'secret', not 'private'","Match casing exactly as listed in the error","Define privacy values as a constant enum in your scripts","Omit --privacy when not changing visibility"],"tags":["pinterest","invalid-argument","validation","cli"],"backgroundTag":"invalid-argument-value","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}